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 <eblake@redhat.com>
+2010-02-22 Eric Blake <eblake@redhat.com>
+
+ 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.
+
2010-02-21 Bruno Haible <bruno@clisp.org>
* lib/stdio.in.h (obstack_printf): Fix typo.
# if @REPLACE_GETTIMEOFDAY@
# undef gettimeofday
# define gettimeofday rpl_gettimeofday
+# endif
+# if @REPLACE_GETTIMEOFDAY@ || !@HAVE_GETTIMEOFDAY@
extern int gettimeofday (struct timeval *restrict, void *restrict)
_GL_ARG_NONNULL ((1));
# endif
-# 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
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],
# Configure a replacement for <sys/time.h>.
-# serial 3
+# serial 4
# Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
[
GNULIB_GETTIMEOFDAY=0; AC_SUBST([GNULIB_GETTIMEOFDAY])
dnl Assume POSIX behavior unless another module says otherwise.
+ HAVE_GETTIMEOFDAY=1; AC_SUBST([HAVE_GETTIMEOFDAY])
HAVE_STRUCT_TIMEVAL=1; AC_SUBST([HAVE_STRUCT_TIMEVAL])
HAVE_SYS_TIME_H=1; AC_SUBST([HAVE_SYS_TIME_H])
REPLACE_GETTIMEOFDAY=0; AC_SUBST([REPLACE_GETTIMEOFDAY])
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
-e 's|@''NEXT_SYS_TIME_H''@|$(NEXT_SYS_TIME_H)|g' \
-e 's/@''GNULIB_GETTIMEOFDAY''@/$(GNULIB_GETTIMEOFDAY)/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 '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \