diff --git a/gnulib/Makefile.in b/gnulib/Makefile.in index 0e0ebb2a6d1..bdd3c3f3fbc 100644 --- a/gnulib/Makefile.in +++ b/gnulib/Makefile.in @@ -164,6 +164,7 @@ am__aclocal_m4_deps = $(top_srcdir)/../config/depstand.m4 \ $(top_srcdir)/import/m4/getpagesize.m4 \ $(top_srcdir)/import/m4/getprogname.m4 \ $(top_srcdir)/import/m4/getrandom.m4 \ + $(top_srcdir)/import/m4/gettimeofday.m4 \ $(top_srcdir)/import/m4/glob.m4 \ $(top_srcdir)/import/m4/glob_h.m4 \ $(top_srcdir)/import/m4/gnulib-common.m4 \ @@ -182,6 +183,7 @@ am__aclocal_m4_deps = $(top_srcdir)/../config/depstand.m4 \ $(top_srcdir)/import/m4/locale-ja.m4 \ $(top_srcdir)/import/m4/locale-zh.m4 \ $(top_srcdir)/import/m4/locale_h.m4 \ + $(top_srcdir)/import/m4/localtime-buffer.m4 \ $(top_srcdir)/import/m4/lock.m4 \ $(top_srcdir)/import/m4/lstat.m4 \ $(top_srcdir)/import/m4/malloc.m4 \ @@ -249,6 +251,7 @@ am__aclocal_m4_deps = $(top_srcdir)/../config/depstand.m4 \ $(top_srcdir)/import/m4/sys_random_h.m4 \ $(top_srcdir)/import/m4/sys_socket_h.m4 \ $(top_srcdir)/import/m4/sys_stat_h.m4 \ + $(top_srcdir)/import/m4/sys_time_h.m4 \ $(top_srcdir)/import/m4/sys_types_h.m4 \ $(top_srcdir)/import/m4/sys_uio_h.m4 \ $(top_srcdir)/import/m4/tempname.m4 \ @@ -926,6 +929,7 @@ HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@ HAVE_GETPASS = @HAVE_GETPASS@ HAVE_GETRANDOM = @HAVE_GETRANDOM@ HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ +HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@ HAVE_GLOB = @HAVE_GLOB@ HAVE_GLOB_H = @HAVE_GLOB_H@ HAVE_GLOB_PATTERN_P = @HAVE_GLOB_PATTERN_P@ @@ -1055,6 +1059,7 @@ HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@ HAVE_STRUCT_SIGACTION_SA_SIGACTION = @HAVE_STRUCT_SIGACTION_SA_SIGACTION@ HAVE_STRUCT_SOCKADDR_STORAGE = @HAVE_STRUCT_SOCKADDR_STORAGE@ HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY = @HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY@ +HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@ HAVE_STRVERSCMP = @HAVE_STRVERSCMP@ HAVE_SYMLINK = @HAVE_SYMLINK@ HAVE_SYMLINKAT = @HAVE_SYMLINKAT@ @@ -1064,6 +1069,7 @@ HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@ HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@ HAVE_SYS_RANDOM_H = @HAVE_SYS_RANDOM_H@ HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@ +HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ HAVE_SYS_UIO_H = @HAVE_SYS_UIO_H@ HAVE_TANF = @HAVE_TANF@ @@ -1191,6 +1197,7 @@ NEXT_AS_FIRST_DIRECTIVE_STRING_H = @NEXT_AS_FIRST_DIRECTIVE_STRING_H@ NEXT_AS_FIRST_DIRECTIVE_SYS_RANDOM_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_RANDOM_H@ NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H@ NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H@ +NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H@ NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H@ NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H@ NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@ @@ -1218,6 +1225,7 @@ NEXT_STRING_H = @NEXT_STRING_H@ NEXT_SYS_RANDOM_H = @NEXT_SYS_RANDOM_H@ NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_H@ NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@ +NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@ NEXT_SYS_TYPES_H = @NEXT_SYS_TYPES_H@ NEXT_SYS_UIO_H = @NEXT_SYS_UIO_H@ NEXT_TIME_H = @NEXT_TIME_H@ @@ -1317,6 +1325,7 @@ REPLACE_GETLOGIN_R = @REPLACE_GETLOGIN_R@ REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@ REPLACE_GETPASS = @REPLACE_GETPASS@ REPLACE_GETRANDOM = @REPLACE_GETRANDOM@ +REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@ REPLACE_GLOB = @REPLACE_GLOB@ REPLACE_GLOB_PATTERN_P = @REPLACE_GLOB_PATTERN_P@ REPLACE_GMTIME = @REPLACE_GMTIME@ @@ -1451,6 +1460,7 @@ REPLACE_STRTOK_R = @REPLACE_STRTOK_R@ REPLACE_STRTOLD = @REPLACE_STRTOLD@ REPLACE_STRTOUMAX = @REPLACE_STRTOUMAX@ REPLACE_STRUCT_LCONV = @REPLACE_STRUCT_LCONV@ +REPLACE_STRUCT_TIMEVAL = @REPLACE_STRUCT_TIMEVAL@ REPLACE_SYMLINK = @REPLACE_SYMLINK@ REPLACE_SYMLINKAT = @REPLACE_SYMLINKAT@ REPLACE_TANF = @REPLACE_TANF@ diff --git a/gnulib/aclocal.m4 b/gnulib/aclocal.m4 index dd04373848d..af6abc1542f 100644 --- a/gnulib/aclocal.m4 +++ b/gnulib/aclocal.m4 @@ -1237,6 +1237,7 @@ m4_include([import/m4/getlogin_r.m4]) m4_include([import/m4/getpagesize.m4]) m4_include([import/m4/getprogname.m4]) m4_include([import/m4/getrandom.m4]) +m4_include([import/m4/gettimeofday.m4]) m4_include([import/m4/glob.m4]) m4_include([import/m4/glob_h.m4]) m4_include([import/m4/gnulib-common.m4]) @@ -1255,6 +1256,7 @@ m4_include([import/m4/locale-fr.m4]) m4_include([import/m4/locale-ja.m4]) m4_include([import/m4/locale-zh.m4]) m4_include([import/m4/locale_h.m4]) +m4_include([import/m4/localtime-buffer.m4]) m4_include([import/m4/lock.m4]) m4_include([import/m4/lstat.m4]) m4_include([import/m4/malloc.m4]) @@ -1322,6 +1324,7 @@ m4_include([import/m4/strtok_r.m4]) m4_include([import/m4/sys_random_h.m4]) m4_include([import/m4/sys_socket_h.m4]) m4_include([import/m4/sys_stat_h.m4]) +m4_include([import/m4/sys_time_h.m4]) m4_include([import/m4/sys_types_h.m4]) m4_include([import/m4/sys_uio_h.m4]) m4_include([import/m4/tempname.m4]) diff --git a/gnulib/config.in b/gnulib/config.in index 8d32022a301..4a20b470fb2 100644 --- a/gnulib/config.in +++ b/gnulib/config.in @@ -67,6 +67,13 @@ and handles trailing slash correctly. */ #undef FUNC_REALPATH_WORKS +/* Define if gettimeofday clobbers the localtime buffer. */ +#undef GETTIMEOFDAY_CLOBBERS_LOCALTIME + +/* Define this to 'void' or 'struct timezone' to match the system's + declaration of the second argument to gettimeofday. */ +#undef GETTIMEOFDAY_TIMEZONE + /* Define to a C preprocessor expression that evaluates to 1 or 0, depending whether the gnulib module canonicalize-lgpl shall be considered present. */ #undef GNULIB_CANONICALIZE_LGPL @@ -194,6 +201,9 @@ /* Define to 1 when the gnulib module getrandom should be tested. */ #undef GNULIB_TEST_GETRANDOM +/* Define to 1 when the gnulib module gettimeofday should be tested. */ +#undef GNULIB_TEST_GETTIMEOFDAY + /* Define to 1 when the gnulib module glob should be tested. */ #undef GNULIB_TEST_GLOB @@ -510,6 +520,9 @@ /* Define to 1 if you have the `getrandom' function. */ #undef HAVE_GETRANDOM +/* Define to 1 if you have the `gettimeofday' function. */ +#undef HAVE_GETTIMEOFDAY + /* Define to 1 if you have the `glob' function. */ #undef HAVE_GLOB diff --git a/gnulib/configure b/gnulib/configure index 917aba28d46..fa2feb5ea9a 100644 --- a/gnulib/configure +++ b/gnulib/configure @@ -704,32 +704,6 @@ SYS_TIME_H_DEFINES_STRUCT_TIMESPEC TIME_H_DEFINES_STRUCT_TIMESPEC NEXT_AS_FIRST_DIRECTIVE_TIME_H NEXT_TIME_H -REPLACE_LOCALTIME -REPLACE_GMTIME -GNULIB_GETTIMEOFDAY -REPLACE_TZSET -REPLACE_TIMEGM -REPLACE_STRFTIME -REPLACE_NANOSLEEP -REPLACE_MKTIME -REPLACE_LOCALTIME_R -REPLACE_CTIME -HAVE_TIMEZONE_T -HAVE_TZSET -HAVE_TIMEGM -HAVE_STRPTIME -HAVE_NANOSLEEP -HAVE_DECL_LOCALTIME_R -GNULIB_TZSET -GNULIB_TIME_RZ -GNULIB_TIME_R -GNULIB_TIMEGM -GNULIB_STRPTIME -GNULIB_STRFTIME -GNULIB_NANOSLEEP -GNULIB_LOCALTIME -GNULIB_MKTIME -GNULIB_CTIME HAVE_SYS_UIO_H NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H NEXT_SYS_UIO_H @@ -1082,6 +1056,39 @@ REPLACE_GLOB HAVE_GLOB_PATTERN_P HAVE_GLOB GNULIB_GLOB +REPLACE_LOCALTIME +REPLACE_GMTIME +REPLACE_TZSET +REPLACE_TIMEGM +REPLACE_STRFTIME +REPLACE_NANOSLEEP +REPLACE_MKTIME +REPLACE_LOCALTIME_R +REPLACE_CTIME +HAVE_TIMEZONE_T +HAVE_TZSET +HAVE_TIMEGM +HAVE_STRPTIME +HAVE_NANOSLEEP +HAVE_DECL_LOCALTIME_R +GNULIB_TZSET +GNULIB_TIME_RZ +GNULIB_TIME_R +GNULIB_TIMEGM +GNULIB_STRPTIME +GNULIB_STRFTIME +GNULIB_NANOSLEEP +GNULIB_LOCALTIME +GNULIB_MKTIME +GNULIB_CTIME +NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H +NEXT_SYS_TIME_H +REPLACE_STRUCT_TIMEVAL +REPLACE_GETTIMEOFDAY +HAVE_SYS_TIME_H +HAVE_STRUCT_TIMEVAL +HAVE_GETTIMEOFDAY +GNULIB_GETTIMEOFDAY LTLIBINTL LIBINTL LIB_GETRANDOM @@ -3639,6 +3646,8 @@ as_fn_append ac_func_list " getlogin_r" as_fn_append ac_func_list " getprogname" as_fn_append ac_func_list " getexecname" as_fn_append ac_func_list " getrandom" +as_fn_append ac_header_list " sys/time.h" +as_fn_append ac_func_list " gettimeofday" as_fn_append ac_header_list " glob.h" as_fn_append ac_func_list " glob" as_fn_append ac_func_list " glob_pattern_p" @@ -3662,7 +3671,6 @@ as_fn_append ac_func_list " mkostemp" as_fn_append ac_func_list " openat" as_fn_append ac_func_list " link" as_fn_append ac_func_list " setenv" -as_fn_append ac_header_list " sys/time.h" as_fn_append ac_func_list " strdup" as_fn_append ac_func_list " strerror_r" as_fn_append ac_func_list " __xpg_strerror_r" @@ -6599,6 +6607,7 @@ fi # Code from module getprogname: # Code from module getrandom: # Code from module gettext-h: + # Code from module gettimeofday: # Code from module glob: # Code from module glob-h: # Code from module hard-locale: @@ -6616,6 +6625,7 @@ fi # Code from module limits-h: # Code from module localcharset: # Code from module locale: + # Code from module localtime-buffer: # Code from module lock: # Code from module lstat: # Code from module malloc-posix: @@ -6688,6 +6698,7 @@ fi # Code from module sys_random: # Code from module sys_socket: # Code from module sys_stat: + # Code from module sys_time: # Code from module sys_types: # Code from module sys_uio: # Code from module tempname: @@ -10342,6 +10353,249 @@ _ACEOF + GNULIB_GETTIMEOFDAY=0; + HAVE_GETTIMEOFDAY=1; + HAVE_STRUCT_TIMEVAL=1; + HAVE_SYS_TIME_H=1; + REPLACE_GETTIMEOFDAY=0; + REPLACE_STRUCT_TIMEVAL=0; + + + + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_sys_time_h='<'sys/time.h'>' + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +$as_echo_n "checking absolute name of ... " >&6; } +if ${gl_cv_next_sys_time_h+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test $ac_cv_header_sys_time_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'sys/time.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_sys_time_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_sys_time_h + gl_cv_next_sys_time_h='"'$gl_header'"' + else + gl_cv_next_sys_time_h='<'sys/time.h'>' + fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_time_h" >&5 +$as_echo "$gl_cv_next_sys_time_h" >&6; } + fi + NEXT_SYS_TIME_H=$gl_cv_next_sys_time_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'sys/time.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_sys_time_h + fi + NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H=$gl_next_as_first_directive + + + + + + if test $ac_cv_header_sys_time_h != yes; then + HAVE_SYS_TIME_H=0 + fi + + + + + + if test $ac_cv_header_sys_socket_h != yes; then + for ac_header in winsock2.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default" +if test "x$ac_cv_header_winsock2_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_WINSOCK2_H 1 +_ACEOF + +fi + +done + + fi + if test "$ac_cv_header_winsock2_h" = yes; then + HAVE_WINSOCK2_H=1 + UNISTD_H_HAVE_WINSOCK2_H=1 + SYS_IOCTL_H_HAVE_WINSOCK2_H=1 + else + HAVE_WINSOCK2_H=0 + fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timeval" >&5 +$as_echo_n "checking for struct timeval... " >&6; } +if ${gl_cv_sys_struct_timeval+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if HAVE_SYS_TIME_H + #include + #endif + #include + #if HAVE_WINSOCK2_H + # include + #endif + +int +main () +{ +static struct timeval x; x.tv_sec = x.tv_usec; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_sys_struct_timeval=yes +else + gl_cv_sys_struct_timeval=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timeval" >&5 +$as_echo "$gl_cv_sys_struct_timeval" >&6; } + if test $gl_cv_sys_struct_timeval != yes; then + HAVE_STRUCT_TIMEVAL=0 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wide-enough struct timeval.tv_sec member" >&5 +$as_echo_n "checking for wide-enough struct timeval.tv_sec member... " >&6; } +if ${gl_cv_sys_struct_timeval_tv_sec+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if HAVE_SYS_TIME_H + #include + #endif + #include + #if HAVE_WINSOCK2_H + # include + #endif + +int +main () +{ +static struct timeval x; + typedef int verify_tv_sec_type[ + sizeof (time_t) <= sizeof x.tv_sec ? 1 : -1 + ]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_sys_struct_timeval_tv_sec=yes +else + gl_cv_sys_struct_timeval_tv_sec=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timeval_tv_sec" >&5 +$as_echo "$gl_cv_sys_struct_timeval_tv_sec" >&6; } + if test $gl_cv_sys_struct_timeval_tv_sec != yes; then + REPLACE_STRUCT_TIMEVAL=1 + fi + fi + + + + + + + + + + + + NEED_LOCALTIME_BUFFER=0 + + + GNULIB_CTIME=0; + GNULIB_MKTIME=0; + GNULIB_LOCALTIME=0; + GNULIB_NANOSLEEP=0; + GNULIB_STRFTIME=0; + GNULIB_STRPTIME=0; + GNULIB_TIMEGM=0; + GNULIB_TIME_R=0; + GNULIB_TIME_RZ=0; + GNULIB_TZSET=0; + HAVE_DECL_LOCALTIME_R=1; + HAVE_NANOSLEEP=1; + HAVE_STRPTIME=1; + HAVE_TIMEGM=1; + HAVE_TZSET=1; + HAVE_TIMEZONE_T=0; + REPLACE_CTIME=GNULIB_PORTCHECK; + REPLACE_LOCALTIME_R=GNULIB_PORTCHECK; + REPLACE_MKTIME=GNULIB_PORTCHECK; + REPLACE_NANOSLEEP=GNULIB_PORTCHECK; + REPLACE_STRFTIME=GNULIB_PORTCHECK; + REPLACE_TIMEGM=GNULIB_PORTCHECK; + REPLACE_TZSET=GNULIB_PORTCHECK; + + : ${GNULIB_GETTIMEOFDAY=0}; + REPLACE_GMTIME=0; + REPLACE_LOCALTIME=0; + + GNULIB_GLOB=0; HAVE_GLOB=1; HAVE_GLOB_PATTERN_P=1; @@ -15796,8 +16050,6 @@ $as_echo "#define gid_t int" >>confdefs.h fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5 $as_echo_n "checking for stdbool.h that conforms to C99... " >&6; } if ${ac_cv_header_stdbool_h+:} false; then : @@ -16445,35 +16697,6 @@ $as_echo "$gl_cv_next_sys_types_h" >&6; } - GNULIB_CTIME=0; - GNULIB_MKTIME=0; - GNULIB_LOCALTIME=0; - GNULIB_NANOSLEEP=0; - GNULIB_STRFTIME=0; - GNULIB_STRPTIME=0; - GNULIB_TIMEGM=0; - GNULIB_TIME_R=0; - GNULIB_TIME_RZ=0; - GNULIB_TZSET=0; - HAVE_DECL_LOCALTIME_R=1; - HAVE_NANOSLEEP=1; - HAVE_STRPTIME=1; - HAVE_TIMEGM=1; - HAVE_TZSET=1; - HAVE_TIMEZONE_T=0; - REPLACE_CTIME=GNULIB_PORTCHECK; - REPLACE_LOCALTIME_R=GNULIB_PORTCHECK; - REPLACE_MKTIME=GNULIB_PORTCHECK; - REPLACE_NANOSLEEP=GNULIB_PORTCHECK; - REPLACE_STRFTIME=GNULIB_PORTCHECK; - REPLACE_TIMEGM=GNULIB_PORTCHECK; - REPLACE_TZSET=GNULIB_PORTCHECK; - - : ${GNULIB_GETTIMEOFDAY=0}; - REPLACE_GMTIME=0; - REPLACE_LOCALTIME=0; - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timespec in " >&5 $as_echo_n "checking for struct timespec in ... " >&6; } @@ -20481,6 +20704,194 @@ $as_echo "#define GNULIB_TEST_GETRANDOM 1" >>confdefs.h + + + + gl_gettimeofday_timezone=void + if test $ac_cv_func_gettimeofday != yes; then + HAVE_GETTIMEOFDAY=0 + else + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether gettimeofday clobbers localtime buffer" >&5 +$as_echo_n "checking whether gettimeofday clobbers localtime buffer... " >&6; } +if ${gl_cv_func_gettimeofday_clobber+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + # When cross-compiling: + case "$host_os" in + # Guess all is fine on glibc systems. + *-gnu* | gnu*) gl_cv_func_gettimeofday_clobber="guessing no" ;; + # Guess all is fine on musl systems. + *-musl*) gl_cv_func_gettimeofday_clobber="guessing no" ;; + # Guess no on native Windows. + mingw*) gl_cv_func_gettimeofday_clobber="guessing no" ;; + # If we don't know, obey --enable-cross-guesses. + *) gl_cv_func_gettimeofday_clobber="$gl_cross_guess_inverted" ;; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + #include + #include + +int +main () +{ + + time_t t = 0; + struct tm *lt; + struct tm saved_lt; + struct timeval tv; + lt = localtime (&t); + saved_lt = *lt; + gettimeofday (&tv, NULL); + return memcmp (lt, &saved_lt, sizeof (struct tm)) != 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_gettimeofday_clobber=no +else + gl_cv_func_gettimeofday_clobber=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_gettimeofday_clobber" >&5 +$as_echo "$gl_cv_func_gettimeofday_clobber" >&6; } + + case "$gl_cv_func_gettimeofday_clobber" in + *yes) + REPLACE_GETTIMEOFDAY=1 + +$as_echo "#define GETTIMEOFDAY_CLOBBERS_LOCALTIME 1" >>confdefs.h + + + + + NEED_LOCALTIME_BUFFER=1 + REPLACE_GMTIME=1 + REPLACE_LOCALTIME=1 + + ;; + esac + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gettimeofday with POSIX signature" >&5 +$as_echo_n "checking for gettimeofday with POSIX signature... " >&6; } +if ${gl_cv_func_gettimeofday_posix_signature+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + struct timeval c; + int gettimeofday (struct timeval *restrict, void *restrict); + +int +main () +{ +/* glibc uses struct timezone * rather than the POSIX void * + if _GNU_SOURCE is defined. However, since the only portable + use of gettimeofday uses NULL as the second parameter, and + since the glibc definition is actually more typesafe, it is + not worth wrapping this to get a compliant signature. */ + int (*f) (struct timeval *restrict, void *restrict) + = gettimeofday; + int x = f (&c, 0); + return !(x | c.tv_sec | c.tv_usec); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_func_gettimeofday_posix_signature=yes +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int gettimeofday (struct timeval *restrict, struct timezone *restrict); + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_func_gettimeofday_posix_signature=almost +else + gl_cv_func_gettimeofday_posix_signature=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_gettimeofday_posix_signature" >&5 +$as_echo "$gl_cv_func_gettimeofday_posix_signature" >&6; } + if test $gl_cv_func_gettimeofday_posix_signature = almost; then + gl_gettimeofday_timezone='struct timezone' + elif test $gl_cv_func_gettimeofday_posix_signature != yes; then + REPLACE_GETTIMEOFDAY=1 + fi + if test $REPLACE_STRUCT_TIMEVAL = 1; then + REPLACE_GETTIMEOFDAY=1 + fi + case "$host_os" in + mingw*) REPLACE_GETTIMEOFDAY=1 ;; + esac + fi + +cat >>confdefs.h <<_ACEOF +#define GETTIMEOFDAY_TIMEZONE $gl_gettimeofday_timezone +_ACEOF + + + if test $HAVE_GETTIMEOFDAY = 0 || test $REPLACE_GETTIMEOFDAY = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS gettimeofday.$ac_objext" + + : + fi + + + + + + GNULIB_GETTIMEOFDAY=1 + + + + + +$as_echo "#define GNULIB_TEST_GETTIMEOFDAY 1" >>confdefs.h + + + + + + + if test $ac_cv_func_glob = no; then HAVE_GLOB=0 else @@ -21773,6 +22184,17 @@ $as_echo "$gl_cv_next_locale_h" >&6; } + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS localtime-buffer.$ac_objext" + + + if test "$gl_threads_api" = posix; then # OSF/1 4.0 and Mac OS X 10.1 lack the pthread_rwlock_t type and the # pthread_rwlock_* functions. @@ -28272,6 +28694,10 @@ fi + + + + diff --git a/gnulib/import/Makefile.am b/gnulib/import/Makefile.am index 8e9c05c2681..84de424a173 100644 --- a/gnulib/import/Makefile.am +++ b/gnulib/import/Makefile.am @@ -42,6 +42,7 @@ # fnmatch-gnu \ # frexpl \ # getcwd \ +# gettimeofday \ # glob \ # inet_ntop \ # inttypes \ @@ -693,6 +694,15 @@ libgnu_a_SOURCES += gettext.h ## end gnulib module gettext-h +## begin gnulib module gettimeofday + + +EXTRA_DIST += gettimeofday.c + +EXTRA_libgnu_a_SOURCES += gettimeofday.c + +## end gnulib module gettimeofday + ## begin gnulib module glob @@ -917,6 +927,15 @@ EXTRA_DIST += locale.in.h ## end gnulib module locale +## begin gnulib module localtime-buffer + + +EXTRA_DIST += localtime-buffer.c localtime-buffer.h + +EXTRA_libgnu_a_SOURCES += localtime-buffer.c + +## end gnulib module localtime-buffer + ## begin gnulib module lock libgnu_a_SOURCES += glthread/lock.h glthread/lock.c @@ -2372,6 +2391,40 @@ EXTRA_DIST += sys_stat.in.h ## end gnulib module sys_stat +## begin gnulib module sys_time + +BUILT_SOURCES += sys/time.h + +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +sys/time.h: sys_time.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) + $(AM_V_at)$(MKDIR_P) sys + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's/@''HAVE_SYS_TIME_H''@/$(HAVE_SYS_TIME_H)/g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_SYS_TIME_H''@|$(NEXT_SYS_TIME_H)|g' \ + -e 's/@''GNULIB_GETTIMEOFDAY''@/$(GNULIB_GETTIMEOFDAY)/g' \ + -e 's|@''HAVE_WINSOCK2_H''@|$(HAVE_WINSOCK2_H)|g' \ + -e 's/@''HAVE_GETTIMEOFDAY''@/$(HAVE_GETTIMEOFDAY)/g' \ + -e 's/@''HAVE_STRUCT_TIMEVAL''@/$(HAVE_STRUCT_TIMEVAL)/g' \ + -e 's/@''REPLACE_GETTIMEOFDAY''@/$(REPLACE_GETTIMEOFDAY)/g' \ + -e 's/@''REPLACE_STRUCT_TIMEVAL''@/$(REPLACE_STRUCT_TIMEVAL)/g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ + < $(srcdir)/sys_time.in.h; \ + } > $@-t && \ + mv $@-t $@ +MOSTLYCLEANFILES += sys/time.h sys/time.h-t + +EXTRA_DIST += sys_time.in.h + +## end gnulib module sys_time + ## begin gnulib module sys_types BUILT_SOURCES += sys/types.h diff --git a/gnulib/import/Makefile.in b/gnulib/import/Makefile.in index 8162d3a26fa..476cde8dd57 100644 --- a/gnulib/import/Makefile.in +++ b/gnulib/import/Makefile.in @@ -56,6 +56,7 @@ # fnmatch-gnu \ # frexpl \ # getcwd \ +# gettimeofday \ # glob \ # inet_ntop \ # inttypes \ @@ -220,6 +221,7 @@ am__aclocal_m4_deps = $(top_srcdir)/../config/depstand.m4 \ $(top_srcdir)/import/m4/getpagesize.m4 \ $(top_srcdir)/import/m4/getprogname.m4 \ $(top_srcdir)/import/m4/getrandom.m4 \ + $(top_srcdir)/import/m4/gettimeofday.m4 \ $(top_srcdir)/import/m4/glob.m4 \ $(top_srcdir)/import/m4/glob_h.m4 \ $(top_srcdir)/import/m4/gnulib-common.m4 \ @@ -238,6 +240,7 @@ am__aclocal_m4_deps = $(top_srcdir)/../config/depstand.m4 \ $(top_srcdir)/import/m4/locale-ja.m4 \ $(top_srcdir)/import/m4/locale-zh.m4 \ $(top_srcdir)/import/m4/locale_h.m4 \ + $(top_srcdir)/import/m4/localtime-buffer.m4 \ $(top_srcdir)/import/m4/lock.m4 \ $(top_srcdir)/import/m4/lstat.m4 \ $(top_srcdir)/import/m4/malloc.m4 \ @@ -305,6 +308,7 @@ am__aclocal_m4_deps = $(top_srcdir)/../config/depstand.m4 \ $(top_srcdir)/import/m4/sys_random_h.m4 \ $(top_srcdir)/import/m4/sys_socket_h.m4 \ $(top_srcdir)/import/m4/sys_stat_h.m4 \ + $(top_srcdir)/import/m4/sys_time_h.m4 \ $(top_srcdir)/import/m4/sys_types_h.m4 \ $(top_srcdir)/import/m4/sys_uio_h.m4 \ $(top_srcdir)/import/m4/tempname.m4 \ @@ -1019,6 +1023,7 @@ HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@ HAVE_GETPASS = @HAVE_GETPASS@ HAVE_GETRANDOM = @HAVE_GETRANDOM@ HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ +HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@ HAVE_GLOB = @HAVE_GLOB@ HAVE_GLOB_H = @HAVE_GLOB_H@ HAVE_GLOB_PATTERN_P = @HAVE_GLOB_PATTERN_P@ @@ -1148,6 +1153,7 @@ HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@ HAVE_STRUCT_SIGACTION_SA_SIGACTION = @HAVE_STRUCT_SIGACTION_SA_SIGACTION@ HAVE_STRUCT_SOCKADDR_STORAGE = @HAVE_STRUCT_SOCKADDR_STORAGE@ HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY = @HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY@ +HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@ HAVE_STRVERSCMP = @HAVE_STRVERSCMP@ HAVE_SYMLINK = @HAVE_SYMLINK@ HAVE_SYMLINKAT = @HAVE_SYMLINKAT@ @@ -1157,6 +1163,7 @@ HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@ HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@ HAVE_SYS_RANDOM_H = @HAVE_SYS_RANDOM_H@ HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@ +HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ HAVE_SYS_UIO_H = @HAVE_SYS_UIO_H@ HAVE_TANF = @HAVE_TANF@ @@ -1284,6 +1291,7 @@ NEXT_AS_FIRST_DIRECTIVE_STRING_H = @NEXT_AS_FIRST_DIRECTIVE_STRING_H@ NEXT_AS_FIRST_DIRECTIVE_SYS_RANDOM_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_RANDOM_H@ NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H@ NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H@ +NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H@ NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H@ NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H@ NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@ @@ -1311,6 +1319,7 @@ NEXT_STRING_H = @NEXT_STRING_H@ NEXT_SYS_RANDOM_H = @NEXT_SYS_RANDOM_H@ NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_H@ NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@ +NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@ NEXT_SYS_TYPES_H = @NEXT_SYS_TYPES_H@ NEXT_SYS_UIO_H = @NEXT_SYS_UIO_H@ NEXT_TIME_H = @NEXT_TIME_H@ @@ -1410,6 +1419,7 @@ REPLACE_GETLOGIN_R = @REPLACE_GETLOGIN_R@ REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@ REPLACE_GETPASS = @REPLACE_GETPASS@ REPLACE_GETRANDOM = @REPLACE_GETRANDOM@ +REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@ REPLACE_GLOB = @REPLACE_GLOB@ REPLACE_GLOB_PATTERN_P = @REPLACE_GLOB_PATTERN_P@ REPLACE_GMTIME = @REPLACE_GMTIME@ @@ -1544,6 +1554,7 @@ REPLACE_STRTOK_R = @REPLACE_STRTOK_R@ REPLACE_STRTOLD = @REPLACE_STRTOLD@ REPLACE_STRTOUMAX = @REPLACE_STRTOUMAX@ REPLACE_STRUCT_LCONV = @REPLACE_STRUCT_LCONV@ +REPLACE_STRUCT_TIMEVAL = @REPLACE_STRUCT_TIMEVAL@ REPLACE_SYMLINK = @REPLACE_SYMLINK@ REPLACE_SYMLINKAT = @REPLACE_SYMLINKAT@ REPLACE_TANF = @REPLACE_TANF@ @@ -1678,33 +1689,34 @@ EXTRA_DIST = m4/gnulib-cache.m4 alloca.c alloca.in.h arpa_inet.in.h \ fnmatch.c fnmatch_loop.c fnmatch.in.h fpucw.h frexp.c frexp.c \ frexpl.c fstat.c stat-w32.c stat-w32.h at-func.c fstatat.c \ getcwd.c getcwd-lgpl.c getdtablesize.c getlogin_r.c \ - getrandom.c glob.c glob_internal.h glob_pattern_p.c globfree.c \ - glob-libc.h glob.in.h hard-locale.h inet_ntop.c intprops.h \ - inttypes.in.h isblank.c float+.h isnan.c isnand-nolibm.h \ - isnand.c float+.h isnan.c isnanl-nolibm.h isnanl.c cdefs.h \ - libc-config.h limits.in.h localcharset.h locale.in.h lstat.c \ - malloc.c malloca.h math.in.h lc-charset-dispatch.c \ - lc-charset-dispatch.h mbrtowc-impl-utf8.h mbrtowc-impl.h \ - mbrtowc.c mbtowc-lock.c mbtowc-lock.h windows-initguard.h \ - mbsinit.c mbsrtowcs-impl.h mbsrtowcs-state.c mbsrtowcs.c \ - mbtowc-impl.h mbtowc.c memchr.c memchr.valgrind memmem.c \ - str-two-way.h mempcpy.c memrchr.c mkdir.c mkdtemp.c mkostemp.c \ - msvc-inval.c msvc-inval.h msvc-nothrow.c msvc-nothrow.h \ - netinet_in.in.h open.c openat.c openat.h dirent-private.h \ - opendir.c pathmax.h rawmemchr.c rawmemchr.valgrind \ - dirent-private.h readdir.c readlink.c realloc.c rename.c \ - dirent-private.h rewinddir.c rmdir.c same-inode.h save-cwd.h \ - malloc/scratch_buffer.h scratch_buffer.h setenv.c \ - setlocale-lock.c setlocale_null.h windows-initguard.h \ - signal.in.h _Noreturn.h arg-nonnull.h c++defs.h warn-on-use.h \ - stat-w32.c stat-w32.h stat.c stat-time.h stdalign.in.h \ - stdbool.in.h stddef.in.h stdint.in.h stdio.in.h stdlib.in.h \ - strchrnul.c strchrnul.valgrind strdup.c streq.h strerror.c \ - strerror-override.c strerror-override.h strerror_r.c \ - string.in.h strnlen.c str-two-way.h strstr.c strtok_r.c \ - sys_random.in.h sys_socket.in.h sys_stat.in.h sys_types.in.h \ - sys_uio.in.h tempname.h time.in.h time_r.c unistd.in.h \ - unistd--.h unistd-safer.h unsetenv.c \ + getrandom.c gettimeofday.c glob.c glob_internal.h \ + glob_pattern_p.c globfree.c glob-libc.h glob.in.h \ + hard-locale.h inet_ntop.c intprops.h inttypes.in.h isblank.c \ + float+.h isnan.c isnand-nolibm.h isnand.c float+.h isnan.c \ + isnanl-nolibm.h isnanl.c cdefs.h libc-config.h limits.in.h \ + localcharset.h locale.in.h localtime-buffer.c \ + localtime-buffer.h lstat.c malloc.c malloca.h math.in.h \ + lc-charset-dispatch.c lc-charset-dispatch.h \ + mbrtowc-impl-utf8.h mbrtowc-impl.h mbrtowc.c mbtowc-lock.c \ + mbtowc-lock.h windows-initguard.h mbsinit.c mbsrtowcs-impl.h \ + mbsrtowcs-state.c mbsrtowcs.c mbtowc-impl.h mbtowc.c memchr.c \ + memchr.valgrind memmem.c str-two-way.h mempcpy.c memrchr.c \ + mkdir.c mkdtemp.c mkostemp.c msvc-inval.c msvc-inval.h \ + msvc-nothrow.c msvc-nothrow.h netinet_in.in.h open.c openat.c \ + openat.h dirent-private.h opendir.c pathmax.h rawmemchr.c \ + rawmemchr.valgrind dirent-private.h readdir.c readlink.c \ + realloc.c rename.c dirent-private.h rewinddir.c rmdir.c \ + same-inode.h save-cwd.h malloc/scratch_buffer.h \ + scratch_buffer.h setenv.c setlocale-lock.c setlocale_null.h \ + windows-initguard.h signal.in.h _Noreturn.h arg-nonnull.h \ + c++defs.h warn-on-use.h stat-w32.c stat-w32.h stat.c \ + stat-time.h stdalign.in.h stdbool.in.h stddef.in.h stdint.in.h \ + stdio.in.h stdlib.in.h strchrnul.c strchrnul.valgrind strdup.c \ + streq.h strerror.c strerror-override.c strerror-override.h \ + strerror_r.c string.in.h strnlen.c str-two-way.h strstr.c \ + strtok_r.c sys_random.in.h sys_socket.in.h sys_stat.in.h \ + sys_time.in.h sys_types.in.h sys_uio.in.h tempname.h time.in.h \ + time_r.c unistd.in.h unistd--.h unistd-safer.h unsetenv.c \ $(top_srcdir)/import/extra/update-copyright verify.h \ wchar.in.h wctype.in.h windows-initguard.h windows-mutex.c \ windows-mutex.h windows-once.c windows-once.h \ @@ -1716,7 +1728,8 @@ BUILT_SOURCES = $(ALLOCA_H) arpa/inet.h ctype.h dirent.h $(ERRNO_H) \ $(LIMITS_H) locale.h math.h $(NETINET_IN_H) signal.h \ $(STDALIGN_H) $(STDBOOL_H) $(STDDEF_H) $(STDINT_H) stdio.h \ stdlib.h string.h sys/random.h sys/socket.h sys/stat.h \ - sys/types.h sys/uio.h time.h unistd.h wchar.h wctype.h + sys/time.h sys/types.h sys/uio.h time.h unistd.h wchar.h \ + wctype.h SUFFIXES = MOSTLYCLEANFILES = core *.stackdump alloca.h alloca.h-t arpa/inet.h \ arpa/inet.h-t ctype.h ctype.h-t dirent.h dirent.h-t errno.h \ @@ -1727,9 +1740,9 @@ MOSTLYCLEANFILES = core *.stackdump alloca.h alloca.h-t arpa/inet.h \ stdbool.h stdbool.h-t stddef.h stddef.h-t stdint.h stdint.h-t \ stdio.h stdio.h-t stdlib.h stdlib.h-t string.h string.h-t \ sys/random.h sys/random.h-t sys/socket.h sys/socket.h-t \ - sys/stat.h sys/stat.h-t sys/types.h sys/types.h-t sys/uio.h \ - sys/uio.h-t time.h time.h-t unistd.h unistd.h-t wchar.h \ - wchar.h-t wctype.h wctype.h-t + sys/stat.h sys/stat.h-t sys/time.h sys/time.h-t sys/types.h \ + sys/types.h-t sys/uio.h sys/uio.h-t time.h time.h-t unistd.h \ + unistd.h-t wchar.h wchar.h-t wctype.h wctype.h-t MOSTLYCLEANDIRS = arpa netinet sys sys sys sys CLEANFILES = DISTCLEANFILES = @@ -1755,18 +1768,18 @@ EXTRA_libgnu_a_SOURCES = alloca.c btowc.c canonicalize-lgpl.c \ fchdir.c fcntl.c fdopendir.c float.c itold.c fnmatch.c \ fnmatch_loop.c frexp.c frexp.c frexpl.c fstat.c stat-w32.c \ at-func.c fstatat.c getcwd.c getcwd-lgpl.c getdtablesize.c \ - getlogin_r.c getrandom.c glob.c glob_pattern_p.c globfree.c \ - inet_ntop.c isblank.c isnan.c isnand.c isnan.c isnanl.c \ - lstat.c malloc.c lc-charset-dispatch.c mbrtowc.c mbtowc-lock.c \ - mbsinit.c mbsrtowcs-state.c mbsrtowcs.c mbtowc.c memchr.c \ - memmem.c mempcpy.c memrchr.c mkdir.c mkdtemp.c mkostemp.c \ - msvc-inval.c msvc-nothrow.c open.c openat.c opendir.c \ - rawmemchr.c readdir.c readlink.c realloc.c rename.c \ - rewinddir.c rmdir.c setenv.c setlocale-lock.c stat-w32.c \ - stat.c strchrnul.c strdup.c strerror.c strerror-override.c \ - strerror_r.c strnlen.c strstr.c strtok_r.c time_r.c unsetenv.c \ - windows-mutex.c windows-once.c windows-recmutex.c \ - windows-rwlock.c wmemchr.c wmempcpy.c + getlogin_r.c getrandom.c gettimeofday.c glob.c \ + glob_pattern_p.c globfree.c inet_ntop.c isblank.c isnan.c \ + isnand.c isnan.c isnanl.c localtime-buffer.c lstat.c malloc.c \ + lc-charset-dispatch.c mbrtowc.c mbtowc-lock.c mbsinit.c \ + mbsrtowcs-state.c mbsrtowcs.c mbtowc.c memchr.c memmem.c \ + mempcpy.c memrchr.c mkdir.c mkdtemp.c mkostemp.c msvc-inval.c \ + msvc-nothrow.c open.c openat.c opendir.c rawmemchr.c readdir.c \ + readlink.c realloc.c rename.c rewinddir.c rmdir.c setenv.c \ + setlocale-lock.c stat-w32.c stat.c strchrnul.c strdup.c \ + strerror.c strerror-override.c strerror_r.c strnlen.c strstr.c \ + strtok_r.c time_r.c unsetenv.c windows-mutex.c windows-once.c \ + windows-recmutex.c windows-rwlock.c wmemchr.c wmempcpy.c # Use this preprocessor expression to decide whether #include_next works. # Do not rely on a 'configure'-time test for this, since the expression @@ -1914,6 +1927,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getlogin_r.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getprogname.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getrandom.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gettimeofday.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glob.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glob_pattern_p.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/globfree.Po@am__quote@ @@ -1926,6 +1940,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/itold.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lc-charset-dispatch.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/localcharset.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/localtime-buffer.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lstat.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/malloc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/malloca.Po@am__quote@ @@ -3395,6 +3410,31 @@ sys/stat.h: sys_stat.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNU } > $@-t && \ mv $@-t $@ +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +sys/time.h: sys_time.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) + $(AM_V_at)$(MKDIR_P) sys + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's/@''HAVE_SYS_TIME_H''@/$(HAVE_SYS_TIME_H)/g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_SYS_TIME_H''@|$(NEXT_SYS_TIME_H)|g' \ + -e 's/@''GNULIB_GETTIMEOFDAY''@/$(GNULIB_GETTIMEOFDAY)/g' \ + -e 's|@''HAVE_WINSOCK2_H''@|$(HAVE_WINSOCK2_H)|g' \ + -e 's/@''HAVE_GETTIMEOFDAY''@/$(HAVE_GETTIMEOFDAY)/g' \ + -e 's/@''HAVE_STRUCT_TIMEVAL''@/$(HAVE_STRUCT_TIMEVAL)/g' \ + -e 's/@''REPLACE_GETTIMEOFDAY''@/$(REPLACE_GETTIMEOFDAY)/g' \ + -e 's/@''REPLACE_STRUCT_TIMEVAL''@/$(REPLACE_STRUCT_TIMEVAL)/g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ + < $(srcdir)/sys_time.in.h; \ + } > $@-t && \ + mv $@-t $@ + # We need the following in order to create when the system # doesn't have one that works with the given compiler. sys/types.h: sys_types.in.h $(top_builddir)/config.status diff --git a/gnulib/import/gettimeofday.c b/gnulib/import/gettimeofday.c new file mode 100644 [contents snipped] diff --git a/gnulib/import/localtime-buffer.c b/gnulib/import/localtime-buffer.c new file mode 100644 [contents snipped] diff --git a/gnulib/import/localtime-buffer.h b/gnulib/import/localtime-buffer.h new file mode 100644 [contents snipped] diff --git a/gnulib/import/m4/gettimeofday.m4 b/gnulib/import/m4/gettimeofday.m4 new file mode 100644 [contents snipped] diff --git a/gnulib/import/m4/gnulib-cache.m4 b/gnulib/import/m4/gnulib-cache.m4 index ce00c9ef11c..db95504cc6a 100644 --- a/gnulib/import/m4/gnulib-cache.m4 +++ b/gnulib/import/m4/gnulib-cache.m4 @@ -47,6 +47,7 @@ # fnmatch-gnu \ # frexpl \ # getcwd \ +# gettimeofday \ # glob \ # inet_ntop \ # inttypes \ @@ -87,6 +88,7 @@ gl_MODULES([ fnmatch-gnu frexpl getcwd + gettimeofday glob inet_ntop inttypes diff --git a/gnulib/import/m4/gnulib-comp.m4 b/gnulib/import/m4/gnulib-comp.m4 index e5e197c7c55..8c2c28ec932 100644 --- a/gnulib/import/m4/gnulib-comp.m4 +++ b/gnulib/import/m4/gnulib-comp.m4 @@ -102,6 +102,7 @@ AC_DEFUN([gl_EARLY], # Code from module getprogname: # Code from module getrandom: # Code from module gettext-h: + # Code from module gettimeofday: # Code from module glob: # Code from module glob-h: # Code from module hard-locale: @@ -119,6 +120,7 @@ AC_DEFUN([gl_EARLY], # Code from module limits-h: # Code from module localcharset: # Code from module locale: + # Code from module localtime-buffer: # Code from module lock: # Code from module lstat: # Code from module malloc-posix: @@ -191,6 +193,7 @@ AC_DEFUN([gl_EARLY], # Code from module sys_random: # Code from module sys_socket: # Code from module sys_stat: + # Code from module sys_time: # Code from module sys_types: # Code from module sys_uio: # Code from module tempname: @@ -399,6 +402,12 @@ AC_DEFUN([gl_INIT], gl_SYS_RANDOM_MODULE_INDICATOR([getrandom]) AC_SUBST([LIBINTL]) AC_SUBST([LTLIBINTL]) + gl_FUNC_GETTIMEOFDAY + if test $HAVE_GETTIMEOFDAY = 0 || test $REPLACE_GETTIMEOFDAY = 1; then + AC_LIBOBJ([gettimeofday]) + gl_PREREQ_GETTIMEOFDAY + fi + gl_SYS_TIME_MODULE_INDICATOR([gettimeofday]) gl_GLOB if test $HAVE_GLOB = 0 || test $REPLACE_GLOB = 1; then AC_LIBOBJ([glob]) @@ -445,6 +454,8 @@ AC_DEFUN([gl_INIT], LOCALCHARSET_TESTS_ENVIRONMENT= AC_SUBST([LOCALCHARSET_TESTS_ENVIRONMENT]) gl_LOCALE_H + AC_REQUIRE([gl_LOCALTIME_BUFFER_DEFAULTS]) + AC_LIBOBJ([localtime-buffer]) gl_LOCK gl_MODULE_INDICATOR([lock]) gl_FUNC_LSTAT @@ -697,6 +708,8 @@ AC_DEFUN([gl_INIT], AC_PROG_MKDIR_P gl_HEADER_SYS_STAT_H AC_PROG_MKDIR_P + gl_HEADER_SYS_TIME_H + AC_PROG_MKDIR_P gl_SYS_TYPES_H AC_PROG_MKDIR_P gl_HEADER_SYS_UIO @@ -962,6 +975,7 @@ AC_DEFUN([gl_FILE_LIST], [ lib/getprogname.h lib/getrandom.c lib/gettext.h + lib/gettimeofday.c lib/glob-libc.h lib/glob.c lib/glob.in.h @@ -990,6 +1004,8 @@ AC_DEFUN([gl_FILE_LIST], [ lib/localcharset.c lib/localcharset.h lib/locale.in.h + lib/localtime-buffer.c + lib/localtime-buffer.h lib/lstat.c lib/malloc.c lib/malloc/scratch_buffer.h @@ -1082,6 +1098,7 @@ AC_DEFUN([gl_FILE_LIST], [ lib/sys_socket.c lib/sys_socket.in.h lib/sys_stat.in.h + lib/sys_time.in.h lib/sys_types.in.h lib/sys_uio.in.h lib/tempname.c @@ -1164,6 +1181,7 @@ AC_DEFUN([gl_FILE_LIST], [ m4/getpagesize.m4 m4/getprogname.m4 m4/getrandom.m4 + m4/gettimeofday.m4 m4/glob.m4 m4/glob_h.m4 m4/gnulib-common.m4 @@ -1181,6 +1199,7 @@ AC_DEFUN([gl_FILE_LIST], [ m4/locale-ja.m4 m4/locale-zh.m4 m4/locale_h.m4 + m4/localtime-buffer.m4 m4/lock.m4 m4/lstat.m4 m4/malloc.m4 @@ -1248,6 +1267,7 @@ AC_DEFUN([gl_FILE_LIST], [ m4/sys_random_h.m4 m4/sys_socket_h.m4 m4/sys_stat_h.m4 + m4/sys_time_h.m4 m4/sys_types_h.m4 m4/sys_uio_h.m4 m4/tempname.m4 diff --git a/gnulib/import/m4/localtime-buffer.m4 b/gnulib/import/m4/localtime-buffer.m4 new file mode 100644 [contents snipped] diff --git a/gnulib/import/m4/sys_time_h.m4 b/gnulib/import/m4/sys_time_h.m4 new file mode 100644 [contents snipped] diff --git a/gnulib/import/sys_time.in.h b/gnulib/import/sys_time.in.h new file mode 100644 [contents snipped] diff --git a/gnulib/update-gnulib.sh b/gnulib/update-gnulib.sh index 2ca8c035263..b9cc7d8f353 100755 --- a/gnulib/update-gnulib.sh +++ b/gnulib/update-gnulib.sh @@ -39,6 +39,7 @@ IMPORTED_GNULIB_MODULES="\ fnmatch-gnu \ frexpl \ getcwd \ + gettimeofday \ glob \ inet_ntop inttypes \