From: Jim Meyering Date: Sun, 28 Jan 2007 18:55:01 +0000 (+0000) Subject: * modules/sys_time (Makefile.am): Build sys/time.h only when it's the X-Git-Tag: cvs-readonly~1175 X-Git-Url: http://erislabs.net/gitweb/?a=commitdiff_plain;h=1d4024b4187e22048a33e5baf953183fc2dedeb3;p=gnulib.git * modules/sys_time (Makefile.am): Build sys/time.h only when it's the value of $(SYS_TIME_H). [MOSTLYCLEANFILES]: Now that sys/time.h is created only when needed, remove it conditionally, too. * m4/sys_time_h.m4 (gl_HEADER_SYS_TIME_H_BODY): Set SYS_TIME_H. * m4/gettimeofday.m4 (gl_FUNC_GETTIMEOFDAY): (gl_FUNC_GETTIMEOFDAY_CLOBBER): Set SYS_TIME_H when setting GETTIMEOFDAY_REPLACEMENT to 1. 2007-01-28 Bruno Haible --- diff --git a/ChangeLog b/ChangeLog index 886120a6c..6f32be165 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,16 @@ 2007-01-28 Bruno Haible + * modules/sys_time (Makefile.am): Build sys/time.h only when it's the + value of $(SYS_TIME_H). + [MOSTLYCLEANFILES]: Now that sys/time.h is created only when needed, + remove it conditionally, too. + * m4/sys_time_h.m4 (gl_HEADER_SYS_TIME_H_BODY): Set SYS_TIME_H. + * m4/gettimeofday.m4 (gl_FUNC_GETTIMEOFDAY): + (gl_FUNC_GETTIMEOFDAY_CLOBBER): Set SYS_TIME_H when setting + GETTIMEOFDAY_REPLACEMENT to 1. + +2007-01-28 Bruno Haible + * m4/unistd_h.m4 (gl_HEADER_UNISTD_DEFAULTS): New macro. (gl_HEADER_UNISTD): Require it. Don't set UNISTD_H to empty here. * m4/fchdir.m4 (gl_FUNC_FCHDIR): Require gl_HEADER_UNISTD_DEFAULTS. diff --git a/m4/gettimeofday.m4 b/m4/gettimeofday.m4 index 655e2768e..770434ad9 100644 --- a/m4/gettimeofday.m4 +++ b/m4/gettimeofday.m4 @@ -32,6 +32,7 @@ AC_DEFUN([gl_FUNC_GETTIMEOFDAY], if test $gl_cv_func_gettimeofday_posix_signature != yes; then GETTIMEOFDAY_REPLACEMENT=1 + SYS_TIME_H=sys/time.h if test $gl_cv_func_gettimeofday_clobber != yes; then AC_LIBOBJ(gettimeofday) gl_PREREQ_GETTIMEOFDAY @@ -77,6 +78,7 @@ AC_DEFUN([gl_FUNC_GETTIMEOFDAY_CLOBBER], if test $gl_cv_func_gettimeofday_clobber = yes; then GETTIMEOFDAY_REPLACEMENT=1 + SYS_TIME_H=sys/time.h gl_GETTIMEOFDAY_REPLACE_LOCALTIME AC_DEFINE([GETTIMEOFDAY_CLOBBERS_LOCALTIME], 1, [Define if gettimeofday clobbers the localtime buffer.]) diff --git a/m4/sys_time_h.m4 b/m4/sys_time_h.m4 index dbd60c3a2..fc29f88e5 100644 --- a/m4/sys_time_h.m4 +++ b/m4/sys_time_h.m4 @@ -52,4 +52,10 @@ AC_DEFUN([gl_HEADER_SYS_TIME_H_BODY], dnl Assume POSIX behavior unless another module says otherwise. GETTIMEOFDAY_REPLACEMENT=0 AC_SUBST([GETTIMEOFDAY_REPLACEMENT]) + 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]) ]) diff --git a/modules/sys_time b/modules/sys_time index 80be27d0f..006b7afe7 100644 --- a/modules/sys_time +++ b/modules/sys_time @@ -13,7 +13,7 @@ gl_HEADER_SYS_TIME_H AC_PROG_MKDIR_P Makefile.am: -BUILT_SOURCES += sys/time.h +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. @@ -28,7 +28,7 @@ sys/time.h: sys_time_.h < $(srcdir)/sys_time_.h; \ } > $@-t mv $@-t $@ -MOSTLYCLEANFILES += sys/time.h sys/time.h-t +MOSTLYCLEANFILES += $(SYS_TIME_H) sys/time.h-t Include: #include