comparison configure.in @ 29899:19caebb8eb1f

[HAVE_TIMEVAL]: Move gettimeofday test here, test for struct timezone and test how we can call gettimeofday.
author Dave Love <fx@gnu.org>
date Fri, 23 Jun 2000 15:30:19 +0000
parents 507584616639
children f660cfaca2db
comparison
equal deleted inserted replaced
29898:8f071fd1161d 29899:19caebb8eb1f
258 GCC_LINK_TEST_OPTIONS=-Wl,-rpath,/usr/X11R6/lib 258 GCC_LINK_TEST_OPTIONS=-Wl,-rpath,/usr/X11R6/lib
259 case "${canonical}" in 259 case "${canonical}" in
260 # This is necessary on 5.0 to avoid mangling src/Makefile. 260 # This is necessary on 5.0 to avoid mangling src/Makefile.
261 # Separated out in case it causes problems on earlier versions. 261 # Separated out in case it causes problems on earlier versions.
262 alpha*-dec-osf[5-9]*) 262 alpha*-dec-osf[5-9]*)
263 opsys=osf5-0
263 NON_GNU_CPP='cpp' ;; 264 NON_GNU_CPP='cpp' ;;
264 esac 265 esac
265 ;; 266 ;;
266 267
267 alpha*-*-linux-gnu* ) 268 alpha*-*-linux-gnu* )
1156 AC_CHECK_HEADERS(machine/soundcard.h sys/soundcard.h) 1157 AC_CHECK_HEADERS(machine/soundcard.h sys/soundcard.h)
1157 1158
1158 dnl checks for header files 1159 dnl checks for header files
1159 AC_CHECK_HEADERS(sys/select.h sys/timeb.h sys/time.h unistd.h utime.h \ 1160 AC_CHECK_HEADERS(sys/select.h sys/timeb.h sys/time.h unistd.h utime.h \
1160 linux/version.h sys/systeminfo.h termios.h limits.h string.h stdlib.h \ 1161 linux/version.h sys/systeminfo.h termios.h limits.h string.h stdlib.h \
1161 termcap.h stdio_ext.h fcntl.h) 1162 termcap.h stdio_ext.h fcntl.h term.h)
1162 AC_HEADER_STDC 1163 AC_HEADER_STDC
1163 AC_HEADER_TIME 1164 AC_HEADER_TIME
1164 AC_DECL_SYS_SIGLIST 1165 AC_DECL_SYS_SIGLIST
1165 1166
1166 dnl Some systems have utime.h but don't declare the struct anyplace. 1167 dnl Some systems have utime.h but don't declare the struct anyplace.
1864 else : 1865 else :
1865 fi 1866 fi
1866 AC_CHECK_FUNCS(touchlock) 1867 AC_CHECK_FUNCS(touchlock)
1867 AC_CHECK_HEADERS(maillock.h) 1868 AC_CHECK_HEADERS(maillock.h)
1868 1869
1869 AC_CHECK_FUNCS(gettimeofday gethostname getdomainname dup2 \ 1870 AC_CHECK_FUNCS(gethostname getdomainname dup2 \
1870 rename closedir mkdir rmdir sysinfo \ 1871 rename closedir mkdir rmdir sysinfo \
1871 random lrand48 bcopy bcmp logb frexp fmod rint cbrt ftime res_init setsid \ 1872 random lrand48 bcopy bcmp logb frexp fmod rint cbrt ftime res_init setsid \
1872 strerror fpathconf select mktime euidaccess getpagesize tzset setlocale \ 1873 strerror fpathconf select mktime euidaccess getpagesize tzset setlocale \
1873 utimes setrlimit setpgid getcwd getwd shutdown strftime getaddrinfo \ 1874 utimes setrlimit setpgid getcwd getwd shutdown strftime getaddrinfo \
1874 __fpending mblen mbrlen strsignal setitimer ualarm) 1875 __fpending mblen mbrlen strsignal setitimer ualarm)
1969 if test $emacs_cv_localtime_cache = yes; then 1970 if test $emacs_cv_localtime_cache = yes; then
1970 AC_DEFINE(LOCALTIME_CACHE) 1971 AC_DEFINE(LOCALTIME_CACHE)
1971 fi 1972 fi
1972 1973
1973 if test "x$HAVE_TIMEVAL" = xyes; then 1974 if test "x$HAVE_TIMEVAL" = xyes; then
1974 AC_CACHE_CHECK(whether gettimeofday can accept two arguments, 1975 AC_CHECK_FUNCS(gettimeofday)
1975 emacs_cv_gettimeofday_two_arguments, 1976 AC_CACHE_CHECK(whether gettimeofday can accept two arguments,
1976 AC_TRY_LINK([ 1977 emacs_cv_gettimeofday_two_arguments,
1978 AC_TRY_COMPILE([
1977 #ifdef TIME_WITH_SYS_TIME 1979 #ifdef TIME_WITH_SYS_TIME
1978 #include <sys/time.h> 1980 #include <sys/time.h>
1979 #include <time.h> 1981 #include <time.h>
1980 #else 1982 #else
1981 #ifdef HAVE_SYS_TIME_H 1983 #ifdef HAVE_SYS_TIME_H
1982 #include <sys/time.h> 1984 #include <sys/time.h>
1983 #else 1985 #else
1984 #include <time.h> 1986 #include <time.h>
1985 #endif 1987 #endif
1986 #endif], 1988 #endif],
1987 [struct timeval time; 1989 [struct timeval time;
1988 gettimeofday (&time, 0);], 1990 gettimeofday (&time, 0);],
1989 emacs_cv_gettimeofday_two_arguments=yes, 1991 emacs_cv_gettimeofday_two_arguments=yes,
1990 emacs_cv_gettimeofday_two_arguments=no)) 1992 emacs_cv_gettimeofday_two_arguments=no))
1991 if test $emacs_cv_gettimeofday_two_arguments = no; then 1993 if test $emacs_cv_gettimeofday_two_arguments = no; then
1992 AC_DEFINE(GETTIMEOFDAY_ONE_ARGUMENT) 1994 AC_DEFINE(GETTIMEOFDAY_ONE_ARGUMENT)
1993 fi 1995 fi
1996 fi
1997
1998 dnl Note that AC_STRUCT_TIMEZONE doesn't do what you might expect.
1999 if test "$ac_cv_func_gettimeofday" = yes; then
2000 AC_CACHE_CHECK([for struct timezone], emacs_cv_struct_timezone,
2001 [AC_TRY_COMPILE([#include <sys/time.h>],
2002 [struct timezone tz;],
2003 dnl It may be that we can't call gettimeofday with a non-null pointer,
2004 dnl even though we have struct timezone (e.g. HPUX). In that case
2005 dnl we'll lie about struct timezone.
2006 [AC_TRY_RUN([
2007 #ifdef TIME_WITH_SYS_TIME
2008 #include <sys/time.h>
2009 #include <time.h>
2010 #else
2011 #ifdef HAVE_SYS_TIME_H
2012 #include <sys/time.h>
2013 #else
2014 #include <time.h>
2015 #endif
2016 #endif
2017 main () {
2018 struct timeval time;
2019 struct timezone dummy;
2020 exit (gettimeofday (&time, &dummy));
2021 }],
2022 emacs_cv_struct_timezone=yes,
2023 emacs_cv_struct_timezone=no, emacs_cv_struct_timezone=yes)],
2024 emacs_cv_struct_timezone=no)])
1994 fi 2025 fi
1995 2026
1996 ok_so_far=yes 2027 ok_so_far=yes
1997 AC_CHECK_FUNC(socket, , ok_so_far=no) 2028 AC_CHECK_FUNC(socket, , ok_so_far=no)
1998 if test $ok_so_far = yes; then 2029 if test $ok_so_far = yes; then