+# checking whether 8 bit clean or not
+AC_CACHE_CHECK([whether strchr()/strrchr() is 8bit clean],
+ [lha_cv_func_strchr_8bit_clean],
+ AC_TRY_RUN([
+#if STDC_HEADERS
+# include <string.h>
+#else
+# if !HAVE_STRCHR
+# define strchr index
+# define strrchr rindex
+# endif
+char *strchr (), *strrchr ();
+#endif
+
+main()
+{
+ char *s = "\377";
+ if (strchr(s, 0xff) != s) exit(1);
+ if (strchr(s, '\377') != s) exit(1);
+ if (strrchr(s, 0xff) != s) exit(1);
+ if (strrchr(s, '\377') != s) exit(1);
+ exit(0); /* ok */
+}
+], lha_cv_func_strchr_8bit_clean=yes,
+ lha_cv_func_strchr_8bit_clean=no,
+ lha_cv_func_strchr_8bit_clean=no))
+
+if test x$lha_cv_func_strchr_8bit_clean = xyes; then
+ AC_DEFINE(STRCHR_8BIT_CLEAN, 1,
+ [Define to 1 if strchr()/strrchr() works correctly.])
+fi
+
+# checking whether the 2nd argument of gettimeofday() is effective or not.
+# note that this timezone argument is obsolete.
+AC_CACHE_CHECK([whether the 2nd argument of gettimeofday() is effective],
+ [lha_cv_func_gettimeofday_2nd_arg],
+ AC_TRY_RUN([
+#if TIME_WITH_SYS_TIME
+# include <sys/time.h>
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+# include <sys/time.h>
+# else
+# include <time.h>
+# endif
+#endif
+
+main()
+{
+ struct timeval tv;
+ struct timezone tz;
+
+ tz.tz_minuteswest = -1;
+ if (gettimeofday(&tv, &tz) == -1)
+ exit(1);
+
+ if (tz.tz_minuteswest == -1)
+ exit(1); /* the timezone information is no given */
+
+ exit(0);
+}], lha_cv_func_gettimeofday_2nd_arg=yes,
+ lha_cv_func_gettimeofday_2nd_arg=no,
+ lha_cv_func_gettimeofday_2nd_arg=no))
+
+if test x$lha_cv_func_gettimeofday_2nd_arg = xyes; then
+ AC_DEFINE(GETTIMEOFDAY_HAS_2ND_ARG, 1,
+ [Define to 1 if the 2nd argument of gettimeofday() is effective.])
+fi
+