summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2010-02-22 09:00:06 -0700
committerEric Blake <eblake@redhat.com>2010-02-22 16:00:59 -0700
commitaff170b49eab9693cdeaf5cc3559f5c64bfdf4c9 (patch)
tree9b329a80f9150c161a79f5dff94ba98d3ba190e8 /m4
parent56ba8a8e50d7dfb086fd3bb95e5542b1929e96a6 (diff)
downloadgnulib-aff170b49eab9693cdeaf5cc3559f5c64bfdf4c9.tar.gz
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 <eblake@redhat.com>
Diffstat (limited to 'm4')
-rw-r--r--m4/gettimeofday.m48
-rw-r--r--m4/sys_time_h.m43
2 files changed, 8 insertions, 3 deletions
diff --git a/m4/gettimeofday.m4 b/m4/gettimeofday.m4
index 32e4f29a9f..709a4d4fb4 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 b14bc4ba2b..be6d7ecbfa 100644
--- a/m4/sys_time_h.m4
+++ b/m4/sys_time_h.m4
@@ -1,5 +1,5 @@
# 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
@@ -63,6 +63,7 @@ AC_DEFUN([gl_HEADER_SYS_TIME_H_DEFAULTS],
[
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])