X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=m4%2Fsys_time_h.m4;h=b38e1bc5f1a38dd14fa56367f3e90708226ebaf6;hb=d77c9cd8c648ec0943a951c48b181651ae00421b;hp=4387cd87def48ac29ab0be6b18da851a895371b1;hpb=5661ab9d49512b4cf3c19caa11bb581d8ce561ba;p=gnulib.git diff --git a/m4/sys_time_h.m4 b/m4/sys_time_h.m4 index 4387cd87d..b38e1bc5f 100644 --- a/m4/sys_time_h.m4 +++ b/m4/sys_time_h.m4 @@ -9,6 +9,14 @@ AC_DEFUN([gl_HEADER_SYS_TIME_H], [ + dnl Use AC_REQUIRE here, so that the REPLACE_GETTIMEOFDAY=0 statement + dnl below is expanded once only, before all REPLACE_GETTIMEOFDAY=1 + dnl statements that occur in other macros. + AC_REQUIRE([gl_HEADER_SYS_TIME_H_BODY]) +]) + +AC_DEFUN([gl_HEADER_SYS_TIME_H_BODY], +[ AC_REQUIRE([AC_C_RESTRICT]) AC_CHECK_HEADERS_ONCE([sys/time.h]) @@ -42,8 +50,12 @@ AC_DEFUN([gl_HEADER_SYS_TIME_H], AC_SUBST([HAVE_STRUCT_TIMEVAL]) dnl Assume POSIX behavior unless another module says otherwise. - HAVE_GETTIMEOFDAY_POSIX_SIGNATURE=1 - AC_SUBST([HAVE_GETTIMEOFDAY_POSIX_SIGNATURE]) - GETTIMEOFDAY_CLOBBERS_LOCALTIME=0 - AC_SUBST([GETTIMEOFDAY_CLOBBERS_LOCALTIME]) + REPLACE_GETTIMEOFDAY=0 + AC_SUBST([REPLACE_GETTIMEOFDAY]) + if test $HAVE_SYS_TIME_H = 0 || test $HAVE_STRUCT_TIMEVAL = 0; then + SYS_TIME_H=sys/time.h + else + SYS_TIME_H= + fi + AC_SUBST([SYS_TIME_H]) ])