aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Love2000-06-23 15:30:19 +0000
committerDave Love2000-06-23 15:30:19 +0000
commit8a2c23285e8e7e5860dbc7cf7b5f689f646c077b (patch)
treedb7c9597b2a6913d84d335053417977ab77e8d7c
parent04f9dc47975a470b9708f0dccb84e77c74afbafa (diff)
downloademacs-8a2c23285e8e7e5860dbc7cf7b5f689f646c077b.tar.gz
emacs-8a2c23285e8e7e5860dbc7cf7b5f689f646c077b.zip
[HAVE_TIMEVAL]: Move gettimeofday test here, test for struct timezone
and test how we can call gettimeofday.
-rw-r--r--configure.in49
1 files changed, 40 insertions, 9 deletions
diff --git a/configure.in b/configure.in
index 6200d4ae392..a7a3e3a9a5a 100644
--- a/configure.in
+++ b/configure.in
@@ -260,6 +260,7 @@ 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 ;;
@@ -1158,7 +1159,7 @@ AC_CHECK_HEADERS(machine/soundcard.h sys/soundcard.h)
1158dnl checks for header files 1159dnl checks for header files
1159AC_CHECK_HEADERS(sys/select.h sys/timeb.h sys/time.h unistd.h utime.h \ 1160AC_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)
1162AC_HEADER_STDC 1163AC_HEADER_STDC
1163AC_HEADER_TIME 1164AC_HEADER_TIME
1164AC_DECL_SYS_SIGLIST 1165AC_DECL_SYS_SIGLIST
@@ -1866,7 +1867,7 @@ fi
1866AC_CHECK_FUNCS(touchlock) 1867AC_CHECK_FUNCS(touchlock)
1867AC_CHECK_HEADERS(maillock.h) 1868AC_CHECK_HEADERS(maillock.h)
1868 1869
1869AC_CHECK_FUNCS(gettimeofday gethostname getdomainname dup2 \ 1870AC_CHECK_FUNCS(gethostname getdomainname dup2 \
1870rename closedir mkdir rmdir sysinfo \ 1871rename closedir mkdir rmdir sysinfo \
1871random lrand48 bcopy bcmp logb frexp fmod rint cbrt ftime res_init setsid \ 1872random lrand48 bcopy bcmp logb frexp fmod rint cbrt ftime res_init setsid \
1872strerror fpathconf select mktime euidaccess getpagesize tzset setlocale \ 1873strerror fpathconf select mktime euidaccess getpagesize tzset setlocale \
@@ -1971,9 +1972,10 @@ if test $emacs_cv_localtime_cache = yes; then
1971fi 1972fi
1972 1973
1973if test "x$HAVE_TIMEVAL" = xyes; then 1974if test "x$HAVE_TIMEVAL" = xyes; then
1974AC_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,
1976AC_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>
@@ -1984,15 +1986,44 @@ AC_TRY_LINK([
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
1994fi 1996fi
1995 1997
1998dnl Note that AC_STRUCT_TIMEZONE doesn't do what you might expect.
1999if 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
2017main () {
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)])
2025fi
2026
1996ok_so_far=yes 2027ok_so_far=yes
1997AC_CHECK_FUNC(socket, , ok_so_far=no) 2028AC_CHECK_FUNC(socket, , ok_so_far=no)
1998if test $ok_so_far = yes; then 2029if test $ok_so_far = yes; then