diff options
-rw-r--r-- | Makefile.in | 2 | ||||
-rw-r--r-- | aclocal.m4 | 192 | ||||
-rw-r--r-- | lib/ChangeLog | 10 | ||||
-rw-r--r-- | lib/Makefile.in | 31 | ||||
-rw-r--r-- | m4/Makefile.in | 1 |
5 files changed, 135 insertions, 101 deletions
diff --git a/Makefile.in b/Makefile.in index 25062386d..2c39bb01b 100644 --- a/Makefile.in +++ b/Makefile.in @@ -216,7 +216,7 @@ $(top_builddir)/config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(srcdir)/configure: $(srcdir)/configure.ac $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) cd $(srcdir) && $(AUTOCONF) -$(ACLOCAL_M4): configure.ac m4/acl.m4 m4/afs.m4 m4/alloca.m4 m4/assert.m4 m4/bison.m4 m4/boottime.m4 m4/c-stack.m4 m4/canonicalize.m4 m4/check-decl.m4 m4/chown.m4 m4/codeset.m4 m4/d-ino.m4 m4/d-type.m4 m4/dirfd.m4 m4/dos.m4 m4/error.m4 m4/extensions.m4 m4/fnmatch.m4 m4/fpending.m4 m4/fstypename.m4 m4/fsusage.m4 m4/ftruncate.m4 m4/ftw.m4 m4/getcwd-path-max.m4 m4/getcwd.m4 m4/getgroups.m4 m4/getline.m4 m4/getndelim2.m4 m4/gettext.m4 m4/gettimeofday.m4 m4/glibc.m4 m4/glibc21.m4 m4/group-member.m4 m4/host-os.m4 m4/human.m4 m4/iconv.m4 m4/intdiv0.m4 m4/intmax_t.m4 m4/inttypes-pri.m4 m4/inttypes.m4 m4/inttypes_h.m4 m4/isc-posix.m4 m4/jm-macros.m4 m4/jm-mktime.m4 m4/jm-winsz1.m4 m4/jm-winsz2.m4 m4/lchown.m4 m4/lcmessage.m4 m4/lib-check.m4 m4/lib-ld.m4 m4/lib-link.m4 m4/lib-prefix.m4 m4/link-follow.m4 m4/longdouble.m4 m4/longlong.m4 m4/ls-mntd-fs.m4 m4/lstat.m4 m4/mbrtowc.m4 m4/mbswidth.m4 m4/memcmp.m4 m4/memcoll.m4 m4/mkdir-slash.m4 m4/mkstemp.m4 m4/mktime.m4 m4/nanosleep.m4 m4/onceonly.m4 m4/open-max.m4 m4/perl.m4 m4/prereq.m4 m4/progtest.m4 m4/putenv.m4 m4/readdir.m4 m4/regex.m4 m4/rename.m4 m4/restrict.m4 m4/rmdir-errno.m4 m4/search-libs.m4 m4/signed.m4 m4/ssize_t.m4 m4/st_dm_mode.m4 m4/st_mtim.m4 m4/stat.m4 m4/stdbool.m4 m4/stdint_h.m4 m4/strftime.m4 m4/timespec.m4 m4/tm_gmtoff.m4 m4/tzset.m4 m4/uintmax_t.m4 m4/unlink-busy.m4 m4/unlocked-io.m4 m4/uptime.m4 m4/utimbuf.m4 m4/utime.m4 m4/utimes.m4 m4/vasnprintf.m4 m4/vasprintf.m4 m4/wchar_t.m4 m4/wint_t.m4 m4/xstrtoimax.m4 m4/xstrtoumax.m4 +$(ACLOCAL_M4): configure.ac m4/acl.m4 m4/afs.m4 m4/alloca.m4 m4/assert.m4 m4/bison.m4 m4/boottime.m4 m4/c-stack.m4 m4/canonicalize.m4 m4/check-decl.m4 m4/chown.m4 m4/codeset.m4 m4/d-ino.m4 m4/d-type.m4 m4/dirfd.m4 m4/dos.m4 m4/error.m4 m4/extensions.m4 m4/fnmatch.m4 m4/fpending.m4 m4/fstypename.m4 m4/fsusage.m4 m4/ftruncate.m4 m4/ftw.m4 m4/getcwd-path-max.m4 m4/getcwd.m4 m4/getgroups.m4 m4/getline.m4 m4/getndelim2.m4 m4/gettext.m4 m4/gettimeofday.m4 m4/glibc.m4 m4/glibc21.m4 m4/group-member.m4 m4/host-os.m4 m4/human.m4 m4/iconv.m4 m4/intdiv0.m4 m4/intmax_t.m4 m4/inttypes-pri.m4 m4/inttypes.m4 m4/inttypes_h.m4 m4/isc-posix.m4 m4/jm-macros.m4 m4/jm-mktime.m4 m4/jm-winsz1.m4 m4/jm-winsz2.m4 m4/lchown.m4 m4/lcmessage.m4 m4/lib-check.m4 m4/lib-ld.m4 m4/lib-link.m4 m4/lib-prefix.m4 m4/link-follow.m4 m4/longdouble.m4 m4/longlong.m4 m4/ls-mntd-fs.m4 m4/lstat.m4 m4/mbrtowc.m4 m4/mbswidth.m4 m4/memcmp.m4 m4/memcoll.m4 m4/mkdir-slash.m4 m4/mkstemp.m4 m4/mktime.m4 m4/nanosleep.m4 m4/onceonly.m4 m4/open-max.m4 m4/perl.m4 m4/prereq.m4 m4/progtest.m4 m4/putenv.m4 m4/readdir.m4 m4/regex.m4 m4/rename.m4 m4/restrict.m4 m4/rmdir-errno.m4 m4/search-libs.m4 m4/signed.m4 m4/ssize_t.m4 m4/st_dm_mode.m4 m4/st_mtim.m4 m4/stat.m4 m4/stdbool.m4 m4/stdint_h.m4 m4/strftime.m4 m4/timespec.m4 m4/tm_gmtoff.m4 m4/tzset.m4 m4/uintmax_t.m4 m4/unlink-busy.m4 m4/unlocked-io.m4 m4/uptime.m4 m4/utimbuf.m4 m4/utime.m4 m4/utimens.m4 m4/utimes.m4 m4/vasnprintf.m4 m4/vasprintf.m4 m4/wchar_t.m4 m4/wint_t.m4 m4/xstrtoimax.m4 m4/xstrtoumax.m4 cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) config.h: stamp-h1 diff --git a/aclocal.m4 b/aclocal.m4 index 24475a536..09d335eae 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1863,6 +1863,7 @@ AC_DEFUN([jm_PREREQ], AC_REQUIRE([jm_PREREQ_STAT]) AC_REQUIRE([jm_PREREQ_STRNLEN]) AC_REQUIRE([jm_PREREQ_TEMPNAME]) # called by mkstemp + AC_REQUIRE([gl_UTIMENS]) AC_REQUIRE([jm_PREREQ_XGETCWD]) AC_REQUIRE([jm_PREREQ_XREADLINK]) ]) @@ -2418,6 +2419,108 @@ AC_DEFUN([jm_FUNC_MBRTOWC], fi ]) +dnl Copyright (C) 2003 Free Software Foundation, Inc. +dnl This file is free software, distributed under the terms of the GNU +dnl General Public License. As a special exception to the GNU General +dnl Public License, this file may be distributed as part of a program +dnl that contains a configuration script generated by Autoconf, under +dnl the same distribution terms as the rest of that program. + +AC_DEFUN([gl_UTIMENS], +[ + dnl Prerequisites of lib/utimens.c. + AC_REQUIRE([gl_TIMESPEC]) + AC_REQUIRE([jm_CHECK_TYPE_STRUCT_TIMESPEC]) + AC_REQUIRE([jm_CHECK_TYPE_STRUCT_UTIMBUF]) + AC_CHECK_FUNCS_ONCE(utime) +]) + +#serial 7 + +dnl From Jim Meyering + +AC_DEFUN([gl_TIMESPEC], +[ + dnl Prerequisites of lib/timespec.h. + AC_REQUIRE([AC_HEADER_TIME]) + AC_CHECK_HEADERS_ONCE(sys/time.h) + jm_CHECK_TYPE_STRUCT_TIMESPEC + AC_STRUCT_ST_MTIM_NSEC + + dnl Persuade glibc <time.h> to declare nanosleep(). + AC_REQUIRE([AC_GNU_SOURCE]) + + AC_CHECK_DECLS(nanosleep, , , [#include <time.h>]) +]) + +dnl Define HAVE_STRUCT_TIMESPEC if `struct timespec' is declared +dnl in time.h or sys/time.h. + +AC_DEFUN([jm_CHECK_TYPE_STRUCT_TIMESPEC], +[ + dnl Persuade pedantic Solaris to declare struct timespec. + AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + + AC_REQUIRE([AC_HEADER_TIME]) + AC_CHECK_HEADERS_ONCE(sys/time.h) + AC_CACHE_CHECK([for struct timespec], fu_cv_sys_struct_timespec, + [AC_TRY_COMPILE( + [ +# if TIME_WITH_SYS_TIME +# include <sys/time.h> +# include <time.h> +# else +# if HAVE_SYS_TIME_H +# include <sys/time.h> +# else +# include <time.h> +# endif +# endif + ], + [static struct timespec x; x.tv_sec = x.tv_nsec;], + fu_cv_sys_struct_timespec=yes, + fu_cv_sys_struct_timespec=no) + ]) + + if test $fu_cv_sys_struct_timespec = yes; then + AC_DEFINE(HAVE_STRUCT_TIMESPEC, 1, + [Define if struct timespec is declared in <time.h>. ]) + fi +]) + +#serial 6 + +dnl From Paul Eggert. + +# Define ST_MTIM_NSEC to be the nanoseconds member of struct stat's st_mtim, +# if it exists. + +AC_DEFUN([AC_STRUCT_ST_MTIM_NSEC], + [AC_CACHE_CHECK([for nanoseconds member of struct stat.st_mtim], + ac_cv_struct_st_mtim_nsec, + [ac_save_CPPFLAGS="$CPPFLAGS" + ac_cv_struct_st_mtim_nsec=no + # tv_nsec -- the usual case + # _tv_nsec -- Solaris 2.6, if + # (defined _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED == 1 + # && !defined __EXTENSIONS__) + # st__tim.tv_nsec -- UnixWare 2.1.2 + for ac_val in tv_nsec _tv_nsec st__tim.tv_nsec; do + CPPFLAGS="$ac_save_CPPFLAGS -DST_MTIM_NSEC=$ac_val" + AC_TRY_COMPILE([#include <sys/types.h> +#include <sys/stat.h>], [struct stat s; s.st_mtim.ST_MTIM_NSEC;], + [ac_cv_struct_st_mtim_nsec=$ac_val; break]) + done + CPPFLAGS="$ac_save_CPPFLAGS"]) + + if test $ac_cv_struct_st_mtim_nsec != no; then + AC_DEFINE_UNQUOTED(ST_MTIM_NSEC, $ac_cv_struct_st_mtim_nsec, + [Define to be the nanoseconds member of struct stat's st_mtim, + if it exists.]) + fi + ] +) + #serial 5 dnl A replacement for autoconf's macro by the same name. This version @@ -4368,6 +4471,9 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF], AC_REQUIRE([gt_TYPE_WCHAR_T]) AC_REQUIRE([gt_TYPE_WINT_T]) AC_CHECK_FUNCS(snprintf) + + # Solaris 2.5.1 needs -lw to get the wcslen function. + AC_SEARCH_LIBS(wcslen, [w]) ]) # Prerequisites of lib/asnprintf.c. @@ -6470,39 +6576,6 @@ AC_DEFUN([AC_FUNC_CANONICALIZE_FILE_NAME], AC_CHECK_FUNC([canonicalize_file_name], , [AC_LIBOBJ(canonicalize)]) ]) -#serial 6 - -dnl From Paul Eggert. - -# Define ST_MTIM_NSEC to be the nanoseconds member of struct stat's st_mtim, -# if it exists. - -AC_DEFUN([AC_STRUCT_ST_MTIM_NSEC], - [AC_CACHE_CHECK([for nanoseconds member of struct stat.st_mtim], - ac_cv_struct_st_mtim_nsec, - [ac_save_CPPFLAGS="$CPPFLAGS" - ac_cv_struct_st_mtim_nsec=no - # tv_nsec -- the usual case - # _tv_nsec -- Solaris 2.6, if - # (defined _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED == 1 - # && !defined __EXTENSIONS__) - # st__tim.tv_nsec -- UnixWare 2.1.2 - for ac_val in tv_nsec _tv_nsec st__tim.tv_nsec; do - CPPFLAGS="$ac_save_CPPFLAGS -DST_MTIM_NSEC=$ac_val" - AC_TRY_COMPILE([#include <sys/types.h> -#include <sys/stat.h>], [struct stat s; s.st_mtim.ST_MTIM_NSEC;], - [ac_cv_struct_st_mtim_nsec=$ac_val; break]) - done - CPPFLAGS="$ac_save_CPPFLAGS"]) - - if test $ac_cv_struct_st_mtim_nsec != no; then - AC_DEFINE_UNQUOTED(ST_MTIM_NSEC, $ac_cv_struct_st_mtim_nsec, - [Define to be the nanoseconds member of struct stat's st_mtim, - if it exists.]) - fi - ] -) - #serial 3 # Define HAVE_ST_DM_MODE if struct stat has an st_dm_mode member. @@ -6521,59 +6594,6 @@ AC_DEFUN([AC_STRUCT_ST_DM_MODE], ] ) -#serial 7 - -dnl From Jim Meyering - -AC_DEFUN([gl_TIMESPEC], -[ - dnl Prerequisites of lib/timespec.h. - AC_REQUIRE([AC_HEADER_TIME]) - AC_CHECK_HEADERS_ONCE(sys/time.h) - jm_CHECK_TYPE_STRUCT_TIMESPEC - AC_STRUCT_ST_MTIM_NSEC - - dnl Persuade glibc <time.h> to declare nanosleep(). - AC_REQUIRE([AC_GNU_SOURCE]) - - AC_CHECK_DECLS(nanosleep, , , [#include <time.h>]) -]) - -dnl Define HAVE_STRUCT_TIMESPEC if `struct timespec' is declared -dnl in time.h or sys/time.h. - -AC_DEFUN([jm_CHECK_TYPE_STRUCT_TIMESPEC], -[ - dnl Persuade pedantic Solaris to declare struct timespec. - AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) - - AC_REQUIRE([AC_HEADER_TIME]) - AC_CHECK_HEADERS_ONCE(sys/time.h) - AC_CACHE_CHECK([for struct timespec], fu_cv_sys_struct_timespec, - [AC_TRY_COMPILE( - [ -# if TIME_WITH_SYS_TIME -# include <sys/time.h> -# include <time.h> -# else -# if HAVE_SYS_TIME_H -# include <sys/time.h> -# else -# include <time.h> -# endif -# endif - ], - [static struct timespec x; x.tv_sec = x.tv_nsec;], - fu_cv_sys_struct_timespec=yes, - fu_cv_sys_struct_timespec=no) - ]) - - if test $fu_cv_sys_struct_timespec = yes; then - AC_DEFINE(HAVE_STRUCT_TIMESPEC, 1, - [Define if struct timespec is declared in <time.h>. ]) - fi -]) - #serial 6 dnl From Jim Meyering and Paul Eggert. AC_DEFUN([jm_HEADER_TIOCGWINSZ_IN_TERMIOS_H], diff --git a/lib/ChangeLog b/lib/ChangeLog index b657e630b..8a54a0db3 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,5 +1,15 @@ 2003-08-09 Jim Meyering <jim@meyering.net> + * utimens.c (utimens): Test HAVE_UTIME, not HAVE_UTIMES. + Prefer utime, since it works and utimes doesn't on some systems. + +2003-08-06 Paul Eggert <eggert@twinsun.com> + + * Makefile.am (libeftish_a_SOURCES): Add utimens.c, utimens.h. + * utimens.c, utimens.h: New files. + +2003-08-09 Jim Meyering <jim@meyering.net> + * unicodeio.c (unicode_to_mb): Change Solaris 2.7 to Solaris 5.7 in comment. * putenv.c: Likewise. diff --git a/lib/Makefile.in b/lib/Makefile.in index 7ab44a850..aab55467b 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -242,6 +242,7 @@ libfetish_a_SOURCES = \ unistd-safer.h \ unlocked-io.h \ userspec.c \ + utimens.c utimens.h \ version-etc.c version-etc.h \ xalloc.h \ xgetcwd.c xgetcwd.h \ @@ -313,12 +314,12 @@ am_libfetish_a_OBJECTS = acl.$(OBJEXT) getdate.$(OBJEXT) \ safe-read.$(OBJEXT) safe-write.$(OBJEXT) same.$(OBJEXT) \ save-cwd.$(OBJEXT) savedir.$(OBJEXT) settime.$(OBJEXT) \ sha.$(OBJEXT) stripslash.$(OBJEXT) umaxtostr.$(OBJEXT) \ - unicodeio.$(OBJEXT) userspec.$(OBJEXT) version-etc.$(OBJEXT) \ - xgetcwd.$(OBJEXT) xgethostname.$(OBJEXT) xmalloc.$(OBJEXT) \ - xmemcoll.$(OBJEXT) xnanosleep.$(OBJEXT) xreadlink.$(OBJEXT) \ - xstrdup.$(OBJEXT) xstrndup.$(OBJEXT) xstrtod.$(OBJEXT) \ - xstrtol.$(OBJEXT) xstrtoul.$(OBJEXT) xstrtoimax.$(OBJEXT) \ - xstrtoumax.$(OBJEXT) yesno.$(OBJEXT) + unicodeio.$(OBJEXT) userspec.$(OBJEXT) utimens.$(OBJEXT) \ + version-etc.$(OBJEXT) xgetcwd.$(OBJEXT) xgethostname.$(OBJEXT) \ + xmalloc.$(OBJEXT) xmemcoll.$(OBJEXT) xnanosleep.$(OBJEXT) \ + xreadlink.$(OBJEXT) xstrdup.$(OBJEXT) xstrndup.$(OBJEXT) \ + xstrtod.$(OBJEXT) xstrtol.$(OBJEXT) xstrtoul.$(OBJEXT) \ + xstrtoimax.$(OBJEXT) xstrtoumax.$(OBJEXT) yesno.$(OBJEXT) libfetish_a_OBJECTS = $(am_libfetish_a_OBJECTS) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) @@ -393,14 +394,15 @@ am__depfiles_maybe = depfiles @AMDEP_TRUE@ ./$(DEPDIR)/settime.Po ./$(DEPDIR)/sha.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/strftime.Po ./$(DEPDIR)/stripslash.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/umaxtostr.Po ./$(DEPDIR)/unicodeio.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/userspec.Po ./$(DEPDIR)/version-etc.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/xgetcwd.Po ./$(DEPDIR)/xgethostname.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/xmalloc.Po ./$(DEPDIR)/xmemcoll.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/xnanosleep.Po ./$(DEPDIR)/xreadlink.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/xstrdup.Po ./$(DEPDIR)/xstrndup.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/xstrtod.Po ./$(DEPDIR)/xstrtoimax.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/xstrtol.Po ./$(DEPDIR)/xstrtoul.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/xstrtoumax.Po ./$(DEPDIR)/yesno.Po +@AMDEP_TRUE@ ./$(DEPDIR)/userspec.Po ./$(DEPDIR)/utimens.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/version-etc.Po ./$(DEPDIR)/xgetcwd.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/xgethostname.Po ./$(DEPDIR)/xmalloc.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/xmemcoll.Po ./$(DEPDIR)/xnanosleep.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/xreadlink.Po ./$(DEPDIR)/xstrdup.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/xstrndup.Po ./$(DEPDIR)/xstrtod.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/xstrtoimax.Po ./$(DEPDIR)/xstrtol.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/xstrtoul.Po ./$(DEPDIR)/xstrtoumax.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/yesno.Po COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) @@ -589,6 +591,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/umaxtostr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unicodeio.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/userspec.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utimens.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/version-etc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xgetcwd.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xgethostname.Po@am__quote@ diff --git a/m4/Makefile.in b/m4/Makefile.in index 15998a0ec..18ae84af0 100644 --- a/m4/Makefile.in +++ b/m4/Makefile.in @@ -248,6 +248,7 @@ unlocked-io.m4 \ uptime.m4 \ utimbuf.m4 \ utime.m4 \ +utimens.m4 \ utimes.m4 \ vasnprintf.m4 \ vasprintf.m4 \ |