2 dnl * If we have gettimeofday;
3 dnl * If we have struct timezone for use in calling it;
4 dnl * If calling it with a timezone pointer actually works -- this is deemed
5 dnl obsolete or undefined on some systems which say you should use a null
6 dnl pointer -- and undefine HAVE_TIMEZONE if so;
7 dnl * Whether it only takes one arg.
8 AC_DEFUN([LIBGFOR_GETTIMEOFDAY], [
9 AC_CHECK_FUNCS(gettimeofday)
10 if test "$ac_cv_func_gettimeofday" = yes; then
11 AC_CACHE_CHECK([for struct timezone], gfor_cv_struct_timezone,
12 [AC_TRY_COMPILE([#include <sys/time.h>],
13 [struct timezone tz;],
14 gfor_cv_struct_timezone=yes, gfor_cv_struct_timezone=no)])
15 if test $gfor_cv_struct_timezone = yes; then
16 dnl It may be that we can't call gettimeofday with a non-null pointer.
17 dnl In that case we'll lie about struct timezone.
19 #ifdef TIME_WITH_SYS_TIME
23 #ifdef HAVE_SYS_TIME_H
32 struct timezone dummy;
33 if (gettimeofday (&time, &dummy))
38 [gfor_have_struct_timezone=yes], [gfor_have_struct_timezone=no],
39 [gfor_have_struct_timezone=yes])
40 if test $gfor_have_struct_timezone = yes; then
41 AC_DEFINE(HAVE_TIMEZONE, 1, [Do we have struct timezone])
44 AC_REQUIRE([AC_HEADER_TIME])
45 AC_CACHE_CHECK(whether gettimeofday can accept two arguments,
46 emacs_cv_gettimeofday_two_arguments,
48 #ifdef TIME_WITH_SYS_TIME
52 #ifdef HAVE_SYS_TIME_H
62 struct timezone dummy;
67 gettimeofday (&time, DUMMY);],
68 emacs_cv_gettimeofday_two_arguments=yes,
69 emacs_cv_gettimeofday_two_arguments=no))
70 if test $emacs_cv_gettimeofday_two_arguments = no; then
71 AC_DEFINE(GETTIMEOFDAY_ONE_ARGUMENT, 1,
72 [Does gettimeofday take a single argument])
76 sinclude(../libtool.m4)
77 dnl The lines below arrange for aclocal not to bring an installed
78 dnl libtool.m4 into aclocal.m4, while still arranging for automake to
79 dnl add a definition of LIBTOOL to Makefile.in.
80 ifelse(,,,[AC_SUBST(LIBTOOL)
81 AC_DEFUN([AM_PROG_LIBTOOL])
82 AC_DEFUN([AC_LIBTOOL_DLOPEN])
83 AC_DEFUN([AC_PROG_LD])