From 55afb299b5f091486e3d8bc49f31b7b9f3fbe3fb Mon Sep 17 00:00:00 2001 From: Eric Blake
Date: Mon, 22 Feb 2010 09:00:06 -0700 Subject: [PATCH] gettimeofday: restore support for platforms that lack function Fixes a regression from 2010-02-04, commit de4d0a3. * m4/gettimeofday.m4 (gl_FUNC_GETTIMEOFDAY): Also compile replacement if function is missing. * m4/sys_time_h.m4 (gl_HEADER_SYS_TIME_H_DEFAULTS): New witness. * modules/sys_time (Makefile.am): Substitute it. * lib/sys_time.in.h (gettimeofday): Check it. Reported by Michael Goffioul. Signed-off-by: Eric Blake --- ChangeLog | 8 ++++++++ lib/sys_time.in.h | 2 ++ m4/gettimeofday.m4 | 8 ++++++-- m4/sys_time_h.m4 | 3 ++- modules/sys_time | 1 + 5 files changed, 19 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6887124..a57be62 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,13 @@ 2010-02-22 Eric Blake + gettimeofday: restore support for platforms that lack function + * m4/gettimeofday.m4 (gl_FUNC_GETTIMEOFDAY): Also compile + replacement if function is missing. + * m4/sys_time_h.m4 (gl_HEADER_SYS_TIME_H_DEFAULTS): New witness. + * modules/sys_time (Makefile.am): Substitute it. + * lib/sys_time.in.h (gettimeofday): Check it. + Reported by Michael Goffioul. + bootstrap: use GNULIB_SRCDIR to reduce disk usage * build-aux/bootstrap (GNULIB_SRCDIR): If set, use as a reference, rather than reconfiguring where the submodule points. diff --git a/lib/sys_time.in.h b/lib/sys_time.in.h index 12f0860..fe7f624 100644 --- a/lib/sys_time.in.h +++ b/lib/sys_time.in.h @@ -59,6 +59,8 @@ struct timeval # if @REPLACE_GETTIMEOFDAY@ # undef gettimeofday # define gettimeofday rpl_gettimeofday +# endif +# if @REPLACE_GETTIMEOFDAY@ || address@hidden@ extern int gettimeofday (struct timeval *restrict, void *restrict) _GL_ARG_NONNULL ((1)); # endif diff --git a/m4/gettimeofday.m4 b/m4/gettimeofday.m4 index 32e4f29..709a4d4 100644 --- a/m4/gettimeofday.m4 +++ b/m4/gettimeofday.m4 @@ -1,4 +1,4 @@ -# serial 14 +# serial 15 # Copyright (C) 2001-2003, 2005, 2007, 2009-2010 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation @@ -15,7 +15,11 @@ AC_DEFUN([gl_FUNC_GETTIMEOFDAY], AC_CHECK_FUNCS_ONCE([gettimeofday]) gl_gettimeofday_timezone=void - if test $ac_cv_func_gettimeofday = yes; then + if test $ac_cv_func_gettimeofday != yes; then + HAVE_GETTIMEOFDAY=0 + AC_LIBOBJ([gettimeofday]) + gl_PREREQ_GETTIMEOFDAY + else gl_FUNC_GETTIMEOFDAY_CLOBBER AC_CACHE_CHECK([for gettimeofday with POSIX signature], [gl_cv_func_gettimeofday_posix_signature], diff --git a/m4/sys_time_h.m4 b/m4/sys_time_h.m4 index b14bc4b..be6d7ec 100644 --- a/m4/sys_time_h.m4 +++ b/m4/sys_time_h.m4 @@ -1,5 +1,5 @@ # Configure a replacement for