From 434f9efa9a3d61cf3ae3fe90ff2c0492bb42fa64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= Date: Thu, 21 May 2009 19:42:01 +0000 Subject: [PATCH] merging coreutils-7.4 into trunk git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30823 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- build/jam/HaikuImage | 11 +- src/bin/coreutils/AUTHORS | 44 +- src/bin/coreutils/COPYING | 841 +- src/bin/coreutils/ChangeLog | 11365 +-- src/bin/coreutils/ChangeLog-2005 | 605 + src/bin/coreutils/ChangeLog-2006 | 4040 + src/bin/coreutils/ChangeLog-2007 | 4022 + src/bin/coreutils/ChangeLog-2008 | 379 + src/bin/coreutils/GNUmakefile | 105 +- src/bin/coreutils/INSTALL | 110 +- src/bin/coreutils/Makefile.am | 156 +- src/bin/coreutils/Makefile.cfg | 40 - src/bin/coreutils/Makefile.in | 919 +- src/bin/coreutils/Makefile.maint | 623 - src/bin/coreutils/NEWS | 665 +- src/bin/coreutils/README | 90 +- src/bin/coreutils/THANKS | 86 +- src/bin/coreutils/THANKS-to-translators | 70 +- src/bin/coreutils/TODO | 120 +- src/bin/coreutils/aclocal.m4 | 445 +- src/bin/coreutils/bootstrap | 453 +- src/bin/coreutils/bootstrap.conf | 312 +- src/bin/coreutils/configure | 63344 +++++++--------- src/bin/coreutils/configure.ac | 329 +- .../doc/{ChangeLog => ChangeLog-2007} | 39 + src/bin/coreutils/doc/Makefile.am | 103 +- src/bin/coreutils/doc/Makefile.in | 842 +- src/bin/coreutils/doc/constants.texi | 1 + src/bin/coreutils/doc/coreutils.info | 4781 +- src/bin/coreutils/doc/coreutils.texi | 2352 +- src/bin/coreutils/doc/fdl.texi | 88 +- src/bin/coreutils/doc/getdate.texi | 15 +- src/bin/coreutils/doc/perm.texi | 4 +- src/bin/coreutils/doc/stamp-vti | 8 +- src/bin/coreutils/doc/version.texi | 8 +- .../lib/{ChangeLog => ChangeLog-2007} | 5 + src/bin/coreutils/lib/Jamfile | 45 +- src/bin/coreutils/lib/Makefile.am | 27 +- src/bin/coreutils/lib/Makefile.in | 2059 +- src/bin/coreutils/lib/acl-internal.h | 208 +- src/bin/coreutils/lib/acl.c | 256 - src/bin/coreutils/lib/acl.h | 20 +- src/bin/coreutils/lib/acl_entries.c | 68 +- src/bin/coreutils/lib/alloca.c | 5 +- .../coreutils/lib/{alloca_.h => alloca.in.h} | 15 +- ...link-with-size.c => areadlink-with-size.c} | 43 +- src/bin/coreutils/lib/areadlink.h | 23 + src/bin/coreutils/lib/argmatch.c | 9 +- src/bin/coreutils/lib/argmatch.h | 9 +- src/bin/coreutils/lib/argv-iter.c | 117 + src/bin/coreutils/lib/argv-iter.h | 47 + .../lib/{inet_ntop.h => arpa_inet.in.h} | 69 +- src/bin/coreutils/lib/asnprintf.c | 5 +- src/bin/coreutils/lib/asprintf.c | 13 +- src/bin/coreutils/lib/at-func.c | 9 +- src/bin/coreutils/lib/backupfile.c | 10 +- src/bin/coreutils/lib/backupfile.h | 10 +- src/bin/coreutils/lib/base64.c | 50 +- src/bin/coreutils/lib/base64.h | 22 +- src/bin/coreutils/lib/basename.c | 9 +- src/bin/coreutils/lib/btowc.c | 38 + src/bin/coreutils/lib/buffer-lcm.c | 9 +- src/bin/coreutils/lib/c-ctype.c | 5 +- src/bin/coreutils/lib/c-ctype.h | 22 +- src/bin/coreutils/lib/c-strcase.h | 5 +- src/bin/coreutils/lib/c-strcasecmp.c | 5 +- src/bin/coreutils/lib/c-strncasecmp.c | 5 +- src/bin/coreutils/lib/c-strtod.c | 57 +- src/bin/coreutils/lib/c-strtod.h | 39 +- src/bin/coreutils/lib/calloc.c | 60 +- src/bin/coreutils/lib/canon-host.c | 24 +- src/bin/coreutils/lib/canon-host.h | 19 +- src/bin/coreutils/lib/canonicalize.c | 60 +- src/bin/coreutils/lib/canonicalize.h | 10 +- src/bin/coreutils/lib/chdir-long.c | 12 +- src/bin/coreutils/lib/chdir-long.h | 9 +- src/bin/coreutils/lib/chown.c | 9 +- src/bin/coreutils/lib/cloexec.c | 9 +- src/bin/coreutils/lib/close-hook.c | 94 + src/bin/coreutils/lib/close-hook.h | 75 + src/bin/coreutils/lib/close-stream.c | 17 +- src/bin/coreutils/lib/close.c | 42 + src/bin/coreutils/lib/closein.c | 111 + src/bin/coreutils/lib/closein.h | 32 + src/bin/coreutils/lib/closeout.c | 52 +- src/bin/coreutils/lib/closeout.h | 15 +- src/bin/coreutils/lib/config.charset | 84 +- src/bin/coreutils/lib/config.h | 18 +- src/bin/coreutils/lib/config.hin | 708 +- src/bin/coreutils/lib/copy-acl.c | 553 + src/bin/coreutils/lib/creat-safer.c | 9 +- src/bin/coreutils/lib/cycle-check.c | 10 +- src/bin/coreutils/lib/cycle-check.h | 10 +- src/bin/coreutils/lib/diacrit.c | 10 +- src/bin/coreutils/lib/diacrit.h | 10 +- src/bin/coreutils/lib/dirchownmod.c | 13 +- src/bin/coreutils/lib/dirent.in.h | 98 + src/bin/coreutils/lib/dirfd.c | 19 +- src/bin/coreutils/lib/dirfd.h | 29 - src/bin/coreutils/lib/dirname.c | 9 +- src/bin/coreutils/lib/dirname.h | 9 +- src/bin/coreutils/lib/dup-safer.c | 15 +- src/bin/coreutils/lib/dup2.c | 9 +- src/bin/coreutils/lib/errno.in.h | 158 + src/bin/coreutils/lib/error.c | 14 +- src/bin/coreutils/lib/error.h | 15 +- src/bin/coreutils/lib/euidaccess-stat.c | 11 +- src/bin/coreutils/lib/euidaccess.c | 14 +- src/bin/coreutils/lib/euidaccess.h | 3 - src/bin/coreutils/lib/exclude.c | 10 +- src/bin/coreutils/lib/exclude.h | 10 +- src/bin/coreutils/lib/exitfail.c | 10 +- src/bin/coreutils/lib/exitfail.h | 10 +- src/bin/coreutils/lib/fchdir.c | 93 +- src/bin/coreutils/lib/fchmodat.c | 9 +- src/bin/coreutils/lib/fchownat.c | 10 +- src/bin/coreutils/lib/fclose.c | 47 + src/bin/coreutils/lib/fcntl--.h | 9 +- src/bin/coreutils/lib/fcntl-safer.h | 9 +- .../coreutils/lib/{fcntl_.h => fcntl.in.h} | 54 +- src/bin/coreutils/lib/fd-reopen.c | 17 +- src/bin/coreutils/lib/fd-reopen.h | 9 +- src/bin/coreutils/lib/fd-safer.c | 17 +- src/bin/coreutils/lib/fflush.c | 204 + src/bin/coreutils/lib/file-has-acl.c | 489 +- src/bin/coreutils/lib/file-set.c | 74 + src/bin/coreutils/lib/file-set.h | 12 + src/bin/coreutils/lib/file-type.c | 9 +- src/bin/coreutils/lib/file-type.h | 9 +- src/bin/coreutils/lib/fileblocks.c | 9 +- src/bin/coreutils/lib/filemode.c | 9 +- src/bin/coreutils/lib/filemode.h | 9 +- src/bin/coreutils/lib/filenamecat.c | 66 +- src/bin/coreutils/lib/filenamecat.h | 14 +- src/bin/coreutils/lib/filevercmp.c | 181 + src/bin/coreutils/lib/filevercmp.h | 42 + src/bin/coreutils/lib/float+.h | 151 + src/bin/coreutils/lib/float.in.h | 62 + src/bin/coreutils/lib/fnmatch.c | 7 +- .../lib/{fnmatch_.h => fnmatch.in.h} | 5 +- src/bin/coreutils/lib/fnmatch_loop.c | 5 +- src/bin/coreutils/lib/fopen-safer.c | 16 +- .../lib/{__fpending.c => fpending.c} | 15 +- .../lib/{__fpending.h => fpending.h} | 9 +- src/bin/coreutils/lib/fprintftime.h | 11 +- src/bin/coreutils/lib/fpucw.h | 107 + src/bin/coreutils/lib/fpurge.c | 137 + src/bin/coreutils/lib/fpurge.h | 38 + src/bin/coreutils/lib/freadahead.c | 85 + src/bin/coreutils/lib/freadahead.h | 38 + src/bin/coreutils/lib/freading.c | 64 + src/bin/coreutils/lib/freading.h | 53 + src/bin/coreutils/lib/freadptr.c | 103 + src/bin/coreutils/lib/freadptr.h | 39 + src/bin/coreutils/lib/freadseek.c | 136 + src/bin/coreutils/lib/freadseek.h | 42 + src/bin/coreutils/lib/free.c | 31 - src/bin/coreutils/lib/frexp.c | 166 + src/bin/coreutils/lib/frexpl.c | 18 + src/bin/coreutils/lib/fseeko.c | 133 + src/bin/coreutils/lib/fseterr.c | 74 + src/bin/coreutils/lib/fseterr.h | 37 + src/bin/coreutils/lib/fstatat.c | 9 +- src/bin/coreutils/lib/fsusage.c | 12 +- src/bin/coreutils/lib/fsusage.h | 9 +- src/bin/coreutils/lib/ftello.c | 54 + src/bin/coreutils/lib/fts-cycle.c | 9 +- src/bin/coreutils/lib/fts.c | 337 +- src/bin/coreutils/lib/fts_.h | 30 +- src/bin/coreutils/lib/full-read.c | 9 +- src/bin/coreutils/lib/full-read.h | 8 +- src/bin/coreutils/lib/full-write.c | 9 +- src/bin/coreutils/lib/full-write.h | 9 +- src/bin/coreutils/lib/gai_strerror.c | 14 +- src/bin/coreutils/lib/getaddrinfo.c | 34 +- src/bin/coreutils/lib/getaddrinfo.h | 155 - src/bin/coreutils/lib/getcwd.c | 37 +- src/bin/coreutils/lib/getdate.c | 1363 +- src/bin/coreutils/lib/getdate.h | 9 +- src/bin/coreutils/lib/getdate.y | 305 +- src/bin/coreutils/lib/getdelim.c | 34 +- src/bin/coreutils/lib/getdelim.h | 28 - src/bin/coreutils/lib/getgroups.c | 19 +- src/bin/coreutils/lib/gethostname.c | 16 +- src/bin/coreutils/lib/gethrxtime.c | 9 +- src/bin/coreutils/lib/gethrxtime.h | 9 +- src/bin/coreutils/lib/getline.c | 10 +- src/bin/coreutils/lib/getline.h | 28 - src/bin/coreutils/lib/getloadavg.c | 60 +- src/bin/coreutils/lib/getndelim2.c | 132 +- src/bin/coreutils/lib/getndelim2.h | 9 +- src/bin/coreutils/lib/getopt.c | 17 +- .../coreutils/lib/{getopt_.h => getopt.in.h} | 11 +- src/bin/coreutils/lib/getopt1.c | 15 +- src/bin/coreutils/lib/getopt_int.h | 11 +- src/bin/coreutils/lib/getpagesize.c | 39 + src/bin/coreutils/lib/getpagesize.h | 68 - src/bin/coreutils/lib/getpass.c | 11 +- src/bin/coreutils/lib/getpass.h | 5 +- src/bin/coreutils/lib/gettext.h | 16 +- src/bin/coreutils/lib/gettime.c | 9 +- src/bin/coreutils/lib/gettimeofday.c | 28 +- src/bin/coreutils/lib/getugroups.c | 64 +- src/bin/coreutils/lib/getugroups.h | 19 + src/bin/coreutils/lib/getusershell.c | 14 +- src/bin/coreutils/lib/gnulib.mk | 1661 +- src/bin/coreutils/lib/group-member.c | 9 +- src/bin/coreutils/lib/group-member.h | 9 +- src/bin/coreutils/lib/hard-locale.c | 9 +- src/bin/coreutils/lib/hard-locale.h | 9 +- src/bin/coreutils/lib/hash-pjw.c | 9 +- src/bin/coreutils/lib/hash-pjw.h | 10 +- src/bin/coreutils/lib/hash-triple.c | 77 + src/bin/coreutils/lib/hash-triple.h | 22 + src/bin/coreutils/lib/hash.c | 13 +- src/bin/coreutils/lib/hash.h | 9 +- src/bin/coreutils/lib/human.c | 26 +- src/bin/coreutils/lib/human.h | 15 +- src/bin/coreutils/lib/i-ring.c | 9 +- src/bin/coreutils/lib/i-ring.h | 9 +- src/bin/coreutils/lib/iconv.in.h | 74 + src/bin/coreutils/lib/iconv_open-aix.gperf | 44 + src/bin/coreutils/lib/iconv_open-aix.h | 256 + src/bin/coreutils/lib/iconv_open-hpux.gperf | 56 + src/bin/coreutils/lib/iconv_open-hpux.h | 299 + src/bin/coreutils/lib/iconv_open-irix.gperf | 31 + src/bin/coreutils/lib/iconv_open-irix.h | 199 + src/bin/coreutils/lib/iconv_open-osf.gperf | 50 + src/bin/coreutils/lib/iconv_open-osf.h | 278 + src/bin/coreutils/lib/iconv_open.c | 175 + src/bin/coreutils/lib/idcache.c | 32 +- src/bin/coreutils/lib/idcache.h | 11 + src/bin/coreutils/lib/ignore-value.h | 45 + src/bin/coreutils/lib/inet_ntop.c | 9 +- src/bin/coreutils/lib/intprops.h | 9 +- src/bin/coreutils/lib/inttostr.c | 16 +- src/bin/coreutils/lib/inttostr.h | 34 +- .../lib/{inttypes_.h => inttypes.in.h} | 75 +- src/bin/coreutils/lib/isapipe.c | 54 +- src/bin/coreutils/lib/isnan.c | 161 + src/bin/coreutils/lib/isnand-nolibm.h | 33 + src/bin/coreutils/lib/isnand.c | 19 + src/bin/coreutils/lib/isnanf-nolibm.h | 33 + src/bin/coreutils/lib/isnanf.c | 20 + src/bin/coreutils/lib/isnanl-nolibm.h | 33 + src/bin/coreutils/lib/isnanl.c | 20 + src/bin/coreutils/lib/lchmod.h | 35 - src/bin/coreutils/lib/lchown.c | 29 +- src/bin/coreutils/lib/lchown.h | 42 - src/bin/coreutils/lib/linebuffer.c | 35 +- src/bin/coreutils/lib/linebuffer.h | 23 +- src/bin/coreutils/lib/localcharset.c | 58 +- src/bin/coreutils/lib/localcharset.h | 5 +- src/bin/coreutils/lib/long-options.c | 9 +- src/bin/coreutils/lib/long-options.h | 9 +- src/bin/coreutils/lib/lseek.c | 65 + src/bin/coreutils/lib/lstat.c | 32 +- src/bin/coreutils/lib/lstat.h | 24 - src/bin/coreutils/lib/malloc.c | 35 +- .../coreutils/lib/{allocsa.c => malloca.c} | 51 +- .../coreutils/lib/{allocsa.h => malloca.h} | 53 +- .../{allocsa.valgrind => malloca.valgrind} | 6 +- src/bin/coreutils/lib/math.in.h | 567 + src/bin/coreutils/lib/mbchar.c | 9 +- src/bin/coreutils/lib/mbchar.h | 13 +- src/bin/coreutils/lib/mbiter.h | 215 + src/bin/coreutils/lib/mbrlen.c | 32 + src/bin/coreutils/lib/mbrtowc.c | 386 + src/bin/coreutils/lib/mbsalign.c | 236 + src/bin/coreutils/lib/mbsalign.h | 23 + src/bin/coreutils/lib/mbscasecmp.c | 17 +- src/bin/coreutils/lib/mbsinit.c | 47 + src/bin/coreutils/lib/mbslen.c | 44 + src/bin/coreutils/lib/mbsrtowcs-state.c | 37 + src/bin/coreutils/lib/mbsrtowcs.c | 136 + src/bin/coreutils/lib/mbsstr.c | 379 + src/bin/coreutils/lib/mbswidth.c | 24 +- src/bin/coreutils/lib/mbswidth.h | 9 +- src/bin/coreutils/lib/mbuiter.h | 10 +- src/bin/coreutils/lib/md5.c | 35 +- src/bin/coreutils/lib/md5.h | 17 +- src/bin/coreutils/lib/memcasecmp.c | 9 +- src/bin/coreutils/lib/memcasecmp.h | 9 +- src/bin/coreutils/lib/memchr.c | 213 +- src/bin/coreutils/lib/memchr2.c | 164 + src/bin/coreutils/lib/memchr2.h | 31 + src/bin/coreutils/lib/memcmp.c | 30 +- src/bin/coreutils/lib/memcmp2.c | 39 + src/bin/coreutils/lib/memcmp2.h | 42 + src/bin/coreutils/lib/memcoll.c | 9 +- src/bin/coreutils/lib/memcoll.h | 9 +- src/bin/coreutils/lib/memcpy.c | 9 +- src/bin/coreutils/lib/mempcpy.c | 5 +- src/bin/coreutils/lib/memrchr.c | 209 +- src/bin/coreutils/lib/memset.c | 5 +- src/bin/coreutils/lib/memxfrm.c | 9 +- src/bin/coreutils/lib/mgetgroups.c | 142 + src/bin/coreutils/lib/mgetgroups.h | 19 + src/bin/coreutils/lib/mkancesdirs.c | 9 +- src/bin/coreutils/lib/mkdir-p.c | 9 +- src/bin/coreutils/lib/mkdir-p.h | 9 +- src/bin/coreutils/lib/mkdir.c | 34 +- src/bin/coreutils/lib/mkdirat.c | 9 +- src/bin/coreutils/lib/mkstemp-safer.c | 9 +- src/bin/coreutils/lib/mkstemp.c | 11 +- src/bin/coreutils/lib/mktime.c | 9 +- src/bin/coreutils/lib/modechange.c | 9 +- src/bin/coreutils/lib/modechange.h | 9 +- src/bin/coreutils/lib/mountlist.c | 23 +- src/bin/coreutils/lib/mountlist.h | 9 +- src/bin/coreutils/lib/mpsort.c | 11 +- src/bin/coreutils/lib/nanosleep.c | 42 +- src/bin/coreutils/lib/netdb.in.h | 185 + .../lib/{netinet_in_.h => netinet_in.in.h} | 25 +- src/bin/coreutils/lib/obstack.c | 11 +- src/bin/coreutils/lib/obstack.h | 11 +- src/bin/coreutils/lib/open-safer.c | 18 +- src/bin/coreutils/lib/open.c | 140 + src/bin/coreutils/lib/openat-die.c | 22 +- src/bin/coreutils/lib/openat-priv.h | 9 +- src/bin/coreutils/lib/openat-proc.c | 9 +- src/bin/coreutils/lib/openat.c | 14 +- src/bin/coreutils/lib/openat.h | 13 +- src/bin/coreutils/lib/pathmax.h | 9 +- src/bin/coreutils/lib/physmem.c | 9 +- src/bin/coreutils/lib/physmem.h | 9 +- src/bin/coreutils/lib/pipe-safer.c | 9 +- src/bin/coreutils/lib/posixtm.c | 21 +- src/bin/coreutils/lib/posixtm.h | 9 +- src/bin/coreutils/lib/posixver.c | 11 +- src/bin/coreutils/lib/printf-args.c | 61 +- src/bin/coreutils/lib/printf-args.h | 33 +- src/bin/coreutils/lib/printf-frexp.c | 188 + src/bin/coreutils/lib/printf-frexp.h | 23 + src/bin/coreutils/lib/printf-frexpl.c | 18 + src/bin/coreutils/lib/printf-frexpl.h | 23 + src/bin/coreutils/lib/printf-parse.c | 210 +- src/bin/coreutils/lib/printf-parse.h | 120 +- src/bin/coreutils/lib/priv-set.c | 143 + src/bin/coreutils/lib/priv-set.h | 50 + src/bin/coreutils/lib/progname.c | 63 + src/bin/coreutils/lib/progname.h | 60 + src/bin/coreutils/lib/propername.c | 311 + src/bin/coreutils/lib/propername.h | 106 + src/bin/coreutils/lib/putenv.c | 24 +- src/bin/coreutils/lib/quote.c | 9 +- src/bin/coreutils/lib/quote.h | 9 +- src/bin/coreutils/lib/quotearg.c | 264 +- src/bin/coreutils/lib/quotearg.h | 199 +- src/bin/coreutils/lib/raise.c | 9 +- src/bin/coreutils/lib/rand-isaac.c | 9 +- src/bin/coreutils/lib/rand-isaac.h | 9 +- src/bin/coreutils/lib/randint.c | 13 +- src/bin/coreutils/lib/randint.h | 9 +- src/bin/coreutils/lib/randperm.c | 9 +- src/bin/coreutils/lib/randread.c | 53 +- src/bin/coreutils/lib/randread.h | 9 +- src/bin/coreutils/lib/readlink.c | 9 +- src/bin/coreutils/lib/readtokens.c | 14 +- src/bin/coreutils/lib/readtokens.h | 9 +- src/bin/coreutils/lib/readtokens0.c | 9 +- src/bin/coreutils/lib/readtokens0.h | 9 +- src/bin/coreutils/lib/readutmp.c | 14 +- src/bin/coreutils/lib/readutmp.h | 9 +- src/bin/coreutils/lib/realloc.c | 60 +- src/bin/coreutils/lib/ref-add.sin | 2 +- src/bin/coreutils/lib/ref-del.sin | 2 +- src/bin/coreutils/lib/regcomp.c | 140 +- src/bin/coreutils/lib/regex.c | 5 +- src/bin/coreutils/lib/regex.h | 5 +- src/bin/coreutils/lib/regex_internal.c | 35 +- src/bin/coreutils/lib/regex_internal.h | 23 +- src/bin/coreutils/lib/regexec.c | 22 +- src/bin/coreutils/lib/rename-dest-slash.c | 9 +- src/bin/coreutils/lib/rename.c | 126 +- src/bin/coreutils/lib/rmdir.c | 9 +- src/bin/coreutils/lib/root-dev-ino.c | 11 +- src/bin/coreutils/lib/root-dev-ino.h | 11 +- src/bin/coreutils/lib/rpmatch.c | 136 +- src/bin/coreutils/lib/safe-read.c | 9 +- src/bin/coreutils/lib/safe-read.h | 9 +- src/bin/coreutils/lib/safe-write.c | 9 +- src/bin/coreutils/lib/safe-write.h | 9 +- src/bin/coreutils/lib/same-inode.h | 9 +- src/bin/coreutils/lib/same.c | 9 +- src/bin/coreutils/lib/same.h | 9 +- src/bin/coreutils/lib/save-cwd.c | 12 +- src/bin/coreutils/lib/save-cwd.h | 9 +- src/bin/coreutils/lib/savedir.c | 9 +- src/bin/coreutils/lib/savedir.h | 9 +- src/bin/coreutils/lib/savewd.c | 12 +- src/bin/coreutils/lib/savewd.h | 9 +- src/bin/coreutils/lib/se-context.in.h | 26 + src/bin/coreutils/lib/se-selinux.in.h | 58 + src/bin/coreutils/lib/select.c | 449 + src/bin/coreutils/lib/selinux-at.c | 88 + src/bin/coreutils/lib/selinux-at.h | 23 + src/bin/coreutils/lib/selinux/selinux.h | 58 + src/bin/coreutils/lib/set-mode-acl.c | 490 + src/bin/coreutils/lib/setenv.c | 34 +- src/bin/coreutils/lib/setenv.h | 54 - src/bin/coreutils/lib/settime.c | 9 +- src/bin/coreutils/lib/sha1.c | 37 +- src/bin/coreutils/lib/sha1.h | 20 +- src/bin/coreutils/lib/sha256.c | 50 +- src/bin/coreutils/lib/sha256.h | 27 +- src/bin/coreutils/lib/sha512.c | 52 +- src/bin/coreutils/lib/sha512.h | 20 +- src/bin/coreutils/lib/sig-handler.h | 44 + src/bin/coreutils/lib/sig2str.c | 9 +- src/bin/coreutils/lib/sig2str.h | 9 +- src/bin/coreutils/lib/sigaction.c | 204 + src/bin/coreutils/lib/signal.in.h | 202 + src/bin/coreutils/lib/signbitd.c | 64 + src/bin/coreutils/lib/signbitf.c | 64 + src/bin/coreutils/lib/signbitl.c | 64 + src/bin/coreutils/lib/sigprocmask.c | 329 + src/bin/coreutils/lib/size_max.h | 34 + src/bin/coreutils/lib/snprintf.c | 12 +- src/bin/coreutils/lib/socket_.h | 85 - src/bin/coreutils/lib/stat-time.h | 79 +- .../coreutils/lib/{dirent_.h => stdarg.in.h} | 42 +- .../lib/{stdbool_.h => stdbool.in.h} | 24 +- .../coreutils/lib/{stdint_.h => stdint.in.h} | 162 +- src/bin/coreutils/lib/stdio--.h | 9 +- src/bin/coreutils/lib/stdio-impl.h | 94 + src/bin/coreutils/lib/stdio-safer.h | 9 +- src/bin/coreutils/lib/stdio-write.c | 148 + src/bin/coreutils/lib/stdio.in.h | 527 + src/bin/coreutils/lib/stdio_.h | 192 - src/bin/coreutils/lib/stdlib--.h | 9 +- src/bin/coreutils/lib/stdlib-safer.h | 9 +- src/bin/coreutils/lib/stdlib.in.h | 383 + src/bin/coreutils/lib/stdlib_.h | 141 - src/bin/coreutils/lib/stpcpy.c | 7 +- src/bin/coreutils/lib/stpncpy.c | 91 + src/bin/coreutils/lib/str-kmp.h | 153 + src/bin/coreutils/lib/strcspn.c | 7 +- src/bin/coreutils/lib/strdup.c | 5 +- src/bin/coreutils/lib/streq.h | 179 + src/bin/coreutils/lib/strerror.c | 341 + src/bin/coreutils/lib/strftime.c | 50 +- src/bin/coreutils/lib/strftime.h | 19 +- src/bin/coreutils/lib/striconv.c | 461 + src/bin/coreutils/lib/striconv.h | 79 + .../coreutils/lib/{string_.h => string.in.h} | 204 +- src/bin/coreutils/lib/strintcmp.c | 9 +- src/bin/coreutils/lib/stripslash.c | 9 +- src/bin/coreutils/lib/strndup.c | 5 +- src/bin/coreutils/lib/strnlen.c | 5 +- src/bin/coreutils/lib/strnlen1.c | 9 +- src/bin/coreutils/lib/strnlen1.h | 9 +- src/bin/coreutils/lib/strnumcmp-in.h | 9 +- src/bin/coreutils/lib/strnumcmp.c | 9 +- src/bin/coreutils/lib/strpbrk.c | 5 +- src/bin/coreutils/lib/strtod.c | 226 +- src/bin/coreutils/lib/strtoimax.c | 9 +- src/bin/coreutils/lib/strtol.c | 7 +- src/bin/coreutils/lib/strtoll.c | 11 +- src/bin/coreutils/lib/strtoul.c | 11 +- src/bin/coreutils/lib/strtoull.c | 7 +- src/bin/coreutils/lib/strverscmp.c | 5 +- src/bin/coreutils/lib/strverscmp.h | 24 - src/bin/coreutils/lib/sys/stat.h | 31 + src/bin/coreutils/lib/sys_select.in.h | 96 + src/bin/coreutils/lib/sys_socket.in.h | 406 + .../coreutils/lib/{stat_.h => sys_stat.in.h} | 119 +- .../lib/{sys_time_.h => sys_time.in.h} | 53 +- src/bin/coreutils/lib/t-fpending.c | 42 - src/bin/coreutils/lib/tempname.c | 134 +- src/bin/coreutils/lib/tempname.h | 13 +- src/bin/coreutils/lib/{time_.h => time.in.h} | 30 +- src/bin/coreutils/lib/time_r.c | 5 +- src/bin/coreutils/lib/timespec.h | 9 +- src/bin/coreutils/lib/trim.c | 133 + src/bin/coreutils/lib/trim.h | 34 + src/bin/coreutils/lib/u64.h | 11 +- src/bin/coreutils/lib/unicodeio.c | 72 +- src/bin/coreutils/lib/unicodeio.h | 17 +- src/bin/coreutils/lib/unistd--.h | 9 +- src/bin/coreutils/lib/unistd-safer.h | 9 +- src/bin/coreutils/lib/unistd.in.h | 581 + src/bin/coreutils/lib/unistd_.h | 192 - src/bin/coreutils/lib/unistr.h | 684 + src/bin/coreutils/lib/unistr/u8-uctomb-aux.c | 72 + src/bin/coreutils/lib/unistr/u8-uctomb.c | 91 + src/bin/coreutils/lib/unitypes.h | 29 + src/bin/coreutils/lib/uniwidth.h | 67 + src/bin/coreutils/lib/uniwidth/cjk.h | 40 + src/bin/coreutils/lib/uniwidth/width.c | 362 + src/bin/coreutils/lib/unlinkdir.c | 38 +- src/bin/coreutils/lib/unlinkdir.h | 9 +- src/bin/coreutils/lib/unlocked-io.h | 11 +- src/bin/coreutils/lib/unsetenv.c | 20 +- src/bin/coreutils/lib/userspec.c | 13 +- src/bin/coreutils/lib/utime.c | 109 - src/bin/coreutils/lib/utimecmp.c | 9 +- src/bin/coreutils/lib/utimecmp.h | 9 +- src/bin/coreutils/lib/utimens.c | 206 +- src/bin/coreutils/lib/utimens.h | 2 +- src/bin/coreutils/lib/vasnprintf.c | 5065 +- src/bin/coreutils/lib/vasnprintf.h | 9 +- src/bin/coreutils/lib/vasprintf.c | 18 +- src/bin/coreutils/lib/vasprintf.h | 69 - src/bin/coreutils/lib/verify.h | 9 +- src/bin/coreutils/lib/verror.c | 77 + src/bin/coreutils/lib/verror.h | 53 + src/bin/coreutils/lib/version-etc-fsf.c | 9 +- src/bin/coreutils/lib/version-etc.c | 33 +- src/bin/coreutils/lib/version-etc.h | 17 +- src/bin/coreutils/lib/version.c | 2 + src/bin/coreutils/lib/version.h | 1 + src/bin/coreutils/lib/vfprintf.c | 74 + src/bin/coreutils/lib/vprintf.c | 36 + src/bin/coreutils/lib/wchar.in.h | 313 + src/bin/coreutils/lib/wchar_.h | 42 - src/bin/coreutils/lib/wcrtomb.c | 53 + .../coreutils/lib/{wctype_.h => wctype.in.h} | 73 +- src/bin/coreutils/lib/wcwidth.c | 51 + src/bin/coreutils/lib/wcwidth.h | 57 - src/bin/coreutils/lib/write-any-file.c | 50 + src/bin/coreutils/lib/write-any-file.h | 2 + src/bin/coreutils/lib/write.c | 62 + src/bin/coreutils/lib/xalloc-die.c | 9 +- src/bin/coreutils/lib/xalloc.h | 37 +- src/bin/coreutils/lib/xasprintf.c | 33 + src/bin/coreutils/lib/xfreopen.c | 41 + src/bin/coreutils/lib/xfreopen.h | 2 + src/bin/coreutils/lib/xfts.c | 9 +- src/bin/coreutils/lib/xgetcwd.c | 9 +- src/bin/coreutils/lib/xgetcwd.h | 9 +- src/bin/coreutils/lib/xgethostname.c | 9 +- src/bin/coreutils/lib/xmalloc.c | 15 +- src/bin/coreutils/lib/xmemcoll.c | 9 +- src/bin/coreutils/lib/xmemxfrm.c | 13 +- src/bin/coreutils/lib/xnanosleep.c | 68 +- src/bin/coreutils/lib/xprintf.c | 79 + src/bin/coreutils/lib/xprintf.h | 46 + src/bin/coreutils/lib/xreadlink.c | 131 - src/bin/coreutils/lib/xreadlink.h | 34 - src/bin/coreutils/lib/xsize.h | 111 + src/bin/coreutils/lib/xstriconv.c | 62 + src/bin/coreutils/lib/xstriconv.h | 78 + src/bin/coreutils/lib/xstrndup.c | 9 +- src/bin/coreutils/lib/xstrndup.h | 9 +- src/bin/coreutils/lib/xstrtod.c | 9 +- src/bin/coreutils/lib/xstrtod.h | 9 +- src/bin/coreutils/lib/xstrtol-error.c | 98 + src/bin/coreutils/lib/xstrtol.c | 47 +- src/bin/coreutils/lib/xstrtol.h | 75 +- src/bin/coreutils/lib/xtime.h | 9 +- src/bin/coreutils/lib/xvasprintf.c | 110 + src/bin/coreutils/lib/xvasprintf.h | 56 + src/bin/coreutils/lib/yesno.c | 22 +- src/bin/coreutils/lib/yesno.h | 10 +- src/bin/coreutils/man/Makefile.am | 77 +- src/bin/coreutils/man/Makefile.in | 796 +- src/bin/coreutils/man/arch.x | 6 + src/bin/coreutils/man/base64.1 | 20 +- src/bin/coreutils/man/basename.1 | 20 +- src/bin/coreutils/man/cat.1 | 24 +- src/bin/coreutils/man/chcon.1 | 90 + src/bin/coreutils/man/chcon.x | 4 + src/bin/coreutils/man/chgrp.1 | 18 +- src/bin/coreutils/man/chmod.1 | 45 +- src/bin/coreutils/man/chmod.x | 29 +- src/bin/coreutils/man/chown.1 | 18 +- src/bin/coreutils/man/chroot.1 | 20 +- src/bin/coreutils/man/cksum.1 | 18 +- src/bin/coreutils/man/comm.1 | 32 +- src/bin/coreutils/man/cp.1 | 41 +- src/bin/coreutils/man/csplit.1 | 18 +- src/bin/coreutils/man/cut.1 | 24 +- src/bin/coreutils/man/date.1 | 32 +- src/bin/coreutils/man/date.x | 9 + src/bin/coreutils/man/dd.1 | 60 +- src/bin/coreutils/man/df.1 | 21 +- src/bin/coreutils/man/dir.1 | 44 +- src/bin/coreutils/man/dircolors.1 | 18 +- src/bin/coreutils/man/dirname.1 | 18 +- src/bin/coreutils/man/du.1 | 38 +- src/bin/coreutils/man/du.x | 2 +- src/bin/coreutils/man/echo.1 | 27 +- src/bin/coreutils/man/env.1 | 18 +- src/bin/coreutils/man/expand.1 | 18 +- src/bin/coreutils/man/expr.1 | 20 +- src/bin/coreutils/man/factor.1 | 24 +- src/bin/coreutils/man/false.1 | 18 +- src/bin/coreutils/man/fmt.1 | 22 +- src/bin/coreutils/man/fold.1 | 18 +- src/bin/coreutils/man/groups.1 | 25 +- src/bin/coreutils/man/head.1 | 22 +- src/bin/coreutils/man/help2man | 22 +- src/bin/coreutils/man/hostid.1 | 23 +- src/bin/coreutils/man/hostname.1 | 42 - src/bin/coreutils/man/id.1 | 26 +- src/bin/coreutils/man/id.x | 2 +- src/bin/coreutils/man/install.1 | 36 +- src/bin/coreutils/man/join.1 | 28 +- src/bin/coreutils/man/kill.1 | 20 +- src/bin/coreutils/man/link.1 | 18 +- src/bin/coreutils/man/ln.1 | 22 +- src/bin/coreutils/man/logname.1 | 18 +- src/bin/coreutils/man/ls.1 | 44 +- src/bin/coreutils/man/md5sum.1 | 25 +- src/bin/coreutils/man/mkdir.1 | 24 +- src/bin/coreutils/man/mkfifo.1 | 23 +- src/bin/coreutils/man/mknod.1 | 25 +- src/bin/coreutils/man/mktemp.1 | 70 + src/bin/coreutils/man/mktemp.x | 6 + src/bin/coreutils/man/mv.1 | 23 +- src/bin/coreutils/man/nice.1 | 18 +- src/bin/coreutils/man/nl.1 | 20 +- src/bin/coreutils/man/nohup.1 | 24 +- src/bin/coreutils/man/od.1 | 30 +- src/bin/coreutils/man/paste.1 | 18 +- src/bin/coreutils/man/pathchk.1 | 20 +- src/bin/coreutils/man/pinky.1 | 18 +- src/bin/coreutils/man/pr.1 | 32 +- src/bin/coreutils/man/printenv.1 | 21 +- src/bin/coreutils/man/printf.1 | 22 +- src/bin/coreutils/man/printf.x | 2 + src/bin/coreutils/man/ptx.1 | 18 +- src/bin/coreutils/man/pwd.1 | 26 +- src/bin/coreutils/man/readlink.1 | 18 +- src/bin/coreutils/man/rm.1 | 21 +- src/bin/coreutils/man/rmdir.1 | 23 +- src/bin/coreutils/man/runcon.1 | 75 + src/bin/coreutils/man/runcon.x | 14 + src/bin/coreutils/man/seq.1 | 18 +- src/bin/coreutils/man/sha1sum.1 | 25 +- src/bin/coreutils/man/sha224sum.1 | 25 +- src/bin/coreutils/man/sha256sum.1 | 25 +- src/bin/coreutils/man/sha384sum.1 | 25 +- src/bin/coreutils/man/sha512sum.1 | 25 +- src/bin/coreutils/man/shred.1 | 24 +- src/bin/coreutils/man/shuf.1 | 24 +- src/bin/coreutils/man/sleep.1 | 18 +- src/bin/coreutils/man/sort.1 | 43 +- src/bin/coreutils/man/split.1 | 28 +- src/bin/coreutils/man/stat.1 | 26 +- src/bin/coreutils/man/stty.1 | 26 +- src/bin/coreutils/man/su.1 | 59 - src/bin/coreutils/man/sum.1 | 20 +- src/bin/coreutils/man/sync.1 | 18 +- src/bin/coreutils/man/tac.1 | 18 +- src/bin/coreutils/man/tail.1 | 37 +- src/bin/coreutils/man/tee.1 | 18 +- src/bin/coreutils/man/test.1 | 21 +- src/bin/coreutils/man/timeout.1 | 65 + src/bin/coreutils/man/timeout.x | 6 + src/bin/coreutils/man/touch.1 | 37 +- src/bin/coreutils/man/touch.x | 9 + src/bin/coreutils/man/tr.1 | 18 +- src/bin/coreutils/man/true.1 | 18 +- src/bin/coreutils/man/truncate.1 | 74 + src/bin/coreutils/man/truncate.x | 6 + src/bin/coreutils/man/tsort.1 | 18 +- src/bin/coreutils/man/tty.1 | 18 +- src/bin/coreutils/man/uname.1 | 20 +- src/bin/coreutils/man/uname.x | 2 +- src/bin/coreutils/man/unexpand.1 | 18 +- src/bin/coreutils/man/uniq.1 | 37 +- src/bin/coreutils/man/unlink.1 | 18 +- src/bin/coreutils/man/uptime.1 | 23 +- src/bin/coreutils/man/users.1 | 20 +- src/bin/coreutils/man/vdir.1 | 44 +- src/bin/coreutils/man/wc.1 | 21 +- src/bin/coreutils/man/who.1 | 20 +- src/bin/coreutils/man/whoami.1 | 18 +- src/bin/coreutils/man/yes.1 | 18 +- src/bin/coreutils/src/Jamfile | 24 +- src/bin/coreutils/src/Makefile.am | 382 +- src/bin/coreutils/src/Makefile.in | 1915 +- src/bin/coreutils/src/base64.c | 56 +- src/bin/coreutils/src/basename.c | 22 +- src/bin/coreutils/src/c99-to-c89.diff | 152 +- src/bin/coreutils/src/cat.c | 46 +- src/bin/coreutils/src/chcon.c | 566 + src/bin/coreutils/src/chgrp.c | 25 +- src/bin/coreutils/src/chmod.c | 51 +- src/bin/coreutils/src/chown-core.c | 35 +- src/bin/coreutils/src/chown-core.h | 11 +- src/bin/coreutils/src/chown.c | 29 +- src/bin/coreutils/src/chroot.c | 40 +- src/bin/coreutils/src/cksum.c | 26 +- src/bin/coreutils/src/comm.c | 236 +- src/bin/coreutils/src/copy.c | 1044 +- src/bin/coreutils/src/copy.h | 94 +- src/bin/coreutils/src/cp-hash.c | 32 +- src/bin/coreutils/src/cp-hash.h | 1 - src/bin/coreutils/src/cp.c | 272 +- src/bin/coreutils/src/csplit.c | 56 +- src/bin/coreutils/src/cut.c | 63 +- src/bin/coreutils/src/date.c | 40 +- src/bin/coreutils/src/dcgen | 10 +- src/bin/coreutils/src/dd.c | 345 +- src/bin/coreutils/src/df.c | 175 +- src/bin/coreutils/src/dircolors.c | 33 +- src/bin/coreutils/src/dircolors.h | 30 +- src/bin/coreutils/src/dircolors.hin | 32 +- src/bin/coreutils/src/dirname.c | 24 +- src/bin/coreutils/src/du.c | 242 +- src/bin/coreutils/src/echo.c | 75 +- src/bin/coreutils/src/env.c | 29 +- src/bin/coreutils/src/expand.c | 26 +- src/bin/coreutils/src/expr.c | 289 +- src/bin/coreutils/src/extract-magic | 9 +- src/bin/coreutils/src/factor.c | 490 +- src/bin/coreutils/src/fmt.c | 26 +- src/bin/coreutils/src/fold.c | 20 +- src/bin/coreutils/src/fs.h | 58 +- src/bin/coreutils/src/getlimits.c | 180 + src/bin/coreutils/src/group-list.c | 121 + src/bin/coreutils/src/group-list.h | 19 + src/bin/coreutils/src/groups.c | 132 + src/bin/coreutils/src/groups.sh | 83 - src/bin/coreutils/src/head.c | 38 +- src/bin/coreutils/src/hostid.c | 28 +- src/bin/coreutils/src/hostname.c | 28 +- src/bin/coreutils/src/id.c | 239 +- src/bin/coreutils/src/install.c | 360 +- src/bin/coreutils/src/join.c | 405 +- src/bin/coreutils/src/kill.c | 69 +- src/bin/coreutils/src/link.c | 22 +- src/bin/coreutils/src/ln.c | 83 +- src/bin/coreutils/src/logname.c | 22 +- src/bin/coreutils/src/ls.c | 749 +- src/bin/coreutils/src/md5sum.c | 74 +- src/bin/coreutils/src/mkdir.c | 42 +- src/bin/coreutils/src/mkfifo.c | 40 +- src/bin/coreutils/src/mknod.c | 39 +- src/bin/coreutils/src/mktemp.c | 294 + src/bin/coreutils/src/mv.c | 99 +- src/bin/coreutils/src/nice.c | 38 +- src/bin/coreutils/src/nl.c | 24 +- src/bin/coreutils/src/nohup.c | 36 +- src/bin/coreutils/src/od.c | 383 +- src/bin/coreutils/src/operand2sig.c | 83 + src/bin/coreutils/src/operand2sig.h | 18 + src/bin/coreutils/src/paste.c | 56 +- src/bin/coreutils/src/pathchk.c | 32 +- src/bin/coreutils/src/pinky.c | 36 +- src/bin/coreutils/src/pr.c | 118 +- src/bin/coreutils/src/printenv.c | 28 +- src/bin/coreutils/src/printf.c | 77 +- src/bin/coreutils/src/prog-fprintf.c | 37 + src/bin/coreutils/src/prog-fprintf.h | 25 + src/bin/coreutils/src/ptx.c | 200 +- src/bin/coreutils/src/pwd.c | 105 +- src/bin/coreutils/src/readlink.c | 24 +- src/bin/coreutils/src/remove.c | 697 +- src/bin/coreutils/src/remove.h | 9 +- src/bin/coreutils/src/rm.c | 30 +- src/bin/coreutils/src/rmdir.c | 77 +- src/bin/coreutils/src/runcon.c | 264 + src/bin/coreutils/src/seq.c | 201 +- src/bin/coreutils/src/setuidgid.c | 165 +- src/bin/coreutils/src/shred.c | 56 +- src/bin/coreutils/src/shuf.c | 31 +- src/bin/coreutils/src/sleep.c | 25 +- src/bin/coreutils/src/sort.c | 707 +- src/bin/coreutils/src/split.c | 58 +- src/bin/coreutils/src/stat.c | 212 +- src/bin/coreutils/src/stty.c | 135 +- src/bin/coreutils/src/su.c | 44 +- src/bin/coreutils/src/sum.c | 30 +- src/bin/coreutils/src/sync.c | 22 +- src/bin/coreutils/src/system.h | 203 +- src/bin/coreutils/src/tac-pipe.c | 9 +- src/bin/coreutils/src/tac.c | 32 +- src/bin/coreutils/src/tail.c | 49 +- src/bin/coreutils/src/tee.c | 30 +- src/bin/coreutils/src/test.c | 75 +- src/bin/coreutils/src/timeout.c | 338 + src/bin/coreutils/src/touch.c | 66 +- src/bin/coreutils/src/tr.c | 92 +- src/bin/coreutils/src/true.c | 26 +- src/bin/coreutils/src/truncate.c | 424 + src/bin/coreutils/src/tsort.c | 24 +- src/bin/coreutils/src/tty.c | 22 +- src/bin/coreutils/src/uname-arch.c | 2 + src/bin/coreutils/src/uname-uname.c | 2 + src/bin/coreutils/src/uname.c | 176 +- src/bin/coreutils/src/uname.h | 7 + src/bin/coreutils/src/unexpand.c | 26 +- src/bin/coreutils/src/uniq.c | 74 +- src/bin/coreutils/src/unlink.c | 22 +- src/bin/coreutils/src/uptime.c | 69 +- src/bin/coreutils/src/users.c | 26 +- src/bin/coreutils/src/wc.c | 302 +- src/bin/coreutils/src/wheel-gen.pl | 9 +- src/bin/coreutils/src/who.c | 51 +- src/bin/coreutils/src/whoami.c | 24 +- src/bin/coreutils/src/yes.c | 24 +- 795 files changed, 98534 insertions(+), 59960 deletions(-) create mode 100644 src/bin/coreutils/ChangeLog-2006 create mode 100644 src/bin/coreutils/ChangeLog-2007 create mode 100644 src/bin/coreutils/ChangeLog-2008 delete mode 100644 src/bin/coreutils/Makefile.cfg delete mode 100644 src/bin/coreutils/Makefile.maint rename src/bin/coreutils/doc/{ChangeLog => ChangeLog-2007} (98%) rename src/bin/coreutils/lib/{ChangeLog => ChangeLog-2007} (99%) delete mode 100644 src/bin/coreutils/lib/acl.c rename src/bin/coreutils/lib/{alloca_.h => alloca.in.h} (82%) rename src/bin/coreutils/lib/{xreadlink-with-size.c => areadlink-with-size.c} (71%) create mode 100644 src/bin/coreutils/lib/areadlink.h create mode 100644 src/bin/coreutils/lib/argv-iter.c create mode 100644 src/bin/coreutils/lib/argv-iter.h rename src/bin/coreutils/lib/{inet_ntop.h => arpa_inet.in.h} (51%) create mode 100644 src/bin/coreutils/lib/btowc.c create mode 100644 src/bin/coreutils/lib/close-hook.c create mode 100644 src/bin/coreutils/lib/close-hook.h create mode 100644 src/bin/coreutils/lib/close.c create mode 100644 src/bin/coreutils/lib/closein.c create mode 100644 src/bin/coreutils/lib/closein.h create mode 100644 src/bin/coreutils/lib/copy-acl.c create mode 100644 src/bin/coreutils/lib/dirent.in.h delete mode 100644 src/bin/coreutils/lib/dirfd.h create mode 100644 src/bin/coreutils/lib/errno.in.h delete mode 100644 src/bin/coreutils/lib/euidaccess.h create mode 100644 src/bin/coreutils/lib/fclose.c rename src/bin/coreutils/lib/{fcntl_.h => fcntl.in.h} (61%) create mode 100644 src/bin/coreutils/lib/fflush.c create mode 100644 src/bin/coreutils/lib/file-set.c create mode 100644 src/bin/coreutils/lib/file-set.h create mode 100644 src/bin/coreutils/lib/filevercmp.c create mode 100644 src/bin/coreutils/lib/filevercmp.h create mode 100644 src/bin/coreutils/lib/float+.h create mode 100644 src/bin/coreutils/lib/float.in.h rename src/bin/coreutils/lib/{fnmatch_.h => fnmatch.in.h} (93%) rename src/bin/coreutils/lib/{__fpending.c => fpending.c} (57%) rename src/bin/coreutils/lib/{__fpending.h => fpending.h} (71%) create mode 100644 src/bin/coreutils/lib/fpucw.h create mode 100644 src/bin/coreutils/lib/fpurge.c create mode 100644 src/bin/coreutils/lib/fpurge.h create mode 100644 src/bin/coreutils/lib/freadahead.c create mode 100644 src/bin/coreutils/lib/freadahead.h create mode 100644 src/bin/coreutils/lib/freading.c create mode 100644 src/bin/coreutils/lib/freading.h create mode 100644 src/bin/coreutils/lib/freadptr.c create mode 100644 src/bin/coreutils/lib/freadptr.h create mode 100644 src/bin/coreutils/lib/freadseek.c create mode 100644 src/bin/coreutils/lib/freadseek.h delete mode 100644 src/bin/coreutils/lib/free.c create mode 100644 src/bin/coreutils/lib/frexp.c create mode 100644 src/bin/coreutils/lib/frexpl.c create mode 100644 src/bin/coreutils/lib/fseeko.c create mode 100644 src/bin/coreutils/lib/fseterr.c create mode 100644 src/bin/coreutils/lib/fseterr.h create mode 100644 src/bin/coreutils/lib/ftello.c delete mode 100644 src/bin/coreutils/lib/getaddrinfo.h delete mode 100644 src/bin/coreutils/lib/getdelim.h delete mode 100644 src/bin/coreutils/lib/getline.h rename src/bin/coreutils/lib/{getopt_.h => getopt.in.h} (96%) create mode 100644 src/bin/coreutils/lib/getpagesize.c delete mode 100644 src/bin/coreutils/lib/getpagesize.h create mode 100644 src/bin/coreutils/lib/getugroups.h create mode 100644 src/bin/coreutils/lib/hash-triple.c create mode 100644 src/bin/coreutils/lib/hash-triple.h create mode 100644 src/bin/coreutils/lib/iconv.in.h create mode 100644 src/bin/coreutils/lib/iconv_open-aix.gperf create mode 100644 src/bin/coreutils/lib/iconv_open-aix.h create mode 100644 src/bin/coreutils/lib/iconv_open-hpux.gperf create mode 100644 src/bin/coreutils/lib/iconv_open-hpux.h create mode 100644 src/bin/coreutils/lib/iconv_open-irix.gperf create mode 100644 src/bin/coreutils/lib/iconv_open-irix.h create mode 100644 src/bin/coreutils/lib/iconv_open-osf.gperf create mode 100644 src/bin/coreutils/lib/iconv_open-osf.h create mode 100644 src/bin/coreutils/lib/iconv_open.c create mode 100644 src/bin/coreutils/lib/idcache.h create mode 100644 src/bin/coreutils/lib/ignore-value.h rename src/bin/coreutils/lib/{inttypes_.h => inttypes.in.h} (94%) create mode 100644 src/bin/coreutils/lib/isnan.c create mode 100644 src/bin/coreutils/lib/isnand-nolibm.h create mode 100644 src/bin/coreutils/lib/isnand.c create mode 100644 src/bin/coreutils/lib/isnanf-nolibm.h create mode 100644 src/bin/coreutils/lib/isnanf.c create mode 100644 src/bin/coreutils/lib/isnanl-nolibm.h create mode 100644 src/bin/coreutils/lib/isnanl.c delete mode 100644 src/bin/coreutils/lib/lchmod.h delete mode 100644 src/bin/coreutils/lib/lchown.h create mode 100644 src/bin/coreutils/lib/lseek.c delete mode 100644 src/bin/coreutils/lib/lstat.h rename src/bin/coreutils/lib/{allocsa.c => malloca.c} (73%) rename src/bin/coreutils/lib/{allocsa.h => malloca.h} (75%) rename src/bin/coreutils/lib/{allocsa.valgrind => malloca.valgrind} (78%) create mode 100644 src/bin/coreutils/lib/math.in.h create mode 100644 src/bin/coreutils/lib/mbiter.h create mode 100644 src/bin/coreutils/lib/mbrlen.c create mode 100644 src/bin/coreutils/lib/mbrtowc.c create mode 100644 src/bin/coreutils/lib/mbsalign.c create mode 100644 src/bin/coreutils/lib/mbsalign.h create mode 100644 src/bin/coreutils/lib/mbsinit.c create mode 100644 src/bin/coreutils/lib/mbslen.c create mode 100644 src/bin/coreutils/lib/mbsrtowcs-state.c create mode 100644 src/bin/coreutils/lib/mbsrtowcs.c create mode 100644 src/bin/coreutils/lib/mbsstr.c create mode 100644 src/bin/coreutils/lib/memchr2.c create mode 100644 src/bin/coreutils/lib/memchr2.h create mode 100644 src/bin/coreutils/lib/memcmp2.c create mode 100644 src/bin/coreutils/lib/memcmp2.h create mode 100644 src/bin/coreutils/lib/mgetgroups.c create mode 100644 src/bin/coreutils/lib/mgetgroups.h create mode 100644 src/bin/coreutils/lib/netdb.in.h rename src/bin/coreutils/lib/{netinet_in_.h => netinet_in.in.h} (67%) create mode 100644 src/bin/coreutils/lib/open.c create mode 100644 src/bin/coreutils/lib/printf-frexp.c create mode 100644 src/bin/coreutils/lib/printf-frexp.h create mode 100644 src/bin/coreutils/lib/printf-frexpl.c create mode 100644 src/bin/coreutils/lib/printf-frexpl.h create mode 100644 src/bin/coreutils/lib/priv-set.c create mode 100644 src/bin/coreutils/lib/priv-set.h create mode 100644 src/bin/coreutils/lib/progname.c create mode 100644 src/bin/coreutils/lib/progname.h create mode 100644 src/bin/coreutils/lib/propername.c create mode 100644 src/bin/coreutils/lib/propername.h create mode 100644 src/bin/coreutils/lib/se-context.in.h create mode 100644 src/bin/coreutils/lib/se-selinux.in.h create mode 100644 src/bin/coreutils/lib/select.c create mode 100644 src/bin/coreutils/lib/selinux-at.c create mode 100644 src/bin/coreutils/lib/selinux-at.h create mode 100644 src/bin/coreutils/lib/selinux/selinux.h create mode 100644 src/bin/coreutils/lib/set-mode-acl.c delete mode 100644 src/bin/coreutils/lib/setenv.h create mode 100644 src/bin/coreutils/lib/sig-handler.h create mode 100644 src/bin/coreutils/lib/sigaction.c create mode 100644 src/bin/coreutils/lib/signal.in.h create mode 100644 src/bin/coreutils/lib/signbitd.c create mode 100644 src/bin/coreutils/lib/signbitf.c create mode 100644 src/bin/coreutils/lib/signbitl.c create mode 100644 src/bin/coreutils/lib/sigprocmask.c create mode 100644 src/bin/coreutils/lib/size_max.h delete mode 100644 src/bin/coreutils/lib/socket_.h rename src/bin/coreutils/lib/{dirent_.h => stdarg.in.h} (53%) rename src/bin/coreutils/lib/{stdbool_.h => stdbool.in.h} (86%) rename src/bin/coreutils/lib/{stdint_.h => stdint.in.h} (75%) create mode 100644 src/bin/coreutils/lib/stdio-impl.h create mode 100644 src/bin/coreutils/lib/stdio-write.c create mode 100644 src/bin/coreutils/lib/stdio.in.h delete mode 100644 src/bin/coreutils/lib/stdio_.h create mode 100644 src/bin/coreutils/lib/stdlib.in.h delete mode 100644 src/bin/coreutils/lib/stdlib_.h create mode 100644 src/bin/coreutils/lib/stpncpy.c create mode 100644 src/bin/coreutils/lib/str-kmp.h create mode 100644 src/bin/coreutils/lib/streq.h create mode 100644 src/bin/coreutils/lib/strerror.c create mode 100644 src/bin/coreutils/lib/striconv.c create mode 100644 src/bin/coreutils/lib/striconv.h rename src/bin/coreutils/lib/{string_.h => string.in.h} (80%) delete mode 100644 src/bin/coreutils/lib/strverscmp.h create mode 100644 src/bin/coreutils/lib/sys_select.in.h create mode 100644 src/bin/coreutils/lib/sys_socket.in.h rename src/bin/coreutils/lib/{stat_.h => sys_stat.in.h} (66%) rename src/bin/coreutils/lib/{sys_time_.h => sys_time.in.h} (52%) delete mode 100644 src/bin/coreutils/lib/t-fpending.c rename src/bin/coreutils/lib/{time_.h => time.in.h} (83%) create mode 100644 src/bin/coreutils/lib/trim.c create mode 100644 src/bin/coreutils/lib/trim.h create mode 100644 src/bin/coreutils/lib/unistd.in.h delete mode 100644 src/bin/coreutils/lib/unistd_.h create mode 100644 src/bin/coreutils/lib/unistr.h create mode 100644 src/bin/coreutils/lib/unistr/u8-uctomb-aux.c create mode 100644 src/bin/coreutils/lib/unistr/u8-uctomb.c create mode 100644 src/bin/coreutils/lib/unitypes.h create mode 100644 src/bin/coreutils/lib/uniwidth.h create mode 100644 src/bin/coreutils/lib/uniwidth/cjk.h create mode 100644 src/bin/coreutils/lib/uniwidth/width.c delete mode 100644 src/bin/coreutils/lib/utime.c delete mode 100644 src/bin/coreutils/lib/vasprintf.h create mode 100644 src/bin/coreutils/lib/verror.c create mode 100644 src/bin/coreutils/lib/verror.h create mode 100644 src/bin/coreutils/lib/version.c create mode 100644 src/bin/coreutils/lib/version.h create mode 100644 src/bin/coreutils/lib/vfprintf.c create mode 100644 src/bin/coreutils/lib/vprintf.c create mode 100644 src/bin/coreutils/lib/wchar.in.h delete mode 100644 src/bin/coreutils/lib/wchar_.h create mode 100644 src/bin/coreutils/lib/wcrtomb.c rename src/bin/coreutils/lib/{wctype_.h => wctype.in.h} (69%) create mode 100644 src/bin/coreutils/lib/wcwidth.c delete mode 100644 src/bin/coreutils/lib/wcwidth.h create mode 100644 src/bin/coreutils/lib/write-any-file.c create mode 100644 src/bin/coreutils/lib/write-any-file.h create mode 100644 src/bin/coreutils/lib/write.c create mode 100644 src/bin/coreutils/lib/xasprintf.c create mode 100644 src/bin/coreutils/lib/xfreopen.c create mode 100644 src/bin/coreutils/lib/xfreopen.h create mode 100644 src/bin/coreutils/lib/xprintf.c create mode 100644 src/bin/coreutils/lib/xprintf.h delete mode 100644 src/bin/coreutils/lib/xreadlink.c delete mode 100644 src/bin/coreutils/lib/xreadlink.h create mode 100644 src/bin/coreutils/lib/xsize.h create mode 100644 src/bin/coreutils/lib/xstriconv.c create mode 100644 src/bin/coreutils/lib/xstriconv.h create mode 100644 src/bin/coreutils/lib/xstrtol-error.c create mode 100644 src/bin/coreutils/lib/xvasprintf.c create mode 100644 src/bin/coreutils/lib/xvasprintf.h create mode 100644 src/bin/coreutils/man/arch.x create mode 100644 src/bin/coreutils/man/chcon.1 create mode 100644 src/bin/coreutils/man/chcon.x delete mode 100644 src/bin/coreutils/man/hostname.1 create mode 100644 src/bin/coreutils/man/mktemp.1 create mode 100644 src/bin/coreutils/man/mktemp.x create mode 100644 src/bin/coreutils/man/runcon.1 create mode 100644 src/bin/coreutils/man/runcon.x delete mode 100644 src/bin/coreutils/man/su.1 create mode 100644 src/bin/coreutils/man/timeout.1 create mode 100644 src/bin/coreutils/man/timeout.x create mode 100644 src/bin/coreutils/man/truncate.1 create mode 100644 src/bin/coreutils/man/truncate.x create mode 100644 src/bin/coreutils/src/chcon.c create mode 100644 src/bin/coreutils/src/getlimits.c create mode 100644 src/bin/coreutils/src/group-list.c create mode 100644 src/bin/coreutils/src/group-list.h create mode 100644 src/bin/coreutils/src/groups.c delete mode 100755 src/bin/coreutils/src/groups.sh create mode 100644 src/bin/coreutils/src/mktemp.c create mode 100644 src/bin/coreutils/src/operand2sig.c create mode 100644 src/bin/coreutils/src/operand2sig.h create mode 100644 src/bin/coreutils/src/prog-fprintf.c create mode 100644 src/bin/coreutils/src/prog-fprintf.h create mode 100644 src/bin/coreutils/src/runcon.c create mode 100644 src/bin/coreutils/src/timeout.c create mode 100644 src/bin/coreutils/src/truncate.c create mode 100644 src/bin/coreutils/src/uname-arch.c create mode 100644 src/bin/coreutils/src/uname-uname.c create mode 100644 src/bin/coreutils/src/uname.h diff --git a/build/jam/HaikuImage b/build/jam/HaikuImage index 693554fdd4..c1eab3a5e2 100644 --- a/build/jam/HaikuImage +++ b/build/jam/HaikuImage @@ -36,7 +36,8 @@ SYSTEM_BIN = "[" addattr alert arp base64 basename bash bc beep bootman bzip2 factor false fdinfo ffm filepanel find finddir fmt fold fortune frcode ftp ftpd funzip fwcontrol - gawk $(X86_ONLY)gdb grep groups gzip gzexe hd head hey hostname + gawk $(X86_ONLY)gdb getlimits grep groups gzip gzexe + hd head hey hostname id ident ideinfo idestatus ifconfig install installsound iroster isvolume join @@ -55,10 +56,10 @@ SYSTEM_BIN = "[" addattr alert arp base64 basename bash bc beep bootman bzip2 safemode screen_blanker screenmode sed setdecor settype setversion setvolume seq sha1sum shar shred shuf shutdown sleep sort spamdbm split stat strace stty su sum sync sysinfo - tac tail tar tcpdump tcptester tee telnet telnetd test top touch tput tr - traceroute translate trash true tsort tty - uname unchop unexpand unmount uniq unrar unshar unzip unzipsfx updatedb - uptime urlwrapper useradd uudecode uuencode + tac tail tar tcpdump tcptester tee telnet telnetd test timeout top touch tput + tr traceroute translate trash true truncate tsort tty + uname unchop unexpand unmount uniq unlink unrar unshar unzip unzipsfx + updatedb uptime urlwrapper useradd uudecode uuencode vdir version vim vmstat waitfor wc wget whoami xargs xres yes zdiff zforce zgrep zip zipcloak zipgrep zipnote zipsplit zmore znew ; diff --git a/src/bin/coreutils/AUTHORS b/src/bin/coreutils/AUTHORS index 5200633a8f..fa3c02963c 100644 --- a/src/bin/coreutils/AUTHORS +++ b/src/bin/coreutils/AUTHORS @@ -1,35 +1,37 @@ Here are the names of the programs in this package, each followed by the name(s) of its author(s). +arch: David MacKenzie, Karel Zak base64: Simon Josefsson -basename: FIXME unknown -cat: Torbjorn Granlund, Richard M. Stallman +basename: David MacKenzie +cat: Torbjörn Granlund, Richard M. Stallman +chcon: Russell Coker, Jim Meyering chgrp: David MacKenzie, Jim Meyering chmod: David MacKenzie, Jim Meyering chown: David MacKenzie, Jim Meyering chroot: Roland McGrath cksum: Q. Frank Xia -comm: Richard Stallman, David MacKenzie -cp: Torbjorn Granlund, David MacKenzie, Jim Meyering +comm: Richard M. Stallman, David MacKenzie +cp: Torbjörn Granlund, David MacKenzie, Jim Meyering csplit: Stuart Kemp, David MacKenzie -cut: David Ihnat, David MacKenzie, Jim Meyering +cut: David M. Ihnat, David MacKenzie, Jim Meyering date: David MacKenzie dd: Paul Rubin, David MacKenzie, Stuart Kemp -df: Torbjorn Granlund, David MacKenzie, Paul Eggert -dir: Richard Stallman, David MacKenzie +df: Torbjörn Granlund, David MacKenzie, Paul Eggert +dir: Richard M. Stallman, David MacKenzie dircolors: H. Peter Anvin dirname: David MacKenzie, Jim Meyering -du: Torbjorn Granlund, David MacKenzie, Paul Eggert, Jim Meyering -echo: FIXME unknown +du: Torbjörn Granlund, David MacKenzie, Paul Eggert, Jim Meyering +echo: Brian Fox, Chet Ramey env: Richard Mlynarik, David MacKenzie expand: David MacKenzie -expr: Mike Parker +expr: Mike Parker, James Youngman, Paul Eggert factor: Paul Rubin false: Jim Meyering fmt: Ross Paterson fold: David MacKenzie ginstall: David MacKenzie -groups: David MacKenzie +groups: David MacKenzie, James Youngman head: David MacKenzie, Jim Meyering hostid: Jim Meyering hostname: Jim Meyering @@ -39,11 +41,12 @@ kill: Paul Eggert link: Michael Stone ln: Mike Parker, David MacKenzie logname: FIXME: unknown -ls: Richard Stallman, David MacKenzie +ls: Richard M. Stallman, David MacKenzie md5sum: Ulrich Drepper, Scott Miller, David Madore mkdir: David MacKenzie mkfifo: David MacKenzie mknod: David MacKenzie +mktemp: Jim Meyering mv: Mike Parker, David MacKenzie, Jim Meyering nice: David MacKenzie nl: Scott Bartram, David MacKenzie @@ -55,11 +58,12 @@ pinky: Joseph Arceneaux, David MacKenzie, Kaveh Ghazi pr: Pete TerMaat, Roland Huebner printenv: David MacKenzie, Richard Mlynarik printf: David MacKenzie -ptx: F. Pinard +ptx: François Pinard pwd: Jim Meyering readlink: Dmitry V. Levin -rm: Paul Rubin, David MacKenzie, Richard Stallman, Jim Meyering +rm: Paul Rubin, David MacKenzie, Richard M. Stallman, Jim Meyering rmdir: David MacKenzie +runcon: Russell Coker seq: Ulrich Drepper sha1sum: Ulrich Drepper, Scott Miller, David Madore sha224sum: Ulrich Drepper, Scott Miller, David Madore @@ -70,7 +74,7 @@ shred: Colin Plumb shuf: Paul Eggert sleep: Jim Meyering, Paul Eggert sort: Mike Haertel, Paul Eggert -split: Torbjorn Granlund, Richard M. Stallman +split: Torbjörn Granlund, Richard M. Stallman stat: Michael Meskes stty: David MacKenzie su: David MacKenzie @@ -80,19 +84,25 @@ tac: Jay Lepreau, David MacKenzie tail: Paul Rubin, David MacKenzie, Ian Lance Taylor, Jim Meyering tee: Mike Parker, Richard M. Stallman, David MacKenzie test: Kevin Braunsdorf, Matthew Bradburn +timeout: Pádraig Brady touch: Paul Rubin, Arnold Robbins, Jim Kingdon, David MacKenzie, Randy Smith tr: Jim Meyering true: Jim Meyering +truncate: Pádraig Brady tsort: Mark Kettenis tty: David MacKenzie uname: David MacKenzie unexpand: David MacKenzie -uniq: Richard Stallman, David MacKenzie +uniq: Richard M. Stallman, David MacKenzie unlink: Michael Stone uptime: Joseph Arceneaux, David MacKenzie, Kaveh Ghazi users: Joseph Arceneaux, David MacKenzie -vdir: Richard Stallman, David MacKenzie +vdir: Richard M. Stallman, David MacKenzie wc: Paul Rubin, David MacKenzie who: Joseph Arceneaux, David MacKenzie, Michael Stone whoami: Richard Mlynarik yes: David MacKenzie + +;; Local Variables: +;; coding: utf-8 +;; End: diff --git a/src/bin/coreutils/COPYING b/src/bin/coreutils/COPYING index d511905c16..94a9ed024d 100644 --- a/src/bin/coreutils/COPYING +++ b/src/bin/coreutils/COPYING @@ -1,285 +1,626 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. - Preamble + Preamble - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + TERMS AND CONDITIONS - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". + 0. Definitions. -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. + "This License" refers to version 3 of the GNU General Public License. - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. + A "covered work" means either the unmodified Program or a work based +on the Program. - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. + 1. Source Code. -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. + The Corresponding Source for a work in source code form is that +same work. -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. + 2. Basic Permissions. - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of this License. - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. + 13. Use with the GNU Affero General Public License. -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. + 14. Revised Versions of this License. - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. - NO WARRANTY + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. + 15. Disclaimer of Warranty. - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - END OF TERMS AND CONDITIONS + 16. Limitation of Liability. - How to Apply These Terms to Your New Programs + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it @@ -287,15 +628,15 @@ free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least +state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or + the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -303,37 +644,31 @@ the "copyright" line and a pointer to where the full notice is found. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + You should have received a copy of the GNU General Public License + along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/src/bin/coreutils/ChangeLog b/src/bin/coreutils/ChangeLog index 034a6d618b..0739db3441 100644 --- a/src/bin/coreutils/ChangeLog +++ b/src/bin/coreutils/ChangeLog @@ -1,5539 +1,6616 @@ -2007-03-22 Jim Meyering +2009-05-07 Jim Meyering - Version 6.9. - * NEWS: Record release date and new version number. - * configure.ac (AC_INIT): New version number. + version 7.4 + * NEWS (Build-related): Mention make check fixes. - * tests/mv/hard-3: Correct the preceding change: $3 -> $2. + admin: update NEWS + * NEWS (Bug fixes): Mention the date-related fixes. + (Portability): Mention the ACL-related fixes on *BSD. -2007-03-22 Paul Eggert +2009-05-05 Pádraig Brady - Improve a test script. - * tests/mv/hard-3: Check for 'ls' failure, too. - Generate more-useful debugging output when 'ls' fails. + doc: note the use of LC_COLLATE in comm, join and uniq + * doc/coreutils.texi (uniq invocation): Simplify the + text to remove the inconsequential mentioning of order, + while implying that LC_COLLATE can alter equality comparisons. + * src/comm.c (usage): Mention LC_COLLATE is significant. + * src/join.c (usage): Ditto. + * src/uniq.c (usage): Ditto. Also improve the summary. + Suggestion from Andries Brouwer -2007-03-21 Jim Meyering +2009-05-05 Jim Meyering - Fix a test script not to claim an ext2 file system is of type xfs. - * tests/du/slink: When using df --local and df --type=TYPE, - test only the exit code. Don't bother with stdout. - Prompted by a report by Thomas Schwinge of an inaccurate diagnostic. + tests: rm/one-file-system: umount more reliably + * tests/rm/one-file-system: Run umount via trap, so it runs + also upon irregular termination. - * gl/lib/savewd.c: Remove this file, since the savewd_save change - is now in gnulib. The other wasn't useful. +2009-05-05 Andreas Schwab -2007-03-20 Jim Meyering + tests: fix typo in check-AUTHORS rule + * src/Makefile.am (check-AUTHORS): Set locale. - * gl/lib/acl.c: Remove this file, now that gnulib's version subsumes it. +2009-05-04 Jim Meyering - Skip part of this test when "." is not a local file system. - * tests/install/basic-1: Otherwise, it would fail on some NFS - file systems. - * tests/mkdir/p-3: Likewise. + build: use a gnulib SHA1 that is not private + * gnulib: Update submodule to latest *public*. -2007-03-19 Paul Eggert + build: update from gnulib, for ACL-related fixes + * gnulib: Update submodule to latest. - * src/Makefile.am (dir_LDADD, ls_LDADD, vdir_LDADD): - Add $(LIB_ACL_TRIVIAL). +2009-05-03 David Bartley -2007-03-18 Jim Meyering + mv, rm: adapt to new and improved gnulib interfaces + Use gnulib's new priv-set module and updated write-any-file. + With them, the remove-called can_write_any_file function no + longer tries to drop the unlink-directory privilege, so now + each caller of remove must do that separately, calling + priv_set_remove_linkdir. + * bootstrap.conf (gnulib_modules): Add priv-set. + * src/rm.c: Include "priv-set.h". + (main): Call priv_set_remove_linkdir. + * src/mv.c (main): Likewise. + * gnulib: Update submodule to latest. - Fix a generic NFS-related test failure. - * tests/mkdir/p-3: When setting up an unreadable "." in an - inaccessible parent, make the parent inaccessible *after* making "." - unreadable. Otherwise, running "chmod a-r ." in an already- - inaccessible parent would fail on NFS with "Stale NFS file handle". +2009-05-03 Jim Meyering - Fix a bug in how pr -m -s works. - * NEWS: Describe how the fix affects pr. - * src/pr.c (init_parameters): The --merge (-m) option does - not imply --expand-tabs (-e), so don't set "untabify_input". - Reported by Wis Macomson. - * tests/misc/pr: New file. Test for the above fix. - * tests/misc/Makefile.am (TESTS): Add pr. - * THANKS: Update. - -2007-03-17 Jim Meyering - - Detect use of AC_CONFIG_AUX_DIR also when its argument is quoted. - * bootstrap: Put ""s around use of $build_aux, in case - someone uses a name containing shell meta-characters. - Reported by Alfred M. Szmidt. - * tests/misc/tty-eof: Add shuf to the list of tested commands. - - Avoid test failure on NFS-mounted Solaris ZFS file system. - * tests/du/basic: Skip a test if "." is on a non-local file system. - - Avoid an obscure build failure, prefer waitpid over wait. - * src/install.c (strip): Use waitpid, not wait. It's equivalent, - but feels less obsolescent. - - * bootstrap: Don't use \> in grep regexp. For HP-UX. - -2007-03-16 Jim Meyering - - Begin adding support for Solaris ZFS (4 entries per trivial ACL) - * gl/lib/acl.c (ACL_NOT_WELL_SUPPORTED): New macro. - (file_has_acl, copy_acl): Use it, rather than enumerating errno values. - (is_trivial_acl): New function. Incomplete, for now. - (file_has_acl, copy_acl): Use the new function, rather than - counting the number of entries in an ACL. - - * bootstrap: Update from gnulib. - - * .x-sc_prohibit_atoi_atof: Add TODO here, too. - -2007-03-16 Paul Eggert - - * src/copy.c: Include filemode.h. - (overwrite_prompt): Say "try to overwrite", not "overwrite", to - make it clearer that the attempt may fail. Problem reported by - Dan Jacobson in: - http://lists.gnu.org/archive/html/bug-coreutils/2007-03/msg00130.html - Output symbolic mode as well as numeric. - * tests/mv/i-2 (fail): Adjust to new prompt format. - -2007-03-15 Jim Meyering - - Enforce policy: don't use *scanf functions. - * Makefile.maint (sc_prohibit_atoi_atof): Add to regexp and diagnostic. - * .x-sc_prohibit_atoi_atof: Give stty a temporary pass. - * TODO: note that stty.c needs this small clean-up. - -2007-03-13 Jim Meyering - - Prepare to work on ACL-related failure when using Solaris ZFS. - * gl/lib/acl.c: New file, copied from gnulib. - - Work around a failing test due to an NFS-based race condition. - * tests/cp/sparse: Accept a report that the copy is *smaller*. - -2007-03-12 Jim Meyering - - Make bootstrap.conf a tiny bit more generic. - * bootstrap.conf (XGETTEXT_OPTIONS): Exclude gettext-related .m4 - files when e.g., AM_GNU_GETTEXT([external] appears in configure.ac. - -2007-03-10 Jim Meyering - - Try to fix today's NFS-related failure: Treat ESTALE like EACCES. - * gl/lib/savewd.c: Copy this file from gnulib, then change - "errno != EACCES" to (errno != EACCES && errno != ESTALE). - The symptom was this failure in tests/install/basic-1: - ginstall: cannot create directory `rel/a': Stale NFS file handle - - The preceding change solved part of the problem. Now ginstall fails. - * tests/install/basic-1: Temporarily, don't redirect ginstall's - stderr to /dev/null, so I can see why the NFS autobuilder's NFS test - is failing. - - * tests/install/basic-1: When setting up an unreadable "." in an - inaccessible parent, make the parent inaccessible *after* making "." - unreadable. Otherwise, running "chmod a-r ." in an already- - inaccessible parent would fail on NFS with "Stale NFS file handle". - Reported by Bob Proulx. - - * Makefile.maint (po-check): Exclude c99-to-c89.diff. - -2007-03-09 Jim Meyering - - Avoid test failures on Darwin 7.9.0 (MacOS X 10.3.9) - * tests/chgrp/basic: Don't let failure by chgrp to set the - group of a symlink make this test fail. Do give a diagnostic. - In the chgrp-no-change-ctime test, add darwin7.9.0 as another - known-failing system. - When failing on some other system, print $host_triplet, too. - Also avoid test failures on Darwin 8.8.x (MacOS X 10.4). - Reported by Peter Fales. - -2007-03-08 Jim Meyering - - * src/c99-to-c89.diff: Reflect the new c99'ism, update offsets. - -2007-03-08 Paul Eggert - - rm without -f: give a better diagnostic when euidaccess fails. - * src/remove.c (write_protected_non_symlink): Return int, not bool, - so that we can indicate failure too (as a postive error number). - (prompt): If write_protected_non_symlink fails, report that error - number and fail rather than charging ahead and removing the dubious - entry. Redo the logic of printing a diagnostic so that we need to - invoke quote (full_filename (...)) only once. More details at: - - -2007-03-08 Jim Meyering - - Generalize a few more cvs-isms. - * bootstrap (checkout_only_file): Rename from CVS_only_file. - Change comments and diagnostics not to say "CVS". - - * bootstrap: Run libtool, if necessary. - - Make bootstrap a little more general. - * bootstrap (build_aux): Factor out/use this definition. - Formally require a "AC_CONFIG_AUX_DIR($build_aux)" line in configure.ac. - (insert_sorted_if_absent): Move function definition "up", to - precede new first use. - If $build_aux/ doesn't exist initially, create it, and - mark it as ignored. - -2007-03-03 Andrew Church (tiny change) - Paul Eggert - - Fix a bug: cp -x would fail to set mount point permissions. - * NEWS: mention cp -x bug fix - * src/copy.c (copy_internal): Don't return immediately after - copying a mount point that we do not intend to recurse under. - Based on a patch by Andrew Church. - -2007-03-03 Jim Meyering - - pwd-unreadable-parent: Skip test on ia64/Linux, too. - * tests/misc/pwd-unreadable-parent: Also skip when $REPLACE_GETCWD. - Reported by Bob Proulx. - -2007-03-02 Jim Meyering - - pwd-unreadable-parent: Skip test on non-Linux/GNU systems. - * tests/misc/pwd-unreadable-parent: Rather than trying to decide - whether this test has a chance of succeeding, run it only when - $(host_os) is linux-gnu. It was failing on powerpc-apple-darwin8.8.0 - * tests/misc/Makefile.am (TESTS_ENVIRONMENT): Add host_os=$(host_os). - - * tests/misc/pwd-long: Also allow "+" in $PWD. - - Remove another coreutils-ism. Formatting cleanup. - * Makefile.maint (my-distcheck): Update an outdated comment. - (emit_upload_commands): Use $(PACKAGE) rather than "coreutils". - (my-distcheck): Skip the c99/c89 check if there's no such .diff file. - -2007-03-01 Jim Meyering - - * Makefile.maint (warn_cflags): Hoist, adding "-Dlint -O". - (my-distcheck): Use the new variable, instead of too-long literal. - - Make "make syntax-check" rules less coreutils-specific. - * Makefile.maint (sc_cast_of_x_alloc_return_value): Use CVS_LIST_EXCEPT. - (sc_cast_of_alloca_return_value): Likewise. - (sc_root_tests): Do nothing if there is no check-root target - in tests/Makefile.am. - - Run the writable-files check only for release-building targets. - * Makefile.maint (local-checks-available): Remove writable-files. - (alpha beta major): Put it here, instead. - - "make syntax-check" now runs only Makefile.cfg-selected tests - * Makefile.maint (syntax-check-rules): Hoist this definition so that - it precedes the indirect use in the definition of $(local-check). - (local-check): Use :=, not just "=". - (syntax-check): Depend on $(local-check), not $(syntax-check-rules). - -2007-02-28 Bruno Haible - - * bootstrap.conf (gnulib_modules): Replace xreadlink with - xreadlink-with-size. Add xreadlink. - * src/copy.c (copy_internal): Update. - * src/ls.c (is_directory): Update. - * src/stat.c (print_stat): Update. - * src/readlink.c (main): Use the one-argument xreadlink function. - -2007-02-28 Paul Eggert - - * doc/coreutils.texi (Common options): --si outputs "M", not "MB". - Problem reported by Philip Rowlands in - . - -2007-02-28 Jim Meyering - - * .x-sc_file_system: Add the new test, tests/misc/df-P, to this - list of exceptions, for the "make distcheck" sc_file_system rule. - - * Makefile.maint (gnulib_snapshot_date): Remove now-unused definition. - -2007-02-27 Paul Eggert - - Make df -P immune to effects of e.g., the BLOCK_SIZE envvar. - * NEWS: With -P, the default block size and output format is not - affected by DF_BLOCK_SIZE, BLOCK_SIZE, or BLOCKSIZE. - * src/df.c (main): Implement this. - -2007-02-27 Jim Meyering - - Add a test for the above. - * tests/misc/df-P: New file. - * tests/misc/Makefile.am (TESTS): Add df-P. - -2007-02-25 Jim Meyering - - * Makefile.maint (announcement): Adjust so that it works with - announce-gen's --gnulib-snapshot-time-stamp option. - Indent one of the command lines using TAB, not 8 spaces. - - Post-release version change. - * NEWS: Add a line for 6.8+. - * configure.ac (AC_INIT): Set new version string. - -2007-02-24 Jim Meyering - - Version 6.8. - * NEWS: Record release date and new version number. - * configure.ac (AC_INIT): New version number. - - Don't skip this test on new-enough Linux/GNU systems. - * tests/misc/pwd-unreadable-parent: Test $REPLACE_GETCWD = 0, - rather than for __GETCWD_PREFIX in config.h (the latter is no - longer defined, ever, due to gnulib changes). - * tests/misc/Makefile.am (TESTS_ENVIRONMENT): Define REPLACE_GETCWD. - - Remove the "gnits" option; it prohibits my using "+" as a version - string suffix, and all it does (beyond the default "gnu" option) - is to _require_ the THANKS file. - * configure.ac (AM_INIT_AUTOMAKE): Remove it. - - Remove all AUTOMAKE_OPTIONS settings in Makefile.am files. - * tests/chgrp/Makefile.am, tests/chmod/Makefile.am: - * tests/chown/Makefile.am, tests/cp/Makefile.am: - * tests/du/Makefile.am, tests/expr/Makefile.am: - * tests/factor/Makefile.am, tests/general/Makefile.am: - * tests/install/Makefile.am, tests/ln/Makefile.am: - * tests/ls/Makefile.am, tests/mkdir/Makefile.am: - * tests/mv/Makefile.am, tests/readlink/Makefile.am: - * tests/rm/Makefile.am, tests/rmdir/Makefile.am: - * tests/seq/Makefile.am, tests/stty/Makefile.am: - * tests/tee/Makefile.am, tests/touch/Makefile.am: - - * README: Document the OSF/1 4.0d build failure and work-around. - Reported by Bruno Haible. - - * NEWS: Use a simple "+" suffix to denote pre-release, not "-dirty". - Nicer connotations. - * configure.ac: Use 6.7+, not 6.7-dirty. - -2007-02-24 Paul Eggert - - * NEWS: sort no longer compresses temporaries by default. - * bootstrap.conf: Remove findprog. - * doc/coreutils.texi (sort invocation): The default is to not - compress. Don't treat "" specially. - * src/sort.c: Don't include findprog.h. - (create_temp): Compress only if the user specified --compress-program. - * tests/misc/sort-compress: Adjusts tests to match new behavior. - -2007-02-24 Jim Meyering - - Avoid a shell syntax error, when building with an inadequate Perl. - * man/Makefile.am (.x.1): Add quotes around $(PERL) in case, since - it can expand to "/.../missing perl". - - * man/Makefile.am (.x.1): Warn when unable to update a man page. - Suggestion from Bruno Haible. - -2007-02-23 Bruno Haible - - Handle better the combination of old Perl and a pre-c99 compiler. - * man/Makefile.am (.x.1): If the autoconf test has determined that - perl is missing or not a sufficient version, do nothing. - - * tests/readlink/can-e: Put the closing double-quote at the end of a - backquoted word, not in the middle. Works around a bug in sh on - OSF/1 4.0d. - * tests/readlink/can-f: Likewise. - * tests/readlink/can-m: Likewise. - - * tests/du/slink: Skip the test if executing on an nfsv3 file system. - This avoids a test failure at least on OSF/1 4.0d. - -2007-02-23 Jim Meyering - - * src/date.c (usage): Split a diagnostic that had grown to be - longer than the C89 maximum of 509 bytes. - -2007-02-23 Ed Santiago - - * src/date.c (usage): Mention that --rfc-3339 uses space, not 'T', - for a separator. Include sample RFC 2822 and 3339 output. - -2007-02-23 Jim Meyering - - With -Dlint, make shuf free all heap-allocated storage. - * src/shuf.c (main): Move declaration of input_lines to - function scope, and initialize to NULL, so we can free it. - [lint]: Free all malloc'd memory. - * tests/misc/shuf: Also test shuf's -e and -i options. - -2007-02-22 Jim Meyering - - Merge in a change from some other incarnation of this file (gzip?) - * bootstrap (gnulib_tool): Skip get_translations if there is no po/ dir. - - Adjust preceding change not to perform an unaligned access. - * src/copy.c (copy_reg): Undo previous change. Instead, make - it clearer that we're using a single-byte sentinel, and - [lint]: Initialize sizeof (uintptr_t) - 1 bytes after the sentinel. + tests: correct the "make check"-run check-AUTHORS test + * src/Makefile.am (check-AUTHORS): Revert back to using + en_US.UTF-8, to ease parsing (English-only) text around the + list of names, even when .po files are not installed. Reported by Andreas Schwab. + Along the way, use $(AM_V_GEN), not "@". + (sc_tight_scope): Use $(AM_V_GEN) here, too. + * gnulib: Update submodule to latest, for the proper_name_utf8 fix + that makes --version output print the UTF-8 rendering of author names + in more cases. - Placate valgrind, wrt ./cp --sparse=always - * src/copy.c (copy_reg): Place the sentinel by setting a - full word's worth of bits, not just a single byte's worth. - This avoids a harmless (but distracting) case of memory being - used-uninitialized. + tests: add tests of e.g., date -d 'next monday' + * tests/misc/date-next-dow: New file. + * tests/Makefile.am (TESTS): Add misc/date-next-dow. + * gnulib: Update submodule to latest, for getdate.y that + handles "next Monday" properly when run on a Monday. -2007-02-21 Paul Eggert +2009-05-01 Jim Meyering - Honor dd's noatime flag if possible, even if not supported on build fs - * doc/coreutils.texi (dd invocation): Warn that noatime might not be - reliable. - * src/dd.c (flags, usage): Look at O_NOATIME, not - HAVE_WORKING_O_NOATIME, to decide whether to support the noatime - flag, so that dd attempts O_NOATIME even if the build file system - does not support it. Problem reported by Jim Meyering today in - bug-coreutils. - * tests/dd/misc: Generate a warning, not a failure, if noatime - exists but fails. + post-release administrivia + * NEWS: Add header line for next release. + * .prev-version: Record previous version. + * cfg.mk (old_NEWS_hash): Auto-update. -2007-02-21 Jim Meyering + version 7.3 + * NEWS: Record release date. - * tests/misc/date: Remove vestigial use of Data::Dumper. + maint: tweak release-building notes + * README-release: Specify -j1 on the command to run all tests. + Otherwise, running some in parallel would cause failures, e.g., + for rm/ext3-perf and tail-2/assert-2. -2007-02-20 Paul Eggert +2009-05-01 Eric Blake - * src/copy.c (cached_umask): Cast -1 to mode_t to avoid a warning - about out-of-range initializer with Sun C 5.8. + stdopen: remove unused code + * m4/stdopen.m4: Delete now-unused file. + * lib/stdopen.h: Likewise. + * lib/stdopen.c: Likewise. -2007-02-20 Jim Meyering +2009-04-30 Jim Meyering - * bootstrap (CVS_only_file): Use README-hacking. + build: update from gnulib, for fixed lib/signbitl.c + * gnulib: Update submodule to latest. - Now that we use GIT, not cvs, rename README-cvs. - * README-hacking: Renamed from... - Update to reflect that we now use git. + build: "make check" now fails in a friendlier manner for missing Perl + * doc/Makefile.am (sc-lower-case-var): Don't redirect stderr of + $(PERL) (which is sometimes build-aux/missing) to /dev/null, + so that a failing "make check" explains that Perl is not installed. + Reported by James Youngman. - * README-cvs: ...this. + build: doc: emit something for each "make check"-run rule + * doc/Makefile.am: Use $(AM_V_GEN) in place of each leading "@". + (check-texinfo): Align line-continuation backslashes. - * src/env.c (main): When invoked with no arguments (i.e. when printing - the environment), use a local variable to iterate through the global - "environ" array, rather than "environ" itself. This is solely to - avoid changing the environment for an LD_PRELOAD-substituted "puts" - or "exit" function. Tiny patch by Harvey Eneman. See - . +2009-04-29 Jim Meyering + + build: update from gnulib, for the lib/*-state.c compilation fixes + * gnulib: Update submodule to latest. + +2009-04-28 Pádraig Brady + + misc: correct NEWS entry about id -G portability + * NEWS (Portability): getgrouplist has the portability issues, + not getgroups. + +2009-04-28 Jim Meyering + + df: adjust comment to match recent code change + * src/df.c (main): Update comment to match. + + misc: mention the df vs. automount change + * NEWS (Portability): Mention that df now accommodates the new + behavior of some automounters. + + misc: alphabetize NEWS entries + +2009-04-28 Tomas Smetana + + df: use open(2), not stat, to trigger automounting + * src/df.c (main): When iterating over command-line arguments, + attempting to ensure each backing file system is mounted, use + open, not stat. stat is no longer sufficient to trigger + automounting, in some cases. Based on a suggestion from Ian Kent. + More details in http://bugzilla.redhat.com/497830 + +2009-04-28 Ondřej Vašík + + tests: ensure that cp's -a doesn't silence --preserve=context + * tests/cp/cp-a-selinux: Ensure that the -a option does not silence + error diagnostics from --preserve=context, when preserving context + is required. + + tests: add test for xattr diagnostics on dest. FS lacking xattr support + * tests/cp/cp-mv-enotsup-xattr: Ensure that xattr diagnostics are + displayed correctly when destination filesystem lacks xattr support. + * tests/Makefile.am (root_tests): Add new root-only test. + +2009-04-27 Jim Meyering + + copy.c: factor out test for errno value indicating "unsupported" + * src/copy.c (errno_unsupported): New function. + (copy_attr_error, copy_internal): Use it. + +2009-04-27 Ondřej Vašík + + cp -a: diagnose failure when preserving xattr/context required + * src/copy.c (copy_attr_by_fs): Always print diagnostics when preserving + xattrs is required. + (copy_attr_by_name): Likewise. + (copy_reg): Always print diagnostics when preserving SELinux + context is required. + (copy_internal): Likewise. Also, do not ignore ENOTSUP and ENODATA + errors when preserving SELinux context is required. + * NEWS (Bug fixes): Mention it. + + mv: ignore xattr-preservation failure when not supported by filesystem + *src/copy.c: Do not warn about xattr-preservation failure when xattrs + are not supported and preservation of xattrs is not explicitly required. + Reported by Eric Sandeen in http://bugzilla.redhat.com/496142 + +2009-04-25 Jim Meyering + + build: update from gnulib, for the vc-list-files fix + * gnulib: Update submodule to latest. + + build: adjust use of automake's new $(AM_V_GEN) variable + * src/Makefile.am (dircolors.h, wheel-size.h, wheel.h, fs.h): + (version.c, version.h): Use $(AM_V_GEN) only as a prefix of an existing + command. Otherwise, it provokes warnings from some "make" programs. + Suggestion from Ralf Wildenhues. + +2009-04-25 Ralf Wildenhues + + tests: fix check-AUTHORS skip logic + * src/Makefile.am (check-AUTHORS): When this test is skipped, be + sure to avoid all commands in the recipe, not just those passed + to the first shell. + +2009-04-25 Eric Blake + + cfg.mk: update to latest gnulib change + * cfg.mk (bootstrap-tools): Override maint.mk default to include + bison. + * gnulib: Update to latest gnulib. + +2009-04-24 Jim Meyering + + build: move coreutils-specific rules from maint.mk to new file + * dist-check.mk: New file: coreutils-specific rules extracted + from maint.mk, now that maint.mk has migrated to gnulib. + * Makefile.am (EXTRA_DIST): Add dist-check.mk. + * coreutils/cfg.mk: Include $(srcdir)/dist-check.mk. + * gnulib: Update submodule to latest. + + tests: avoid unusual (~1-in-20) failure of a new test + * tests/misc/sort: Remove one of the generated tests. + 363 remain in this file alone. + + build: use automake's new $(AM_V_GEN) and $(AM_V_at) variables + * src/Makefile.am (dircolors.h, wheel-size.h, wheel.h, fs.h): + (version.c, version.h): Mark with $(AM_V_GEN) and $(AM_V_at), + so that the latest automake prints "GEN $@" by default. + +2009-04-24 Simon Josefsson + + build: use maint.mk from gnulib + * maint.mk: Remove file. Now it's generated. + * .gitignore: Ignore it. + * bootstrap.conf (gnulib_modules): Add maintainer-makefile. + * gnulib: Update submodule to latest. + +2009-04-23 Jim Meyering + + build: make --enable-silent-rules the default + * configure.ac (AM_INIT_AUTOMAKE): Remove silent-rules. Instead,... + (AM_SILENT_RULES): Use this, with it's undocumented [yes] argument. + Those who want verbose build output may configure with + --disable-silent-rules or use "make V=1". + + * gnulib: Update submodule to latest. + + sort -m: don't segfault when output file is also an input file + * src/sort.c (avoid_trashing_input): Fix an off-by-one error and + guard the use of memmove. + * NEWS (Bug fixes): Mention it. + * tests/misc/sort: Add tests to exercise the offending code. + * THANKS: Update. + Reported by Otavio Salvador in http://bugs.debian.org/525048. + + tests: make the check-AUTHORS test more portable, now that it's... + run as part of "make check". + * src/Makefile.am (check-AUTHORS): Don't depend on en_US.UTF-8. + Instead, use the French UTF8 locale, if configure found one. + If not found, just skip the test. + + avoid parallel "make distcheck" failure due to two run-in-src/ rules + Move the check-AUTHORS rule from "syntax-check" to "check". + * maint.mk (local-checks-available): Remove check-AUTHORS. + (check-AUTHORS): Remove rule. + * src/Makefile.am (CLEANFILES): Add $(no_install__progs), + since they too are built sometimes. + (check-AUTHORS): Split a longer-than-80 sed command. + (../AUTHORS): Remove obsolete rule. + +2009-04-22 Jim Meyering + + cp: work around linux kernel bug: short-read != EOF on /proc + Remove the optimization that avoided up to 50% of cp's read syscalls. + Do not assume that a short read on a regular file indicates EOF. + When reading from a file in /proc on linux [at least 2.6.9 - 2.6.29] + into a 4k-byte buffer or larger, a short read does not + always indicate EOF. For example, "cp /proc/slabinfo /tmp" + copies only 4068 of the total 7493 bytes. This optimization + (25719a33154f0c62ea9881f0c79ae312dd4cec7a, Improve performance a bit + by optimizing away; 2005-11-24) appears to have been worth less than + a 2% speed-up (and usually much less), so the impact of removing it + is negligible. + + * src/copy.c (copy_reg): Don't exit the loop early. + * tests/cp/proc-short-read: New test, lightly based on a suggestion + from Mike Frysinger, to exercise this fix. + * tests/Makefile.am (TESTS): Add cp/proc-short-read. + * NEWS (Improve robustness): Mention this change. + + tests: avoid new "make distcheck" failure due to newer File::Temp + With newer perl (e.g., Fedora 10's 4:5.10.0-68.fc10), tests/CuTmpdir.pm + stopped removing its temporary directories, with diagnostics like this: + cannot remove path when cwd is /c/coreutils/tests/misc/seq.tmp-e2up \ + for /c/coreutils/tests/misc/seq.tmp-e2up: at \ + /usr/lib/perl5/5.10.0/File/Temp.pm line 902 + Chdir out of the target directory before that code runs: + * tests/CuTmpdir.pm (END): chdir '..'. + (chmod_tree): Remove explicit "chdir $dir". + +2009-04-19 Jim Meyering + + doc: update README + * README: (Reporting bugs): List the bug-reporting address here, too, + not just in the following more test-oriented paragraph. + Reported by Tim Mooney. + All changes are no longer listed in version-controlled ChangeLog + files, so note that contributions are attributed in the commit logs. + Mention bootstrap.conf, now that it's the authoritative source of + minimal prerequisite program/version# pairs. + +2009-04-19 Aurelien Jarno + + tests: avoid failure of install-C test on FreeBSD UFS file system + * tests/install/install-C: Use 2755 (set-gid), not 1755 (sticky), + to test install -C with non-permission mode bits set. At least on + FreeBSD with a UFS file system, a non-root user may not set the + sticky bit on a non-directory. + +2009-04-19 Jim Meyering + + comment touch up: insert a space between "#" and text of comment + * bootstrap: It's easier to read that way. + +2009-04-19 Ralf Wildenhues + + fix comment typos + * bootstrap: Fix comment typos. + * src/pr.c: Likewise. + +2009-04-17 Jim Meyering + + maint: bootstrap: sync a tiny change from gnulib + * bootstrap: rename variable to sync with gnulib: s/\$depth/$shallow/ + +2009-04-16 Jim Meyering + + * gnulib: Update submodule to latest. + + build: use '.'-relative name, gnulib_dir + * cfg.mk (gnulib_dir): Use "gnulib", not "/gnulib", now that + the former is a git submodule, and guaranteed to exist. + +2009-04-15 Jim Meyering + + maint: clean up skipped syntax-check rules + * cfg.mk (local-checks-to-skip): Remove patch-check and changelog-check. + * maint.mk (patch-check): Remove rule. + (local-checks-available): Remove patch-check. + (changelog-check): Remove rule. + +2009-04-11 Ralf Wildenhues + + build: avoid parallel distcheck failure + * Makefile.am (ALL_RECURSIVE_TARGETS): Initialize here, too, + to please automake. Add install-root, check-root, distcheck-hook. + * cfg.mk (ALL_RECURSIVE_TARGETS): Add sc_tight_scope. + * maint.mk (ALL_RECURSIVE_TARGETS): Add patch-check, + check-AUTHORS, maintainer-distcheck, vc-dist, taint-distcheck, + my-distcheck, alpha, beta, major. + +2009-04-10 Jim Meyering + + doc: fix a typo: s/is a is a/is a/ + * doc/coreutils.texi (Putting the tools together): Fix typo. + + build: tight-scope test: don't build excluded programs + * src/Makefile.am (sc_tight_scope): Depend on $(bin_PROGRAMS), + not $(all_programs) + + gnulib: update to latest: fix ls -v & sort -V + * NEWS (Bug fixes): Mention it. + + maint: remove obsolete utime module + * bootstrap.conf (obsolete_gnulib_modules): Remove utime. + + maint: put each module name on its own line; sort + * bootstrap.conf (gnulib_modules): List them one per line. + +2009-04-09 Jim Meyering + + tests: misc/ls-misc: avoid shadowing local decl of $e + * tests/misc/ls-misc (make_j_d): Rename latter $e to $env + +2009-04-09 Pádraig Brady + + id: fix infinite loop on some systems + Steven Parkes reported that `id -G $USER` went into an infinite loop + on Darwin systems for users in more than 10 groups: + http://bugs.gentoo.org/show_bug.cgi?id=264007 + * gl/lib/mgetgroups.c (mgetgroups): Work around buggy getgrouplist + implementations that don't update the required size correctly, + by doubling the result buffer and retrying. Also return the + parameter updated by getgrouplist rather than its return value, + as the documentation doesn't actually state the number of groups + stored is returned by getgrouplist. + * tests/misc/id-groups: Add test to exercise this logic + * tests/Makefile.am: Reference new test + * NEWS: Mention the fix + * THANKS: Update + +2009-04-07 Jim Meyering + + maint: avoid "make syntax-check" failure + * src/install.c (main): Tweak syntax of new diagnostic. + +2009-04-07 Pádraig Brady + + install: deprecate the --preserve_context option + src/install.c: Print a warning when --preserve_context + rather than --preserve-context is used as per FIXME. + + maint: remove compiler warnings from randint and randread modules + * gl/lib/randint.c: Remove unused MAX macro + * gl/lib/randread.c (randread_error): Add __attribute__((__noreturn__)) + + shred,sort,shuf: don't use /dev/urandom by default + Suggestion from Steven Schveighoffer at: + http://savannah.gnu.org/patch/?6797 + to greatly speed up the random passes done by shred. + * gl/lib/randread.c: Default to using the internal + pseudorandom generator, rather than reading /dev/urandom + * src/shred.c (usage): remove mention of /dev/urandom + * src/shuf.c (usage); ditto + * src/sort.c (usage): ditto + * doc/coreutils.text: Document the new behaviour + for aquiring random data. + + maint: Clarify ambiguous refs to Linux kernels or GNU/Linux systems + * README-prereq: s_linux_GNU/Linux_ or s_linux_Linux kernel_ + * README-valgrind: ditto + * src/chown-core.c: ditto + * src/dd.c: ditto + * src/df.c: ditto + * src/ls.c: ditto + * src/mv.c: ditto + * src/pwd.c: ditto + * src/remove.c: ditto + * src/shred.c: ditto + * src/stat.c: ditto + * src/su.c: ditto + * src/system.h: ditto + * src/timeout.c: ditto + * src/truncate.c: ditto + + doc: add missing documentation for some SELinux options + * doc/coreutils.texi (ls invocation): Describe the --context (-Z) option + (install invocation): Describe the --preserve-context and -Z options + (id invocation): Describe the --context (-Z) option + (mkdir invocation): ditto + (mknod invocation): ditto + (mkfifo invocation): ditto + * TODO: remove the todo item + +2009-04-06 Jim Meyering + + * doc/code-vs-command: Remove long-unused, never-distributed file. + +2009-04-04 Jim Meyering + + gnulib: update to latest: includes Solaris 8 portability fixes + + maint: clean up Makefile.am, rename remaining ChangeLog files + * Makefile.am (changelog_etc, syntax_check_exceptions): Define. + (EXTRA_DIST): Use. Remove names that are now automatically + included: build-aux/git-version-gen, build-aux/vc-list-files. + * build-aux/ChangeLog-2007: Rename from */ChangeLog. + * doc/ChangeLog-2007: Likewise. + * lib/ChangeLog-2007: Likewise. + * m4/ChangeLog-2007: Likewise. + * po/ChangeLog-2007: Likewise. + + tests: tweak po_check syntax check + * maint.mk (sc_po_check): Don't let dangling lib/*.[ch] links cause + spurious "grep: lib/file.h: No such file or directory" warnings. + + tests: improve ChangeLog syntax check + * maint.mk (sc_changelog): Use $(VC_LIST_EXCEPT), not find. + Don't hang when there are no ChangeLog files. + (sc_require_config_h): For the file-name-filter, use grep -l + to be slightly more efficient. + (sc_require_config_h_first, _header_without_use, sc_program_name): + Likewise. + +2009-04-04 Ralf Wildenhues + + tests: make syntax-checks more robust + * maint.mk (_prohibit_regexp): Add ';' at end of ':'-introduced + comment so that the comment doesn't gobble up the following test + for a missing regexp definition. + (_header_without_use): Escape all '.'s in a header file name, + not just the first one. + +2009-04-03 Jim Meyering + + * cfg.mk (old_NEWS_hash): Regenerate once more. + + doc: adjust 7.2 "cat,cp,install,mv,split speed-up" NEWS item + * NEWS: Reword an entry from 7.2 and change "linux" to "GNU/Linux". + The latter was requested by Richard Stallman. + * cfg.mk (old_NEWS_hash): Regenerate. + +2009-04-03 Pádraig Brady + + ls: fix alignment when month names have varying widths + Reported by Samuel Thibault and Stéphane Raimbault, as the glibc fr_FR + locale has recently changed to use the official but variable width + abbreviated month names. Other glibc locales also have variable widths. + http://sourceware.org/ml/libc-locales/2008-q1/msg00035.html + http://sourceware.org/bugzilla/show_bug.cgi?id=9859 + * NEWS: Mention the fix + * gl/lib/mbsalign.c: A new module to align and truncate a + string in a specified number of screen cells, while handling + multi-byte characters appropriately. + * gl/lib/mbsalign.h: Ditto + * gl/modules/mbsalign: Ditto + * bootstrap.conf: Reference the new module + * src/ls.c (abmon_init): New function, precompute the abbreviated + months aligned left in a minimum width column <= 5 screen cells. + (align_nstrftime): New function, replace the first %b in the + format specification to strftime with the precomputed month string. + Note using the cached month strings speeds up `ls -lU` by around 17% + on glibc-2.7-2 on linux at least. Also if we implement this function + using heap storage rather than automatic storage, and use snprintf + instead of strcpy, ls will slow down by 2% and 1% respectively + (i.e. a net gain of 14% rather than 17%). + * tests/ls/abmon-align: A new test to test ls alignment for + various formats and locales + * tests/Makefile.am: Reference the new test + +2009-04-02 Pádraig Brady + + doc: Clarify the help for version sorting in ls and sort + * src/ls.c: Update the -v help description + * src/sort.c: Update the -V help description + +2009-04-02 Jim Meyering + + doc: adjust README-prereq instructions + * README-prereq: Reverse order of -b/--track options. + Pádraig Brady mentioned that is required with at least git-1.5.3.6. + Invoke automake's own bootstrap script. + +2009-04-02 C de-Avillez + + build: require automake-1.10b or newer + * bootstrap.conf: Require at least automake-1.10b. + * README-prereq: Mention 1.10b, not 1.10a. + +2009-04-02 Jim Meyering + + tests: skip mv/i-3 if /dev/stdin is unreadable + * tests/mv/i-3: Skip if /dev/stdin is unreadable. + Reported by Sergei Steshenko. + +2009-03-31 Jim Meyering + + build: set automake's silent-rules option via configure.ac + * bootstrap: Revert commit 9f39fa855, 2009-03-28, + "build: use automake's --silent-rules option when possible". + * configure.ac (AM_INIT_AUTOMAKE): Instead, set it here. + Require the just-released version of automake: 1.10b. + + tests: enable automake's color-tests and parallel-tests via configure.ac + * gnulib-tests/Makefile.am (AUTOMAKE_OPTIONS): Don't define here. + * tests/Makefile.am (AUTOMAKE_OPTIONS): Likewise. + * configure.ac (AM_INIT_AUTOMAKE): Instead, add color-tests and + parallel-tests here. + +2009-03-31 Ralf Wildenhues + + build: use Automake's new parallel-tests feature + * build-aux/check.mk: Remove, not needed any more. + * tests/Makefile.am (AUTOMAKE_OPTIONS): Add parallel-tests and + color-tests. + * tests/check.mk: Do not include build-aux/check.mk any more. + (SUFFIXES, TEST_LOGS): Remove. + (TESTS_ENVIRONMENT): Use $$f rather than $$tst in $PERL invocation. + * gnulib-tests/Makefile.am: Do not include build-aux/check.mk. + (AUTOMAKE_OPTIONS): New macro, add parallel-test and color-tests. + (TEST_LOGS): Remove. + +2009-03-31 Jim Meyering + + * README-release (savannah news): Also mention the Subject: to use. + + post-release administrivia + * NEWS: Add header line for next release. + * .prev-version: Record previous version. + * cfg.mk (old_NEWS_hash): Auto-update. + + version 7.2 + * NEWS: Record release date. + +2009-03-29 Jim Meyering + + tests: don't use lang-default from individual tests + * tests/sample-test: Don't recommend using lang-default here. + It is now run for each test automatically, via TESTS_ENVIRONMENT. + * tests/dd/reblock: Don't source lang-default here. + * tests/misc/truncate-fail-diag: Likewise. + + tests: other-fs-tmpdir: remove just-added duplicate /usr/tmp + * tests/other-fs-tmpdir (CANDIDATE_TMP_DIRS): Remove 2nd /usr/tmp. + + tests: other-fs-tmpdir: avoid bogus "skipped **********..." diagnostic + * tests/other-fs-tmpdir (CANDIDATE_TMP_DIRS): Add /dev/shm to the list. + Don't use a line of asterisks as the first line of the "why skipped" + diagnostic, now that that line is printed on 'make check's stderr. + +2009-03-28 Jim Meyering + + build: use automake's --silent-rules option when possible + * bootstrap: Use automake's --silent-rules option. + +2009-03-27 Jim Meyering + + tests: test-argv-iter.c: avoid declaration-after-stmt + * gl/tests/test-argv-iter.c: Move declaration "up", so as not + to ruffle feathers of crufty compilers. We accommodate such + compilers here solely because this module may migrate to gnulib. + Tiny patch by Matthew Woehlke. + +2009-03-27 Eric Blake + + tests: fix 'make sc_tight_scope' on cygwin + * src/Makefile.am (sc_tight_scope): Ignore leading underscores in symbols. + +2009-03-27 Jim Meyering + + tests: avoid spurious test failure in set-GID build dir + * tests/install/install-C-root: Skip this test if in set-gid directory. + Reported by Sven Joachim and C de-Avillez. + + tests: migrate setgid-check into test-lib.sh + * tests/test-lib.sh (skip_if_setgid_): New function. + * tests/setgid-check: Remove file. + * tests/Makefile.am (EXTRA_DIST): Remove setgid-check. + * tests/chmod/c-option: Use the new function rather than sourcing + the separate file. + * tests/cp/cp-parents: Likewise. + * tests/install/install-C: Likewise. + * tests/mkdir/parents: Likewise. + * tests/mkdir/perm: Likewise. + +2009-03-26 Jim Meyering + + tests: mark the rm/ext3-perf test as "very" expensive + * tests/rm/ext3-perf: Relegate this test to the very_expensive + category, since it is failing too often for me, when run in + parallel (-j4) with other disk-hammering tests. This test fails + when it takes too long, so the fact that it fails under pressure + is an inconvenience more than a real problem. + + * gnulib: Update submodule to latest. + +2009-03-26 Paul Eggert + + df: port the known-value fix to AIX as well + * src/df.c (known_value): New function, which also works on AIX + /proc file systems. + (df_readable, show_dev): Use it instead of hardcoding comparison to + UINTMAX_MAX. Suggested by Jim Meyering and Matthew Woehlke. + + df: fix a bug when totaling unknown values + * src/df.c (show_dev): Don't add UINTMAX_MAX to grand totals, as that + value indicates that the true value is unknown; adding it effectively + subtracts 1 from the total, whereas we want to leave the total alone. + +2009-03-25 Jim Meyering + + tests: don't fail "make syntax-check" on cygwin + * maint.mk (NEWS_hash): Remove trailing " -" or " *-". + * cfg.mk (old_NEWS_hash): Regenerate, removing " -". + Reported by Eric Blake. + +2009-03-25 Eric Blake + + pwd: support -L and -P + * src/pwd.c (longopts): New variable. + (logical_getcwd): New function. + (main): Use it. + (usage): Document new options. + * doc/coreutils.texi (pwd invocation): Likewise. + * NEWS: Likewise. + * TODO (pwd): Mark it done. + * tests/misc/pwd-option: New file. + * tests/Makefile.am (TESTS): Add test. + * THANKS: Update. + Reported by Paul D. Smith, in savannah bug 24949. + +2009-03-25 Ondřej Vašík + + doc: update suffix regex in version sort + * doc/coreutils.texi: Reflect current filevercmp regex. + +2009-03-25 Ralf Wildenhues + + tests: CuTmpdir.pm: avoid use of undefined variable in warning + * tests/CuTmpdir.pm (chmod_tree): Do not warn if $dir is undefined. + +2009-03-24 Jim Meyering + + tests: ls -v: exercise yet another change in gnulib's new filevercmp + * tests/misc/ls-misc: Add names with ~ and ~.1~ suffixes. + + * gnulib: Update submodule to latest. + +2009-03-24 Kamil Dudka + + ls: make it possible to disable coloring of hard links + * src/ls.c (print_color_indicator): Don't color hard links if disabled + (when there is an empty hl= in the LS_COLORS environment variable). + * tests/ls/hardlink: Add test case for disabled hard link highlighting. + * NEWS: Mention the change. + +2009-03-21 Jim Meyering + + tests: search only files that are under version control + * maint.mk (sc_error_exit_success): Search only files + that are under version control. + (sc_makefile_path_separator_check): Likewise. + Check *.mk files, too, not just Makefile.am files. + + tests: follow own advice: use $(PATH_SEPARATOR), not ":" + * maint.mk (coreutils-path-check): Use the variable, not the literal. + + tests: modernize: use $(var) makefile notation, not @var@ + * maint.mk (sc_makefile_path_separator_check): Recommend + the use of $(PATH_SEPARATOR), not @PATH_SEPARATOR@. + Remove an obsolete comment. + +2009-03-20 Jim Meyering + + tests: teach sc_dd_O_FLAGS about new syntax in dd.c + * cfg.mk (sc_dd_O_FLAGS): Adapt to new syntax. + +2009-03-20 Eric Blake + + dd: use a more portable definition of O_FULLBLOCK + * src/dd.c (O_FULLBLOCK): Compute its value without using a 180KB + macro. This avoids triggering a compilation failure with HP-UX's cc. + Reported by Matthew Woehlke. + +2009-03-20 Jim Meyering + + tests: avoid spurious mkdir/selinux test failure on HP-UX 11.23 + * tests/mkdir/selinux: Accept yet another diagnostic. + Reported by Matthew Woehlke. + +2009-03-19 Jim Meyering + + tests: df/total-verify: avoid test failure with older Perl + * tests/df/total-verify: Don't use perl's -f option. + Reported by Matthew Woehlke. + + * gnulib: Update submodule to latest. + +2009-03-18 Jim Meyering + + tests: adjust sort-continue not to fail under valgrind + * tests/misc/sort-continue: Don't run cat inside fd-limited shell. + If sort fails to run in an fd-limited shell, skip the test. + +2009-03-18 Paul Eggert + + tests: add another sort/nmerge test + * tests/Makefile.am (TESTS): Add sort-merge-fdlimit. + * tests/misc/sort-merge-fdlimit: New file. + * doc/coreutils.texi (sort invocation): Document that we now silently + lower nmerge if necessary. + Patch by Paul Eggert, Nima Nikzad, Max Chang, Alexander Nguyen, + Sahil Amoli, and Nick Graham. + + sort: handle fd exhaustion better when merging + This is an alternative to my 9 March patch labeled "Silently lower + nmerge; don't (sometimes incorrectly) range-check" + . + It differs by not using 'dup' to probe for extra file descriptors; + instead, it simply calls 'open' (and 'pipe') to open files and pipes, + until one of these calls fails due to file descriptor exhaustion; it + then backs off by 1, does a merge with the files that it has opened, + and then retries with the (now-smaller) number of files. + + This patch requires quite a few more changes to the source code than + the earlier patch, but it is in some sense "better" because it doesn't + need to call "dup" ahead of time in order to decide whether "open" or + "pipe" will fail. Also, it's more robust in the case where "open" or + "pipe" fails with errno==EMFILE because some system-wide limit is + exhausted. + + * src/sort.c (create_temp_file): New arg SURVIVE_FD_EXHAUSTION. + (stream_open): New function, containing guts of xfopen. + (xfopen): Use it. + (pipe_fork): Set errno on failure. + (maybe_create_temp): New function, containing guts of create_temp. + (create_temp): Use it. + (open_temp): Distinguish failures due to file descriptor exhaustion + from other failures, and on fd exhaustion return a notice to caller + rather than dying. Don't test execlp's return value; when it returns, + it *always* returns -1. + (open_input_files): New function. + (mergefps): New arg FPS. It's now the caller's responsibility to open + the input and output files. All callers changed. + (mergefiles): New function. + (avoid_trashing_input, merge): Handle the case where a single merge + can't merge as much as we wanted due to file descriptor exhaustion, by + merging as much as we can and then retrying. + * tests/Makefile.am (TESTS): Add misc/sort-continue. + * tests/misc/sort-continue: New file. + * THANKS: Add Glen Lenker and Matt Pham who coauthored this patch. + +2009-03-18 Jim Meyering + + maint: normalize leading-TAB indentation in Makefiles + * maint.mk (sc_makefile_TAB_only_indentation): New rule. + Replace each TAB+8-space sequence with two TABs. + * man/Makefile.am: Likewise. + * build-aux/check.mk: Likewise. + I used this command (run it more than once, if needed): + t=$'\t'; git grep -l -E "$t {8}"|grep -E 'Makefile|\.mk$' \ + | xargs perl -pi -e 's/\t {8}/\t\t/' + +2009-03-15 Jim Meyering + + maint: remove long-unused Makefile + * tests/sort-time/Makefile: Remove long-unused file. + + maint: remove unused include and definitions + * gl/lib/randread.c (__attribute__): Remove unused definition. + (ATTRIBUTE_UNUSED): Likewise. + * gl/lib/selinux-at.c (_): Remove unused definition. + Don't include . No longer needed. + + * gnulib: Update submodule to latest. + +2009-03-14 Jim Meyering + + system.h: correct compilation error: MAX not defined + * src/system.h (io_blksize): Move definition down, so it follows that + of MAX -- to avoid compilation failure on OpenSolaris. Reported by + David Bartley. Details in + http://lists.gnu.org/archive/html/bug-coreutils/2009-03/msg00190.html + + * gnulib: Update to pull in select/interix work-around. + +2009-03-13 Kamil Dudka + + doc: update "version sort" documentation + * doc/coreutils.texi: Reflect current filevercmp behavior. + +2009-03-12 Jim Meyering + + tests: groups-version: don't require that id be built + * tests/misc/groups-version: groups is now independent of id. + + tests: skip the groups-dash test when "groups" is not built + * tests/misc/groups-dash: Skip if groups is not being installed. + Suggested by Mike Frysinger. + Also fail if groups exits with nonzero status. + +2009-03-12 Pádraig Brady + + maint: mention Autoconf version required to build Automake + * README-prereq: coreutils currently requires an unreleased + version of Automake, so mention the minimum version of Autoconf + required to build that. Suggestion from James Youngman. + +2009-03-12 Jim Meyering + + * gnulib: Update submodule to latest. + +2009-03-11 Ondřej Vašík + + cp: make -a option preserve xattrs, but with reduced diagnostics + * copy.c (copy_attr_by_fd): Reduce xattr diagnostics for 'cp -a'. + (copy_attr_by_name): Likewise. + * cp.c (main): Preserve xattrs with -a option, when possible. + * doc/coreutils.texi: Document that xattrs are preserved with + cp -a, with no added diagnostics. + * NEWS: Mention the change. + * tests/misc/xattr: Add tests for 'cp --preserve=all' and 'cp -a'. + +2009-03-11 Pádraig Brady + + maint: Document how to best to enable gcc warnings for developers + * README-hacking: Mention --enable-gcc-warnings configure option + * configure.ac: Don't scare developers away from using gcc warnings + +2009-03-11 Jim Meyering + + maint: remove an obsolete FIXME comment + * src/Makefile.am (../AUTHORS): Remove obsolete FIXME comment. + There are no longer any installed *.sh programs. + +2009-03-11 Pádraig Brady + + cat: Fix immediate output of processed data + Introduced by commit 790892db, 2006-06-08 "Ensure that cat works ...". + * NEWS: Mention the bugfix. + * src/cat.c (cat): Fix the typo which stopped the writing + of processed data before a blocking read() is done. + * tests/misc/cat-buf: Add to ensure processed data is not buffered. + * tests/Makefile.am: Reference the new test. + + cat,cp,mv,install,split: Set the minimum IO block size used to 32KiB + This is following on from this change: + [02c3dc9d 2008-03-06 cat: use larger buffer sizes ...] + which increased the IO block size used by cat by 8 times, + but also capped it at 32KiB. + * NEWS: Mention the change in behavior. + * src/system.h: Add a new io_blksize() function that + returns the max of ST_BLKSIZE or 32KiB, as this was + seen as a good value for a minimum block size to use + to get good performance while minimizing system call overhead. + * src/cat.c: Use it. + * src/copy.c: ditto + * src/split.c: ditto + +2009-03-08 Jim Meyering + + tests: add a test for newly-fixed bug in comm --check-order + * tests/misc/comm (ooo-prefix): Add a test for today's fix. + * NEWS (Bug fixes): Mention it. + +2009-03-08 Bruno Haible + + comm: fix a bug in its new --check-order option + * src/comm.c: Include memcmp2.h. + (check_order): Use memcmp2 instead of memcmp. + * bootstrap.conf (gnulib_modules): Add memcmp2. + +2009-03-08 Jim Meyering + + tests: ls -v: exercise the bug fixed by gnulib's new filevercmp + * tests/misc/ls-misc (version-sort): New test. + (mk_file): New function. + Reported by Josh Triplett in . + Details in http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/16902 + * NEWS (Bug fixes): Mention it. + + gnulib: sync submodule to latest + +2009-03-07 Jim Meyering + + pr: fix a bug whereby --indent=N (-o) did not indent header lines + * src/pr.c (print_header): Honor chars_per_margin also for the header. + Inspired by a patch from C de-Avillez. + This change also adjusts two other %*s directives to be %*.*s instead, + (for the padding on either side of "file_text") to correct a bug that + could make pr print one space of padding instead of none. + * NEWS (Bug fixes): Mention it. + * tests/pr/o3Jml24f-lm-lo: Adjust for new expected output. + * tests/pr/o3a3Sl24f-tn: Likewise. + * tests/pr/o3a3Snl24f-tn: Likewise. + * tests/pr/o3a3l24f-tn: Likewise. + * tests/pr/o3b3Sl24f-tn: Likewise. + * tests/pr/o3b3Snl24f-tn: Likewise. + * tests/pr/o3b3l24f-tn: Likewise. + * tests/pr/o3mSl24f-bl-tn: Likewise. + * tests/pr/o3mSnl24fbltn: Likewise. + * tests/pr/o3ml24f-bl-tn: Likewise. + + bootstrap: add to XGETTEXT_OPTIONS + * bootstrap.conf (XGETTEXT_OPTIONS): Add c-format --flag options + for verror and verror_at_line; alphabetize. + + maint: use a git submodule for gnulib + * .gitmodules: New file, to track gnulib. + * gnulib: New file, created by running this: + git submodule add git://git.sv.gnu.org/gnulib.git gnulib + + build: allow ./bootstrap --srcdir=... to work with a git submodule + * bootstrap (git_modules_config): Use GIT_CONFIG, not GIT_CONFIG_LOCAL. + The latter was removed in v1.5.6.1-109-gdc87183. + + build: avoid "multiply defined..." warning from automake + * Makefile.am (AM_CFLAGS): Add $(WARN_CFLAGS) via +=, not =, to + avoid "multiply defined..." warning from automake. + +2009-03-06 Jim Meyering + + cat: use larger buffer sizes to reduce read/write-syscall overhead + * src/cat.c (max): Remove definition. Use MAX from system.h instead. + (compute_buffer_size): New function to compute the input and output + buffer sizes, which are now set at 8 times st_blksize with a maximum + of 32KiB. Previously the typical block sizes used were 1KiB for pipes + and 4KiB for files, and now will be 8KiB and 32KiB respectively. + (main): Use it. + This change can double throughput on modern systems. For timings, + see http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/16040 + Suggestion from Tzvi Rotshtein. + + maint: avoid new unused-macro warnings from gcc + * src/ls.c (ASSERT_MATCHING_DEV_INO): Comment-out unused definition, + to match commented-out use. + * src/install.c (INITIAL_HASH_MODULE, INITIAL_ENTRY_TAB_SIZE): + (READ_SIZE): Remove definitions of unused macros. + * src/mv.c (INITIAL_HASH_MODULE, INITIAL_ENTRY_TAB_SIZE): Likewise. + * src/dd.c (max): Likewise. + * src/expand.c (OUTPUT_BLOCK): Likewise. + * src/csplit.c (ALLOC_SIZE): Likewise. + * src/pr.c (NULLCOL): Likewise. + * src/ptx.c (Sword): Likewise. + * src/unexpand.c (OUTPUT_BLOCK): Likewise. + * src/factor.c (NDEBUG): Likewise. + + tests: fix just-introduced typo in rm/ext3-perf + * tests/rm/ext3-perf: Fix typo in commit 2b1e6636bea, + 2009-02-27 "tests: rm/ext3-perf: relax this test". + + maint: remove spurious case-ignoring option from a test + * maint.mk (sc_trailing_blank): Remove useless/harmless ignore_case=1. + +2009-03-04 Ralf Wildenhues + + policy: use git to help avoid trailing white space + * HACKING (Avoid trailing white space): Describe how git can help. + +2009-03-04 Andreas Schwab + + Update Andreas Schwab's email address + * THANKS: Update Andreas Schwab's email address. + +2009-03-03 Jim Meyering + + maint: improve release-related process and documentation + * README-release: Fix typo. it's "maintainer-clean". + Refer to HACKING for full list of dependencies. + Use cvs add's -ko option to inhibit $Id$-style keyword expansion. + * maint.mk (web-manual): Factor out definition of $(manual_title). + (vc-dist): Set XZ_OPT=-9ev for the final "make dist". + * cfg.mk (manual_title): Define it here. + Suggestions from Eric Blake. + +2009-03-02 Jim Meyering + + dist: document our release procedure + * README-release: New file. + + dist: automate the post-release web-manual update process + * maint.mk (web-manual): New rule, from m4's maint.mk. + * bootstrap.conf (gnulib_modules): Add gendocs. + + tests: rm/ext3-perf: relax this test + * tests/rm/ext3-perf: If set-up takes too long, use the set-up time + as the removal time limit. Otherwise, a parallel "make check" would + usually fail when run with RUN_VERY_EXPENSIVE_TESTS=yes. + + tests: don't skip setgid-dir related tests on SELinux-enabled systems + * tests/setgid-check: The change in ls (use ".", not "+") caused + this check always to report the working directory as set-gid. + Now, use stat, not ls. + + tests: reflect the s/+/./ SELinux indicator change + * tests/mkdir/perm: Now that this test is no longer always skipped, + make it work independently of ls: use stat, not ls, to get perm string. + * test-lib.sh (rwx_to_mode_): Use stat, not ls to get perm string + This test was run only when RUN_VERY_EXPENSIVE_TESTS=yes was set. + + tests: when skipping a test, say why on screen, not just in the log + * tests/test-lib.sh: Redirect also to descriptor 9. + Better one-line why-skip diagnostics. + * tests/check.mk (TESTS_ENVIRONMENT): Redirect 9 to stderr. + * tests/misc/pwd-unreadable-parent: Remove redundant "skipping..." diag. + + maint: enable many gcc warnings + * bootstrap.conf (gnulib_modules): Add manywarnings. + * configure.ac: Use gl_MANYWARN_ALL_GCC, and exclude options + I don't want or that provoke too many warnings. + (WARN_CFLAGS, WERROR_CFLAGS): Define. + (lint, GNULIB_PORTCHECK): Define. + (_FORTIFY_SOURCE): Define to 2. + + maint: avoid gcc warning about missing attributes + * src/prog-fprintf.h (prog_fprintf): Declare with printf attribute. + * src/system.h (usage): Declare with the "noreturn" attribute. + + maint: avoid warnings about potentially-counterproductive "inline" + * src/dd.c (quit): Remove "inline" attribute. + * src/test.c (advance, unary_advance): Likewise. + + maint: cp: avoid gcc warning about unused macro definitions + * src/cp.c (INITIAL_HASH_MODULE, INITIAL_ENTRY_TAB_SIZE): Remove. + + dist: do not emit MD5 or SHA1 checksums into announcement template + * maint.mk (announcement): Use announce-gen's new --no-print-checksums. + +2009-02-28 Jim Meyering + + maint: detect unnecessary inclusion of signal.h + * maint.mk (sc_prohibit_signal_without_use): New rule. + + maint: remove an unnecessary inclusion of + * src/operand2sig.c: Don't include . + +2009-02-28 Pádraig Brady + + tests: sort: Check skipping blanks in multibyte locales + * tests/misc/sort: On Fedora 8 at least, sort -k1b,1 + mishandles blanks in multibyte locales, so add test. + +2009-02-27 Jim Meyering + + * HACKING: avoid trailing white space + + cp: diagnose invalid "cp -rl dir dir" right away, once again + Running "mkdir dir; cp -rl dir dir" would create dir/dir/dir/... + rather than diagnosing the "copy-into-self" failure. + + The easy fix would have been to revert this part of the change + [3ece0355 2008-11-09 cp: use far less memory in some cases] + that introduced the bug: + + - remember_copied (dst_name, dst_sb.st_ino, dst_sb.st_dev); + + if (!x->hard_link) + + remember_copied (dst_name, dst_sb.st_ino, dst_sb.st_dev); + + However, that would have induced the failure of the new cp/link-heap + test, due to the added memory pressure of recording 10k dev/ino pairs. + And besides, I liked that improvement and wanted to keep it. + + Now that it's obvious recording the just-created-directory dev/ino + needn't depend on the setting of hard_link, I realized it is necessary + to record the pair only for the first directory created for each + source command-line argument. + + I made that change, then noticed the new test, cp -rl a d d, would pass + when run once, yet output the into-self diagnostic twice. Also note + the side effect: it creates d/a and d/d. However, running that same + command a second time, now with the modified directory, would fail. + + That turned out to be due to the fact that although the first into-self + failure was detected in copy_dir, that function would continue copying + other entries regardless -- and that would make it fail (eventually) + with the unwanted recursion. + + * src/copy.c (copy_internal): This function needed an indicator of + whether, for a give command line argument, it had already created its + first directory. If so, no more need to record dev/ino pairs. If this + is the first, then do record its pair. Hence, the new parameter. + (copy_dir, copy): Update callers. + (copy_dir): Upon any into-self failure, break out of the loop. + * tests/cp/into-self: Test for the above. + Reported by Mikael Magnusson. + +2009-02-26 Jim Meyering + + tests: stty-row-col would hang when run in the background + * tests/misc/stty-row-col: Don't hang when run in background + at least on Solaris 10 and OpenBSD. + +2009-02-26 Pádraig Brady + + sort: Fix two bugs with determining the end of field + * src/sort.c: When no specific number of chars to skip + is specified for the end field, always skip the whole field. + Also never include leading spaces from next field. + * tests/misc/sort: Add 2 new tests for these cases. + * NEWS: Mention this bug fix. + * THANKS: Add bug reporter. + Reported by Davide Canova. + +2009-02-26 Eric Blake + + argv-iter: avoid variadic macro + * gl/lib/argv-iter.h (_ATTRIBUTE_NONNULL_): Don't assume C99 variadic + macros are portable yet; needed for at least IRIX/MIPSpro. + * THANKS: Update. + Reported by Stuart Shelton. + +2009-02-26 Pádraig Brady + + tests: Remove system specific error strings + * tests/dd/skip-seek-past-file: Just check for + the non system specific part of the error strings. + This was causing an erroneous failure on NetBSD 1.6 at least. + +2009-02-25 Jim Meyering + + tests: using printf with \e for ESC isn't portable + * tests/ls/color-clear-to-eol: Use \33, not \e for ascii ESC. + This test failed when using the built-in printf of /bin/sh from + NetBSD 1.6. + +2009-02-24 Pádraig Brady + + Ensure comment for translators is included in po file + Issue reported by Göran Uddeborg. + + * src/system.h: Move the translator comment adjacent + to the translated string. + * THANKS: Update Göran's email address. + +2009-02-22 Tobias Stoeckmann + + truncate: fix typo in man page + * man/truncate.x: Fix spelling. * THANKS: Update. - * bootstrap: Move definitions of temporary directory names and the - new bt_regex "up" to precede all uses, so it's clearer what their - scope is. Also, use [.], rather than \\., since the former works - even if eval'd. +2009-02-22 Andrew Church - * bootstrap: Remove occurrences of $bt (._bootmp) from lib/Makefile. - Based on the bison 2007-02-19 change by Joel E. Denny. + doc: describe dd's status=noxref option + * doc/coreutils.texi (dd invocation): Describe status=noxref. -2007-02-19 Paul Eggert +2009-02-22 Jim Meyering - * NEWS: sort now uses a --compress-program option rather than - an environment variable. - * doc/coreutils.texi (sort invocation): Document this. - * src/sort.c (usage): Likewise. - (COMPRESS_PROGRAM_OPTION): New const. - (long_options, create_temp, main): Support new option. - * tests/misc/sort-compress: Test it. - -2007-02-19 Jim Meyering - - * bootstrap: Fix typo s/dowloading/downloading/ in --help output. - -2007-02-18 Jim Meyering - - * src/system.h: Don't include exit.h, now that it's subsumed - by the gnulib-generated stdlib.h. - - * tests/rm/fail-eacces: Skip this test when running as root. - Reported by Matthew Woehlke. - - * bootstrap: Use "._bootmp" as the temporary directory name, - not ".#bootmp". The latter's "#" caused trouble with the new, - gnulib-added "LINK_WARNING_H = $(top_srcdir)/.#bootmp/..." line. - -2007-02-14 Paul Eggert - - * bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase. - * src/dircolors.c: Include c-strcase.h. - (dc_parse_stream): Use c_strcasecmp rather than - strcasecmp to avoid unreliable results in locales like Turkish - where strcasecmp is incompatible with the C locale. - -2007-02-13 Jim Meyering - - Also check for and print stderr output, in case a program fails. - * tests/misc/tty-eof: Occasionally (not reproducible), this - test would fail, with one or more programs exiting nonzero, e.g., - tty-eof: sha224sum exited with status 1 (expected 0) - Now, maybe we'll get a clue, the next time that happens. - -2007-02-12 Jim Meyering - - * .x-sc_useless_cpp_parens: Ignore a false-positive in a shell script. - - * tests/misc/pwd-unreadable-parent: Skip the test if we're - definitely using the replacement. - * tests/misc/Makefile.am (TESTS_ENVIRONMENT): Define CONFIG_HEADER. - -2007-02-10 Jim Meyering - - Remove excess leading spaces that would make help2man misbehave. - * src/printf.c (usage): Remove excess spaces on 2nd line of %b desc. - * src/nl.c (usage): Remove excess spaces on 2nd line of pBRE desc. - * src/dd.c (usage): Remove excess spaces on 2nd line of sync desc. - * src/date.c (usage): Use two spaces after each optional flag, not one. - Reported by Thomas Huriaux in . - - * Makefile.maint (longopt_re): Relax the regexp, making square - brackets optional, so it matches the newly reported violations, too. - - * src/csplit.c (usage): Use two spaces (not one) to separate - each option string from its description, so help2man formats - the derived man page properly. Reported by Thomas Huriaux in - . - * src/df.c (usage): Likewise. - * src/du.c (usage): Likewise. - * src/install.c (usage): Likewise. - * src/ls.c (usage): Likewise. - -2007-02-03 Jim Meyering - - Test for today's gnulib/lib/getcwd.c fix affecting pwd and readlink - * NEWS: Mention the bug fix. - * tests/misc/pwd-unreadable-parent: New file. - * tests/misc/Makefile.am (TESTS): Ad pwd-unreadable-parent. - -2007-02-02 Paul Eggert - - * NEWS: Document fix for cp --preserve=mode. - * src/copy.c (copy_internal): Omit the group- or other-writeable - permissions when creating a directory, to avoid a race condition - if the special mode bits aren't right just after the directory is - created. - * src/cp.c (make_dir_parents_private): Likewise. - * tests/cp/parent-perm-race: Test for the "cp --preserve=mode" - race fix in copy.c. - - * NEWS: Document fix for cp --parents. - * src/cp.c (make_dir_parents_private): Report the error sooner with - "cp --parents DIR/FILE DEST" when DIR is a non-directory, thus not - creating the directory, DEST/DIR. - * tests/cp/cp-parents: Test for the non-race-condition bug fixed - by the above change. - -2007-02-02 Jim Meyering - - * src/nl.c (proc_text): Use "NULL", not "(struct re_registers *) 0". - - * src/c99-to-c89.diff: Make shred.c Index: and a/b prefixes - consistent, so this can be applied with patch -p0. - Reported by Matthew Woehlke. - - * Makefile.maint (patch-check): Use patch with its -p2 option, - since that makes this check slightly more strict. - -2007-01-29 Jim Meyering - - Plug a leak in ls. - * src/ls.c (print_dir): Don't leak a "DIR"+fd upon failure to - determine dev/inode or upon detecting a symlink loop. - - * src/ls.c: Rename three global variables. - (cwd_file): Rename from 'files'. - (cwd_n_alloc): Rename from 'nfiles'. - (cwd_n_used): Rename from 'files_index'. - - Shave 8 bytes off the size of "struct fileinfo". - * src/ls.c (fileinfo): Put all members of type "bool" together. - -2007-01-28 Paul Eggert - - Modify "ls" to sort its data faster, using the new gnulib mpsort - module rather than qsort. This is particularly a win in - environments where strcoll is slow, since mpsort typically calls - strcoll less often than qsort does. - * bootstrap.conf (gnulib_modules): Add mpsort. - * src/ls.c: Include mpsort.h. - (sorted_file, sorted_file_alloc): New vars, for a new vector of - pointers to the file info, for speed. - (clear_files, extract_dirs_from_files, sort_files, print_current_files): - (print_many_per_line, print_horizontal, print_with_commas): - (calculate_columns): Set and use new vector. - (initialize_ordering_vector): New function. - -2007-01-26 Paul Eggert - - Adjust to today's change to gnulib, which added a module for - string.h to replace the little include files like strcase.h. - * src/dircolors.c: Don't include strcase.h. - * src/system.h: Don't include mempcpy.h, memrchr.h, stpcpy.h, strpbrk.h. - -2007-01-26 Jim Meyering - - * src/dd.c (advance_input_after_read_error): Change diagnostic to - say "invalid file offset" rather than "screwy file offset". - - * .x-sc_cast_of_argument_to_free: Remove this file. - * Makefile.am (EXTRA_DIST): Likewise. - -2007-01-25 Dan Hipschman - - * src/sort.c (create_temp): Remove superfluous access-X_OK - check. find_in_path does this for us. - -2007-01-24 Jim Meyering - - Remove usually-skipped test. - * tests/cp/open-perm-race: Remove this file. It is subsumed - by parent-perm-race. - * tests/cp/Makefile.am (TESTS): Remove open-perm-race. - * tests/sort/Makefile.am: Regenerate. - - Pass "make distcheck" again. - * src/sort.c (usage): Split a diagnostic that had grown to be - longer than the C89 maximum of 509 bytes. - * .x-sc_cast_of_argument_to_free: New file. Allow a cast in sort.c. - FIXME: this is just temporary, while we wait to remove the offending - access-calling code. - * Makefile.am (EXTRA_DIST): Add .x-sc_cast_of_argument_to_free. - * Makefile.maint (sc_cast_of_argument_to_free): Use the - canonical, $$($(CVS_LIST_EXCEPT)). - * m4/.gitignore, m4/.cvsignore, lib/.gitignore, lib/.cvsignore: Update. - -2007-01-24 Paul Eggert - - * NEWS: New option sort -C, proposed by XCU ERN 127, which looks - like it will be approved. Also add --check=quiet, --check=silent - as long aliases, and --check=diagnose-first as an alias for -c. - * doc/coreutils.texi (sort invocation): Document this. - Also, mention that sort -c can take at most one file. - * src/sort.c: Implement this. - Include argmatch.h. - (usage): Document the change. - (CHECK_OPTION): New constant. - (long_options): --check now takes an optional argument, and is now - treated differently from 'c'. - (check_args, check_types): New constant arrays. - (check): New arg CHECKONLY, which suppresses diagnostic if -C. - (main): Parse the new options. - * tests/sort/Test.pm (02d, 02d, incompat5, incompat6): - New tests for -C. - -2007-01-24 Jim Meyering - - Fix a typo. - * tests/misc/sort-compress: Use $abs_top_builddir, not $top_builddir. - * tests/misc/Makefile.am (TESTS_ENVIRONMENT): Likewise. - - Don't depend on "which". - * tests/misc/sort-compress (SORT): Use $abs_builddir, now which. - * tests/misc/Makefile.am (TESTS_ENVIRONMENT): Export top_builddir. - -2007-01-24 Dan Hipschman - - Test sort compression. - * tests/misc/Makefile.am: Add the test. - * tests/misc/sort-compress: New file containing the tests. - -2007-01-24 Jim Meyering - - * NEWS: sort temp file compression: tweak wording. - * src/sort.c (struct sortfile) [name]: Declare member to be const. - -2007-01-21 Jim Meyering - - * src/sort.c (MAX_FORK_RETRIES_COMPRESS, MAX_FORK_RETRIES_DECOMPRESS): - In pipe_fork callers, use these named constants, not "2" and "8". - (proctab, nprocs): Declare to be "static". - (pipe_fork) [lint]: Initialize local, pid, - to avoid unwarranted may-be-used-uninitialized warning. - (create_temp): Use the active voice. Describe parameters, too. - -2007-01-21 James Youngman - - Centralize all the uses of sigprocmask(). Don't restore an invalid - saved mask. - * src/sort.c (enter_cs, leave_cs): New functions for protecting - code sequences against signal delivery. - * (exit_cleanup): Use enter_cs and leave_cs instead of - calling sigprocmask directly. - (create_temp_file, pipe_fork, zaptemp): Likewise - -2007-01-21 Dan Hipschman - - Add compression of temp files to sort. - * NEWS: Mention this. - * bootstrap.conf: Import findprog. - * configure.ac: Add AC_FUNC_FORK. - * doc/coreutils.texi: Document GNUSORT_COMPRESSOR environment - variable. - * src/sort.c (compress_program): New global, holds the name of the - external compression program. - (struct sortfile): New type used by mergepfs and friends instead - of filenames to hold PIDs of compressor processes. - (proctab): New global, holds compressor PIDs on which to wait. - (enum procstate, struct procnode): New types used by proctab. - (proctab_hasher, proctab_comparator): New functions for proctab. - (nprocs): New global, number of forked but unreaped children. - (reap, reap_some): New function, wait for/cleanup forked processes. - (register_proc, update_proc, wait_proc): New functions for adding, - modifying and removing proctab entries. - (create_temp_file): Change parameter type to pointer to file - descriptor, and return type to pointer to struct tempnode. - (dup2_or_die): New function used in create_temp and open_temp. - (pipe_fork): New function, creates a pipe and child process. - (create_temp): Creates a temp file and possibly a compression - program to which we filter output. - (open_temp): Opens a compressed temp file and creates a - decompression process through which to filter the input. - (mergefps): Change FILES parameter type to struct sortfile array - and update access accordingly. Use open_temp and reap_some. - (avoid_trashing_input, merge): Change FILES parameter like - mergefps and call create_temp instead of create_temp_file. - (sort): Call create_temp instead of create_temp_file. - Use reap_some. - (avoid_trashing_input, merge, sort, main): Adapt to mergefps. - - The idea of compressing sorts temporary files was first - suggested/implemented by Jay Soffian in 1998, and again - by Charles Randall in 2001. - -2007-01-20 Jim Meyering - - * tests/misc/pwd-long: Work properly even when run from the - wrong one of two or more bind-mounted sibling directories. - Suggestion from Mike Stone in . - -2007-01-20 Paul Eggert - - Standardize on list of signals when an app catches signals. - * src/csplit.c (main): Also catch SIGALRM, SIGPIPE, SIGPOLL, - SIGPROF, SIGVTALRM, SIGXCPU, SIGXFSZ. - * src/ls.c (main): Likewise (except SIGPIPE was already caught). - Note that ls.c is special, as it also catches SIGTSTP. - * src/sort.c (main): Likewise. Also catch SIGQUIT. More details in - . - -2007-01-19 Dan Hipschman - and Paul Eggert - - * src/sort.c (cleanup): Clear temphead at the end. - (exit_cleanup): New function. - (main): Don't invoke atexit until we're ready. - Invoke it with exit_cleanup, not with cleanup and close_stdout, - to avoid a race condition with cleanup and signal handling. More - details: http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/9508 - -2007-01-18 Jim Meyering - - * src/c99-to-c89.diff: Adjust remove.c offsets. - -2007-01-17 Jim Meyering - - Make "rm --interactive=never ..." never prompt. - * NEWS: Mention this. - * src/remove.h (enum rm_interactive): New ternary type. - (struct rm_options) [interactive]: Use it, here -- rather than bool. - * src/remove.c (prompt): Reflect type change. - * src/mv.c (rm_option_init): Initialize to RMI_NEVER now. - * src/rm.c (main): Add a FIXME comment for '-d' option. - Adapt to type change of rm_options.interactive. - - * tests/rm/i-never: New file. Test for the above fix. - * tests/rm/Makefile.am (TESTS): Add i-never. - -2007-01-15 Jim Meyering - - * bootstrap (gnulib_tool): When adding to .cvsignore and .gitignore, - emit foo.h, for each foo_.h. This yields one false-positive, fts.h, - but that's ok, since fts_.h will eventually be renamed. - - * src/remove.c (remove_dir): Don't use errno in diagnostic. - Root-only test failure reported by Alex van Hout and Jon Grosshart in - . - - * bootstrap.conf (avoided_gnulib_modules): Fix my typo: - s/--avoid=canonicalize-lgpl/--avoid=canonicalize-gpl/ - -2007-01-14 Bruno Haible - - Enable use of gnulib's new fchdir module. - * bootstrap.conf (avoided_gnulib_modules): Avoid canonicalize-lgpl, - since we use canonicalize. - (gnulib_modules): Add fchdir. - * m4/jm-macros.m4 (coreutils_MACROS): Remove fchdir-stub. - -2007-01-13 Jim Meyering - - * Transform all Makefile.am files so that when running "make check", - CU_TEST_NAME is set to the name of the test. This is so that when I - run valgrind-enabled (--log-file-qualifier=CU_TEST_NAME) "make check" - on the entire package it is more convenient to map a leak or error - found in a valgrind log file back to the offending test. - Use this command: - (echo tests/Makefile.am.in; find tests -name Makefile.am) \ - |xargs perl -pi -e '/^(\s*)PATH=...VG_PATH_PREFIX/ and ' \ - -e 'print $1,q|CU_TEST_NAME=`basename $(abs_srcdir)`,$$tst |,"\\\n"' - -2007-01-11 Jim Meyering - - Avoid a leak in expr's implementation of the ":" (match) operator. - * src/expr.c (docolon): Free the regexp buffer using regfree, rather - than doing it manually, being careful to set fastmap to NULL first. - Free any re_regs.start and .end members, if necessary. - - * tests/misc/test-diag: Work also when libc's error function - reports the entire program name ("../../src/test"), rather than - just the final component. - -2007-01-10 Jim Meyering - - Don't use fts_statp uninitialized for "chown -RLh --preserve-root ...". - * src/chown-core.c (FTSENT_IS_DIRECTORY): New macro. - (change_file_owner): Perform the ROOT_DEV_INO_CHECK only for a - directory. Non-directory entries lack fts_statp data when using - the FTS_NOSTAT option. - -2007-01-07 Jim Meyering - - * tests/sample-test: Update copyright date to 2007. - * Makefile.maint (copyright-check): Also check the copyright date - in tests/sample-test. - -2007-01-06 Jim Meyering - - * tests/fmt/basic (pfx-only, pfx-of-pfx): New tests, - based on examples from G.P. Halkes in - . - -2007-01-06 G.P. Halkes - - * src/fmt.c (copy_rest): Correct prefix handling. - Don't elide a line with the prefix followed by only white space. - (get_line): Move EOF-check to loop-termination condition. - * tests/fmt/basic (pfx-1): Adjust test to expect desired result. - (pfx-2): Remove test; its premise was contrary to the documentation. - -2007-01-05 Jim Meyering - - Avoid a used-uninitialized bug for invalid input, i.e., when the size - of the input, not counting newlines, is 1 % 4. - * gl/lib/base64.c (base64_decode): Don't hard-code inlen==4. - It may be smaller when flushing. - -2007-01-05 Mike Frysinger - - * src/dircolors.hin: Add a TERM directive for cons25. - -2007-01-04 Jim Meyering - - * Makefile.cfg (local-checks-to-skip): Skip strftime-check, in - case you don't have convenient access to glibc info documentation. - - Use the release year, not the current year. - * src/groups.sh (version): Use a better name: @RELEASE_YEAR@. - * src/Makefile.am (RELEASE_YEAR): Define it. - (.sh): Use it. - Thanks to a prod from Eric Blake. - - Ensure that "group --version" always prints the current year. - * src/groups.sh (version): Use @CURRENT_YEAR@, rather than 2006. - * src/Makefile.am (.sh): Also substitute for @CURRENT_YEAR@. - Suggestion from Eric Blake. - - When decoding, always allow newlines in input, with almost no - performance impact. - * src/base64.c (do_decode): Initialize decode context. - Call base64_decode one more time, after all input is processed. - (usage): When decoding, newlines are always accepted. - - * tests/misc/base64: Add a bunch of tests, for the above. - * gl/lib/base64.c: Include . - (base64_decode_ctx_init, get_4, decode_4): New functions. - (base64_decode): Efficiently handle interspersed newlines. - (base64_decode_alloc): Update signature. - * gl/lib/base64.h (struct base64_decode_context): Define. - (base64_decode_ctx_init): Add prototype. - (base64_decode, base64_decode_alloc): Update prototypes. - - * gl/lib/base64.c: Copied from gnulib. - * gl/lib/base64.h: Likewise. - -2007-01-03 Jim Meyering - - * THANKS: Add Evan Hunt. - -2007-01-03 Bruno Haible - - Avoid spurious test failures on MacOS X 10.3.9, in a German locale. - * tests/chown/deref: Apply lang-default. - * tests/misc/split-a: Likewise. - * tests/mv/reply-no: Likewise. - - * src/copy.c (copy_internal): Use mkfifo as a fallback if mknod fails. - Needed on MacOS X. - -2007-01-02 Paul Eggert - - Now, "ls -FRL" always follows symbolic links on Linux. - * NEWS: Mention this bug fix. - * src/ls.c (gobble_file): Fix bug reported by - Nobuyuki Tsuchimura in - http://lists.gnu.org/archive/html/bug-coreutils/2006-12/msg00152.html - where "ls -FRL" didn't follow a symbolic link in some cases on Linux. - * tests/ls/follow-slink: Add a test for this case. - -2007-01-01 Jim Meyering - - * tests/rm/fail-eperm: Revert last change. The PATH=... setting - is not honored at least on HP-UX 11.23 systems. - Instead, simply transform the actual output diagnostic. - Test failure reported by Bob Proulx. - -2006-12-30 Jim Meyering - - * bootstrap (gnulib_extra_files): Remove announce-gen. - * bootstrap.conf (gnulib_modules): Add it here instead, now that - it's a module. - - * tests/misc/base64: Factor a long, repetitive string. - - * src/c99-to-c89.diff: Adjust remove.c offsets. - - Clean up after the change of 2006-12-28. - * src/remove.c (AD_pop_and_chdir): Change **DIRP parameter to *DIRP, - now that this function never modifies the pointer. Adjust comments - and code accordingly. - (remove_dir): Set "dirp" to NULL right after AD_pop_and_chdir call, - now that AD_pop_and_chdir no longer does that. - - * tests/rm/fail-eperm: Avoid spurious differences (the error function - from latest glibc no longer prints the full program_name): so don't - invoke rm via ../../src/rm. Instead, invoke it via "PATH=../../src rm". - - * tests/mv/acl (skip): Skip this test also if the destination - directory, which is on a different file system, lacks ACL support. - - * src/copy.c (copy_reg): Rewrite a comment that was rendered - inaccurate by the 2006-10-18 change. - -2006-12-28 Jim Meyering - - When moving "up" the hierarchy, be careful to remove a just-emptied - directory before opening ".", to avoid trouble with file system - implementations that cache readdir results at opendir-time. - * src/remove.c (AD_pop_and_chdir): Add a file descriptor parameter. - Don't update **DIRP. Don't call fdopendir here. - (remove_dir): Call fdopendir here instead. - Report and patch from Mikulas Patocka: - - -2006-12-27 Jim Meyering - - * src/tail.c (usage): Mention +N for --bytes and --lines. - Suggestion from Evan Hunt. - -2006-12-26 Jim Meyering - - * configure.ac: Require autoconf-2.61 and automake-1.10. - Without the former (even with autoconf-2.60), "make distcheck" - would fail (without the 2006-09-26 autoconf AC_CHECK_DECL fix), - due to an inttypes.h generated with CFLAGS including -pedantic. - With the old decl check, @HAVE_DECL_STRTOUMAX@ would be 0. - - * Makefile.maint (VC-tag): Define, so as to gpg-sign each release - tag, using the release version number as the message. - (vc-dist): Use $(VC-tag), rather than "$(VC) tag". - -2006-12-21 Paul Eggert - - * NEWS: dd bs= operands now silently override later ibs= and obs=, - as POSIX requires. - * src/dd.c (scanargs): Implement it. - * tests/dd/misc (outbytes): Test it. - * doc/coreutils.texi (dd invocation): Specify that bs=N - overrides later ibs and obs, undoing part of the - previous change. (The behavior was wrong.) - -2006-12-20 Jim Meyering - - "rm -rf /etc/motd" (run by non-root) now prints a diagnostic. - * src/remove.c (remove_entry): Handle EACCES for a non-directory, too. - Don't let a non-directory get by with errno == EPERM, either. - Check the file type directly (using cached stat value), rather - than trying to guess it from errno values. - Karl Berry reported that a cross-partition "mv /etc/issue ~" - failed with the um,... suboptimal diagnostic, - "mv: cannot remove `/etc/issue': Not a directory". - * tests/rm/Makefile.am (TESTS): Add fail-eacces. - * tests/rm/fail-eacces: New file. - * NEWS: Mention that both mv and rm are affected. - - "cut -f 2- A B" no longer triggers a double-free bug - * src/cut.c (cut_fields): Set file-scoped global to NULL after - freeing it. This avoids a double-free (and core dump on some systems) - for this usage: "echo 1>a; echo 2>b; cut -f2- a b". Reported by - James Hunt in . - * NEWS: List this bug fix. - * THANKS: Mention him. - * tests/misc/cut: New file. - * tests/misc/Makefile.am (TESTS): Add cut. - -2006-12-15 Jim Meyering - - * tests/cp/open-perm-race: Correct the gdb-existence check. - Don't run either subsequent gdb command in a sub-shell. - Reported by Thomas Schwinge. - * THANKS: bring up to date. - -2006-12-14 Paul Eggert - - Make sure cp -p isn't too generous with file permissions. - * tests/cp/Makefile.am (TESTS): Add file-perm-race. - * tests/cp/file-perm-race: New file. - - Ensure cp -pR --parents isn't too generous with parent permissions. - * tests/cp/Makefile.am (TESTS): Add parent-perm-race. - * tests/cp/parent-perm-race: New file. - -2006-12-14 Jim Meyering - - * tests/chgrp/default-no-deref: Don't assume that files are created - with the primary group by default. That's not true in a directory - with the set-GID bit set. - - Don't hang when there's no input tty. - * tests/cp/open-perm-race: Skip this test if there is no - controlling input `terminal'. - - Test for a hard-to-detect race fix, using gdb. - * tests/cp/open-perm-race: New file, to test for the - cp --preserve=ownership fix of 2006-12-06. - - * tests/cp/Makefile.am (TESTS_ENVIRONMENT): Define abs_top_builddir. - (TESTS): Add open-perm-race. - - * src/chgrp.c (main): Don't prohibit -RLh, aka -RL with --no-dereference. - * src/chown.c (main): Likewise. - * src/chown-core.c (change_file_owner): Add to a comment. - * tests/chown/preserve-root: Add tests. - - * NEWS: --preserve-root now works with chgrp, chmod, and chown. - * src/chmod.c (process_file): Do honor the --preserve-root option. - * src/chown-core.c (change_file_owner): Likewise, but here, also - handle the case in which a traversal would go "through" a symlink - to root. Reported by Matthew M. Boedicker - * tests/chown/preserve-root: Test for the above. - * tests/chown/Makefile.am (TESTS): Add preserve-root. - - * NEWS: Mention the chmod fix induced by the 2006-12-11 change - to gnulib's m4/openat.m4. - -2006-12-13 Andreas Schwab - - Don't fail if mv/acl test succeeds. - * tests/mv/acl (skip): Check for acl support in the file system. - * tests/mv/Makefile.am (XFAIL_TESTS): Remove. - (TESTS_ENVIRONMENT): Pass CONFIG_HEADER. - -2006-12-13 Paul Eggert - - Remove some arbitrary restrictions on size fields, so that - commands like "sort -k 18446744073709551616" no longer fail merely - because 18446744073709551616 doesn't fit in uintmax_t. The trick - is that these fields can all be treated as effectively infinity; - their exact values don't matter, since no internal buffer can be - that long. - * src/join.c (string_to_join_field): Verify that SIZE_MAX <= - ULONG_MAX if the code assumes this. Silently truncate too-large - values to SIZE_MAX, as the remaining code will do the right thing - in this case. - * src/sort.c (parse_field_count): Likewise. - * src/uniq.c (size_opt, main): Likewise. - * tests/join/Test.pm (bigfield): New test. - * tests/sort/Test.pm (bigfield): New test. - * tests/uniq/Test.pm (121): New test. - -2006-12-13 Jim Meyering - - * tests/chgrp/default-no-deref: New test. - * tests/chgrp/Makefile.am (TESTS): Add default-no-deref. - -2006-12-12 Jim Meyering - - * src/system.h (SETVBUF): Remove definition, now that the - autoconf macro, AC_FUNC_SETVBUF_REVERSED, does nothing. - * src/tee.c (tee_files): s/SETVBUF/setvbuf/. - * src/od.c (open_next_file): Likewise. - -2006-12-09 Jim Meyering - - * man/Makefile.am (.x.1): Make help2man use $(PACKAGE_STRING) as the - "source". I.e. "GNU coreutils 6.7". - - * NEWS: With the change from "-pre" to "-dirty" suffix, also change - from NEXT_VER-pre to CUR_VER-dirty. So, this is 6.7-dirty. - * configure.ac (AC_INIT): s/6.8-dirty/6.7-dirty/. - - * tests/uniq/Test.pm (test_vector): Skip the pipe-reading test - whenever uniq is expected to fail. This should catch the other case - [test #112] in which uniq emits "cat: write error: Broken pipe" on - some systems. - -2006-12-08 Jim Meyering - - Include bootstrap tool version info in the announcement form. - * Makefile.maint (gnulib_snapshot_date): Define. - (announcement): Use two new announce-gen options, - --bootstrap-tools and --gnulib-snapshot-date. - * Makefile.cfg (gnulib_dir): Set. - - Post-release version change. - * NEWS: Add a line for 6.8-dirty. - * configure.ac (AC_INIT): Set new version string. - -2006-12-07 Jim Meyering jim@meyering.net - - Version 6.7. - * NEWS: Record release date. Remove '-pre' suffix. - * configure.ac (AC_INIT): Remove version string suffix. - -2006-12-07 Jim Meyering - - Make the output of "make check" more reproducible. - * tests/touch/empty-file: Use envvar-check, so "make check" doesn't - evoke diagnostics like this when COLUMNS=0 in the environment: - ls: ignoring invalid width in environment variable COLUMNS: 0 - * tests/touch/no-rights: Likewise. - * tests/help-version: Likewise. - * tests/uniq/Test.pm: Don't perform the pipe-reading version of test - 118, since it emits "cat: write error: Broken pipe" on some systems. - -2006-12-06 Paul Eggert - - * NEWS: Document the cp -p fix for special bits. - * src/copy.c (set_owner): Now returns a three-way result, so - that the caller can clear the special bits. All callers changed. - (copy_reg): Don't set the special bits if chown failed. - (copy_internal): Likewise. - * tests/cp/special-bits: Test this fix. - -2006-12-06 Paul Eggert - - * NEWS: Document the cp --preserve=ownership fix. - * m4/jm-macros.m4 (coreutils_MACROS): Check for fchmod. - * src/copy.c (fchmod_or_lchmod): New function. - (copy_reg): New arg OMITTED_PERMISSIONS. All uses changed. - Omit confusing and unused ", dst_mode" arg to 'open' without O_CREAT. - When creating a file, use O_EXCL, so we're more likely to detect - funny business by other processes. At the end, if permissions - were omitted, chmod them back in. - (copy_internal): If the ownership might change, omit some permissions - at first, then restore them after chowning the file. - * src/cp.c (make_dir_parents_private): Likewise. - * src/copy.c (cached_umask): New function. - * src/copy.h (cached_umask): New decl. - -2006-12-06 Jim Meyering - - Make the output of "make check" more reproducible. - * tests/misc/date-sec: Don't emit any diagnostic about sleeping. - -2006-12-03 Paul Eggert - - * src/install.c (install_file_in_file): Preserve time stamps - before changing owner or file mode bits, for consistency with - other coreutils programs. - -2006-12-03 Jim Meyering - - * tests/misc/date-sec: Output a fixed string. - - * NEWS: du --one-file-system (-x) would skip subdirectories of any - directory listed as second or subsequent command line argument. - * tests/du/one-file-system: New file. Test for today's fts.c fix. - * tests/du/Makefile.am (TESTS): Add one-file-system. - Reported by Mike Frysinger. - -2006-12-02 Jim Meyering - - * tests/du/basic: Generate 4KB file simply using printf, rather than - seq+head. This avoids a spurious "Broken pipe" diagnostic from seq. - -2006-11-28 Jim Meyering - - * tests/mv/no-target-dir: Detect a buggy rename syscall. If found, - skip this test. This happens at least on ia64 linux-2.4.19 w/ext3. - Reported by Matthew Woehlke. - - * tests/mv/dir2dir: Also accept EBUSY. - Reported by Matthew Woehlke. - -2006-11-27 Jim Meyering - - * Makefile.maint (patch-check): Rewrite to diagnose failure. - * src/c99-to-c89.diff: Adjust shred.c offsets. - -2006-11-26 Paul Eggert - - Improve the check for departures from C89, and fix the departures - I found. - * Makefile.maint (my-distcheck): Also check for C89 compatibility - as best we can with GCC. - * src/stat.c (PRINTF_OPTION): Omit comma before } in enum - declaration; C89 doesn't allow this. - * src/dcgen: Don't generate string literals longer than - what C89 requires support for. - * src/cut.c (usage): Don't use string literals longer than - what C89 requires support for. - * src/date.c (usage): Likewise. - * src/dd.c (usage): Likewise. - * src/du.c (usage): Likewise. - * src/ls.c (usage): Likewise. - * src/od.c (usage): Likewise. - * src/readlink.c (usage): Likewise. - * src/seq.c (usage): Likewise. - * src/shred.c (usage): Likewise. - -2006-11-26 Mike Frysinger - - Recognize new archive, audio and image formats. - Give audio files a separate color. - * src/dircolors.hin: Add comments for common .sh and .csh scripts. - Add .bz2, .tbz2, .tz, .rar, .ace, .zoo, .cpio, .7z, .rz as archive - suffixes. Add .mng, .pcx, .m2v, .mkv, .ogm, .mp4, .m4v, .mp4v, .vob, - .qt, .nuv, .wmv, .asf, .rm, .rmvb, .flc, .yuv as image formats. - Add .aac, .au, .mid, .midi, .mka, .ra as audio suffixes. Change - audio color to 00;36 to differentiate from image/video color. - -2006-11-26 Jim Meyering - - * Makefile.maint (patch-check): Compile patched sources with - CFLAGS='-Wdeclaration-after-statement -Werror', to ensure that - no violations remain. - - * src/c99-to-c89.diff: Remove 3 bogus hunks. - - * src/remove.c (fd_to_subdirp): Remove unused parameter, ds. - Update callers. - - * src/c99-to-c89.diff: Adjust for changes in rm.c and in remove.c. - - * src/rm.c (main): Remove unnecessary (assuming C99) braces. - -2006-11-26 Paul Eggert - - Port parts of the code to C89 to minimize the need for c99-to-c89.diff, - while trying to retain the readability of C99 as much as possible. - * src/remove.c (rm_1): Remove decl of local, fd_cwd. - Replace each of two uses with literal AT_FDCWD. - (cache_stat_init): Return its argument, for convenience. - Update the caller in remove_dir. - (AD_pop_and_chdir): Return prev_dir rather than storing through - a pointer argument. All uses changed. - (AD_ensure_initialized): New function. - (AD_mark_helper): Use it, to avoid the need for declaration - after statement. - (rm): Move cycle_check_init call into callee... - (rm_1): ...here. - Use an else clause in place of a "continue" statement. - (close_preserve_errno): Remove. - (fd_to_subdirp): Rewrite to avoid the need for decl after statement. - -2006-11-25 Jim Meyering - - * Makefile.am (EXTRA_DIST): Remove announce-gen from here, too. - -2006-11-24 Theodoros V. Kalamatianos (tiny change) - - * tests/du/inacc-dest: Skip this test when running as root. - -2006-11-23 Jim Meyering - - * announce-gen: Remove file. It's moving to gnulib. - * bootstrap: Pull it from gnulib/build-aux instead. - * Makefile.maint (announcement): Reflect move to ./build-aux. - - * tests/du/deref-args: Use "printf %65536s x" to create a 64KB file, - rather than a pipeline that would sometimes evoke a diagnostic - like "seq: write error: Broken pipe". - - * tests/help-version: Suppress dd transfer rate output. - - * configure.ac (AC_INIT): Bump to 6.7-pre, not 6.6-pre. - -2006-11-22 Jim Meyering - - * announce-gen (print_news_deltas): Fix silly, but harmless typo: - change "(:?..." to "(?:..." in regexps. - - Post-release version change. - * NEWS: Add a line for 6.7-pre. - * configure.ac (AC_INIT): Bump to 6.7 and add "-pre" suffix. - - Version 6.6. - * NEWS: Record release date. Remove "-pre" suffix. - * configure.ac (AC_INIT): Remove "-pre" suffix from version string. - - * announce-gen: Remove unused --release-archive-directory option. - (print_news_deltas): Accept new adjective, "Noteworthy", in addition - to the old "Major". - Match version numbers in NEWS using tighter regular expressions. - (main): Require the --gpg-key-id=ID option. - * Makefile.maint (announcement): Don't use now-removed - --release-archive-directory=... option. - - * NEWS: Mention the three noteworthy changes, all fixed via gnulib. - -2006-11-21 Jim Meyering - - * tests/rm/one-file-system: Upon setup failure (e.g., mount failure), - skip the test rather than failing. Reported by Michael Deutschmann. - - * tests/rm/fail-eperm: Use the "(exit N); exit N" idiom, - rather than just "exit N". - - Arrange for "make check-root" to run the new root-only test. - * tests/Makefile.am (t7): New target, to run tests/ls/nameless-uid. - (all_t): Add t7. - -2006-11-20 Jim Meyering - - Add a root-only test for today's lib/idcache.c fix. - * tests/ls/nameless-uid: New file. - * tests/ls/Makefile.am (TESTS): Add nameless-uid. - (TESTS_ENVIRONMENT): Add PERL to the list. - -2006-11-19 Jim Meyering - - * tests/tail-2/assert-2: Mark as a very-expensive test, because I - find the 7-second sleep annoyingly long. Besides, this test is - probably far too specific and timing sensitive ever to trigger again. - * tests/tail-2/assert: Likewise. - - Post-release version change. - * NEWS: Add a line for 6.6-pre. - * configure.ac (AC_INIT): Bump to 6.6 and add "-pre" suffix. - - Version 6.5. - * NEWS: Record release date. Remove "-cvs" suffix. - * configure.ac (AC_INIT): Remove "-cvs" suffix from version string. - -2006-11-18 Jim Meyering - - "ln --backup f f" produces a misleading diagnostic: - ln: creating hard link `f' => `f': No such file or directory - * src/ln.c (do_link): Give a better diagnostic in this unusual case. - (do_link): Rename local: s/lstat_ok/dest_lstat_ok/. - * tests/ln/Makefile.am (TESTS): Add hard-backup. - * tests/ln/hard-backup: New test for the above. - * NEWS: Mention this fix. - -2006-11-16 Paul Eggert - - * bootstrap.conf (gnulib_modules): Add sys_stat, since we use it - directly too. - * lib/.cvsignore, lib/.gitignore: Add root-dev-ino.c, root-dev-ino.h. - * m4/.cvsignore, m4/.gitignore: Add root-dev-ino.m4. - * src/ls.c (DIRED_FPUTS_LITERAL, PUSH_CURRENT_DIRED_POS): - Omit unnecessary parenthesization of args. - * src/od.c (EQUAL_BLOCKS): Likewise. - * src/system.h (STREQ, ASSIGN_STRDUPA): Likewise. - -2006-11-16 Jim Meyering - - * tests/tail-2/append-only: If chattr +a fails, exit 77 (to tell - automake we're skipping this test), and give a diagnostic to tell - the user the same thing. Reported by Mike Grayson. - -2006-11-16 Ralf Wildenhues - - * man/Makefile.am (dist_man_MANS): Replace all optional manpages - with `$(MAN)', computed at configure time; also, list them ... - (optional_mans): ... in this new variable. - (max_aux, EXTRA_DIST): Ensure that we distribute all manpages. - -2006-11-16 Jim Meyering - - Help valgrind see that there is no leak in dd.c. - * src/dd.c (dd_copy): Declare real_buf and real_obuf to be static, - so we need not free them at all. This is easier than freeing - both buffers at each of the early "return"s. - - * src/csplit.c (load_buffer): Plug an inconsequential leak. - -2006-11-15 Jim Meyering - - * .x-po-check: Exclude gl/ files. Otherwise, po-check would - complain that some of gl/lib/*.[ch] are not listed in POTFILES.in. - -2006-11-14 Jim Meyering - - * gl/m4/root-dev-ino.m4: Now that this is part of a real "module", - remove the now-unnecessary use of AC_LIBSOURCES. - - Adapt to new version of gnulib-tool. - * gl/modules/root-dev-ino: New file. - * lib/root-dev-ino.c, lib/root-dev-ino.h: Move these files ... - * gl/lib/root-dev-ino.c, gl/lib/root-dev-ino.h: ... to here. - * m4/root-dev-ino.m4: Move this file ... - * gl/m4/root-dev-ino.m4: ... to here. - - * bootstrap.conf (gnulib_modules): Add root-dev-ino. - -2006-11-13 Jim Meyering - - * src/sort.c (insertkey): Use xmemdup, rather than xmalloc+assignment. - From Paul Eggert. - - Plug another technically-unimportant leak in sort. - * src/sort.c (main): Don't allocate memory for each new key here. - (insertkey): Allocate memory for each key here, instead. - (key_init): Rename from new_key. Don't allocate. - - * src/sort.c (main): Plug a tiny memory leak. - Move declaration of local "minus" down to be nearer point of use. - -2006-11-12 Jim Meyering - - du would exit early, when encountering an inaccessible directory - Reported by Mike Frysinger, in - http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/8831 - * tests/du/inacc-dest: New test, based on an example from Mike Frysinger. - * tests/chgrp/no-x: Remove the "fts_read failed: ..." - diagnostic from the expected output when using native fdopendir. - * tests/chmod/no-x: Likewise. - * tests/du/no-x: Likewise. - * NEWS: Mention this bug fix. - * tests/du/Makefile.am (TESTS): Add inacc-dest. - - * Makefile.maint (sc_cast_of_x_alloc_return_value): Add an exclusion - for xalloc.h itself. - - Avoid false-positive when testing via valgrind. - * tests/mv/atomic: Grep strace output for a more specific pattern - than just "unlink", since that got a false positive when testing - under valgrind: unlink("/tmp/valgrind_proc_9657_cmdline_A51E9991") = 0 - * tests/mv/Makefile.am (TESTS_ENVIRONMENT): Define EGREP. - -2006-10-28 Jim Meyering - - * Makefile.maint (patch-check): Make it easier to regenerate - the src/c99-to-c89.diff file. E.g., I do this: - make patch-check REGEN_PATCH=1; ediff src/c99-to-c89.diff new-diff - - * src/c99-to-c89.diff: Update to reflect new offsets in rm.c. - -2006-10-26 Jim Meyering - - * src/system.h (ftello): Add a compile-time check for the highly - unlikely condition of off_t narrower than long int, rather than - handling it at run time. Based on a patch from Paul Eggert. - -2006-10-25 Paul Eggert - - * tests/chmod/c-option: When double-quoting part of a word, prefer - to double-quote the whole word. This is a bit easier to read (at - least for me), and in some cases it avoids a shell bug with Tru64 - 4.0 sh reported by Nelson H. F. Beebe. For example, instead of - "$abs_srcdir"/../setgid-check we now write - "$abs_srcdir/../setgid-check". - * tests/cp/cp-parents: Likewise. - * tests/du/inaccessible-cwd: Likewise. - * tests/du/long-from-unreadable: Likewise. - * tests/install/basic-1: Likewise. - * tests/install/trap: Likewise. - * tests/misc/close-stdout: Likewise. - * tests/mkdir/concurrent-1: Likewise. - * tests/mkdir/p-1: Likewise. - * tests/mkdir/p-3: Likewise. - * tests/mkdir/parents: Likewise. - * tests/mkdir/perm: Likewise. - * tests/readlink/can-e: Likewise. - * tests/readlink/can-f: Likewise. - * tests/readlink/can-m: Likewise. - * tests/rm/inaccessible: Likewise. - * tests/rm/unread3: Likewise. - * tests/touch/no-create-missing: Likewise. - - * lib/.cvsignore: Add uinttostr.c. - -2006-10-25 Jim Meyering - - Portability to Tru64 V4.0. - * src/system.h (ftello) [!HAVE_FSEEKO && !defined ftello]: - Define inline replacement function. - This (along with a yesterday's fix for autoconf's - _AC_SYS_LARGEFILE_MACRO_VALUE macro) makes it so coreutils - now builds once more on Tru64 V4.0. Reported by Nelson Beebe. - -2006-10-25 Bruno Haible - - * src/cat.c (infile): Add "const" to declaration. - * src/csplit.c (prefix): Likewise. - * src/printf.c (cfcc_msg): Likewise. - * src/tail.c (valid_file_spec): Likewise. - * src/cut.c (cut_file): Likewise, for a parameter. - * src/expr.c (str_value): Likewise. - * src/fold.c (fold_file): Likewise. - * src/pr.c (init_header): Likewise. - * src/dircolors.c (dc_parse_stream): Likewise, for a local. - * src/tr.c (make_printable_str): Likewise. - * src/nl.c (body_type, header_type, footer_type, current_type): - (separator_str, build_type_arg, nl_file): Likewise, for many. - * src/paste.c (main): Don't assign a read-only string to 'optarg'. - * src/tac.c (separator, tac_seekable, copy_to_temp): Likewise. - -2006-10-25 Jim Meyering - - * tests/sample-test: Update copyright year list to include only - the current year, since this is what I'll want in any new test. - -2006-10-24 Jim Meyering - - * src/c99-to-c89.diff: Update to reflect new offsets. - - * NEWS: new feature: rm accepts new option: --one-file-system - Suggested by Steve McIntyre in . - * src/remove.h (struct rm_options) [one_file_system]: New member. - * src/rm.c (rm_option_init): Initialize it. - (usage): Document the option. - * src/mv.c (rm_option_init): Likewise. - * src/remove.c (remove_dir): With --one-file-system and --recursive, - for each directory command line argument, do not affect a file system - different from that of the starting directory. And give a diagnostic. - * src/rm.c (ONE_FILE_SYSTEM): New enum. - (main): Handle new option. - * tests/rm/one-file-system: Test the above. - * tests/rm/Makefile.am (TESTS): Add one-file-system. - * tests/Makefile.am (check-root): Add the rm/one-file-system - test to the list. - (EXTRA_DIST): Add other-fs-tmpdir. - - * tests/mv/setup: Removed. Renamed to... - * tests/other-fs-tmpdir: ...this new file. - * tests/mv/Makefile.am (EXTRA_DIST): Remove setup. - * tests/mv/acl: Reflect renaming: use ../other-fs-tmpdir. - * tests/mv/backup-is-src: Likewise. - * tests/mv/hard-link-1: Likewise. - * tests/mv/leak-fd: Likewise. - * tests/mv/mv-special-1: Likewise. - * tests/mv/part-fail: Likewise. - * tests/mv/part-hardlink: Likewise. - * tests/mv/part-rename: Likewise. - * tests/mv/part-symlink: Likewise. - * tests/mv/partition-perm: Likewise. - * tests/mv/to-symlink: Likewise. - * tests/mv/into-self-2: Likewise. - - Don't let a failure in one test stop "make -k" from running the others. - * tests/Makefile.am (t1 t2 t3 t4 t5): New targets. - (check-root): Depend on them, rather than executing the five - commands in a single rule. Reported by Greg Schafer. - -2006-10-23 Bob Proulx (tiny change) - - * Makefile.maint (alpha beta major): Use a better log message for - the automatic commit of .prev-version. - -2006-10-23 Jim Meyering - - * tests/misc/pwd-long: Undo last change, since it made Perl invoke - pwd via a shell. Instead, ensure that the absolute name of the - pwd binary consists solely of reasonable characters. - Whoops. Don't exec the perl script. Otherwise, the sh-trap-based - clean-up code isn't run. - - * NEWS: Add a line for 6.5-cvs. - * configure.ac (AC_INIT): Bump to 6.5 and add "-cvs" suffix. - -2006-10-22 Jim Meyering - - Version 6.4. - - * NEWS: Record the 6.4 release date. - * configure.ac (AC_INIT): Remove "-cvs" suffix from version string. - - * Makefile.maint: Complete the adaptation to function with a working - directory that is using git (rather than cvs) for version control. - -2006-10-22 Ralf Wildenhues - - * tests/chmod/c-option: Double-quote instances of `$abs_srcdir'. - * tests/cp/cp-parents: Likewise. - * tests/mkdir/parents: Likewise. - * tests/mkdir/perm: Likewise. - - * tests/sample-test: Quote variables containing absolute build - tree paths. In the cleanup trap, make sure `cd' succeeds before - `chmod'ing and `rm'ing the temporary files. - * tests/chgrp/basic: Likewise. - * tests/chgrp/deref: Likewise. - * tests/chgrp/no-x: Likewise. - * tests/chgrp/posix-H: Likewise. - * tests/chgrp/recurse: Likewise. - * tests/chmod/c-option: Likewise. - * tests/chmod/equal-x: Likewise. - * tests/chmod/equals: Likewise. - * tests/chmod/inaccessible: Likewise. - * tests/chmod/no-x: Likewise. - * tests/chmod/octal: Likewise. - * tests/chmod/setgid: Likewise. - * tests/chmod/umask-x: Likewise. - * tests/chmod/usage: Likewise. - * tests/chown/basic: Likewise. - * tests/chown/deref: Likewise. - * tests/chown/separator: Likewise. - * tests/cp/acl: Likewise. - * tests/cp/backup-1: Likewise. - * tests/cp/backup-dir: Likewise. - * tests/cp/backup-is-src: Likewise. - * tests/cp/cp-HL: Likewise. - * tests/cp/cp-deref: Likewise. - * tests/cp/cp-i: Likewise. - * tests/cp/cp-mv-backup: Likewise. - * tests/cp/cp-parents: Likewise. - * tests/cp/deref-slink: Likewise. - * tests/cp/dir-rm-dest: Likewise. - * tests/cp/dir-slash: Likewise. - * tests/cp/dir-vs-file: Likewise. - * tests/cp/fail-perm: Likewise. - * tests/cp/into-self: Likewise. - * tests/cp/link: Likewise. - * tests/cp/link-no-deref: Likewise. - * tests/cp/link-preserve: Likewise. - * tests/cp/no-deref-link1: Likewise. - * tests/cp/no-deref-link2: Likewise. - * tests/cp/no-deref-link3: Likewise. - * tests/cp/perm: Likewise. - * tests/cp/preserve-2: Likewise. - * tests/cp/r-vs-symlink: Likewise. - * tests/cp/same-file: Likewise. - * tests/cp/slink-2-slink: Likewise. - * tests/cp/sparse: Likewise. - * tests/cp/special-bits: Likewise. - * tests/cp/src-base-dot: Likewise. - * tests/cp/symlink-slash: Likewise. - * tests/dd/not-rewound: Likewise. - * tests/dd/skip-seek2: Likewise. - * tests/dd/unblock-sync: Likewise. - * tests/du/2g: Likewise. - * tests/du/8gb: Likewise. - * tests/du/basic: Likewise. - * tests/du/deref: Likewise. - * tests/du/deref-args: Likewise. - * tests/du/exclude: Likewise. - * tests/du/fd-leak: Likewise. - * tests/du/hard-link: Likewise. - * tests/du/inaccessible-cwd: Likewise. - * tests/du/long-from-unreadable: Likewise. - * tests/du/long-sloop: Likewise. - * tests/du/no-deref: Likewise. - * tests/du/no-x: Likewise. - * tests/du/restore-wd: Likewise. - * tests/du/slash: Likewise. - * tests/du/slink: Likewise. - * tests/du/trailing-slash: Likewise. - * tests/du/two-args: Likewise. - * tests/fmt/long-line: Likewise. - * tests/install/basic-1: Likewise. - * tests/install/create-leading: Likewise. - * tests/install/d-slashdot: Likewise. - * tests/install/trap: Likewise. - * tests/ln/misc: Likewise. - * tests/ln/target-1: Likewise. - * tests/ls/color-dtype-dir: Likewise. - * tests/ls/dangle: Likewise. - * tests/ls/dired: Likewise. - * tests/ls/file-type: Likewise. - * tests/ls/follow-slink: Likewise. - * tests/ls/infloop: Likewise. - * tests/ls/inode: Likewise. - * tests/ls/m-option: Likewise. - * tests/ls/no-arg: Likewise. - * tests/ls/recursive: Likewise. - * tests/ls/rt-1: Likewise. - * tests/ls/stat-dtype: Likewise. - * tests/ls/stat-failed: Likewise. - * tests/ls/stat-vs-dirent: Likewise. - * tests/misc/cat-proc: Likewise. - * tests/misc/close-stdout: Likewise. - * tests/misc/csplit: Likewise. - * tests/misc/date-sec: Likewise. - * tests/misc/false-status: Likewise. - * tests/misc/head-c: Likewise. - * tests/misc/head-pos: Likewise. - * tests/misc/mknod: Likewise. - * tests/misc/nl: Likewise. - * tests/misc/nohup: Likewise. - * tests/misc/pathchk1: Likewise. - * tests/misc/printf: Likewise. - * tests/misc/printf-hex: Likewise. - * tests/misc/pwd-long: Likewise. - * tests/misc/shuf: Likewise. - * tests/misc/sort-rand: Likewise. - * tests/misc/split-a: Likewise. - * tests/misc/split-fail: Likewise. - * tests/misc/split-l: Likewise. - * tests/misc/stat-fmt: Likewise. - * tests/misc/tac-continue: Likewise. - * tests/misc/wc-files0: Likewise. - * tests/mkdir/concurrent-1: Likewise. - * tests/mkdir/p-1: Likewise. - * tests/mkdir/p-2: Likewise. - * tests/mkdir/p-3: Likewise. - * tests/mkdir/p-slashdot: Likewise. - * tests/mkdir/p-thru-slink: Likewise. - * tests/mkdir/p-v: Likewise. - * tests/mkdir/parents: Likewise. - * tests/mkdir/perm: Likewise. - * tests/mkdir/t-slash: Likewise. - * tests/mv/acl: Likewise. - * tests/mv/atomic: Likewise. - * tests/mv/backup-dir: Likewise. - * tests/mv/childproof: Likewise. - * tests/mv/diag: Likewise. - * tests/mv/dir-file: Likewise. - * tests/mv/dir2dir: Likewise. - * tests/mv/dup-source: Likewise. - * tests/mv/hard-2: Likewise. - * tests/mv/hard-3: Likewise. - * tests/mv/hard-4: Likewise. - * tests/mv/hard-link-1: Likewise. - * tests/mv/hard-verbose: Likewise. - * tests/mv/i-2: Likewise. + tests: reenable temporarily-disabled tests using e.g., trap '' TTOU + Revert "tests: skip newly-modified tests unconditionally..." + This reverts commit 773a88d33f68e50a2919c8a8310c646a7e5fabc2. + * tests/misc/stty: Don't skip. + * tests/misc/stty-invalid: Likewise. * tests/mv/i-3: Likewise. - * tests/mv/i-4: Likewise. - * tests/mv/i-5: Likewise. - * tests/mv/i-link-no: Likewise. - * tests/mv/into-self-4: Likewise. - * tests/mv/leak-fd: Likewise. - * tests/mv/mv-special-1: Likewise. - * tests/mv/no-target-dir: Likewise. - * tests/mv/part-fail: Likewise. - * tests/mv/part-hardlink: Likewise. - * tests/mv/part-rename: Likewise. - * tests/mv/part-symlink: Likewise. - * tests/mv/partition-perm: Likewise. - * tests/mv/perm-1: Likewise. - * tests/mv/reply-no: Likewise. - * tests/mv/trailing-slash: Likewise. - * tests/mv/update: Likewise. - * tests/od/od-N: Likewise. - * tests/od/x8: Likewise. - * tests/readlink/can-e: Likewise. - * tests/readlink/can-f: Likewise. - * tests/readlink/can-m: Likewise. - * tests/readlink/rl-1: Likewise. - * tests/rm/cycle: Likewise. - * tests/rm/dangling-symlink: Likewise. - * tests/rm/deep-1: Likewise. - * tests/rm/dir-no-w: Likewise. - * tests/rm/dir-nonrecur: Likewise. - * tests/rm/dot-rel: Likewise. - * tests/rm/empty-inacc: Likewise. - * tests/rm/f-1: Likewise. - * tests/rm/fail-2eperm: Likewise. - * tests/rm/hash: Likewise. - * tests/rm/i-1: Likewise. - * tests/rm/i-no-r: Likewise. - * tests/rm/ignorable: Likewise. - * tests/rm/inaccessible: Likewise. - * tests/rm/interactive-always: Likewise. - * tests/rm/interactive-once: Likewise. - * tests/rm/ir-1: Likewise. - * tests/rm/isatty: Likewise. - * tests/rm/no-give-up: Likewise. - * tests/rm/r-1: Likewise. - * tests/rm/r-2: Likewise. - * tests/rm/r-3: Likewise. - * tests/rm/r-4: Likewise. - * tests/rm/readdir-bug: Likewise. - * tests/rm/rm1: Likewise. - * tests/rm/rm2: Likewise. - * tests/rm/rm3: Likewise. - * tests/rm/rm4: Likewise. - * tests/rm/rm5: Likewise. - * tests/rm/sunos-1: Likewise. - * tests/rm/unread2: Likewise. - * tests/rm/unread3: Likewise. - * tests/rmdir/fail-perm: Likewise. - * tests/rmdir/t-slash: Likewise. - * tests/shred/exact: Likewise. - * tests/shred/remove: Likewise. - * tests/sum/sysv: Likewise. - * tests/tail-2/append-only: Likewise. - * tests/tail-2/assert: Likewise. - * tests/tail-2/assert-2: Likewise. - * tests/tail-2/big-4gb: Likewise. - * tests/tail-2/fflush: Likewise. - * tests/tail-2/infloop-1: Likewise. - * tests/tail-2/proc-ksyms: Likewise. - * tests/tail-2/start-middle: Likewise. - * tests/tail-2/tail-n0f: Likewise. - * tests/tee/basic: Likewise. - * tests/tee/dash: Likewise. - * tests/touch/fail-diag: Likewise. - * tests/touch/no-create-missing: Likewise. - * tests/touch/not-owner: Likewise. - * tests/touch/obsolescent: Likewise. - * tests/touch/read-only: Likewise. - * tests/touch/relative: Likewise. -2006-10-21 Jim Meyering +2009-02-22 James Youngman - * NEWS: (cp --backup fix): Fix a typo. + update James Youngman's email address + * THANKS: Update James Youngman's email address - * .gitignore: Remove some references to files in subdirectories. - * build-aux/.gitignore, doc/.gitignore, lib/.gitignore: New files. - * m4/.gitignore, po/.gitignore, src/.gitignore: Likewise. +2009-02-21 Jim Meyering - * src/copy.c (copy_internal): Add a comment saying why we prefer - mknod over mkfifo. + post-release administrivia + * NEWS: Add header line for next release. + * .prev-version: Record previous version. + * cfg.mk (old_NEWS_hash): Auto-update. - Enable an fts optimization (call lstat only for directories, - on some file system types) also with the --preserve-root option - of chown or chgrp. - * src/chown-core.c (change_file_owner): Compare fts_statp-based - dev/ino against root dev/ino only for directories. - (chown_files): Don't let the root_dev_ino setting influence whether - we use FTS_NOSTAT: fts always sets *fts_statp for a directory. + version 7.1 + * NEWS: Record release date. -2006-10-20 Jim Meyering + * README: Mention that c99-to-c89.diff is no longer maintained. - * src/od.c (usage): Change description of default to use "-w16", - not the now-invalid "-w 16" syntax. From Dan Jacobson. + tests: skip new install-C test if working directory is set-gid + * tests/install/install-C: Use setgid-check. -2006-10-19 Jim Meyering + tests: skip newly-modified tests unconditionally, just to be safe + * tests/misc/stty-invalid: Skip. + * tests/misc/stty: Likewise. + * tests/mv/i-3: Likewise. - * bootstrap: Add names to each .gitignore file (if it exists) - as well as to .cvsignore. + tests: don't let SIGTTOU/TTIN hang a backgrounded "make check" + Running "make check &" would hang due to SIGTTOU and SIGTTIN signals. + * tests/misc/stty: Ignore SIGTTOU. + * tests/misc/stty-invalid: Likewise. + * tests/mv/i-3: Ignore SIGTTIN. - * Makefile.maint (po-check): This rule didn't detect the new use - of "gettext" (as opposed to the use of "_" everywhere else) in - lib/xstrtol.h. Adjust the grep regexp so that now it does. +2009-02-20 Jim Meyering -2006-10-18 Paul Eggert + doc: ls: clarify description of -s + * src/ls.c (usage): Make the description of -s mention "allocated size", + so that it's less likely to be confused with an apparent byte-count. + Suggested by Vito Caputo. - * src/copy.c (copy_reg): Rewrite slightly to avoid duplicate code - when opening dst_name. - (copy_reg, copy_internal): Use (SYSCALL != 0) rather than plain - (SYSCALL) to test for failure in a system call. +2009-02-19 Jim Meyering - * src/copy.c (copy_internal): Use mknod rather than mkfifo to copy - a fifo. This preserves the special mode bits on Solaris 10, which - is compatible with what Solaris 10 cp -R does. + doc: dd: document that the default block size is 512 bytes + * src/dd.c (usage): Document the default block size. + * doc/coreutils.texi (dd invocation): Document that the default + block size (bs, ibs, obs) is 512 bytes. + Reported by Petr Uzel. - * src/copy.c (copy_internal): Remove redundant and confusing local - variable src_type. +2009-02-18 Jim Meyering - * src/copy.c (copy_internal): Don't pass mkdir a mode greater than - 7777. This matches historical 'cp' behavior and avoids some - (though not all) implementation-defined behavior of mkdir. - * src/cp.c (make_dir_parents_private): Likewise. - * src/copy.c (copy_internal): Don't pass 'open' a mode greater - than 777. This is required by POSIX. It doesn't make any difference - in actual behavior on any host that I know of. + maint: changing NEWS' copyright date must not invalidate checksum + * maint.mk (NEWS_hash): Don't let the Copyright date line contribute + to the checksum. + * cfg.mk (old_NEWS_hash): Update to reflect the new policy. -2006-10-17 Jim Meyering + doc: explain how to recover from changes committed to master + * HACKING: A beginner's commit-to-master is so common, + and causes enough confusion, that we describe how to recover. - * src/dd.c (usage): Use two spaces (not one) to separate the - "fdatasync" option string from its description, so help2man formats - the derived man page properly. Reported by Samuel Thibault - in . + maint: add copyright notices + * HACKING: Add copyright notice. + * tests/test-lib.sh: Likewise. -2006-10-16 Jim Meyering +2009-02-18 Ondřej Vašík - * .x-sc_trailing_blank: Remove names of files that are no longer - version-controlled. + cp: -a now preserves SELinux context, with reduced diagnostics + * copy.c (copy_reg): Reduce SELinux context diagnostics for 'cp -a'. + (copy_internal): Likewise + * copy.h (cp_options): Add boolean reduce_diagnostics. + * cp.c (usage): Say that --archive (-a) behaves like -dR --preserve=all. + (cp_option_init): Initialize added reduce_diagnostics. + (main): Add reduce_diagnostics for the -a option, and preserve SELinux + context, if possible. + * mv.c (cp_options_init): Initialize new cp_options booleans. + * install.c (cp_option_init): Likewise. + * NEWS: Mention those behaviour changes. + * doc/coreutils.texi: Document --preserve=context, document that + diagnostics are not shown for failures of non-mandatory attributes + (just SELinux at the moment). + * tests/cp/cp-a-selinux: Check not only failures, but succesful use + of preserving SELinux context in cp. -2006-10-16 Paul Eggert +2009-02-18 Eric Blake - * src/groups.sh (version): Reword message to match the other programs. - Problem reported by Eric Blake. + add missing copyright dates + * NEWS: Add 2009 to copyright. + * README: Likewise. + * README-hacking: Likewise. + * TODO: Likewise. + * doc/Makefile.am: Likewise. + * m4/prereq.m4: Likewise. + * src/nl.c: Likewise. + * src/seq.c: Likewise. + * tests/cp/cp-i: Likewise. + * tests/install/install-C: Likewise. + * tests/install/install-C-root: Likewise. + * tests/install/install-C-selinux: Likewise. + * tests/misc/seq: Likewise. + * tests/mv/mv-n: Likewise. -2006-10-14 Jim Meyering +2009-02-17 Eric Blake - * Makefile.maint (headers_with_interesting_macro_defs): Define. - (.re-defmac, sc_always_defined_macros): New rules. + install: compare files in binary mode + * src/install.c (need_copy): Use O_BINARY when it matters. - * src/system.h (EXIT_FAILURE, EXIT_SUCCESS): Remove definitions. - Instead, include "exit.h". This hereby retires the work-around for - "Sony NEWS-OS Release 4.0C"'s bug due to "#define EXIT_FAILURE 0". +2009-02-17 Kamil Dudka - * src/cksum.c (uint_fast32_t): Don't define. - Instead, include . + install: add --compare (-C) option to install file only when necessary + * src/install.c (have_same_content): New function to compare files + content. + (extra_mode): New function checking for non-permission bits in mode. + (need_copy): New function to check if copy is necessary. + (main): Handle new option --compare (-C). + (copy_file): Skip file copying if not necessary. + (usage): Show new option --compare (-C) in --help. + * tests/install/install-C: Basic tests for install --compare (-C). + * tests/install/install-C-root: Tests requiring root privileges. + * tests/install/install-C-selinux: Tests requiring SELinux. + * tests/Makefile.am: Add new tests for install --compare (-C). + * doc/coreutils.texi: Document new install option --compare (-C). + * NEWS: Mention the change. - * src/pinky.c (S_IWGRP): Don't define. - It's already defined by "stat-macros.h" (included via system.h). +2009-02-17 Ondřej Vašík - * Makefile.cfg: Remove cruft that's now handled via bootstrap. - * Makefile.maint: Likewise, remove these targets/rules/variables: - (local_updates, update, cvs-update, wget_files, get-targets): Remove. - (cvs_files, wget-update, automake_repo): Likewise. - Move the comment about cvsu to build-aux/vc-list-files, - where cvsu is actually used. + nl: correct long-option name for -v in usage + * nl.c (usage): Use --starting-line-number, not --first-page for -v - * Makefile.maint (cvs-update): Use $(CVS), not "cvs". +2009-02-15 Jim Meyering - Work also when the working directory (with e.g. coreutils sources) - is version controlled with git, rather than CVS. - * bootstrap (CVS_only_file): Test for the existence of README-cvs, - rather than CVS. - In messages and comments, say e.g., "checked-out sources", - rather than "CVS sources". - (version_controlled_file): New function. Work for git as well as - for CVS. Don't use grep's -q option. - (slurp): Call it here, in place of CVS-specific code. + doc: id: make --help and .man more descriptive + * src/id.c (usage): Improve description, based on a suggestion + from Brian M. Carlson in http://bugs.debian.org/514675 + * man/id.x: Use a better one-liner, based on the one at top of id.c. - * NEWS: cp -r --backup dir1 dir2, would rename an existing dir1/dir2 - to dir1/dir2~. - * src/copy.c (copy_internal): Although we do create a backup of each - destination directory when in move mode, don't do that when copying. - Reported by Peter Breitenlohner, in - . - * tests/cp/backup-dir: New file. Test for the above. - * tests/cp/Makefile.am (TESTS): Add backup-dir. +2009-02-15 Pádraig Brady -2006-10-13 Jim Meyering + seq: Fix equal width calculation when '.' added to last number + Issue reported by Samuel Hapák. + - More chown/chgrp dereferencing-related fixes. - * src/chown-core.c (change_file_owner): Don't use fts_statp if - we're dereferencing symlinks. - Reverse conjuncts, so that we use dereference file_stats - (aka ent->fts_statp) only *after* we've confirmed that - chopt->affect_symlink_referent is true. Otherwise, we might - use ent->fts_statp uninitialized. - Don't turn on FTS_NOSTAT when dereferencing symlinks. - * tests/chown/deref: Update the expected diagnostic, now that - this test case (trying to use "chown --dereference ..." on a - dangling symlink) takes a different code path. + * src/seq.c: Account for '.' added to "last" number. + * tests/misc/seq: Add corresponding test. + * NEWS: Mention the fix. -2006-10-13 Paul Eggert +2009-02-13 Jim Meyering - Sync from Bison, as follows: + du,chgrp,chmod,chown: use FTS_DEFER_STAT + * src/du.c (main): Use FTS_DEFER_STAT, for better locality of inode + reference. Important when traversing file systems with fake inodes. + * src/chgrp.c (main): Likewise. + * src/chmod.c (main): Likewise. + * src/chown.c (main): Likewise. + The only remaining fts client, chcon, doesn't need this, since it goes + further and uses FTS_NOSTAT, which suppresses all non- directory + stat calls. - 2006-10-01 Paul Eggert +2009-02-13 Pádraig Brady - Fix problems with translating English-language diagnostics. - * bootstrap: Fix bug introduced in recent bootstrap changes, with - respect to bison-runtime pot generation. The YY_ stuff - wasn't being captured. + maint: mention how to run a single test in HACKING docs + * HACKING: Give an example of how to run a test in isolation. + * README: Fix/simplify example for running a single test. + * README-hacking: Reference the HACKING file. -2006-10-13 Jim Meyering +2009-02-12 Eric Blake - * src/chown-core.c (change_file_owner): Use fstatat, not stat, - now that we're using fts_open with FTS_CWDFD. - * tests/chgrp/posix-H: Add --preserve-root to an invocation of - chgrp, to exercise the above fix. - * NEWS: Mention the above. + ln: add details to --help text + * src/ln.c (usage): Mention more about symlink properties. + * doc/coreutils.texi (ln invocation): Likewise. + * THANKS: Update. + Reported by Vitali Lovich. - * src/du-tests: Clean up a little, though it's still not portable. +2009-02-10 Jim Meyering - * .vg-suppressions: Add 3 more for debian unstable. + ls: clean up after wrapped+colored file names with clear-to-EOL + This change addresses a relatively unusual case: ls --color, with + a highlighted name being printed initially in the last row of a + terminal emulator (possibly followed by other lines of output) such + that it is wrapped onto the following line, as the terminal emulator + scrolls the output. That would cause the entire following line to + be highlighted, even if the name happened to use only one position. + The least-invasive patch would have made colorized output larger for + all uses. The approach taken below is more invasive, but limits the + increase in overhead to only those lines that are expected to wrap. + * src/ls.c (enum indicator_no): Add C_CLR_TO_EOL. + (indicator_name): Add "cl". + (color_indicator): Add default escape codes for "cl". + (print_long_format): Propagate width to print_name_with_quoting. + (print_name_with_quoting): Print new C_CLR_TO_EOL string if needed. + Return the width of what we're printing. + (print_file_name_and_frills): Propagate width. + (print_type_indicator): Return bool (aka width). + (print_many_per_line): Pass column position to print_* function. + (print_current_files): Likewise. + (print_horizontal): Likewise. + (print_with_commas): Likewise. + * src/dircolors.c (slack_codes): Add "CLRTOEOL". + (ls_codes): Add "cl". + * tests/ls/color-clear-to-eol: New file. Test for this fix. + * tests/Makefile.am (TESTS): Add ls/color-clear-to-eol. + * THANKS: Update. + Reported by Alexander V. Lukyanov. See thread for details: + http://thread.gmane.org/gmane.linux.kernel/740021/focus=14824 + Thanks to Jan Engelhardt for helping me reproduce the problem. - * tests/ls/Test.pm: Remove long-unused file. - * Makefile.am (EXTRA_DIST): Add bootstrap.conf. - Suggestions from Bruno Haible. + Demonstrate with this in an 80-column xterm: + seq 200 # to start in the "bottom" row + touch zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz.foo + env LS_COLORS='*.foo=0;31;42' ls -og --color=always -2006-10-12 Ralf Wildenhues + Before the fix, you'd see something like this: + (where the file name is printed in red on a green background, + and each "=" denotes a space on a green background) + ... + -rw-r--r-- 1 0 Feb 5 11:31 zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\ + zzzzzzzzzzzzzz.foo=================================================== - * Makefile.am (THANKS-to-translators): Add missing $(srcdir). - (MAINTAINERCLEANFILES): Add .kludge-stamp. - * man/Makefile.am (MAINTAINERCLEANFILES): Typo $(dist_man_MANS) - instead of $(man_MANS). + After the patch, the trailing green spaces are gone: -2006-10-12 Ralf Wildenhues + -rw-r--r-- 1 0 Feb 5 11:31 zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\ + zzzzzzzzzzzzzz.foo - * configure.ac: Avoid compiler warnings about default return - type in function definitions and unused variables in tests. - * src/who.c (print_user) [HAVE_UT_HOST]: hostlen is only needed - if this is #defined. + * tests/test-lib.sh: Use skip_test_... in place of echo...;exit 77. -2006-10-12 Jim Meyering +2009-02-10 Nix - * configure.ac: Reflect s/gl_MACROS/coreutils_MACROS/ renaming. - Call gl_INIT directly, rather than through the above. + tests: avoid skipping stty-* tests + * tests/test-lib.sh (require_controlling_input_terminal_): + Check stdout, not stdin. -2006-10-11 Paul Eggert +2009-02-09 Jim Meyering - * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell - variable was sometimes used without being initialized. This - messed up the installation of the INSTALL file in some cases. + touch: deprecate --file option: equivalent to --reference (-r) + * src/touch.c: Mark long-undocumented --file for removal in 2010. + (main): Warn upon use of --file. -2006-10-11 Jim Meyering +2009-02-06 Pádraig Brady - * src/ls.c (usage): Correct description of -s, --size. - It works even without -l. Suggestion from Karl Berry. + tests: fix dd skip=greater_max_file_size test on Solaris 10 + * tests/dd/skip-seek-past-file: I had previously commented that + on some systems lseek(> max file size) may succeed, but left + the possibility of failure in that case, so that I could determine + specific systems to put in the comments for both failure modes. -2006-10-10 Paul Eggert +2009-02-05 Jim Meyering - * src/ls.c (quote_name): Use initializer rather than memset to - initialize an object to zero. This is easier to read and is less - likely to introduce a runtime error due to a mixup. It causes - gcc -W to issue a warning, but you can work around this by - appending -Wno-missing-field-initializers. - * src/pathchk.c (portable_chars_only): Likewise. - * src/shred.c (main): Likewise. + avoid spurious parentheses/arith-op-related warnings from newer gcc + * src/copy.c (set_owner): Use && rather than &. * src/stty.c (main): Likewise. - * src/tr.c (card_of_complement): Likewise. * src/wc.c (wc): Likewise. -2006-10-09 Paul Eggert +2009-02-02 Jim Meyering + + maint: tighten atoi/atof-prohibiting regexp, clean up .x-sc- file + * maint.mk (sc_prohibit_atoi_atof): Require "(" after token. + * .x-sc_prohibit_atoi_atof: Remove names that no longer contain a match. + + doc: preserve --help line breaks in 'REPORTING BUGS' man page section + * man/help2man: Insert .br between adjacent lines. + + * src/system.h (emit_bug_reporting_address): Remove periods. + + update copyright dates from recent changes + * src/dd.c: Add 2009 to list of copyright years. + * tests/dd/seek-skip-past-file: Likewise. + * tests/dd/seek-skip-past-dev: Likewise. + * m4/xattr.m4: Likewise. + * src/copy.h: Likewise. + + * maint.mk (sc_redundant_const): Use $(_prohibit_regexp). + +2009-02-02 jidanni@jidanni.org + + date doc: warn at -d about LC_TIME + We also warn here about LC_TIME, so the user will know even if he + doesn't look in the @xref{Date input formats}. + + document sort --ignore-case --unique interaction + +2009-01-31 Jim Meyering + + maint: detect useless inclusion of c-ctype.h + * maint.mk (sc_prohibit_c_ctype_without_use): New rule. + +2009-01-29 Jim Meyering + + maint: teach "make syntax-check" to print each check name as it's run + * maint.mk (%.m): New rules to print each syntax-checking rule name, + just before running its commands. + ($(syntax-check-rules)): Depend on it. + + maint: silence some syntax-check rules + * cfg.mk (sc_strftime_check): Silence the rule. + (sc_tight_scope): Likewise. + * src/Makefile.am (check-AUTHORS): Likewise. + + maint: factor syntax-check rules + * maint.mk (_ignore_case): New macro. + (_prohibit_regexp): Use it. + Factor many existing syntax-check rules to use $(_prohibit_regexp). + +2009-01-29 Kamil Dudka + + cp/mv: add xattr support + This patch was originally written by Andreas Grünbacher, nowadays + available at + http://www.suse.de/~agruen/coreutils/5.91/coreutils-xattr.diff + + * bootstrap.conf: Add gnulib module verror. + * po/POTFILES.in: Add lib/verror.c. + * m4/xattr.m4: Check for libattr availability, new configure option + --disable-xattr. + * m4/prereq.m4: Require gl_FUNC_XATTR. + * src/Makefile.am: Link cp, mv and ginstall with libattr. + * src/copy.h: Add preserve_xattr and require_preserve_xattr to + cp_options. + * src/copy.c (copy_attr_error): New function to handle errors during + xattr copying. + (copy_attr_quote): New function to quote file name in error messages + printed by libattr. + (copy_attr_free): Empty function requested by libattr to free quoted + string. + (copy_attr_by_fd): New fd-oriented function to copy xattr. + (copy_attr_by_name): New name-oriented function to copy xattr. + (copy_reg, copy_internal): Call copy_extended_attributes function. + * src/cp.c (usage): Mention new --preserve=xattr option. + (decode_preserve_arg): Handle new --preserve=xattr option. + * src/mv.c: Always attempt to preserve xattr. + * src/install.c: Never attempt to preserve xattr. + * tests/misc/xattr: New test for xattr support in cp, mv and install. + * tests/Makefile.am: Add the new test to list. + * doc/coreutils.texi: Mention xattr support, new --preserve=xattr + option. + * NEWS: Mention the change. + +2009-01-28 Jim Meyering + + system.h: add a comment re autoconf's new AC_PACKAGE_URL + * src/system.h (emit_bug_reporting_address): Add a comment + suggesting to use AC_PACKAGE_URL once we require autoconf-2.64. + +2009-01-28 Pádraig Brady + + tests: Fixup shred-passes test + * tests/misc/shred-passes: Set the $fail variable correctly. + The issue was noticed by Jim Meyering. + + tests: Add a test to verify shred's default operations + * tests/Makefile.am: add new test + * tests/misc/shred-passes: Verify the operations shred + does by default to overwrite and remove a zero length file. + + dd: Better handle user specified offsets that are too big + Following are the before and after operations for seekable files, + for the various erroneous offsets handled by this patch: + + skip beyond end of file + before: immediately exit(0); + after : immediately printf("cannot skip to specified offset"); exit(0); + + skip > max file size + before: read whole file and exit(0); + after : immediately printf("cannot skip: Invalid argument"); exit(1); + seek > max file size + before: immediately printf("truncate error: EFBIG"); exit(1); + after : immediately printf("truncate error: EFBIG"); exit(1); + + skip > OFF_T_MAX + before: read whole device/file and exit(0); + after : immediately printf("cannot skip:"); exit(1); + seek > OFF_T_MAX + before: immediately printf("truncate error: offset too large"); exit(1); + after : immediately printf("truncate error: offset too large"); exit(1); + + skip > device size + before: read whole device and exit(0); + after : immediately printf("cannot skip: Invalid argument"); exit(1); + seek > device size + before: read whole device and printf("write error: ENOSPC"); exit(1); + after : immediately printf("cannot seek: Invalid argument"); exit(1); + + * NEWS: Summarize this change in behavior. + * src/dd.c (skip): Add error checking for large seek/skip offsets on + seekable files, rather than deferring to using read() to advance offset. + (dd_copy): Print a warning if skip past EOF, as per FIXME comment. + * test/Makefile.am: Add 2 new tests. + * tests/dd/seek-skip-past-file: Add tests for first 3 cases above. + * tests/dd/seek-skip-past-dev: Add root only test for last case above. + +2009-01-27 Jim Meyering + + doc: emit better bug-reporting info, to help help2man + * src/system.h (emit_bug_reporting_address): End each "sentence" + with period, mark URLs with <...>. + Based on a suggestion from Eric Blake. + Use fputs on a string without %s, not printf. + + doc: ensure that emit_bug_reporting_address changes propagate to *.1 + * man/Makefile.am ($(MAN)): Depend on system.h. + + doc: restore "REPORTING BUGS" section to generated man pages + * man/help2man ($PAT_BUGS): Update regexp to match the newer + "Report PROG bugs ..." --help output, as well as "Report bugs...". + Reported by Eric Blake. + +2009-01-26 Jim Meyering + + tests: generalize install-transform-check + * maint.mk (install-transform-check): Generalize to work also + in a project that installs manuals in a section other than "1". + +2009-01-23 Jim Meyering + + build: resolve conflict with new declaration from version-etc.h + * src/system.h (emit_bug_reporting_address): Define away, + now, gnulib's version-etc.h also declares this function. + In this package, we choose to include each program's name in + the diagnostic. Define away the conflicting declaration. + (emit_bug_reporting_address): Also emit home page and + "General help..." links, like the new function does. + Reported by Bob Proulx. + +2009-01-23 Pádraig Brady + + doc: shred: Correct docs on default number of overwrites. + * NEWS: Mention the change to the default number of passes. + * doc/Makefile.am: Update constants.texi with the default + number of passes shred uses, so that the documentation + will automatically reflect any future changes. + * doc/coreutils.texi (shred invocation): Update the description + of the --iterations option to have the correct default number, + while still conveying that there are 25 internal patterns + that may be useful. + +2009-01-22 Pádraig Brady + + shred: change default number of overwrites from 25 to 3 + * src/shred.c: The concensus is that a default of 3 + passes is appropriate for current drive technologies. + * src/TODO: Reference Paul Eggert's suggestion + of enhancing shred to conform to DoD 5220 rules. + +2009-01-21 Jim Meyering + + m4: don't use AC_REQUIRE([AC_C_BIGENDIAN]) + * m4/jm-macros.m4: Use AC_REQUIRE([gl_BIGENDIAN]) instead. + This avoids a subtle problem recently documented in autoconf: + http://git.sv.gnu.org/gitweb/?p=autoconf.git;a=commitdiff;h=34e2c8d5484 + +2009-01-19 Jim Meyering + + no longer define *_FILENO constants + * src/system.h (STDIN_FILENO, STDOUT_FILENO, STDERR_FILENO): + Remove definitions. Now guaranteed by gnulib. + + build: use dist-xz, not dist-lzma, cont'd + * README-hacking: mention XZ utils + * README-prereq: Add a FIXME comment. + + tests: tail-2/infloop-1 is racy + * tests/tail-2/infloop-1: Add a comment to that effect. + +2009-01-18 Jim Meyering + + build: use dist-xz, not dist-lzma + * configure.ac (AM_INIT_AUTOMAKE): s/dist-lzma/dist-xz/. + Requires recent "xz" from git://ctrl.tukaani.org/lzma-utils.git + +2009-01-16 Jim Meyering + + maint: remove obsolete sc_author_mark_check rule + * maint.mk (sc_author_mark_check): Remove rule. + "and" no longer appears in the definition of AUTHORS. + + Merge branch 'master' of git://git.sv.gnu.org/coreutils + + maint: enforce existing prohibition: no cvs $keywords$ + * maint.mk (sc_prohibit_cvs_keyword): New rule. + + echo, printf, test: remove unused #include directives + * src/echo.c: Don't include "long-options.h". No longer used. + * src/printf.c: Likewise. + * src/test.c: Likewise. + +2009-01-16 Pádraig Brady + + pathchk: avoid -Wsign-compare warnings + * src/pathchk.c: Compare pathconf limits to _signed_ MAX constants, + as pathconf returns signed values. + + pr: avoid -Wsign-compare warnings + * src/pr.c: Use unsigned variables in unsigned comparisons. + + shred: avoid -Wsign-compare warnings + * src/shred.c: Use already assigned signed variable sizeof_r, + rather than the unsigned sizeof(r). Don't use signed integer + overflow check that contemporary compilers may remove anyway. + + simplify mgetgroups() and avoid -Wsign-compare warnings + * gl/lib/mgetgroups.c: Avoid -Wsign-compare warning by using unsigned + types for the parameters of the new function realloc_groupbuf(). + mgetgroups() was refactored to use this function rather than + explicitly allocating and copying from automatic storage itself. + * src/group-list.c: Use int rather than size_t as variable is + used in signed comparisons. + * src/id.c: ditto. + +2009-01-14 Eric Blake + + test, echo, printf: don't accept option abbreviation + * src/test.c (main): Directly parse accepted options, thus + avoiding abbreviations. + * src/echo.c (main): Likewise. + * src/printf.c (main): Likewise. + +2009-01-14 Kamil Dudka + + cp/mv: add --no-clobber (-n) option to not overwrite target + * src/cp.c (usage): Show new option -n in --help. + (main): Handle new option -n. + * src/mv.c (usage): Show new option -n in --help. + (main): Handle new option -n. + * doc/coreutils.texi: Document new cp/mv option -n. + * tests/cp/cp-i: Add tests for -f, -i and -n options. + * tests/mv/mv-n: New test for mv -n. + * tests/Makefile.am: Add test mv/mv-n to the list. + * NEWS: Mention the change. + +2009-01-08 Eric Blake + + option handling: make exceptions more consistent + * doc/coreutils.texi (Common options): Not all utilities reject + option abbreviations. + * src/chroot.c (main): Report correct name on failure. + * src/echo.c (usage): Clarify long option usage. + * src/setuidgid.c (usage): Likewise. + * src/hostid.c (usage): Condense. + +2009-01-07 Jim Meyering + + * bootstrap.conf (avoided_gnulib_modules): Add dummy. + + * maint.mk: align some backslashes + +2009-01-05 Pádraig Brady + + doc: pathchk description enhancements + * doc/coreutils.texi (pathchk invocation): Mention pathchk + checks validity (for current system) as well as portability. + Say messages go to stderr, and reorder description of checks + done for the -p option, to match what's done in code. + * src/pathchk.c (usage): Mention pathchk checks name validity. + Suggested clarifications were from Dan Jacobson. + +2009-01-03 Pádraig Brady + + src/.gitignore: Ignore getlimits utility + * src/.gitignore: Ignore getlimits + + tests: refactor to use the new getlimits utility + * tests/Coreutils.pm: Add function to make limits available + * tests/test-lib.sh: ditto + * tests/misc/join: Check for both SIZE_OFLOW and UINTMAX_OFLOW + rather than using arbitrary 2^128 + * tests/misc/sort: ditto + * tests/misc/uniq: ditto + * tests/misc/printf: Check for both INT_OFLOW and INT_UFLOW + rather than using arbitrary -2^31 + * tests/misc/seq-long-double: Check for INTMAX_OFLOW + rather than using arbitrary 2^63 + * tests/misc/split-fail: Check --lines --bytes and --line-bytes + options limits on all platforms. Note getlimits obviates the + need to use expr to check if 32 bit integers are supported, + which I think was invalid anyway as expr now supports bignum? + * tests/misc/test: Check for UINTMAX_OFLOW rather than + using arbitrary 2^64 and 2^128. Check for INTMAX_UFLOW + rather than using arbitrary -2^64 + * tests/misc/timeout-parameters: Check for UINT_OFLOW + rather than using arbitrary 2^32 + * tests/misc/truncate-overflow: Don't depend on truncate + to determine if we're on a 32 or 64 bit platform and + instead use the various OFF_T limits + * tests/misc/sort-merge: Check for UINTMAX_OFLOW + rather than using arbitrary 2^64+1 + * tests/misc/unexpand: ditto + +2009-01-03 Michael Meskes + + stat: print file-system total inode count (%c) as an unsigned number + * src/stat.c (print_statfs): Print statfs.f_files, the total inode + count of a file system, as an unsigned number. + +2009-01-01 Jim Meyering + + tests: factor ls-misc (no semantic change) + * tests/misc/ls-misc: Factor out uses of "\e[0m". + + update copyright year + * doc/coreutils.texi: Likewise. + * tests/sample-test: Likewise. + +2009-01-01 Jim Meyering + + improve M4 quoting + * configure.ac: Add quotes. + * gl/m4/mgetgroups.m4 (gl_MGETGROUPS): Likewise. + * m4/boottime.m4 (GNULIB_BOOT_TIME): Likewise. + * m4/check-decl.m4 (gl_CHECK_DECLS): Likewise. + * m4/gmp.m4 (cu_GMP): Likewise. + * m4/jm-macros.m4 (coreutils_MACROS, gl_CHECK_ALL_HEADERS): Likewise. + (gl_CHECK_ALL_TYPES): Likewise. + * m4/lib-check.m4 (cu_LIB_CHECK): Likewise. + * m4/stat-prog.m4 (cu_PREREQ_STAT_PROG): Likewise. + + FYI, I first ran this command: + git ls-files | grep -E '\.(m4|ac)$' | xargs perl -pi \ + -e 's/(AC_[A-Z_]+\()([^[()]+?)([,)])/$1\[$2]$3/g;' \ + -e 's/(AC_[A-Z_]+\(\[[^,]+?\], )([^,[()]+?)([,)])/$1\[$2]$3/g;' \ + -e 's/(AC_[A-Z_]+\((?:\[[^,]+?\], ){2})([^,[()]+?)([,)])/$1\[$2]$3/g' + Then I updated serial numbers and copyright dates manually. + Also, I manually added two pairs of quotes in boottime.m4. + +2009-01-01 Jim Meyering + + bootstrap: don't use cmp's -s option when reading from a pipe + GNU cmp exits without reading all input when given the -s option, + and that can cause termination of the writing process via SIGPIPE. + Instead, when reading from a pipe, just redirect output to /dev/null + so that all input is read. + + maint: factor out common code; prohibit use of HAVE_MBRTOWC + * maint.mk (_prohibit_regexp): New macro. + (sc_avoid_if_before_free, sc_cast_of_argument_to_free): + (sc_cast_of_x_alloc_return_value, sc_cast_of_alloca_return_value): + (sc_space_tab, sc_prohibit_atoi_atof, sc_prohibit_strcmp): + (sc_prohibit_stat_st_blocks, sc_prohibit_S_IS_definition): Use it. + (sc_prohibit_HAVE_MBRTOWC): New rule. + + maint: use more sc_-prefixed names + * maint.mk (sc_po_check): Renamed from po-check. + (sc_author_mark_check): Renamed from author_mark_check. + (sc_copyright_check): Renamed from copyright-check. + (sc_makefile_path_separator_check): Renamed from + makefile_path_separator_check. + (local-checks-available): Remove the old names. + * Makefile.am (EXTRA_DIST): Reflect the renaming: .x-sc_po_check + * .x-po-check: Rename to... + * .x-sc_po_check: ...new file. + + maint: tighten m4 AC_ quoting check + * maint.mk (sc_m4_quote_check): Renamed from m4-check. + Also search for AC_DEFINE and AC_DEFINE_UNQUOTED. + Also search in configure.ac. + * configure.ac: Quote first argument of AC_DEFINE. + * jm-macros.m4 (coreutils_MACROS): Quote the first argument to AC_DEFINE. + + maint: move coreutils-specific syntax check rules into cfg.mk + * maint.mk (sc_dd_max_sym_length, sc_prohibit_jm_in_m4): + (sc_root_tests, sc_always_defined_macros, sc_system_h_headers): + (sc_sun_os_names, sc_tight_scope, sc_no_exec_perl_coreutils): + Move rules into cfg.mk. + (sc_strftime_check): Renamed from strftime-check, and moved, too. + * cfg.mk: Add the above rules. + + portability: accommodate gnulib's getaddrinfo change + * src/Makefile.am (pinky_LDADD, who_LDADD): Append $(GETADDRINFO_LIB) + + cleanup/modernize: don't test HAVE_MBRTOWC; now gnulib provides it + * bootstrap.conf (gnulib_modules): Include mbrtowc explicitly. + * src/ls.c (quote_name): Don't test HAVE_MBRTOWC, now that we're + guaranteed to have the function. + * src/wc.c (wc): Likewise. + +2008-12-27 Eric Blake + + doc: mention long option abbreviation + * doc/coreutils.texi (Common options): Give example of + abbreviating options. + * THANKS: Update. + Reported by Adam Jimerson. + +2008-12-26 Jim Meyering + + maint: ensure dd's computation of O_FULLBLOCK uses all O_ symbol names + * src/dd.c (O_FULLBLOCK): Use a more uniform initializer, that makes + it easier to extract all O_ symbol names. + * maint.mk (syntax-check-rules): Also search for sc_ rules in cfg.mk. + (sc_root_tests): Ensure that this rule sets $diff. + * cfg.mk (sc_dd_O_FLAGS): New rule. + +2008-12-26 Matt Harden + + dd: add support for opening files in Concurrent I/O (CIO) mode + * src/dd.c (O_CIO): New flag. + * src/dd.c (O_FULLBLOCK): Add O_CIO to the list of flags that + O_FULLBLOCK should be greater than. + * src/dd.c (flags): Give the name "cio" to the new O_CIO flag, mirroring + the treatment of O_DIRECT. + * src/dd.c (usage): Add a description of the new flag when it is available. + * doc/coreutils.text (dd invocation): Describe the new flag. + * NEWS: Mention the new feature. + +2008-12-23 Jim Meyering + + build: do enable $(WERROR_CFLAGS) for src/ files. + This reverts the more recent commit (of two) entitled "build: + add configure-time --enable-gcc-warnings option; avoid warnings". + Pádraig Brady spotted the contradiction between the log message + and actual change. + + This reverts commit 292d68565a34b237cd2bf586ace545b7cd3dbfcf. + +2008-12-23 Pádraig Brady + + doc: stty: Clarification of some input and output settings + * doc/coreutils.texi (stty invocation): Clarify any + ambiguity in regard to the direction of input and output settings. + Add some notes on the case changing settings. + Most of the text was supplied by Dan Jacobson. + + timeout: remove problematic casts + * src/timeout.c (apply_time_suffix): Change input parameter from + unsigned int to unsigned long, which is the type of the variable it's + actually manipulating. This removes the need for the cast which was + giving a warning with the gcc options: -fstrict-aliasing + -Wstrict-aliasing. Also add a check for overflow possible on 16-bit + platforms, and fix indents. + (main): Remove a redundant cast in the alarm() call. + +2008-12-21 Jim Meyering + + * .x-sc_require_config_h: Remove obsolete regexps. + + maint.mk: enforce the "include first" rule + * maint.mk (sc_require_config_h_first): New rule. + * .x-sc_require_config_h_first: New file. + + build: add configure-time --enable-gcc-warnings option; avoid warnings + * bootstrap.conf (gnulib_modules): Add "warnings" module. + * configure.ac: Add --enable-gcc-warnings, derived from code in bison. + * src/Makefile.am (AM_CFLAGS): Set to $(WARN_CFLAGS) # $(WERROR_CFLAGS) + * lib/Makefile.am (AM_CFLAGS): Change spelling to $(WARN_CFLAGS) + Don't use $(WERROR_CFLAGS), yet. + * src/system.h (usage): Declare. + * src/base64.c (usage): Declare to be global, for consistency. + * src/timeout.c (usage): Likewise. + * src/truncate.c (usage): Likewise. + * src/getlimits.c (usage): Likewise. + * src/pinky.c (ttyname): Declare with prototype, rather than an + empty argument list. + * src/who.c (ttyname): Likewise. + * src/su.c (crypt, getusershell, setusershell, endusershell): Likewise. + + build: turn on $(WERROR_CFLAGS) for src/ + + build: add configure-time --enable-gcc-warnings option; avoid warnings + * bootstrap.conf (gnulib_modules): Add "warnings" module. + * configure.ac: Add --enable-gcc-warnings, derived from code in bison. + * src/Makefile.am (AM_CFLAGS): Set to $(WARN_CFLAGS) # $(WERROR_CFLAGS) + * lib/Makefile.am (AM_CFLAGS): Change spelling to $(WARN_CFLAGS) + Don't use $(WERROR_CFLAGS), yet. + * src/system.h (usage): Declare. + * src/base64.c (usage): Declare to be global, for consistency. + * src/timeout.c (usage): Likewise. + * src/truncate.c (usage): Likewise. + * src/getlimits.c (usage): Likewise. + * src/pinky.c (ttyname): Declare with prototype, rather than an + empty argument list. + * src/who.c (ttyname): Likewise. + * src/su.c (crypt, getusershell, setusershell, endusershell): Likewise. + +2008-12-17 Pádraig Brady + + doc: Remove curly quotes from shell examples in man pages + Use \(aq rather than a literal ' as groff will convert apostrophe + to a right quote (\u2029) in utf8 locales for example. + Stepan Kasal details the issue and fix here: + http://lists.gnu.org/archive/html/bug-coreutils/2008-12/msg00124.html + +2008-12-16 Jim Meyering + + ChangeLog-2008: say ChangeLog files are no longer manually maintained + and point to HACKING's policy. Suggestion from Dan Jacobson. + + du: -H now does what POSIX requires + * src/du.c (usage): Update --help output. + (main): Move -H-handling code from the --si block to + the one for --dereference-args (-D). + * doc/coreutils.texi (du invocation): Update description. + * NEWS (Changes in behavior): Mention this. + +2008-12-13 Jim Meyering + + doc: pr: formatting corrections + * doc/coreutils.texi (pr invocation): Fix some overzealous uses of @var. + Reported by Andreas Schwab. + +2008-12-13 Ralf Wildenhues + + more portable bootstrap procedure + * bootstrap (get_version): Fix portability issues in sed script. + (check_versions): For buildreq apps, honor the corresponding + $APP variable like $AMTAR, $AUTOCONF. + (usage): Document this. + (update_po_files): Honor $SHA1SUM. + (main): Honor $AUTOPOINT, $ACLOCAL, $AUTOCONF, $AUTOHEADER, + $AUTOMAKE, $LIBTOOLIZE. + +2008-12-03 Jim Meyering + + tests: ensure that chmod, chgrp and chown honor --silent + * tests/chmod/silent: New file, to test all three programs. + * tests/Makefile.am (TESTS): Add chmod/silent. + * NEWS (Bug fixes): Mention this. + The bug was introduced in 96a5d2ce6a53d96cb667af78f13e56fadcdb91e6. + +2008-12-03 Ondřej Vašík + + chmod, chown, chgrp: honor --silent (-f) once again + * chmod.c (process_file): Make -f suppress fts-related diagnostics. + * chown-core.c (change_file_owner): Likewise. + Reported via . + +2008-12-02 Jim Meyering + + wc: read and process --files0-from= input a name at a time, + when the file name list is not too large. Before, wc would always read + the entire file name list into memory and *then* process each file name. + wc does read the list into memory when the list is known not to be too + large; this is done in order to be able to align the output numbers, + as it does with arguments specified on the command-line + * src/wc.c: Include "argv-iter.h". + (main): Rewrite to use argv-iter when the input file name list + is known to be too large. + * NEWS (Bug fixes): Mention it. + + du: read and process --files0-from= input a name at a time, + rather than by reading the entire input into memory and *then* + processing each file name. + * src/du.c: Include "argv-iter.h", not "readtokens0.h". + (main): Rewrite to use argv-iter. + Call xfts_open on each argument, rather than on the entire + argv list at once. + Call print_size here, not from du_files. + Diagnose read failure. + * NEWS (Bug fixes): Mention it. + * THANKS: update. + Reported by Barry Kelly. More details in + http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/15159/ + +2008-12-01 Jim Meyering + + seq: plug a leak + * src/factor.c (emit_ul_factor): Call mpz_clear. + + avoid warnings about initialization of automatic aggregates + * src/system.h (DZA_CONCAT0, DZA_CONCAT): New macros. + (DECLARE_ZEROED_AGGREGATE): New macro. + * src/ls.c (quote_name): Use it. + * src/pathchk.c (portable_chars_only): Use it. + * src/shred.c (main): Use it. + * src/stty.c (main): Use it. + * src/wc.c (SUPPORT_OLD_MBRTOWC): Use it. + + * bootstrap.conf (gnulib_modules): Add argv-iter. + + argv-iter: add tests + * gl/modules/argv-iter-tests: New module. + * gl/tests/test-argv-iter.c: New file. + + argv-iter: new module + * gl/lib/argv-iter.h: New file. + * gl/lib/argv-iter.c: New file. + * gl/modules/argv-iter: New file. + With a suggestion for improved memory management by Pádraig Brady. + + * src/hostname.c (sethostname) [!HAVE_SETHOSTNAME]: Remove declaration. + + cp, mv: remove 3-year-deprecated+warned-about --reply option + * src/cp.c (reply_args, reply_vals): Remove globals. + [REPLY_OPTION]: Remove enum. + (long_opts) ["reply"]: Remove initializer. + (main): Remove case stmt. + * src/mv.c: Likewise. + Don't include "argmatch.h". No longer used. + * NEWS (Changes in behavior): Mention this. + * tests/Makefile.am (TESTS): Remove mv/reply-no. + * tests/mv/reply-no: Remove file. + * tests/mv/i-link-no: Update, now that --reply= is gone. + +2008-12-01 Pádraig Brady + + doc: Make descriptions of ASCII NUL and --zero-terminated option consistent + doc/coretuils.texi: Refactor shuf, sort and uniq --zero-terminated + option to use the same text. Also refer to NUL characters as + @acronym{ASCII} @sc{nul} consistently. + +2008-12-01 Jim Meyering + + doc: enforce @var{lower} policy + * doc/coreutils.texi: Fix remaining violations. + * doc/Makefile.am (sc-lower-case-var): New rule. + Add some command-suppressing "@" directives so that a successful + "make check" run is less noisy. + +2008-12-01 Pádraig Brady + + doc: Tweak info docs to standarise on lower-case @var{file} + * doc/coreutils.texi: s/@var{FILE}/@var{file}/ + + doc: Improve description of --files0-from option + * doc/coreutils.texi: Describe the most common + usage of --files0-from=- to read names from stdin. + * src/du.c: Likewise. + * src/sort.c: Likewise. + * src/wc.c: Likewise. + + tests: dd/reblock: Reduce chance of timing related failures + * tests/dd/reblock: Change the IPC mechanism to the dd process + under test, from pipes to fifos. Also change the delay + between data writes to 0.2s for both tests. + This should increase the chance that the dd process + will read the data chunks separately. + +2008-11-30 Jim Meyering + + m4: avoid a warning from gcc's -Wstrict-prototypes + * m4/jm-macros.m4 (ARGMATCH_DIE_DECL): Use proper prototype for usage. + + tests: df: skip total-verify if df fails + * tests/df/total-verify: Skip the test if df fails. + + build: don't reject definition of STREQ + * maint.mk (sc_prohibit_strcmp): Tighten rule: exclude + macro definitions like the one in system.h. + * .x-sc_prohibit_strcmp: Don't exempt src/system.h. + + tests: start long-running cp/link-heap earlier + * tests/Makefile.am (TESTS): Move cp/link-heap nearer the start of the + list, so that its termination doesn't delay a parallel "make check". + + tests: avoid failure of cp/link-heap on some systems + * tests/cp/link-heap: Raise virtual memory limit from 10,000 + to 14,000, to avoid failure on Debian/unstable (libc6 2.7-16). + + remove explicit declaration of putenv, ... + * src/date.c: ... now that gnulib guarantees that it's in . + * src/env.c: Likewise. + + tests: dd/reblock: avoid occasional failure + * tests/dd/reblock: Sleep longer to avoid a race condition. + Reported by Bob Proulx. + +2008-11-27 James Youngman + + pwd: add pwd -P, -L to TODO + * TODO: Add to-do entry for -P and -L options of pwd. + +2008-11-26 Ondřej Vašík + + doc: fix typo in units factorization, removed TODO items + * doc/coreutils: switch typo (switched gibibytes/gigabytes) + * TODO: removed missing chcon and runcon documentation from list + +2008-11-26 Jim Meyering + + doc: factor out list of suffix-to-number (e.g., KB->1000B) mappings + * coreutils.texi (multiplierSuffixes, multiplierSuffixesNoBlocks): + New macros. + (od invocation, head invocation, tail invocation, split invocation): + (truncate invocation): Use them. + + doc: tail: one more s/bytes/n/ change + * doc/coreutils.texi (tail invocation): Make one more + @var{bytes} -> @var{n} change. - * src/sort.c (usage): Mention again that sort fields are origin 1. +2008-11-26 Pádraig Brady - * NEWS: Fix typo: iso-8602 -> iso-8601. Problem reported by - Bob Proulx. + doc: tail: fix description of --bytes=N (-c) + * doc/coreutils.texi (tail invocation): Use @var{n} consistently, + not a mix of that and @var{bytes}. Reported by anonymous + in . - * bootstrap (usage, main program, symlink_to_gnulib): Add option - --copy. Inspired by a suggestion from Bruno Haible. +2008-11-23 Karl Berry -2006-10-09 Jim Meyering + doc: move @shortcontents and @contents from end to start + * doc/coreutils.texi: Move @shortcontents and @contents from the + end to the beginning, just after "@end titlepage". - Avoid a compiler warning. - * src/pathchk.c (portable_chars_only): Initialize variable of type - mbstate_t via memset, rather than via '{0}'. Patch from Bruno Haible. +2008-11-23 Jim Meyering -2006-10-06 Paul Eggert + doc (stat): clarify: there are two sets of format directives + * doc/coreutils.texi (stat invocation): Clarify description of + --file-system format directives. - Fix bug reported today by Mike Frysinger: mkdir -pv is logging the - wrong file name in some cases. Lars Wendler reported a bug in - my original fix. - * src/install.c (make_ancestor): New arg COMPONENT. - * src/mkdir.c (make_ancestor): Likewise. - * tests/install/basic-1: Check for install -Dv bug. - * tests/mkdir/Makefile.am (TESTS): Add p-v. - * tests/mkdir/p-v: New file, to test this bug. +2008-11-23 Karl Berry -2006-10-05 Paul Eggert + doc (stat): correct formatting in coreutils.texi + * doc/coreutils.texi (stat invocation): Move the list of regular, + non-file-system, format directives from the description of --terse, + out of the enclosing table. - * src/chgrp.c: Don't include lchown.h; no longer needed. - * src/chown.c: Likewise. +2008-11-22 Jim Meyering - * tests/ls/stat-dtype: Use a dynamic test to decide whether the - current file system has useful d_type info. + tests: dd: add a test for the required behavior + * tests/dd/reblock: New file. Test for the required functionality. + Based on an example and discussion from this thread: + http://lists.gnu.org/archive/html/bug-coreutils/2008-11/msg00153.html + * tests/Makefile.am (TESTS): Add dd/reblock. - * src/dd.c (flags): noatime and nofollow now depend on - HAVE_WORKING_O_NOATIME and HAVE_WORKING_O_NOFOLLOW, too. - (usage): Output info about noatime and nofollow only if - they are known to work. - * src/remove.c (AD_push): Inspect HAVE_WORKING_O_NOFOLLOW rather - than O_NOFOLLOW, when testing whether it's possible to avoid a - race condition reliably. +2008-11-22 Pádraig Brady -2006-10-05 Jim Meyering + Revert part of "dd: avoid unnecessary memory copies" + This reverts part of commit fbd87029cfc494a72bb73ade27ef46382c5bc832. + Paul Eggert noticed the problem in + http://lists.gnu.org/archive/html/bug-coreutils/2008-11/msg00153.html + * doc/coreutils.texi (dd invocation): Clarify. - * src/c99-to-c89.diff: Update to reflect new offsets. +2008-11-21 Pádraig Brady - * tests/install/basic-1: Skip the latter part of this test if the - just-built dd binary is not readable. Otherwise, this test would fail - when binaries were created as root. Reported by Bauke Jan Douma in - . + getlimits: A new utility for use in coreutils' tests + * src/getlimits.c: A utility to print platform dependent + limits in a format suitable for use in shell scripts. + * src/Makefile.am: Add getlimits to list of utilities + to build but not install. Also add it to the list linked + with libiconv + * po/POTFILES.in: Add getlimits to translation list. -2006-10-03 Paul Eggert + dd: avoid unnecessary memory copies + * src/dd.c (scanargs): When not otherwise required (e.g. for + conversion), use two-buffer mode only when the input and output + buffer sizes differ. Before, some of the most basic invocations of + dd, e.g., dd < in > out, would unnecessarily use separate buffers + and perform memory copies between them. + +2008-11-20 Jim Meyering + + cp: use far less memory in some cases + cp --link was "remembering" many name,dev,inode triples unnecessarily. + cp was doing the same, even without --link, for every directory in the + source hierarchy, while it can do its job with entries merely for the + command-line arguments. Prompted by a report from Patrick Shoenfeld. + Details . + * src/copy.c (copy_internal): Refrain from remembering + name,dev,inode for most files, when invoked via cp --link. + Record an infloop-avoidance triple for each directory specified + on the command line, not for each directory in the source tree. + Don't record a dir-triple when x->hard_link is set. + * NEWS (Buf fixes): Mention it. + * tests/cp/link-heap: New file. Test for cp's lowered memory usage. + * tests/Makefile.am (TESTS): Add link-heap. + + tests: add a test of cp --preserve=links + * tests/cp/link-preserve: Add a case and comments. + + cp: remove unused code + * src/cp-hash.c (remember_created): Remove unused function. + Remove thus-obviated headers: , "quote.h", "error.h". + * src/cp-hash.h (remember_created): Remove declaration. + +2008-11-17 Jim Meyering + + doc: HACKING: reference http://www.gnu.org/licenses/why-assign.html + Suggestion from Patrick Schoenfeld. + +2008-11-16 Jim Meyering + + tests: remove debug code that would try to write into /t/k-env + * tests/ls/no-cap: Remove debugging "tee". + + tests: change misc/printf-surprise so that it doesn't segfault anymore + * tests/misc/printf-surprise: Disable MALLOC_PERTURB_, so that "make + check" no longer provokes a segfault from printf(1). Before, that + would be detected as a known problem and cause the test to be skipped. + Adjust the test so that a segfault once again results in test failure. + +2008-11-12 Jim Meyering + + tests: remove df/total + * tests/df/total: Remove file. + * tests/Makefile.am (TESTS): Remove df/total. + It is subsumed by df/total-verify. + +2008-11-12 Ondřej Vašík + + * tests/df/total-verify [VERBOSE]: Run df --version, not ls --version. + +2008-11-12 Jim Meyering + + avoid spurious test failure when df always fails + * tests/df/total-verify: Skip upon _df_ failure, not tee failure. + Reported by Ondřej Vašík. Details in + . + +2008-11-11 Eric Blake + + jm-macros.m4: avoid syntax issue with newer autoconf + * jm-macros.m4 (coreutils_MACROS): Make LIB_CAP assignment persistent. + +2008-11-11 Jim Meyering + + Update references to GFDL: 1.2 -> 1.3 + * doc/coreutils.texi: Likewise. + * doc/perm.texi: Likewise. + * old/fileutils/NEWS: Likewise. + * old/sh-utils/NEWS: Likewise. + * old/textutils/NEWS: Likewise. + +2008-11-10 Jim Meyering + + make --help print "Report PROGRAM translation bugs to <...>." + for all but the C/POSIX locale. + * src/system.h: Include "hard-locale.h". + (emit_bug_reporting_address): Tell where to report translation bugs. + + don't include "hard-locale.h", now that system.h does + * src/comm.c: Likewise. + * src/join.c: Likewise. + * src/ls.c: Likewise. + * src/pinky.c: Likewise. + * src/pr.c: Likewise. + * src/sort.c: Likewise. + * src/uniq.c: Likewise. + * src/who.c: Likewise. + + avoid warnings about discarding "qualifiers from pointer target type" + Use the new "bad_cast" function or an actual cast-to-"(char *)" + to avoid warnings. + * src/system.h (bad_cast): Define. + * src/chown.c (main): + * src/chroot.c (main): + * src/date.c (main): + * src/du.c (main): + * src/expand.c (stdin_argv): + * src/ls.c (decode_switches): + * src/md5sum.c (main): + * src/paste.c (main): + * src/pr.c (col_sep_string, column_separator, line_separator, main): + * src/sort.c (main): + * src/split.c (main): + * src/tail.c (main): + * src/unexpand.c (stdin_argv): + * src/yes.c (main): + + avoid a compiler warning + (strip_program): Declare to be const. + + use xfreopen in place of unchecked freopen + * bootstrap.conf (modules): Add xfreopen. + * src/cat.c (main): Include "xfreopen.h". Use xfreopen. + * src/cksum.c (cksum): Likewise. + * src/head.c (head_file, main): Likewise. + * src/md5sum.c (digest_file): Likewise. + * src/od.c (open_next_file): Likewise. + * src/split.c (type_undef): Likewise. + * src/sum.c (bsd_sum_file, sysv_sum_file): Likewise. + * src/tac.c (tac_file, main): Likewise. + * src/tail.c (tail_file, main): Likewise. + * src/tee.c (tee_files): Likewise. + * src/tr.c (main): Likewise. + * src/wc.c (wc_file): Likewise. + * po/POTFILES.in: Add lib/xfreopen.c + + xfreopen: new module + * gl/lib/xfreopen.c: New file. + * gl/lib/xfreopen.h: New file. + * gl/modules/xfreopen: New file. + +2008-11-09 Jim Meyering + + Update URL: s!www.iro.umontreal.ca!translationproject.org/team/...! + * Makefile.am (THANKS-to-translators): Update URL template. + +2008-11-09 James Youngman + + install: indicate clearly it's not for installing packages + * src/install.c (usage): Indicate the program copies files, + as opposed to installing packages. + +2008-11-08 Jim Meyering + + emit more precise bug-reporting instructions + Hoping that this will decrease the volume of bug reports + mistakenly directed to the coreutils mailing list. + * src/system.h (emit_bug_reporting_address): Specify the program + name in the "Report bugs to <...>." line in each program's --help + output and man page. Now, it will say "Report PROGRAM_NAME bugs + to <...>." Suggestion from Ondřej Vašík. + +2008-11-05 Jim Meyering + + include gnulib's strdup module explicitly + * bootstrap.conf (gnulib_modules): Include strdup explicitly, to + keep the latest version of gnulib-tool from omitting this now-marked- + as-obsolete module. + +2008-10-28 Kamil Dudka + + ls: --color now highlights hard linked files, too + * src/ls.c (print_color_indicator): Colorize hard linked files. + * src/dircolors.c: Add color for hard link. + * src/dircolors.hin: Add color for hard link. + * tests/ls/hardlink: Test for ls - colorize hard linked files. + * tests/Makefile.am (TESTS): Add ls/hardlink. + * NEWS: Mention the change. + +2008-10-28 Jim Meyering + + tests: ls/stat-failed: don't discard stderr. + * tests/ls/stat-failed: Let stderr be recorded, to ease debugging. + +2008-10-26 Jim Meyering + + tests: seq: check for today's extended long double fix + * tests/misc/seq-long-double: New file. Test for today's bug fix. + * tests/check.mk (TESTS_ENVIRONMENT): Export CC definition. + * tests/Makefile.am (TESTS): Add misc/seq-long-double. + * NEWS (Bug fixes): Mention it. + +2008-10-26 Paul Eggert + + seq: improve quality of format-checking code + * src/seq.c (validate_format): Remove. Migrate its checks into... + (long_double_format): Report an error and exit if an error is found, + instead of returning NULL. All callers changed. + Use a more-consistent format for diagnostics. + * tests/misc/seq: Adjust to the more-consistent format for diagnostics. + +2008-10-25 Jim Meyering + + factor: avoid compilation failure without libgmp + * src/factor.c (debug) [!HAVE_GMP]: Define. + Reported by Bob Proulx. + +2008-10-25 Paul Eggert + + factor: remove --bignum and --no-bignum options + Here's a patch to remove the --bignum and --no-bignum options from + 'factor'. The case for removing --bignum isn't as strong as that for + 'expr', but still, it seems to me that these options are not needed and + complicate the documentation unnecessarily. + + * doc/coreutils.texi (factor invocation): Remove --bignum, --no-bignum. + * src/factor.c (algorithm, ALGORITHM_CHOICE, USE_BIGNUM, NO_USE_BIGNUM): + Remove; all uses removed. + (extract_factors_multi): Remove, replacing with.... + (print_factors_multi): New function, with signature similar to that + of new signature of print_factors_single. + (print_factors_single): Migrate checking code to caller. + (print_factors): Use GMP if it's available; don't bother asking user. + Improve accuracy of check for "large" numbers. + (long_options, main): Remove support for --bignum. + +2008-10-25 Jim Meyering + + tests: df/total: don't fail for an inaccessible mount point + * tests/df/total: Ignore nonzero exit status from df. + +2008-10-25 Paul Eggert + + seq: revert Solaris 8 work-around that caused x86 regression + * src/seq.c: Don't include , . + (abs_rel_diff): Remove. + (print_numbers): Test for equality, not for an epsilonish value. + This reverts 4827dd27b0c655a685947aaa01426a5ecba179f3, aka + v6.10-185-g4827dd2, which broke 'seq' on the x86; for example, it + causes "seq 9223372036854775807 9223372036854775808" to incorrectly + output 3 numbers instead of 2. It's better to punish obsolescent + hosts that have incorrectly-working floating-point than to punish + correctly-working hosts. + * tests/misc/seq: Use 0.9000000000000, rather than + 0.90000000000000000000, to avoid tickling a bug in Solaris 8 strtold, + which converts "0.9" and "0.9000000000000" correctly, but incorrectly + converts "0.90000000000000000000" to a smaller value. + +2008-10-24 Eric Blake + + group-list: avoid compiler warning + * src/group-list.c (print_group_list) [!HAVE_GETGROUPS]: Always + return value. + +2008-10-23 Jim Meyering + + ls: use '.' (not +) as SELinux-only alt. access flag in ls -l output + * src/ls.c (gobble_file) [long_format]: Map SELinux-only to '.', + any other nonempty combination of MAC and ACL to '+', and all else + to the usual ' '. Suggested by Michael Stone. + * tests/misc/selinux: Adapt: expect '.', not '+'. + * doc/coreutils.texi (What information is listed): Document this. + * NEWS (Changes in behavior): Mention it. + +2008-10-22 Pádraig Brady + + Remove lzma as a specific build requirement + * bootstrap.conf: lzma was added as a build requirement + in the recently added build tools requirements check. + Remove that as it's quite new and also only required + for the make dist stage. + +2008-10-22 Paul Eggert + + * src/ls.c (usage): Describe exit statuses more concisely. + +2008-10-22 Pádraig Brady + + Add better checks and docs for build tools + Prompted by a report from Ed Avis: + + + * README-hacking: Organise LZMA and Valgrind as + as optional requirements rather than in their own sections. + Mention bootstrap will now check tool versions. + * README-prereq: Make a start on specific instructions + for optaining build tools. Currently we just have notes + for Fedora linux. + * bootstrap.conf: Add the list of tools and versions required. + * bootstrap: Add the logic to check for the required tools, + and list all required tools and versions if any are missing. + +2008-10-22 Jim Meyering + + clean up gl/modules/selinux-at + * gl/modules/selinux-at: + Ensure that LIB_SELINUX is cleared, in case it's set in the environment. + m4-quote the first two args to AC_SEARCH_LIBS. + Don't violate autoconf's ac_ namespace: s/ac_save/gl_save/ + Drop the useless double quotes around a simple assignment RHS. + +2008-10-21 Jim Meyering + + move selinux-h module from gl/ to gnulib + * gl/lib/se-context.in.h: Remove file. + * gl/lib/se-selinux.in.h: Likewise. + * gl/m4/selinux-context-h.m4: Likewise. + * gl/m4/selinux-selinux-h.m4: Likewise. + * gl/modules/selinux-h: Likewise. + + prepare to move selinux-h module to gnulib + * gl/modules/selinux-h (Makefile.am) + [selinux/selinux.h, selinux/context.h]: + Remove temporary file and target, in case they're read-only. + Use $(MKDIR_P), not mkdir -p. + (License): Relax to LGPLv2+. + Remove vestigial comments. + + tests: test today's ls-vs-capability fix + Test for this fix: f3f1ccfd871ee395e7fafc051c1b7dedb39fdfc9. + * tests/Makefile.am (TESTS): Add ls/no-cap. + * tests/ls/no-cap: New file. + +2008-10-21 Kamil Dudka + + ls: make it possible to disable file capabilities checking + * ls.c (print_color_indicator): Do not check for file capability + if that attribute is not being colored. + Since 84f6abfe00b4ab533145623638b417a2221f9c75, ls --color would check + each file for "capabilities". In , + James Antill reported that ls --color seemed slower with capabilities + detection. + +2008-10-21 Jim Meyering + + reflect gnulib's removal of lstat.h + * src/copy.h: Don't include "lstat.h". + * src/ls.c: Likewise. + * src/remove.c: Likewise. + * src/rm.c: Likewise. + +2008-10-20 Pádraig Brady + + expr: Fixup authors + * src/expr.c: Standardise the format of AUTHORS to + that used in other utils with multiple authors. + Also add Paul Eggert since he basically rewrote it + with his bignum fixes. + * AUTHORS (expr): Add Paul Eggert. + +2008-10-19 Jim Meyering + + accommodate gnulib header removals + * src/copy.c: Don't include "euidaccess.h" or "lchmod.h". + * src/cp.c: Don't include "lchmod.h". + * src/ls.c: Don't include "dirfd.h". + * src/mkdir.c: Don't include "lchmod.h". + * src/pwd.c: Don't include "dirfd.h". + * src/remove.c: Don't include "dirfd.h" or "euidaccess.h". + * src/test.c: Don't include "euidaccess.h". + * gl/modules/getloadavg.diff: Adjust diff for changed context. + * src/uptime.c (uptime): Remove declaration. + +2008-10-18 Jim Meyering + + * maint.mk (coreutils-path-check): New definition, now run + only if src/true.c exists. Factored out of... + (my-distcheck): ...here. + +2008-10-17 Jim Meyering + + maint: avoid warning in ls.c + * src/ls.c (has_capability) [!HAVE_CAP]: Add unused attribute. + + maint: avoid warnings due to attribute warn_unused_result + Now that a (void) cast no longer suffices to ignore warnings from gcc + about uses of functions marked with the warn_unused_result attribute, + we need an alternative. For the record, here's one of the ignorable + warnings: "copy.c:233: warning: ignoring return value of 'fchown', + declared with attribute warn_unused_result" + * bootstrap.conf (gnulib_modules): Import ignore-value. + * src/copy.c: Include "ignore-value.h". + (set_owner): Use ignore_value in place of "(void)" casts, + to ignore lchown and fchown failures. + * src/cp.c (re_protect): Likewise, to ignore lchown failure. + * src/remove.c (preprocess_dir): Remove unnecessary "(void)" cast. + +2008-10-16 Jim Meyering + + mktemp: diagnose freopen failure + * src/mktemp [--quiet]: Don't ignore freopen failure. + +2008-10-16 Paul Eggert + + * src/mktemp.c (main): Add 'const' twice to avoid GCC warning. + +2008-10-16 Jim Meyering + + build: when po-check fails, say why and suggest a fix + * maint.mk (po-check): Before, when this check failed, it just + spat out a diff mentioning two temporary files. Now, it tells + you what's wrong and suggests a fix with a patch using the name + of the affected file (rather than temporary file names) in the + diff output. + +2008-10-16 Eric Blake + + csplit: prefer sigaction over signal + * bootstrap.conf (gnulib_modules): Import sigaction. + * src/csplit.c (sigprocmask, siginterrupt) [SA_NOCLDSTOP]: Delete + workarounds. + (interrupt_handler, main): Drop use of signal. Rely on sigaction + to block fatal signal during cleanup, and to restore it to default + in case of nested signals. + +2008-10-15 Pádraig Brady + + tests: add option processing tests for 'expr' + * tests/misc/expr: Add tests for various combinations + of options where the first part of the expression + could be confused with an option. + +2008-10-15 Paul Eggert + + expr: remove --bignum and --no-bignum options + * doc/coreutils.texi (expr invocation): Remove the --bignum and + --no-bignum options. They weren't really needed, and they broke + longstanding (albeit nonportable) scripts. + * src/expr.c: Don't include . Include "inttostr.h", + "long-options.h", "verify.h". Check at compile-time that + size_t fits in unsigned long int, as the code assumes this in + several places. + (HAVE_GMP): Define to 0 if not defined, for convenience. + (mpz_t, mpz_clear, mpz_init_set_ui, mpz_init_set_str, mpz_add): + (mpz_sub, mpz_mul, mpz_tdiv_q, mpz_tdiv_r, mpz_get_str, mpz_sgn): + (mpz_fits_ulong_p, mpz_get_ui, mpz_out_str): + Supply substitutes when !HAVE_GMP, which work well enough for + expr's purposes. + (mp_integer): Remove. All integers are gmp, if gmp is available. + (struct valinfo): Remove 'z' member; no longer needed. The 'i' + member is always of type mpz_t. + (enum arithmetic_mode, MP_NEVER, MP_ALWAYS, MP_AUTO, mode): + Remove; no longer needed. + (usage): Remove documentation of --bignum and --no-bignum. + (integer_overflow): Abort if error misbehaves, to pacify GCC. + Restore old message on arithmetic overflow, to be conservative. + (die): Omit exit_status parameter; not needed (is always EXPR_FAILURE). + (string_too_long, USE_BIGNUM, NO_USE_BIGNUM, long_options): + Remove; no longer needed. + (main): Don't use getopt_long; this breaks old nonportable scripts. + (int_value): Arg is unsigned, in case we have strings whose length + exceeds LONG_MAX (!). + (int_value, freev, printv, null, tostring, toarith): + (eval6, eval4, eval3): + Always use mpz_ functions, to simplify the code. + (substr_value): Remove; no longer needed. + (getsize): Simplify the API: one arg rather than 3. Don't assume + unsigned long int fits in size_t. + (promote, domult, dodivide, doadd): Remove; no longer needed. + * tests/misc/expr: Don't use --bignum to test for bignum support. + Instead, use big numbers to test this. + +2008-10-15 Jim Meyering + + expr: don't interpret argv[0] as an operand + * src/expr.c (main): Given a first argument like -22 (negative, with + two or more digits), expr would decrement optind to 0 and then attempt + to evaluate argv[0]. + + doc: cp, mv: remove mention of deprecated --reply= option + * doc/coreutils.texi (cp invocation, mv invocation): Don't mention it. + +2008-10-13 Jim Meyering + + doc: adjust spacing in ls --help output, for better man formatting + * src/ls.c (usage): Adjust spacing so the "Exit status:" list + renders well in the help2man-generated man page. + +2008-10-13 Ondřej Vašík + + doc: ls: clarify exit status description + * src/ls.c (exit_status): Clarify comments. + (usage): Clarify exit status description in --help output. + * doc/coreutils.texi (ls invocation): Clarify exit status documentation + Reported by Greg Metcalfe in . + +2008-10-12 Jim Meyering + + doc: reorder tsort/ptx nodes so body and menu ordering are consistent + * doc/coreutils.texi (tsort invocation, tsort background): Move these + nodes "down", so that they follow the ptx nodes, thus matching the + alphabetized order in the menu. + (tsort background): Make this a subsection. + Suggested by Karl Berry. + + tests: move check-misc targets from src/Makefile.am to maint.mk + * src/Makefile.am (check): Remove check-misc. + (check-misc): Remove target. + * maint.mk (sc_prohibit_stat_st_blocks): New target. + (sc_prohibit_S_IS_definition): New target. + * Makefile.am (EXTRA_DIST): Add .x-sc_prohibit_stat_st_blocks. + * .x-sc_prohibit_stat_st_blocks: New file. + Andreas Schwab reported that "make check" could fail to detect + violation of the no-S_IS*-definition policy. + + tests: df: avoid test failure when using mawk + * tests/df/total-awk: Rewrite to use $PERL, not $AWK. + mawk can't even count above 2^31. Reported by Ed Avis. + http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/14792/focus=14802 + * tests/df/total-verify: Rename from total-awk. + * tests/Makefile.am (TESTS): Reflect renaming. + +2008-10-10 Jim Meyering + + bootstrap: merge from gnulib + +2008-10-07 Ondřej Vašík + + doc: document runcon and chcon in SELinux context section + * doc/coreutils.texi: Document runcon and chcon. + Add minimal SELinux context section. + +2008-10-06 Ondřej Vašík + + chcon: remove traces of unimplemented --change (-c) option + This option was never supported in upstream coreutils. + * chcon.c (usage): Remove --change (-c) from help message. + (main): Remove 'c' from getopt string. + Remove related and now-unused enums. + +2008-10-06 Andreas Dilger + + stat: add lustre filesystem type + * src/stat.c (human_fstype) [S_MAGIC_LUSTRE]: Add case. + Make "stat -f" recognize the "Lustre" filesystem type. + + * NEWS: Mention this feature. + +2008-10-06 Jim Meyering + + remove.c: avoid compile failure on OS/2 + * src/remove.c (dirent_inode_sort_may_be_useful): Guard also with + "#if defined __linux__". Reported by Elbert Pol. + +2008-10-05 Jim Meyering + + post-release administrivia + * NEWS: Add header line for next release. + * .prev-version: Record previous version. + * cfg.mk (old_NEWS_hash): Auto-update. - * src/system.h (ST_BLKSIZE): Ceiling at SIZE_MAX / 8 + 1, not at 4 - MiB, since XFS hosts can legitimately have large values of - st_blksize. Problem reported by Tony Ernst in - . + version 7.0 + * NEWS: Record release date. -2006-10-04 Jim Meyering + * maint.mk (alpha beta major): Add "-a" to git commit ... command. - * src/remove.c (nonexistent_file_errno): Remove ENAMETOOLONG. - Paul Eggert pointed out that the specified file may exist, - in spite of such an errno value. - * tests/rm/Makefile.am (TESTS): Remove ignore-name-too-long. - * tests/rm/ignore-name-too-long: Remove file. - * NEWS: Update here, too. +2008-10-04 Jim Meyering -2006-10-03 Jim Meyering + tests: fix the install/strip-program test + * tests/install/strip-program: Use $PREFERABLY_POSIX_SHELL, + not POSIX_SHELL. The latter may be empty, and would fail + on OpenBSD 3.9. + * tests/check.mk (TESTS_ENVIRONMENT): Propagate + PREFERABLY_POSIX_SHELL to tests. - * tests/rm/fail-eperm: Report failure also if rm is terminated by - a signal. +2008-10-03 Jim Meyering - * src/c99-to-c89.diff: Convert two c99'isms -- one in remove.c - and one in shred.c -- that were added before coreutils-6.3. - Reported by Michael Deutschmann. + timeout.c: don't use perror; exit 125 upon failed fork + * src/timeout.c (main): Use "error", not perror. + Elbert Pol noticed a build failure on OS/2. + * src/timeout.c (main): Exit 125 (not errno) upon failed fork. + Make the failed fork diagnostic match the one from install.c. - * src/c99-to-c89.diff: Update to reflect new offsets. +2008-10-03 Kamil Dudka - * src/remove.c (remove_entry): With -f, exit successfully in spite - of a missing file under some very unusual conditions (with errno - being any of ENOENT, ENOTDIR, ENAMETOOLONG). + ls and sort: use filevercmp instead of strverscmp + * src/ls.c (cmp_version): Use filevercmp instead of strverscmp. + * src/sort.c (usage): Remove mna reference to strverscmp(3). + (compare_version): Use filevercmp instead of strverscmp. + * bootstrap.conf: Add filevercmp to list of gnulib modules. + * tests/misc/sort-version: Remove conflicting string and enhance test. + * NEWS: Mention the change. + +2008-10-02 Jim Meyering - With --force (-f), rm no longer fails for ENOTDIR. - * src/remove.c (ignorable_missing): New function. - Use it everywhere, rather than open-coding the test. - Andreas Schwab reported the ENOTDIR problem. - (ignorable_missing): Similarly, don't fail for ENAMETOOLONG. + tests: skip a root-only test when configured without libcap + * tests/ls/capability: Test for HAVE_CAP definition in config.h. - * NEWS: Mention the bug fix. - * tests/rm/ignorable: New file. Test for the ENOTDIR case. - * tests/rm/ignore-name-too-long: New file. Test for ENAMETOOLONG. - * tests/rm/Makefile.am (TESTS): Add the new file names. +2008-10-02 Eric Blake + + ignore additional built file - * bootstrap: Undo last change to this file, since now gnulib-tool - sticks with the automake default in generating dependencies. + remove.c: allow compilation on cygwin + * src/remove.c (dirent_inode_sort_may_be_useful) + [!HAVE_STRUCT_DIRENT_D_TYPE]: Elide definition when there is no point + in trying to use it. - * NEWS: Add a line for 6.4-cvs. - * configure.ac (AC_INIT): Bump to 6.4 and add "-cvs" suffix. +2008-10-02 Jim Meyering -2006-09-30 Jim Meyering + bootstrap: merge from gnulib + * bootstrap: add submodule support, git-merge-changelog - Version 6.3. - * NEWS: Record the 6.3 release date. - * configure.ac (AC_INIT): Remove "-cvs" suffix from version string. +2008-10-01 Jim Meyering - * NEWS: Mention Paul's Solaris 8 vs. 10 work-around. + remove.c: combine two helper functions, to avoid sign-extension + * src/remove.c (fs_handles_readdir_ordered_dirents_efficiently): + Remove function, so as not to have to worry about the type of + statfs.f_type and sign extension. + (dirent_inode_sort_may_be_useful): Adjust comment. + Perform the switch directly on the struct.member here, instead. + Andreas Schwab spotted the potential for a sign-extension bug, + that happens not to bite for the S_* f_type values currently used. - * src/c99-to-c89.diff: Update offsets. + rm: don't preprocess a directory on a file system of type tmpfs or nfs + The preprocessing phase is not necessary on tmpfs, and induces + a 20% performance decrease when removing a 2M-entry directory. + * src/remove.c (fs_handles_readdir_ordered_dirents_efficiently): + (dirent_inode_sort_may_be_useful): New functions from gnulib/fts.c. + They'll probably become a gnulib module -- eventually. + (preprocess_dir): Use dirent_inode_sort_may_be_useful. -2006-09-29 Paul Eggert + tests: use our new timeout program + * tests/rm/ext3-perf: Also, record set-up duration and FS type. - * tests/rm/readdir-bug: Don't use $(...) in a shell script, - as it doesn't work with Solaris /bin/sh. +2008-09-29 Ralf Wildenhues -2006-09-29 Jim Meyering + fix make variable quotation error + * tests/check.mk (TESTS_ENVIRONMENT): Quote shell variable + $tmp__, fix expansion. - * NEWS: Mention Paul's fix (to gnulib's canon-host.c) for - the pinky segfault. +2008-09-29 Jim Meyering - * tests/seq/basic [neg-2, eq-wid-2]: Comment out tests that - use .1 as the increment. Actual output varies too much. - [eq-wid-3]: New, commented out test. + seq: solve e13188e7ef7bbd609c1586332a335b4194b881aa more cleanly + * src/seq.c (print_numbers): Don't switch c_strtold -> strtold + in order to accommodate the locale-dependent behavior of our internal + asprintf use. Instead, simply set the locale to C before calling + asprintf, and then set it back afterwards. - * src/shuf.c (read_input): Fix an off-by-one error that - would cause an infloop for piped input of 8KB or more. - * NEWS: Mention the fix. - * tests/misc/shuf: Test for the above fix. +2008-09-28 Jim Meyering - Since any system may be affected by the Darwin readdir bug, - perform the extra rewinddir unconditionally. The performance - impact of rewinding a directory is negligible. - * src/remove.c (NEED_REWIND): Define to use - CONSECUTIVE_READDIR_UNLINK_THRESHOLD unconditionally. + build: avoid spurious valgrind warning about uses of touch + * .vg-suppressions (utimensat-NULL): Avoid bogus valgrind warning + that appears on at least Fedora 9. - * tests/seq/basic: Use .11 as the upper bound, in case the ".1" - increment translates to a slightly larger value. - This corrects a test failure on FreeBSD 6.1 reported by Nelson Beebe. - The final expected value wasn't being printed. + mktemp: plug an inconsequential leak + * src/mktemp.c (main) [lint]: Free template. - Work around a readdir bug in Darwin 7.9.0 (MacOS X 10.3.9) on HFS+ - and NFS, whereby rm would not remove all files in a directory. - * src/remove.c (CONSECUTIVE_READDIR_UNLINK_THRESHOLD): Reduce to 10. - (NEED_REWIND): New macro, so that we incur the cost of the work-around - rewinddir only on afflicted systems. - * NEWS: Clarify and correct. - * tests/rm/readdir-bug: New file. Test for the above fix. - * tests/rm/Makefile.am (TESTS): Add it. - Prompted by testing and analysis from Bruno Haible: - http://lists.gnu.org/archive/html/bug-coreutils/2006-09/msg00326.html + THANKS: add Erik Auerswald -2006-09-28 Paul Eggert +2008-09-28 Eric Blake - * tests/rm/fail-eperm: Unset BASH_ENV, CDPATH, and ENV, too; - suggested for Debian stable, which uses Perl 5.8.4. + remove.c: avoid compiler warning + * src/remove.c (compare_ino, dirent_count) + [!HAVE_STRUCT_DIRENT_D_TYPE]: Mask declaration when unused. -2006-09-28 Jim Meyering +2008-09-27 Jim Meyering - Automatically generated dependencies are important even - when all of the sources in a directory come from gnulib. - * bootstrap (gnulib_tool): Remove the "no-dependencies" automake - option that gnulib-tool adds to what becomes our lib/gnulib.mk. + rm -r: avoid O(n^2) performance for a directory with very many entries + This enhancement works around a problem that is specific to at least + ext3 and ext4 file systems. With them, it would take hours to remove + a two-million-entry directory. RAM-backed file systems (tmpfs) are + not affected, since there is no seek penalty. + * remove.c (rm_malloc, rm_free, compare_ino): New functions. + (dirent_count, preprocess_dir): New function. + [struct readdir_data]: New struct. + (remove_cwd_entries): Call preprocess_dir. + * tests/rm/ext3-perf: New file. Test for the performance fix. + * NEWS: mention the new feature - * tests/rm/fail-eperm: Enable Perl's (-T) taint checking. - Ensure that IFS is set properly and unset PATH. - Sanitize inputs. - Work properly even when the name of the selected file starts with "-". - Invoke rm via "../../src/rm", and adjust expected output. - Prompted by a patch from Tim Waugh. + remove.c: don't use xmalloc; don't let obstack call exit on failure + (obstack_chunk_alloc, obstack_chunk_free): Don't define. + (top_dir): Param is no longer "const". + Use malloc, not xmalloc, and call longjmp upon failed malloc. + (obstack_init_minimal): New function. + (ds_init): Don't use xmalloc. Instead, use caller-supplied buffer. + Use obstack_specify_allocation_with_arg, not obstack_init, so + that we control what happens upon allocation failure. + Arrange for ds_free not to free uninitialized if/when + any obstack_specify_allocation_with_arg allocation fails. + (ds_free): Don't free DS, now that it's no longer malloc'd. + (rm): Allocate DS on the stack. + Arrange to handle ds_init allocation failure. - * README-cvs: Add Bison to the list of required packages. + step1 -2006-09-26 Jim Meyering + * maint.mk (my-distcheck): remove duplicate c99-related test code - * src/c99-to-c89.diff: Update offsets. + maint: allow more C99 constructs; stop maintaining c99-to-c89 patch set + * cfg.mk (local-checks-to-skip): Add patch-check. + With the recent changes to remove.c, I no longer wish + to maintain the c99-to-c89 patch set. - * NEWS: rm works around a bug in Darwin 8.6.1 w/NFS that kept - it from removing a directory containing 188 or more entries. - * src/remove.c (CONSECUTIVE_READDIR_UNLINK_THRESHOLD): Decrease by - 20, go work around the buggy readdir on Darwin 8.6.1 with NFS. - Reported by Matthew Woehlke. +2008-09-26 Jim Meyering -2006-09-26 Paul Eggert + seq -0.1 0.1 2: print final number when locale's decimal point is "," + * src/seq.c (print_numbers): Use strtold, not c_strtold to convert + from just-formatted-using-asprintf string back to double, since + asprintf may have used something other than "." as the decimal point. + Reported by lsof@nodata.co.uk as . + Thanks to Ondřej Vašík for discovering that the bug was locale-related. - * NEWS: "groups user" no longer outputs "user :"; you need at least - two users. "groups" now processes options like --help more compatibly. - * src/groups.sh: Implement the option-processing change. - Handle user and group names with special characters more robustly. - Report write errors instead of exiting silently with status 1. + $ LC_ALL=cs_CZ.UTF-8 seq -0.1 0.1 2|grep 2.0 + [Exit 1] + $ seq -0.1 0.1 2|grep 2.0 + 2.0 -2006-09-26 Jim Meyering + * tests/check.mk (TESTS_ENVIRONMENT): Add LOCALE_FR_UTF8, for... + * tests/misc/seq [locale-dec-pt]: New test for the above. + * NEWS (bug fix): Mention it. - * README: Warn not to run autoreconf manually. Use bootstrap instead. + maint: relax a check so "make distcheck" succeeds again + * maint.mk (makefile-check): Relax the check, in order to exempt + the necessary use of a sole @...@-delimited Makefile.am variable. - * src/groups.sh: When invoked with 0 or 1 argument, just exec "id". - Rewrite to avoid using temporary, $status. +2008-09-24 Jim Meyering - * NEWS: Mention the bug fix. - * src/groups.sh: Don't hide a write failure. - Reported by Iain Calder . + maint: avoid using find -name Makefile.am; could get false positives + * maint.mk (makefile-check): Instead, search for the offending + @...@ construct only in version-controlled files. -2006-09-25 Jim Meyering +2008-09-24 Benno Schulenberg - * src/chown.c (usage): Clarify --dereference description. - * src/chgrp.c (usage): Likewise. Suggestion from Jamie McClelland. + pinky: gettextize two missed strings + Additionally differentiate the strings for unknown idle time and + unknown real name so they can be translated differently. -2006-09-24 Jim Meyering +2008-09-24 Jim Meyering - * NEWS: Mention these fixes. - * src/copy.c (copy_reg): With --verbose (-v), print - "removed `file_name'" just after unlinking a file. - (copy_internal): Likewise, in three more places. - Marc Lehman reported that "touch x; ln x y; mv -v x y" was silent. - * tests/mv/hard-verbose: New file. Test for the above fix. - * tests/mv/Makefile.am (TESTS): Add hard-verbose. + cp.c: adjust a comment to make it consistent with documentation + '-a' is equivalent to -dpR, so s/-dpPR/-dpR/; the -P is redundant, + since -d already implies -P, and both --help and "info cp" say -dpR: + Corresponding doc changes: 080ac7785071c7f135711a39e57c71d9057d9bd7 + b7c2db676635518c06add0dd570543ae83e21f2e. - * tests/help-version (sync_args): Don't call sync, since it spins up - disks that I've deliberately caused to spin down (but not unmounted). +2008-09-22 Ralf Wildenhues - * NEWS: Mention the improvement to sort. + fix installation with ./ginstall in src + * src/Makefile.am (cu_install_program): New variable, set to + either ./ginstall or @INSTALL_PROGRAM@ (for cross compilation). + (INSTALL_PROGRAM): Override AC_SUBST unconditionally, to avoid + warning, and wrong initialization order. - * tests/tail-2/proc-ksyms: Require that /proc/ksyms be readable - as well as existing. +2008-09-22 Benno Schulenberg - * tests/ls/stat-dtype: Don't use tmpfs on linux-2.4 or older, - since that predated addition of d_type support. + doc: alphabetize 'who's option descriptions + * doc/coreutils.texi (who invocation): Alphabetize. -2006-09-23 Jim Meyering +2008-09-19 Benno Schulenberg - * gl/modules/getloadavg.diff: New file. Work around the way the latest - version of the getloadavg module interacts with our bootstrap script. - * bootstrap (gnulib_tool_options): Add "--local-dir gl". - * Makefile.am (EXTRA_DIST): Sort file names. - Add bootstrap and gl/modules/getloadavg.diff + who --help: add a general description -2006-09-20 Paul Eggert + uptime --help: put together message parts that belong together - * bootstrap: Add support for --force. - (usage): New function. Describe usage less tersely. - (CVS_only_file): New var. + tr --help: gettextize a single paragraph as a single string + Breaking a paragraph into several strings is awkward for translators. - * NEWS: Document fix for cp -i and mv -i. - * src/copy.c (copy_internal): With -i, prompt even if the source - is a directory and the destination is not. This is required by - POSIX and gives the user a chance to bail out before failing. - * tests/cp/Makefile.am (TESTS): Add cp-i. - * tests/cp/cp-i: New file. - * tests/mv/Makefile.am (TESTS): Add i-5. - * tests/mv/i-5: New file. + tail: gettextize the string, "standard input" -2006-09-20 Jim Meyering + tail --help: move the --retry entry into alphabetical order + * src/tail.c (usage): Also simplify --retry description, split a + long string in two, remove a stray period, and add the usual indent. - * NEWS: Mention the chmod bug fix. + shred --help: lowercase a stray capital - * tests/chmod/inaccessible: New test, specifically for this bug. - Based on a test case from Paul Eggert. - * tests/chmod/Makefile.am (TESTS): Add inaccessible. + stty --help: correct the alignment of an entry + * src/stty.c (usage): Also remove a stray period, and ungettextize + a debugging message. - Fix the 2006-09-18 bug differently. - * src/chmod.c: (process_file): Upon FTS_NS for a top-level file, - tell fts_read to stat the file again, in case it has become - accessible since the initial fts_open call. - * src/chown-core.c (change_file_owner): Likewise. + sort --help: sort the options better alphabetically + Take the opportunity to split the long message into three parts. - * src/chmod.c: Revert last change. There is a better way. - * src/chown-core.c: Likewise. + rmdir --help: use lower case in option description; adjust indentation -2006-09-19 Paul Eggert + remove.c: move comment to right before string, so gettext will pick it up - * src/ln.c (target_directory_operand): Rewrite to avoid porting - problem on Tandem reported by Matthew Woehlke in - . + pr --help: elide arguments after short options that allow a space + * src/pr.c (usage): Also, put the -S option with its description. -2006-09-18 Paul Eggert + od: ungettextize debugging messages - Fix bug where chmod, chown, and chgrp did not process operands - left-to-right in some cases. - * src/chmod.c (wd_errno): New var. - (chmod_file): New function, with most of the contents of the - old prcess_file function. - (process_files): Use it. This gives file names to fts one - at a time, so that they are processed left-to-right as POSIX - requires. - * src/chown-core.c (wd_errno, chown_files): Likewise. - (chown_file): New function. - * tests/install/basic-1: Redo test so as to not workaround - the chmod bug, thereby testing for it. + nohup, remove, tr: also gettextize the alternative messages - * src/shuf.c (main): Quote the entire range when reporting an - invalid one, rather than just the part that contained the error. + od --help: avoid concatening two messages without a newline + src/od.c (usage): Better: make them into two separate paragraphs. - * tests/stty/row-col-1: Rewrite to avoid temporary file that is - sometimes left behind if the test is skipped or interrupted. + mkfifo, mknod --help: put -Z option in its alphabetical position + Options are normally sorted by their short form, not their long form. + Also line up their descriptions. - * bootstrap (symlink_to_gnulib): New function. - (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib - to copies-of-gnulib. - (cp_mark_as_generated, slurp, gnulib_files): - Avoid making a copy if it's the same as the old version. - (gnulib_files): Add support for this variable (used by Bison). +2008-09-19 Jim Meyering - * tests/ls/stat-vs-dirent: Fix quoting problem in diagnostic - indicating flaw in kernel. Reword to say that the flaw isn't - serious for coreutils, since the flaw does affect ls -i. + doc: coreutils.texi (csplit invocation): Add an example. - * tests/chgrp/basic: Fix bug in test case exposed by building on - Solaris 8 in a setgid directory. The test case incorrectly - assumed that 'symlink' would be in group $g1. +2008-09-14 Ralf Wildenhues -2006-09-18 Jim Meyering + various VPATH-related fixes + * maint.mk (VC_LIST): Prepend '$(srcdir)/'. + (patch-check): Fix to make it work with a VPATH build. + * src/Makefile.am (sc_tight_scope): Likewise. + * man/Makefile.am (.x.1): Do not make outputs unwritable. - * NEWS: Add a line for 6.3-cvs. - * configure.ac (AC_INIT): Bump to 6.3 and add "-cvs" suffix. +2008-09-14 Jim Meyering - Version 6.2. - * NEWS: Record the 6.2 release date. - * configure.ac (AC_INIT): Remove "-cvs" suffix from version string. + stat: remove obsolete and undocumented option, --filesystem + * src/stat.c: Remove obsolete and undocumented --filesystem. -2006-09-17 Jim Meyering - - * tests/chgrp/basic: On an OpenBSD system, rather than failing - due to a known problem, merely warn about it. - Rewrite to avoid testing output of chgrp --verbose and chgrp -c. - Instead, use stat to test file system for desired results, directly. - * tests/chgrp/Makefile.am (TESTS_ENVIRONMENT): Set host_triplet. - - * tests/envvar-check: Add more variable names to the list of those - that can affect these programs and tests: _POSIX2_VERSION, COLUMNS, - QUOTING_STYLE, TABSIZE, TERM, TMPDIR. - -2006-09-16 Paul Eggert - - * NEWS: Document that mkdir -p and install -d now fork on occasion. - * bootstrap.conf (gnulib_modules): Add savewd. - * src/install.c: Include savewd.h. - (process_dir): New function. - (main, install_file_in_file_parents): Use it, along with the new - savewd module, to avoid some race conditions. - * src/mkdir.c: Include savewd.h. - (struct mkdir_options): New members make_ancestor_function, mode, - mode_bits. - (make_ancestor): Return 1 if the resulting directory is not readable. - (process_dir): New function. - (main): Use it, along with new savewd module, to avoid some - race conditions. Fill in new slots of struct mkdir_options, so - that callees get the values. - * tests/install/basic-1: Test for coreutils 5.97 bug that was - fixed in coreutils 6.0, and which should still be fixed with - this change. - * tests/mkdir/p-3: Likewise. - -2006-09-15 Jim Meyering - - * bootstrap.conf (gnulib_modules): Add rename-dest-slash. - The 2006-09-08 changes made it so "mv dir new-name/" would - fail on NetBSD 1.6. This makes it work once again. - -2006-09-14 Jim Meyering - - * src/mv.c (main): Remove unnecessary (always-true) test for 2 <= n. - Instead, since it's a little fragile, assert the condition. - (target_directory_operand): Update comment to reflect latest change. - -2006-09-12 Paul Eggert - - * src/who.c (print_user): Rewrite to avoid warning from - GCC 4.1.1 with -Wall. - -2006-09-12 Jim Meyering - - * tests/mv/atomic: Check for specific strace output, rather than - simply nonempty. RHEL AS 4 would fail this test due to strace - generating "[ Process PID=14434 runs in 32 bit mode. ]". - Reported by Nelson Beebe. +2008-09-13 Jim Meyering -2006-09-11 Jim Meyering - - * src/remove.c (remove_dir): Move new cache_stat_init call onto - it's own line. - (rm_1): Move declaration of "st" and new cache_stat_init call - "down" to nearer where they're used. - * src/c99-to-c89.diff: Add another set of curly braces. + tests: reenable disabled test, now that automake can handle it + This reverts the change in ae1c205fc473589d028ef63785926263843555cd. -2006-09-10 Paul Eggert +2008-09-11 Jim Meyering - * src/expr.c (eval6): Fix buffer overrun, or bad performance, if - substr's last operand is very large. Performance problem reported - by Sebastian Kreft. + tests: temporarily disable part of "make distcheck" + * maint.mk (install-transform-check): Temporarily disable. -2006-09-09 Jim Meyering + tweak wording and check to avoid failure + * doc/coreutils.texi (printf invocation): Tweak wording. + * doc/Makefile.am (check-texinfo): Allow "search path". - * Makefile.maint (sc_prohibit_jm_in_m4): Don't hang when there - are no .m4 files. - (sc_require_config_h): Skip this test if there are no version- - controlled .c files. - (sc_prohibit_assert_without_use): Likewise. +2008-09-10 Jim Meyering -2006-09-08 Jim Meyering + doc: mention which commands may be built-in functions + * doc/coreutils.texi (mayConflictWithShellBuiltIn): New macro. + (mknod invocation, stat invocation, echo invocation) + (printf invocation, test invocation, pwd invocation) + (nice invocation, kill invocation, sleep invocation): Use it. + (printf invocation): Invoke via "env" rather than using a + literal /usr/local/bin/ prefix in examples. - * bootstrap: Export CVS_RSH separate from its assignment, to work - even with Solaris 10's /bin/sh. Suggestion from Mark D. Baushke. +2008-09-10 Ralf Wildenhues -2006-09-08 Paul Eggert + simplify installation rules, using new Automake + This relies on development Automake to provide multi-file + installation, and avoids relying on undocumented Automake + interfaces. It also removes special-casing for `['. + * configure.ac (AM_INIT_AUTOMAKE): Depend on 1.10a. + (CROSS_COMPILING): New Automake conditional. + * src/Makefile.am (install-exec-am, filtered_PROGS) + (d_bindir, cu-install-binPROGRAMS): Remove. + (INSTALL_PROGRAM) [!CROSS_COMPILING]: Set to `./ginstall'. - * NEWS: tail now ignores the -f option if POSIXLY_CORRECT is set, - no file operand is given, and standard input is any FIFO. - This is in response to Open Group XCU ERN 114. - * src/tail.c (main): Likewise. + fix minor shell issues in test suite + * tests/misc/help-version: Fix bad quoting. + * tests/cp/same-file: Fix unportable shell quoting. + * tests/mv/part-symlink: Likewise. -2006-09-08 Jim Meyering +2008-09-10 Jim Meyering - mv and "cp -r" no longer fail when invoked with two arguments - where the first one names a directory and the second name ends in - a slash and doesn't exist. E.g., "mv dir B/", for nonexistent B, - now succeeds, once more. This reverts part of the 2004-06-27 - change for 5.3.0. - * NEWS: Say the above. - * src/mv.c (target_directory_operand): Don't require (here) - that the target operand "look like" a directory. This change - pushes the test down to the rename syscall level, where a - "mv dir existing-non-dir/" will mistakenly succeed on older systems - that ignore trailing slashes in the rename destination argument. - * src/cp.c (target_directory_operand): Likewise, but for cp. - * tests/mv/trailing-slash: Exercise the above fixes. - * tests/cp/trailing-slash: New file. - * tests/cp/Makefile.am (EXTRA_DIST): Add trailing-slash. + tests: don't use "local" in bourne shell scripts + * tests/test-lib.sh (remove_tmp_, skip_if_mcstransd_is_running_): + Avoid failure on Solaris 11, since their /bin/sh passes the tests + in posix-shell.m4, yet does not support "local" (which is not POSIX). - * bootstrap: Use the previously unused variable, $src, - to avoid repeating "$GNULIB_SRCDIR/$file". + tests: use "Exit $fail", not (exit $fail); exit $fail + * tests/test-lib.sh (Exit): New function by Ralf Wildenhues in automake + http://git.sv.gnu.org/gitweb/?p=automake.git;a=commitdiff;h=20594c08f63 + * tests/**: Convert all uses: - * bootstrap (cp_mark_as_generated): Don't use "local", to - accommodate ancient "/bin/sh". Suggested by Ralf Wildenhues. - Rename now-global "$src" and "$dst" to have cp_ prefix. - Safer, and avoids confusion. + This restrictive change converted the vast majority: - * bootstrap (cp_mark_as_generated): New function. - (slurp): Use it to prepend editor hints and a warning that - the file we're copying is generated. - Suggestion from Bruce Korb. - (cp_mark_as_generated): Don't add C-style comments for .l or .y files. - Fix last-minute typo. + git grep -l '^(exit \$fail); exit \$fail$' \ + | xargs perl -pi -e 's/'^\(exit \$fail\); exit \$fail$/Exit \$fail/' + + And this did the rest, plus a few undesirable ones, so I manually + backed out the changes to ChangeLog-* and build-aux/check.mk: + + git grep -l -E '\(exit [^)]+\); exit ' \ + | xargs perl -pi -e 's/\(exit (.+?)\); exit \1/Exit $1/' + +2008-09-08 Jim Meyering + + tests: move input-tty into a test-lib.sh function + * tests/test-lib.sh (require_controlling_input_terminal_): New function, from + * tests/input-tty: ...here. Remove file. + * tests/Makefile.am (EXTRA_DIST): Remove input-tty. + * tests/mv/i-3: Use the function, not the file. + * tests/misc/stty: Likewise. + * tests/misc/stty-row-col: Likewise. + * tests/misc/stty-invalid: Likewise. + +2008-09-07 Jim Meyering + + tests: work around Solaris 11 bug + * tests/misc/printf-surprise: Accept bogus prefix on stderr output. + + tests: don't let rounding-to-1KB blocks provoke a failure + * tests/df/total-awk: Use df's --block-size=512 option. + + tests: don't fail due to built-in sleep from Solaris 11's /bin/sh + * tests/misc/help-version (id_args): Invoke via env to ensure we + run the just-built version of sleep. + +2008-09-06 Kamil Dudka + + install: new option: --strip-program, + ...to specify the program used to strip binaries + * src/install.c (main): Handle new option --strip-program. + (strip): Use strip program from global variable strip_program. + (usage): Mention new option --strip-program in --help. + * tests/tests/strip-program: Test case for new option --strip-program. + * tests/Makefile.am: Add new test case to test set. + * doc/coreutils.texi: Mention new option --strip-program. + * NEWS: Mention the change. + * TODO: Remove completed task. + +2008-09-03 Kamil Dudka + + df: new option: --total to print grand totals + * src/df.c (add_uint_with_neg_flag): New function to add two integral + values with separate negation flag. + (show_dev): New parameter force_fsu to display numbers directly. Collect + summary statistics on each printed device. + (usage): Mention new option --total in --help. + (main): Initialize summary on program start. Handle new option --total. + * tests/df/total: Dummy test case for new --total option. + * tests/df/total-awk: Better test case for new --total option (requires + awk). + * doc/coreutils.texi: Mention new parameter --total. + * NEWS: Mention the change. + * TODO: Removed completed task. + +2008-09-03 Jim Meyering + + TODO: add an item for a chmod optimization + +2008-08-31 Jerry Snitselaar + + env, groups: remove duplicate inclusion of + * src/env.c: Remove redundant #include. + * src/groups.c: Likewise. + Tiny change. + +2008-08-26 Jim Meyering + + generate version.c and version.h + * src/Makefile.am (version.c, version.h): New rules. Generate. + (nodist_libver_a_SOURCES): Define + * .gitignore: Add src/version.c and src/version.h. + (DISTCLEANFILES): Add version.c and version.h. + + use new global, "Version", rather than macro, VERSION + With this change, a version-string update no longer + forces recompilation of 100+ src/*.o files. + * src/version.c (Version): New global. New file. + * src/version.h: Declare it. + * src/Makefile.am: Put it in a library that everyone links to. + (noinst_LIBRARIES, libver_a_SOURCES): Define. + (LDADD): Add libver.a. + (sc_tight_scope): Use perl (was sed), and a more relaxed regexp + to build the global-variable-name-recognizing regexp list. + * src/system.h: Include "version.h". + (case_GETOPT_VERSION_CHAR): Use Version rather than VERSION. + * src/basename.c (main): Use Version rather than VERSION. + * src/chroot.c (main): Likewise. + * src/cksum.c (main): Likewise. + * src/dd.c (main): Likewise. + * src/dirname.c (main): Likewise. + * src/echo.c (main): Likewise. + * src/hostid.c (main): Likewise. + * src/hostname.c (main): Likewise. + * src/link.c (main): Likewise. + * src/logname.c (main): Likewise. + * src/nice.c (main): Likewise. + * src/nohup.c (main): Likewise. + * src/printenv.c (main): Likewise. + * src/printf.c (main): Likewise. + * src/pwd.c (main): Likewise. + * src/setuidgid.c (main): Likewise. + * src/sleep.c (main): Likewise. + * src/sync.c (main): Likewise. + * src/test.c (main): Likewise. + * src/timeout.c (main): Likewise. + * src/true.c (main): Likewise. + * src/tsort.c (main): Likewise. + * src/unlink.c (main): Likewise. + * src/uptime.c (main): Likewise. + * src/users.c (main): Likewise. + * src/whoami.c (main): Likewise. + * src/yes.c (main): Likewise. + + bootstrap: preserve permissions of more copied files + * bootstrap (cp_mark_as_generated): Preserve perms of copied files. + Remove a kludge, now that this is fixed. + +2008-08-23 Bruno Haible + + doc: clarify wc -L documentation + * doc/coreutils.texi (wc invocation): Explain what the -L option + measures. + +2008-08-20 Eric Blake + + ls: adjust to gnulib change + * src/ls.c (includes): "strverscmp.h" no longer exists. + +2008-08-19 Eric Blake + + .gitignore: ignore more files + * .gitignore: Ignore directories created by gnulib. + + .gitattributes: generalize + * .gitattributes: Relax the glob pattern, so it matches *.texinfo, too. + Suggest a POSIX BRE, rather than one that uses the GNU extension, \\+. + + sort: improve usage wording + * src/sort.c (usage): Mention that -k defaults to end of line if + POS2 omitted. + * THANKS: Update. + Reported by Tim Ryan. + +2008-08-15 Jim Meyering + + adjust + +2008-08-15 Bruce Korb + + sort: new option, --sort=version, for version number ordering + * src/sort.c [struct keyfield] (version): New member. + (usage): Describe --version-sort. + (sort_options): Add 'V'. + (long_options): Add "version-sort". + (CHECK_TABLE, _ct_, SORT_TABLE, _st_): Define new macros. + (check_args, sort_args, sort_types): Use these new macros in declarations. + (ARGMATCH_VERIFY): Remove use. No longer needed. + (compare_version): New function. + (key_compare): Add a case. + (check_ordering_compatibility): Handle new type. + (main): Likewise. Reformat two expressions for readability. + * tests/misc/sort-version: new test file + * tests/Makefile.am: add it to the list + * doc/coreutils.texi (sort invocation): Document it. + * NEWS: Mention the new feature. + +2008-08-14 Jim Meyering + + set envvars via "env" to avoid spurious set -x output from bad shells + * tests/dd/misc: Set LC_ALL=C via env. + * tests/cp/thru-dangling: Set POSIXLY_CORRECT via env. + This is necessary at least on AIX 5.3. + Reported by Jeph Cowan and Ralf Wildenhues. Details here: + http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/14235/focus=14257 + + "expr --bignum 1" now fails when expr is built without libgmp + * src/expr.c (main): When --bignum is requested, yet expr was built + without libgmp, exit nonzero (3) in addition to giving a diagnostic. + + mktemp, sort, tac: don't use undefined after mkstemp failure + When mkstemp fails, the template buffer may have undefined + contents, so we must not print it. + * src/sort.c (create_temp_file): Use temp_dir, not "file" + when diagnosing failed mkstemp, because "file" may be undefined. + * tests/misc/sort-merge: Adjust for new expected output. + Jeph Cowan and Ralf Wildenhues reported the test failure: + http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/14235/focus=14257 + * src/tac.c (copy_to_temp): Don't use template buffer after + failed mkstemp call, since its contents may be undefined. + * tests/misc/tac (pipe-bad-tmpdir): New test for the above. + * src/mktemp.c (main): Save a copy of the template string, + solely for use in case mkstemp fails. + * tests/misc/mktemp (pipe-bad-tmpdir): New test for the above. + +2008-08-12 Benno Schulenberg + + kill: micro grammar nit in description of SIGNAL + + groups: let synopsis show that the command allows multiple usernames + Also make the docstring say so. + + id: remove superfluous condition test; it is caught at -Z above + + id: gettextize a few missed tiny strings + + fmt: remove the 'no file' sentence; the standard phrase is given below + Replace the sentence with a more useful explanation of -DIGITS. + +2008-08-11 Benno Schulenberg + + echo: correct description of \c + * src/echo.c (usage): Correct description of \c. + * coreutils.texi (echo invocation): Likewise. + * src/echo.c: Remove --help-duplicating comment. + + doc: the quote operator for expr is '+', not 'quote' + + factor: remove duplicate docstring; use the more detailed one + + echo: gettextize the alternative option description too + + dd: clarify meaning of multiplication factors; put xM in order + + doc: remove stray word from date's field width description + + date: remove confusing and unneeded sentence from --help + It makes it unclear what 'sequences' refers to, + and the -u option already says enough. + + printenv: say what it does when variables are specified + + doc: put the exitstatus paragraph in a better place + * doc/coreutils.texi (tsort invocation): move two lines + + cp: move a newline to make second message identical to others + + who: Gettextize two forgotten strings + +2008-08-10 Jim Meyering + + sort: remove unnecessary declaration of strtod + * src/sort.c (STDC_HEADERS): Remove declaration of strtod. + + sort: avoid erroneous cast + * src/sort.c (OPEN_MAX): Define if not already defined. + (MAX_NMERGE): Remove definition. + (specify_nmerge): Don't cast MAX_NMERGE (of type size_t) to unsigned int. + Instead, use OPEN_MAX as the fall-back value. + + sort: don't print uninitialized in diagnostic + * src/sort.c (specify_nmerge): Do use uinttostr value. + Provoke with e.g., sort -m --batch-size=18446744073709551617 + Omit quotes around known-numeric value in diagnostic. + * tests/misc/sort-merge [nmerge-big]: Tighten ERR_SUBST regexp + to require a numeric value in that diagnostic, so this particular + failure cannot reappear. + +2008-08-09 Jim Meyering + + * .gitattributes: Better diff output for texinfo sources. + + dd.c: reduce duplication in new O_FULLBLOCK-defining code + * src/dd.c (MULTIPLE_BITS_SET): New macro, extracted from... + (multiple_bits_set): ...this function. + Use a single-line, and far simpler expression (no need to list all + O_* symbols again) to validate the derived O_FULLBLOCK value. + + * coreutils.texi (factor invocation, expr invocation): Adjust wording. + + expr: avoid compiler warnings + * src/expr.c (die): New "noreturn" function to wrap one-arg use of + error + (string_too_long): Use die rather than error. + (toint): Remove definition of now-unused function. + (eval6): Remove a little duplication. + Use die rather than error. + (dodivide): Remove declaration of now-unused variable. + + * tests/misc/expr: Add tests of the new GMP-based code. + +2008-08-06 James Youngman + + expr: support arbitrary-precision arithmetic + * src/Makefile.am (expr_LDADD): Link expr against GNU MP. + * doc/coreutils.texi (expr invocation): Describe --bignum, + --no-bignum. Explain the new arbitrary-precision functionality. + * NEWS: Indicate that arbitrary-precision arithmetic is now + supported in expr. + * src/expr.c (enum valtype): Added mp_integer, signifying a GNU MP + number. + (usage): Document the new options --bignum and --no-bignum which + force and prohibit the use of arbitrary-precision arithmetic, + respectively. + (long_options): data structure for getopt_long, which we need to + use to parse the options mentioned above. + (main): parse these options with getopt_long instead of + parse_long_options. + (valinfo): Downgrade the numeric member of the union from + intmax_t to signed long, since MP lacks functions for promoting an + intmax_t to an arbitrary-precision quantity. + (enum arithmetic_mode): Represents the current choice between + --bignum, --no-bignum and the default (automatically switch from + one to the other if needed). + (integer_overflow): issue a more explicit error message indicating + that MP is not available. + (string_too_long): new function, emits a fatal error message for + the case where an argument to the 'index' expression is too long + for a string offset to be represented. + (int_value): With --bignum, create the value as mp_integer rather + than plain integer. + (substr_value): factored out of eval6; implements "substr". + (freev): also destroy mp_integer values. Check that no mp_integer + values exist if --no-bignum was specified. + (printv, null, tostring): support mp_integer. + (toint): new funtion for converting from string or mp_integer to + integer. + (getsize): extracts a size_t value from a VALUE object; used to + implement substr. + (promote): promotes a value from integer to mp_integer. + (domult, dodivide): functions for multiplication and division, + factored out of eval4. + (doadd): addition/subraction function, factpred out of eval3. + (eval3): support mp_integer types; call doadd. + (eval4): support mp_integer types; call domult, dodivide. + (eval6): support mp_integer offsets and lengths for "substr" and + "index". + * TODO: Mention that expr supports arbitrary-precision arithmetic, + and suggest that this might also be a good idea for seq. + * AUTHORS (expr): Add James Youngman. + + doc: mv,cp: undocument the --reply option + * doc/coreutils.texi (mv invocation): Remove documentation for mv --reply. + (cp invocation): Likewise. + * NEWS: mention this. + + document the supported baud rates beyond 38400 + * doc/coreutils.texi (Special): Document the supported baud rates + beyond 38400. + +2008-08-05 John David Anglin + + ls: ignore spurious getfilecon failure due to lack of SELinux support + * src/ls.c (gobble_file): Upon failed getfilecon, treat an errno value + of EOPNOTSUPP just like ENOTSUP. See . + +2008-08-05 James Youngman + + Document uptime. + * doc/coreutils.texi (uptime invocation): document uptime. + * TODO: uptime is documented now. + * src/uptime.c (print_uptime): Use fprintftime to print the time, rather + than printf. This should make the situation better for translations. + +2008-08-04 Benno Schulenberg + + doc: correct and normalize --help output of several tools + * src/chroot.c (usage): Add "[ARG]" to synopsis. + * src/cut.c (usage): Remove an inconsistent period in an option + description. + * src/du.c (usage): Remove superfluous argument after short option -X. + Also remove inconsistent uppercase and final period. + Use a single indent level for prettiness. + * src/shred.c (usage): Normalize the synopsis. + * src/stty.c (usage): Options -F and --file are alternatives, cannot + both be used. + * src/sum.c (usage): -r does not overrule -s; the last one counts. + * src/uptime.c (usage): Remove inconsistent space from the synopsis. + * src/users.c: Likewise. + +2008-08-04 Jim Meyering + + false: mark "false" description for translation + * src/true.c (usage): Mark both strings with N_, so that + the one for "false" is also extracted for translation. + For consistency, mark both, although only the latter one needed it. + Inspired by a patch from Benno Schulenberg. + +2008-08-04 James Youngman + + factor: credit Torbjörn Granlund + * src/factor.c: Credit Torbjörn Granlund as the author of the + arbitrary-precision factorization code. + +2008-08-03 Jim Meyering + + doc: make it clear we're talking about the Linux kernel + * doc/coreutils.texi (mv invocation): tweak wording + +2008-08-02 Ralf Wildenhues + + tests: fix build-aux/check.mk for non-GNU make + * build-aux/check.mk ($(TEST_LOGS)) [!GNU_MAKE]: Check for + a $(TESTS) test in the build dir, before one in srcdir. For details, + see . + + * bootstrap: Fix unportable expr usage. + +2008-08-01 Kamil Dudka + + ls: --color now highlights files with capabilities, too + * src/ls.c: [HAVE_CAP] Include . + (has_capability): New function for capability detection. + (print_color_indicator): Colorize file with capability. + * m4/jm-macro.m4: New configure option: --disable-libcap. + Check for libcap usability. + * src/Makefile.am (dir_LDADD, ls_LDADD, ...): Append $(LIB_CAP). + * src/dircolors.c: Update color lists. + * src/dircolors.hin: Mention new CAPABILITY color attribute. + * tests/ls/capability: Test for ls - colorize file with capability. + * tests/Makefile.am (root_tests): Add ls/capability. + * NEWS: Mention the change. + +2008-08-01 James Youngman + + factor arbitrarily large numbers + * m4/gmp.m4: New file; adds cu_GMP, which detects GNU MP. + * configure.ac: Use cu_GMP. + * src/Makefile.am: Link factor against libgmp if available. + * src/factor.c: Use GNU MP if it is available. + (emit_factor, emit_ul_factor, factor_using_division, + factor_using_pollard_rho, extract_factors_multi, + sort_and_print_factors, free_factors): new functions + for the arbitrary-precision implementation, taken from an example + in GNU MP. + (factor_wheel): Renamed; was called factor. + (print_factors_single): Renamed; was called print_factors. + (print_factors): New function, chooses between the single- and + arbitrary-precision algorithms according to availability of GNU MP + and the length of the number to be factored. + (usage, main): New options --bignum and --no-bignum. + * coreutils.texi (factor invocation): Document new command-line + options for the MP implementation and update the performance + numbers to take into account the asymptotically faster algorithm. + * TODO: Remove item about factoring large primes (it's done). + * m4/gmp.m4: Add support for --without-gmp. + * NEWS: Mention the new feature. + +2008-08-01 Kamil Dudka -2006-09-07 Jim Meyering + ls -U1 now uses constant memory + When printing one name per line and not sorting, ls now uses + constant memory per directory, no matter how many files are in + the directory. + * ls.c (print_dir): Print each file name immediately, when possible. + * NEWS: Mention the improvement. + +2008-07-30 Jim Meyering + + * timeout.c: Fix grammar in a comment. Normalize comment syntax. + +2008-07-28 Jim Meyering + + bootstrap: work also when there are no .po files in po/ + * bootstrap (update_po_files): Complete the change that I began + in 7ba2dd808232cff3ee76aaceb97f4381c3c9cde4. + +2008-07-27 Jim Meyering + + * NEWS: Move shuf --zero-terminated item into bug-fixes section. + +2008-07-27 Mikael Magnusson - * bootstrap: Revert last change. There are less disruptive ways - to mark these generated files as read-only. + shuf: correctly document --head-count + * src/shuf.c (usage): Correct --help output. + * doc/coreutils.texi: Correct option listing. + * NEWS: Mention correction. - * src/c99-to-c89.diff: Update to have proper offsets. +2008-07-27 Jim Meyering -2006-09-06 Jim Meyering + shuf: honor --zero-terminated option even with --input-range=LO-HI + * src/shuf.c (write_permuted_output): Add EOLBYTE parameter and use + it rather than hard-coding "\n". + (main): Adjust sole caller. + * tests/misc/shuf: Add a test to exercise this bug fix. + * NEWS: Mention it. - Ensure that some gnulib-tool-generated files are read-only. - * bootstrap (slurp): Put the body of this function in a sub-shell, - with "umask a-w" so that all new files are read-only. Remove each - file before we write to it, in case it's read-only. - Make po/Makevars and runtime-po/Makevars read-only, too. +2008-07-23 Jim Meyering -2006-09-05 Jim Meyering + dd: minor fullblock changes + * src/dd.c (O_FULLBLOCK): Define using an enum, not #define. + Derive the value, rather than hard-coding to one that might conflict. + (usage): Mention iflag=fullblock in --help output. + (scanargs): Reset the O_FULLBLOCK bit, so that we don't try to set + an undefined attribute via fcntl (fd, F_SETFL, ... + * tests/dd/misc: Signal framework_failure when necessary. + Use "compare actual expected", so any diffs look "right". + * NEWS (dd): Alphabetize and reword. + * coreutils.texi (dd invocation): Adjust wording. - * tests/cp/acl: Skip this test when cp lacks ACL support. - * tests/cp/Makefile.am (TESTS_ENVIRONMENT): Set $(CONFIG_HEADER). +2008-07-23 Kamil Dudka - * src/c99-to-c89.diff (remove.c): Adapt one hunk to match the new - context from change of 2006-09-02. + dd: new option: iflag=fullblock to accumulate full input blocks + * src/dd.c (iread_fullblock): New function for reading full blocks. + (scanargs): Check for new parameter iflag=fullblock. + (skip): Use iread_fnc pointer instead of iread function. + (dd_copy): Use iread_fnc pointer instead of iread function. + * tests/dd/misc: Add test for dd - read full blocks. + * doc/coretuils.texi: Mention new parameter iflag=fullblock. + * NEWS: Mentioned the change. -2006-09-04 Jim Meyering +2008-07-23 Jim Meyering - * README-cvs: Fix typo in update command. + dd: adjust --help output so help2man formats the man page properly + * src/dd.c (usage): Use two spaces (not one) to separate + "directory" from its description, so help2man formats + the derived man page properly. -2006-09-03 Jim Meyering +2008-07-23 Reuben Thomas - * NEWS: Tweak the wording in the new change description so that - no one can think this change causes e.g., `rm -fr foo../' to fail. + doc: add example .bashrc code for a ~/.dircolors file + * coreutils.texi: Add tip for .bashrc use from Jim Meyering. - * tests/rm/inaccessible: Adjust for movement of config.h to lib/. - Use $CONFIG_HEADER, rather than hard-coding it. - * tests/rm/Makefile.am (TESTS_ENVIRONMENT): Set $CONFIG_HEADER. +2008-07-22 Jim Meyering -2006-09-02 Paul Eggert + tests: do not run chmod on a prefix of space-embedded tmpdir + * TESTS/test-lib.sh (remove_tmp_): New function. + (trap 0): Use it instead of open-coded (and misquoted) version. - * NEWS: rm now rejects attempts to remove /, ./, and ../. - * src/basename.c: Don't include dirname.h, since system.h does it now. + tests: ensure "make check" w/tainted build dir no longer impacts $HOME + * maint.mk (taint-distcheck): New rule. + (maintainer-distcheck): Make it. + +2008-07-22 Ralf Wildenhues + + tests: again, do not change the mode of all directories below $HOME + * tests/CuTmpdir.pm (chmod_tree): Do not run chmod on undefined + argument, can happen when the build path contains spaces. + +2008-07-19 Jim Meyering + + * THANKS: Update, now that I have a name for jemm4jemm. + +2008-07-18 Andreas Schwab + + mknod: correct misplaced -Z description in --help output + * src/mknod.c (usage): Put it after the "Mandatory arguments..." line. + +2008-07-16 Jim Meyering + + dircolors.hin: add Ogg/Theora-related extensions + * dircolors.hin: Add extensions from + http://wiki.xiph.org/index.php/MIME_Types_and_File_Extensions + Suggestion from jemm4jemm@yahoo.com. + + * HACKING: describe how to find a misplaced change-set + +2008-07-15 Jim Meyering + + fix two bugs in ptx + * src/ptx.c (fix_output_parameters): Don't let before_max_width + go negative -- that would cause an infloop in define_all_fields. + (main): Don't clobber name[0] with lists of two or more input files. + * tests/misc/ptx: New file. Test for the above. + * tests/Makefile.am (TESTS): Add misc/ptx. + +2008-07-11 Pádraig Brady + + tests: expand: test for lines starting with both spaces and tabs + The expand released in current distributions (Fedora Core 4 - Fedora 9 + at least), doesn't expand --initial tabs if spaces are present. + + tests/misc/expand: Add test to verify --initial works correctly + with lines starting with both spaces and tabs. + +2008-07-10 Jim Meyering + + make check: accommodate stricter POSIX-conforming shells + Without this, test-related variable settings were not exported to + the shell_or_perl_ function when using dash or Solaris 11's /bin/sh. + * tests/check.mk (TESTS_ENVIRONMENT): Use an explicit "export", + so as not to rely on non-POSIX behavior of some /bin/sh (e.g., + bash-based ones). + +2008-07-06 Jim Meyering + + * bootstrap: Remove $bt and $bt2 also when not using gettext. + +2008-07-04 Jim Meyering + + who -r: don't print "last=" when the corresponding byte is unprintable + * src/who.c (print_runlevel): Print last=%c only when the "preceding + run-level" byte is printable. Reported by Gian Piero De Lolliis in + . + +2008-07-04 Ondřej Vašík + + doc: describe who's -p, -r, and -t options + * doc/coreutils.texi (who invocation): + +2008-07-04 Jim Meyering + + install with just-built ./ginstall only when not cross-compiling + * src/Makefile.am (install-exec-am): ...otherwise, use the default + value, $(INSTALL_PROGRAM). Reported by Brian Silverman. + + * README-hacking: Update the section on LZMA. + +2008-06-30 Pádraig Brady + + truncate: ignore whitespace in --size parameters + Without this, `truncate -s '> -1' F` would truncate F to length 0, + and `truncate -s " +1" F` would truncate F to 1 byte. Now, each + elicits a diagnostic. + * src/truncate.c: Skip leading white space in the --size option + argument and any white space after one of the relative modifiers, + so that the presence of a +/- modifier can be detected reliably. + * tests/misc/truncate-parameters: Add tests for the above. + +2008-06-28 Jim Meyering + + doc: add "..." to Usage, to indicate there may be multiple OPTIONs + * src/base64.c (usage): Likewise. + * src/cat.c (usage): Likewise. + * src/md5sum.c (usage): Likewise. + * src/mkdir.c (usage): Likewise. + * src/mkfifo.c (usage): Likewise. + * src/split.c (usage): Likewise. + * src/stat.c (usage): Likewise. + Heiko Marr reported the problem with mkdir. + + mkfifo: correct misplaced -Z description in --help output + * src/mkfifo.c (usage): Put it *after* the "Mandatory arguments..." line. + + uniq: remove redundant test + * src/uniq.c (find_field): Remove redundant test in outer loop- + termination expression. Also, add a "const" attribute. + +2008-06-27 Pádraig Brady + + timeout: fix invalid argument tests + * tests/misc/timeout-parameters: Remove test for invalid + signal number (we don't know what signal numbers are + invalid on all systems). Also tweak the other invalid + signal check so that the rest of the arguments are correct. + +2008-06-27 Jim Meyering + + avoid a -Wsign-compare warning + * src/tee.c (tee_files): Swap fwrite's size/n_elem args and + compare the return value against "1". + + base64: don't rely on feof returning 0/1 + * src/base64.c (do_decode): feof is specified to return nonzero, + not 0/1, so use "k < 1 + !!feof(in)" as the loop termination test. + +2008-06-27 Pádraig Brady + + truncate: silence -Wsign-compare warnings + * src/truncate.c: Cast signed to unsigned to + confirm intent which will silence -Wsign-compare warnings + +2008-06-27 Jim Meyering + + factor out time_t-to-string conversion idiom + * src/system.h: Include "inttostr.h". + (timetostr): New function, factored out of... + * src/date.c (show_date): Use timetostr. + * src/du.c (show_date): Likewise. + * src/ls.c (print_long_format): Likewise. + * src/pinky.c (time_string): Likewise. + * src/stat.c (human_time): Likewise. + * src/*.c: Don't include inttostr.h, since system.h does. + * src/c99-to-c89.diff: Adjust offsets. + +2008-06-27 Pádraig Brady + + truncate: Fix integer portability issues + * src/truncate.c: Explicitly convert from off_t to intmax_t + when printing numbers as they may be different types. + Also don't mix size_t and off_t types in operations as + the latter will be promoted to unsigned when these types + are the same size. + +2008-06-26 Jim Meyering + + tests: adjust c99-to-c89 patch as well as the code to generate it + * maint.mk (patch-check) [REGEN_PATCH]: Trim some trailing blanks. + * src/c99-to-c89.diff: Adjust shred.c offsets. + + tests: fix make distcheck failure due to TODO change + * maint.mk (po-check): Limit check for e.g., _(...)-marked + messages to files matching *.? and *.??, thus excluding TODO + and *.diff. + + * TODO: Add item: remove uses of imaxtostr. + +2008-06-26 Peter O'Gorman + + tests: accommodate difference in an AIX 5.3 diagnostic + * tests/mkdir/selinux: Handle different strerror (ENOTSUP) spelling. + +2008-06-26 Jim Meyering + + shred: also ignore EISDIR upon failed fsync/fdatasync on HP-UX + * src/shred.c (ignorable_sync_errno): New function. + (dosync): Use it. + Based on a patch from Peter O'Gorman. + + * HACKING: use shorter "-1" (over HEAD~1) with git format-patch + + bootstrap.conf: don't list "open" specifically + It is no longer necessary to list it specifically, + now that several gnulib modules depend on the "open" module. + This reverts commit 3ea1fe588e20f196cc9b9907d5943bd620c6b944. + + truncate: handle the case in which off_t != intmax_t + * src/truncate.c (parse_len): Use a temporary of type intmax_t, + rather than off_t; detect out of range [OFF_T_MIN..OFF_T_MAX]. + (main) [IF_LINT]: Initialize, to avoid an unwarranted + "may be used uninitialized" warning. + Reported by Michael Geng. + +2008-06-23 Jim Meyering + + basename: List David MacKenzie as the author. + * src/basename.c (AUTHORS): List David as the author. + * AUTHORS: Update here, too. + +2008-06-23 Ondřej Vašík + + echo: use AUTHORS from bash's built-in echo + * AUTHORS,src/echo.c: Use bash builtin echo authors instead of FIXME unknown + +2008-06-22 Jim Meyering + + use gnulib's "open" module + * bootstrap.conf (gnulib_modules): Add open. + This is required at least for Solaris 9 and HP-UX 11, to + avoid a truncate test failure. For details, see this thread: + http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/13755 + + stat: warn that the --context (-Z) option (a no-op) is obsolete + * src/stat.c (main): It will be removed in a couple years. + * NEWS (Change in behavior): Mention this. + +2008-06-20 Jim Meyering + + make "make syntax-check" quieter + * maint.mk (po-check, makefile-check, sc_proper_name_utf8_requires_ICONV): + Add "@" prefix. + +2008-06-20 Bo Borgerson + + sort: Fix bug where --batch-size option shrank SORT_SIZE. + * src/sort.c (specify_nmerge, main): Only adjust SORT_SIZE if it's already set. + * tests/misc/sort-merge: Test bug fix. + +2008-06-19 Jim Meyering + + tests: avoid test failure when root's primary group-ID is not 0 + * tests/cp/preserve-gid: Expect a cp-without-`-p'-created file to + have a group ID of $(id -g). Reported by Jarod Wilson. Details in + http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/13803/focus=13837 + + tests: avoid root-only test failure when run in a chroot + * tests/misc/runcon-no-reorder: Accept the diagnostic that is + produced when running in a chroot without /selinux/context. + Reported by Jarod Wilson. Details in + http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/13803/focus=13837 + +2008-06-18 Jim Meyering + + * tests/check.mk: Fix a typo in a comment. + +2008-06-17 Jim Meyering + + doc: fix a syntax error + * coreutils.texi (du invocation): Add missing comma. + +2008-06-17 Bo Borgerson + + sort: accept new option --batch-size=NMERGE + * src/sort.c: (static unsigned int nmerge) Replace constant NMERGE. + (specify_nmerge) Validate and apply new option. + (mergefps) Replace some arrays with pointers to xnmalloc'd storage. + * tests/misc/sort-merge: Test new option. + * doc/coreutils.texi: Describe new option. + * NEWS: Advertise new option. + + sort: add new option --files0-from=F + * src/sort.c: Support new option. + * tests/misc/sort-files0-from: Test new option. + * tests/misc/Makefile.am: Indicate new test. + * docs/coreutils.texi: Explain new option. + * NEWS: Advertise new option. + + HACKING: Add section for tips on reducing translator workload. + * HACKING (Be nice to translators): New section. + Add Jim's suggestion to avoid changing translatable strings if possible. + +2008-06-17 Jim Meyering + + * THANKS: Add name and email for Carl Roth. + +2008-06-17 Eric Blake + + ls, od: avoid redundant const + * src/ls.c (long_time_format, sort_functions): Avoid redundant const. + * src/od.c (charname): Likewise. + * maint.mk (sc_redundant_const): Add rule to detect this. + +2008-06-17 Bo Borgerson + + join: improve memory management + * src/join.c (struct seq): Use a (struct line **) for `lines' rather than + one long (struct line *). This allows individual lines to be swapped out + if necessary. + (reset_line): Get a line ready for new input. + (init_linep): Create a new line and assign it to the the pointer passed in. + (spareline[2]): Hold a spare line for each input file. + (free_spareline): Clean up. + (get_line): Take a (struct line **) instead of a (struct line *). If the + line to be overwritten is the previous line for the current file then swap + it out for the spare. + (join): Accomodate new structure of SEQs and new parameters to get_line; + Don't free stale lines until the end -- they're re-usable now. + (dup_line): Remove function. + * NEWS: Mention the performance improvement. + +2008-06-16 Ralf Wildenhues + + * doc/coreutils.texi (join invocation): Drop leading blanks. + +2008-06-16 Jim Meyering + + remove redundant const directives + In 1463824d8e7f72c31f1d803d7cfe2b608ccafc5c, I added some + missing "const" directives, as well as some new, redundant ones. + This removes the redundant ones. Pointed out by Eric Blake. + * base64.c, cat.c, chcon.c, chgrp.c, chmod.c, chown.c, comm.c: + * cp.c, csplit.c, cut.c, date.c, dd.c, df.c, dircolors.c, du.c: + * env.c, expand.c, fmt.c, fold.c, groups.c, head.c, id.c: + * install.c, join.c, kill.c, ln.c, ls.c, md5sum.c, mkdir.c: + * mkfifo.c, mknod.c, mktemp.c, mv.c, nice.c, nl.c, od.c: + * paste.c, pathchk.c, pinky.c, pr.c, ptx.c, readlink.c, rm.c: + * rmdir.c, runcon.c, seq.c, shred.c, shuf.c, sort.c, split.c: + * stat.c, stty.c, su.c, sum.c, tac.c, tail.c, tee.c, timeout.c: + * touch.c, tr.c, truncate.c, tty.c, uname.c, unexpand.c, uniq.c: + * wc.c, who.c: Remove redundant const directives. + * maint.mk (sc_const_long_option): Don't require redundant "const". + + chcon: correct --verbose output to include newlines + * src/chcon.c (process_file): Append "\n" to --verbose diagnostic. + * tests/misc/chcon: Add a test for the above. + * NEWS: mention the bug fix + Reported by Carl D. Roth in http://bugzilla.redhat.com/451478. + +2008-06-15 Jim Meyering + + address root cause of compilation failures: + The affected code wasn't even being compiled on my system, + because HAVE_NL_LANGINFO was not defined. On other systems, where + vasnprintf.m4 determines it needs %A or %a replacement support, it + _would_ check for nl_langinfo, and expose the compilation failure. + * m4/jm-macros.m4: Check for nl_langinfo, required by sort.c. + + fix the compilation failure for real + * src/sort.c (monthtab): Neither "const" may be added. + + fix a const-related compilation failure in sort.c + * src/sort.c (monthtab): Remove overzealous "const". + Table entries are modified in an #if HAVE_NL_LANGINFO block. + Introduced by 1463824d8e7f72c31f1d803d7cfe2b608ccafc5c. + + update HACKING guidelines + * HACKING: Don't suggest --signoff; it's redundant. + (log requirements): Specify preferred forms. + Mention preference for "<" over ">". + Mention the "const placement" preference. + +2008-06-14 Jim Meyering + + run gnulib-tests in parallel + * tests/Makefile.am: Define AUTOMAKE_OPTIONS, so check.mk can append. + * tests/check.mk: Define SUFFIXES, so check.mk can append. + * build-aux/check.mk (SUFFIXES): Append, so as not to evoke + automake warning the prior definition in gnulib-tests/gnulib.mk. + (AUTOMAKE_OPTIONS): Likewise. + * gnulib-tests/Makefile.am (TEST_LOGS): Define. + Include build-aux/check.mk + + * maint.mk (sc_proper_name_utf8_requires_ICONV) Fix typo in diagnostic. + + add "const" attribute, where possible + * maint.mk (sc_const_long_option): New rule. Enforce global change. + * src/base64.c (long_options): Use "const" where possible. + * src/cat.c (main): Likewise. + * src/chcon.c (long_options): Likewise. + * src/chgrp.c (long_options): Likewise. + * src/chmod.c (long_options): Likewise. + * src/chown.c (long_options): Likewise. + * src/comm.c (long_options, OUTPUT_DELIMITER_OPTION): Likewise. + * src/cp.c (long_opts): Likewise. + * src/csplit.c (longopts): Likewise. + * src/cut.c (longopts): Likewise. + * src/date.c (long_options): Likewise. + * src/dd.c (conversions, flags, statuses): Likewise. + * src/df.c (long_options): Likewise. + * src/dircolors.c (long_options): Likewise. + * src/du.c (long_options): Likewise. + * src/env.c (longopts): Likewise. + * src/expand.c (longopts): Likewise. + * src/fmt.c (long_options): Likewise. + * src/fold.c (longopts): Likewise. + * src/groups.c (longopts): Likewise. + * src/head.c (long_options): Likewise. + * src/id.c (longopts): Likewise. + * src/install.c (long_options): Likewise. + * src/join.c (longopts): Likewise. + * src/kill.c (long_options): Likewise. + * src/ln.c (long_options): Likewise. + * src/ls.c (long_time_format, long_options, sort_functions): Likewise. + * src/md5sum.c (long_options): Likewise. + * src/mkdir.c (longopts): Likewise. + * src/mkfifo.c (longopts): Likewise. + * src/mknod.c (longopts): Likewise. + * src/mktemp.c (longopts): Likewise. + * src/mv.c (long_options): Likewise. + * src/nice.c (longopts): Likewise. + * src/nl.c (longopts): Likewise. + * src/od.c (charname, long_options): Likewise. + * src/paste.c (longopts): Likewise. + * src/pathchk.c (longopts): Likewise. + * src/pinky.c (longopts): Likewise. + * src/pr.c (long_options): Likewise. + * src/ptx.c (long_options): Likewise. + * src/readlink.c (longopts): Likewise. + * src/rm.c (long_opts): Likewise. + * src/rmdir.c (longopts): Likewise. + * src/runcon.c (long_options): Likewise. + * src/seq.c (long_options): Likewise. + * src/shred.c (long_opts): Likewise. + * src/shuf.c (long_opts): Likewise. + * src/sort.c (monthtab, long_options): Likewise. + * src/split.c (longopts): Likewise. + * src/stat.c (long_options): Likewise. + * src/stty.c (mode_info, control_info, longopts, set_mode) Likewise. + (set_control_char, speeds): Likewise. + * src/su.c (longopts): Likewise. + * src/sum.c (longopts): Likewise. + * src/tac.c (longopts): Likewise. + * src/tail.c (long_options): Likewise. + * src/tee.c (long_options): Likewise. + * src/timeout.c (long_options): Likewise. + * src/touch.c (longopts): Likewise. + * src/tr.c (long_options): Likewise. + * src/truncate.c (longopts): Likewise. + * src/tty.c (longopts): Likewise. + * src/uname.c (uname_long_options, arch_long_options): Likewise. + * src/unexpand.c (longopts): Likewise. + * src/uniq.c (longopts): Likewise. + * src/wc.c (longopts): Likewise. + * src/who.c (longopts): Likewise. + + revert previous change, "don't use "const" with scalar types" + * src/truncate.c: There is nothing wrong with that construct. + This reverts commit d7d80c5b7b122377fe250357a3ab182e8fbde20a. + + don't use "const" with scalar types + * src/truncate.c: Several vendor compilers reject that. + See http://article.gmane.org/gmane.comp.lib.gnulib.bugs/13876 + +2008-06-13 Eric Blake + + od: improve handling of padding + * src/od.c (decode_one_format): Alter the format, again. + (FMT_BYTES_ALLOCATED): Reduce size by adjusting to new format. + (MAX_INTEGRAL_TYPE_SIZE): Move earlier in the file. + (charname): Turn it into a 2D array, since there's no need for + pointers now. + (PRINT_TYPE, print_named_ascii, print_ascii): Add a width + parameter. + (write_block): Account for width parameter. + Using ideas from Paul Eggert. + + od: align multiple -t specs + * src/od.c (struct tspec): Add pad_width field, and adjust + print_function prototype. + (decode_one_format): Rewrite all fmt_string values to account for + pad width. + (FMT_BYTES_ALLOCATED): Adjust to new format style. + (main): Compute pad width per spec. + (write_block): Account for pad width. + (dump): Don't print padding-only fields. + (PRINT_TYPE, print_named_ascii, print_ascii): All print functions + adjusted to use variable pad width. + * tests/Makefile.am (TESTS): Add test. + * tests/misc/od-multiple-t: New file. + * THANKS: Update. + * NEWS: Mention the improvement. + Reported by Gary Johnson. + + od: use gnulib printf replacement as necessary + * src/od.c (includes): Add xprintf.h. + (PRINT_TYPE): New macro, using xprintf instead of printf. + (print_s_char, print_char, print_s_short, print_short, print_int) + (print_long, print_long_long, print_float, print_double) + (print_long_double): Factor into PRINT_TYPE macro. + (print_named_ascii, print_ascii): Use xprintf. + * NEWS: Mention this as a bug fix. + + od: simplify long double support + * m4/jm-macros.m4 (gl_CHECK_ALL_TYPES): Remove obsolete check for + AC_C_LONG_DOUBLE. + * src/od.c (LONG_DOUBLE): Delete. + (width_bytes, MAX_FP_TYPE_SIZE, decode_one_format, main): Just use + 'long double' directly. + (print_long_double): No longer protect by HAVE_LONG_DOUBLE. + + doc: od defaults to -toS, not -td2 + * src/od.c (usage): Correct description of default. + +2008-06-13 Jim Meyering + + skip (don't fail) root-only tests for common set-up failures + Address 2 of 4 failures reported by Jarod Wilson in + http://bugzilla.redhat.com/442352. More details here: + http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/13803 + * tests/cp/cp-a-selinux: Skip the test if "mkfs -t ext2" fails. + * tests/rm/fail-2eperm: Skip the test if "rm" is not accessible. + +2008-06-12 Jim Meyering + + tweak to conform with syntax policy + Use "<" or "<=" rather than ">" or ">=". + Use "Type const *", rather than "const Type *". + +2008-06-12 Bo Borgerson + + comm: accept new option: --output-delimiter=STR + * src/comm.c (delimiter): New global. + (writeline): Use delimiter string instead of single TAB character. + (main): Initialize delimiter. + * tests/misc/comm: Add tests for comm output delimiter specification. + * doc/coreutils.texi: Document new option. + * NEWS: Advertise new option. + * TODO: Remove associated item. + + comm: ensure that input files are sorted + * NEWS: List new behavior. + * doc/coreutils.texi (checkOrderOption) New macro for + describing `--check-order' and `--nocheck-order', used in + both join and comm. + * src/comm.c (main): Initialize new options. + (usage): Describe new options. + (compare_files): Keep an extra pair of buffers for the previous + line from each file to check the internal order. + (check_order): If an order-check is required, compare and handle + the result appropriately. + (copylinebuffer): Copy a linebuffer; used for copy before read. + * tests/misc/Makefile.am: List new test. + * tests/misc/comm: Tests for the comm program, including the + new order-checking functionality and attendant command-line options. + +2008-06-11 Jim Meyering + + fix another unportable use of 'tr' + * configure.ac [EXTRA_PROGRAMS]: Add omitted space in tr's STRING2. + Spotted by Denis Excoffier, upon Solaris 8 build failure. + + tests: skip a chown test on FreeBSD 6.x + * tests/chown/separator: Skip this test if is likely to fail + due to the combination of a bogus group name and a broken + getgrnam function. + + tests: remove duplicate mention of misc/selinux + * tests/Makefile.am (TESTS): Remove misc/selinux, since it's + already listed in $(root_tests). + +2008-06-11 Bruno Haible + + fix build failure on AIX 4 + * configure.ac: Fix unportable invocation of 'tr', introduced on + 2008-04-22. Affects tr from at least AIX 4.3.2. + +2008-06-10 Pádraig Brady + + remove test for specific diagnostic when truncating missing directory + Solaris 10 returns ENOTDIR when truncating a nonexistent directory, + whereas Linux returns EISDIR (because it has a trailing /). + * tests/misc/truncate-fail-diag: Remove the test for the specific error. + + timeout: use system-independent exit values + Change exit values from ETIMEDOUT and ECANCELED, + the values of which are system dependent, to + 124 and 125 respectively. + * src/timeout.c (EXIT_TIMEDOUT, EXIT_CANCELED): Define. + (usage, main): Adjust. + * coreutils.texi (timeout invocation): Update. + * tests/misc/timeout: Adjust. + +2008-06-09 Jim Meyering + + enforce the proper_name_utf8-requires-ICONV link rule + * maint.mk (sc_proper_name_utf8_requires_ICONV): New rule. + * src/Makefile.am (timeout_LDADD, truncate_LDADD): Add $(LIBICONV). + +2008-06-09 Bruno Haible + + * NEWS (Improvements): Mention improved (via gnulib) ACL support. + +2008-06-08 Jim Meyering + + maint.mk: my-distcheck runs $(MAKE) syntax-check once again + * maint.mk (my-distcheck): Run $(MAKE) syntax-check once again. + Run "$(MAKE) check" _after_ the less expensive syntax-check. + +2008-06-08 Bo Borgerson + + standardize some error messages + * maint.mk: (sc_error_message_warn_fatal, sc_error_message_uppercase): + (sc_error_message_period): Add automatic checks for non-standard error + messages. + * .x-sc_error_message_uppercase: explicit exclusion for this check + * src/cp.c: Standardize some error messages. + * src/date.c: Likewise. + * src/dircolors.c: Likewise. + * src/du.c: Likewise. + * src/expr.c: Likewise. + * src/install.c: Likewise. + * src/join.c: Likewise. + * src/ln.c: Likewise. + * src/mv.c: Likewise. + * src/od.c: Likewise. + * src/pr.c: Likewise. + * src/split.c: Likewise. + * src/truncate.c: Likewise. + * src/wc.c: Likewise. + * tests/du/files0-from: Expect new error message. + * tests/misc/join: Likewise. + * tests/misc/split-a: Likewise. + * tests/misc/wc-files0-from: Likewise. + * tests/misc/xstrtol: Likewise. + * lib/xmemxfrm.c: Likewise. + +2008-06-08 Jim Meyering + + syntax-check: detect anachronistic Perl-based tests + * maint.mk (sc_no_exec_perl_coreutils): Rename and rewrite. + +2008-06-06 Pádraig Brady + + Add new program: truncate + * AUTHORS: Register as the author + * NEWS: Mention this change + * README: Add truncate command to list + * src/truncate.c: New command + * src/Makefile.am: Add truncate command to list to build + * src/.gitignore: Add truncate binary to list to ignore + * doc/coreutils.texi (truncate invocation): Add truncate info + * man/Makefile.am: Add truncate man page to list to build + * man/truncate.x: Add truncate man page template + * po/POTFILES.in: Add truncate to list to translate + * tests/Makefile.am: Add truncate tests + * tests/misc/help-version: Add support for new truncate command + * tests/misc/truncate-dangling-symlink: check dangling link ok + * tests/misc/truncate-dir-fail: ensure dirs fail + * tests/misc/truncate-fail-diag: validate messages for missing paths + * tests/misc/truncate-fifo: ensure fifos ignored + * tests/misc/truncate-no-create-missing: ensure -c option honoured + * tests/misc/truncate-overflow: check signed integer overflows + * tests/misc/truncate-owned-by-other: root permissions check + * tests/misc/truncate-parameters: check invalid parameter combinations + * tests/misc/truncate-relative: check invalid relative sizes + +2008-06-06 Eric Blake + + improve 'date +%C' documentation + * src/date.c (usage): Use 20, not 21, for current century. + * THANKS: Update. + Reported by Dameon G. Rogers, fix suggested by Philip Rowlands. + +2008-06-03 Jim Meyering + + nice.c: avoid a cast + * src/nice.c (main): Use argv[0], rather than + "program_name with a cast". Suggestion from Eric Blake. + + adjust c99-to-c89 patch as well as the code to generate it + * maint.mk (patch-check) [REGEN_PATCH]: Eliminate date-related + differences in generated diffs. + * src/c99-to-c89.diff: Adjust offsets. + + use gnulib's progname module + * bootstrap.conf (gnulib_modules): Add progname. + * src/*.c (program_name): Remove declaration. + * (main): Call set_program_name rather than setting program_name. + * src/nice.c (main): Cast program_name to "(char *)". + * src/prog-fprintf.c: Include "system.h" + * src/system.h: Include "progname.h". + * maint.mk (sc_program_name): Adjust rule. + Suggestion from Eric Blake. + + remove duplicate definition of matchpathcon_init_prefix + * gl/lib/se-selinux.in.h (matchpathcon_init_prefix): Remove definition. + It is already defined there. Reported by Eric Blake. + +2008-06-02 Jim Meyering + + fix cpp indentation policy violations + * src/copy.c (mkfifo): Indent nested "# define". + * src/timeout.c (ECANCELED): Likewise. + + accommodate older SELinux which lacks matchpathcon_init_prefix + * m4/jm-macros.m4: Check for matchpathcon_init_prefix. + * src/install.c [!HAVE_MATCHPATHCON_INIT_PREFIX] + (matchpathcon_init_prefix): Define away. + * gl/lib/se-selinux.in.h (matchpathcon_init_prefix): Define. + Reported by Ilya N. Golubev in + . + + each file with a "main" must also declare program_name + * maint.mk (sc_program_name): New rule. + * .x-sc_program_name: New file. + * Makefile.am (EXTRA_DIST): Add .x-sc_program_name. + + declare program_name consistently + * src/base64.c: Likewise. + * src/basename.c: Likewise. + * src/cat.c: Likewise. + * src/chcon.c: Likewise. + * src/chgrp.c: Likewise. * src/chmod.c: Likewise. - * src/copy.c: Likewise. + * src/chown.c: Likewise. + * src/chroot.c: Likewise. + * src/cksum.c: Likewise. + * src/comm.c: Likewise. * src/cp.c: Likewise. + * src/csplit.c: Likewise. + * src/cut.c: Likewise. + * src/date.c: Likewise. + * src/dd.c: Likewise. * src/df.c: Likewise. * src/dircolors.c: Likewise. * src/dirname.c: Likewise. * src/du.c: Likewise. + * src/echo.c: Likewise. + * src/env.c: Likewise. + * src/expand.c: Likewise. + * src/expr.c: Likewise. + * src/factor.c: Likewise. + * src/fmt.c: Likewise. + * src/fold.c: Likewise. + * src/groups.c: Likewise. + * src/head.c: Likewise. + * src/hostid.c: Likewise. + * src/hostname.c: Likewise. + * src/id.c: Likewise. * src/install.c: Likewise. + * src/join.c: Likewise. + * src/kill.c: Likewise. + * src/link.c: Likewise. * src/ln.c: Likewise. + * src/logname.c: Likewise. * src/ls.c: Likewise. + * src/md5sum.c: Likewise. * src/mkdir.c: Likewise. + * src/mkfifo.c: Likewise. + * src/mknod.c: Likewise. + * src/mktemp.c: Likewise. * src/mv.c: Likewise. - * src/remove.c: Likewise. + * src/nice.c: Likewise. + * src/nl.c: Likewise. + * src/nohup.c: Likewise. + * src/od.c: Likewise. + * src/paste.c: Likewise. + * src/pathchk.c: Likewise. + * src/pinky.c: Likewise. + * src/pr.c: Likewise. + * src/printenv.c: Likewise. + * src/printf.c: Likewise. + * src/ptx.c: Likewise. + * src/pwd.c: Likewise. + * src/readlink.c: Likewise. * src/rm.c: Likewise. * src/rmdir.c: Likewise. - * src/shred.c: Likewise. + * src/runcon.c: Likewise. + * src/seq.c: Likewise. + * src/setuidgid.c: Likewise. + * src/shuf.c: Likewise. + * src/sleep.c: Likewise. + * src/sort.c: Likewise. * src/split.c: Likewise. + * src/stat.c: Likewise. + * src/stty.c: Likewise. * src/su.c: Likewise. - * src/system.h: Include "dirname.h", since dot_or_dotdot needs it - now. - (dot_or_dotdot): Succeed even if "." or ".." is followed by a - slash. - * src/rm.c (usage, main): --preserve-root is now the default. - * src/remove.h: Fix comment. - * src/remove.c (cache_fstatat, cache_stat_init): New functions. - (cache_statted, cache_stat_ok): New functions. - (write_protected_non_symlink): Remove struct stat ** buf_p arg, - which is no longer needed with the new functions. All callers - changed. - (prompt, is_dir_lstat, remove_entry, remove_dir): - New struct stat * arg. All callers changed. - (write_protected_non_symlink, prompt, is_dir_lstat, remove_entry): - (remove_cwd_entries, remove_dir, rm_1): - Use and maintain the file status cache. - (prompt, remove_entry): Omit the first "directory" in the diagnostic - "Cannot remove directory `foo': is a directory". This causes "rm" - to pass a test case that it would otherwise fail now that it - "knows" more about its argument. I think the diagnostic is better - without the first "directory" anyway. - (prompt): Remove the no-longer-needed IS_DIR arg; all callers changed. - (rm_1): Reject attempts to remove /, ./, or ../. - * tests/rm/Makefile.am (TESTS): Add r-4. - * tests/rm/r-4: New file. - -2006-09-01 Paul Eggert - - * src/stat.c: Include - (alignof): New macro. - (HAVE_STRUCT_STATXFS_F_FSID___VAL, HAVE_STRUCT_STATXFS_F_FSID_VAL): - Remove. - (STRUCT_STATXFS_F_FSID_IS_INTEGER): New macro. - (FSID_VAL): Remove. - (print_statfs): If f_fsid isn't an integer, grab its words one - at a time in little-endian order. This is a bit easier to configure - and should avoid a compilation failure on MacOS reported by Bruno - Haible. - -2006-08-29 Paul Eggert - - * src/stat.c (HAVE_STRUCT_STATXFS_F_FSID_VAL, FSID_VAL): New macros, to - work around a Mac OS X porting problem reported by Bruno Haible in - . - (print_statfs): Use them. - - * bootstrap.conf (gnulib_modules): Add isapipe. - * src/tail.c: Include isapipe.h. - (IS_PIPE_LIKE_FILE_TYPE): Remove. - (IS_TAILABLE_FILE_TYPE): Just list both FIFOs and sockets as - tailable, since this seems to be portable. - (main): Use isapipe, to fix a bug on MacOS X reported by Bruno Haible in - . - - * src/system.h (LOCALEDIR): Remove, since configmake.h now defines - it for us. - -2006-08-28 Paul Eggert - - * src/copy.c (copy_internal): Don't test whether macros like - S_ISLNK are defined, since they're always defined now. - * src/cp.c (main): Likewise. - * src/ln.c (main): Likewise. - * src/ls.c (get_link_name, make_link_name): Likewise. - * src/mknod.c (main): Likewise. - * src/mkfifo.c (usage): Likewise. - * src/who.c (S_IWGRP): Likewise. - - Adjust to recent gnulib changes for the gnulib module. - * bootstrap.conf (gnulib_modules): Add fcntl. - * src/system.h (SEEK_SET, SEEK_CUR, SEEK_END): Remove. Other code - is already assuming these macros are defined. - (O_DIRECT, O_DIRECTORY, O_DSYNC, O_NDELAY, O_NOATIME, O_NONBLOCK): - (O_NOCTTY, O_NOFOLLOW, O_NOLINKS, O_RSYNC, O_SYNC, O_BINARY, O_TEXT): - Remove; the fcntl module now handles these. - - Adjust to recent gnulib changes for the inttypes module. - * bootstrap.conf (gnulib_modules): Remove stdint; add inttypes. - (excluded_files): Don't exclude m4/inttypes-h.m4 or m4/inttypes-pri.m4. - - * src/system.h: Don't bother to include , since we can - now assume inttypes.h does the equivalent of including stdint.h. - -2006-08-27 Jim Meyering - - * src/copy.c (copy_internal): Don't make a backup if the last - component of the source name is "." or "..". - Reported by Andreas Schwab in http://savannah.gnu.org/bugs/?17540. - * NEWS: Mention this. - * tests/cp/src-base-dot: New file. Test for the above fix. - * tests/cp/Makefile.am (TESTS): Add src-base-dot. - - * src/system.h (DOT_OR_DOTDOT): Remove macro. Rewrite as a... - (dot_or_dotdot): ...new static inline function. - * src/remove.c (rm_1): Reflect this renaming. - * src/ls.c (basename_is_dot_or_dotdot): Likewise. - - * src/copy.c (copy_internal): Add comments. - -2006-08-26 Paul Eggert - - * src/Makefile.am (AM_CPPFLAGS): Remove -I$(srcdir) and -I../lib, - since Automake supplies them for us. It always did -I$(srcdir), - and with the recent change to AC_CONFIG_HEADERS in configure.ac it - is now also doing -I../lib. - - * bootstrap (get_translations): Skip this if WGET_COMMAND is empty. - Fail if the first "echo" fails. Suppress diagnostics from "ls po/*.po" - since there might not be any .po files. - (WGET_COMMAND): Set to empty if wget doesn't - seem to be available. - -2006-08-26 Jim Meyering - - This test was failing in some environments. - * tests/ls/color-dtype-dir: Don't rely on eval "`dircolors -b`" - to set LS_COLORS in the environment. - * tests/envvar-check: Instead, ensure that LS_COLORS is not set. - Reported by Bob Proulx. - - * src/c99-to-c89.diff: Remove hunk for copy.c; no longer needed. - - * Makefile.am (EXTRA_DIST): Remove these files here, too: - .x-sc_no_if_have_config_h, .x-sc_prohibit_assert_without_use, - .x-sc_two_space_separator_in_usage. - - Fix "mv --verbose --backup" so its output includes the - " (backup: foo.~1~)" suffix also when backing up a directory. - * NEWS: Report this bug fix. - * src/copy.c (emit_verbose): New function, factored out of... - (copy_internal): ...here. Use the new function. - * tests/mv/backup-dir: Test for the above fix. - * tests/mv/Makefile.am (TESTS): Add backup-dir. - -2006-08-25 Paul Eggert - - * .x-sc_no_if_have_config_h: Remove; no longer needed. - * .x-sc_prohibit_assert_without_use: Remove; it was empty. - * .x-sc_two_space_separator_in_usage: Likewise. - * Makefile.maint (sc_no_have_config_h): Renamed from - sc_no_if_have_config_h, since it now checks that HAVE_CONFIG_H - is absent everywhere. - * bootstrap.conf (gnulib_modules): Add config-h. - * src/shred.c: Include unconditionally, since - we now assume config.h exists. - * src/dircolors.c: Likewise. - -2006-08-26 Jim Meyering - - "ls --color" would highlight other-writable and sticky directories - no differently than regular directories on a file system with - dirent.d_type support. - * NEWS: Say the above. - * src/ls.c (gobble_file): With --color, also stat the file when - we know it is a directory. - Derived from an anonymous one-line fix and bug report: - . - * tests/ls/color-dtype-dir: New file. Test for the above fix. - * tests/ls/Makefile.am (TESTS): Add color-dtype-dir. - -2006-08-25 Paul Eggert - - * .cvsignore: Remove stamp-h1. Add coreutils-*, to ignore - tarballs. - * bootstrap.conf: Add configmake, verify. - * src/.cvsignore: Remove localedir.h. - * src/Makefile.am (localedir, DISTCLEANFILES, localedir.h): Remove; - subsumed by configmake. - * src/system.h: Include configmake.h rather than localedir.h - (LOCALEDIR): New macro. - - Rewrite to avoid some unnecessary casts, macros, literals. - * src/shred.c (DEFAULT_PASSES, VERBOSE_UPDATE): Now constants, - not macros. - (SECTOR_SIZE, SECTOR_MASK): New constants. - (fillpattern, dopass, do_wipefd, main): Remove unnecessary casts, - and use the SECTOR_* constants when applicable. Check for size < - 0 rather than size == -1, since negative-size files are a sign of - trouble anyway. - -2006-08-25 Bruno Haible - - * src/shred.c (dopass): Assume a continuable error if EIO even - if the current position is not a multiple of 512. - -2006-08-24 Jim Meyering - - * src/stat.c (print_statfs): Fix typo: remove extra "sizeof". - -2006-08-23 Paul Eggert - - * src/stat.c (HAVE_STRUCT_STATXFS_F_FSID___VAL): Define. This - macro was being used without being defined. - (SB_F_NAMEMAX): Remove cast. - (f_fsid) [BeOS]: Likewise. - (OUT_NAMEMAX): Renamed from NAMEMAX_FORMAT, with a new meaning. - All uses changed. - (out_string, out_int, out_uint, out_uint_o, out_uint_x): New - functions. - (xstrcat): Remove. All uses changed to use the above functions. - (print_statfs, print_stat): 2nd arg is now the prefix len, not the - buffer len. All uses changed. Output '?', not '*', for unknown - data or errors. Do not assume signed values can be interchanged - with unsigned when printing. - (print_statfs): For %i, print the fsid as a single int, not as a - pair. - (print_it): Quote invalid format better. - - * NEWS: printf supports the I flag. - * src/printf.c (print_formatted) [glibc 2.2 or later]: Likewise. - -2006-08-23 Bruno Haible - - * src/stat.c (STRUCT_STATVFS, statfs, f_fsid, f_blocks, f_bfree) [BeOS]: - (f_bavail, f_bsize, STATFS_FRSIZE, f_files, f_ffree) [BeOS]: - (STATXFS_FILE_SYSTEM_TYPE_MEMBER_NAME) [BeOS]: Define. - - * src/ls.c (SA_RESTART): Fallback define. - -2006-08-23 Paul Eggert - - * src/system.h (EDQUOT): Define if not already defined. - Problem reported by Bruno Haible for BeOS. - - * .cvsignore: Remove config.h, config.hin, as they are now - in lib. - * configure.ac (AC_CONFIG_HEADERS): Move config.h and config.hin - to lib. - * src/Makefile.am (AM_CPPFLAGS): Remove '-I..'; no longer needed. - - * bootstrap (slurp): Define gl_LOCK_EARLY instead of gl_LOCK, - to accommodate today's gnulib change. - -2006-08-23 Jim Meyering - - * NEWS: Mention the sweeping infrastructure changes. - -2006-08-22 Paul Eggert - - * bootstrap.conf (gnulib_modules): Add gnupload. - * Makefile.maint (emit_upload_commands): gnupload is now - in build-aux. - * gnupload: Remove from CVS, since it's now a gnulib module. - - * bootstrap (bootstrap_conf_cleanup): Remove. - (excluded_files): New var. - * bootstrap.conf: Likewise. - * bootstrap (slurp): Exclude files early if they're in the - excluded_files list. That way, their names don't get put into - .cvsignore. - - * aclocal.m4, config.hin, configure: - Remove from CVS, since ./bootstrap generates them automatically. - * .cvsignore: Add INSTALL, Makefile.in, aclocal.m4, config.hin, - configure, *.cache, *.lineno, *.log. - Remove more-specific entries. This catches files like configure.lineno. - * man/.cvsignore: Add Makefile.in. - * src/.cvsignore: Add Makefile.in. - Remove .version, dir.c, install, mvdir, stamp-v, vdir.c, version.c. - - * tests/.cvsignore: - * tests/chgrp/.cvsignore: - * tests/chmod/.cvsignore: - * tests/chown/.cvsignore: - * tests/cp/.cvsignore: - * tests/cut/.cvsignore: - * tests/dd/.cvsignore: - * tests/dircolors/.cvsignore: - * tests/du/.cvsignore: - * tests/expr/.cvsignore: - * tests/factor/.cvsignore: - * tests/fmt/.cvsignore: - * tests/head/.cvsignore: - * tests/install/.cvsignore: - * tests/join/.cvsignore: - * tests/ln/.cvsignore: - * tests/ls/.cvsignore: - * tests/ls-2/.cvsignore: - * tests/md5sum/.cvsignore: - * tests/misc/.cvsignore: - * tests/mkdir/.cvsignore: - * tests/mv/.cvsignore: - * tests/od/.cvsignore: - * tests/pr/.cvsignore: - * tests/readlink/.cvsignore: - * tests/rm/.cvsignore: - * tests/rmdir/.cvsignore: - * tests/seq/.cvsignore: - * tests/sha1sum/.cvsignore: - * tests/shred/.cvsignore: - * tests/sort/.cvsignore: - * tests/stty/.cvsignore: - * tests/sum/.cvsignore: - * tests/tac/.cvsignore: - * tests/tail/.cvsignore: - * tests/tail-2/.cvsignore: - * tests/tee/.cvsignore: - * tests/test/.cvsignore: - * tests/touch/.cvsignore: - * tests/tr/.cvsignore: - * tests/tsort/.cvsignore: - * tests/unexpand/.cvsignore: - * tests/uniq/.cvsignore: - * tests/wc/.cvsignore: - Add Makefile.in. Sort entries if necessary. Remove *.I, *.E, - *.X, *.O, *-tests, build-script, mk-script if they're never - created in this directory. - -2006-08-22 Bruno Haible - - BeOS portability. - * src/uptime.c: Include OS.h if it exists. - (print_uptime): On BeOS, use the get_system_info function (actually a - macro). Loop through utmp entries only if utmp.h or utmpx.h exists. - (uptime): Call read_utmp only if utmp.h or utmpx.h exists. - -2006-08-22 Jim Meyering - - * .cvsignore: Add ABOUT-NLS. - - Move the check-AUTHORS rule to be run as part of "make distcheck", - rather than "make check". - * src/Makefile.am (check): Don't depend on check-AUTHORS; it would - cause "make check" to fail on systems unable to build all binaries. - * Makefile.maint (check-AUTHORS): New rule. - (local-checks-available): Add it here. - Reported by Bruno Haible. Needed for BeOS. - -2006-08-21 Paul Eggert - - * src/df.c (print_header, show_dev): Use a column width that - depends on the block size of -P is specified and not autoscaling. - Problem reported by Gustavo G. Rondina in: - http://lists.gnu.org/archive/html/bug-coreutils/2006-08/msg00164.html - -2006-08-21 Jim Meyering - - * tests/dircolors/simple (a): Don't fail with an unexpected diagnostic - when the shell variable, SHELL, is not set. - Trigger the failure with "(unset SHELL; make check TESTS=simple)". - Reported by Sven Joachim in . - - * src/od.c: Now that HAVE_UNSIGNED_LONG_LONG is no longer defined - in config.h, change the uses to HAVE_UNSIGNED_LONG_LONG_INT. - Otherwise, on a system with 4-byte longs, "od -t u8" fails with this: - od: invalid type string `u8'; - this system doesn't provide a 8-byte integral type - FIXME: add a test for this, but skip it when sizeof uintmax < 8. - -2006-08-20 Paul Eggert - - Add a bootstrap procedure, so that the CVS version contains fewer - files and we bootstrap the rest from gnulib, gettext, etc. - * README-cvs: New file. - * bootstrap: New file. - * bootstrap.conf: New file. - * .x-sc_trailing_blank: Remove config-log, .gdb-history. Add .po. - * configure.ac (AC_PREREQ): Move here from m4/*.m4, for benefit - of gnulib-tool. - (gl_DEFAULT_POSIX2_VERSION, gl_USE_SYSTEM_EXTENSIONS, gl_PERL): - (gl_IGNORE_UNUSED_LIBRARIES): Remove; now done by gnulib. - (gl_EARLY): Add. - (gl_MACROS): Call just after gl_EARLY, just for clarity. - * src/c99-to-c89.diff: Remove patch to ls.c; no longer needed. - * src/kill.c (strtoimax): Remove decl. - * src/ls.c: Include "wcwidth.h" instead of rolling it ourselves. + * src/sum.c: Likewise. + * src/sync.c: Likewise. + * src/tac.c: Likewise. + * src/tail.c: Likewise. + * src/tee.c: Likewise. + * src/test.c: Likewise. + * src/timeout.c: Likewise. + * src/touch.c: Likewise. + * src/tr.c: Likewise. + * src/true.c: Likewise. + * src/tsort.c: Likewise. + * src/tty.c: Likewise. + * src/uname.c: Likewise. + * src/unexpand.c: Likewise. + * src/uniq.c: Likewise. + * src/unlink.c: Likewise. + * src/uptime.c: Likewise. + * src/users.c: Likewise. * src/wc.c: Likewise. - * src/ls.c (sort_files): Rewrite to avoid need for C99-style - declaration, so that we don't need to patch this file. - * src/printf.c (strtoimax, strtoumax): Remove decls. - * src/su.c: Include getpass.h. - (getpass): remove. - * src/system.h: Include mempcpy.h, stpcpy.h, strpbrk.h. - Include inttypes.h unconditionally. - (LONGEST_MODIFIER, PRIdMAX, PRIoMAX, PRIuMAX, PRIxMAX): Remove. - (stpcpy, strndup, strstr, strtoul, mempcpy, CHAR_MIN, CHAR_MAX): - (SCHAR_MIN, SCHAR_MAX, UCHAR_MAX, SHRT_MIN, SHRT_MAX, INT_MAX): - (INT_MIN, INTMAX_MAX, INTMAX_MIN, UINT_MAX, LONG_MAX, ULONG_MAX): - (SIZE_MAX, SSIZE_MAX, UINTMAX_MAX): Remove. + * src/who.c: Likewise. + * src/whoami.c: Likewise. + * src/yes.c: Likewise. - * ABOUT-NLS, INSTALL, Makefile.in, man/Makefile.in: - * src/Makefile.in, tests/Makefile.in, tests/chgrp/Makefile.in: - * tests/chmod/Makefile.in, tests/chown/Makefile.in: - * tests/cp/Makefile.in, tests/cut/Makefile.in: - * tests/dd/Makefile.in, tests/dircolors/Makefile.in: - * tests/du/Makefile.in, tests/expr/Makefile.in: - * tests/factor/Makefile.in, tests/fmt/Makefile.in: - * tests/general/Makefile.in, tests/head/Makefile.in: - * tests/install/Makefile.in, tests/join/Makefile.in: - * tests/ln/Makefile.in, tests/ls/Makefile.in: - * tests/ls-2/Makefile.in, tests/md5sum/Makefile.in: - * tests/misc/Makefile.in, tests/mkdir/Makefile.in: - * tests/mv/Makefile.in, tests/od/Makefile.in: - * tests/pr/Makefile.in, tests/readlink/Makefile.in: - * tests/rm/Makefile.in, tests/rmdir/Makefile.in: - * tests/seq/Makefile.in, tests/sha1sum/Makefile.in: - * tests/shred/Makefile.in, tests/sort/Makefile.in: - * tests/stty/Makefile.in, tests/sum/Makefile.in: - * tests/tac/Makefile.in, tests/tail/Makefile.in: - * tests/tail-2/Makefile.in, tests/tee/Makefile.in: - * tests/test/Makefile.in, tests/touch/Makefile.in: - * tests/tr/Makefile.in, tests/tsort/Makefile.in: - * tests/unexpand/Makefile.in, tests/uniq/Makefile.in: - * tests/wc/Makefile.in: - Remove from CVS, since ./bootstrap generates them automatically. +2008-06-02 Eric Blake -2006-08-20 Eric Blake + export program_name, required by gnulib + * src/timeout.c (program_name): Export. - * src/stat.c (USE_STATVFS): Reinstate the patch from 2006-08-15; - the patch from 2006-08-18 broke on cygwin. +2008-06-02 Jim Meyering -2006-08-20 Jim Meyering + revert inadvertent change in last patch + * configure.ac (AM_INIT_AUTOMAKE): Restore accidentally-modified + options. Spotted by Eric Blake. - * NEWS: Add a line for 6.2-cvs. - * configure.ac (AC_INIT): Bump to 6.2 and add "-cvs" suffix. +2008-06-02 Pádraig Brady -2006-08-19 Jim Meyering + new program: timeout + * AUTHORS: Register as the author. + * NEWS: Mention this change. + * README: Add timeout command to list. + * src/timeout.c: New file. + * src/kill.c (operand2sig): Move function to its own file, + now that timeout.c will also use it. + * src/operand2sig.c (operand2sig): New file, extracted from kill.c. + * src/operand2sig.h (operand2sig): Declare. + * src/Makefile.am (EXTRA_PROGRAMS): Add timeout. + * src/.gitignore: Add timeout binary to list to ignore. + * doc/coreutils.texi (timeout invocation): Add timeout info. + (Signal specifications): New section, also referenced by kill. + * man/Makefile.am (timeout.1): Add dependency. + * man/timeout.x: New file. + * po/POTFILES.in: Add timeout.c and operand2sig.c to list to translate. + * tests/Makefile.am (TESTS): Add the two new tests. + * tests/misc/help-version: Add support for new timeout command. + * tests/misc/invalid-opt: Add support for new timeout command. + * tests/misc/timeout: New file: check basic timeout operation. + * tests/misc/timeout-parameters: New file: check invalid parameter + combinations. - * Version 6.1. - * NEWS: Record the 6.1 release date. - * configure.ac (AC_INIT): Remove "-cvs" suffix from version string. +2008-06-02 Jim Meyering - * tests/Makefile.am (EXTRA_DIST): Add sparse-file. + spell author names consistently + * src/comm.c (AUTHORS): Use RMS' middle initial. + * src/ls.c (AUTHORS): Likewise. + * src/rm.c (AUTHORS): Likewise. + * src/uniq.c (AUTHORS): Likewise. + * src/cut.c (AUTHORS): Use David M. Ihnat's middle initial. + * AUTHORS: Update to match. + Reported by Michael Piefel. - Avoid test failure when `make check' is run through debuild. - * tests/help-version: Ensure that $SHELL is set to some value - and exported. Patch from Sven Joachim. For details, see - . +2008-06-01 Simon Josefsson - * tests/ls/stat-dtype: Test for the 2006-08-17 `ls -CF' fix. + doc: adjust base64 documentation + * coreutils.texi (base64 invocation): Use RFC 4648 as the specification. + Move the URL down a bit in the text. - * README: Describe potential "pre-C99 build failure", and work-around. +2008-06-01 Erik Auerswald - Some of my 2006-07-03 changes to tests/*/Makefile.am were being - backed out due to updates provoked by the copyright changes. - * tests/Makefile.am.in (PATH): Prepend $(VG_PATH_PREFIX), so that - it propagates to the derived Makefile.am files. - ($(srcdir)/Makefile.am): Mark generated .am files as read-only, - so we don't mistakenly edit them again. - * tests/cut/Makefile.am: Regenerate. - * tests/head/Makefile.am: Likewise. - * tests/join/Makefile.am: Likewise. - * tests/pr/Makefile.am: Likewise. - * tests/sort/Makefile.am: Likewise. - * tests/tac/Makefile.am: Likewise. - * tests/tail/Makefile.am: Likewise. - * tests/test/Makefile.am: Likewise. - * tests/tr/Makefile.am: Likewise. - * tests/uniq/Makefile.am: Likewise. - * tests/wc/Makefile.am: Likewise. + md5sum: new option, --quiet, to suppress OK messages + sha1sum, sha224sum, sha384sum, and sha512sum accept it, too. + * src/md5sum.c: add option --quiet to suppress OK messages + * doc/coreutils.texi: document option --quiet + * tests/misc/md5sum: add test for option --quiet + * NEWS: mention new option --quiet for md5sum+sha*sum in "New + features" section - * NEWS: Fix cp --sparse so that it preserves tail-end sparseness, even - when the file's apparent size is not a multiple of its block size. - * src/copy.c (copy_reg): Don't write a NUL before calling ftruncate. - For some file sizes, writing that single byte would unnecessarily - waste a few file blocks. That write may have been necessary in the - early days of Linux, but now, removing it should be safe. - Based on a patch by Alan Curry: - * tests/cp/sparse: New test for the above. - * tests/cp/Makefile.am (TESTS): Add sparse. +2008-06-01 Jim Meyering - * tests/sparse-file: New file, essence factored out of... - * tests/du/8gb: ... here. Use the new script. + add rules to commit three post-release changes automatically + * maint.mk (noteworthy): Define. + (emit-commit-log): Define. + (alpha beta major): Also update NEWS and cfg.mk automatically, + and commit all three changes at once. -2006-08-18 Paul Eggert + update old_NEWS_hash + * cfg.mk (old_NEWS_hash): Update by running "make update-NEWS-hash". + Reported by Erik Auerswald. - * src/system.h (select_plural): Reduce by 1000000, not 1000, since - the CVS gettext manual now suggests 1000000. +2008-06-01 Simon Josefsson -2006-08-18 Bruno Haible + src/base64.c: Improve comments. - Add support for NetBSD 3.0. - * src/stat.c (USE_STATVFS): Set to 1 if 'struct statvfs' has a field - f_fstypename. - (STATXFS_FILE_SYSTEM_TYPE_MEMBER_NAME): Define also if 'struct statvfs' - has a field f_fstypename. - This undoes the 2006-08-15 to src/stat.c. +2008-06-01 Jim Meyering -2006-08-17 Paul Eggert + * NEWS: add header line for next release - Copyright notice fixes. + adjust format of .prev-version commit message + * maint.mk (alpha beta major): Start with "*", omit version number. - * COPYING: Upgrade to latest version from FSF. + * .prev-version: Record previous version. - * src/uname.c: Use (C) in copyright notice. +2008-05-31 Jim Meyering - * .vg-suppressions: Add copyright notice. - * ChangeLog: Likewise. - * ChangeLog-2005: Likewise. - * Makefile.am: Likewise. - * NEWS: Likewise. - * README: Likewise. - * README-valgrind: Likewise. - * TODO: Likewise. - * announce-gen: Likewise. - * man/Makefile.am: Likewise. - * man/chmod.x: Likewise. - * man/chown.x: Likewise. - * man/df.x: Likewise. - * man/du.x: Likewise. - * man/rm.x: Likewise. - * src/dircolors.hin: Likewise. - * src/du-tests: Likewise. - * src/extract-magic: Likewise. - * src/tac-pipe.c: Likewise. - * src/wheel-gen.pl: Likewise. - * tests/Coreutils.pm: Likewise. - * tests/Makefile.am.in: Likewise. - * tests/acl: Likewise. - * tests/envvar-check: Likewise. - * tests/expensive: Likewise. - * tests/group-names: Likewise. - * tests/help-version: Likewise. - * tests/mk-script: Likewise. - * tests/priv-check: Likewise. - * tests/rwx-to-mode: Likewise. - * tests/sample-test: Likewise. - * tests/setgid-check: Likewise. - * tests/chgrp/basic: Likewise. - * tests/chgrp/deref: Likewise. - * tests/chgrp/no-x: Likewise. - * tests/chgrp/posix-H: Likewise. - * tests/chgrp/recurse: Likewise. - * tests/chmod/c-option: Likewise. - * tests/chmod/equal-x: Likewise. - * tests/chmod/equals: Likewise. - * tests/chmod/no-x: Likewise. - * tests/chmod/octal: Likewise. - * tests/chmod/setgid: Likewise. - * tests/chmod/umask-x: Likewise. - * tests/chmod/usage: Likewise. - * tests/chown/basic: Likewise. - * tests/chown/deref: Likewise. - * tests/chown/separator: Likewise. - * tests/cp/Makefile.am: Likewise. - * tests/cp/acl: Likewise. - * tests/cp/backup-1: Likewise. - * tests/cp/backup-is-src: Likewise. - * tests/cp/cp-HL: Likewise. - * tests/cp/cp-deref: Likewise. - * tests/cp/cp-mv-backup: Likewise. + Version 6.12. + * NEWS: Record release date. + + install: reenable matchpathcon-related code + The underlying performance problem is being dealt with in Automake + by limiting the number of install invocations, and in SELinux with + incremental changes as well as a potential new implementation. + * src/Makefile.am (ginstall_CPPFLAGS) [ENABLE_MATCHPATHCON]: Define. + * src/install.c [ENABLE_WHEN_MATCHPATHCON_IS_MORE_EFFICIENT]: + Rename to ENABLE_MATCHPATHCON. + * NEWS: mention this change + +2008-05-30 Jim Meyering + + configure.ac: remove explicit use of AB_INIT + * configure.ac: Don't invoke AB_INIT directly, now that it's + done automatically via gl_INIT. + + tests: ignore known failure on all Darwin 8.x / Mac OS X v10.4.x + * tests/chgrp/basic: Update comment and host_triplet version test. + + tests: avoid failure with older version of Perl's File::Temp + * tests/CuTmpdir.pm (import): Use &File::Temp::cleanup only + if it is defined. Reported by Bruno Haible in + http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/13652 + + NEWS: mention that cp -p copies permissions more portably + Based on wording suggested by Bruno Haible. + +2008-05-29 Jim Meyering + + improve description of du's--separate-dirs option + * coreutils.texi (du invocation): Prompted by Volker Badziong's + report in http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/13646 + + du.c: tiny cleanup (no semantic change) + * src/du.c (process_file): Use "file", rather than + equivalent "ent->fts_path". + +2008-05-27 Jim Meyering + + in 280+ tests/* files, use $srcdir, not $top_srcdir/tests + + prefer abs_srcdir over abs_top_srcdir, ... + so that e.g., tests/* may refer to absolute names without + hard-coding the name of the containing directory (tests/, here). + * tests/check.mk (TESTS_ENVIRONMENT): Define abs_srcdir. + * tests/pr/pr-tests: Use $abs_srcdir/pr not $abs_top_srcdir/tests/pr. + * tests/chmod/c-option: Use $abs_srcdir, not $abs_top_srcdir/tests. * tests/cp/cp-parents: Likewise. - * tests/cp/deref-slink: Likewise. - * tests/cp/dir-rm-dest: Likewise. - * tests/cp/dir-slash: Likewise. - * tests/cp/dir-vs-file: Likewise. - * tests/cp/fail-perm: Likewise. - * tests/cp/into-self: Likewise. - * tests/cp/link: Likewise. - * tests/cp/link-no-deref: Likewise. - * tests/cp/link-preserve: Likewise. - * tests/cp/no-deref-link1: Likewise. - * tests/cp/no-deref-link2: Likewise. - * tests/cp/no-deref-link3: Likewise. - * tests/cp/perm: Likewise. - * tests/cp/preserve-2: Likewise. - * tests/cp/r-vs-symlink: Likewise. - * tests/cp/same-file: Likewise. - * tests/cp/slink-2-slink: Likewise. - * tests/cp/special-bits: Likewise. - * tests/cp/symlink-slash: Likewise. - * tests/cut/Makefile.am: Likewise. - * tests/cut/Test.pm: Likewise. - * tests/dd/misc: Likewise. - * tests/dd/not-rewound: Likewise. - * tests/dd/skip-seek: Likewise. - * tests/dd/skip-seek2: Likewise. - * tests/dd/unblock-sync: Likewise. - * tests/dircolors/simple: Likewise. - * tests/du/2g: Likewise. - * tests/du/8gb: Likewise. - * tests/du/Makefile.am: Likewise. - * tests/du/basic: Likewise. - * tests/du/deref: Likewise. - * tests/du/deref-args: Likewise. - * tests/du/exclude: Likewise. - * tests/du/fd-leak: Likewise. - * tests/du/files0-from: Likewise. - * tests/du/hard-link: Likewise. - * tests/du/inaccessible-cwd: Likewise. - * tests/du/long-from-unreadable: Likewise. - * tests/du/long-sloop: Likewise. - * tests/du/no-deref: Likewise. - * tests/du/no-x: Likewise. - * tests/du/restore-wd: Likewise. - * tests/du/slash: Likewise. - * tests/du/slink: Likewise. - * tests/du/trailing-slash: Likewise. - * tests/du/two-args: Likewise. - * tests/expr/basic: Likewise. - * tests/factor/basic: Likewise. - * tests/fmt/basic: Likewise. - * tests/fmt/long-line: Likewise. - * tests/general/Makefile.am: Likewise. - * tests/general/atgeneral.m4: Likewise. - * tests/general/dd.at: Likewise. - * tests/head/Makefile.am: Likewise. - * tests/head/Test.pm: Likewise. - * tests/install/basic-1: Likewise. - * tests/install/create-leading: Likewise. - * tests/install/d-slashdot: Likewise. - * tests/install/trap: Likewise. - * tests/join/Makefile.am: Likewise. - * tests/join/Test.pm: Likewise. - * tests/ln/backup-1: Likewise. - * tests/ln/misc: Likewise. - * tests/ln/sf-1: Likewise. - * tests/ln/target-1: Likewise. - * tests/ls/Makefile.am: Likewise. - * tests/ls/Test.pm: Likewise. - * tests/ls/dangle: Likewise. - * tests/ls/dired: Likewise. - * tests/ls/file-type: Likewise. - * tests/ls/follow-slink: Likewise. - * tests/ls/infloop: Likewise. - * tests/ls/inode: Likewise. - * tests/ls/m-option: Likewise. - * tests/ls/no-arg: Likewise. - * tests/ls/recursive: Likewise. - * tests/ls/rt-1: Likewise. - * tests/ls/stat-dtype: Likewise. - * tests/ls/stat-failed: Likewise. - * tests/ls/stat-vs-dirent: Likewise. - * tests/ls/symlink-slash: Likewise. - * tests/ls/time-1: Likewise. - * tests/ls-2/tests: Likewise. - * tests/md5sum/basic-1: Likewise. - * tests/md5sum/newline-1: Likewise. - * tests/misc/Makefile.am: Likewise. - * tests/misc/base64: Likewise. - * tests/misc/basename: Likewise. - * tests/misc/cat-proc: Likewise. - * tests/misc/close-stdout: Likewise. - * tests/misc/csplit: Likewise. - * tests/misc/date: Likewise. - * tests/misc/date-sec: Likewise. - * tests/misc/df: Likewise. - * tests/misc/dirname: Likewise. - * tests/misc/expand: Likewise. - * tests/misc/false-status: Likewise. - * tests/misc/fold: Likewise. - * tests/misc/head-c: Likewise. - * tests/misc/head-elide-tail: Likewise. - * tests/misc/head-pos: Likewise. - * tests/misc/mknod: Likewise. - * tests/misc/nice: Likewise. - * tests/misc/nl: Likewise. - * tests/misc/nohup: Likewise. - * tests/misc/paste-no-nl: Likewise. - * tests/misc/pathchk1: Likewise. - * tests/misc/printf: Likewise. - * tests/misc/printf-hex: Likewise. - * tests/misc/pwd-long: Likewise. - * tests/misc/sha224sum: Likewise. - * tests/misc/sha256sum: Likewise. - * tests/misc/sha384sum: Likewise. - * tests/misc/sha512sum: Likewise. - * tests/misc/shuf: Likewise. - * tests/misc/sort-merge: Likewise. - * tests/misc/sort-rand: Likewise. - * tests/misc/split-a: Likewise. - * tests/misc/split-fail: Likewise. - * tests/misc/split-l: Likewise. - * tests/misc/stat-fmt: Likewise. - * tests/misc/stat-printf: Likewise. - * tests/misc/tac-continue: Likewise. - * tests/misc/test-diag: Likewise. - * tests/misc/tty-eof: Likewise. - * tests/misc/wc-files0: Likewise. - * tests/misc/wc-files0-from: Likewise. - * tests/mkdir/concurrent-1: Likewise. - * tests/mkdir/p-1: Likewise. - * tests/mkdir/p-2: Likewise. - * tests/mkdir/p-3: Likewise. - * tests/mkdir/p-slashdot: Likewise. - * tests/mkdir/p-thru-slink: Likewise. * tests/mkdir/parents: Likewise. * tests/mkdir/perm: Likewise. - * tests/mkdir/special-1: Likewise. - * tests/mkdir/t-slash: Likewise. - * tests/mkdir/writable-under-readonly: Likewise. - * tests/mv/Makefile.am: Likewise. * tests/mv/acl: Likewise. - * tests/mv/atomic: Likewise. * tests/mv/backup-is-src: Likewise. - * tests/mv/childproof: Likewise. - * tests/mv/diag: Likewise. - * tests/mv/dir-file: Likewise. - * tests/mv/dir2dir: Likewise. - * tests/mv/dup-source: Likewise. - * tests/mv/force: Likewise. - * tests/mv/hard-2: Likewise. - * tests/mv/hard-3: Likewise. - * tests/mv/hard-4: Likewise. * tests/mv/hard-link-1: Likewise. - * tests/mv/i-1: Likewise. - * tests/mv/i-2: Likewise. - * tests/mv/i-3: Likewise. - * tests/mv/i-4: Likewise. - * tests/mv/i-link-no: Likewise. - * tests/mv/into-self: Likewise. * tests/mv/into-self-2: Likewise. - * tests/mv/into-self-3: Likewise. - * tests/mv/into-self-4: Likewise. * tests/mv/leak-fd: Likewise. * tests/mv/mv-special-1: Likewise. - * tests/mv/no-target-dir: Likewise. * tests/mv/part-fail: Likewise. * tests/mv/part-hardlink: Likewise. * tests/mv/part-rename: Likewise. * tests/mv/part-symlink: Likewise. * tests/mv/partition-perm: Likewise. - * tests/mv/perm-1: Likewise. - * tests/mv/reply-no: Likewise. - * tests/mv/setup: Likewise. + * tests/mv/sticky-to-xpart: Likewise. * tests/mv/to-symlink: Likewise. - * tests/mv/trailing-slash: Likewise. - * tests/mv/update: Likewise. - * tests/mv/vfat: Likewise. - * tests/od/od-N: Likewise. - * tests/od/x8: Likewise. - * tests/pr/Makefile.am: Likewise. - * tests/pr/Test.pm: Likewise. - * tests/readlink/can-e: Likewise. - * tests/readlink/can-f: Likewise. - * tests/readlink/can-m: Likewise. - * tests/readlink/rl-1: Likewise. - * tests/rm/Makefile.am: Likewise. - * tests/rm/cycle: Likewise. - * tests/rm/dangling-symlink: Likewise. - * tests/rm/deep-1: Likewise. - * tests/rm/dir-no-w: Likewise. - * tests/rm/dir-nonrecur: Likewise. - * tests/rm/dot-rel: Likewise. - * tests/rm/empty-inacc: Likewise. - * tests/rm/empty-name: Likewise. - * tests/rm/f-1: Likewise. - * tests/rm/fail-2eperm: Likewise. - * tests/rm/fail-eperm: Likewise. + * tests/rm/one-file-system: Likewise. + * tests/sample-test: Likewise. + + tests: generalize my-distcheck + * maint.mk (my-distcheck): Accommodate missing gnulib-tests. + +2008-05-26 Jim Meyering + + reflect renaming of acl.c in gnulib + * POTFILES.in: s/acl.c/set-mode-acl.c/ + + test installation results more thoroughly + * maint.mk (my-distcheck): Ensure that properly-named binaries + are installed. Also check all man pages, except [.1. + Move configure-time --prefix= to install-time prefix=. + (my-instcheck, install-transform-check): Define. + + install many binaries at once, when possible + * src/Makefile.am (install-exec-am): Override the standard + automake-generated target, so we can decide whether to use + the usual install-one-by-one rule, or whether we can use + the new install-many-at-once rule: + (cu-install-binPROGRAMS): New rule. + + * src/runcon.c: Add copyright comment. + + adjust AUTHORS and check-AUTHORS rule to accommodate + * AUTHORS: Add coding: utf-8 comment at end. + Spell François' and Torbjörn's names properly. + * src/Makefile.am: Parse AUTHORS file more carefully. + Use perl to join now-split lines. + Use en_US.UTF-8 to generate --version output. + + * src/c99-to-c89.diff: Adjust offsets. + + adjust copyright dates + + convert the rest to use proper_name -- manually + * src/base64.c (AUTHORS): Rename from AUTHOR, for consistency. + + convert 3-author programs to use proper_name + g grep -E -l 'define AUTHORS "[^,]+", "[^,]+", "[^,]+"$'|xargs perl -pi -e \ + 's/(define AUTHORS) ("[^,]+"), ("[^,]+"), ("[^,]+")$/$1 \\\n proper_name ($2), \\\n proper_name ($3), \\\n proper_name ($4)/' + + convert 2-author programs to use proper_name + g grep -E -l 'define AUTHORS "[^,]+", "[^,]+"$'|xargs perl -pi -e \ + 's/(define AUTHORS) ("[^,]+"), ("[^,]+")$/$1 \\\n proper_name ($2), \\\n proper_name ($3)/' + + convert single-author programs to use proper_name + g grep -E -l 'define AUTHORS "[^,]+"$'|xargs perl -pi -e \ + 's/(define AUTHORS) ("[^,]+")$/$1 proper_name ($2)/' + + use gnulib's proper_name_utf8 function, but *not* proper_name + * bootstrap.conf (gnulib_modules): Add propername. + (XGETTEXT_OPTIONS): Add options to tell xgettext about the functions. + * src/cat.c, src/cp.c, src/df.c, src/du.c, src/split.c: + Mark Torbjörn Granlund's name. + * src/ptx.c: Mark François Pinard's name. + Use "TRANSLATORS:" comment marker, rather than "Note to translators:". + * src/system.h: Include propername.h. + (proper_name): Define away. + * src/Makefile.am (cat_LDADD, df_LDADD, du_LDADD, ptx_LDADD, split_LDADD): + Initialize, so we can... + (cat_LDADD, cp_LDADD, df_LDADD, du_LDADD, ptx_LDADD, split_LDADD): + ...Use "+=" to append $(LIBICONV) for each program that uses + proper_name_utf8. + +2008-05-24 Jim Meyering + + * POTFILES.in: Add lib/copy-acl.c. + +2008-05-20 Jim Meyering + + install: avoid a leak in currently-ifdef'd-out code + * src/install.c (setdefaultfilecon) + [ENABLE_WHEN_MATCHPATHCON_IS_MORE_EFFICIENT]: + Call matchpathcon_init_prefix only once. + Suggestion from Stephen Smalley. Reported by Ben Webb in + . + +2008-05-19 Jim Meyering + + use gnulib's base64 module, now that it's sync'd to match this one + * gl/lib/base64.c: Remove file. + * gl/lib/base64.h: Remove file. + +2008-05-19 Pádraig Brady + + doc: clarify field delimiter description in uniq --help output + * src/uniq.c: Clarify in help output that field delimiters are + blanks and not the larger set of whitespace characters. + +2008-05-17 Jim Meyering + + tests: skip when a debian libc6-2.7-11 bug makes printf segfault + * tests/misc/printf-surprise: Detect case of a low-memory-provoked + segfault and skip the test (this is actually a bug in snprintf). + For details, see http://bugs.debian.org/481543 + + tests: sync and update wc and du --files0-from tests + * tests/du/files0-from: Sync from tests/misc/wc-files0-from. + (minus-in-minus): New test. + Adjust for new diagnostics. + * tests/misc/wc-files0-from: Adjust for new diagnostics. + + du, wc: merge improved --files0-from=F-related diagnostics + du gave a better diagnostic for one unusual case, + and wc gave a better diagnostic for a different one. + Now each diagnoses both unusual cases. + * src/du.c (main): Disallow '-' as file name when reading from stdin. + * src/wc.c (main): Give a better diagnostic for a zero-length file name. + + test invalid-option handling in all programs + * tests/Makefile.am (TESTS): Add misc/invalid-opt. + * tests/misc/invalid-opt: New file. + + tests: remove ugly /bin/sh wrapper around each perl-based test script + * tests/check.mk (TESTS_ENVIRONMENT): Save and restore TMPDIR around + envvar-check, so that the few scripts that require $TMPDIR don't fail. + This is also good to let a user's default TMPDIR setting be used e.g., + in the search for an 'other-partition'. + FIXME: this is pretty ugly. maybe undo it and find a better way. + (TESTS_ENVIRONMENT): Invoke perl scripts with $(PERL), and use -T + if the script requires that. Otherwise, use $(SHELL). + + * tests/misc/md5sum-newline: Create a file whose name contains + a newline in Perl (resort to using "system", since open refuses). + + Fix old brokenness exposed by this change: + * tests/du/files0-from: Correct test not to rely on stdin + being attached to a non-tty. + * tests/misc/sort (3g, 3h, 3i): Likewise: add explicit empty input file. + Avoid warnings about using qw()-around-commas. + + * tests/rm/fail-eperm: Now that this test is run from a temporary + subdirectory, adjust the full name of the "rm" program we're going + to run. + + Change #!/bin/sh to #!/usr/bin/perl, and factor out the few lines + of boilerplate code to invoke perl. Do not "require 5.00x"; + a configure-time Perl test handles that + * tests/dd/skip-seek: + * tests/misc/base64: + * tests/misc/basename: + * tests/misc/cut: + * tests/misc/date: + * tests/misc/dircolors: + * tests/misc/dirname: + * tests/misc/expand: + * tests/misc/expr: + * tests/misc/factor: + * tests/misc/fmt: + * tests/misc/fold: + * tests/misc/head: + * tests/misc/head-elide-tail: + * tests/misc/join: + * tests/misc/ls-misc: + * tests/misc/md5sum: + * tests/misc/md5sum-newline: + * tests/misc/mktemp: + * tests/misc/od: + * tests/misc/paste: + * tests/misc/pr: + * tests/misc/printf-cov: + * tests/misc/seq: + * tests/misc/sha1sum: + * tests/misc/sha1sum-vec: + * tests/misc/sha224sum: + * tests/misc/sha256sum: + * tests/misc/sha384sum: + * tests/misc/sha512sum: + * tests/misc/sort-merge: + * tests/misc/stat-printf: + * tests/misc/sum: + * tests/misc/tac: + * tests/misc/tail: + * tests/misc/test: + * tests/misc/test-diag: + * tests/misc/tr: + * tests/misc/tsort: + * tests/misc/tty-eof: + * tests/misc/unexpand: + * tests/misc/uniq: + * tests/misc/wc: + * tests/misc/wc-files0-from: + * tests/misc/xstrtol: + * tests/mv/i-1: + * tests/pr/pr-tests: + * tests/rm/empty-name: + * tests/rm/fail-eperm: + * tests/rm/unreadable: + +2008-05-16 Jim Meyering + + tests: allow to run Perl tests more cleanly + Before this change, perl tests were run via a #!/bin/sh script + in which perl was invoked via $(PERL) ... -- - <<\EOF. + That made some stty tests fail due to the way stdin was usurped. + * build-aux/check.mk (am__check_pre): Don't append $(SHELL) to this + nominally automake-internal variable. + * tests/check.mk (TESTS_ENVIRONMENT): Instead, define a shell function + here, and append it to the more user-visible $(TESTS_ENVIRONMENT). + + tests: env-related clean up + * tests/Coreutils.pm: tiny clean-up: s/env/env --/ + * tests/misc/help-version: Use "env" rather than an absolute file + name prefix. + * tests/misc/printf-surprise: Likewise. + + tests: improve coverage of printf.c + * tests/misc/printf-cov: New file. + * tests/Makefile.am (TESTS): Add misc/printf-cov. + * tests/misc/help-version: Use env rather than abs file name prefix. + + make HACKING slightly more generic + * HACKING: remove some uses of "coreutils" + Point to git's own SubmittingPatches URL. + +2008-05-15 Bruno Haible + + doc: some Unicode characters cannot be specified via \u or \U + * doc/coreutils.texi (printf invocation): Clarify invalid ranges for + Unicode character escape syntax. + +2008-05-11 Jim Meyering + + move sha256 and sha512 modules to gnulib + * bootstrap.conf (gnulib_modules) [sha256, sha512]: Add "crypto/" + prefix to module name, now that they come from gnulib. + * gl/lib/sha256.c: Remove file. + * gl/lib/sha256.h: Likewise. + * gl/lib/sha512.c: Likewise. + * gl/lib/sha512.h: Likewise. + * gl/lib/u64.h: Likewise. + * gl/m4/sha256.m4: Likewise. + * gl/m4/sha512.m4: Likewise. + * gl/modules/sha256: Likewise. + * gl/modules/sha512: Likewise. + +2008-05-10 Jim Meyering + + now that the last of the mk-script-using tests is gone... + * tests/Makefile.am (EXTRA_DIST): Remove Makefile.am.in and mk-script. + Move/adjust SUBDIRS-related comments. + * tests/Makefile.am.in: Remove file, no longer used. + * tests/mk-script: Likewise. + * bootstrap: Remove coreutils-specific SUBDIRS-related code. + + tests: remove directory, tests/join/ + * configure.ac (AC_CONFIG_FILES): Remove tests/join/Makefile. + * tests/misc/join: New file, with tests from... + * tests/join/Test.pm: ...here. Remove file. + * tests/Makefile.am (SUBDIRS): Remove definition. + + * tests/misc/tac: Also perform stdin and piped tests. + + tests: convert pr tests + * configure.ac (AC_CONFIG_FILES): Remove tests/pr/Makefile. + * tests/Makefile.am (SUBDIRS): Remove pr. + * tests/pr/pr-tests: New file, with tests from... + * tests/pr/Test.pm: ...here. Remove file. + * tests/Makefile.am (EXTRA_DIST): Add $(pr_data). + (pr_data): List all of the pr's test-related data files. + + tests: remove directory, tests/tail/ + * configure.ac (AC_CONFIG_FILES): Remove tests/tail/Makefile. + * tests/Makefile.am (SUBDIRS): Remove tail. + * tests/misc/tail: New file, with tests from... + * tests/tail/Test.pm: ...here. Remove file. + +2008-05-09 Bernhard Marx + + doc: improve description of "niceness" values + * doc/coreutils.texi (nice invocation): + +2008-05-09 Jim Meyering + + tests: remove directory, tests/sort/ + * configure.ac (AC_CONFIG_FILES): Remove tests/sort/Makefile. + * tests/Makefile.am (SUBDIRS): Remove sort. + * tests/misc/sort: New file, with tests from... + * tests/sort/Test.pm: ...here. Remove file. + +2008-05-08 Bruno Haible + + Speed up "wc -m" and "wc -w" in multibyte case. + * src/wc.c: Include mbchar.h. + (wc): New variable in_shift. Use it to avoid calling mbrtowc for most + ASCII characters. Reported via Jan Engelhardt in + http://bugzilla.novell.com/381873 with discussion here + http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/13520 + +2008-05-08 Jim Meyering + + tests: remove directory, tests/tac/ + * configure.ac (AC_CONFIG_FILES): Remove tests/tac/Makefile. + * tests/Makefile.am (SUBDIRS): Remove tac. + * tests/misc/tac: Many new tests, from... + * tests/tac/Test.pm: ...here. Remove file. + + tests: remove directory, tests/test/ + * configure.ac (AC_CONFIG_FILES): Remove tests/test/Makefile. + * tests/Makefile.am (SUBDIRS): Remove test. + * tests/misc/test: Many new tests, from... + * tests/test/Test.pm: ...here. Remove file. + + tests: Coreutils.pm: support running a program that is a shell built-in + * tests/Coreutils.pm (run_tests): Add support for running a + program like 'test', that is a shell built-in. + +2008-05-06 Jim Meyering + + * TODO: Bo Borgerson is rewriting support for cp --recursive + + tests: remove directory, tests/tr/ + * configure.ac (AC_CONFIG_FILES): Remove tests/tr/Makefile. + * tests/Makefile.am (SUBDIRS): Remove tr. + * tests/misc/tr: Many new tests, from... + * tests/tr/Test.pm: ...here. Remove file. + * tests/tr/failures: Remove file. + * tests/tr/TODO: Remove file. + + tests: skip another test if mcstransd is running + * tests/test-lib.sh (skip_if_mcstransd_is_running_): New function, + extracted from... + * tests/misc/chcon: ...here. Use function, not open-coded test. + * tests/misc/selinux: Use the function here, too. + Require root, not non-root. + * tests/Makefile.am (root_tests): Add misc/selinux. + + tests: translate uniq-z-test-adding code to new framework + * tests/misc/uniq (add-z-variants): New function. + Use it. + + tests: remove directory, tests/uniq/ + * configure.ac (AC_CONFIG_FILES): Remove tests/uniq/Makefile. + * tests/Makefile.am (SUBDIRS): Remove uniq. + * tests/misc/uniq: Many new tests, from... + * tests/uniq/Test.pm: ...here. Remove file. + + tests: remove directory, tests/cut/ + * configure.ac (AC_CONFIG_FILES): Remove tests/cut/Makefile. + * tests/Makefile.am (SUBDIRS): Remove cut. + * tests/misc/cut: Many new tests, from... + * tests/cut/Test.pm: ...here. Remove file. + + tests: remove directory, tests/head/ + * configure.ac (AC_CONFIG_FILES): Remove tests/head/Makefile. + * tests/Makefile.am (SUBDIRS): Remove head. + * tests/misc/head: New file, derived from ... + * tests/head/Test.pm: ...this. Remove file. + * tests/head/in: Remove file. + * tests/head/in-1024: Remove file. + * tests/Coreutils.pm (triple_test): New function. + + tests: Coreutils.pm improvements + * tests/Coreutils.pm: Allow test names longer than 12. + Print a useful diagnostic for bogus spec entry. + + Handle the combination of IN_PIPE and ENV properly. + * tests/Coreutils.pm (run_tests): Put ENV right before command, + not before the "cat INPUT_FILE |" prefix. + + tests: move "sparse-file" into test-lib.sh + * tests/sparse-file: Remove file Move contents into ... + * tests/test-lib.sh (require_sparse_support_): ...here. New function. + * tests/cp/sparse: Use the function, not the file. + * tests/du/8gb: Likewise. + * tests/Makefile.am (EXTRA_DIST): Remove sparse-file. + + tests: move "group-names" into test-lib.sh + * tests/group-names: Remove file Move contents into ... + * tests/test-lib.sh (require_membership_in_two_groups_): ...here. New function. + * tests/chgrp/basic: Use the function, not the file. + * tests/chgrp/default-no-deref: Likewise. + * tests/chgrp/deref: Likewise. + * tests/chgrp/no-x: Likewise. + * tests/chgrp/posix-H: Likewise. + * tests/chgrp/recurse: Likewise. + * tests/cp/existing-perm-race: Likewise. + * tests/Makefile.am (EXTRA_DIST): Remove group-names. + + tests: use printf+sed rather than yes+head+tr + * tests/misc/fmt-long-line: Minor clean-up. + Using "yes" like that has caused trouble in the past. + + tests: save and restore TERM around use of TESTS_ENVIRONMENT, + now that TESTS_ENVIRONMENT unsets it. + * check.mk (am__check_pre): Save $TERM. + (am__check_post): Restore saved value of TERM and export. + + tests: hoist the sourcing of "lang-default" + * tests/check.mk (TESTS_ENVIRONMENT): Source lang-default here, ... + ... rather than in each of 100+ test scripts. + * tests/chgrp/basic: + * tests/chgrp/no-x: + * tests/chmod/c-option: + * tests/chmod/no-x: + * tests/chmod/setgid: + * tests/chmod/thru-dangling: + * tests/chmod/umask-x: + * tests/chmod/usage: + * tests/chown/basic: + * tests/chown/deref: + * tests/chown/preserve-root: + * tests/cp/abuse: + * tests/cp/acl: + * tests/cp/backup-is-src: + * tests/cp/cp-a-selinux: + * tests/cp/cp-i: + * tests/cp/cp-mv-backup: + * tests/cp/deref-slink: + * tests/cp/fail-perm: + * tests/cp/into-self: + * tests/cp/link-preserve: + * tests/cp/preserve-gid: + * tests/cp/same-file: + * tests/cp/slink-2-slink: + * tests/cp/special-f: + * tests/cp/symlink-slash: + * tests/cp/thru-dangling: + * tests/du/basic: + * tests/du/hard-link: + * tests/du/inacc-dest: + * tests/du/long-sloop: + * tests/du/no-x: + * tests/install/basic-1: + * tests/ln/hard-backup: + * tests/ln/sf-1: + * tests/ls/file-type: + * tests/ls/infloop: + * tests/ls/nameless-uid: + * tests/ls/rt-1: + * tests/ls/stat-failed: + * tests/ls/symlink-slash: + * tests/ls/x-option: + * tests/misc/chcon: + * tests/misc/chcon-fail: + * tests/misc/csplit: + * tests/misc/df-P: + * tests/misc/groups-dash: + * tests/misc/groups-version: + * tests/misc/nohup: + * tests/misc/printf-surprise: + * tests/misc/runcon-no-reorder: + * tests/misc/selinux: + * tests/misc/split-a: + * tests/misc/split-fail: + * tests/misc/tac-continue: + * tests/misc/wc-files0: + * tests/mkdir/p-v: + * tests/mkdir/selinux: + * tests/mv/acl: + * tests/mv/backup-dir: + * tests/mv/backup-is-src: + * tests/mv/childproof: + * tests/mv/diag: + * tests/mv/dir2dir: + * tests/mv/dup-source: + * tests/mv/force: + * tests/mv/hard-link-1: + * tests/mv/hard-verbose: + * tests/mv/i-2: + * tests/mv/i-3: + * tests/mv/i-4: + * tests/mv/i-5: + * tests/mv/i-link-no: + * tests/mv/into-self: + * tests/mv/into-self-2: + * tests/mv/into-self-3: + * tests/mv/mv-special-1: + * tests/mv/part-fail: + * tests/mv/part-symlink: + * tests/mv/partition-perm: + * tests/mv/perm-1: + * tests/mv/reply-no: + * tests/mv/sticky-to-xpart: + * tests/mv/update: + * tests/rm/cycle: + * tests/rm/dir-no-w: + * tests/rm/dir-nonrecur: + * tests/rm/fail-2eperm: + * tests/rm/fail-eacces: + * tests/rm/inaccessible: + * tests/rm/interactive-always: + * tests/rm/interactive-once: + * tests/rm/isatty: + * tests/rm/one-file-system: + * tests/rm/r-1: + * tests/rm/r-2: + * tests/rm/rm1: + * tests/rm/rm2: + * tests/rm/rm3: + * tests/rm/rm4: + * tests/rm/rm5: + * tests/rm/unread2: + * tests/rm/v-slash: + * tests/touch/fail-diag: + * tests/touch/not-owner: + + tests: hoist envvar-check so it is run for every test + I.e., also for Perl-based tests; not just the ones using test-lib.sh. + * tests/check.mk (TESTS_ENVIRONMENT): Source envvar-check here, ... + * tests/test-lib.sh: ...not here. + + fix typo in comments: s/ouput/output/ + adjust spelling in that same comment: s/localisation/localization/ + + * tests/touch/Makefile.am: Remove now-unused file. + + tests: test split more thoroughly + * tests/misc/split-a: Clean up. Catch more failures. + + * tests/misc/wc: Remove an unused variable. + + tests: detect and check more uses of strcmp + * maint.mk (sc_prohibit_strcmp): Relax regexp to recognize other + formatting styles. + + avoid problems with sign-extended "char" operand to is* functions + * src/cut.c (set_fields): Apply to_uchar to isblank operands. + * src/uniq.c (find_field): Likewise. + * src/seq.c (scan_arg): Likewise, for isspace. + * tests/misc/uniq: New file. Test for the above, but only + when isspace(0240). + * tests/Makefile.am (TESTS): Add misc/uniq. + * configure.ac: Use gt_LOCALE_FR. + * tests/check.mk (TESTS_ENVIRONMENT): Propagate LOCALE_FR to scripts. + * NEWS: Mention the bug fixes. + + Before this patch, on FreeBSD 6: + + $ printf 'x y z\nx \xa0 y z\n' > in + $ LC_ALL=fr_FR.UTF-8 uniq -f2 in|tr ' ' . + x.y.z + x. .y.z + + With the patch: + + $ LC_ALL=fr_FR.UTF-8 uniq -f2 in|tr ' ' . + x.y.z + + This also affected many other locales: + for i in $(locale -a); do test $(LC_ALL=$i ./uniq -f1 in|wc -l) + = $(LC_ALL=$i uniq -f1 in|wc -l) || echo $i ; done + ... + en_GB.ISO8859-1 + en_GB.ISO8859-15 + en_GB.UTF-8 + en_IE.UTF-8 + en_NZ.ISO8859-1 + en_NZ.ISO8859-15 + en_NZ.UTF-8 + en_US.ISO8859-1 + en_US.ISO8859-15 + en_US.UTF-8 + ... + +2008-05-06 Bo Borgerson + + base64: remove some unused/redundant getopt code + * src/base64.c (struct option long_option): Remove redundant help/version + option items. + (main): Remove unused 'q' from short options. + +2008-05-06 Jim Meyering + + help2man: fix perl 5.10 problem properly + * man/help2man: Do pull LC_ALL via "use POSIX". + Instead, limit the importing of gettext-related symbols + to just those two we'll use: gettext and textdomain. + +2008-05-05 Jim Meyering + + help2man: avoid failure with Debian unstable's Perl 5.10.0 + Avoid failure that produced this diagnostic: + Constant subroutine main::LC_ALL redefined at /.../Exporter.pm + * man/help2man: Don't include LC_ALL in the "use POSIX" list, + since Locale::gettext->import will get it. + +2008-05-05 Bo Borgerson + + base64 module: adjust API so it's compatible with gnulib's + * gl/lib/base64.c (base64_decode_ctx): If no context structure was passed in, + treat newlines as garbage (this is the historical behavior). Formerly + base64_decode. + (base64_decode_alloc_ctx): Formerly base64_decode_alloc. + * gl/lib/base64.h (base64_decode): Macro for four-argument calls. + (base64_decode_alloc): Likewise. + * src/base64.c (do_decode): Call base64_decode_ctx instead of base64_decode. + +2008-05-05 Jim Meyering + + * tests/misc/tac: Set execute bit. + + tac: avoid segfault for e.g., "echo > x; tac -r x x" + * src/tac.c (tac_seekable): Move local "regs" declaration out + to file scope, so its values aren't clobbered between calls. + Discovered by Cristian Cadar, Daniel Dunbar and Dawson Engler, + reported in http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/13501 + * NEWS: Mention the bug fix. + * tests/Makefile.am (TESTS): Add misc/tac. + * tests/misc/tac: New file. Test for the above. + +2008-04-30 Jim Meyering + + tests: avoid a "make check-root" failure when mcstransd is running + * tests/misc/chcon: Skip this test if mcstransd seems to be running. + + tests: avoid spurious "make check-root" failure + * README (Running tests as root): Also set PATH in suggested "sudo" + command. This avoids failure of at least tests/cp/cp-a-selinux + when the default PATH does not contain /sbin. + * tests/cp/cp-a-selinux: Don't redirect stderr to /dev/null. + "mkfs" was failing due to /sbin not being in PATH. + +2008-04-30 Bo Borgerson + + Add Daniel Dunbar's lcov instructions to HACKING + * HACKING: New section `Finding things to do', points to TODO file and + gives instructions on generating an html coverage report as provided by + Daniel Dunbar. + * TODO: Add item for improving test coverage. Point back to HACKING. + +2008-04-29 Jim Meyering + + chcon, runcon: make --help print the bug-reporting address + * src/chcon.c (usage): Use emit_bug_reporting_address. + * src/runcon.c (usage): Likewise. + * tests/misc/help-version: Don't exempt chcon and runcon. + * NEWS: Mention this. + +2008-04-28 Jim Meyering + + tests: don't hard-code coreutils list of tests/ SUBDIRS in bootstrap + * bootstrap: Extract the list from tests/Makefile.am, and die + when it is empty -- it will be, eventually. + +2008-04-28 Bo Borgerson + + tests: remove references to tests/wc from bootstrap + * bootstrap: Don't try to initialize anything in tests/wc. + +2008-04-28 Jim Meyering + + tests: slightly relax sc_cast_of_argument_to_free syntax check + * maint.mk (sc_cast_of_argument_to_free): Relax regexp slightly. + (sc_no_have_config_h): Add a comment. + +2008-04-28 Bo Borgerson + + tests: don't chmod after a failed chdir in cleanup + * tests/CuTmpdir.pm (chmod_tree): Don't chmod if chdir failed. + + Only cleanup test dirs from the process that created them. + * tests/CuTmpdir.pm (import): Use closure around current PID to avoid cleanup races. + +2008-04-27 Jim Meyering + + move wc tests from own subdir into a single script + * configure.ac (AC_CONFIG_FILES): Remove wc/Makefile from the list. + * tests/Makefile.am (SUBDIRS): Remove wc from the list. + (TESTS): Add misc/wc. + * tests/misc/wc: New file, derived from tests/wc/Tests.pm. + * tests/wc/Test.pm: Remove file. + + tests: remove temporary log file upon catchable signal + * check.mk (am__check_pre): Add signal handler to remove $@-t. + + tests: don't source envvar-check manually, test-lib.sh does it + * tests/cp/abuse: Remove ". $top_srcdir/tests/envvar-check". + * tests/cp/parent-perm: Likewise. + * tests/cp/special-f: Likewise. + * tests/ls/proc-selinux-segfault: Likewise. + * tests/misc/help-version: Likewise. + * tests/mkdir/selinux: Likewise. + * tests/mv/sticky-to-xpart: Likewise. + * tests/touch/now-owned-by-other: Likewise. + * tests/sample-test: Remove commented out suggestion. + + tests: ensure at least one failure when $built_programs is empty + Before, this test and others would pass with empty $built_programs. + * tests/misc/help-version: Fail if built_programs is empty. + + tests: improve perl-based tempdir handling + Before, upon interrupt, directories would be left behind. + * tests/CuTmpdir.pm: Remove temporary directory on interrupt. + + tests: reorder some tests in the long list + * tests/Makefile.am (TESTS): Move some tests that use sleep + "up" in the list so that they don't delay even a little the + completion of "make check". Also run a chmod test early. + + tests: put root-only (usually skipped) tests at the end + * tests/Makefile.am (TESTS): Don't list root-only tests explicitly. + Instead, just use $(root_tests). + * tests/check.mk (vc_exe_in_TESTS): Now that root_tests are separate, + parse out the union of $(TESTS) and $(root_tests). + + tests: move another file (expensive) into test-lib.sh + * tests/expensive: Remove file. Move contents into ... + * tests/test-lib.sh (expensive_): ...here. New function. + * tests/du/fd-leak: Update caller to use the new function. + * tests/mv/leak-fd: Likewise. * tests/rm/hash: Likewise. - * tests/rm/i-1: Likewise. - * tests/rm/i-no-r: Likewise. - * tests/rm/inaccessible: Likewise. - * tests/rm/interactive-always: Likewise. - * tests/rm/interactive-once: Likewise. - * tests/rm/ir-1: Likewise. - * tests/rm/isatty: Likewise. - * tests/rm/no-give-up: Likewise. - * tests/rm/r-1: Likewise. - * tests/rm/r-2: Likewise. - * tests/rm/r-3: Likewise. - * tests/rm/rm1: Likewise. - * tests/rm/rm2: Likewise. - * tests/rm/rm3: Likewise. - * tests/rm/rm4: Likewise. - * tests/rm/rm5: Likewise. - * tests/rm/sunos-1: Likewise. - * tests/rm/unread2: Likewise. - * tests/rm/unread3: Likewise. - * tests/rm/unreadable: Likewise. - * tests/rmdir/fail-perm: Likewise. - * tests/rmdir/ignore: Likewise. - * tests/rmdir/t-slash: Likewise. - * tests/seq/basic: Likewise. - * tests/sha1sum/basic-1: Likewise. - * tests/sha1sum/sample-vec: Likewise. - * tests/shred/exact: Likewise. - * tests/shred/remove: Likewise. - * tests/sort/Makefile.am: Likewise. - * tests/sort/Test.pm: Likewise. - * tests/sort-time/Makefile: Likewise. - * tests/sort-time/README: Likewise. - * tests/sort-time/rand-gen: Likewise. - * tests/stty/basic-1: Likewise. - * tests/stty/row-col-1: Likewise. - * tests/sum/basic-1: Likewise. - * tests/sum/sysv: Likewise. - * tests/tac/Makefile.am: Likewise. - * tests/tac/Test.pm: Likewise. - * tests/tail/Makefile.am: Likewise. - * tests/tail/Test.pm: Likewise. - * tests/tail-2/Makefile.am: Likewise. - * tests/tail-2/append-only: Likewise. - * tests/tail-2/assert: Likewise. - * tests/tail-2/assert-2: Likewise. * tests/tail-2/big-4gb: Likewise. - * tests/tail-2/fflush: Likewise. - * tests/tail-2/infloop-1: Likewise. - * tests/tail-2/proc-ksyms: Likewise. - * tests/tail-2/start-middle: Likewise. - * tests/tail-2/tail-n0f: Likewise. - * tests/tee/basic: Likewise. - * tests/tee/dash: Likewise. - * tests/test/Makefile.am: Likewise. - * tests/test/Test.pm: Likewise. - * tests/touch/Makefile.am: Likewise. - * tests/touch/dangling-symlink: Likewise. - * tests/touch/empty-file: Likewise. - * tests/touch/fail-diag: Likewise. - * tests/touch/fifo: Likewise. - * tests/touch/no-create-missing: Likewise. - * tests/touch/no-rights: Likewise. - * tests/touch/not-owner: Likewise. - * tests/touch/obsolescent: Likewise. - * tests/touch/read-only: Likewise. - * tests/touch/relative: Likewise. - * tests/tr/Makefile.am: Likewise. - * tests/tr/Test.pm: Likewise. - * tests/tr/failures: Likewise. - * tests/tsort/basic-1: Likewise. - * tests/unexpand/basic-1: Likewise. - * tests/uniq/Makefile.am: Likewise. - * tests/uniq/Test.pm: Likewise. - * tests/wc/Makefile.am: Likewise. - * tests/wc/Test.pm: Likewise. + * tests/Makefile.am (EXTRA_DIST): Remove its name. -2006-08-17 Jim Meyering + tests: cp/perm (usually not run) was failing on systems with SELinux + * tests/cp/perm: Use stat to get the permission string, not ls. + This test was run only when RUN_VERY_EXPENSIVE_TESTS=yes was set + in the environment. It would fail on SELinux-enable systems + because ls-generated permission strings would not match, e.g., + "test _-rw-r--r--+ = _-rw-r--r--" would fail. - ls -CF would misalign columns in some cases. - * src/ls.c (get_type_indicator): New function. extracted from... - (print_type_indicator): ...here. Use it. - (length_of_file_name_and_frills): Use it here, too, rather than - assuming stat.st_mode is valid. - Reported by Andreas Schwab, here: - - See the test for this above. FYI, I did ls -CF /proc and visually - inspected the result. + tweak HACKING advice - * src/copy.c (copy_internal, same_file_ok): Adjust comments not - to mention the now-removed cp_options.xstat member. +2008-04-24 Jim Meyering - * Makefile.maint (patch-check): Adapt to work now that the patch - modifies more than one file in src/. + tests: do define built_programs + * tests/check.mk (built_programs): Define here, where it's used. + This definition was in now-removed tests/misc/Makefile.am. - With this patch, permit building with Solaris cc on Solaris 7. - * src/c99-to-c89.diff: Add diffs to convert more c99-isms. - This integrates patches from Bruno Haible. +2008-04-23 Jim Meyering -2006-08-16 Paul Eggert + tests: update commented-out examples in sample-test, too + * tests/sample-test: Use $top_srcdir/tests/SCRIPT_NAME, not + $top_srcdir/../SCRIPT_NAME here, too. - Fix some problems reported by Bruno Haible. - * tests/chmod/setgid (abs_srcdir): Remove; not used or needed. - Skip this test if "chmod g+s d" silently does nothing. - * tests/ls-2/tests: Skip this test suite if we can't set up files - properly for the setuid-etc test. This simplifies some of the - hacks we were using to work around porting problems. +2008-04-23 Ondřej Vašík -2006-08-16 Jim Meyering + tests: don't fail in a non-English locale + * tests/chmod/thru-dangling: Source lang-default. + * tests/cp/thru-dangling: Likewise. + * tests/misc/printf-surprise: Likewise. - * tests/cp/Makefile.am: Don't mark "acl" as XFAIL. - * tests/cp/acl: Instead, skip the test if either setfacl - or getfacl fails. - Reported by Michael Stone. +2008-04-23 Jim Meyering -2006-08-16 Paul Eggert + tests: remove now-unused Makefile.am + * tests/misc/Makefile.am: Remove file. - * tests/lang-default (LC_ALL): Set to "C", so we get - English-language diagnostics. Unset the other variables; it - should be portable to use 'unset' for this stuff nowadays. - Problem reported by Bruno Haible. Using "C" reverses the - 2000-10-22 change to fileutils in this area. +2008-04-23 Ondřej Vašík - Fix bugs when printing plurals of numbers that are not - unsigned long int values. - * src/system.h (select_plural): New function. - * src/md5sum.c (digest_check): Use select_plural to avoid bug. - * src/uptime.c (print_uptime): Likewise. - * src/dd.c (print_stats): Likewise. Also, don't use ngettext to - print a floating point number, as reducing to 0 or 1 doesn't work - for some languages. Instead, just use "s" for seconds since it - doesn't need a plural form. + id: do not print SELinux context when invoked with a USERNAME argument + * NEWS: Mention new behaviour. + * src/id.c (main): Do not print SELinux context when user is specified. + * tests/Makefile.am: Add the new test. + * tests/misc/id-context: New file. Test for the fix. + Problem reported by Ronny Buchmann in http://bugzilla.redhat.com/443485. -2006-08-16 Bruno Haible +2008-04-23 Jim Meyering - Old versions of gzip would write --help output to stderr, and it - would be annoying to see that in the output of every "make" command. - * Makefile.maint (gzip_rsyncable): Throw away stderr output of - "gzip --help". + id: do print the AFS-specific nameless group ID (called a PAG) + In 6.11, we mistakenly suppressed the printing of certain group IDs, + thinking they were useless AFS-specific artifacts. + This change reverts that, so now they are printed once again. + http://thread.gmane.org/gmane.org.fsf.announce/867/focus=13345 + This also reverts the bug-fix that applied solely to the new code + used to avoid printing those IDs -2006-08-16 Andreas Schwab + Revert "id bug fix: don't point to potentially clobbered static storage" + This reverts commit f7d1c59c224f81a8bab5fa2afcaf815988f50467. + Revert "Work around AFS bug: id and groups would print invalid group number." + This reverts commit b7a836c0a3524cda8ef79c30c3fe7ea759ae4656. + Revert "* src/c99-to-c89.diff: Accommodate a C99-ism in id.c." + This reverts commit d44893c5dba4150b4ded9cf6aad316c1ef620c9f. - * tests/cp/acl: Don't use non-portable == operator for test. +2008-04-22 Jim Meyering -2006-08-16 Jim Meyering - - * tests/ls/stat-dtype: Use stat to test file system type, rather - than df -T, in case /etc/mtab lies. Reported by Michael Stone. - -2006-08-15 Paul Eggert - - * NEWS: Mention that df exits with nonzero status if it generates - no output. This change was in 6.0 but inadvertently unmentioned. - * src/df.c (file_systems_processed): Renamed from n_valid_args, and now - a boolean. - (show_dev): Don't set it until we actually output something. - Print the header if this is the first output. - (main): Don't print a header, as that is now show_dev's job. - * tests/misc/Makefile.am (TESTS): Add df. - * tests/misc/df: New file. - -2006-08-15 Eric Blake - - * src/stat.c (USE_STATVFS): Define to 0 if f_type is needed, but - statvfs.f_type not present. See - . - -2006-08-15 Paul Eggert - - * src/dd.c (print_stats): Don't substitute "1" for number, as this - causes confusion for the Hungarian translators. Problem reported - by Egmont Koblinger here: - http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/7726 - -2006-08-15 Jim Meyering - - * .x-sc_require_config_h: Add lib/at-func.c. - - * NEWS: Add a line for 6.1-cvs. - * configure.ac (AC_INIT): Bump to 6.1 and add "-cvs" suffix. - -2006-08-15 Jim Meyering - - * Version 6.0. - * NEWS: Record the 6.0 release date. - * configure.ac (AC_INIT): Remove "-cvs" suffix from version string. - - * TODO: Add an item (convert to use gnulib-tool), add to the plan - for id-vs-getgrouplist, and remove a few completed items. - - * Makefile.maint (alpha beta major): Fix syntax error. - -2006-08-13 Jim Meyering - - * src/shred.c (usage): Don't indent the second line of an item. - Otherwise, help2man would misformat the output. - Reported by Adam Buchbinder in . - -2006-08-11 Paul Eggert - - * configure.ac (AM_GNU_GETTEXT): Upgrade to need-formatstring-macros. - Suggested by Eric Blake to avoid problems like - . - -2006-08-11 Jim Meyering - - * tests/ls/stat-vs-dirent: Too many (losing) systems trigger the - failure that this test checks for (stat/dirent inode mismatch at - a mount point), so continue to give a diagnostic about the failure, - but don't actually count it as a failure. - -2006-08-10 Paul Eggert - - * ABOUT-NLS: Update from gettext 0.15. - * configure.ac (AM_GNU_GETTEXT_VERSION): Update from 0.13.1 to 0.15. - - * src/csplit.c (struct control): Remove fastmap member. - (extract_regexp): Allocate fastmap separately, since otherwise - it might move due to a realloc. This fixes a bug that led - to a core dump on 64-bit sparc Solaris 10 (Sun Studio 10). - -2006-08-10 Jim Meyering - - * tests/ls/stat-dtype: If "." is tmpfs, skip this test unless uname -s - reports "Linux". This avoids a failure on Solaris 10's tmpfs. - Redirect both stdout and stderr of df invocations. - - * src/dircolors.hin: Add a TERM directive for each of the following: - ansi, color-xterm, gnome, konsole, kterm, rxvt-cygwin, - rxvt-cygwin-native, screen.linux, xterm-256color. - Sort the TERM directives. - From Mike Frysinger. - -2006-08-09 Paul Eggert - - * src/dd.c (usage): Warn about oflag=append without conv=notrunc. - See Debian bug 373736. - - * src/dircolors.hin: Add mlterm, rxvt-unicode; this fixes Debian - bug 317503. - - * src/.cvsignore: Add shuf. - - * Makefile.maint: Remove the po-update procedure; it doesn't - work with the new repository on http://www.iro.umontreal.ca/. - For now I guess we'll have to fix things by hand. - (do-po-update, po-update): Remove. All references removed. - - * src/shuf.c (next_line): New function. - (read_input): Use it, to avoid relying on GCC-specific behavior - with void * arithmetic. Problem reported by Bob Proulx. - * Makefile.maint (my-distcheck): Compile with -Wpointer-arith - to detect this sort of problem automatically in the future. - -2006-08-09 Jim Meyering - - * src/ls.c: Add a compile-time check to ensure that filetype - and filetype_letter have the same number of elements. - - * tests/misc/sort-rand: Remove use of --seed=S. - -2006-08-08 Paul Eggert - - Add a command 'shuf', and modify shred and sort to use the new - random number generator library of 'shuf'. - - * AUTHORS: Add shuf. - * README: Likewise. - * NEWS: Likewise. Mention new --random-source option for shred - and sort. Move "sort +1 -2" notice to the appropriate section, - and clarify its role with respect to POSIXLY_CORRECT. - * man/.cvsignore: Add shuf.1. - * man/Makefile.am (dist_man_MANS): Add shuf.1. - (shuf.1): New dependency. - * man/shuf.x: New file. - * src/Makefile.am (bin_PROGRAMS): Add shuf. - (EXTRA_DIST): Remove rand-isaac.c. - (shuf_LDADD): New macro. - * src/rand-isaac.c: Remove, moving most of its contents to - lib/rand-isaac.c. - * src/shuf.c: New file. - * src/shred.c: Use new random-number interface rather than rand-isaac.c. - Don't include rand-isaac.c; include randint.h and randread.h instead. - (RANDOM_SOURCE_OPTION): New enum. - (long_opts, usage, main): New option --random-source. - * src/sort.c: Likewise. - * src/shred.c (struct irand_state, irand_init, irand32, irand_mod): Remove. - All callers changed to use randint interface. - (fillrand): Remove. All callers changed to use randread interface. - (dopass): Remove dependency on ISAAC buffer size. - (genpattern): Don't wipe the random state here. - (randint_source): New static var. - (clear_random_data): New function. - (main): Allocate random source, and arrange to wipe it on exit. - * src/sort.c: Include md5.h, randread.h, xmemxfrm.h. - (longopts, usage, main): Remove undocumented --seed option; - it's now replaced by --random-source. - (rand_state, get_hash): Remove. - (randread_source): New static var. - (random_state, cmp_hashes, compare_random): New functions; they guarantee - no collisions in the random hash function. - (keycompare): Use compare_random for -R; don't fall back on comparing - via memcoll, since compare_random does the right thing. - * tests/misc/Makefile.am (TESTS): Add shuf. - * tests/misc/shuf: New file. - -2006-07-29 Paul Eggert - - * src/copy.c (set_author): Preserve the st_author field via the - file descriptor dest_desc. - -2006-07-28 Paul Eggert - - * NEWS: chmod now preserves setuid and setgid bits on directories - if you use a numeric mode with them clear, e.g., "chmod 755 DIR". - - Fix test case problems if working directory is setgid, - reported by Bob Proulx. - * tests/cp/fail-perm: Use symbolic mode so that we clear - setgid bit more reliably on directories. - * tests/mkdir/special-1 (set_mode_string): Likewise. - -2006-07-27 Jim Meyering - - * src/chgrp.c (usage): Use correct grammar in description of the - --reference option - * src/chown.c (usage): Likewise. - -2006-07-26 Thomas Schwinge (tiny change) - - * src/copy.c (set_author) [HAVE_STRUCT_STAT_ST_AUTHOR]: - Correctly access SRC_SB's element ST_AUTHOR. - -2006-07-26 Jim Meyering - - * tests/ls/stat-failed: Adapt to match new expected output. - From Paul Eggert. - - * src/ls.c (print_color_indicator): Test for S_IFREG first, rather - than having the code test for all of the other types first. - Hoist the set-uid/gid-testing code "up" into this new block. - Classify any other type of file (e.g., S_TYPEISSHM, etc.) as - C_ORPHAN, not as C_FILE. - -2006-07-26 Jim Meyering - - Checking in a change from Paul. - - 2006-07-25 Paul Eggert - - * src/ls.c (DT_INIT): Remove. All uses removed. - (enum filetype): Use an ordinary enum rather than trying to keep - the values in sync with DT_FIFO etc. That way, we don't have - to make special assumptions about them. All uses changed. - (whiteout): New constant member of enum filetype. - (filetype_letter): New constant, for use with enum filetype. - (FILETYPE_INDICATORS): New initializer list. - (print_dir): Add case for DT_WHT. - (gobble_file): If stat fails, don't discard information from - readdir; instead, preserve it so it can be printed. - (print_long_format): Fall back on readdir result if stat info - is not available. Use "?" to denote each unknown mode char, - instead of an overall "?", since we now know some of the mode - typically. - (print_type_indicator): Now that MODE isn't necessarily - useful, guard all uses. - Now that two blocks in the type-checking tree can set "type = C_FILE", - move the suffix-handling code out and down. - -2006-07-26 Jim Meyering - - Prepare for the above change. - * src/ls.c [struct fileinfo] (stat_ok): Rename from stat_failed, - and adjust uses. From a patch by Paul Eggert. - -2006-07-26 Jim Meyering - - * src/ls.c: Correct indentation/formatting in a few places. - -2006-07-25 Paul Eggert - - * tests/cp/fail-perm: Use "chmod 0500" rather than "chmod 500". - Problem report and fix from Bob Proulx. - * NEWS: Clarify the "chmod 0500" news, and correct the vague - statements about compatibility with BSD. - -2006-07-25 Jim Meyering - - * src/ls.c (gobble_file): When handling a stat-failed entry, - print the entry name not the absolute_name -- to be consistent - with the usual case. - * tests/ls/stat-failed: Update accordingly. - - * src/ls.c: Add parens around the new uses of ?: ternary operator. - - * src/dircolors.hin: Mention that ORPHAN refers not just to dangling - symlinks. - - Get --dired offsets right when handling stat-failed entries. - * src/ls.c (print_long_format): Be careful to increment P by the - appropriate amount, even when inode_number_width and nlink_width - are zero. - * tests/ls/stat-failed: Test for the above. - - * src/ls.c (gobble_file) [USE_ACL]: Don't use-uninitialized the - have_acl member. That would happen for a directory with both a - non-stat'able entry and one with an ACL. - - * src/ls.c (gobble_file): Make it so failure to stat a - non-command-line file provokes an exit status of 1, not 0. - Say "cannot access" rather than "cannot stat". - * tests/ls/stat-failed: New file/test, for the above. - * tests/ls/Makefile.am (TESTS): Add stat-failed. - * tests/ls-2/tests (no-a-isdir-b): Update to reflect addition - of "cannot access " to diagnostic. - - * src/ls.c: Declare stat_failed to be "bool", not "int" everywhere. - - * src/ls.c [enum filetype] (command_line): Remove member. Not needed. - Replace all occurrences of "type == command_line" with the - equivalent, "command_line_arg". - - * src/ls.c: Apply the stat-failed parts of Red Hat's - coreutils-selinux.patch. From Ulrich Drepper. - This makes it so files not mentioned on the command line (e.g., - names read from a directory that *is* mentioned on the command - line) for which stat fails are still listed. With --color, - such files are colored just like ORPHANs (aka dangling symlinks). - - * src/df.c (n_valid_args): Declare global to be static. - -2006-07-24 Jim Meyering - - * tests/ls/stat-dtype: Skip this test on reiserfs, since that file - system lacks d_type support. - -2006-07-22 Paul Eggert - - * man/chmod.x: Update to reflect recent changes to coreutils.texi. - -2006-07-21 Jim Meyering - - * src/su.c (usage): Correct typo in --help output: s/commmand/command/ - Reported by Tim Waugh. - Also remove the comment duplicating much of --help output. - - * src/ls.c (FILE_TYPE_INDICATOR_OPTION): Reposition this new - name so the list remains alphabetized. - - Fix another bug: ls --indicator-style=file-type would call - stat for a symlink, even though it wasn't always needed. - In some cases, that unnecessary stat would cause ls to fail. - * src/ls.c (gobble_file): Don't treat symlinks specially (in - requiring a stat syscall). Remove the offending exclusion. - - * NEWS: Mention the fix. - - * tests/ls/stat-dtype: New file/test, for the above fix. - Also exercises the new df feature, below. - - * src/df.c (main): Fail and don't print the headers if no - file system is processed. This makes it easy to test whether - a specified directory is on a file system of a given type or types. - Otherwise, applications would have had to parse df's output. - E.g., is "." either ext3 or reiserfs: df -t ext3 -t reiserfs . - - Fix a bug: ls --file-type worked like --indicator-style=slash, - rather than like --indicator-style=file-type. - * src/ls.c (FILE_TYPE_INDICATOR_OPTION): New enum member. - (long_options): Map "file-type" to FILE_TYPE_INDICATOR_OPTION, - not to 'p'. - (decode_switches): Handle new case: FILE_TYPE_INDICATOR_OPTION. - * NEWS: Mention the fix. - * tests/ls-2/tests (file-type): New test, for the above fix. - -2006-07-19 Jim Meyering - - * src/ls.c (print_dir): Give a better diagnostic for failed opendir. - - * Makefile.am (EXTRA_DIST): Add build-aux/vc-list-files. - -2006-07-16 Paul Eggert - - * NEWS: chmod, install, and mkdir now leave setgid and setuid bits - of directories alone unless you specify them explicitly. - install and mkdir now implement X correctly. - install now creates parent directories with mode 755, without - changing their owner or group. - * src/chmod.c (process_file): Adjust to mode_adjust API change. - * src/install.c: Include mkancesdirs.h. - (announce_mkdir, make_ancestor): New functions. - (DEFAULT_MODE): New macro, specifying initial value of 'mode'. - (mode): Use it. - (dir_mode, dir_mode_bits): New vars. - (main): Set dir modes separately from nondir, so that the X - op of -m works correctly. - (main): Remove cwd_errno cruft, since make_dir_parents no longer - affects cwd. Adjust to new make_dir_parents API. - (install_file_in_file_parents): 2nd arg is now char *, not char - const *. Use mkancesdirs instead of rolling our own code. - (change_attributes): Don't worry about AFS, since that kludge - should not be needed any more. - * src/mkdir.c (struct mkdir_options): New struct. - (announce_mkdir, make_ancestor): New functions. - (main): Use them. Adjust to mode_adjust API change. Stick with - umask 0. Use make_dir_parents for all the work. - * src/mkfifo.c (main): Adjust to new mode_adjust API. - * src/mknod.c (main): Likewise. - * tests/chmod/setgid: Do the setgid test instead of bailing. - * tests/mkdir/p-3: Remove re_protect case that no longer applies. - GNU chmod now behaves like other versions of chmod. - * tests/mkdir/perm: Add a test for the X bug. - -2006-07-14 Paul Eggert - - * src/base64.c (do_decode): Output to parameter OUT, not to stdout. - This doesn't fix any bugs, since OUT always equals stdout, but it - makes the code easier to understand. - -2006-07-14 Jim Meyering - - * Makefile.maint (CVS_LIST): Use new file, build-aux/vc-list-files, - rather than open-coding it. Now supports mercurial, too. - * .hgignore: New file. - * Makefile.am (EXTRA_DIST): Add .hgignore, which ignores nearly - all generated files, including ones like configure and po/*.po - that are currently version-controlled in cvs. - - * Makefile.am (EXTRA_DIST): Add a few more .??* files. - They've been in CVS, just haven't been distributed before this. - Distribute ChangeLog-2005, too. - (MAINTAINERCLEANFILES): Add THANKS-to-translators. - -2006-07-11 Paul Eggert - - * src/system.h: Assume exists, since gnulib assumes - this now as well. - -2006-07-09 Jim Meyering - - * tests/mv/dir2dir: Adjust so failing with ENOTEMPTY is ok, too. - That happens with Linux/tmpfs. - * tests/mv/Makefile.am (TESTS): Add dir2dir. - -2006-07-09 Paul Eggert - - Adjust to recent updates from gnulib. - * src/dd.c (apply_translations): Use toupper rather than - islower followed by toupper; it's simpler and typically - faster now that we assume at least C89 semantics. Similarly - for tolower. - * src/sort.c (inittables): Likewise. - * src/expand.c (expand): Don't assume that isprint etc. return - booleans (needed for pre-C99 hosts). - * src/fmt.c (check_punctuation): Likewise. - * src/ptx.c (initialize_regex, fix_output_parameters): Likewise. - * src/tr.c (is_char_class_member): Likewise. - * src/unexpand.c (unexpand): Likewise. - * src/join.c (is_blank): Remove; no longer needed. All uses - replaced by isblank (to_uchar (...)). - * src/pinky.c (create_fullname): Don't assume char is unsigned. - * src/printf.c (print_esc): Likewise. - * src/ptx.c (SKIP_NON_WHITE, SKIP_WHITE, SKIP_WHITE_BACKWARDS): - (copy_unescaped_string): Likewise. - * src/stat.c (print_it): Likewise. - * src/system.h (_D_EXACT_NAMELEN): Renamed from NLENGTH, for - convenience on GNU systems. All uses changed. Don't bother - looking for any dirent.h substitute other than ndir.h. - (D_INO): Remove unnecessary parentheses. - (IN_CTYPE_DOMAIN, ISGRAPH, ISPRINT, ISALNUM, ISALPHA): - (ISCNTRL, ISLOWER, ISPUNCT, ISSPACE, ISUPPER, ISXDIGIT): - (ISDIGIT_LOCALE, TOLOWER, TOUPPER): Remove. All uses changed - to ctype.h equivalents. - (isblank): Renamed from ISBLANK. Check for HAVE_DECL_ISBLANK too. - All uses changed. - -2006-07-08 Jim Meyering - - * tests/mv/dir2dir: New file, test for 2006-07-05 fix in copy.c. - - * Makefile.maint (sc_the_the): New rule. - - * src/dd.c (skip): Remove one of two adjacent "the"s in a comment. - * tests/Coreutils.pm (run_tests): Remove one of two adjacent "then"s - in a comment. - -2006-07-07 Jim Meyering - - * NEWS: Mention that mv can now remove an empty destination directory, - and give an example. Prompted by a report from Florent Bayle. - -2006-07-05 Jim Meyering - - * src/ls.c (usage): Correct the description of -G: it is useful - only in a long listing. Reported by Martin Pool in - . - - * man/chmod.x: Correct the description of the sticky bit. Reported - by Chris Moore via Ian Jackson in . - - * src/copy.c (copy_internal): Don't work around old NFS clients like - SunOS-4.1.4 and Irix 5.3 that set errno to values like EIO and - ENOTEMPTY upon failed rename. Otherwise, we risk misinterpreting - a banal failure as a recursive move-into-self failure. - Reported by Florent Bayle in . - - * src/c99-to-c89.diff: Regenerate, to remove fuzz. - -2006-07-03 Jim Meyering - - Plug another unusual leak. - (AD_mark_helper): Free malloc'd filename if hash_insert says - that string is already in the hash table. - - The dev/inode of the topmost directory in each hierarchy were not - being recorded. - * src/remove.c (remove_cwd_entries): Don't call cycle_check here. - (AD_push): Call it from here instead. - - Fix two small leaks. - * src/remove.c (AD_stack_clear): New function. - (rm_1): Use it. - (AD_pop_and_chdir): Free *prev_dir just before longjmp. - - * tests/Makefile.am, tests/*/Makefile.am: (TESTS_ENVIRONMENT): - Add $VG_PATH_PREFIX as a prefix to $PATH - - * tests/envvar-check (vars): Add CDPATH and POSIXLY_CORRECT. - * tests/Makefile.am (evar-check): Remove rule. - (EXTRA_DIST): Remove .env-warn. - * tests/.env-warn: Remove file. No longer used. + build: move a project-specific definition to cfg.mk + * cfg.mk (old_NEWS_hash): Define here, ... + * maint.mk: ... not here. + (update-NEWS-hash): Update comment. Suggestion from Eric Blake. -2006-07-02 Paul Eggert - - * src/system.h: Include unconditionally, since we - now assume the stdint module. - -2006-07-01 Paul Eggert - - * NEWS: With no operand, 'tail -f' now silently ignores the '-f' - only if standard input is a FIFO or pipe and POSIXLY_CORRECT is set. - * src/tail.c (main): Implement this. - * tests/tail/Test.pm (f-pipe-1): Renamed from f-1. - (test_vector): Set POSIXLY_CORRECT for the f-pipe-* tests. - -2006-07-01 Jim Meyering - - * src/ln.c (do_link): Use new, shorter URL, for ag-review link. - - * .x-sc_require_config_h: Add ^lib/xstrtold\.c$, so make distcheck - passes once again. - -2006-06-30 Paul Eggert - - * NEWS: seq now uses long double internally rather than double. - It now defaults to a minimal fixed point format if possible. - It lets you use %a, %A, %E, %F, %G. - * src/Makefile.am (seq_LDADD): Remove $(SEQ_LIBM); add $(POW_LIB). - * src/seq.c: Don't include or ; no longer needed. - (isfinite) [!defined isfinite]: New macro. - (separator, terminator): Now points to const. - (first, step, last): Remove. - (usage): Update to match new behavior. - (struct operand, operand): New type. - (scan_arg): Renamed from scan_double_arg, since we no longer use double. - All uses changed. - Compute and return a value of type operand, not double. - (long_double_format): Renamed from valid_format, and now returns a - new format with an "L" added if needed, if the original format was - valid. Allow %a, %A, %E, %F, and %G formats. - (print_numbers): Take numeric values as args rather than from globals. - Print long double, not double. - (get_width_format): Remove. - (get_default_format): New function. - (main): Implement new way of calculating default format. - Don't worry about locale's representation of the decimal point, since - the arguments are always processed in the C locale. - * tests/seq/basic (neg-2): Adjust to new default format. - (eq-wid-1, eq-wid-2): Resurrect these tests, since the new - implementation should do the right thing. + Accommodate building on OS/2 (www.ecomstation.com Ecs v2 rc4) + * configure.ac: Filter out carriage returns in more places. + Reported by Elbert Pol, details here: + http://thread.gmane.org/gmane.org.fsf.announce/867/focus=13332 -2006-06-30 Jim Meyering + guard against inserting a NEWS entry into a block for a prior release + Without a guard like this, it is far too easy to apply a patch + prepared against a preceding release, and not notice that a NEWS + entry is inserted into the wrong block. + * maint.mk (sc_immutable_NEWS): New rule. + (update-NEWS-hash): New rule to update the hard-coded hash. - * tests/stty/basic-1: Work around an intermittent test failure - on HP-UX 11.11. Report and analysis from Bob Proulx. - http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/7475 + tests: ensure that all exec-$PERL lines are the same + * maint.mk (sc_perl_coreutils_test): New rule. -2006-06-28 Paul Eggert +2008-04-21 Jim Meyering - * NEWS: Support obsolete usages like "sort +1 -2" even when - conforming to POSIX 1003.1-2001, since this is a pure extension to - POSIX. Problem reported by Christian in: - http://lists.gnu.org/archive/html/bug-coreutils/2006-06/msg00220.html - * src/sort.c (main): Implement this. + tests: skip (don't fail) rm/one-file-system when mount --bind fails + * tests/rm/one-file-system: Reported by Allen Hewes. - * src/system.h (CLOSEDIR): Remove. All uses changed to closedir. - Autoconf 2.60 says this stuff was obsolete. + tests: convert umask-check to a function + * tests/test-lib.sh (working_umask_or_skip_): New function, from... + * tests/umask-check: ...here. Remove file. + * tests/Makefile.am (EXTRA_DIST): Remove umask-check. + * tests/mkdir/perm: Use the function rather than sourcing the file. + * tests/cp/cp-parents: Likewise. + * tests/cp/parent-perm: Likewise. + Bruno Haible reported that parent-perm was failing to run umask-check. -2006-06-28 Jim Meyering + tests: adjust perl -I to use $top_srcdir/tests, not $srcdir/.. - * src/c99-to-c89.diff: Regenerate, to remove fuzz. + tests: clean up root tests; adapt to new layout + * tests/Makefile.am (root_tests): New list. + (check-root): Add 'SUBDIRS='. + (root-hint): Point to README. + * Makefile.am (check-root): Add 'SUBDIRS=' here, too. + * maint.mk (sc_root_tests): Adapt rule to new syntax used + in tests/Makefile.am. -2006-06-28 Bob Proulx (tiny change) + Revamp test-related Makefiles. + One side-effect of this change is that "make check" now works even if + you put "." early in your shell's search PATH (don't do that!). - * tests/mv/i-link-no: Work around HP-UX /bin/sh tracing problem - (set -x when VERBOSE=yes) when stderr is redirected before stdout - causing shell tracing of the stdout redirection to be written to - the stderr file. Avoid problem and test failure on HP-UX by - redirecting stderr last. - * tests/dd/unblock-sync: Order shell file redirections for - stderr and stdout in the common style. - tests/acl: Likewise. + Remove all test-related Makefile.am files, except those generated + by mk-script. Instead, tests/Makefile.am now lists not only the + tests directly under tests/, but also those in tests/*/ that are + not generated by mk-script, e.g., cp/abuse, cp/acl, mv/i-1, etc. -2006-06-27 Jim Meyering + A lot of these changes are like this: - * tests/misc/cat-proc: Try to avoid any spurious numeric - differences in frequently-changing /proc/cpuinfo. - Reported by Nelson Beebe. + -. $srcdir/../lang-default + +. $top_srcdir/tests/lang-default -2006-06-26 Jim Meyering + -. $srcdir/../test-lib.sh + +. $top_srcdir/tests/test-lib.sh - Attempt rmdir (actually, unlinkat-with-AT_REMOVEDIR) upon any - fd_to_subdirp failure, not just when errno == EACCES. - * src/remove.c (remove_dir): Use unlinkat-with-AT_REMOVEDIR, not - rmdir, here, even though rmdir may happen to be adequate. + * configure.ac (AC_CONFIG_FILES): Remove corresponding Makefiles. + * tests/check.mk (vc_exe_in_TESTS): Relax syntax requirements. + * tests/rwx-to-mode: Remove file. Rewritten as... + * tests/test-lib.sh (rwx_to_mode_): ...this new function. + * tests/Makefile.am (EXTRA_DIST): Remove rwx-to-mode. + (SUBDIRS): Remove each dir with a removed Makefile.am. + (EXTRA_DIST): Add $(TESTS). + (TESTS): Add over 300 entries. - * NEWS: rm no longer fails to remove an empty, unreadable directory - * src/remove.c (remove_cwd_entries): If we can't open a directory, - and the failure is not being ignored, try to remove the directory - with rmdir (aka unlinkat-with-AT_REMOVEDIR), in case it's empty. - Problem report and test case from Paul Eggert in - . +2008-04-20 Jim Meyering - * tests/rm/empty-inacc: New test, for the above. + * tests/misc/Makefile.am (built_programs): Remove. Unused. - Avoid a segfault for wc --files0=- < /dev/null. - * src/wc.c (compute_number_width): Return right away if nfiles == 0. + Use "env" to invoke potential built-ins. + * tests/misc/pwd-unreadable-parent: Invoke pwd via "env -- pwd", + rather than via an absolute name. + * tests/touch/not-owner: Likewise for test. + * tests/chmod/setgid: Likewise. -2006-06-25 Jim Meyering +2008-04-19 Jim Meyering + + * .prev-version: Record previous version: 6.11. - * NEWS: wc accepts a new option --files0-from=FILE, where FILE - contains a list of NUL-separated file names. + Version 6.11. + * NEWS: Record release date. - * src/wc.c: Include "readtokens.h". - (usage): Describe the new option, and adjust the `Usage': - with this option, no FILE may be specified on the command line. - (main): Handle the new option. - * tests/misc/wc-files0: New tests, for the above. - * tests/misc/wc-files0-from: Likewise. - * tests/misc/Makefile.am (TESTS): Add wc-files0. + * maint.mk (writable-files): Fix syntax error. -2006-06-24 Jim Meyering + * doc/.gitignore: Add texinfo-related outputs. - * src/md5sum.c (DIGEST_BUFFER): Remove now-unused definitions. +2008-04-19 Sven Joachim -2006-06-22 Jim Meyering + * THANKS: Update my address, correct encoding for a name. - * src/tee.c (tee_files): Rename from tee, to avoid conflict with - the function in glibc's . Reported by Andreas Schwab. +2008-04-19 Jim Meyering -2006-06-19 Jim Meyering + pr -e, with a mix of backspaces and TABs, could corrupt the heap + * tests/pr/Test.pm: New tests for the above. + * src/pr.c (char_to_clump): Ensure that "input_position" never + goes below 0. + Also, elide any backspace encountered when input_position is 0, + to be compatible at least with /bin/pr from Solaris 10. + This bug is present in the original version: + b25038ce9a234ea0906ddcbd8a0012e917e6c661 + * NEWS [Bug fixes]: Mention this. + Report and diagnosis by Cristian Cadar, Daniel Dunbar and Dawson Engler + in http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/13272 - * Makefile.cfg (local-checks-to-skip): Add changelog-check, - so this check is not run as part of "make distcheck". +2008-04-19 Mike Frysinger -2006-06-18 Bob Proulx (tiny change) + * src/dircolors.hin: Add .flv. Move .svgz to "image formats". - * tests/misc/pwd-long: Fix typo (s/neq/ne/) in previous change. +2008-04-19 Jim Meyering -2006-06-18 Jim Meyering + md5sum -c: ignore a line with a NUL byte among checksum hex digits + * src/md5sum.c (hex_digits): Require that all "digest_hex_bytes" + be hexadecimal digits, not just those before the first NUL byte. + This bug dates back to the original version: + 3763a4f24eb21be40674d13ff7b04e078f473e85 + * tests/misc/md5sum (nul-in-cksum): Test for the above. + * NEWS [Bug fixes]: Mention this. + Prompted by a report from Flóki Pálsson in + http://bugzilla.redhat.com/439531 - * tests/misc/pwd-long: Make error output a little clearer. +2008-04-16 Matthew Woehlke -2006-06-17 Jim Meyering + tests: accommodate built-in mknod more cleanly still + * tests/mkdir/selinux: Use "env" rather than "nice". - * tests/rm/inaccessible: Skip this test on systems without openat - support. Reported by Bob Proulx. +2008-04-16 Jim Meyering -2006-06-15 Bob Proulx (tiny change) + tests: accommodate built-in mknod more cleanly + * tests/mkdir/selinux: Undo most of previous change, + bc22dbbf844f31ddaf2e68b167d0128a985d73ab, and instead + invoke the command via "nice". Using "exec" should be + enough, but isn't with OpenBSD's PD KSH v5.2.14 99/07/13.2. + Eric Blake suggested using nice. - * tests/misc/mknod: Improve permission checks to handle - running mkdir test in set-gid directories. + mknod --help: note that this command may be a shell built-in + * src/mknod.c (usage): Print USAGE_BUILTIN_WARNING. + Suggestion from Eric Blake. -2006-06-14 Jim Meyering + avoid "may be used uninitialized" warning from newer gcc + * src/md5sum.c (digest_check) [lint]: Initialize local, "filename". - * tests/du/basic: Revamp not to hard-code file system block sizes. + tests: add a comment explaining the potential failure -2006-06-12 Ralf Wildenhues + tests: avoid mkdir/selinux failure when mknod is a shell built-in + * tests/mkdir/selinux: Skip the mknod test if it's a built-in. - * tests/du/Makefile.am (TESTS_ENVIRONMENT): Pass $(PERL), for - files0-from test. +2008-04-15 Jim Meyering -2006-06-11 Jim Meyering + md5sum, sha1sum, etc: handle invalid input (i.e., don't segfault) + * src/md5sum.c (bsd_split_3): Return right away if s_len == 0. + * tests/misc/md5sum (bsd-segv): New test for the above. + * tests/misc/sha1sum (bsd-segv): Likewise. + * NEWS: Mention the bug fix. + Reported by Cristian Cadar, Daniel Dunbar and Dawson Engler. - * .gitignore: New file. - * Makefile.am (EXTRA_DIST): Add .gitignore. +2008-04-14 Jim Meyering - Setting TIME_STYLE=long-iso in the environment would make the - cp/same-file test fail. - * tests/envvar-check (vars): Add TIME_STYLE to the list. - * tests/cp/same-file: Revert last change. - Source the envvar-check script, to ensure that TIME_STYLE - settings don't affect these tests. + tests: don't fail on systems without a "stat" syscall + * tests/test-lib.sh (require_strace_): Add a syscall parameter. + * tests/ls/stat-free-symlinks: Update caller. + * tests/mv/atomic: Likewise. + * tests/mv/atomic2: Likewise. + Reported by Mike Frysinger in + http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/13222 -2006-06-11 Paul Eggert + tests: accommodate a different errno string on Irix 6.5 + * tests/mkdir/selinux: Also handle "Not supported". + Reported by Peter Fales. - * tests/cp/same-file: Execute 'ls' in the C locale, so that it - uses POSIX time stamp formats. Problem reported by John Nixon in - . + seq: work around floating point inaccuracies on more systems + * src/seq.c: Include for fabs. + Include for DBL_EPSILON. + (abs_rel_diff): New function. + (print_numbers): Use abs_rel_diff rather than a strict equality test. + Without this change, Solaris 8 and Irix 6.2 would fail the float-6 + test. Reported by Peter Fales in + http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/13183 + * src/c99-to-c89.diff: Adjust seq.c offsets. -2006-06-10 Jim Meyering + doc: fix typo + * coreutils.texi (sort invocation): s/Whitespace/White space/ - * NEWS: Mention the AIX-strndup-bug vs. dircolors workaround. +2008-04-12 Jim Meyering - Require a "Version N.M" line at the top of the ChangeLog - file only when making the actual release, not when running - "make distcheck". - * Makefile.maint (maintainer-distcheck): Don't depend on - changelog-check. - (alpha beta major): Depend on it here, instead. + tests: Accommodate a different errno value on OSF/1 4.0F. + * tests/mkdir/selinux: Also handle "Function not implemented". -2006-06-08 Jim Meyering + Avoid link failure when using mkstemp replacement. + * src/Makefile.am (tac_LDADD): Add $(LIB_CLOCK_GETTIME). + This is necessary at least on a DEC Alpha OSF/1 4.0F. + + tests: always enable VERBOSE output, now that test framework works better + * cfg.mk: Set VERBOSE=yes. + * tests/check.mk: Likewise. + +2008-04-11 Jim Meyering + + doc: avoid "make pdf" failure (due to texi2dvi bug?) + * doc/coreutils.texi (filesZeroFromOption): + Comment out @cindex-in-@macro use. - Ensure that cat works with any of the options, -A -v -e -E -T, - when applied to files in /proc and /sys, even when the FIONREAD - ioctl produces nonsensical results. Before this change, cat would - produce no output (or truncated output), for some linux kernels. + doc: use a valid texinfo macro name + * doc/coreutils.texi (filesZeroFromOption): s/0/Zero/ - * src/cat.c (write_pending): New function, factored out of cat. - (cat): Also interpret a negative ioctl/FIONREAD count as indicating - that there are bytes to read. Some versions of linux-2.6.16 do that. - Write any pending output before returning. - Reported by Dan Jacobson in . - * NEWS: Mention this bug fix. - * tests/misc/cat-proc: New file. Test for the above. - * tests/misc/Makefile.am (TESTS): Add cat-proc. +2008-04-08 Jim Meyering -2006-06-07 Paul Eggert + tests: accommodate a different errno value on HPUX-10.20 + * tests/mkdir/selinux: Also handle "Unknown system error". + Reported by Peter Fales. + +2008-04-06 Jim Meyering + + doc: factor out --files0-from duplication + * coreutils.texi (wc invocation) [files0fromOption]: New macro. Use it. + (du invocation): Use it here, too. - * src/expr.c (eval4): Detect overflow properly when multiplying - INTMAX_MIN * -1. + * src/c99-to-c89.diff: Adjust remove.c diffs. -2006-06-06 Paul Eggert +2008-04-06 Jim Meyering - * NEWS: The 'expr' command now detects and reports integer overflow. - (It would be better to use extended precision instead, but that - would be more work.) - * src/expr.c (integer_overflow): New function. - (eval4, eval3): Check for integer overflow. + remove.c: accommodate systems with negative errno values + This is required at least on Haiku and BeOS. + * src/remove.c (write_protected_non_symlink): Return 1 for a write- + protected non-symlink, 0 if we determine it's not, and -1 upon + error (setting errno accordingly only in this final case). + (prompt): Deal with the changed semantics of the above function. + Based on this patch from Axel Dörfler: + http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/13071 -2006-06-05 Paul Eggert +2008-04-05 Jim Meyering - Fix problems when building with Solaris/SVR4/etc. make, which uses a - different and somewhat bogus implementation of VPATH. In the - directory tests/misc, rename tests whose names might appear in the - Automake-generated rules. For example, we can't use a test named - 'test', since Automake generates a rule that contains the text - "if test -f ./$$tst; ...", and this might expand to something like - "if ../../../coreutils-6.0/tests/misc/test -f ./$$test; ...", - which executes the 'test' script rather than the 'test' command. - * tests/misc/false-status: Renamed from tests/misc/false. - * tests/misc/pwd-long: Renamed from tests/misc/pwd. - * tests/misc/sort-merge: Renamed from tests/misc/sort. - ($prog): Set to 'sort' rather than to $PROG. - * tests/misc/test-diag: Renamed from tests/misc/test. - * tests/misc/Makefile.am (PROG): Take the basename of $$tst, - in case Solaris make has prepended the directory. - (TESTS): Adjust to above renamings. - * tests/misc/expand: Don't assign to PROG; no longer needed - now that Makefile.am sets PROG to the basename. - * tests/misc/fold: Likewise. + Accommodate building on OS/2 (www.ecomstation.com Ecs v2 rc4) + * configure.in: Also filter out carriage returns from the value + of $no_install_progs_default. Reported by Elbert Pol. -2006-06-03 Jim Meyering +2008-04-02 Jim Meyering - Make `cp --link --no-dereference' work also on systems where the - link system call cannot create a hard link to a symbolic link. - * src/copy.c (copy_internal) [LINK_FOLLOWS_SYMLINKS]: Don't use - the link syscall on a symlink when it would do the wrong thing. - Based on the patch by Aurelien Jarno: - * tests/cp/link-no-deref: New file/test for the above. - * tests/cp/Makefile.am (TESTS): Add link-no-deref. - * NEWS: Mention the change (doesn't affect Linux). + "touch E; mkfifo F; cp -fR F E" no longer fails due to existing E + * src/copy.c (copy_internal): Revert change of 2005-03-01, + 4303f0454592421eea48be87777d32a49e1d5e5b + Prompted by Michael Stone, who pointed me to an old bug report from + Ian Jackson: http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/7504 + * tests/cp/special-f: New file. Test for the above. + * tests/cp/Makefile.am (TESTS): Add special-f. + * NEWS: mention this bug fix. + + copy.c: remove an in-function #ifdef + * src/copy.c (rpl_mkfifo) [! HAVE_MKFIFO]: New function. + (mkfifo) [! HAVE_MKFIFO]: Define to rpl_mkfifo. + (copy_internal): Remove #ifdef. + + HACKING: rename README-contribution-guidelines + README-contribution-guidelines: Rename to .. + HACKING: ...this. + +2008-04-01 Jim Meyering + + bootstrap: remove dangling *.[ch] symlinks from lib + * bootstrap [dangling symlink removal]: Match *.[ch] files, too. + Suggestion from Eric Blake. + + bootstrap: make find's -depth option be the first. + * bootstrap [dangling symlink removal]: Move find's -depth + option to precede all others, to avoid a warning. -2006-06-01 Paul Eggert + * bootstrap: Remove dangling symlinks from lib (aka $source_base), too. + + Avoid root-only SELinux-related test failures w/o mcstransd. + When mcstransd is not running (i.e., after service mcstrans stop), + "make check" as root would provoke two test failures. + * tests/cp/cp-a-selinux: Use the context, root:object_r:tmp_t:s0, + that works both with and without mcstransd. + Thanks to Eric Paris for the tip and to Ondřej Vašík for alerting + me to the problem. + Reported by Robert Scheck in . - Fix some porting problems in the test cases reported by - Ralf Wildenhues for HP-UX 11.23 in: - http://lists.gnu.org/archive/html/bug-coreutils/2006-05/msg00238.html - * tests/help-version: Don't assume that \< \> works in sed. - * tests/misc/close-stdout: Don't assume that >&- works. - Add a /dev/full test. - * tests/touch/no-create-missing: Don't assume that >&- works. + root tests: Set NON_ROOT_USERNAME if not set already. + * tests/test-lib.sh (require_root_): This avoids failure of a + couple of root-only tests that require a value for that envvar. -2006-05-30 Jim Meyering + texinfo formatting tweaks + * coreutils.texi: Avoid some overfull hbox warnings. + (Treating / specially): Use @file{/} rather than a bare /. - * src/ls.c (usage): Add `v' to the list of sorting-related options. - From Justin Pryzby. + printf doc: xref print(3) and libc's "Output Conversion Syntax" node + * coreutils.texi (printf invocation): Add xref. + Use "The GNU C Library Reference Manual" as the name of the 'libc' + document consistently. + * man/printf.x: Add See also: printf(3). + Suggested by A. Costa in http://bugs.debian.org/465522 -2006-05-28 Ralf Wildenhues +2008-03-31 Jim Meyering - * tests/cp/fail-perm: source lang-default. - * tests/rm/inaccessible: Likewise. - -2006-05-28 Jim Meyering - - * tests/rm/inaccessible: AIX 4.3.3 gives a different diagnostic. - Recognize it, too. Reported by Ralf Wildenhues, in - http://lists.gnu.org/archive/html/bug-coreutils/2006-05/msg00192.html - -2006-05-27 Jim Meyering - - * src/chgrp.c: Support new options: --preserve-root and - --no-preserve-root. Somehow this program was skipped when those - options were added to chown, chmod, and rm. Reported by - vaqflabuopac@spammotel.com in . - * NEWS: Mention this. - -2006-05-25 Paul Eggert - - * NEWS: Remove mention of --seed. We'll replace it with something - better, and don't want to indicate that it is supported. - * src/sort.c (usage): Likewise. - -2006-05-20 Jim Meyering - - * src/chmod.c (main): Use FTS_PHYSICAL here, too. - - * src/du.c (main): Rename local, s/symlink_deref_bit/symlink_deref_bits/ - and arrange for -D to set fts' FTS_PHYSICAL bit as well as - FTS_COMFOLLOW. Spotted by Justin Pryzby. - - * gnupload: Merge changes from automake, retaining the ""--to... - kludge to placate overzealous `make distcheck' check. - -2006-05-19 Jim Meyering - - * src/du.c (main): Don't let -D, -L, or -P turn off the internal - FTS_TIGHT_CYCLE_CHECK directory traversal option. - Reported by Justin Pryzby in http://bugs.debian.org/367691 - -2006-05-15 Jim Meyering - - * src/cp.c (usage): Correct description of -a: s/-dpR/-dpPR/. - From Tomas Pospisek. - -2006-05-13 Jim Meyering - - * tests/mv/no-target-dir: Test two more cases. - -2006-05-11 Jim Meyering - - mv -T DIR EMPTY_DIR no longer fails unconditionally - * src/copy.c (copy_internal): Don't manually prohibit a move where - the destination is an existing directory. Sometimes doing that is - valid. Let the rename system call enforce the rules. That is - allowed only when the source is a directory and the destination - directory (to be replaced) is empty. Reported by Eric Blake. - * tests/mv/no-target-dir: New file/test for this. - * tests/mv/Makefile.am (TESTS): Add no-target-dir. - * NEWS: Mention this. - - * tests/mv/atomic: New file/test for yesterday's fix. - * tests/mv/Makefile.am (TESTS): Add atomic. - - * tests/du/long-sloop: Avoid harmless `ambiguous redirect' diagnostic. - -2006-05-10 Jim Meyering - - * src/copy.c (copy_internal): Don't explicitly unlink the destination - when moving a symlink into the place of an existing non-directory. - Reported by Joshua Hudson. - * NEWS: mention this. - -2006-05-07 Jim Meyering - - * Makefile.maint (patch-check): Fail if patch generates any output, - even merely for changed offsets. - - * src/c99-to-c89.diff: Adjust to reflect new offsets. - - * NEWS: Mention changes affecting df, pwd, shred. - -2006-05-06 Jim Meyering - - * tests/ls/stat-vs-dirent: New test, to detect the bogus file - system condition where dirent.d_ino != stat.st_ino. - * tests/ls/Makefile.am (TESTS): Add stat-vs-dirent. - -2006-05-06 Eric Blake - - * tests/ls/inode: Expand to test inode from readdir case. - * tests/ls/follow-slink: Expand to test broken links encountered - implicitly, favoring Solaris 9 and OpenBSD 3.4 behavior. - -2006-05-06 Eric Blake - - * tests/mv/leak-fd: Work even on case-insensitive file system. - -2006-05-04 Jim Meyering - - * NEWS: Mention the 2006-03-19 pwd-related change that makes - lib/getcwd.c work around inconsistent file system dirent.d_ino data. - -2006-05-03 Jim Meyering - - * src/ls.c (DEFINE_SORT_FUNCTIONS, LIST_SORTFUNCTION_VARIANTS): - Use better macro parameter names: s/basename/key_name/, - s/basefunc/key_cmp_func. Fix typo in comment. - -2006-04-29 Eric Blake - - * src/ls.c (main): On systems with d_type, directories_first only - implies format_needs_type, not format_needs_stat. - -2006-05-03 Jim Meyering - - * src/ls.c (xstrcoll_df_version, rev_xstrcoll_df_version): Add space - after comma in arg list, from Eric Blake. - -2006-04-25 Paul Eggert - - * tests/misc/date (relative-3): New test, derived from a bug - report by John Thomas McDole. - -2006-04-23 Francesco Montorsi - - New option for ls: --group-directories-first. - It makes ls list directories before files. - * NEWS [New features]: Mention it. - * src/ls.c (sort_type): Rearrange to use as an array index when - choosing sort function; added new sort_numtypes member for - compile-time check. - (time_type): Add new time_numtypes member for compile-time check. - (directories_first): New global variable. - (GROUP_DIRECTORIES_FIRST_OPTION): New enum. - (long_options): Add --directories-first. - (main): Support new option. - (is_directory): New function. - (extract_dirs_from_files): Use it. - (DIRFIRST_CHECK, DEFINE_SORT_FUNCTIONS) - (LIST_SORTFUNCTION_VARIANTS): New macros. - (sort_functions): New global variable. - (sort_files): Use it. - (usage): Document new option. - -2006-04-18 Paul Eggert - - * src/shred.c (fillrand): The assertion was way too weak, due to - what must be a typo. Strengthen it to its intended value. - (dopass): Don't use alloca; it's not worth the aggravation here, - since it's used only to get a page-aligned buffer, and page - alignment doesn't buy us much here. I'm suspicious that alloca - causes problems on some hosts, due to a recent bug report by Adam - Waltman: http://bugs.gentoo.org/130246. - -2006-04-18 Jim Meyering - - * tests/misc/tty-eof: Add new programs, base64, sha224sum, sha256sum, - sha384sum, sha512sum. - -2006-04-17 Paul Eggert - - * src/chmod.c (describe_change): Adjust to filemode changes. - * src/ls.c (HAVE_ST_DM_MODE): Remove; moved to ../lib/filemode.c. - (print_long_format): Use (new) filemodestring rather than - (old) mode_string, so that we get more file types right, at least - in theory. Adjust to filemode changes. - * src/stat.c (human_access): Likewise. - -2006-04-18 Jim Meyering - - * src/ptx.c (main) [DEFAULT_IGNORE_FILE]: Remove code to use a default - ignore file. This has never been enabled. Reported by Eric Blake. - -2006-04-12 Paul Eggert - - * src/ln.c (linkfunc): Remove. This method ran into a compiler/linker - bug in Interix. Just call symlink or link directly. All uses changed. - * src/setuidgid.c (main) [! HAVE_SETGROUPS]: Don't call setgroups. - * src/stat.c (USE_STATVFS): New macro. - Include and use statvfs only if USE_STATVFS. - (NAMEMAX_FORMAT): define a bit more clearly, now that the - statvfs-using code is a bit more regular. - * src/system.h (sync) [!HAVE_SYNC]: New macro. - -2006-04-11 Paul Eggert - - * NEWS: csplit, nl, expr now conform to POSIX better, and are - more-compatible with traditional Unix, with respect to regular - expressions. - * src/csplit.c (extract_regexp): Set re_syntax_options to a - value that is compatible with what POSIX requires. - * src/nl.c (build_type_arg): Likewise. - * src/expr.c (docolon): Likewise. Also, don't let anchors match - newline; this fixes an incompatibility with tradition and with POSIX. - Don't warn about leading ^. POSIX says it is unspecified whether - ^ is a special character, which means that implementations can - either treat it as special or not, but either way a warning is not - allowed (unless the regexp is otherwise invalid). Instead, anchor - the expression but treat ^ as an anchor; this is the traditional - behavior (e.g., Solaris 10). - (eval4, eval3, eval2): Treat non-numeric args, division by zero, - and the like as invalid expressions (exit status 2), not as - failure of 'expr' (exit status 3). This is more consistent with - how Solaris behaves. - * tests/expr/basic (fail-a): Adjust exit status to match new expr - behavior, for status 2 versus 3. - (anchor): New test. - (bre1, bre2, bre3, bre4, bre5, bre6, bre7, bre8, bre9, bre10): - (bre11, bre12, bre13, bre14, bre15, bre16, bre17, bre18, bre19, bre20): - (bre21, bre22, bre23, bre24, bre25, bre26, bre27, bre28, bre29, bre30): - (bre31, bre32, bre33, bre34, bre35, bre36, bre37, bre38, bre39, bre40): - (bre41, bre42, bre43, bre44, bre45, bre46, bre47, bre48, bre49, bre50): - (bre51, bre52, bre53, bre54, bre55, bre56, bre57, bre58, bre59, bre60): - (bre61, bre62): New tests. - * tests/misc/csplit: Use \{...\} in test RE, to test that we're - conforming to POSIX. - - Port to Solaris 8. - * tests/du/long-from-unreachable: Solaris 8 sh doesn't understand - "if !". Do not assume that 'sed' can handle long, newline-free input. - * tests/du/long-sloop: Likewise. Evaluate expr once, not $n times. - -2006-04-10 Paul Eggert - - Adjust to new regex.h API (with new fastmap type), and clean - up the regex storage allocation a bit. - - * src/csplit.c (struct control): Put re_compiled member at the - end, since it's large. Change regexpr member from char * to bool; - all uses changed. Add new member fastmap. - (extract_regexp): regexp arg is now char const *, not char *. - Don't bother duplicating the regular expression; it's not needed. - Set fastmap from new fastmap member. Don't bother allocating - a buffer, as the regexp code does a better job than we do. - * src/expr.c (docolon): Allocate and use a fastmap. - Don't bother allocating a buffer. - * src/nl.c (body_fastmap, header_fastmap, footer_fastmap): - New vars. - (build_type_arg): New fastmap arg. All uses changed. - Don't bother allocating a buffer, but set a fastmap. - * src/ptx.c (context_regex_string, word_regex_string): Remove. - (context_regex, word_regex): New vars, replacing the above. - All uses changed. - (struct regex_data): New type. - (compile_regex): Renamed from alloc_and_compile_regex, since - we no longer allocate storage. Arg is now a struct regex_data *, - not a const char *. All uses changed. Don't allocate the fastmap; - instead, take it from the caller. Don't convert size_t to int, - to avoid arithmetic overflow problems. Don't bother freeing - storage afterwards; it's not worth the aggravation. - * src/tac.c (compiled_separator_fastmap): New ver. - (main): Use it. Don't bother allocating a buffer. - -2006-03-30 Jim Meyering - - * src/dd.c (iwrite): Remove assignment without effect. - Reported by Felix Rauch Valenti. - -2006-03-22 Eric Blake - - * src/ptx.c (usage): Remove mention of --copyright/-C. - (main): Alias --copyright to --version plus a deprecation warning. - * NEWS: Mention this. - -2006-03-27 Jim Meyering - - * src/Makefile.am (uptime_LDADD): Add $(POW_LIB), for uptime's - use of strtod. Tiny patch from Nickolai Zeldovich. - -2006-03-11 Eric Blake - - * tests/misc/dirname: New file. - * tests/basename/Makefile.am: Delete. - * tests/basename/basic: Move to... - * tests/misc/basename: ... this new file. Add some tests, - including fixed behavior for //. - * tests/misc/Makefile.am (TESTS): Sort. Add basename, dirname. - * tests/Makefile.am (SUBDIRS): Remove basename. - * configure.ac (AC_CONFIG_FILES): Remove tests/basename. - - Improvements to dirname/basename handling on platforms like - cygwin with distinct // and with drive letters. - * NEWS: Document new behavior. - * src/basename.c (main): Don't strip suffix from file system - roots. - * src/cp.c (target_directory_operand): Use new last_component. - (ASSIGN_BASENAME_STRDUPA): Likewise. Reduce time spent - traversing the string. - * src/dircolors.c (guess_shell_syntax): Use new last_component. - * src/install.c (target_directory_operand, install_file_in_dir): - Likewise. - * src/ln.c (target_directory_operand, main): Likewise. - * src/ls.c (basename_is_dot_or_dotdot): Likewise. - * src/mv.c (target_directory_operand, movefile): Likewise. - * src/remove.c (rm_1): Likewise. - * src/shred.c (wipename): Likewise. - * src/split.c (next_file_name): Likewise. - * src/su.c (log_su, run_shell): Likewise. - -2006-03-23 Paul Eggert - - * NEWS: nohup diagnostics are now more precise, and nohup now - redirects stderr to nohup.out if stdout is closed and stderr is a tty. - * src/nohup.c (main): Implement this. - * tests/misc/nohup: Test the new behavior. - -2006-03-12 Jim Meyering - - * src/copy.c (set_author): Rename function, from preserve_author. - - * src/remove.c (AD_pop_and_chdir): Use new macro, - CYCLE_CHECK_REFLECT_CHDIR_UP, rather than open-coding it. - - * src/system.h (SAME_INODE): Remove definition. - Include "same-inode.h", instead. - -2006-03-11 Eric Blake - - * src/pwd.c (robust_getcwd): Prepend only one slash, not two. - -2006-03-10 Jim Meyering - - Fix a bug whereby a user with write access to a directory being removed - could cause the removal of that directory to fail with an erroneous - diagnostic about a directory cycle. Reported by Vineet Chadha. - - * NEWS: Mention this. - * src/remove.c (AD_pop_and_chdir): If the directory we're about to - leave (and try to rmdir) is the one whose dev_ino is being used to - detect a cycle, reset cycle_check_state.dev_ino to that of the parent. - -2006-03-08 Paul Eggert - - * NEWS: Document dd's new 'directory' and 'nolinks' flags. - * src/dd.c (set_fd_flags): Handle file-creation flags on file - descriptors, rather than ignoring them. - * tests/dd/misc: Add test cases for append, nofollow, directory, - and nolinks flags. Simplify redirection to /dev/null in some cases. - - * tests/dd/misc: iflags->iflag. This fixes a typo that meant the - noatime test never tested anything. - -2006-03-05 Paul Eggert - - * src/dd.c (flags, usage): New flags directory, nolinks. - * src/system.h (O_NOLINKS): Define to 0 if not already defined. - - * src/ls.c (usage): Mention that -f disables --color. - Problem reported by Niels Möller. - -2006-03-03 Justin Pryzby - - * man/*.x: Add references to syscalls from utilities of the same name. - -2006-03-05 Jim Meyering - - * tests/help-version: Set SHELL, if not already set, in order to - avoid failure when `make check' is run through debuild; dircolors - would fail due to lack of $SHELL. Reported by Sven Joachim. - - Make `base64 --wrap=N' work for N=0, and for N larger than SIZE_MAX. - * src/base64.c (wrap_write, do_encode, main): Change type of - parameters and locals, wrap_column, form size_t to uintmax_t. - (main): Adjust to use xstrtoumax, accordingly. - -2006-03-03 Jim Meyering - - Don't fail when run from an environment with SHELL not a Bourne - shell, e.g. `env SHELL=/bin/csh make check' would fail this test. - * tests/dircolors/simple: Invoke each non-failing test with -b. - Reported by Michael Stone. - -2006-02-27 Jim Meyering - - * tests/misc/base64: Derive --decode-using tests from the - encode-based ones. - - * tests/misc/base64: Factor out a long constant string. - Split lines to stay within 80 columns. - - * tests/misc/Makefile.am (TESTS): Add base64. - * tests/misc/base64: Test base64. From Simon Josefsson. - - * src/base64.c (do_decode): Use correct type for parameter, - ignore_garbage: s/size_t/bool/. - - * src/base64.c: Don't include .h files already included by system.h: - , , , , . - Include "system.h" before the other lib/*.h header files. - Include before "system.h". - (wrap_write): Remove declaration of unused local, initial_column. - (wrap_write): Correct declaration syntax: s/size_t * V/size_t *V/. - - * README: Add base64 to the list. - -2006-02-17 Simon Josefsson - - New program: base64. - * AUTHORS: Mention base64. + Emit "#line 1" right after the two 'read-only/GENERATED' lines. + * bootstrap (cp_mark_as_generated): This preserves line numbering + e.g., in assertions, which is important when correlating between + coreutils test failures and the original files in gnulib/tests. + Suggested by Eric Blake. + + * README-contribution-guidelines: Mention how to amend a commit. + Suggestion from Pádraig Brady. + + Begin documenting contribution guidelines. + * README-contribution-guidelines: New file. For now, not distributed. + + "rm -r DIR" would mistakenly prompt about very long names + * src/remove.c (write_protected_non_symlink): Return 0(-1) when + euidaccess_stat pronounces a writable(not-writable) file, not -1(0). + * tests/rm/deep-2: New file. Test for the above-fixed bug. + * tests/rm/Makefile.am (TESTS): Add deep-2. + Discovered while reviewing this change: + http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/13071 + + * NEWS: Note the dd bug fix. The bug was introduced over 8 years ago: + 9fca49f67c16c8b42c32e185808fe187cedb0fa7 + +2008-03-31 Paul Eggert + + dd bug fix: accept e.g., if=/dev/stdin and of=/dev/stdout + * lib/fd-reopen.c: Work even if FILE is "/dev/stdin". + Problem reported by Geoffrey Lee in . + * tests/dd/misc: Check for this bug. + +2008-03-29 Jim Meyering + + avoid failure of new test on kernel without SELinux support + * tests/mkdir/selinux: Also accept ENOENT. + Reported by Sven Joachim. + + tests: accept ENOTSUP message as well as the EINVAL one + This test would fail on most non-Linux systems because the original + expected an "Invalid argument" diagnostic, yet they all produced + "Operation not supported". + * tests/mkdir/selinux: Accept both strings. Factor out duplication. + + Work around a recent glibc/getopt.c diagnostic change. + * tests/misc/factor: Map new "-- '1'" to expected "-- 1". + +2008-03-28 Jim Meyering + + mknod, mkfifo: don't segfault when diagnosing invalid SELinux context + Identical to the bug fixed by 72d052896a9092b811961a8f3e6ca5d151a59be5. + * src/mkfifo.c (main): Use "scontext", not NULL optarg in diagnostic. + * src/mknod.c (main): Likewise. + Reported by Cristian Cadar, Daniel Dunbar and Dawson Engler. + * tests/mkdir/selinux: Test for the above fixes. + * NEWS: Mention the fixes. + + Fix typo in old NEWS and ChangeLog: s/commmand/command/. + * ChangeLog-2007: Likewise. * NEWS: Likewise. - * man/Makefile.am: Build base64.1. - * man/base64.x: New file. - * src/Makefile.am (bin_PROGRAMS): Add base64. - * src/base64.c: New file. + Prompted by http://bugzilla.redhat.com/439410 + +2008-03-28 Pádraig Brady + + tests: Factor out code that's going to be reused. + * tests/test-lib.sh (mkfifo_or_skip_): New function, factored out of... + * tests/touch/fifo: ...here. + +2008-03-28 Jim Meyering + + Require that "(exit $fail); exit $fail" be last line of each test. + * maint.mk (sc_require_test_exit_idiom): New rule to enforce policy. + * tests/cp/acl: Adhere to the new policy. + * tests/cp/preserve-gid: Likewise. + * tests/dd/misc: + * tests/install/create-leading: + * tests/ln/sf-1: + * tests/ls/symlink-slash: + * tests/misc/help-version: + * tests/misc/ls-time: + * tests/misc/nice: + * tests/misc/shred-remove: + * tests/misc/stty: + * tests/misc/stty-row-col: + * tests/mkdir/p-1: + * tests/mkdir/p-2: + * tests/mkdir/p-3: + * tests/mkdir/p-v: + * tests/mkdir/special-1: + * tests/mkdir/writable-under-readonly: + * tests/mv/acl: + * tests/mv/backup-is-src: + * tests/mv/diag: + * tests/mv/dir-file: + * tests/mv/force: + * tests/mv/hard-link-1: + * tests/mv/i-2: + * tests/mv/i-4: + * tests/mv/into-self: + * tests/mv/into-self-2: + * tests/mv/into-self-3: + * tests/mv/partition-perm: + * tests/mv/to-symlink: + * tests/rmdir/ignore: + * tests/tail-2/assert: + * tests/tail-2/assert-2: + * tests/touch/dangling-symlink: + * tests/touch/dir-1: + * tests/touch/empty-file: + * tests/touch/fifo: + * tests/touch/no-rights: Likewise. + + Perform explicit exit-nonzero if the embedded Perl script fails. + * tests/misc/pwd-long: Add canonical '(exit $fail); exit $fail'. + +2008-03-27 Jim Meyering + + paste -d\\: avoid heap overrun for backslash at end of delim list + * src/paste.c: Include "quotearg.h". + (collapse_escapes): Handle backslash-escaped backslash explicitly. + Handle unescaped backslash at end of string by returning nonzero, + rather than by overrunning memory. + (main): Diagnose an invalid delimiter list -- carefully. + Reported by Cristian Cadar, Daniel Dunbar and Dawson Engler. + * tests/misc/paste-no-nl (delim-bs): Add a test to demonstrate the + heap-smashing capability. + (delim-bs2): Prior to coreutils-5.1.2, this bug was a little harder + to demonstrate: it would corrupt a first-argument containing e.g., \b + * NEWS: Mention the bug fix. + * tests/misc/Makefile.am (TESTS): Reflect renaming. + * tests/misc/paste: Rename from paste-no-nl. + +2008-03-26 Jim Meyering + + * src/join.c (keycmp): Document new parameters. + + Test for mkdir bug fix. + * tests/mkdir/selinux: New file: test for today's fix. + * tests/mkdir/Makefile.am (TESTS): Add selinux. + +2008-03-26 Daniel Dunbar + + mkdir -Z x d: don't segfault when diagnosing invalid context "x" (tiny change) + * src/mkdir.c (main): Use "scontext", not NULL optarg in diagnostic. + Reported by Cristian Cadar, Daniel Dunbar and Dawson Engler. + * NEWS: Mention the bug fix. + +2008-03-25 Peter Fales + + id bug fix: don't point to potentially clobbered static storage + On at least Mac OS, when calling getpwuid twice with the same UID, + the static storage containing results from the first call is + invalidated by the second call. + * src/id.c (main): Point to a copy of the user name string. + +2008-03-25 Eric Blake + + Use new gnulib gnumakefile module. + * bootstrap.conf (gnulib_modules): Pull in new module. + * GNUmakefile: Remove from version control. + * .gitignore: Update. + * configure.ac (AC_CONFIG_LINKS): Delete; rely on gnulib to do + this now. + * Makefile.am (EXTRA_DIST, distclean-local): Likewise. + +2008-03-25 Jim Meyering + + join bug fix: adapt keycmp to work with new order-checking feature + * src/join.c (keycmp): Add two join-field parameters. + (check_order, join): Update callers. + Reported by Dmitry V. Levin in + http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/12731/focus=13017 + * tests/join/Test.pm (chkodr-7): New test for this fix. + +2008-03-23 Jim Meyering + + join.c: syntax/style tweaks + * src/join.c (check_order): Rename from checkorder. + Move definition to precede first use and remove prototype. + Use EXIT_FAILURE, rather than "1". + (key_cmp): Move definition to precede first use. + +2008-03-22 Jim Meyering + + portability: work around a "busybox sed" limitation + * configure.ac: While every other sed tested supports usage like + '/\(re\)/{s//\1/;...}', and POSIX appears to requires this, + busybox's sed does not support it. So duplicate the regexp: + '/\(re\)/{s/\(re\)/\1/;...}'. Reported by Vincent Lefevre: + . + +2008-03-21 Jim Meyering + + * src/c99-to-c89.diff: Adjust seq.c offsets. + + ptx: avoid heap overrun for backslash at end of optarg string + * src/ptx.c (copy_unescaped_string): Ignore a lone backslash + at end of string. Reported by Cristian Cadar, Daniel Dunbar + and Dawson Engler. Details here: + . + * tests/misc/Makefile.am (TESTS): Add ptx-overrun. + * tests/misc/ptx-overrun: New file. Test for the above fix. + * NEWS: Mention the fix. + + ptx.c readability + * src/ptx.c (copy_unescaped_string): Add braces around 80+-line + single-stmt while-loop body. + + Write NEWS and update c99-to-c89 patch for today's rm improvement. + * NEWS: call this a "portability improvement" ;-) + * src/c99-to-c89.diff: Adjust remove.c offsets. + +2008-03-21 Ingo Weinhold + + remove.c: Accommodate systems with negative errno values. + * src/remove.c (cache_fstatat): Store errno value directly in + the st_ino field, rather than trying to shoehorn it into st_size. + This is required at least on BeOS and Haiku. + +2008-03-21 Jim Meyering + + * src/seq.c (long_double_format): Add a comment. + + * GNUmakefile: Update from gnulib. + +2008-03-20 Jim Meyering + + Remove today's automake kludge, altogether. Fix properly. + * man/Makefile.am: Use dist_man1_MANS instead of dist_man_MANS. + Suggestion from Ralf Wildenhues. + + Add a check to detect this problem, in case it reappears. + * maint.mk (my-distcheck): Run "make install", and then ensure + that ls.1 is installed. + + Kludge to make automake generate install-man rules + * man/Makefile.am (dist_man_MANS): Add a literal, rm.1. + Without this, "make install" would not install man pages. + However, with this kludge, the rm.1 man page is installed + even when you configure with --enable-no-install-program=rm. + + Revert recent man/Makefile.am change. + Revert 4b544e447eb78fd1f031a026a499f6aed177808a. + * man/Makefile.am: That change was only a band-aid. It solved + the stated problem, but not a deeper one: that "make install" + would no longer man pages. Reported by Dmitry V. Levin. + The latter problem arose in + 167b8025aca487de001da2448c1aebc2747bc1d3 with the removal of + the sole literal from the definition of dist_man_MANS. When + automake perceives dist_man_MANS as empty, it no longer emits + the install-man* rules. + +2008-03-20 Eric Blake + + Sync GNUmakefile with gnulib. + * GNUmakefile (Makefile.cfg): Rename... + (cfg.mk): ...to this, and make optional. + (GNUmakefile.cfg): Delete, redundant with cfg.mk. + (Makefile.maint): Rename... + (maint.mk): ...to this. + (all) [!_have-Makefile]: Rename... + (abort-due-to-no-makefile): ...to this, and invoke via + .DEFAULT_GOAL to pick up all targets. + * Makefile.cfg: Rename... + * cfg.mk: ...to this. + * Makefile.maint: Rename... + * maint.mk ...to this. + (ME): Reflect rename. + (makefile-check, m4-check, author_mark_check, msg): Use $(ME) + rather than hard-coded name. + * Makefile.am (EXTRA_DIST): Distribute renamed files. + * .x-sc_file_system: Remove Makefile.maint along with others. No longer needed. + * .x-sc_obsolete_symbols: Likewise. + * .x-sc_prohibit_atoi_atof: Reflect renaming and remove no-longer-VC'd names. + * TODO: Likewise. + +2008-03-19 Bob Proulx + + make check: Remove /tmp/ls-creating debug code. + * tests/misc/ls-misc: Remove debug code creating /tmp/ls. + +2008-03-19 Jim Meyering + + bootstrap: restore kludge removed on 2008-03-12: it's still necessary. + * bootstrap: Make the gnulib-tests/test-*.sh scripts executable. + This restores code removed by dec8bb25bb6da2fe9fe6dd63c0fbbd593a0e94cb. + Reported by Bob Proulx. + + Check for -- and remove -- some unnecessarily included header files. + * Makefile.maint: Add checks for a handful of additional header files. + * src/mktemp.c: Don't include "long-options.h". Not used. + * src/pr.c: Don't include "inttostr.h". Not used. + * src/printenv.c: Don't include "error.h". Not used. + * src/test.c: Don't include "error.h". Not used. + * src/touch.c: Don't include "safe-read.h". Not used. + + Remove more vestiges of CVS. + * Makefile.maint (VC_LIST): Rename from CVS_LIST. + (VC_LIST_EXCEPT): Rename from CVS_LIST_EXCEPT. + + mv: never unlink a destination file before calling rename + While cp --preserve=links must unlink certain destination files, + mv must never do that. + * src/copy.c (copy_internal): Pull the '! x->move_mode' test "up", + so it affects the entire condition, and not just DEREF_NEVER mode. + Reported by James Ralston in . + * tests/mv/atomic2: New file. Test for the above fix. + * tests/mv/Makefile.am (TESTS): Add atomic2. + * NEWS: Mention the bug-fix. + [Bug introduced in 367719ba5f1dbd5e2f7fa2466c441f23f66a7c9e] + + "make" would not always update man/*.1 files (but "make dist" would) + * man/Makefile.am (BUILT_SOURCES): Define, so that "make" always + updates man/*.1 files. Reported by Bob Proulx. + +2008-03-18 Jim Meyering + + syntax-check: Make the space-before-open-paren optional. + * Makefile.maint (sc_prohibit_assert_without_use): Match also + when there is no space before the opening parenthesis. + (sc_prohibit_getopt_without_use): Likewise. + (sc_prohibit_quotearg_without_use): Likewise. + (sc_prohibit_quote_without_use): Likewise. + + * Makefile.maint (sc_no_have_config_h): Use a more precise regexp. + + * Makefile.maint (CVS): Remove now-unused definition. + + Factor out duplication in sc_prohibit_*_without_use rules. + * Makefile.maint (_header_without_use): New "command", + factored out of four sc_prohibit_HEADER_without_use rules. + (sc_prohibit_assert_without_use): Rewrite using $(_header_without_use). + (sc_prohibit_getopt_without_use): Likewise. + (sc_prohibit_quotearg_without_use): Likewise. + (sc_prohibit_quote_without_use): Likewise. + +2008-03-18 Dmitry V. Levin + + Correct typo in "make syntax-check" diagnostic. + * Makefile.maint (sc_prohibit_getopt_without_use): s/assert.h/getopt.h/ + +2008-03-16 Jim Meyering + + Prohibit inclusion of getopt.h without use. + * Makefile.maint (sc_prohibit_getopt_without_use): New rule. + + Include only if used. + * src/group-list.c: Don't include . + * src/printf.c: Likewise. + +2008-03-16 J. Scott Edwards + + sha512_process_bytes: fix a bug in processing a buffer where length&64 != 0 + * gl/lib/sha512.c (sha512_process_bytes): s/63/127/. + +2008-03-12 Jim Meyering + + Generalize GNUmakefile, ... + ...so that it can be used unmodified by autoconf. + * GNUmakefile: Include optional file, GNUmakefile.cfg. + Autoconf will use this to override _autoreconf and to export PATH. + (_autoreconf): Define. + (_dummy): cd to $(srcdir) before removing autom4te.cache. + + * bootstrap: Sync from gnulib and remove part of a local kludge. + +2008-03-10 Ondřej Vašík -2006-02-25 Eric Blake + install, rmdir: write --verbose output to stdout, not to stderr. + * src/install.c (announce_mkdir): Write verbose output to stdout, + not to stderr. + * src/mkdir.c (announce mkdir): Use prog_fprintf for verbose output. + * src/prog-fprintf.c (prog_fprintf): New function and file. + * src/prog-fprintf.h: New file. + * src/rmdir.c (main): Write verbose output to stdout, not to stderr. + Quote directory name in a diagnostic. + * src/rmdir.c (remove_parents): Write verbose output to stdout, + not to stderr. + * doc/coreutils.texi: Mention that shred verbose output is to stderr. + * NEWS: Mention the changes. - In ls, avoid calling stat for --inode (-i), when possible. - * src/pwd.c (NOT_AN_INODE_NUMBER, D_INO): Move to ... - * src/system.h: ... here, for use in ... - * src/ls.c (main): ... here. Prefer dirent.d_ino to stat when - possible. - (gobble_file): Add inode argument. - (print_dir): Pass inode if available. - (usage): Remove inaccuracy. - -2006-02-23 Jim Meyering - - * TODO: Update/correct some obsolete entries. - -2006-02-20 Paul Eggert - - * doc/coreutils.texi (join invocation): Mention `sort -k 1b,1'. - * src/join.c (usage): Likewise. - Documentation problem reported by Philip Kensche. - -2006-02-20 Eric Blake - - * man/rm.x: Update documentation to match previous patch. - -2006-02-18 Eric Blake - - New option for rm: --interactive=once (-I). - * NEWS: Document it, along with change to rm --interactive. - * TODO: Remove entry for implementing rm -I - * src/rm.c (INTERACTIVE_OPTION): New enum value. - (interactive_type): New enum. - (long_opts): Let interactive take an optional argument. - (interactive_args, interactive_types): New option arguments. - (usage): Document -I, --interactive=WHEN. Use program_name - instead of a basename. - (main): New -I option, new behavior to --interactive. - * tests/rm/interactive-once: New tests. - * tests/rm/interactive-always: Ditto. - * tests/rm/Makefile.am (TESTS): Run them. - -2006-02-18 Jim Meyering - - * Makefile.maint (sc_two_space_separator_in_usage): Make the regular - expression match more of the target lines, e.g., those that start with - `-S,' (short option followed by a comma) or that include `=[...]'. - Patch by Nicolas François. - Fix the four offenders thus exposed: - * src/join.c (usage): Use two spaces (not one) to separate the - --first-only option string from its description, so help2man formats - the derived man page properly. - * src/pr.c (usage): Likewise. - * src/uniq.c (usage): Likewise. - * src/install.c (usage): Likewise. - -2006-02-15 Jim Meyering - - * Makefile.maint (alpha beta major): For `make major', ensure that the - version string is of the form N.N[.N]*, where N is one or more digits. - -2006-02-14 Jim Meyering - - * INSTALL: Update from gnulib. - -2006-02-13 Jim Meyering - - * GNUmakefile (all): Emit diagnostics to stderr, not stdout. - -2006-02-12 Jim Meyering - - * Makefile.maint (patch-check): New target. - (local-checks-available): Add to the list. - -2006-02-11 Jim Meyering - - * src/c99-to-c89.diff: New file. - * src/Makefile.am (EXTRA_DIST): Add c99-to-c89.diff. - - * .x-po-check: New file, with exclusions so that `make distcheck' - passes once again. - * Makefile.am (EXTRA_DIST): Add .x-po-check. - - rm -r must remove an empty directory, even if it is inaccessible. - * src/remove.c (close_preserve_errno): New function. - (fd_to_subdirp): Don't print a diagnostic in this function. - Do it from the callers instead, unless rmdir succeeds. - (remove_cwd_entries, remove_dir): Adjust callers. - * tests/rm/empty-inacc: New test for the above. - * tests/rm/Makefile.am (TESTS): Add empty-inacc. - * NEWS: Mention this bug fix. - * tests/rm/rm2: Adjust two expected diagnostics, now that they're - a tiny bit less precise: cannot remove `a/1': ... instead of - cannot open directory `a/1': ... - - * Makefile.maint (syntax-check-rules): Automatically derive this - list of sc_-prefixed rule names. - -2006-02-10 Paul Eggert - - * Makefile.maint (CVS_LIST): Don't assume cvsu is available. - (CVS_LIST_EXCEPT): New macro, to simplify exception-processing. - Most uses of CVS_LIST changed to use CVS_LIST_EXCEPT. - (syntax-check-rules): Bring back sc_changelong. (Hmm, why did it - go away? was that an accident?) - (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value): - (sc_cast_of_alloca_return_value, sc_space_tab, sc_prohibit_atoi_atof): - (sc_error_exit_success, sc_file_system, sc_no_if_have_config_h): - (sc_system_h_headers, sc_sun_os_names, sc_trailing_blank): - (sc_two_space_separator_in_usage, sc_unmarked_diagnostics): - (sc_obsolete_symbols, sc_changelog, sc_prohibit_jm_in_m4): - (sc_useless_cpp_parens, makefile-check, m4-check, po-check): - (author_mark_check, makefile_path_separator_check): - Output line numbers, to simplify navigation of Emacs *compilation* - buffers. - (sc_prohibit_atoi_atof, sc_file_system): - Rework slightly so that Makefile.maint doesn't get reported as a - violation of its own syntax rules. - (sc_dd_max_sym_length): Use ifneq to do nothing, instead of doing - it at run-time (which didn't work with Bison). Fix a makefile typo, - caught by Makefile.maint itself: spaces where a tab should be. - (po-check): Check lib/*.[ch] even if not in CVS; used by Bison, - which copies from ../gnulib/lib/*.[ch] to lib/*.[ch]. - Ignore djgpp and man subdirectories, to avoid false matches with - Bison and coreutils, respectively. Use sort -u to remove the - resulting duplicates. - * gnupload: Rework slightly to avoid bogus warning from - sc_two_space_separator_in_usage. - -2006-02-10 Jim Meyering - - Use gzip's --rsyncable option only if it's available. - * Makefile.maint (gzip_rsyncable): New variable. - (GZIP_ENV): Use it. - -2006-02-08 Jim Meyering - - * Makefile.maint (local-checks-available): Define in terms of - the expansion, $(syntax-check-rules), rather than the single, - top-level target `syntax-check', so that it's easier to exclude - individual rules (via $(local-checks-to-skip)). - (tgz-md5, tgz-sha1, ...): Remove now-unused definitions. +2008-03-10 Jim Meyering -2006-02-07 Jim Meyering + make syntax-check: also check src/*.h files for extern functions, + * src/Makefile.am (sc_tight_scope): ... now that there is one. - * src/system.h (!defined O_DIRECT): If O_DIRECTIO is defined (as it - is on Tru64), define O_DIRECT to that. Patch From James Lemley. +2008-03-07 Jim Meyering - * tests/help-version (expected_failure_status_vdir): - Redirect an expected disk-full diagnostic to /dev/null. + dd: avoid unnecessary, but harmless close_stdout call. + * src/dd.c (close_stdout_required): New global. + (maybe_close_stdout): New function. + (main): Set the global. + Reported by Ulrich Drepper in http://bugzilla.redhat.com/436368 -2006-02-06 Jim Meyering +2008-03-06 Jim Meyering - * src/unexpand.c (usage): Use two spaces (not one) to separate the - --first-only option string from its description, so help2man formats - the derived man page properly. - * src/rm.c (usage): Likewise for --no-preserve-root. - * src/chown.c (usage): Likewise. - * src/chgrp.c (usage): Likewise. + Now that ChangeLog is no longer under version control, ... + * Makefile.maint (alpha beta major): Don't make changelog-check. + (changelog-version-check): Rename from changelog-check. - Add a rule to ensure that the above doesn't happen again. - * Makefile.maint (sc_two_space_separator_in_usage): New rule. - (syntax-check-rules): Add it. - * .x-sc_two_space_separator_in_usage: New empty file. - * Makefile.am (EXTRA_DIST): Add .x-sc_two_space_separator_in_usage. +2008-03-05 Jim Meyering -2006-02-06 Jim Meyering + * src/c99-to-c89.diff: Accommodate a C99-ism in id.c. - * src/cp.c (usage): Use two spaces (not one) to separate each - option string from its description, so help2man formats the - derived man page properly. - * src/mv.c (usage): Likewise. - Patch from Nicolas François in http://bugs.debian.org/351601. +2008-03-05 ribalba -2006-02-04 Jim Meyering - - * src/copy.c (copy_internal): cp -RL would fail when encountering - the same directory more than once in the hierarchy beneath a single - command-line argument. That is legitimate, e.g. when there are - two or more symbolic links, each pointing to some directory that - would not otherwise be copied. Reported by Christophe LYON. - * tests/cp/cp-deref: New file. Test for today's fix. - * tests/cp/Makefile.am (TESTS): Add cp-deref. - * NEWS: Document this. - -2006-02-03 Jim Meyering - - * configure.ac: Require automake-1.9.6, not 1.8.3. - -2006-02-01 Paul Eggert - - * src/od.c (usage): Mention that -t a ignores high order bit. - Documentation problem reported by Ed Avis. - -2006-02-01 Jim Meyering - - * src/pwd.c (find_dir_entry): Remove unused local, `ent_sb_valid'. - -2006-01-30 Paul Eggert - - * src/head.c (main): Use a better diagnostic when someone uses a - trailing numeric option in an invalid way. Problem reported by - Karl Berry. - * src/tail.c (parse_options): Likewise. - -2006-01-30 Jim Meyering - - * man/wc.x: Include `count' keyword in man page synopsis, - per suggestion from http://bugs.debian.org/181585. - -2006-01-24 Paul Eggert - - * src/df.c (show_dev): If the file system claims to have - more available than total blocks, report the number of used - blocks as being total - available (a negative number) rather - than as garbage. Problem reported by Toralf Foerster. - -2006-01-24 Jim Meyering - - * src/tail.c (tail_forever): Don't exit-nonzero when an attempt - to put a regular file in O_NONBLOCK mode fails with EPERM. - That happens on Linux (up to 2.6.15) when using tail -f on a file with - the append-only attribute. Reported by Dean Gaudet. For details, - see http://savannah.gnu.org/bugs/?func=detailitem&item_id=15473. - * NEWS: Mention this fix. - * tests/tail-2/append-only: New file. Test for the above. - * tests/tail-2/Makefile.am (TESTS): Add append-only. - * tests/Makefile.am (check-root): Add tail-2/append-only - -2006-01-21 Jim Meyering - - * NEWS: Mention fts-related improvements and bug fixes. - -2006-01-19 Jim Meyering - - * tests/fmt/basic (pfx-1, pfx-2): New tests, to demonstrate the bug - reported as http://bugs.debian.org/147577. Forwarded by Thomas Hood. - -2006-01-18 Jim Meyering - - * tests/du/Makefile.am (TESTS): Add long-from-unreadable. - -2006-01-17 Jim Meyering - - Now that fts no longer changes the current working directory, adjust - its clients accordingly -- note that du.c uses fts but doesn't need - any adjustment, since it doesn't operate on the actual files, - but rather just uses the stat buffers provided by fts. - - * src/chown-core.c: Include "openat.h". - Don't include "lchown.h". - (restricted_chown): Accept a new parameter, CWD_FD, and use it in - calling openat, lchownat, chownat, rather than open, lchown, chown. - Update caller. - * src/chmod.c: Include "openat.h". - (process_file): Use chmodat (fts->fts_cwd_fd,... in place of chmod (... - - * tests/du/long-from-unreadable: New test, to exercise one small - corner of fts.c. - -2006-01-13 Jim Meyering - - * tests/Makefile.am (SUBDIRS): Add comments discouraging the - addition of new directories under tests/. - - * tests/acl: Redirect stdin to /dev/null. Otherwise, FreeBSD 5.0's - getfacl would hang. - -2006-01-12 Jim Meyering - - * tests/du/long-sloop: Adjust not to hard-code the expected - diagnostic corresponding to ELOOP. Solaris' diagnostic differs - from that of GNU libc. Reported by Paul Eggert. - - * tests/du/long-sloop: Create file at end of symlink chain. - - * tests/misc/test: New file, with a test for one of the - bugs fixed by yesterday's test.c changes. - * tests/misc/Makefile.am (TESTS): Add test. - -2006-01-11 Jim Meyering - - * tests/du/long-sloop: New file. Test for today's fts.c bug fix. - That bug could make du -L, chgrp -L, or chown -L fail to diagnose - a very long sequence of symbolic links (not necessarily a loop). - * tests/du/Makefile.am (TESTS): Add long-sloop. - -2006-01-11 Paul Eggert - - * src/test.c (test_syntax_error): Append a newline. All callers - changed, except for the ones that didn't already append a newline. - Bug reported by Eric Blake. - -2006-01-11 Jim Meyering - - * src/system.h (X2NREALLOC): Now that verify_true is no longer - void, cast its result to void, to avoid gcc's warning that - ``left-hand operand of comma expression has no effect''. - (DECIMAL_DIGIT_ACCUMULATE, X2REALLOC): Likewise. - -2006-01-10 Jim Meyering - - * tests/chmod/no-x: Add a test for today's fts.c fix. - -2006-01-10 Jim Meyering (tiny change) - - * src/ls.c (gobble_file): Use DTTOIF only if it's defined. - This is necessary for Dragonfly. Patch by Joerg Sonnenberger. - -2006-01-10 Paul Eggert - - * src/system.h (X2NREALLOC, X2REALLOC, DECIMAL_DIGIT_ACCUMULATE): - Use verify_true instead of verify_expr, to sync with gnulib. - -2006-01-08 Jim Meyering - - * src/date.c (usage): Adjust the formatting of the entries for - %::z and %:::z (separate with two spaces, not one) so that help2man - formats them properly. Reported by Philip Rowlands. - -2006-01-06 Paul Eggert - - * configure.ac (gl_IGNORE_UNUSED_LIBRARIES): Add. - -2006-01-06 Jim Meyering - - * Makefile.maint (copyright-check): Use date +%Y in place of - hard-coded 2005. - - * src/remove.c (rm_1): Remove `static' attribute on local `status'. - First off, the attribute should have been `volatile' (not static) - to avoid longjmp-related risk of clobber. Secondly, now there is - no longer any risk of a local variable being clobbered, so there's - no need for any attribute at all. - -2006-01-05 Jim Meyering - - * src/remove.c: Give a few functions the inline attribute. - (AD_pop_and_chdir): Use gotos to avoid some duplication. - (AD_push): Rewrite an assertion so that the entire computation - goes away when assertions are turned off. - - * src/tail.c (ENOSYS) [!defined ENOSYS]: Don't define here. - It's already defined in "system.h". - * Makefile.maint: Add a FIXME comment. - -2006-01-04 Jim Meyering - - * ChangeLog: Remove entries from 2005-10-22 and earlier. - * ChangeLog-2005: New file, for entries up to version 5.92. - -2006-01-03 Jim Meyering - - * tests/du/no-x: Also allow a slightly different diagnostic -- the - one you get when using openat-enabled fts.c and du (coming soon). - * tests/chmod/no-x: Likewise. - * tests/chgrp/no-x: Likewise. - - * src/system.h (O_DIRECTORY) [!defined O_DIRECTORY]: Define. - -2006-01-02 Paul Eggert - - * src/chown-core.c (RC_do_ordinary_chown): New enum value. - (restricted_chown): Return it, if the file cannot be accessed due - to EPERM, or if no uid or gid are required, or if the file is - neither a directory nor a regular file. Rewrite to avoid gotos. - (change_file_owner): Handle RC_do_ordinary_chown case. - Rewrite to avoid gotos. - * tests/chgrp/basic: Make sure we can change the group of - inaccessible files. - - * src/date.c (usage): Explain %g, %G, and %V a bit better. - -2006-01-02 Jim Meyering - - * src/copy.c (set_owner): Correct a comment. - - * src/tail.c (parse_options): Change warning to say that --retry - is useful `mainly' (not `only') when following by name. - Reported here: http://bugs.debian.org/273781 - -2006-01-01 Paul Eggert - - * NEWS: Document that mkfifo and mknod -m no longer set special bits. - * src/copy.c: Include lchmod.h. - (copy_internal): Use lchmod rather than chmod. - * src/cp.c: Include lchmod.h. - (re_protect, make_dir_parents_private): Use lchmod rather than chmod. - * src/mkdir.c: Include lchmod.h. - (usage): Clarify -m's operation. - (main): Use lchmod rather than chmod. Don't use lchmod unless the - new mode contains bits outside the 777 range. - * src/mkfifo.c (usage): Clarify -m's operation. - (main): If -m is given, don't invoke chmod; use umask 0 instead. - Report an error if -m asks for bits outside the 777 range. - * src/mknod.c (usage, main): Likewise. - - * src/mkdir.c, src/mkfifo.c, src/mknod.c: Undo 2005-12-19 changes. - -2005-12-27 Jim Meyering - - * Makefile.maint (sc_obsolete_symbols): Prohibit use of O_NDELAY. - (sc_prohibit_assert_without_use): New rule. - (syntax-check-rules): Add it to the list. - * .x-sc_prohibit_assert_without_use: New empty file. - * Makefile.am (EXTRA_DIST): Add it. - - * Makefile.maint (CVS_LIST): Define in terms of $(srcdir). - - * cp.c, df.c, link.c, mknod.c, nice.c, sleep.c, unlink.c: - Don't include ; it wasn't used. - -2005-12-26 Paul Eggert - - * src/chown-core.c (restricted_chown): - Don't try O_WRONLY unless O_RDONLY failed wth EACCES. - * src/remove.c (fd_to_subdirp): Open with O_DIRECTORY | O_NOCTTY - | O_NOFOLLOW too, for consistency with other dir-openers. - Use POSIX-preferred O_NONBLOCK rather than O_NDELAY. - (is_empty_dir): Likewise. - * src/shred.c (wipename): Likewise. Don't bother trying to open - dir for writing, since POSIX prohibits it. - -2005-12-22 Jim Meyering - - * tests/help-version: Redirect stderr to /dev/full, to suppress - write error diagnostic. - -2005-12-19 Jim Meyering - - * src/mkdir.c, src/mknod.c, src/mkfifo.c (main) - Avoid a minor race condition when `-m MODE' is specified, by using - open, fchown, and close rather than just chown. To do that reliably -- - even with an overly restrictive umask -- ensure that each mkdir, - mknod and mkfifo call uses a mode including at least owner-read access. - * src/mknod.c (main): When `-m MODE' is specified, exit nonzero if - the subsequent chown (or equivalent open,fchown,close) fails. - * tests/misc/mknod: New tests. - * tests/misc/Makefile.am (TESTS): Add mknod. - -2005-12-17 Jim Meyering - - * src/remove.c (is_empty_dir): Open with O_NDELAY, so we don't hang, - e.g., on a named pipe. - (OPEN_NO_FOLLOW_SYMLINK): Remove definition. Use O_NOFOLLOW in - place of all uses, since it is guaranteed (system.h) to be defined. - -2005-12-05 Andreas Gruenbacher - - Add POSIX ACL support - * src/ls.c: Switch back from HAVE_ACL to USE_ACL: The acl() syscall - is no requirement for ACL support; particularly, it does not exist - on systems that have POSIX ACLs. - * src/copy.h (cp_option_init) [umask_kill]: Remove member. - * src/cp.c (umask_kill): With default acls, the umask is not to be - applied. Remove umask_kill, don't change the process umask, and let - the kernel apply the umask where appropriate. - * src/cp.c (make_dir_parents_private): Fix logic for POSIX ACLs. - * src/copy.c (get_dest_mode): Remove; it is obsolete after removing - umask_kill. - (copy_reg, copy_internal): Use copy_acl and set_acl - instead of fchown/chown. Fix the logic for POSIX ACLs. - (chown_succeded): Remove; we now always copy acls and - preserve S_ISUID, S_ISGID, and S_ISVTX when needed, no matter if we - did a chown before or not. - * src/mv.c, src/install.c (cp_option_init): Don't set umask_kill member. - * src/Makefile.am (dir_LDADD, ls_LDADD, vdir_LDADD, cp_LDADD, - mv_LDADD, ginstall_LDADD): On systems with an ACL library, arrange - to link with it via $(LIB_ACL), for the utilities that need it. - -2005-12-16 Paul Eggert - - * src/remove.c (OPENAT_CWD_RESTORE__REQUIRE): Remove. - (OPENAT_CWD_RESTORE__ALLOW_FAILURE): Likewise. - (fd_to_subdirp): Remove openat_cwd_restore_allow_failure arg; its - value is now signified by whether cwd_errno is null. - (fd_to_subdirp, remove_dir, rm_1); Change cwd failure indicator from - pointer-to-bool to pointer-to-errno-value. All callers changed. - (rm_1): Don't bother setting a local cwd failure flag and then - ORing it into the caller's. Just set the caller's. - (rm): Use cwd failure errno value to print a slightly-better - diagnostic. - -2005-12-15 Jim Meyering - - * src/stat.c (print_it): Properly handle a backslash at the - end of a --printf format string. Reported by Paul Eggert. - * tests/misc/stat-printf (end-bs): Add a test for the above. - -2005-12-15 Paul Eggert - - * tests/acl: Port to pre-POSIX shells like Solaris 8 /bin/sh. - Don't assume /etc/passwd contains user names; use 'id' instead. - -2005-12-15 Jim Meyering - - stat: revert behavior of --format=FMT (-c) - stat: add new option: --printf=FMT + Work around AFS bug: id and groups would print invalid group number. + * src/id.c (main): Call print_group_list with a user name, if possible. + * src/groups.c (main): Likewise. * NEWS: Mention this. - * src/stat.c (isodigit, octtobin, hextobin): Define. - (PRINTF_OPTION): Define. - (interpret_backslash_escapes, trailing_delim): New globals. - (usage): Document them. Alphabetize on long option names. - (print_esc_char): New function. - (print_it): Rewrite, in order to handle backslash escapes. - (main): Handle new option. Set globals for --format, too. + For details, see + http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/12852 + http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/12875 - * tests/misc/stat-printf: Test --printf and --format. - * tests/misc/Makefile.am (TESTS): Add stat-printf. +2008-03-05 Jim Meyering -2005-12-14 Paul Eggert + Now that Makefile.maint is used in VPATH builds, too... + * Makefile.maint (prev_version_file): Prefix with $(srcdir)/. + (syntax-check-rules): Prefix $(ME) with $(srcdir)/. - * NEWS: sort now reports incompatible options. - * src/sort.c (incompatible_options, check_ordering_compatibility): - New functions. - (main): Use them. Don't bother with a usage message for - "sort -c a b", for consistency with other error diagnostics. - * tests/sort/Test.pm (incompat1, incompat2, incompat3, incompat4): - New tests. + Avoid new "make distcheck" failure, now that VPATH has GNUmakefile. + * GNUmakefile: Remove commands to create ".version". + They were unnecessary, and caused creation of a newer .version + file in a VPATH build, which in turn caused creation of updated + man/*.1 files reflecting the newer time stamp on .version. + Those *.1 files were not removed (since they're distributed), and + the fact that they remained after "distclean" triggered the failure. - * src/cat.c (main): Undo previous change. close_stdout already - does the check, so the previous change wasn't necessary. +2008-03-04 Eric Blake -2005-12-13 Paul Eggert + Reinstate GNUmakefile patch, but with workaround for automake. + * configure.ac (AC_CONFIG_LINKS): Use shell variable to bypass + automake distclean rules. + * Makefile.am (distclean-local): Clean GNUmakefile in VPATH builds, + since we are bypassing automake. + * GNUmakefile (_is-dist-target): 'distclean' is not a dist target. - * src/cat.c (main): Check for close (STDOUT_FILENO) failure. +2008-03-04 Jim Meyering -2005-12-12 Paul Eggert + Clarify comment and attribute preceding change: Reported by Ralf Wildenhues. - Install a more-conservative approach for sort -R. It's the - same basic idea as the existing code, except it uses the full ISAAC - approach (called the "more kosher" approach in the existing comments). - This makes "sort -R" quite a bit slower (about a factor of 2 on my - little tests involving 10000 lines on a 2.4 GHz P4), but I think it's - better to be conservative here at first, and review any performance - improvements carefully. - * .x-sc_require_config_h: Add src/rand-isaac.c. - * src/rand-isaac.h: Remove. All uses now simply include rand-isaac.c. - * src/Makefile.am (noinst_HEADERS): Remove rand-isaac.h. - (shred_SOURCES, sort_SOURCES): Remove. - (EXTRA_DIST): Add rand-isaac.c. - * src/rand-isaac.c: Revert to what used to be in shred.c, without - changing it to allow for varying numbers of words in the state. - Alter so that we include rand-isaac.c directly rather than - compiling it and linking to it. Don't include config.h or - system.h; that's the includer's responsibility. - Omit functions that are specific to shred. - (ISAAC_LOG, ISAAC_WORDS, ISAAC_BYTES, struct isaac_state, ind): - (isaac_step, struct irand_state): - Resurrect these, with the same defns that used to be in shred.c. - (ISAAC_SIZE, isaac_new, isaac_copy): Remove. - (isaac_refill, isaac_seed_start, isaac_seed_data, irand_init, irand32): - static again. - (struct isaac_state, isaac_refill, isaac_mix, isaac_init): - (isaac_seed_start, isaac_seed_data, isaac_seed_finish, isaac_seed): - (irand_init, irand32, irand_mod): - Number of words is constant again. - (struct irand_state, irand_init, irand32, irand_mod): Move to shred.c. - * src/shred.c: Include rand-isaac.c rather than rand-isaac.h. - * src/sort.c: Likewise. - * src/shred.c (fillrand, dopass, main): Undo previous change. - (struct irand_state, irand_init, irand32, irand_mod): Moved back here, - from rand-isaac.c. - * src/sort.c: Don't include md5.h; it wasn't needed. - (struct keyfield): Rename random_hash to random, for consistency - with the other member names. All uses changed. - (usage): Tweak wording to mention STRING for --seed option. - (short_options): Rorder for consistency with other programs. - (rand_state): Now a struct, not a pointer to one. All uses changed. - (HASH_WORDS, HASH_SIZE): Remove. - (get_hash): Remove comments around resbuf size, since we can assume C89. - Use a "more-kosher" (but slower) approach of invoking isaac_refill. - (keycompare): Adjust to the new get_hash. - Add a FIXME. - (badfieldspec): Omit recently-introduced comment; it isn't needed. - (main): Don't set need_random simply because gkey has it set; that - doesn't necessarily mean we'll need random numbers. - Redo seeding to match new get_hash approach. + Comment out yesterday's VPATH-friendly addition, for now. + * configure.ac: ...while we wait for a fixed version of automake. -2005-12-10 Jim Meyering +2008-03-03 Eric Blake - * src/Makefile.am (noinst_HEADERS): Add rand-isaac.h. + Use m4_PACKAGE_VERSION, not AC_AUTOCONF_VERSION. + * configure.ac: The latter is only in post-2.61 autoconf. - Avoid shred segfault on 64-bit systems. - * src/rand-isaac.c (isaac_refill): Don't try to negate a - local of type uint32_t. Make the local an `int' instead. + GNUmakefile build tweaks. + * GNUmakefile: When Makefile is not present, make common targets depend + on "all" in order to trigger nicer error message. + * configure.ac: If autoconf is new enough, link GNUmakefile into VPATH + builds. + For more details, see + . - * NEWS: Mention sort's new options. +2008-03-03 Simon Josefsson - * src/rand-isaac.c (isaac_mix): Declare to be static. - Mark all other functions as `extern' so the tight-scope - part of `make distcheck' passes once again. - * src/rand-isaac.h (isaac_mix): Remove declaration. + Define SHA*_DIGEST_SIZE symbols. + * gl/lib/sha256.h (SHA224_DIGEST_SIZE, SHA256_DIGEST_SIZE): Define. + * gl/lib/sha512.h (SHA384_DIGEST_SIZE, SHA512_DIGEST_SIZE): Define. - * src/sort.c (get_hash): Change position of `*' in parameter - type to conform with convention. - (main): Split a long line so it fits in 80 columns. - (keycompare): Remove stray SPACE before TAB that was - causing `make distcheck' to fail. +2008-03-02 Ralf Wildenhues - * src/shred.c: Don't include gethrxtime.h. No longer needed. + Fix so that out-of-tree VPATH "make dist" works, too. + * GNUmakefile: Add $(srcdir)/ prefix to git-version-gen and argument. - * tests/misc/sort-rand: New file: basic tests for the new options. - * tests/misc/Makefile.am (TESTS): Add sort-rand. +2008-03-02 Jim Meyering -2005-12-10 Frederik Eaton + One more for non-srcdir "make dist". + * GNUmakefile: Also cd $(srcdir) before running autoreconf. - * src/Makefile.am (sort_LDADD): Add $(LIB_GETHRXTIME). - (shred_SOURCES, sort_SOURCES): New macros, so we compile rand-isaac.c. - * src/rand-isaac.c: New file, containing ISAAC code that was in shred.c. - Make state size runtime-configurable. - (isaac_new, isaac_copy): New functions. - * src/rand-isaac.h: New file. - * src/shred.c: Include rand-isaac.h. Move ISAAC code to rand-isaac.c. - (fillrand, main): Adjust to the fact that the state size is now - runtime-configurable. - * src/sort.c (short_options, long_options, WORDS, keycompare, main): - (usage): Add options --random-sort and --seed to implement a random - shuffle. - Include md5.h and rand-isaac.h. - (get_hash): New function. - (rand_state): New var. - (HASH_WORDS, HASH_SIZE): New macros. + Adjust so that non-srcdir "make dist" works, too. + * GNUmakefile: Add $(srcdir)/ prefix to git-version-gen and argument. -2005-12-09 Paul Eggert + Don't infringe namespace of "sub"-Makefiles. + * GNUmakefile (_dummy, _have-Makefile): Add "_" prefix. - * tests/dd/misc: Add test for dd iflags=noatime. + Create sha256 and sha512 modules and move files into gl/. + * bootstrap.conf (gnulib_modules): Add sha256 and sha512. + * m4/prereq.m4: Don't require gl_SHA256 or gl_SHA512. + * gl/modules/sha512: New file. + * gl/modules/sha256: New file. + * m4/sha256.m4: Move to ... + * gl/m4/sha256.m4: ...here, removing use of AC_SOURCES. + * m4/sha512.m4: Move to ... + * gl/m4/sha512.m4: ...here, removing use of AC_SOURCES. + * lib/sha256.c, lib/sha256.h: Move to ... + * gl/lib/sha256.c, gl/lib/sha256.h: ...here. + * lib/sha512.c, lib/sha512.h: Move to ... + * gl/lib/sha512.c, gl/lib/sha512.h: ...here. + * lib/u64.h: Move to ... + * gl/lib/u64.h: ...here. -2005-12-09 Jim Meyering + * bootstrap: Remove only *.m4, and only from $m4_base/. Rewrite the comment. - * src/sort.c (usage): Mention white space vs -b and -t options. - From The Wanderer. + * bootstrap: Sync from gnulib. -2005-12-09 Eric Blake +2008-03-01 Jim Meyering - * src/test.c (main): Fix misleading comment. + Don't skip the groups-version test. + * tests/Makefile.am (built_programs): Remove unused definition. + * src/Makefile.am (built_programs.list): Print a space-separated + list of program names, not NL-separated, since all clients now + expect a space-separated list. -2005-12-07 Paul Eggert + Don't exempt "groups" from write-failure test, now that it's a C program. + * tests/misc/help-version: Since groups is no longer a shell + script, a buggy bourne shell can't cause trouble. - * NEWS: Mention dd's new noatime flag. - * src/system.h (O_NOATIME): Define to 0 if not already defined. - * src/dd.c (flags, usage): Add support for noatime flag. + * configure.ac (AC_INIT): Use .tarball-version, not .version. -2005-12-07 Jim Meyering + Don't depend on gnulib's deprecated "free" module. + * bootstrap.conf (obsolete_gnulib_modules): Remove free. + * gl/modules/mgetgroups (Depends-on): Remove free. - Distribute the cvsu script, used only by `make syntax-check'. - * Makefile.am (EXTRA_DIST): Add build-aux/cvsu. - * Makefile.maint (CVS_LIST): Use build-aux/cvsu, now that we - distribute a copy of this script. - * .x-sc_unmarked_diagnostics: Add build-aux/cvsu. +2008-02-29 Jim Meyering - * tests/mv/acl: exit-77 before the trap, not after, if we fail - to create a temporary directory on another partition. - From Andreas Gruenbacher. + Merge bootstrap changes from gnulib. + * bootstrap (MSGID_BUGS_ADDRESS): Define and use. + (version_controlled_file): Use "git rm", not "git-rm". -2005-12-06 Tomas Pospisek (tiny change) + Use "git tag", not "git-tag", in preparation for git-1.6.0. + * Makefile.maint (VC-tag): Remove '-': s/git-tag/git tag/ - * man/basename.x: Cross-reference to dirname and readlink. - * man/dirname.x: Cross-reference to basename and readlink. +2008-02-28 Jim Meyering -2005-12-05 Andreas Gruenbacher + Make copyright comments consistent. + * src/mktemp.c: Update copyright to use newer form. - * src/copy.c [!HAVE_FCHOWN]: Define fchown(...) to -1. - (set_owner, preserve_author): New functions, factored out of copy_reg. - (copy_reg): Use them. - (copy_internal): Use them here, too. + Make first copyright lines consistent. Some did not end in ", Inc.". + Due to that missing ", Inc" at end of line, emacs' copyright-updating + code missed some opportunities. This corrects most of those, and + adds some mistakenly omitted years. + * src/chown-core.c: Adjust. + * src/chown-core.h: Likewise. + * src/copy.c: Likewise. + * src/copy.h: Likewise. + * src/cp-hash.c: Likewise. + * src/cp.c: Likewise. + * src/group-list.h: Likewise. + * src/mktemp.c: Likewise. + * src/stat.c: Likewise. + * tests/chmod/equal-x: Likewise. + * tests/dd/skip-seek: Likewise. + * tests/envvar-check: Likewise. + * tests/mv/into-self-2: Likewise. -2005-12-04 Jim Meyering +2008-02-25 Bob Proulx - * src/sleep.c (usage): Say what happens with two or more arguments. - Suggested by Justin Pryzby. + Fix test failure where rm would appear to succeed incorrectly. + * tests/rm/fail-eperm: Ignore files that were opportunistically chosen + to test permission failures but disappear before we can finish the test. - * src/uptime.c (print_uptime): Move decl of `upsecs' into scope - where it's used. +2008-02-24 Jim Meyering -2005-12-03 Jim Meyering + * gl/lib/mgetgroups.c (mgetgroups): Parenthesize correctly. - * src/rm.c (long_opts): Change the name of each undocumented, for- - testing-only option to start with `-', so that it cannot render - ambiguous any prefix it happens to share with some other option name. - Problem reported by Eric Blake. - * src/head.c (long_options): Likewise. - * src/tail.c (long_options): Likewise. + * gl/lib/mgetgroups.c: Include . - * tests/misc/head-elide-tail: Update uses of undocumented, for- - testing-only --presume* options to start with `---'. - * tests/rm/dangling-symlink: Likewise. - * tests/rm/dir-no-w: Likewise. +2008-02-23 Jim Meyering + + Avoid test failures when root (/) is not readable. + * tests/test-lib.sh (require_readable_root_): New function. + * tests/misc/pwd-long: Skip this test when / is unreadable. + * tests/du/slash: Likewise. + This is required at least for Mandrake/Mandriva in "secure" mode. + Reported by Theodoros V. Kalamatianos in + http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/12800 + +2008-02-22 Jim Meyering + + id: avoid race when a group is added between getgrouplist calls + * gl/lib/mgetgroups.c (mgetgroups) [N_GROUPS_INIT]: Rename enum. + Use a larger value. + Update *groups only upon success. + Iterate upon failed getgrouplist. + +2008-02-21 James Youngman + + id: use getgrouplist when possible + * gl/m4/mgetgroups.m4: Check for getgrouplist. + * gl/lib/mgetgroups.c (mgetgroups): Use getgrouplist, if available. + * TODO: Remove the item about switching to getgrouplist. + * NEWS: mention this + +2008-02-21 Paul Eggert + + du vs. hard links and argument order: improve documentation + * doc/coreutils.texi (du invocation): Document default behavior on + hard links, and why argument order matters. + +2008-02-20 James Youngman + + join: avoid new leaks + * src/join.c (prevline): Make prevline module-level static, so that + the allocated items can be freed at exit. + (free_prevline): new atexit function; frees items in prevline[]. + Use ARRAY_CARDINALITY, so include "argmatch.h" to get that. + (main): Arrange for free_prevline to be called during exit. + (get_line): Free prevline[which - 1] also, as that + will have been allocated by dup_line. + +2008-02-20 Jim Meyering + + Remove xdelta support, clean up distcheck process. * Makefile.maint (writable-files): Don't create $(release_archive_dir). (my-distcheck): Don't depend on prev-tgz. Remove xdelta-related variables and uses. (alpha beta major): Skip steps if $(release_archive_dir) doesn't exist. + + * bootstrap: Remove dangling symlinks before invoking aclocal. + +2008-02-20 Andreas Schwab + + sort: add --sort=... option. + * src/sort.c (SORT_OPTION): New enum. + (sort_args, sort_types): Define. + (usage, long_options, main): New option --sort. + * tests/sort/Test.pm: Test it. + * doc/coreutils.texi (sort invocation): Document --sort option. + * NEWS: Mention this. + +2008-02-19 Jim Meyering + + 2008-02-19 Jim Meyering + * TODO: Remove final seq-related item. + + * src/c99-to-c89.diff: Adjust seq.c offsets. Accommodate a new C99-ism. + +2008-02-19 Steven Schubiger + + seq: give better diagnostics for invalid formats. + * src/seq.c: (validate_format): New function. + (main): Use it. + * tests/misc/seq (fmt-d, fmt-e): Test for expected diagnostics with + invalid formats. + * NEWS: Mention this change. + * TODO: Remove this item. + [jm: src/seq.c: make diagnostics more consistent + tests/misc/seq (fmt-eos1): adjust the expected diagnostic ] + +2008-02-19 James Youngman + + join: new options: --check-order and --nocheck-order. + * src/join.c: Support --check-order and --nocheck-order. + New variables check_input_order, seen_unpairable and + issued_disorder_warning[]. For --check-order, verify that the + input files are in sorted order. For the default case, check the + order only if there are unpairable lines. + (join): Perform ordering checks after reaching EOF on either + input. + (usage): Mention --check-order and --nocheck-order. + (dupline): Save a copy of the previously-read input line so that + we can detect disorder on the input. + (get_line): Temporarily save a copy of the previous line (by + calling dupline) and check relative ordering (by calling + checkorder) before returning the newly-read line. + (getseq, join): Tell get_line which file we are reading from. + (advance_seq): New function, factoring out some of the code + commonly surrounding calls to getseq. + (checkorder): New function. Verifies that a pair of consecutive + input lines are in sorted order. + * doc/coreutils.texi (join invocation): Document the new options + --check-order and --nocheck-order. + * tests/join/Test.pm (tv): Added tests for --check-order and + --nocheck-order. + * NEWS: Mention this new feature. + + Fix non-srcdir "make distcheck" failure. + * Makefile.am (check-ls-dircolors): Look for sources under + $(srcdir), not under ".". + +2008-02-18 Jim Meyering + + seq: give a proper diagnostic for an invalid --format=% option + * src/seq.c (long_double_format): Handle '%' at end of string. + * tests/misc/seq [fmt-eos1, fmt-eos2]: New tests for the bug. + * NEWS: Mention this. + Reported by Pádraig Brady. + +2008-02-17 Jim Meyering + + .gitignore, src/.gitignore: ignore more + + Clean up Makefile.maint. + * Makefile.maint: Remove obsolete comments. + (local-checks-available): Remove changelog-check. + + Clean up ls.c. + * src/ls.c (put_indicator): Use fwrite, not a loop. + + Ensure that dircolors.c and ls.c remain in sync. + * Makefile.am (check-ls-dircolors): New rule. + (distcheck-hook): Depend on it. + + Expand "ls --color" tests to also use the dircolors defaults. + * tests/misc/ls-misc: Adjust this test so each is run twice. First, as usual, + and the second time with LS_COLORS set using the default settings + produced by running dircolors. + * tests/Coreutils.pm: See below. + + This required some changes: + - save and restore $ENV{LS_COLORS} for each individual test + that requires a specific value. + - Since this is the first test to call the run_tests command more + than once, it has exposed that that function erroneously modifies + the \@Tests array. Fix that in tests/Coreutils.pm. + + Adjust dircolors to match ls.c. + * src/dircolors.hin: comment out NORMAL and FILE, define RESET. + * src/dircolors.c (slack_codes) Add "RESET". + (ls_codes): Add "rs". + +2008-02-17 Ed Avis + + ls --color no longer outputs unnecessary escape sequences + In --color mode, plain files do not get any color, not even white. + When no highlighting is required, ls outputs no escape sequence at all. + * src/ls.c (print_with_color): + (used_color): New global. + (indicator_no) [C_RESET]: New enum value. + (indicator_name) ["rs"]: Corresponding new string. + (color_indicator): Make the 'normal' and 'file' markers be NULL. + Use "rs" (C_RESET) to reset to ordinary colors. + (process_signals): Restore default colors only if necessary. + (main): Don't call prep_non_filename_text here. + (print_name_with_quoting): Call it here, instead. + (prep_non_filename_text): Use C_RESET, not C_NORM. + (print_color_indicator): Return bool, not void. + Print nothing, when possible. + (put_indicator): Call prep_non_filename_text the first time. + * tests/misc/ls-misc: Test for above. + * tests/ls/color-dtype-dir: Adapt: no escapes around regular file name. + * TODO: Remove item. + * NEWS: Mention this. + +2008-02-17 Dan Jacobson + + ls: Improve description of --group-directories-first. + * src/ls.c (usage) [--group-directories-first]: Improve description. + * doc/coreutils.texi (Which files are listed): Likewise. + +2008-02-16 Jim Meyering + + Avoid tests/cp/acl test failure. + * tests/check.mk (TESTS_ENVIRONMENT) [CONFIG_HEADER]: Define + to an absolute name, so it can be used from any point in the + test hierarchy. Reported by James Youngman. + +2008-02-16 James Youngman + + Use the gettime module in ls.c. + Implement TODO list item to make ls.c use the gettime module. + * TODO (ls): Now that we use gettime, remove the TODO entry. + * src/ls.c: Use timespec.h and the gettime module. + (current_time): Change type from time_t to struct timespec. + (current_time_ns): Removed. + (get_current_time): Removed. + (print_long_format): Remove when and when_ns, since we have + when_timespec anyway. Change type of variable six_months_ago from + time_t to struct timespec. + +2008-02-14 Jim Meyering + + groups: don't test printf and putchar calls for failure + They are unnecessary, since we use gnulib's closeout module. + * src/group-list.c (print_group): Remove explicit error tests. + * src/groups.c (main): Likewise. + (write_error): Remove function. + +2008-02-13 James Youngman + + Replace groups.sh with groups.c. + * src/groups.c (main): New file, replacing groups.sh. + * src/group-list.c, src/group-list.h: New files, factored out of id.c, + implementing the functionality that "id" and "groups" have in common. + * src/id.c (print_full_info): Avoid a segfault when trying to print + an error message if getgroups fails. + (print_group_list): Move to group-list.c. + (print_group): Likewise. + * man/Makefile.am: When building groups.1, obtain the help text + from src/groups.c, not src/groups.sh. + (noinst_HEADERS): Add group-list.h. + (group): Remove rule. + (dist_man_MANS): Remove groups.1. + * doc/coreutils.texi (groups: Print group names a user is in): + Explain why "groups" and "groups $(id -un)" give different results + in existing login sessions after you change the group database. + (id: Print user identity): Likewise for "id". + * po/POTFILES.in: Add src/group-list.c and src/groups.c. + * NEWS: mention this. + * AUTHORS: Update. + +2008-02-12 Jim Meyering + + Move more test_skip_-using code to follow ". test-lib.sh". + * tests/mv/acl: Likewise. + * tests/cp/acl: Likewise. + +2008-02-12 Peter Fales + + tests/touch/not-owner: Source test-lib.sh before using skip_test_. + +2008-02-12 Jim Meyering + + * tests/Makefile.am (EXTRA_DIST): Remove strace. + +2008-02-11 Jim Meyering + + tests: Migrate sourced strace file into a function, require_strace_. + * tests/strace: Remove file. + * tests/test-lib.sh (require_strace_): New function. + * tests/mv/atomic: Use require_strace_, rather than ". strace". + * tests/ls/stat-free-symlinks: Likewise. + Peter Fales reported that stat-free-symlinks failed without strace. + + * tests/rm/inaccessible: Source test-lib.sh *before* using skip_test_. + Reported by Peter Fales. + +2008-02-10 Jim Meyering + + Ensure there are no removable (useless) if-before-free tests. + * bootstrap.conf (gnulib_modules): Add useless-if-before-free. + * Makefile.maint (sc_avoid_if_before_free): New rule. + + Use a better dirname emulation. + * build-aux/check.mk (_dirname): Define. + (am__check_pre): Use it. + + Avoid test failure when run with risky PATH ("." before /usr/bin). + * build-aux/check.mk (approx_dirname_filter): Define. + (am__check_pre): Emulate dirname using sed. + Report and suggested fix from Bruno Haible in + http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/12587/focus=12590 + + * build-aux/.gitignore: Remove file from version control. It's generated. + + Generate ChangeLog from git log. + * bootstrap.conf (gnulib_modules): Add gitlog-to-changelog. + Ensure that ChangeLog exists, for automake. + * Makefile.am (gen-ChangeLog): New rule. + (dist-hook): Depend on it. + (EXTRA_DIST): Add ChangeLog-2006, ChangeLog-2007, ChangeLog-2008. + + Remove ChangeLog, dividing its content into ChangeLog-200? + * ChangeLog: Remove file. + * ChangeLog-2005: Prepend the 2005 entries. + * ChangeLog-2006: New file. + * ChangeLog-2007: New file. + * ChangeLog-2008: New file. + + * ChangeLog: Manually update copyright notice at *bottom*. + +2008-02-09 Jim Meyering + + tests: rm/fail-eperm: require-non-root in perl, not sh + Since it creates no temporaries and since it requires non-root, + do the require-non-root bit in perl, rather than using test-lib.sh. + + tests: Remove priv-check. Use new require_root_ function instead. + * tests/priv-check: Remove file. + * tests/Makefile.am (EXTRA_DIST): Remove priv-check. + * tests/test-lib.sh (require_root_): New function. + Use this function rather than sourcing the priv-check file. + * tests/sample-test: Use require_root_ rather than priv-check. + * tests/chown/basic: Likewise. + * tests/cp/cp-a-selinux: Likewise. + * tests/cp/preserve-gid: Likewise. + * tests/cp/special-bits: Likewise. + * tests/ls/nameless-uid: Likewise. + * tests/misc/chcon: Likewise. + * tests/mkdir/writable-under-readonly: Likewise. + * tests/mv/sticky-to-xpart: Likewise. + * tests/rm/fail-2eperm: Likewise. + * tests/rm/no-give-up: Likewise. + * tests/rm/one-file-system: Likewise. + * tests/tail-2/append-only: Likewise. + * tests/touch/now-owned-by-other: Likewise. + * tests/rm/fail-eperm: Use skip_if_root_ rather than priv-check. + * Makefile.maint (sc_root_tests): Reflect this change: + search for the new function name. + + tests: factor out the perl-requiring code in many test scripts + * tests/require-perl: New file. + * tests/Makefile.am (EXTRA_DIST): Add require-perl. + * tests/dd/skip-seek: Use it, and remove manual tests. + * tests/du/files0-from: Likewise. + * tests/ls/nameless-uid: Likewise. + * tests/misc/base64: Likewise. + * tests/misc/basename: Likewise. + * tests/misc/cut: Likewise. + * tests/misc/date: Likewise. + * tests/misc/dircolors: Likewise. + * tests/misc/dirname: Likewise. + * tests/misc/expand: Likewise. + * tests/misc/expr: Likewise. + * tests/misc/factor: Likewise. + * tests/misc/fmt: Likewise. + * tests/misc/fold: Likewise. + * tests/misc/head-elide-tail: Likewise. + * tests/misc/ls-misc: Likewise. + * tests/misc/md5sum: Likewise. + * tests/misc/md5sum-newline: Likewise. + * tests/misc/mktemp: Likewise. + * tests/misc/od: Likewise. + * tests/misc/paste-no-nl: Likewise. + * tests/misc/pr: Likewise. + * tests/misc/pwd-long: Likewise. + * tests/misc/seq: Likewise. + * tests/misc/sha1sum: Likewise. + * tests/misc/sha1sum-vec: Likewise. + * tests/misc/sha224sum: Likewise. + * tests/misc/sha256sum: Likewise. + * tests/misc/sha384sum: Likewise. + * tests/misc/sha512sum: Likewise. + * tests/misc/sort-merge: Likewise. + * tests/misc/stat-printf: Likewise. + * tests/misc/sum: Likewise. + * tests/misc/sum-sysv: Likewise. + * tests/misc/test-diag: Likewise. + * tests/misc/tsort: Likewise. + * tests/misc/tty-eof: Likewise. + * tests/misc/unexpand: Likewise. + * tests/misc/wc-files0-from: Likewise. + * tests/misc/xstrtol: Likewise. + * tests/mv/i-1: Likewise. + * tests/rm/empty-name: Likewise. + * tests/rm/fail-eperm: Likewise. + * tests/rm/unreadable: Likewise. + + (EXTRA_DIST): *do* require require-perl as a stand-alone, 'source'able script. + + tests: call skip_test_ in place of echo+exit 77 + * tests/mv/no-target-dir: Likewise. + * tests/other-fs-tmpdir: Likewise. + * tests/rm/empty-name: Likewise. + * tests/rm/fail-eperm: Likewise. + * tests/rm/inaccessible: Likewise. * tests/rm/isatty: Likewise. - -2005-11-30 Jim Meyering - - * Makefile.maint: Add a comment about cvsu. - -2005-11-25 Paul Eggert - - * NEWS: df updates for "none", "proc", inaccessible file systems. - * src/df.c (show_point): Ignore inaccessible file systems. - (usage): -a includes dummy file systems, not size-0 file systems. - - * src/od.c (unsigned_long_long_int): Renamed from ulonglong_t, - to avoid collision with POSIX name space. All uses changed. - -2005-11-24 Jim Meyering - - * tests/Makefile.am (EXTRA_DIST): Add acl to the list. - * tests/acl: Add `$0: ' prefix to diagnostics. - - * .x-sc_require_config_h: Add lib/buffer-lcm.c to the list. - -2005-11-23 Paul Eggert - - * src/copy.c: Improve performance a bit by optimizing away - unnecessary system calls and going to a block size of at least - 8192 (on normal hosts, anyway). This improved performance 5% on my - Debian stable host (2.4.27 kernel, x86, copying from root - ext3 file system to itself). - Include "buffer-lcm.h". - (copy_reg): Omit last argument. All callers changed. - Use xmalloc to allocate rather than trusting alloca - (which is unwise with large block sizes). - Declare locals more locally, if possible. - Use uintptr_t words instead of int words, for a bit more speed - when looking for null blocks on 64-bit hosts. - Optimize away reads of zero bytes on regular files. - In the typical case, insist on 8 KiB buffers, at least. - Avoid unnecessary extra call to fstat when checking for sparse files. - Avoid now-unnecessary cast to off_t, and "0L". - Avoid unnecessary test of *new_dst when checking for same owner - and group. - -2005-11-22 Paul Eggert - - * src/remove.c (rm): Don't assume C99 for-loop syntax. - -2005-11-22 Jim Meyering - - * src/remove.c (AD_push): Remove debugging cruft. - - * tests/rm/unread2 (rm): Change expected diagnostic, - `cannot open directory' to `cannot remove', to align with - new version of rm. - * tests/rm/rm2: Ensure that rm now continues removing entries - even after certain types of failure. - - * src/remove.c: Rewrite. Now, this module is reentrant on systems - that provide openat (Solaris), and on systems like Linux+procfs - where our openat emulation code is reentrant. This also fixes a - few low-probability leaks and eliminates some code that could, - in very unusual circumstances, cause rm() (via a callee) to exit. - * NEWS: Mention this. - - * configure.ac: Put copyright dates all on one line so the - emacs function that updates them works properly. - -2005-11-18 Paul Eggert - - * configure.ac (AM_PROG_CC_C_O): Add. Needed for CVS Automake. - Problem reported by Eric Blake. - (AC_PROG_CC_STDC): Use this instead of AC_PROG_CC, so that - we get a standard-conforming compiler. This relies on the new - m4/c.m4 file. Note that it's a bit tricky, since c.m4 doesn't - define AC_PROG_CC_STDC; we are relying on Autoconf 2.59 internals. - m4/c.m4 can go away with Autoconf 2.60 comes out. - -2005-11-17 Jim Meyering - - * src/remove.c (AD_mark_helper): Make a `char *' parameter `const'. - (AD_mark_current_as_unremovable): Likewise, but for a local. - (rm_1): Likewise. - - * tests/mv/acl: Let traps handle removing temporary directories. - - Expect acl-related tests to fail, until the corresponding - patches are committed. - * tests/mv/Makefile.am (XFAIL_TESTS): Add acl. - * tests/cp/Makefile.am (XFAIL_TESTS): Likewise. - - ACL tests, from Andreas Gruenbacher. - * tests/acl, tests/mv/acl, tests/cp/acl: New files. - * tests/mv/Makefile.am (TESTS): Add acl. - * tests/cp/Makefile.am (TESTS): Add acl. - - * src/ls.c (basename_is_dot_or_dotdot): Correct wording in comment. - -2005-11-16 Paul Eggert - - * NEWS: Improve quality of ln's diagnostics. - * src/ln.c (do_link, usage): Likewise. - (do_link): Don't use alloca on a buffer of unbounded size. - -2005-11-16 Jim Meyering - - * tests/cp/fail-perm: Accommodate HPUX. It appears to fail - with EACCES rather than EPERM. Reported by Peter O'Gorman here: - http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/5766 - This also affects AIX 4.3.3, according to Ralf Wildenhues, in - http://lists.gnu.org/archive/html/bug-coreutils/2006-05/msg00192.html - -2005-11-14 Jim Meyering - - * NEWS (sort): Mention consequences of today's mkstemp-safer.c fix. - -2005-11-13 Jim Meyering - - * announce-gen: Accept new option, --gpg-key-id=ID and - emit a blurb telling how to use the .sig files. - * Makefile.cfg (gpg_key_ID): Define. - * Makefile.maint (announcement): Use new option and key. - - Require that most .c files include . - * Makefile.maint (sc_require_config_h): New rule. - (syntax-check-rules): Add it. - * .x-sc_require_config_h: New file listing exceptions to the - above rule. Some are legit, others are simply grandfathered in. - * Makefile.am (EXTRA_DIST): Add .x-sc_require_config_h here, too. - -2005-11-12 Jim Meyering - - * src/checksum.h, src/md5.c, src/sha1sum.c: Remove now-unused files. - -2005-11-11 Jim Meyering - - * NEWS: Mention `readlink -f' bug fix in 5.3.0 news. - Mention new readlink options in 5.3.0's `New features' section. - Spotted by Thomas Hood. - -2005-11-08 Jim Meyering - - * NEWS: Merge in changes from b5_9x branch. - -2005-11-08 Paul Eggert - - * NEWS: ls now defaults to --time-style='locale', which in turn acts - like --time-style='posix-long-iso' if the locale settings are messed up. - * src/ls.c (decode_switches): Implement this. - -2005-11-08 Jim Meyering - - * tests/du/2g: s/expensive/very expensive/ in a comment. - From Paul Townsend. - -2005-10-17 Eric Blake - - * src/ls.c (usage): Fix descriptions of --sort, --time. - Reported by Vitaly A. Ostanin. - -2005-11-04 Paul Eggert - - * src/ln.c: Include filenamecat.c. - (FILE_BASENAME_CONCAT): Remove. - (do_link): Remove last arg DEST_IS_DIR. All callers changed. - (main): Use file_name_concat, base_name, and strip_trailing_slashes - instead of FILE_BASENAME_CONCAT. This simplifies the code, and avoids - the use of alloca. - -2005-11-04 Jim Meyering - - * src/du.c (process_file): Don't overflow for files of size >= 2^31 - on systems with stat.st_blocks of a signed 32-bit type. - This bug causes trouble on some AIX 5.1 systems. - Report and trivial patch from Paul Townsend: - - * NEWS: Mention this. - - * tests/du/2g: New (very-expensive) test for the above-fixed bug. - * tests/du/Makefile.am (TESTS): Add it here. - * tests/very-expensive: New file. - * tests/Makefile.am (EXTRA_DIST): Add it here. - * tests/cp/perm: Mark this test as `very-expensive', too. - -2005-11-02 Paul Eggert - - * NEWS: Mention that rm -d and maybe ln -d are scheduled for - removal in 2006. - * src/remove.h (struct rm_options): Remove unlink_dirs. All uses - removed. - * src/rm.c (usage): Don't mention rm -d. - -2005-11-02 Jim Meyering - - * tests/dd/skip-seek: Fix typo in comment: s/fileutils/coreutils. - From Andreas Schwab. - - * tests/dd/unblock-sync: Redirect stderr to /dev/null so the - `M+N records in/out' lines don't pollute `make check' output. - - * tests/dd/skip-seek (sk-seek4): New test, to exercise the bug - fixed on 2005-10-31. This test uses the new, IN_PIPE specifier. - * tests/Coreutils.pm: Accept a new type of input specifier: IN_PIPE, - to indicate that the input file should be piped into the command - under test (via `cat FILE | $prog ...'). - - * src/remove.c (remove_entry): Emit a better diagnostic when rm - (without -r) fails to remove a directory on a non-Linux system. - This change affects only newer Solaris systems (with priv_* - functions like priv_allocset). Reported by Keith Thompson. - - * tests/rm/dir-nonrecur: New file/test for the above fix. - * tests/rm/Makefile.am (TESTS): Add dir-nonrecur. - -2005-11-01 Paul Eggert - - * NEWS: "tail -c 2 FILE" and "touch 0101000000" now operate as - POSIX 1002.1-2001 requires. - * src/tail.c (parse_obsolete_option): Implement this. - Problem reported by Vincent Lefevre. - * src/touch.c (main): Pass PDS_PRE_2000 to posixtime. - * tests/tail/Test.pm (c-2, c-2-minus, c2, c2-minus): New tests. - (test_vector): Add special cases for _POSIX2_VERSION, and - regularize the old ones a bit. - * tests/touch/obsolescent: Add y2000 test. - -2005-10-31 Paul Eggert - - * src/dd.c (skip): Fix off-by-one error reported by - Theodoros V. Kalamatianos. - -2005-10-30 Paul Eggert - - * tests/mkdir/p-3: Require that the test be run as non-root. - Problem and trivial fix reported by Theodoros V. Kalamatianos. - -2005-10-28 Paul Eggert - - * src/ln.c (FILE_BASENAME_CONCAT): Omit unnecessary slashes in the - boundary between DEST and SOURCE in the result. - -2005-10-26 Dmitry V. Levin - - * src/md5sum.c (main) [!O_BINARY]: Changed default read mode - back to text, to sync with documentation and for backwards - compatibility. - -2005-10-25 Jim Meyering - - * tests/dircolors/simple (other-wr): Add an explicit test for - the dircolors bug (NULL-dereference) fixed yesterday. - -2005-10-24 Jim Meyering - - * src/tac.c (tac_file): When determining whether a file is seekable, - also test whether it is a tty. Using only the lseek-based test would - give a false positive on Solaris. Reported by Peter Fales. - -2005-10-24 Dmitry V. Levin - - * tests/install/d-slashdot: New test, for "install -d" failure. - * tests/install/Makefile.am (TESTS): Add d-slashdot. - * tests/mkdir/p-slashdot: New test, for "mkdir -p" failure. - * tests/mkdir/Makefile.am (TESTS): Add p-slashdot. - -2005-10-24 Jim Meyering - - * src/dircolors.c (ls_codes): Add missing comma. - Anonymous report and patch from - http://savannah.gnu.org/bugs/?func=detailitem&item_id=14849 - - * src/dircolors.c: Add compile-time assertion that the slack_codes - and ls_codes arrays have the same number of elements. This would - have prevented the above-fixed bug. - - * src/expand.c (parse_tab_stops): Add a comment to make this function - identical to the one in unexpand.c. - * src/unexpand.c (parse_tab_stops): Adjust syntax to make this function - identical to the one in expand.c. - - * src/expand.c (next_file): Don't assume fopen cannot return stdin. - -2005-10-23 Jim Meyering - - * src/md5sum.c (digest_check, main): Use ptr_align rather than - a dangerous pointer-value-to-`unsigned' cast. - * NEWS: mention the new sha* programs. - * AUTHORS: Add new sha* programs. - -2005-08-28 David Madore - - Add new programs: sha224sum, sha256sum, sha384sum, sha512sum. - * README: Add their names to the list. - * src/md5sum.c: Provide framework for computing sha-2 hashes. - * src/Makefile.am (sha224sum, sha256sum, sha384sum, sha512sum): - Rules for compiling sha-2 utilities - (noinst_HEADERS): Remove checksum.h. - * man/sha512sum.x, man/sha384sum.x, man/sha256sum.x, man/sha224sum.x: - New files. - * man/Makefile.am (dist_man_MANS): Add the corresponding .1 names. - (sha224sum.1, sha256sum.1, sha384sum.1, sha512sum.1): New dependencies. - * tests/misc/sha224sum, tests/misc/sha256sum: New files. - * tests/misc/sha384sum, tests/misc/sha512sum: New files. - * tests/misc/Makefile.am (TESTS): Add new sha224sum, sha256sum, - sha384sum, sha512sum test scripts here rather that each in its - own directory. - -2005-08-28 David Madore - - * tests/sha1sum/basic-1 (million-a): Add the "million a's" test (one - of the FIPS test vectors). - -2005-10-23 Jim Meyering - - * configure.ac: Use 6.0-cvs as the version string. - * NEWS: Adjust accordingly. - - - ----- - - Copyright (C) 2005, 2006 Free Software Foundation, Inc. - - Copying and distribution of this file, with or without - modification, are permitted provided the copyright notice - and this notice are preserved. + * tests/rm/unreadable: Likewise. + * tests/setgid-check: Likewise. + * tests/sparse-file: Likewise. + * tests/strace: Likewise. + * tests/tail-2/append-only: Likewise. + * tests/tail-2/big-4gb: Likewise. + * tests/tail-2/tail-n0f: Likewise. + * tests/touch/dangling-symlink: Likewise. + * tests/touch/fifo: Likewise. + * tests/touch/not-owner: Likewise. + * tests/mv/i-3: Likewise. + * tests/umask-check: Likewise. + * tests/mv/acl: Likewise. + * tests/cp/acl: Likewise. + * tests/chgrp/deref: Likewise. + * tests/chmod/setgid: Likewise. + * tests/cp/existing-perm-race: Likewise. + * tests/cp/file-perm-race: Likewise. + * tests/cp/parent-perm-race: Likewise. + * tests/du/2g: Likewise. + * tests/du/8gb: Likewise. + * tests/du/long-from-unreadable: Likewise. + * tests/du/long-sloop: Likewise. + * tests/du/slink: Likewise. + * tests/ls/nameless-uid: Likewise. + * tests/ls/stat-dtype: Likewise. + * tests/misc/cat-proc: Likewise. + * tests/misc/md5sum-newline: Likewise. + * tests/misc/nice: Likewise. + * tests/misc/od-x8: Likewise. + * tests/misc/pwd-unreadable-parent: Likewise. + * tests/misc/selinux: Likewise. + * tests/misc/stty-row-col: Likewise. + * tests/misc/tac-continue: Likewise. + * tests/misc/arch: Likewise, and source $srcdir/../test-lib.sh *before* + the use of skip_test_. + + tests: move the very-expensive file into test-lib.sh + * tests/very-expensive: Remove file. + * tests/test-lib.sh (very_expensive_): New function. + * tests/Makefile.am (EXTRA_DIST): Remove very-expensive. + * tests/cp/perm: Call the new function, rather than sourcing the file. + * tests/tail-2/assert: Likewise. + * tests/tail-2/assert-2: Likewise. + * tests/du/2g: Likewise. + + tests: start migrating sourced-file function-like tests into test-lib.sh. + * tests/acl: Remove file. + * tests/test-lib.sh (require_acl_): New function. + * tests/cp/acl: Use require_acl_ instead. + * tests/mv/acl: Likewise. + * tests/Makefile.am (EXTRA_DIST): Remove acl. + + tests: mv/acl: Don't mention "yes" as a partition name in diagnostic. diff --git a/src/bin/coreutils/ChangeLog-2005 b/src/bin/coreutils/ChangeLog-2005 index 4ec81dc423..83a6f9e50c 100644 --- a/src/bin/coreutils/ChangeLog-2005 +++ b/src/bin/coreutils/ChangeLog-2005 @@ -1,3 +1,608 @@ +2005-12-27 Jim Meyering + + * Makefile.maint (sc_obsolete_symbols): Prohibit use of O_NDELAY. + (sc_prohibit_assert_without_use): New rule. + (syntax-check-rules): Add it to the list. + * .x-sc_prohibit_assert_without_use: New empty file. + * Makefile.am (EXTRA_DIST): Add it. + + * Makefile.maint (CVS_LIST): Define in terms of $(srcdir). + + * cp.c, df.c, link.c, mknod.c, nice.c, sleep.c, unlink.c: + Don't include ; it wasn't used. + +2005-12-26 Paul Eggert + + * src/chown-core.c (restricted_chown): + Don't try O_WRONLY unless O_RDONLY failed wth EACCES. + * src/remove.c (fd_to_subdirp): Open with O_DIRECTORY | O_NOCTTY + | O_NOFOLLOW too, for consistency with other dir-openers. + Use POSIX-preferred O_NONBLOCK rather than O_NDELAY. + (is_empty_dir): Likewise. + * src/shred.c (wipename): Likewise. Don't bother trying to open + dir for writing, since POSIX prohibits it. + +2005-12-22 Jim Meyering + + * tests/help-version: Redirect stderr to /dev/full, to suppress + write error diagnostic. + +2005-12-19 Jim Meyering + + * src/mkdir.c, src/mknod.c, src/mkfifo.c (main) + Avoid a minor race condition when `-m MODE' is specified, by using + open, fchown, and close rather than just chown. To do that reliably -- + even with an overly restrictive umask -- ensure that each mkdir, + mknod and mkfifo call uses a mode including at least owner-read access. + * src/mknod.c (main): When `-m MODE' is specified, exit nonzero if + the subsequent chown (or equivalent open,fchown,close) fails. + * tests/misc/mknod: New tests. + * tests/misc/Makefile.am (TESTS): Add mknod. + +2005-12-17 Jim Meyering + + * src/remove.c (is_empty_dir): Open with O_NDELAY, so we don't hang, + e.g., on a named pipe. + (OPEN_NO_FOLLOW_SYMLINK): Remove definition. Use O_NOFOLLOW in + place of all uses, since it is guaranteed (system.h) to be defined. + +2005-12-05 Andreas Gruenbacher + + Add POSIX ACL support + * src/ls.c: Switch back from HAVE_ACL to USE_ACL: The acl() syscall + is no requirement for ACL support; particularly, it does not exist + on systems that have POSIX ACLs. + * src/copy.h (cp_option_init) [umask_kill]: Remove member. + * src/cp.c (umask_kill): With default acls, the umask is not to be + applied. Remove umask_kill, don't change the process umask, and let + the kernel apply the umask where appropriate. + * src/cp.c (make_dir_parents_private): Fix logic for POSIX ACLs. + * src/copy.c (get_dest_mode): Remove; it is obsolete after removing + umask_kill. + (copy_reg, copy_internal): Use copy_acl and set_acl + instead of fchown/chown. Fix the logic for POSIX ACLs. + (chown_succeded): Remove; we now always copy acls and + preserve S_ISUID, S_ISGID, and S_ISVTX when needed, no matter if we + did a chown before or not. + * src/mv.c, src/install.c (cp_option_init): Don't set umask_kill member. + * src/Makefile.am (dir_LDADD, ls_LDADD, vdir_LDADD, cp_LDADD, + mv_LDADD, ginstall_LDADD): On systems with an ACL library, arrange + to link with it via $(LIB_ACL), for the utilities that need it. + +2005-12-16 Paul Eggert + + * src/remove.c (OPENAT_CWD_RESTORE__REQUIRE): Remove. + (OPENAT_CWD_RESTORE__ALLOW_FAILURE): Likewise. + (fd_to_subdirp): Remove openat_cwd_restore_allow_failure arg; its + value is now signified by whether cwd_errno is null. + (fd_to_subdirp, remove_dir, rm_1); Change cwd failure indicator from + pointer-to-bool to pointer-to-errno-value. All callers changed. + (rm_1): Don't bother setting a local cwd failure flag and then + ORing it into the caller's. Just set the caller's. + (rm): Use cwd failure errno value to print a slightly-better + diagnostic. + +2005-12-15 Jim Meyering + + * src/stat.c (print_it): Properly handle a backslash at the + end of a --printf format string. Reported by Paul Eggert. + * tests/misc/stat-printf (end-bs): Add a test for the above. + +2005-12-15 Paul Eggert + + * tests/acl: Port to pre-POSIX shells like Solaris 8 /bin/sh. + Don't assume /etc/passwd contains user names; use 'id' instead. + +2005-12-15 Jim Meyering + + stat: revert behavior of --format=FMT (-c) + stat: add new option: --printf=FMT + * NEWS: Mention this. + * src/stat.c (isodigit, octtobin, hextobin): Define. + (PRINTF_OPTION): Define. + (interpret_backslash_escapes, trailing_delim): New globals. + (usage): Document them. Alphabetize on long option names. + (print_esc_char): New function. + (print_it): Rewrite, in order to handle backslash escapes. + (main): Handle new option. Set globals for --format, too. + + * tests/misc/stat-printf: Test --printf and --format. + * tests/misc/Makefile.am (TESTS): Add stat-printf. + +2005-12-14 Paul Eggert + + * NEWS: sort now reports incompatible options. + * src/sort.c (incompatible_options, check_ordering_compatibility): + New functions. + (main): Use them. Don't bother with a usage message for + "sort -c a b", for consistency with other error diagnostics. + * tests/sort/Test.pm (incompat1, incompat2, incompat3, incompat4): + New tests. + + * src/cat.c (main): Undo previous change. close_stdout already + does the check, so the previous change wasn't necessary. + +2005-12-13 Paul Eggert + + * src/cat.c (main): Check for close (STDOUT_FILENO) failure. + +2005-12-12 Paul Eggert + + Install a more-conservative approach for sort -R. It's the + same basic idea as the existing code, except it uses the full ISAAC + approach (called the "more kosher" approach in the existing comments). + This makes "sort -R" quite a bit slower (about a factor of 2 on my + little tests involving 10000 lines on a 2.4 GHz P4), but I think it's + better to be conservative here at first, and review any performance + improvements carefully. + * .x-sc_require_config_h: Add src/rand-isaac.c. + * src/rand-isaac.h: Remove. All uses now simply include rand-isaac.c. + * src/Makefile.am (noinst_HEADERS): Remove rand-isaac.h. + (shred_SOURCES, sort_SOURCES): Remove. + (EXTRA_DIST): Add rand-isaac.c. + * src/rand-isaac.c: Revert to what used to be in shred.c, without + changing it to allow for varying numbers of words in the state. + Alter so that we include rand-isaac.c directly rather than + compiling it and linking to it. Don't include config.h or + system.h; that's the includer's responsibility. + Omit functions that are specific to shred. + (ISAAC_LOG, ISAAC_WORDS, ISAAC_BYTES, struct isaac_state, ind): + (isaac_step, struct irand_state): + Resurrect these, with the same defns that used to be in shred.c. + (ISAAC_SIZE, isaac_new, isaac_copy): Remove. + (isaac_refill, isaac_seed_start, isaac_seed_data, irand_init, irand32): + static again. + (struct isaac_state, isaac_refill, isaac_mix, isaac_init): + (isaac_seed_start, isaac_seed_data, isaac_seed_finish, isaac_seed): + (irand_init, irand32, irand_mod): + Number of words is constant again. + (struct irand_state, irand_init, irand32, irand_mod): Move to shred.c. + * src/shred.c: Include rand-isaac.c rather than rand-isaac.h. + * src/sort.c: Likewise. + * src/shred.c (fillrand, dopass, main): Undo previous change. + (struct irand_state, irand_init, irand32, irand_mod): Moved back here, + from rand-isaac.c. + * src/sort.c: Don't include md5.h; it wasn't needed. + (struct keyfield): Rename random_hash to random, for consistency + with the other member names. All uses changed. + (usage): Tweak wording to mention STRING for --seed option. + (short_options): Rorder for consistency with other programs. + (rand_state): Now a struct, not a pointer to one. All uses changed. + (HASH_WORDS, HASH_SIZE): Remove. + (get_hash): Remove comments around resbuf size, since we can assume C89. + Use a "more-kosher" (but slower) approach of invoking isaac_refill. + (keycompare): Adjust to the new get_hash. + Add a FIXME. + (badfieldspec): Omit recently-introduced comment; it isn't needed. + (main): Don't set need_random simply because gkey has it set; that + doesn't necessarily mean we'll need random numbers. + Redo seeding to match new get_hash approach. + +2005-12-10 Jim Meyering + + * src/Makefile.am (noinst_HEADERS): Add rand-isaac.h. + + Avoid shred segfault on 64-bit systems. + * src/rand-isaac.c (isaac_refill): Don't try to negate a + local of type uint32_t. Make the local an `int' instead. + + * NEWS: Mention sort's new options. + + * src/rand-isaac.c (isaac_mix): Declare to be static. + Mark all other functions as `extern' so the tight-scope + part of `make distcheck' passes once again. + * src/rand-isaac.h (isaac_mix): Remove declaration. + + * src/sort.c (get_hash): Change position of `*' in parameter + type to conform with convention. + (main): Split a long line so it fits in 80 columns. + (keycompare): Remove stray SPACE before TAB that was + causing `make distcheck' to fail. + + * src/shred.c: Don't include gethrxtime.h. No longer needed. + + * tests/misc/sort-rand: New file: basic tests for the new options. + * tests/misc/Makefile.am (TESTS): Add sort-rand. + +2005-12-10 Frederik Eaton + + * src/Makefile.am (sort_LDADD): Add $(LIB_GETHRXTIME). + (shred_SOURCES, sort_SOURCES): New macros, so we compile rand-isaac.c. + * src/rand-isaac.c: New file, containing ISAAC code that was in shred.c. + Make state size runtime-configurable. + (isaac_new, isaac_copy): New functions. + * src/rand-isaac.h: New file. + * src/shred.c: Include rand-isaac.h. Move ISAAC code to rand-isaac.c. + (fillrand, main): Adjust to the fact that the state size is now + runtime-configurable. + * src/sort.c (short_options, long_options, WORDS, keycompare, main): + (usage): Add options --random-sort and --seed to implement a random + shuffle. + Include md5.h and rand-isaac.h. + (get_hash): New function. + (rand_state): New var. + (HASH_WORDS, HASH_SIZE): New macros. + +2005-12-09 Paul Eggert + + * tests/dd/misc: Add test for dd iflags=noatime. + +2005-12-09 Jim Meyering + + * src/sort.c (usage): Mention white space vs -b and -t options. + From The Wanderer. + +2005-12-09 Eric Blake + + * src/test.c (main): Fix misleading comment. + +2005-12-07 Paul Eggert + + * NEWS: Mention dd's new noatime flag. + * src/system.h (O_NOATIME): Define to 0 if not already defined. + * src/dd.c (flags, usage): Add support for noatime flag. + +2005-12-07 Jim Meyering + + Distribute the cvsu script, used only by `make syntax-check'. + * Makefile.am (EXTRA_DIST): Add build-aux/cvsu. + * Makefile.maint (CVS_LIST): Use build-aux/cvsu, now that we + distribute a copy of this script. + * .x-sc_unmarked_diagnostics: Add build-aux/cvsu. + + * tests/mv/acl: exit-77 before the trap, not after, if we fail + to create a temporary directory on another partition. + From Andreas Gruenbacher. + +2005-12-06 Tomas Pospisek (tiny change) + + * man/basename.x: Cross-reference to dirname and readlink. + * man/dirname.x: Cross-reference to basename and readlink. + +2005-12-05 Andreas Gruenbacher + + * src/copy.c [!HAVE_FCHOWN]: Define fchown(...) to -1. + (set_owner, preserve_author): New functions, factored out of copy_reg. + (copy_reg): Use them. + (copy_internal): Use them here, too. + +2005-12-04 Jim Meyering + + * src/sleep.c (usage): Say what happens with two or more arguments. + Suggested by Justin Pryzby. + + * src/uptime.c (print_uptime): Move decl of `upsecs' into scope + where it's used. + +2005-12-03 Jim Meyering + + * src/rm.c (long_opts): Change the name of each undocumented, for- + testing-only option to start with `-', so that it cannot render + ambiguous any prefix it happens to share with some other option name. + Problem reported by Eric Blake. + * src/head.c (long_options): Likewise. + * src/tail.c (long_options): Likewise. + + * tests/misc/head-elide-tail: Update uses of undocumented, for- + testing-only --presume* options to start with `---'. + * tests/rm/dangling-symlink: Likewise. + * tests/rm/dir-no-w: Likewise. + * tests/rm/isatty: Likewise. + +2005-11-30 Jim Meyering + + * Makefile.maint: Add a comment about cvsu. + +2005-11-25 Paul Eggert + + * NEWS: df updates for "none", "proc", inaccessible file systems. + * src/df.c (show_point): Ignore inaccessible file systems. + (usage): -a includes dummy file systems, not size-0 file systems. + + * src/od.c (unsigned_long_long_int): Renamed from ulonglong_t, + to avoid collision with POSIX name space. All uses changed. + +2005-11-24 Jim Meyering + + * tests/Makefile.am (EXTRA_DIST): Add acl to the list. + * tests/acl: Add `$0: ' prefix to diagnostics. + + * .x-sc_require_config_h: Add lib/buffer-lcm.c to the list. + +2005-11-23 Paul Eggert + + * src/copy.c: Improve performance a bit by optimizing away + unnecessary system calls and going to a block size of at least + 8192 (on normal hosts, anyway). This improved performance 5% on my + Debian stable host (2.4.27 kernel, x86, copying from root + ext3 file system to itself). + Include "buffer-lcm.h". + (copy_reg): Omit last argument. All callers changed. + Use xmalloc to allocate rather than trusting alloca + (which is unwise with large block sizes). + Declare locals more locally, if possible. + Use uintptr_t words instead of int words, for a bit more speed + when looking for null blocks on 64-bit hosts. + Optimize away reads of zero bytes on regular files. + In the typical case, insist on 8 KiB buffers, at least. + Avoid unnecessary extra call to fstat when checking for sparse files. + Avoid now-unnecessary cast to off_t, and "0L". + Avoid unnecessary test of *new_dst when checking for same owner + and group. + +2005-11-22 Paul Eggert + + * src/remove.c (rm): Don't assume C99 for-loop syntax. + +2005-11-22 Jim Meyering + + * src/remove.c (AD_push): Remove debugging cruft. + + * tests/rm/unread2 (rm): Change expected diagnostic, + `cannot open directory' to `cannot remove', to align with + new version of rm. + * tests/rm/rm2: Ensure that rm now continues removing entries + even after certain types of failure. + + * src/remove.c: Rewrite. Now, this module is reentrant on systems + that provide openat (Solaris), and on systems like Linux+procfs + where our openat emulation code is reentrant. This also fixes a + few low-probability leaks and eliminates some code that could, + in very unusual circumstances, cause rm() (via a callee) to exit. + * NEWS: Mention this. + + * configure.ac: Put copyright dates all on one line so the + emacs function that updates them works properly. + +2005-11-18 Paul Eggert + + * configure.ac (AM_PROG_CC_C_O): Add. Needed for CVS Automake. + Problem reported by Eric Blake. + (AC_PROG_CC_STDC): Use this instead of AC_PROG_CC, so that + we get a standard-conforming compiler. This relies on the new + m4/c.m4 file. Note that it's a bit tricky, since c.m4 doesn't + define AC_PROG_CC_STDC; we are relying on Autoconf 2.59 internals. + m4/c.m4 can go away with Autoconf 2.60 comes out. + +2005-11-17 Jim Meyering + + * src/remove.c (AD_mark_helper): Make a `char *' parameter `const'. + (AD_mark_current_as_unremovable): Likewise, but for a local. + (rm_1): Likewise. + + * tests/mv/acl: Let traps handle removing temporary directories. + + Expect acl-related tests to fail, until the corresponding + patches are committed. + * tests/mv/Makefile.am (XFAIL_TESTS): Add acl. + * tests/cp/Makefile.am (XFAIL_TESTS): Likewise. + + ACL tests, from Andreas Gruenbacher. + * tests/acl, tests/mv/acl, tests/cp/acl: New files. + * tests/mv/Makefile.am (TESTS): Add acl. + * tests/cp/Makefile.am (TESTS): Add acl. + + * src/ls.c (basename_is_dot_or_dotdot): Correct wording in comment. + +2005-11-16 Paul Eggert + + * NEWS: Improve quality of ln's diagnostics. + * src/ln.c (do_link, usage): Likewise. + (do_link): Don't use alloca on a buffer of unbounded size. + +2005-11-16 Jim Meyering + + * tests/cp/fail-perm: Accommodate HPUX. It appears to fail + with EACCES rather than EPERM. Reported by Peter O'Gorman here: + http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/5766 + This also affects AIX 4.3.3, according to Ralf Wildenhues, in + http://lists.gnu.org/archive/html/bug-coreutils/2006-05/msg00192.html + +2005-11-14 Jim Meyering + + * NEWS (sort): Mention consequences of today's mkstemp-safer.c fix. + +2005-11-13 Jim Meyering + + * announce-gen: Accept new option, --gpg-key-id=ID and + emit a blurb telling how to use the .sig files. + * Makefile.cfg (gpg_key_ID): Define. + * Makefile.maint (announcement): Use new option and key. + + Require that most .c files include . + * Makefile.maint (sc_require_config_h): New rule. + (syntax-check-rules): Add it. + * .x-sc_require_config_h: New file listing exceptions to the + above rule. Some are legit, others are simply grandfathered in. + * Makefile.am (EXTRA_DIST): Add .x-sc_require_config_h here, too. + +2005-11-12 Jim Meyering + + * src/checksum.h, src/md5.c, src/sha1sum.c: Remove now-unused files. + +2005-11-11 Jim Meyering + + * NEWS: Mention `readlink -f' bug fix in 5.3.0 news. + Mention new readlink options in 5.3.0's `New features' section. + Spotted by Thomas Hood. + +2005-11-08 Jim Meyering + + * NEWS: Merge in changes from b5_9x branch. + +2005-11-08 Paul Eggert + + * NEWS: ls now defaults to --time-style='locale', which in turn acts + like --time-style='posix-long-iso' if the locale settings are messed up. + * src/ls.c (decode_switches): Implement this. + +2005-11-08 Jim Meyering + + * tests/du/2g: s/expensive/very expensive/ in a comment. + From Paul Townsend. + +2005-10-17 Eric Blake + + * src/ls.c (usage): Fix descriptions of --sort, --time. + Reported by Vitaly A. Ostanin. + +2005-11-04 Paul Eggert + + * src/ln.c: Include filenamecat.c. + (FILE_BASENAME_CONCAT): Remove. + (do_link): Remove last arg DEST_IS_DIR. All callers changed. + (main): Use file_name_concat, base_name, and strip_trailing_slashes + instead of FILE_BASENAME_CONCAT. This simplifies the code, and avoids + the use of alloca. + +2005-11-04 Jim Meyering + + * src/du.c (process_file): Don't overflow for files of size >= 2^31 + on systems with stat.st_blocks of a signed 32-bit type. + This bug causes trouble on some AIX 5.1 systems. + Report and trivial patch from Paul Townsend: + + * NEWS: Mention this. + + * tests/du/2g: New (very-expensive) test for the above-fixed bug. + * tests/du/Makefile.am (TESTS): Add it here. + * tests/very-expensive: New file. + * tests/Makefile.am (EXTRA_DIST): Add it here. + * tests/cp/perm: Mark this test as `very-expensive', too. + +2005-11-02 Paul Eggert + + * NEWS: Mention that rm -d and maybe ln -d are scheduled for + removal in 2006. + * src/remove.h (struct rm_options): Remove unlink_dirs. All uses + removed. + * src/rm.c (usage): Don't mention rm -d. + +2005-11-02 Jim Meyering + + * tests/dd/skip-seek: Fix typo in comment: s/fileutils/coreutils. + From Andreas Schwab. + + * tests/dd/unblock-sync: Redirect stderr to /dev/null so the + `M+N records in/out' lines don't pollute `make check' output. + + * tests/dd/skip-seek (sk-seek4): New test, to exercise the bug + fixed on 2005-10-31. This test uses the new, IN_PIPE specifier. + * tests/Coreutils.pm: Accept a new type of input specifier: IN_PIPE, + to indicate that the input file should be piped into the command + under test (via `cat FILE | $prog ...'). + + * src/remove.c (remove_entry): Emit a better diagnostic when rm + (without -r) fails to remove a directory on a non-Linux system. + This change affects only newer Solaris systems (with priv_* + functions like priv_allocset). Reported by Keith Thompson. + + * tests/rm/dir-nonrecur: New file/test for the above fix. + * tests/rm/Makefile.am (TESTS): Add dir-nonrecur. + +2005-11-01 Paul Eggert + + * NEWS: "tail -c 2 FILE" and "touch 0101000000" now operate as + POSIX 1002.1-2001 requires. + * src/tail.c (parse_obsolete_option): Implement this. + Problem reported by Vincent Lefevre. + * src/touch.c (main): Pass PDS_PRE_2000 to posixtime. + * tests/tail/Test.pm (c-2, c-2-minus, c2, c2-minus): New tests. + (test_vector): Add special cases for _POSIX2_VERSION, and + regularize the old ones a bit. + * tests/touch/obsolescent: Add y2000 test. + +2005-10-31 Paul Eggert + + * src/dd.c (skip): Fix off-by-one error reported by + Theodoros V. Kalamatianos. + +2005-10-30 Paul Eggert + + * tests/mkdir/p-3: Require that the test be run as non-root. + Problem and trivial fix reported by Theodoros V. Kalamatianos. + +2005-10-28 Paul Eggert + + * src/ln.c (FILE_BASENAME_CONCAT): Omit unnecessary slashes in the + boundary between DEST and SOURCE in the result. + +2005-10-26 Dmitry V. Levin + + * src/md5sum.c (main) [!O_BINARY]: Changed default read mode + back to text, to sync with documentation and for backwards + compatibility. + +2005-10-25 Jim Meyering + + * tests/dircolors/simple (other-wr): Add an explicit test for + the dircolors bug (NULL-dereference) fixed yesterday. + +2005-10-24 Jim Meyering + + * src/tac.c (tac_file): When determining whether a file is seekable, + also test whether it is a tty. Using only the lseek-based test would + give a false positive on Solaris. Reported by Peter Fales. + +2005-10-24 Dmitry V. Levin + + * tests/install/d-slashdot: New test, for "install -d" failure. + * tests/install/Makefile.am (TESTS): Add d-slashdot. + * tests/mkdir/p-slashdot: New test, for "mkdir -p" failure. + * tests/mkdir/Makefile.am (TESTS): Add p-slashdot. + +2005-10-24 Jim Meyering + + * src/dircolors.c (ls_codes): Add missing comma. + Anonymous report and patch from + http://savannah.gnu.org/bugs/?func=detailitem&item_id=14849 + + * src/dircolors.c: Add compile-time assertion that the slack_codes + and ls_codes arrays have the same number of elements. This would + have prevented the above-fixed bug. + + * src/expand.c (parse_tab_stops): Add a comment to make this function + identical to the one in unexpand.c. + * src/unexpand.c (parse_tab_stops): Adjust syntax to make this function + identical to the one in expand.c. + + * src/expand.c (next_file): Don't assume fopen cannot return stdin. + +2005-10-23 Jim Meyering + + * src/md5sum.c (digest_check, main): Use ptr_align rather than + a dangerous pointer-value-to-`unsigned' cast. + * NEWS: mention the new sha* programs. + * AUTHORS: Add new sha* programs. + +2005-08-28 David Madore + + Add new programs: sha224sum, sha256sum, sha384sum, sha512sum. + * README: Add their names to the list. + * src/md5sum.c: Provide framework for computing sha-2 hashes. + * src/Makefile.am (sha224sum, sha256sum, sha384sum, sha512sum): + Rules for compiling sha-2 utilities + (noinst_HEADERS): Remove checksum.h. + * man/sha512sum.x, man/sha384sum.x, man/sha256sum.x, man/sha224sum.x: + New files. + * man/Makefile.am (dist_man_MANS): Add the corresponding .1 names. + (sha224sum.1, sha256sum.1, sha384sum.1, sha512sum.1): New dependencies. + * tests/misc/sha224sum, tests/misc/sha256sum: New files. + * tests/misc/sha384sum, tests/misc/sha512sum: New files. + * tests/misc/Makefile.am (TESTS): Add new sha224sum, sha256sum, + sha384sum, sha512sum test scripts here rather that each in its + own directory. + +2005-08-28 David Madore + + * tests/sha1sum/basic-1 (million-a): Add the "million a's" test (one + of the FIPS test vectors). + +2005-10-23 Jim Meyering + + * configure.ac: Use 6.0-cvs as the version string. + * NEWS: Adjust accordingly. + 2005-10-22 Jim Meyering * Version 5.92. diff --git a/src/bin/coreutils/ChangeLog-2006 b/src/bin/coreutils/ChangeLog-2006 new file mode 100644 index 0000000000..1c734b0e55 --- /dev/null +++ b/src/bin/coreutils/ChangeLog-2006 @@ -0,0 +1,4040 @@ +2006-12-30 Jim Meyering + + * bootstrap (gnulib_extra_files): Remove announce-gen. + * bootstrap.conf (gnulib_modules): Add it here instead, now that + it's a module. + + * tests/misc/base64: Factor a long, repetitive string. + + * src/c99-to-c89.diff: Adjust remove.c offsets. + + Clean up after the change of 2006-12-28. + * src/remove.c (AD_pop_and_chdir): Change **DIRP parameter to *DIRP, + now that this function never modifies the pointer. Adjust comments + and code accordingly. + (remove_dir): Set "dirp" to NULL right after AD_pop_and_chdir call, + now that AD_pop_and_chdir no longer does that. + + * tests/rm/fail-eperm: Avoid spurious differences (the error function + from latest glibc no longer prints the full program_name): so don't + invoke rm via ../../src/rm. Instead, invoke it via "PATH=../../src rm". + + * tests/mv/acl (skip): Skip this test also if the destination + directory, which is on a different file system, lacks ACL support. + + * src/copy.c (copy_reg): Rewrite a comment that was rendered + inaccurate by the 2006-10-18 change. + +2006-12-28 Jim Meyering + + When moving "up" the hierarchy, be careful to remove a just-emptied + directory before opening ".", to avoid trouble with file system + implementations that cache readdir results at opendir-time. + * src/remove.c (AD_pop_and_chdir): Add a file descriptor parameter. + Don't update **DIRP. Don't call fdopendir here. + (remove_dir): Call fdopendir here instead. + Report and patch from Mikulas Patocka: + + +2006-12-27 Jim Meyering + + * src/tail.c (usage): Mention +N for --bytes and --lines. + Suggestion from Evan Hunt. + +2006-12-26 Jim Meyering + + * configure.ac: Require autoconf-2.61 and automake-1.10. + Without the former (even with autoconf-2.60), "make distcheck" + would fail (without the 2006-09-26 autoconf AC_CHECK_DECL fix), + due to an inttypes.h generated with CFLAGS including -pedantic. + With the old decl check, @HAVE_DECL_STRTOUMAX@ would be 0. + + * Makefile.maint (VC-tag): Define, so as to gpg-sign each release + tag, using the release version number as the message. + (vc-dist): Use $(VC-tag), rather than "$(VC) tag". + +2006-12-21 Paul Eggert + + * NEWS: dd bs= operands now silently override later ibs= and obs=, + as POSIX requires. + * src/dd.c (scanargs): Implement it. + * tests/dd/misc (outbytes): Test it. + * doc/coreutils.texi (dd invocation): Specify that bs=N + overrides later ibs and obs, undoing part of the + previous change. (The behavior was wrong.) + +2006-12-20 Jim Meyering + + "rm -rf /etc/motd" (run by non-root) now prints a diagnostic. + * src/remove.c (remove_entry): Handle EACCES for a non-directory, too. + Don't let a non-directory get by with errno == EPERM, either. + Check the file type directly (using cached stat value), rather + than trying to guess it from errno values. + Karl Berry reported that a cross-partition "mv /etc/issue ~" + failed with the um,... suboptimal diagnostic, + "mv: cannot remove `/etc/issue': Not a directory". + * tests/rm/Makefile.am (TESTS): Add fail-eacces. + * tests/rm/fail-eacces: New file. + * NEWS: Mention that both mv and rm are affected. + + "cut -f 2- A B" no longer triggers a double-free bug + * src/cut.c (cut_fields): Set file-scoped global to NULL after + freeing it. This avoids a double-free (and core dump on some systems) + for this usage: "echo 1>a; echo 2>b; cut -f2- a b". Reported by + James Hunt in . + * NEWS: List this bug fix. + * THANKS: Mention him. + * tests/misc/cut: New file. + * tests/misc/Makefile.am (TESTS): Add cut. + +2006-12-15 Jim Meyering + + * tests/cp/open-perm-race: Correct the gdb-existence check. + Don't run either subsequent gdb command in a sub-shell. + Reported by Thomas Schwinge. + * THANKS: bring up to date. + +2006-12-14 Paul Eggert + + Make sure cp -p isn't too generous with file permissions. + * tests/cp/Makefile.am (TESTS): Add file-perm-race. + * tests/cp/file-perm-race: New file. + + Ensure cp -pR --parents isn't too generous with parent permissions. + * tests/cp/Makefile.am (TESTS): Add parent-perm-race. + * tests/cp/parent-perm-race: New file. + +2006-12-14 Jim Meyering + + * tests/chgrp/default-no-deref: Don't assume that files are created + with the primary group by default. That's not true in a directory + with the set-GID bit set. + + Don't hang when there's no input tty. + * tests/cp/open-perm-race: Skip this test if there is no + controlling input `terminal'. + + Test for a hard-to-detect race fix, using gdb. + * tests/cp/open-perm-race: New file, to test for the + cp --preserve=ownership fix of 2006-12-06. + + * tests/cp/Makefile.am (TESTS_ENVIRONMENT): Define abs_top_builddir. + (TESTS): Add open-perm-race. + + * src/chgrp.c (main): Don't prohibit -RLh, aka -RL with --no-dereference. + * src/chown.c (main): Likewise. + * src/chown-core.c (change_file_owner): Add to a comment. + * tests/chown/preserve-root: Add tests. + + * NEWS: --preserve-root now works with chgrp, chmod, and chown. + * src/chmod.c (process_file): Do honor the --preserve-root option. + * src/chown-core.c (change_file_owner): Likewise, but here, also + handle the case in which a traversal would go "through" a symlink + to root. Reported by Matthew M. Boedicker + * tests/chown/preserve-root: Test for the above. + * tests/chown/Makefile.am (TESTS): Add preserve-root. + + * NEWS: Mention the chmod fix induced by the 2006-12-11 change + to gnulib's m4/openat.m4. + +2006-12-13 Andreas Schwab + + Don't fail if mv/acl test succeeds. + * tests/mv/acl (skip): Check for acl support in the file system. + * tests/mv/Makefile.am (XFAIL_TESTS): Remove. + (TESTS_ENVIRONMENT): Pass CONFIG_HEADER. + +2006-12-13 Paul Eggert + + Remove some arbitrary restrictions on size fields, so that + commands like "sort -k 18446744073709551616" no longer fail merely + because 18446744073709551616 doesn't fit in uintmax_t. The trick + is that these fields can all be treated as effectively infinity; + their exact values don't matter, since no internal buffer can be + that long. + * src/join.c (string_to_join_field): Verify that SIZE_MAX <= + ULONG_MAX if the code assumes this. Silently truncate too-large + values to SIZE_MAX, as the remaining code will do the right thing + in this case. + * src/sort.c (parse_field_count): Likewise. + * src/uniq.c (size_opt, main): Likewise. + * tests/join/Test.pm (bigfield): New test. + * tests/sort/Test.pm (bigfield): New test. + * tests/uniq/Test.pm (121): New test. + +2006-12-13 Jim Meyering + + * tests/chgrp/default-no-deref: New test. + * tests/chgrp/Makefile.am (TESTS): Add default-no-deref. + +2006-12-12 Jim Meyering + + * src/system.h (SETVBUF): Remove definition, now that the + autoconf macro, AC_FUNC_SETVBUF_REVERSED, does nothing. + * src/tee.c (tee_files): s/SETVBUF/setvbuf/. + * src/od.c (open_next_file): Likewise. + +2006-12-09 Jim Meyering + + * man/Makefile.am (.x.1): Make help2man use $(PACKAGE_STRING) as the + "source". I.e. "GNU coreutils 6.7". + + * NEWS: With the change from "-pre" to "-dirty" suffix, also change + from NEXT_VER-pre to CUR_VER-dirty. So, this is 6.7-dirty. + * configure.ac (AC_INIT): s/6.8-dirty/6.7-dirty/. + + * tests/uniq/Test.pm (test_vector): Skip the pipe-reading test + whenever uniq is expected to fail. This should catch the other case + [test #112] in which uniq emits "cat: write error: Broken pipe" on + some systems. + +2006-12-08 Jim Meyering + + Include bootstrap tool version info in the announcement form. + * Makefile.maint (gnulib_snapshot_date): Define. + (announcement): Use two new announce-gen options, + --bootstrap-tools and --gnulib-snapshot-date. + * Makefile.cfg (gnulib_dir): Set. + + Post-release version change. + * NEWS: Add a line for 6.8-dirty. + * configure.ac (AC_INIT): Set new version string. + +2006-12-07 Jim Meyering jim@meyering.net + + Version 6.7. + * NEWS: Record release date. Remove '-pre' suffix. + * configure.ac (AC_INIT): Remove version string suffix. + +2006-12-07 Jim Meyering + + Make the output of "make check" more reproducible. + * tests/touch/empty-file: Use envvar-check, so "make check" doesn't + evoke diagnostics like this when COLUMNS=0 in the environment: + ls: ignoring invalid width in environment variable COLUMNS: 0 + * tests/touch/no-rights: Likewise. + * tests/help-version: Likewise. + * tests/uniq/Test.pm: Don't perform the pipe-reading version of test + 118, since it emits "cat: write error: Broken pipe" on some systems. + +2006-12-06 Paul Eggert + + * NEWS: Document the cp -p fix for special bits. + * src/copy.c (set_owner): Now returns a three-way result, so + that the caller can clear the special bits. All callers changed. + (copy_reg): Don't set the special bits if chown failed. + (copy_internal): Likewise. + * tests/cp/special-bits: Test this fix. + +2006-12-06 Paul Eggert + + * NEWS: Document the cp --preserve=ownership fix. + * m4/jm-macros.m4 (coreutils_MACROS): Check for fchmod. + * src/copy.c (fchmod_or_lchmod): New function. + (copy_reg): New arg OMITTED_PERMISSIONS. All uses changed. + Omit confusing and unused ", dst_mode" arg to 'open' without O_CREAT. + When creating a file, use O_EXCL, so we're more likely to detect + funny business by other processes. At the end, if permissions + were omitted, chmod them back in. + (copy_internal): If the ownership might change, omit some permissions + at first, then restore them after chowning the file. + * src/cp.c (make_dir_parents_private): Likewise. + * src/copy.c (cached_umask): New function. + * src/copy.h (cached_umask): New decl. + +2006-12-06 Jim Meyering + + Make the output of "make check" more reproducible. + * tests/misc/date-sec: Don't emit any diagnostic about sleeping. + +2006-12-03 Paul Eggert + + * src/install.c (install_file_in_file): Preserve time stamps + before changing owner or file mode bits, for consistency with + other coreutils programs. + +2006-12-03 Jim Meyering + + * tests/misc/date-sec: Output a fixed string. + + * NEWS: du --one-file-system (-x) would skip subdirectories of any + directory listed as second or subsequent command line argument. + * tests/du/one-file-system: New file. Test for today's fts.c fix. + * tests/du/Makefile.am (TESTS): Add one-file-system. + Reported by Mike Frysinger. + +2006-12-02 Jim Meyering + + * tests/du/basic: Generate 4KB file simply using printf, rather than + seq+head. This avoids a spurious "Broken pipe" diagnostic from seq. + +2006-11-28 Jim Meyering + + * tests/mv/no-target-dir: Detect a buggy rename syscall. If found, + skip this test. This happens at least on ia64 linux-2.4.19 w/ext3. + Reported by Matthew Woehlke. + + * tests/mv/dir2dir: Also accept EBUSY. + Reported by Matthew Woehlke. + +2006-11-27 Jim Meyering + + * Makefile.maint (patch-check): Rewrite to diagnose failure. + * src/c99-to-c89.diff: Adjust shred.c offsets. + +2006-11-26 Paul Eggert + + Improve the check for departures from C89, and fix the departures + I found. + * Makefile.maint (my-distcheck): Also check for C89 compatibility + as best we can with GCC. + * src/stat.c (PRINTF_OPTION): Omit comma before } in enum + declaration; C89 doesn't allow this. + * src/dcgen: Don't generate string literals longer than + what C89 requires support for. + * src/cut.c (usage): Don't use string literals longer than + what C89 requires support for. + * src/date.c (usage): Likewise. + * src/dd.c (usage): Likewise. + * src/du.c (usage): Likewise. + * src/ls.c (usage): Likewise. + * src/od.c (usage): Likewise. + * src/readlink.c (usage): Likewise. + * src/seq.c (usage): Likewise. + * src/shred.c (usage): Likewise. + +2006-11-26 Mike Frysinger + + Recognize new archive, audio and image formats. + Give audio files a separate color. + * src/dircolors.hin: Add comments for common .sh and .csh scripts. + Add .bz2, .tbz2, .tz, .rar, .ace, .zoo, .cpio, .7z, .rz as archive + suffixes. Add .mng, .pcx, .m2v, .mkv, .ogm, .mp4, .m4v, .mp4v, .vob, + .qt, .nuv, .wmv, .asf, .rm, .rmvb, .flc, .yuv as image formats. + Add .aac, .au, .mid, .midi, .mka, .ra as audio suffixes. Change + audio color to 00;36 to differentiate from image/video color. + +2006-11-26 Jim Meyering + + * Makefile.maint (patch-check): Compile patched sources with + CFLAGS='-Wdeclaration-after-statement -Werror', to ensure that + no violations remain. + + * src/c99-to-c89.diff: Remove 3 bogus hunks. + + * src/remove.c (fd_to_subdirp): Remove unused parameter, ds. + Update callers. + + * src/c99-to-c89.diff: Adjust for changes in rm.c and in remove.c. + + * src/rm.c (main): Remove unnecessary (assuming C99) braces. + +2006-11-26 Paul Eggert + + Port parts of the code to C89 to minimize the need for c99-to-c89.diff, + while trying to retain the readability of C99 as much as possible. + * src/remove.c (rm_1): Remove decl of local, fd_cwd. + Replace each of two uses with literal AT_FDCWD. + (cache_stat_init): Return its argument, for convenience. + Update the caller in remove_dir. + (AD_pop_and_chdir): Return prev_dir rather than storing through + a pointer argument. All uses changed. + (AD_ensure_initialized): New function. + (AD_mark_helper): Use it, to avoid the need for declaration + after statement. + (rm): Move cycle_check_init call into callee... + (rm_1): ...here. + Use an else clause in place of a "continue" statement. + (close_preserve_errno): Remove. + (fd_to_subdirp): Rewrite to avoid the need for decl after statement. + +2006-11-25 Jim Meyering + + * Makefile.am (EXTRA_DIST): Remove announce-gen from here, too. + +2006-11-24 Theodoros V. Kalamatianos (tiny change) + + * tests/du/inacc-dest: Skip this test when running as root. + +2006-11-23 Jim Meyering + + * announce-gen: Remove file. It's moving to gnulib. + * bootstrap: Pull it from gnulib/build-aux instead. + * Makefile.maint (announcement): Reflect move to ./build-aux. + + * tests/du/deref-args: Use "printf %65536s x" to create a 64KB file, + rather than a pipeline that would sometimes evoke a diagnostic + like "seq: write error: Broken pipe". + + * tests/help-version: Suppress dd transfer rate output. + + * configure.ac (AC_INIT): Bump to 6.7-pre, not 6.6-pre. + +2006-11-22 Jim Meyering + + * announce-gen (print_news_deltas): Fix silly, but harmless typo: + change "(:?..." to "(?:..." in regexps. + + Post-release version change. + * NEWS: Add a line for 6.7-pre. + * configure.ac (AC_INIT): Bump to 6.7 and add "-pre" suffix. + + Version 6.6. + * NEWS: Record release date. Remove "-pre" suffix. + * configure.ac (AC_INIT): Remove "-pre" suffix from version string. + + * announce-gen: Remove unused --release-archive-directory option. + (print_news_deltas): Accept new adjective, "Noteworthy", in addition + to the old "Major". + Match version numbers in NEWS using tighter regular expressions. + (main): Require the --gpg-key-id=ID option. + * Makefile.maint (announcement): Don't use now-removed + --release-archive-directory=... option. + + * NEWS: Mention the three noteworthy changes, all fixed via gnulib. + +2006-11-21 Jim Meyering + + * tests/rm/one-file-system: Upon setup failure (e.g., mount failure), + skip the test rather than failing. Reported by Michael Deutschmann. + + * tests/rm/fail-eperm: Use the "(exit N); exit N" idiom, + rather than just "exit N". + + Arrange for "make check-root" to run the new root-only test. + * tests/Makefile.am (t7): New target, to run tests/ls/nameless-uid. + (all_t): Add t7. + +2006-11-20 Jim Meyering + + Add a root-only test for today's lib/idcache.c fix. + * tests/ls/nameless-uid: New file. + * tests/ls/Makefile.am (TESTS): Add nameless-uid. + (TESTS_ENVIRONMENT): Add PERL to the list. + +2006-11-19 Jim Meyering + + * tests/tail-2/assert-2: Mark as a very-expensive test, because I + find the 7-second sleep annoyingly long. Besides, this test is + probably far too specific and timing sensitive ever to trigger again. + * tests/tail-2/assert: Likewise. + + Post-release version change. + * NEWS: Add a line for 6.6-pre. + * configure.ac (AC_INIT): Bump to 6.6 and add "-pre" suffix. + + Version 6.5. + * NEWS: Record release date. Remove "-cvs" suffix. + * configure.ac (AC_INIT): Remove "-cvs" suffix from version string. + +2006-11-18 Jim Meyering + + "ln --backup f f" produces a misleading diagnostic: + ln: creating hard link `f' => `f': No such file or directory + * src/ln.c (do_link): Give a better diagnostic in this unusual case. + (do_link): Rename local: s/lstat_ok/dest_lstat_ok/. + * tests/ln/Makefile.am (TESTS): Add hard-backup. + * tests/ln/hard-backup: New test for the above. + * NEWS: Mention this fix. + +2006-11-16 Paul Eggert + + * bootstrap.conf (gnulib_modules): Add sys_stat, since we use it + directly too. + * lib/.cvsignore, lib/.gitignore: Add root-dev-ino.c, root-dev-ino.h. + * m4/.cvsignore, m4/.gitignore: Add root-dev-ino.m4. + * src/ls.c (DIRED_FPUTS_LITERAL, PUSH_CURRENT_DIRED_POS): + Omit unnecessary parenthesization of args. + * src/od.c (EQUAL_BLOCKS): Likewise. + * src/system.h (STREQ, ASSIGN_STRDUPA): Likewise. + +2006-11-16 Jim Meyering + + * tests/tail-2/append-only: If chattr +a fails, exit 77 (to tell + automake we're skipping this test), and give a diagnostic to tell + the user the same thing. Reported by Mike Grayson. + +2006-11-16 Ralf Wildenhues + + * man/Makefile.am (dist_man_MANS): Replace all optional manpages + with `$(MAN)', computed at configure time; also, list them ... + (optional_mans): ... in this new variable. + (max_aux, EXTRA_DIST): Ensure that we distribute all manpages. + +2006-11-16 Jim Meyering + + Help valgrind see that there is no leak in dd.c. + * src/dd.c (dd_copy): Declare real_buf and real_obuf to be static, + so we need not free them at all. This is easier than freeing + both buffers at each of the early "return"s. + + * src/csplit.c (load_buffer): Plug an inconsequential leak. + +2006-11-15 Jim Meyering + + * .x-po-check: Exclude gl/ files. Otherwise, po-check would + complain that some of gl/lib/*.[ch] are not listed in POTFILES.in. + +2006-11-14 Jim Meyering + + * gl/m4/root-dev-ino.m4: Now that this is part of a real "module", + remove the now-unnecessary use of AC_LIBSOURCES. + + Adapt to new version of gnulib-tool. + * gl/modules/root-dev-ino: New file. + * lib/root-dev-ino.c, lib/root-dev-ino.h: Move these files ... + * gl/lib/root-dev-ino.c, gl/lib/root-dev-ino.h: ... to here. + * m4/root-dev-ino.m4: Move this file ... + * gl/m4/root-dev-ino.m4: ... to here. + + * bootstrap.conf (gnulib_modules): Add root-dev-ino. + +2006-11-13 Jim Meyering + + * src/sort.c (insertkey): Use xmemdup, rather than xmalloc+assignment. + From Paul Eggert. + + Plug another technically-unimportant leak in sort. + * src/sort.c (main): Don't allocate memory for each new key here. + (insertkey): Allocate memory for each key here, instead. + (key_init): Rename from new_key. Don't allocate. + + * src/sort.c (main): Plug a tiny memory leak. + Move declaration of local "minus" down to be nearer point of use. + +2006-11-12 Jim Meyering + + du would exit early, when encountering an inaccessible directory + Reported by Mike Frysinger, in + http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/8831 + * tests/du/inacc-dest: New test, based on an example from Mike Frysinger. + * tests/chgrp/no-x: Remove the "fts_read failed: ..." + diagnostic from the expected output when using native fdopendir. + * tests/chmod/no-x: Likewise. + * tests/du/no-x: Likewise. + * NEWS: Mention this bug fix. + * tests/du/Makefile.am (TESTS): Add inacc-dest. + + * Makefile.maint (sc_cast_of_x_alloc_return_value): Add an exclusion + for xalloc.h itself. + + Avoid false-positive when testing via valgrind. + * tests/mv/atomic: Grep strace output for a more specific pattern + than just "unlink", since that got a false positive when testing + under valgrind: unlink("/tmp/valgrind_proc_9657_cmdline_A51E9991") = 0 + * tests/mv/Makefile.am (TESTS_ENVIRONMENT): Define EGREP. + +2006-10-28 Jim Meyering + + * Makefile.maint (patch-check): Make it easier to regenerate + the src/c99-to-c89.diff file. E.g., I do this: + make patch-check REGEN_PATCH=1; ediff src/c99-to-c89.diff new-diff + + * src/c99-to-c89.diff: Update to reflect new offsets in rm.c. + +2006-10-26 Jim Meyering + + * src/system.h (ftello): Add a compile-time check for the highly + unlikely condition of off_t narrower than long int, rather than + handling it at run time. Based on a patch from Paul Eggert. + +2006-10-25 Paul Eggert + + * tests/chmod/c-option: When double-quoting part of a word, prefer + to double-quote the whole word. This is a bit easier to read (at + least for me), and in some cases it avoids a shell bug with Tru64 + 4.0 sh reported by Nelson H. F. Beebe. For example, instead of + "$abs_srcdir"/../setgid-check we now write + "$abs_srcdir/../setgid-check". + * tests/cp/cp-parents: Likewise. + * tests/du/inaccessible-cwd: Likewise. + * tests/du/long-from-unreadable: Likewise. + * tests/install/basic-1: Likewise. + * tests/install/trap: Likewise. + * tests/misc/close-stdout: Likewise. + * tests/mkdir/concurrent-1: Likewise. + * tests/mkdir/p-1: Likewise. + * tests/mkdir/p-3: Likewise. + * tests/mkdir/parents: Likewise. + * tests/mkdir/perm: Likewise. + * tests/readlink/can-e: Likewise. + * tests/readlink/can-f: Likewise. + * tests/readlink/can-m: Likewise. + * tests/rm/inaccessible: Likewise. + * tests/rm/unread3: Likewise. + * tests/touch/no-create-missing: Likewise. + + * lib/.cvsignore: Add uinttostr.c. + +2006-10-25 Jim Meyering + + Portability to Tru64 V4.0. + * src/system.h (ftello) [!HAVE_FSEEKO && !defined ftello]: + Define inline replacement function. + This (along with a yesterday's fix for autoconf's + _AC_SYS_LARGEFILE_MACRO_VALUE macro) makes it so coreutils + now builds once more on Tru64 V4.0. Reported by Nelson Beebe. + +2006-10-25 Bruno Haible + + * src/cat.c (infile): Add "const" to declaration. + * src/csplit.c (prefix): Likewise. + * src/printf.c (cfcc_msg): Likewise. + * src/tail.c (valid_file_spec): Likewise. + * src/cut.c (cut_file): Likewise, for a parameter. + * src/expr.c (str_value): Likewise. + * src/fold.c (fold_file): Likewise. + * src/pr.c (init_header): Likewise. + * src/dircolors.c (dc_parse_stream): Likewise, for a local. + * src/tr.c (make_printable_str): Likewise. + * src/nl.c (body_type, header_type, footer_type, current_type): + (separator_str, build_type_arg, nl_file): Likewise, for many. + * src/paste.c (main): Don't assign a read-only string to 'optarg'. + * src/tac.c (separator, tac_seekable, copy_to_temp): Likewise. + +2006-10-25 Jim Meyering + + * tests/sample-test: Update copyright year list to include only + the current year, since this is what I'll want in any new test. + +2006-10-24 Jim Meyering + + * src/c99-to-c89.diff: Update to reflect new offsets. + + * NEWS: new feature: rm accepts new option: --one-file-system + Suggested by Steve McIntyre in . + * src/remove.h (struct rm_options) [one_file_system]: New member. + * src/rm.c (rm_option_init): Initialize it. + (usage): Document the option. + * src/mv.c (rm_option_init): Likewise. + * src/remove.c (remove_dir): With --one-file-system and --recursive, + for each directory command line argument, do not affect a file system + different from that of the starting directory. And give a diagnostic. + * src/rm.c (ONE_FILE_SYSTEM): New enum. + (main): Handle new option. + * tests/rm/one-file-system: Test the above. + * tests/rm/Makefile.am (TESTS): Add one-file-system. + * tests/Makefile.am (check-root): Add the rm/one-file-system + test to the list. + (EXTRA_DIST): Add other-fs-tmpdir. + + * tests/mv/setup: Removed. Renamed to... + * tests/other-fs-tmpdir: ...this new file. + * tests/mv/Makefile.am (EXTRA_DIST): Remove setup. + * tests/mv/acl: Reflect renaming: use ../other-fs-tmpdir. + * tests/mv/backup-is-src: Likewise. + * tests/mv/hard-link-1: Likewise. + * tests/mv/leak-fd: Likewise. + * tests/mv/mv-special-1: Likewise. + * tests/mv/part-fail: Likewise. + * tests/mv/part-hardlink: Likewise. + * tests/mv/part-rename: Likewise. + * tests/mv/part-symlink: Likewise. + * tests/mv/partition-perm: Likewise. + * tests/mv/to-symlink: Likewise. + * tests/mv/into-self-2: Likewise. + + Don't let a failure in one test stop "make -k" from running the others. + * tests/Makefile.am (t1 t2 t3 t4 t5): New targets. + (check-root): Depend on them, rather than executing the five + commands in a single rule. Reported by Greg Schafer. + +2006-10-23 Bob Proulx (tiny change) + + * Makefile.maint (alpha beta major): Use a better log message for + the automatic commit of .prev-version. + +2006-10-23 Jim Meyering + + * tests/misc/pwd-long: Undo last change, since it made Perl invoke + pwd via a shell. Instead, ensure that the absolute name of the + pwd binary consists solely of reasonable characters. + Whoops. Don't exec the perl script. Otherwise, the sh-trap-based + clean-up code isn't run. + + * NEWS: Add a line for 6.5-cvs. + * configure.ac (AC_INIT): Bump to 6.5 and add "-cvs" suffix. + +2006-10-22 Jim Meyering + + Version 6.4. + + * NEWS: Record the 6.4 release date. + * configure.ac (AC_INIT): Remove "-cvs" suffix from version string. + + * Makefile.maint: Complete the adaptation to function with a working + directory that is using git (rather than cvs) for version control. + +2006-10-22 Ralf Wildenhues + + * tests/chmod/c-option: Double-quote instances of `$abs_srcdir'. + * tests/cp/cp-parents: Likewise. + * tests/mkdir/parents: Likewise. + * tests/mkdir/perm: Likewise. + + * tests/sample-test: Quote variables containing absolute build + tree paths. In the cleanup trap, make sure `cd' succeeds before + `chmod'ing and `rm'ing the temporary files. + * tests/chgrp/basic: Likewise. + * tests/chgrp/deref: Likewise. + * tests/chgrp/no-x: Likewise. + * tests/chgrp/posix-H: Likewise. + * tests/chgrp/recurse: Likewise. + * tests/chmod/c-option: Likewise. + * tests/chmod/equal-x: Likewise. + * tests/chmod/equals: Likewise. + * tests/chmod/inaccessible: Likewise. + * tests/chmod/no-x: Likewise. + * tests/chmod/octal: Likewise. + * tests/chmod/setgid: Likewise. + * tests/chmod/umask-x: Likewise. + * tests/chmod/usage: Likewise. + * tests/chown/basic: Likewise. + * tests/chown/deref: Likewise. + * tests/chown/separator: Likewise. + * tests/cp/acl: Likewise. + * tests/cp/backup-1: Likewise. + * tests/cp/backup-dir: Likewise. + * tests/cp/backup-is-src: Likewise. + * tests/cp/cp-HL: Likewise. + * tests/cp/cp-deref: Likewise. + * tests/cp/cp-i: Likewise. + * tests/cp/cp-mv-backup: Likewise. + * tests/cp/cp-parents: Likewise. + * tests/cp/deref-slink: Likewise. + * tests/cp/dir-rm-dest: Likewise. + * tests/cp/dir-slash: Likewise. + * tests/cp/dir-vs-file: Likewise. + * tests/cp/fail-perm: Likewise. + * tests/cp/into-self: Likewise. + * tests/cp/link: Likewise. + * tests/cp/link-no-deref: Likewise. + * tests/cp/link-preserve: Likewise. + * tests/cp/no-deref-link1: Likewise. + * tests/cp/no-deref-link2: Likewise. + * tests/cp/no-deref-link3: Likewise. + * tests/cp/perm: Likewise. + * tests/cp/preserve-2: Likewise. + * tests/cp/r-vs-symlink: Likewise. + * tests/cp/same-file: Likewise. + * tests/cp/slink-2-slink: Likewise. + * tests/cp/sparse: Likewise. + * tests/cp/special-bits: Likewise. + * tests/cp/src-base-dot: Likewise. + * tests/cp/symlink-slash: Likewise. + * tests/dd/not-rewound: Likewise. + * tests/dd/skip-seek2: Likewise. + * tests/dd/unblock-sync: Likewise. + * tests/du/2g: Likewise. + * tests/du/8gb: Likewise. + * tests/du/basic: Likewise. + * tests/du/deref: Likewise. + * tests/du/deref-args: Likewise. + * tests/du/exclude: Likewise. + * tests/du/fd-leak: Likewise. + * tests/du/hard-link: Likewise. + * tests/du/inaccessible-cwd: Likewise. + * tests/du/long-from-unreadable: Likewise. + * tests/du/long-sloop: Likewise. + * tests/du/no-deref: Likewise. + * tests/du/no-x: Likewise. + * tests/du/restore-wd: Likewise. + * tests/du/slash: Likewise. + * tests/du/slink: Likewise. + * tests/du/trailing-slash: Likewise. + * tests/du/two-args: Likewise. + * tests/fmt/long-line: Likewise. + * tests/install/basic-1: Likewise. + * tests/install/create-leading: Likewise. + * tests/install/d-slashdot: Likewise. + * tests/install/trap: Likewise. + * tests/ln/misc: Likewise. + * tests/ln/target-1: Likewise. + * tests/ls/color-dtype-dir: Likewise. + * tests/ls/dangle: Likewise. + * tests/ls/dired: Likewise. + * tests/ls/file-type: Likewise. + * tests/ls/follow-slink: Likewise. + * tests/ls/infloop: Likewise. + * tests/ls/inode: Likewise. + * tests/ls/m-option: Likewise. + * tests/ls/no-arg: Likewise. + * tests/ls/recursive: Likewise. + * tests/ls/rt-1: Likewise. + * tests/ls/stat-dtype: Likewise. + * tests/ls/stat-failed: Likewise. + * tests/ls/stat-vs-dirent: Likewise. + * tests/misc/cat-proc: Likewise. + * tests/misc/close-stdout: Likewise. + * tests/misc/csplit: Likewise. + * tests/misc/date-sec: Likewise. + * tests/misc/false-status: Likewise. + * tests/misc/head-c: Likewise. + * tests/misc/head-pos: Likewise. + * tests/misc/mknod: Likewise. + * tests/misc/nl: Likewise. + * tests/misc/nohup: Likewise. + * tests/misc/pathchk1: Likewise. + * tests/misc/printf: Likewise. + * tests/misc/printf-hex: Likewise. + * tests/misc/pwd-long: Likewise. + * tests/misc/shuf: Likewise. + * tests/misc/sort-rand: Likewise. + * tests/misc/split-a: Likewise. + * tests/misc/split-fail: Likewise. + * tests/misc/split-l: Likewise. + * tests/misc/stat-fmt: Likewise. + * tests/misc/tac-continue: Likewise. + * tests/misc/wc-files0: Likewise. + * tests/mkdir/concurrent-1: Likewise. + * tests/mkdir/p-1: Likewise. + * tests/mkdir/p-2: Likewise. + * tests/mkdir/p-3: Likewise. + * tests/mkdir/p-slashdot: Likewise. + * tests/mkdir/p-thru-slink: Likewise. + * tests/mkdir/p-v: Likewise. + * tests/mkdir/parents: Likewise. + * tests/mkdir/perm: Likewise. + * tests/mkdir/t-slash: Likewise. + * tests/mv/acl: Likewise. + * tests/mv/atomic: Likewise. + * tests/mv/backup-dir: Likewise. + * tests/mv/childproof: Likewise. + * tests/mv/diag: Likewise. + * tests/mv/dir-file: Likewise. + * tests/mv/dir2dir: Likewise. + * tests/mv/dup-source: Likewise. + * tests/mv/hard-2: Likewise. + * tests/mv/hard-3: Likewise. + * tests/mv/hard-4: Likewise. + * tests/mv/hard-link-1: Likewise. + * tests/mv/hard-verbose: Likewise. + * tests/mv/i-2: Likewise. + * tests/mv/i-3: Likewise. + * tests/mv/i-4: Likewise. + * tests/mv/i-5: Likewise. + * tests/mv/i-link-no: Likewise. + * tests/mv/into-self-4: Likewise. + * tests/mv/leak-fd: Likewise. + * tests/mv/mv-special-1: Likewise. + * tests/mv/no-target-dir: Likewise. + * tests/mv/part-fail: Likewise. + * tests/mv/part-hardlink: Likewise. + * tests/mv/part-rename: Likewise. + * tests/mv/part-symlink: Likewise. + * tests/mv/partition-perm: Likewise. + * tests/mv/perm-1: Likewise. + * tests/mv/reply-no: Likewise. + * tests/mv/trailing-slash: Likewise. + * tests/mv/update: Likewise. + * tests/od/od-N: Likewise. + * tests/od/x8: Likewise. + * tests/readlink/can-e: Likewise. + * tests/readlink/can-f: Likewise. + * tests/readlink/can-m: Likewise. + * tests/readlink/rl-1: Likewise. + * tests/rm/cycle: Likewise. + * tests/rm/dangling-symlink: Likewise. + * tests/rm/deep-1: Likewise. + * tests/rm/dir-no-w: Likewise. + * tests/rm/dir-nonrecur: Likewise. + * tests/rm/dot-rel: Likewise. + * tests/rm/empty-inacc: Likewise. + * tests/rm/f-1: Likewise. + * tests/rm/fail-2eperm: Likewise. + * tests/rm/hash: Likewise. + * tests/rm/i-1: Likewise. + * tests/rm/i-no-r: Likewise. + * tests/rm/ignorable: Likewise. + * tests/rm/inaccessible: Likewise. + * tests/rm/interactive-always: Likewise. + * tests/rm/interactive-once: Likewise. + * tests/rm/ir-1: Likewise. + * tests/rm/isatty: Likewise. + * tests/rm/no-give-up: Likewise. + * tests/rm/r-1: Likewise. + * tests/rm/r-2: Likewise. + * tests/rm/r-3: Likewise. + * tests/rm/r-4: Likewise. + * tests/rm/readdir-bug: Likewise. + * tests/rm/rm1: Likewise. + * tests/rm/rm2: Likewise. + * tests/rm/rm3: Likewise. + * tests/rm/rm4: Likewise. + * tests/rm/rm5: Likewise. + * tests/rm/sunos-1: Likewise. + * tests/rm/unread2: Likewise. + * tests/rm/unread3: Likewise. + * tests/rmdir/fail-perm: Likewise. + * tests/rmdir/t-slash: Likewise. + * tests/shred/exact: Likewise. + * tests/shred/remove: Likewise. + * tests/sum/sysv: Likewise. + * tests/tail-2/append-only: Likewise. + * tests/tail-2/assert: Likewise. + * tests/tail-2/assert-2: Likewise. + * tests/tail-2/big-4gb: Likewise. + * tests/tail-2/fflush: Likewise. + * tests/tail-2/infloop-1: Likewise. + * tests/tail-2/proc-ksyms: Likewise. + * tests/tail-2/start-middle: Likewise. + * tests/tail-2/tail-n0f: Likewise. + * tests/tee/basic: Likewise. + * tests/tee/dash: Likewise. + * tests/touch/fail-diag: Likewise. + * tests/touch/no-create-missing: Likewise. + * tests/touch/not-owner: Likewise. + * tests/touch/obsolescent: Likewise. + * tests/touch/read-only: Likewise. + * tests/touch/relative: Likewise. + +2006-10-21 Jim Meyering + + * NEWS: (cp --backup fix): Fix a typo. + + * .gitignore: Remove some references to files in subdirectories. + * build-aux/.gitignore, doc/.gitignore, lib/.gitignore: New files. + * m4/.gitignore, po/.gitignore, src/.gitignore: Likewise. + + * src/copy.c (copy_internal): Add a comment saying why we prefer + mknod over mkfifo. + + Enable an fts optimization (call lstat only for directories, + on some file system types) also with the --preserve-root option + of chown or chgrp. + * src/chown-core.c (change_file_owner): Compare fts_statp-based + dev/ino against root dev/ino only for directories. + (chown_files): Don't let the root_dev_ino setting influence whether + we use FTS_NOSTAT: fts always sets *fts_statp for a directory. + +2006-10-20 Jim Meyering + + * src/od.c (usage): Change description of default to use "-w16", + not the now-invalid "-w 16" syntax. From Dan Jacobson. + +2006-10-19 Jim Meyering + + * bootstrap: Add names to each .gitignore file (if it exists) + as well as to .cvsignore. + + * Makefile.maint (po-check): This rule didn't detect the new use + of "gettext" (as opposed to the use of "_" everywhere else) in + lib/xstrtol.h. Adjust the grep regexp so that now it does. + +2006-10-18 Paul Eggert + + * src/copy.c (copy_reg): Rewrite slightly to avoid duplicate code + when opening dst_name. + (copy_reg, copy_internal): Use (SYSCALL != 0) rather than plain + (SYSCALL) to test for failure in a system call. + + * src/copy.c (copy_internal): Use mknod rather than mkfifo to copy + a fifo. This preserves the special mode bits on Solaris 10, which + is compatible with what Solaris 10 cp -R does. + + * src/copy.c (copy_internal): Remove redundant and confusing local + variable src_type. + + * src/copy.c (copy_internal): Don't pass mkdir a mode greater than + 7777. This matches historical 'cp' behavior and avoids some + (though not all) implementation-defined behavior of mkdir. + * src/cp.c (make_dir_parents_private): Likewise. + * src/copy.c (copy_internal): Don't pass 'open' a mode greater + than 777. This is required by POSIX. It doesn't make any difference + in actual behavior on any host that I know of. + +2006-10-17 Jim Meyering + + * src/dd.c (usage): Use two spaces (not one) to separate the + "fdatasync" option string from its description, so help2man formats + the derived man page properly. Reported by Samuel Thibault + in . + +2006-10-16 Jim Meyering + + * .x-sc_trailing_blank: Remove names of files that are no longer + version-controlled. + +2006-10-16 Paul Eggert + + * src/groups.sh (version): Reword message to match the other programs. + Problem reported by Eric Blake. + +2006-10-14 Jim Meyering + + * Makefile.maint (headers_with_interesting_macro_defs): Define. + (.re-defmac, sc_always_defined_macros): New rules. + + * src/system.h (EXIT_FAILURE, EXIT_SUCCESS): Remove definitions. + Instead, include "exit.h". This hereby retires the work-around for + "Sony NEWS-OS Release 4.0C"'s bug due to "#define EXIT_FAILURE 0". + + * src/cksum.c (uint_fast32_t): Don't define. + Instead, include . + + * src/pinky.c (S_IWGRP): Don't define. + It's already defined by "stat-macros.h" (included via system.h). + + * Makefile.cfg: Remove cruft that's now handled via bootstrap. + * Makefile.maint: Likewise, remove these targets/rules/variables: + (local_updates, update, cvs-update, wget_files, get-targets): Remove. + (cvs_files, wget-update, automake_repo): Likewise. + Move the comment about cvsu to build-aux/vc-list-files, + where cvsu is actually used. + + * Makefile.maint (cvs-update): Use $(CVS), not "cvs". + + Work also when the working directory (with e.g. coreutils sources) + is version controlled with git, rather than CVS. + * bootstrap (CVS_only_file): Test for the existence of README-cvs, + rather than CVS. + In messages and comments, say e.g., "checked-out sources", + rather than "CVS sources". + (version_controlled_file): New function. Work for git as well as + for CVS. Don't use grep's -q option. + (slurp): Call it here, in place of CVS-specific code. + + * NEWS: cp -r --backup dir1 dir2, would rename an existing dir1/dir2 + to dir1/dir2~. + * src/copy.c (copy_internal): Although we do create a backup of each + destination directory when in move mode, don't do that when copying. + Reported by Peter Breitenlohner, in + . + * tests/cp/backup-dir: New file. Test for the above. + * tests/cp/Makefile.am (TESTS): Add backup-dir. + +2006-10-13 Jim Meyering + + More chown/chgrp dereferencing-related fixes. + * src/chown-core.c (change_file_owner): Don't use fts_statp if + we're dereferencing symlinks. + Reverse conjuncts, so that we use dereference file_stats + (aka ent->fts_statp) only *after* we've confirmed that + chopt->affect_symlink_referent is true. Otherwise, we might + use ent->fts_statp uninitialized. + Don't turn on FTS_NOSTAT when dereferencing symlinks. + * tests/chown/deref: Update the expected diagnostic, now that + this test case (trying to use "chown --dereference ..." on a + dangling symlink) takes a different code path. + +2006-10-13 Paul Eggert + + Sync from Bison, as follows: + + 2006-10-01 Paul Eggert + + Fix problems with translating English-language diagnostics. + * bootstrap: Fix bug introduced in recent bootstrap changes, with + respect to bison-runtime pot generation. The YY_ stuff + wasn't being captured. + +2006-10-13 Jim Meyering + + * src/chown-core.c (change_file_owner): Use fstatat, not stat, + now that we're using fts_open with FTS_CWDFD. + * tests/chgrp/posix-H: Add --preserve-root to an invocation of + chgrp, to exercise the above fix. + * NEWS: Mention the above. + + * src/du-tests: Clean up a little, though it's still not portable. + + * .vg-suppressions: Add 3 more for debian unstable. + + * tests/ls/Test.pm: Remove long-unused file. + * Makefile.am (EXTRA_DIST): Add bootstrap.conf. + Suggestions from Bruno Haible. + +2006-10-12 Ralf Wildenhues + + * Makefile.am (THANKS-to-translators): Add missing $(srcdir). + (MAINTAINERCLEANFILES): Add .kludge-stamp. + * man/Makefile.am (MAINTAINERCLEANFILES): Typo $(dist_man_MANS) + instead of $(man_MANS). + +2006-10-12 Ralf Wildenhues + + * configure.ac: Avoid compiler warnings about default return + type in function definitions and unused variables in tests. + * src/who.c (print_user) [HAVE_UT_HOST]: hostlen is only needed + if this is #defined. + +2006-10-12 Jim Meyering + + * configure.ac: Reflect s/gl_MACROS/coreutils_MACROS/ renaming. + Call gl_INIT directly, rather than through the above. + +2006-10-11 Paul Eggert + + * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell + variable was sometimes used without being initialized. This + messed up the installation of the INSTALL file in some cases. + +2006-10-11 Jim Meyering + + * src/ls.c (usage): Correct description of -s, --size. + It works even without -l. Suggestion from Karl Berry. + +2006-10-10 Paul Eggert + + * src/ls.c (quote_name): Use initializer rather than memset to + initialize an object to zero. This is easier to read and is less + likely to introduce a runtime error due to a mixup. It causes + gcc -W to issue a warning, but you can work around this by + appending -Wno-missing-field-initializers. + * src/pathchk.c (portable_chars_only): Likewise. + * src/shred.c (main): Likewise. + * src/stty.c (main): Likewise. + * src/tr.c (card_of_complement): Likewise. + * src/wc.c (wc): Likewise. + +2006-10-09 Paul Eggert + + * src/sort.c (usage): Mention again that sort fields are origin 1. + + * NEWS: Fix typo: iso-8602 -> iso-8601. Problem reported by + Bob Proulx. + + * bootstrap (usage, main program, symlink_to_gnulib): Add option + --copy. Inspired by a suggestion from Bruno Haible. + +2006-10-09 Jim Meyering + + Avoid a compiler warning. + * src/pathchk.c (portable_chars_only): Initialize variable of type + mbstate_t via memset, rather than via '{0}'. Patch from Bruno Haible. + +2006-10-06 Paul Eggert + + Fix bug reported today by Mike Frysinger: mkdir -pv is logging the + wrong file name in some cases. Lars Wendler reported a bug in + my original fix. + * src/install.c (make_ancestor): New arg COMPONENT. + * src/mkdir.c (make_ancestor): Likewise. + * tests/install/basic-1: Check for install -Dv bug. + * tests/mkdir/Makefile.am (TESTS): Add p-v. + * tests/mkdir/p-v: New file, to test this bug. + +2006-10-05 Paul Eggert + + * src/chgrp.c: Don't include lchown.h; no longer needed. + * src/chown.c: Likewise. + + * tests/ls/stat-dtype: Use a dynamic test to decide whether the + current file system has useful d_type info. + + * src/dd.c (flags): noatime and nofollow now depend on + HAVE_WORKING_O_NOATIME and HAVE_WORKING_O_NOFOLLOW, too. + (usage): Output info about noatime and nofollow only if + they are known to work. + * src/remove.c (AD_push): Inspect HAVE_WORKING_O_NOFOLLOW rather + than O_NOFOLLOW, when testing whether it's possible to avoid a + race condition reliably. + +2006-10-05 Jim Meyering + + * src/c99-to-c89.diff: Update to reflect new offsets. + + * tests/install/basic-1: Skip the latter part of this test if the + just-built dd binary is not readable. Otherwise, this test would fail + when binaries were created as root. Reported by Bauke Jan Douma in + . + +2006-10-03 Paul Eggert + + * src/system.h (ST_BLKSIZE): Ceiling at SIZE_MAX / 8 + 1, not at 4 + MiB, since XFS hosts can legitimately have large values of + st_blksize. Problem reported by Tony Ernst in + . + +2006-10-04 Jim Meyering + + * src/remove.c (nonexistent_file_errno): Remove ENAMETOOLONG. + Paul Eggert pointed out that the specified file may exist, + in spite of such an errno value. + * tests/rm/Makefile.am (TESTS): Remove ignore-name-too-long. + * tests/rm/ignore-name-too-long: Remove file. + * NEWS: Update here, too. + +2006-10-03 Jim Meyering + + * tests/rm/fail-eperm: Report failure also if rm is terminated by + a signal. + + * src/c99-to-c89.diff: Convert two c99'isms -- one in remove.c + and one in shred.c -- that were added before coreutils-6.3. + Reported by Michael Deutschmann. + + * src/c99-to-c89.diff: Update to reflect new offsets. + + * src/remove.c (remove_entry): With -f, exit successfully in spite + of a missing file under some very unusual conditions (with errno + being any of ENOENT, ENOTDIR, ENAMETOOLONG). + + With --force (-f), rm no longer fails for ENOTDIR. + * src/remove.c (ignorable_missing): New function. + Use it everywhere, rather than open-coding the test. + Andreas Schwab reported the ENOTDIR problem. + (ignorable_missing): Similarly, don't fail for ENAMETOOLONG. + + * NEWS: Mention the bug fix. + * tests/rm/ignorable: New file. Test for the ENOTDIR case. + * tests/rm/ignore-name-too-long: New file. Test for ENAMETOOLONG. + * tests/rm/Makefile.am (TESTS): Add the new file names. + + * bootstrap: Undo last change to this file, since now gnulib-tool + sticks with the automake default in generating dependencies. + + * NEWS: Add a line for 6.4-cvs. + * configure.ac (AC_INIT): Bump to 6.4 and add "-cvs" suffix. + +2006-09-30 Jim Meyering + + Version 6.3. + * NEWS: Record the 6.3 release date. + * configure.ac (AC_INIT): Remove "-cvs" suffix from version string. + + * NEWS: Mention Paul's Solaris 8 vs. 10 work-around. + + * src/c99-to-c89.diff: Update offsets. + +2006-09-29 Paul Eggert + + * tests/rm/readdir-bug: Don't use $(...) in a shell script, + as it doesn't work with Solaris /bin/sh. + +2006-09-29 Jim Meyering + + * NEWS: Mention Paul's fix (to gnulib's canon-host.c) for + the pinky segfault. + + * tests/seq/basic [neg-2, eq-wid-2]: Comment out tests that + use .1 as the increment. Actual output varies too much. + [eq-wid-3]: New, commented out test. + + * src/shuf.c (read_input): Fix an off-by-one error that + would cause an infloop for piped input of 8KB or more. + * NEWS: Mention the fix. + * tests/misc/shuf: Test for the above fix. + + Since any system may be affected by the Darwin readdir bug, + perform the extra rewinddir unconditionally. The performance + impact of rewinding a directory is negligible. + * src/remove.c (NEED_REWIND): Define to use + CONSECUTIVE_READDIR_UNLINK_THRESHOLD unconditionally. + + * tests/seq/basic: Use .11 as the upper bound, in case the ".1" + increment translates to a slightly larger value. + This corrects a test failure on FreeBSD 6.1 reported by Nelson Beebe. + The final expected value wasn't being printed. + + Work around a readdir bug in Darwin 7.9.0 (MacOS X 10.3.9) on HFS+ + and NFS, whereby rm would not remove all files in a directory. + * src/remove.c (CONSECUTIVE_READDIR_UNLINK_THRESHOLD): Reduce to 10. + (NEED_REWIND): New macro, so that we incur the cost of the work-around + rewinddir only on afflicted systems. + * NEWS: Clarify and correct. + * tests/rm/readdir-bug: New file. Test for the above fix. + * tests/rm/Makefile.am (TESTS): Add it. + Prompted by testing and analysis from Bruno Haible: + http://lists.gnu.org/archive/html/bug-coreutils/2006-09/msg00326.html + +2006-09-28 Paul Eggert + + * tests/rm/fail-eperm: Unset BASH_ENV, CDPATH, and ENV, too; + suggested for Debian stable, which uses Perl 5.8.4. + +2006-09-28 Jim Meyering + + Automatically generated dependencies are important even + when all of the sources in a directory come from gnulib. + * bootstrap (gnulib_tool): Remove the "no-dependencies" automake + option that gnulib-tool adds to what becomes our lib/gnulib.mk. + + * tests/rm/fail-eperm: Enable Perl's (-T) taint checking. + Ensure that IFS is set properly and unset PATH. + Sanitize inputs. + Work properly even when the name of the selected file starts with "-". + Invoke rm via "../../src/rm", and adjust expected output. + Prompted by a patch from Tim Waugh. + + * README-cvs: Add Bison to the list of required packages. + +2006-09-26 Jim Meyering + + * src/c99-to-c89.diff: Update offsets. + + * NEWS: rm works around a bug in Darwin 8.6.1 w/NFS that kept + it from removing a directory containing 188 or more entries. + * src/remove.c (CONSECUTIVE_READDIR_UNLINK_THRESHOLD): Decrease by + 20, go work around the buggy readdir on Darwin 8.6.1 with NFS. + Reported by Matthew Woehlke. + +2006-09-26 Paul Eggert + + * NEWS: "groups user" no longer outputs "user :"; you need at least + two users. "groups" now processes options like --help more compatibly. + * src/groups.sh: Implement the option-processing change. + Handle user and group names with special characters more robustly. + Report write errors instead of exiting silently with status 1. + +2006-09-26 Jim Meyering + + * README: Warn not to run autoreconf manually. Use bootstrap instead. + + * src/groups.sh: When invoked with 0 or 1 argument, just exec "id". + Rewrite to avoid using temporary, $status. + + * NEWS: Mention the bug fix. + * src/groups.sh: Don't hide a write failure. + Reported by Iain Calder . + +2006-09-25 Jim Meyering + + * src/chown.c (usage): Clarify --dereference description. + * src/chgrp.c (usage): Likewise. Suggestion from Jamie McClelland. + +2006-09-24 Jim Meyering + + * NEWS: Mention these fixes. + * src/copy.c (copy_reg): With --verbose (-v), print + "removed `file_name'" just after unlinking a file. + (copy_internal): Likewise, in three more places. + Marc Lehman reported that "touch x; ln x y; mv -v x y" was silent. + * tests/mv/hard-verbose: New file. Test for the above fix. + * tests/mv/Makefile.am (TESTS): Add hard-verbose. + + * tests/help-version (sync_args): Don't call sync, since it spins up + disks that I've deliberately caused to spin down (but not unmounted). + + * NEWS: Mention the improvement to sort. + + * tests/tail-2/proc-ksyms: Require that /proc/ksyms be readable + as well as existing. + + * tests/ls/stat-dtype: Don't use tmpfs on linux-2.4 or older, + since that predated addition of d_type support. + +2006-09-23 Jim Meyering + + * gl/modules/getloadavg.diff: New file. Work around the way the latest + version of the getloadavg module interacts with our bootstrap script. + * bootstrap (gnulib_tool_options): Add "--local-dir gl". + * Makefile.am (EXTRA_DIST): Sort file names. + Add bootstrap and gl/modules/getloadavg.diff + +2006-09-20 Paul Eggert + + * bootstrap: Add support for --force. + (usage): New function. Describe usage less tersely. + (CVS_only_file): New var. + + * NEWS: Document fix for cp -i and mv -i. + * src/copy.c (copy_internal): With -i, prompt even if the source + is a directory and the destination is not. This is required by + POSIX and gives the user a chance to bail out before failing. + * tests/cp/Makefile.am (TESTS): Add cp-i. + * tests/cp/cp-i: New file. + * tests/mv/Makefile.am (TESTS): Add i-5. + * tests/mv/i-5: New file. + +2006-09-20 Jim Meyering + + * NEWS: Mention the chmod bug fix. + + * tests/chmod/inaccessible: New test, specifically for this bug. + Based on a test case from Paul Eggert. + * tests/chmod/Makefile.am (TESTS): Add inaccessible. + + Fix the 2006-09-18 bug differently. + * src/chmod.c: (process_file): Upon FTS_NS for a top-level file, + tell fts_read to stat the file again, in case it has become + accessible since the initial fts_open call. + * src/chown-core.c (change_file_owner): Likewise. + + * src/chmod.c: Revert last change. There is a better way. + * src/chown-core.c: Likewise. + +2006-09-19 Paul Eggert + + * src/ln.c (target_directory_operand): Rewrite to avoid porting + problem on Tandem reported by Matthew Woehlke in + . + +2006-09-18 Paul Eggert + + Fix bug where chmod, chown, and chgrp did not process operands + left-to-right in some cases. + * src/chmod.c (wd_errno): New var. + (chmod_file): New function, with most of the contents of the + old prcess_file function. + (process_files): Use it. This gives file names to fts one + at a time, so that they are processed left-to-right as POSIX + requires. + * src/chown-core.c (wd_errno, chown_files): Likewise. + (chown_file): New function. + * tests/install/basic-1: Redo test so as to not workaround + the chmod bug, thereby testing for it. + + * src/shuf.c (main): Quote the entire range when reporting an + invalid one, rather than just the part that contained the error. + + * tests/stty/row-col-1: Rewrite to avoid temporary file that is + sometimes left behind if the test is skipped or interrupted. + + * bootstrap (symlink_to_gnulib): New function. + (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib + to copies-of-gnulib. + (cp_mark_as_generated, slurp, gnulib_files): + Avoid making a copy if it's the same as the old version. + (gnulib_files): Add support for this variable (used by Bison). + + * tests/ls/stat-vs-dirent: Fix quoting problem in diagnostic + indicating flaw in kernel. Reword to say that the flaw isn't + serious for coreutils, since the flaw does affect ls -i. + + * tests/chgrp/basic: Fix bug in test case exposed by building on + Solaris 8 in a setgid directory. The test case incorrectly + assumed that 'symlink' would be in group $g1. + +2006-09-18 Jim Meyering + + * NEWS: Add a line for 6.3-cvs. + * configure.ac (AC_INIT): Bump to 6.3 and add "-cvs" suffix. + + Version 6.2. + * NEWS: Record the 6.2 release date. + * configure.ac (AC_INIT): Remove "-cvs" suffix from version string. + +2006-09-17 Jim Meyering + + * tests/chgrp/basic: On an OpenBSD system, rather than failing + due to a known problem, merely warn about it. + Rewrite to avoid testing output of chgrp --verbose and chgrp -c. + Instead, use stat to test file system for desired results, directly. + * tests/chgrp/Makefile.am (TESTS_ENVIRONMENT): Set host_triplet. + + * tests/envvar-check: Add more variable names to the list of those + that can affect these programs and tests: _POSIX2_VERSION, COLUMNS, + QUOTING_STYLE, TABSIZE, TERM, TMPDIR. + +2006-09-16 Paul Eggert + + * NEWS: Document that mkdir -p and install -d now fork on occasion. + * bootstrap.conf (gnulib_modules): Add savewd. + * src/install.c: Include savewd.h. + (process_dir): New function. + (main, install_file_in_file_parents): Use it, along with the new + savewd module, to avoid some race conditions. + * src/mkdir.c: Include savewd.h. + (struct mkdir_options): New members make_ancestor_function, mode, + mode_bits. + (make_ancestor): Return 1 if the resulting directory is not readable. + (process_dir): New function. + (main): Use it, along with new savewd module, to avoid some + race conditions. Fill in new slots of struct mkdir_options, so + that callees get the values. + * tests/install/basic-1: Test for coreutils 5.97 bug that was + fixed in coreutils 6.0, and which should still be fixed with + this change. + * tests/mkdir/p-3: Likewise. + +2006-09-15 Jim Meyering + + * bootstrap.conf (gnulib_modules): Add rename-dest-slash. + The 2006-09-08 changes made it so "mv dir new-name/" would + fail on NetBSD 1.6. This makes it work once again. + +2006-09-14 Jim Meyering + + * src/mv.c (main): Remove unnecessary (always-true) test for 2 <= n. + Instead, since it's a little fragile, assert the condition. + (target_directory_operand): Update comment to reflect latest change. + +2006-09-12 Paul Eggert + + * src/who.c (print_user): Rewrite to avoid warning from + GCC 4.1.1 with -Wall. + +2006-09-12 Jim Meyering + + * tests/mv/atomic: Check for specific strace output, rather than + simply nonempty. RHEL AS 4 would fail this test due to strace + generating "[ Process PID=14434 runs in 32 bit mode. ]". + Reported by Nelson Beebe. + +2006-09-11 Jim Meyering + + * src/remove.c (remove_dir): Move new cache_stat_init call onto + it's own line. + (rm_1): Move declaration of "st" and new cache_stat_init call + "down" to nearer where they're used. + * src/c99-to-c89.diff: Add another set of curly braces. + +2006-09-10 Paul Eggert + + * src/expr.c (eval6): Fix buffer overrun, or bad performance, if + substr's last operand is very large. Performance problem reported + by Sebastian Kreft. + +2006-09-09 Jim Meyering + + * Makefile.maint (sc_prohibit_jm_in_m4): Don't hang when there + are no .m4 files. + (sc_require_config_h): Skip this test if there are no version- + controlled .c files. + (sc_prohibit_assert_without_use): Likewise. + +2006-09-08 Jim Meyering + + * bootstrap: Export CVS_RSH separate from its assignment, to work + even with Solaris 10's /bin/sh. Suggestion from Mark D. Baushke. + +2006-09-08 Paul Eggert + + * NEWS: tail now ignores the -f option if POSIXLY_CORRECT is set, + no file operand is given, and standard input is any FIFO. + This is in response to Open Group XCU ERN 114. + * src/tail.c (main): Likewise. + +2006-09-08 Jim Meyering + + mv and "cp -r" no longer fail when invoked with two arguments + where the first one names a directory and the second name ends in + a slash and doesn't exist. E.g., "mv dir B/", for nonexistent B, + now succeeds, once more. This reverts part of the 2004-06-27 + change for 5.3.0. + * NEWS: Say the above. + * src/mv.c (target_directory_operand): Don't require (here) + that the target operand "look like" a directory. This change + pushes the test down to the rename syscall level, where a + "mv dir existing-non-dir/" will mistakenly succeed on older systems + that ignore trailing slashes in the rename destination argument. + * src/cp.c (target_directory_operand): Likewise, but for cp. + * tests/mv/trailing-slash: Exercise the above fixes. + * tests/cp/trailing-slash: New file. + * tests/cp/Makefile.am (EXTRA_DIST): Add trailing-slash. + + * bootstrap: Use the previously unused variable, $src, + to avoid repeating "$GNULIB_SRCDIR/$file". + + * bootstrap (cp_mark_as_generated): Don't use "local", to + accommodate ancient "/bin/sh". Suggested by Ralf Wildenhues. + Rename now-global "$src" and "$dst" to have cp_ prefix. + Safer, and avoids confusion. + + * bootstrap (cp_mark_as_generated): New function. + (slurp): Use it to prepend editor hints and a warning that + the file we're copying is generated. + Suggestion from Bruce Korb. + (cp_mark_as_generated): Don't add C-style comments for .l or .y files. + Fix last-minute typo. + +2006-09-07 Jim Meyering + + * bootstrap: Revert last change. There are less disruptive ways + to mark these generated files as read-only. + + * src/c99-to-c89.diff: Update to have proper offsets. + +2006-09-06 Jim Meyering + + Ensure that some gnulib-tool-generated files are read-only. + * bootstrap (slurp): Put the body of this function in a sub-shell, + with "umask a-w" so that all new files are read-only. Remove each + file before we write to it, in case it's read-only. + Make po/Makevars and runtime-po/Makevars read-only, too. + +2006-09-05 Jim Meyering + + * tests/cp/acl: Skip this test when cp lacks ACL support. + * tests/cp/Makefile.am (TESTS_ENVIRONMENT): Set $(CONFIG_HEADER). + + * src/c99-to-c89.diff (remove.c): Adapt one hunk to match the new + context from change of 2006-09-02. + +2006-09-04 Jim Meyering + + * README-cvs: Fix typo in update command. + +2006-09-03 Jim Meyering + + * NEWS: Tweak the wording in the new change description so that + no one can think this change causes e.g., `rm -fr foo../' to fail. + + * tests/rm/inaccessible: Adjust for movement of config.h to lib/. + Use $CONFIG_HEADER, rather than hard-coding it. + * tests/rm/Makefile.am (TESTS_ENVIRONMENT): Set $CONFIG_HEADER. + +2006-09-02 Paul Eggert + + * NEWS: rm now rejects attempts to remove /, ./, and ../. + * src/basename.c: Don't include dirname.h, since system.h does it now. + * src/chmod.c: Likewise. + * src/copy.c: Likewise. + * src/cp.c: Likewise. + * src/df.c: Likewise. + * src/dircolors.c: Likewise. + * src/dirname.c: Likewise. + * src/du.c: Likewise. + * src/install.c: Likewise. + * src/ln.c: Likewise. + * src/ls.c: Likewise. + * src/mkdir.c: Likewise. + * src/mv.c: Likewise. + * src/remove.c: Likewise. + * src/rm.c: Likewise. + * src/rmdir.c: Likewise. + * src/shred.c: Likewise. + * src/split.c: Likewise. + * src/su.c: Likewise. + * src/system.h: Include "dirname.h", since dot_or_dotdot needs it + now. + (dot_or_dotdot): Succeed even if "." or ".." is followed by a + slash. + * src/rm.c (usage, main): --preserve-root is now the default. + * src/remove.h: Fix comment. + * src/remove.c (cache_fstatat, cache_stat_init): New functions. + (cache_statted, cache_stat_ok): New functions. + (write_protected_non_symlink): Remove struct stat ** buf_p arg, + which is no longer needed with the new functions. All callers + changed. + (prompt, is_dir_lstat, remove_entry, remove_dir): + New struct stat * arg. All callers changed. + (write_protected_non_symlink, prompt, is_dir_lstat, remove_entry): + (remove_cwd_entries, remove_dir, rm_1): + Use and maintain the file status cache. + (prompt, remove_entry): Omit the first "directory" in the diagnostic + "Cannot remove directory `foo': is a directory". This causes "rm" + to pass a test case that it would otherwise fail now that it + "knows" more about its argument. I think the diagnostic is better + without the first "directory" anyway. + (prompt): Remove the no-longer-needed IS_DIR arg; all callers changed. + (rm_1): Reject attempts to remove /, ./, or ../. + * tests/rm/Makefile.am (TESTS): Add r-4. + * tests/rm/r-4: New file. + +2006-09-01 Paul Eggert + + * src/stat.c: Include + (alignof): New macro. + (HAVE_STRUCT_STATXFS_F_FSID___VAL, HAVE_STRUCT_STATXFS_F_FSID_VAL): + Remove. + (STRUCT_STATXFS_F_FSID_IS_INTEGER): New macro. + (FSID_VAL): Remove. + (print_statfs): If f_fsid isn't an integer, grab its words one + at a time in little-endian order. This is a bit easier to configure + and should avoid a compilation failure on MacOS reported by Bruno + Haible. + +2006-08-29 Paul Eggert + + * src/stat.c (HAVE_STRUCT_STATXFS_F_FSID_VAL, FSID_VAL): New macros, to + work around a Mac OS X porting problem reported by Bruno Haible in + . + (print_statfs): Use them. + + * bootstrap.conf (gnulib_modules): Add isapipe. + * src/tail.c: Include isapipe.h. + (IS_PIPE_LIKE_FILE_TYPE): Remove. + (IS_TAILABLE_FILE_TYPE): Just list both FIFOs and sockets as + tailable, since this seems to be portable. + (main): Use isapipe, to fix a bug on MacOS X reported by Bruno Haible in + . + + * src/system.h (LOCALEDIR): Remove, since configmake.h now defines + it for us. + +2006-08-28 Paul Eggert + + * src/copy.c (copy_internal): Don't test whether macros like + S_ISLNK are defined, since they're always defined now. + * src/cp.c (main): Likewise. + * src/ln.c (main): Likewise. + * src/ls.c (get_link_name, make_link_name): Likewise. + * src/mknod.c (main): Likewise. + * src/mkfifo.c (usage): Likewise. + * src/who.c (S_IWGRP): Likewise. + + Adjust to recent gnulib changes for the gnulib module. + * bootstrap.conf (gnulib_modules): Add fcntl. + * src/system.h (SEEK_SET, SEEK_CUR, SEEK_END): Remove. Other code + is already assuming these macros are defined. + (O_DIRECT, O_DIRECTORY, O_DSYNC, O_NDELAY, O_NOATIME, O_NONBLOCK): + (O_NOCTTY, O_NOFOLLOW, O_NOLINKS, O_RSYNC, O_SYNC, O_BINARY, O_TEXT): + Remove; the fcntl module now handles these. + + Adjust to recent gnulib changes for the inttypes module. + * bootstrap.conf (gnulib_modules): Remove stdint; add inttypes. + (excluded_files): Don't exclude m4/inttypes-h.m4 or m4/inttypes-pri.m4. + + * src/system.h: Don't bother to include , since we can + now assume inttypes.h does the equivalent of including stdint.h. + +2006-08-27 Jim Meyering + + * src/copy.c (copy_internal): Don't make a backup if the last + component of the source name is "." or "..". + Reported by Andreas Schwab in http://savannah.gnu.org/bugs/?17540. + * NEWS: Mention this. + * tests/cp/src-base-dot: New file. Test for the above fix. + * tests/cp/Makefile.am (TESTS): Add src-base-dot. + + * src/system.h (DOT_OR_DOTDOT): Remove macro. Rewrite as a... + (dot_or_dotdot): ...new static inline function. + * src/remove.c (rm_1): Reflect this renaming. + * src/ls.c (basename_is_dot_or_dotdot): Likewise. + + * src/copy.c (copy_internal): Add comments. + +2006-08-26 Paul Eggert + + * src/Makefile.am (AM_CPPFLAGS): Remove -I$(srcdir) and -I../lib, + since Automake supplies them for us. It always did -I$(srcdir), + and with the recent change to AC_CONFIG_HEADERS in configure.ac it + is now also doing -I../lib. + + * bootstrap (get_translations): Skip this if WGET_COMMAND is empty. + Fail if the first "echo" fails. Suppress diagnostics from "ls po/*.po" + since there might not be any .po files. + (WGET_COMMAND): Set to empty if wget doesn't + seem to be available. + +2006-08-26 Jim Meyering + + This test was failing in some environments. + * tests/ls/color-dtype-dir: Don't rely on eval "`dircolors -b`" + to set LS_COLORS in the environment. + * tests/envvar-check: Instead, ensure that LS_COLORS is not set. + Reported by Bob Proulx. + + * src/c99-to-c89.diff: Remove hunk for copy.c; no longer needed. + + * Makefile.am (EXTRA_DIST): Remove these files here, too: + .x-sc_no_if_have_config_h, .x-sc_prohibit_assert_without_use, + .x-sc_two_space_separator_in_usage. + + Fix "mv --verbose --backup" so its output includes the + " (backup: foo.~1~)" suffix also when backing up a directory. + * NEWS: Report this bug fix. + * src/copy.c (emit_verbose): New function, factored out of... + (copy_internal): ...here. Use the new function. + * tests/mv/backup-dir: Test for the above fix. + * tests/mv/Makefile.am (TESTS): Add backup-dir. + +2006-08-25 Paul Eggert + + * .x-sc_no_if_have_config_h: Remove; no longer needed. + * .x-sc_prohibit_assert_without_use: Remove; it was empty. + * .x-sc_two_space_separator_in_usage: Likewise. + * Makefile.maint (sc_no_have_config_h): Renamed from + sc_no_if_have_config_h, since it now checks that HAVE_CONFIG_H + is absent everywhere. + * bootstrap.conf (gnulib_modules): Add config-h. + * src/shred.c: Include unconditionally, since + we now assume config.h exists. + * src/dircolors.c: Likewise. + +2006-08-26 Jim Meyering + + "ls --color" would highlight other-writable and sticky directories + no differently than regular directories on a file system with + dirent.d_type support. + * NEWS: Say the above. + * src/ls.c (gobble_file): With --color, also stat the file when + we know it is a directory. + Derived from an anonymous one-line fix and bug report: + . + * tests/ls/color-dtype-dir: New file. Test for the above fix. + * tests/ls/Makefile.am (TESTS): Add color-dtype-dir. + +2006-08-25 Paul Eggert + + * .cvsignore: Remove stamp-h1. Add coreutils-*, to ignore + tarballs. + * bootstrap.conf: Add configmake, verify. + * src/.cvsignore: Remove localedir.h. + * src/Makefile.am (localedir, DISTCLEANFILES, localedir.h): Remove; + subsumed by configmake. + * src/system.h: Include configmake.h rather than localedir.h + (LOCALEDIR): New macro. + + Rewrite to avoid some unnecessary casts, macros, literals. + * src/shred.c (DEFAULT_PASSES, VERBOSE_UPDATE): Now constants, + not macros. + (SECTOR_SIZE, SECTOR_MASK): New constants. + (fillpattern, dopass, do_wipefd, main): Remove unnecessary casts, + and use the SECTOR_* constants when applicable. Check for size < + 0 rather than size == -1, since negative-size files are a sign of + trouble anyway. + +2006-08-25 Bruno Haible + + * src/shred.c (dopass): Assume a continuable error if EIO even + if the current position is not a multiple of 512. + +2006-08-24 Jim Meyering + + * src/stat.c (print_statfs): Fix typo: remove extra "sizeof". + +2006-08-23 Paul Eggert + + * src/stat.c (HAVE_STRUCT_STATXFS_F_FSID___VAL): Define. This + macro was being used without being defined. + (SB_F_NAMEMAX): Remove cast. + (f_fsid) [BeOS]: Likewise. + (OUT_NAMEMAX): Renamed from NAMEMAX_FORMAT, with a new meaning. + All uses changed. + (out_string, out_int, out_uint, out_uint_o, out_uint_x): New + functions. + (xstrcat): Remove. All uses changed to use the above functions. + (print_statfs, print_stat): 2nd arg is now the prefix len, not the + buffer len. All uses changed. Output '?', not '*', for unknown + data or errors. Do not assume signed values can be interchanged + with unsigned when printing. + (print_statfs): For %i, print the fsid as a single int, not as a + pair. + (print_it): Quote invalid format better. + + * NEWS: printf supports the I flag. + * src/printf.c (print_formatted) [glibc 2.2 or later]: Likewise. + +2006-08-23 Bruno Haible + + * src/stat.c (STRUCT_STATVFS, statfs, f_fsid, f_blocks, f_bfree) [BeOS]: + (f_bavail, f_bsize, STATFS_FRSIZE, f_files, f_ffree) [BeOS]: + (STATXFS_FILE_SYSTEM_TYPE_MEMBER_NAME) [BeOS]: Define. + + * src/ls.c (SA_RESTART): Fallback define. + +2006-08-23 Paul Eggert + + * src/system.h (EDQUOT): Define if not already defined. + Problem reported by Bruno Haible for BeOS. + + * .cvsignore: Remove config.h, config.hin, as they are now + in lib. + * configure.ac (AC_CONFIG_HEADERS): Move config.h and config.hin + to lib. + * src/Makefile.am (AM_CPPFLAGS): Remove '-I..'; no longer needed. + + * bootstrap (slurp): Define gl_LOCK_EARLY instead of gl_LOCK, + to accommodate today's gnulib change. + +2006-08-23 Jim Meyering + + * NEWS: Mention the sweeping infrastructure changes. + +2006-08-22 Paul Eggert + + * bootstrap.conf (gnulib_modules): Add gnupload. + * Makefile.maint (emit_upload_commands): gnupload is now + in build-aux. + * gnupload: Remove from CVS, since it's now a gnulib module. + + * bootstrap (bootstrap_conf_cleanup): Remove. + (excluded_files): New var. + * bootstrap.conf: Likewise. + * bootstrap (slurp): Exclude files early if they're in the + excluded_files list. That way, their names don't get put into + .cvsignore. + + * aclocal.m4, config.hin, configure: + Remove from CVS, since ./bootstrap generates them automatically. + * .cvsignore: Add INSTALL, Makefile.in, aclocal.m4, config.hin, + configure, *.cache, *.lineno, *.log. + Remove more-specific entries. This catches files like configure.lineno. + * man/.cvsignore: Add Makefile.in. + * src/.cvsignore: Add Makefile.in. + Remove .version, dir.c, install, mvdir, stamp-v, vdir.c, version.c. + + * tests/.cvsignore: + * tests/chgrp/.cvsignore: + * tests/chmod/.cvsignore: + * tests/chown/.cvsignore: + * tests/cp/.cvsignore: + * tests/cut/.cvsignore: + * tests/dd/.cvsignore: + * tests/dircolors/.cvsignore: + * tests/du/.cvsignore: + * tests/expr/.cvsignore: + * tests/factor/.cvsignore: + * tests/fmt/.cvsignore: + * tests/head/.cvsignore: + * tests/install/.cvsignore: + * tests/join/.cvsignore: + * tests/ln/.cvsignore: + * tests/ls/.cvsignore: + * tests/ls-2/.cvsignore: + * tests/md5sum/.cvsignore: + * tests/misc/.cvsignore: + * tests/mkdir/.cvsignore: + * tests/mv/.cvsignore: + * tests/od/.cvsignore: + * tests/pr/.cvsignore: + * tests/readlink/.cvsignore: + * tests/rm/.cvsignore: + * tests/rmdir/.cvsignore: + * tests/seq/.cvsignore: + * tests/sha1sum/.cvsignore: + * tests/shred/.cvsignore: + * tests/sort/.cvsignore: + * tests/stty/.cvsignore: + * tests/sum/.cvsignore: + * tests/tac/.cvsignore: + * tests/tail/.cvsignore: + * tests/tail-2/.cvsignore: + * tests/tee/.cvsignore: + * tests/test/.cvsignore: + * tests/touch/.cvsignore: + * tests/tr/.cvsignore: + * tests/tsort/.cvsignore: + * tests/unexpand/.cvsignore: + * tests/uniq/.cvsignore: + * tests/wc/.cvsignore: + Add Makefile.in. Sort entries if necessary. Remove *.I, *.E, + *.X, *.O, *-tests, build-script, mk-script if they're never + created in this directory. + +2006-08-22 Bruno Haible + + BeOS portability. + * src/uptime.c: Include OS.h if it exists. + (print_uptime): On BeOS, use the get_system_info function (actually a + macro). Loop through utmp entries only if utmp.h or utmpx.h exists. + (uptime): Call read_utmp only if utmp.h or utmpx.h exists. + +2006-08-22 Jim Meyering + + * .cvsignore: Add ABOUT-NLS. + + Move the check-AUTHORS rule to be run as part of "make distcheck", + rather than "make check". + * src/Makefile.am (check): Don't depend on check-AUTHORS; it would + cause "make check" to fail on systems unable to build all binaries. + * Makefile.maint (check-AUTHORS): New rule. + (local-checks-available): Add it here. + Reported by Bruno Haible. Needed for BeOS. + +2006-08-21 Paul Eggert + + * src/df.c (print_header, show_dev): Use a column width that + depends on the block size of -P is specified and not autoscaling. + Problem reported by Gustavo G. Rondina in: + http://lists.gnu.org/archive/html/bug-coreutils/2006-08/msg00164.html + +2006-08-21 Jim Meyering + + * tests/dircolors/simple (a): Don't fail with an unexpected diagnostic + when the shell variable, SHELL, is not set. + Trigger the failure with "(unset SHELL; make check TESTS=simple)". + Reported by Sven Joachim in . + + * src/od.c: Now that HAVE_UNSIGNED_LONG_LONG is no longer defined + in config.h, change the uses to HAVE_UNSIGNED_LONG_LONG_INT. + Otherwise, on a system with 4-byte longs, "od -t u8" fails with this: + od: invalid type string `u8'; + this system doesn't provide a 8-byte integral type + FIXME: add a test for this, but skip it when sizeof uintmax < 8. + +2006-08-20 Paul Eggert + + Add a bootstrap procedure, so that the CVS version contains fewer + files and we bootstrap the rest from gnulib, gettext, etc. + * README-cvs: New file. + * bootstrap: New file. + * bootstrap.conf: New file. + * .x-sc_trailing_blank: Remove config-log, .gdb-history. Add .po. + * configure.ac (AC_PREREQ): Move here from m4/*.m4, for benefit + of gnulib-tool. + (gl_DEFAULT_POSIX2_VERSION, gl_USE_SYSTEM_EXTENSIONS, gl_PERL): + (gl_IGNORE_UNUSED_LIBRARIES): Remove; now done by gnulib. + (gl_EARLY): Add. + (gl_MACROS): Call just after gl_EARLY, just for clarity. + * src/c99-to-c89.diff: Remove patch to ls.c; no longer needed. + * src/kill.c (strtoimax): Remove decl. + * src/ls.c: Include "wcwidth.h" instead of rolling it ourselves. + * src/wc.c: Likewise. + * src/ls.c (sort_files): Rewrite to avoid need for C99-style + declaration, so that we don't need to patch this file. + * src/printf.c (strtoimax, strtoumax): Remove decls. + * src/su.c: Include getpass.h. + (getpass): remove. + * src/system.h: Include mempcpy.h, stpcpy.h, strpbrk.h. + Include inttypes.h unconditionally. + (LONGEST_MODIFIER, PRIdMAX, PRIoMAX, PRIuMAX, PRIxMAX): Remove. + (stpcpy, strndup, strstr, strtoul, mempcpy, CHAR_MIN, CHAR_MAX): + (SCHAR_MIN, SCHAR_MAX, UCHAR_MAX, SHRT_MIN, SHRT_MAX, INT_MAX): + (INT_MIN, INTMAX_MAX, INTMAX_MIN, UINT_MAX, LONG_MAX, ULONG_MAX): + (SIZE_MAX, SSIZE_MAX, UINTMAX_MAX): Remove. + + * ABOUT-NLS, INSTALL, Makefile.in, man/Makefile.in: + * src/Makefile.in, tests/Makefile.in, tests/chgrp/Makefile.in: + * tests/chmod/Makefile.in, tests/chown/Makefile.in: + * tests/cp/Makefile.in, tests/cut/Makefile.in: + * tests/dd/Makefile.in, tests/dircolors/Makefile.in: + * tests/du/Makefile.in, tests/expr/Makefile.in: + * tests/factor/Makefile.in, tests/fmt/Makefile.in: + * tests/general/Makefile.in, tests/head/Makefile.in: + * tests/install/Makefile.in, tests/join/Makefile.in: + * tests/ln/Makefile.in, tests/ls/Makefile.in: + * tests/ls-2/Makefile.in, tests/md5sum/Makefile.in: + * tests/misc/Makefile.in, tests/mkdir/Makefile.in: + * tests/mv/Makefile.in, tests/od/Makefile.in: + * tests/pr/Makefile.in, tests/readlink/Makefile.in: + * tests/rm/Makefile.in, tests/rmdir/Makefile.in: + * tests/seq/Makefile.in, tests/sha1sum/Makefile.in: + * tests/shred/Makefile.in, tests/sort/Makefile.in: + * tests/stty/Makefile.in, tests/sum/Makefile.in: + * tests/tac/Makefile.in, tests/tail/Makefile.in: + * tests/tail-2/Makefile.in, tests/tee/Makefile.in: + * tests/test/Makefile.in, tests/touch/Makefile.in: + * tests/tr/Makefile.in, tests/tsort/Makefile.in: + * tests/unexpand/Makefile.in, tests/uniq/Makefile.in: + * tests/wc/Makefile.in: + Remove from CVS, since ./bootstrap generates them automatically. + +2006-08-20 Eric Blake + + * src/stat.c (USE_STATVFS): Reinstate the patch from 2006-08-15; + the patch from 2006-08-18 broke on cygwin. + +2006-08-20 Jim Meyering + + * NEWS: Add a line for 6.2-cvs. + * configure.ac (AC_INIT): Bump to 6.2 and add "-cvs" suffix. + +2006-08-19 Jim Meyering + + * Version 6.1. + * NEWS: Record the 6.1 release date. + * configure.ac (AC_INIT): Remove "-cvs" suffix from version string. + + * tests/Makefile.am (EXTRA_DIST): Add sparse-file. + + Avoid test failure when `make check' is run through debuild. + * tests/help-version: Ensure that $SHELL is set to some value + and exported. Patch from Sven Joachim. For details, see + . + + * tests/ls/stat-dtype: Test for the 2006-08-17 `ls -CF' fix. + + * README: Describe potential "pre-C99 build failure", and work-around. + + Some of my 2006-07-03 changes to tests/*/Makefile.am were being + backed out due to updates provoked by the copyright changes. + * tests/Makefile.am.in (PATH): Prepend $(VG_PATH_PREFIX), so that + it propagates to the derived Makefile.am files. + ($(srcdir)/Makefile.am): Mark generated .am files as read-only, + so we don't mistakenly edit them again. + * tests/cut/Makefile.am: Regenerate. + * tests/head/Makefile.am: Likewise. + * tests/join/Makefile.am: Likewise. + * tests/pr/Makefile.am: Likewise. + * tests/sort/Makefile.am: Likewise. + * tests/tac/Makefile.am: Likewise. + * tests/tail/Makefile.am: Likewise. + * tests/test/Makefile.am: Likewise. + * tests/tr/Makefile.am: Likewise. + * tests/uniq/Makefile.am: Likewise. + * tests/wc/Makefile.am: Likewise. + + * NEWS: Fix cp --sparse so that it preserves tail-end sparseness, even + when the file's apparent size is not a multiple of its block size. + * src/copy.c (copy_reg): Don't write a NUL before calling ftruncate. + For some file sizes, writing that single byte would unnecessarily + waste a few file blocks. That write may have been necessary in the + early days of Linux, but now, removing it should be safe. + Based on a patch by Alan Curry: + * tests/cp/sparse: New test for the above. + * tests/cp/Makefile.am (TESTS): Add sparse. + + * tests/sparse-file: New file, essence factored out of... + * tests/du/8gb: ... here. Use the new script. + +2006-08-18 Paul Eggert + + * src/system.h (select_plural): Reduce by 1000000, not 1000, since + the CVS gettext manual now suggests 1000000. + +2006-08-18 Bruno Haible + + Add support for NetBSD 3.0. + * src/stat.c (USE_STATVFS): Set to 1 if 'struct statvfs' has a field + f_fstypename. + (STATXFS_FILE_SYSTEM_TYPE_MEMBER_NAME): Define also if 'struct statvfs' + has a field f_fstypename. + This undoes the 2006-08-15 to src/stat.c. + +2006-08-17 Paul Eggert + + Copyright notice fixes. + + * COPYING: Upgrade to latest version from FSF. + + * src/uname.c: Use (C) in copyright notice. + + * .vg-suppressions: Add copyright notice. + * ChangeLog: Likewise. + * ChangeLog-2005: Likewise. + * Makefile.am: Likewise. + * NEWS: Likewise. + * README: Likewise. + * README-valgrind: Likewise. + * TODO: Likewise. + * announce-gen: Likewise. + * man/Makefile.am: Likewise. + * man/chmod.x: Likewise. + * man/chown.x: Likewise. + * man/df.x: Likewise. + * man/du.x: Likewise. + * man/rm.x: Likewise. + * src/dircolors.hin: Likewise. + * src/du-tests: Likewise. + * src/extract-magic: Likewise. + * src/tac-pipe.c: Likewise. + * src/wheel-gen.pl: Likewise. + * tests/Coreutils.pm: Likewise. + * tests/Makefile.am.in: Likewise. + * tests/acl: Likewise. + * tests/envvar-check: Likewise. + * tests/expensive: Likewise. + * tests/group-names: Likewise. + * tests/help-version: Likewise. + * tests/mk-script: Likewise. + * tests/priv-check: Likewise. + * tests/rwx-to-mode: Likewise. + * tests/sample-test: Likewise. + * tests/setgid-check: Likewise. + * tests/chgrp/basic: Likewise. + * tests/chgrp/deref: Likewise. + * tests/chgrp/no-x: Likewise. + * tests/chgrp/posix-H: Likewise. + * tests/chgrp/recurse: Likewise. + * tests/chmod/c-option: Likewise. + * tests/chmod/equal-x: Likewise. + * tests/chmod/equals: Likewise. + * tests/chmod/no-x: Likewise. + * tests/chmod/octal: Likewise. + * tests/chmod/setgid: Likewise. + * tests/chmod/umask-x: Likewise. + * tests/chmod/usage: Likewise. + * tests/chown/basic: Likewise. + * tests/chown/deref: Likewise. + * tests/chown/separator: Likewise. + * tests/cp/Makefile.am: Likewise. + * tests/cp/acl: Likewise. + * tests/cp/backup-1: Likewise. + * tests/cp/backup-is-src: Likewise. + * tests/cp/cp-HL: Likewise. + * tests/cp/cp-deref: Likewise. + * tests/cp/cp-mv-backup: Likewise. + * tests/cp/cp-parents: Likewise. + * tests/cp/deref-slink: Likewise. + * tests/cp/dir-rm-dest: Likewise. + * tests/cp/dir-slash: Likewise. + * tests/cp/dir-vs-file: Likewise. + * tests/cp/fail-perm: Likewise. + * tests/cp/into-self: Likewise. + * tests/cp/link: Likewise. + * tests/cp/link-no-deref: Likewise. + * tests/cp/link-preserve: Likewise. + * tests/cp/no-deref-link1: Likewise. + * tests/cp/no-deref-link2: Likewise. + * tests/cp/no-deref-link3: Likewise. + * tests/cp/perm: Likewise. + * tests/cp/preserve-2: Likewise. + * tests/cp/r-vs-symlink: Likewise. + * tests/cp/same-file: Likewise. + * tests/cp/slink-2-slink: Likewise. + * tests/cp/special-bits: Likewise. + * tests/cp/symlink-slash: Likewise. + * tests/cut/Makefile.am: Likewise. + * tests/cut/Test.pm: Likewise. + * tests/dd/misc: Likewise. + * tests/dd/not-rewound: Likewise. + * tests/dd/skip-seek: Likewise. + * tests/dd/skip-seek2: Likewise. + * tests/dd/unblock-sync: Likewise. + * tests/dircolors/simple: Likewise. + * tests/du/2g: Likewise. + * tests/du/8gb: Likewise. + * tests/du/Makefile.am: Likewise. + * tests/du/basic: Likewise. + * tests/du/deref: Likewise. + * tests/du/deref-args: Likewise. + * tests/du/exclude: Likewise. + * tests/du/fd-leak: Likewise. + * tests/du/files0-from: Likewise. + * tests/du/hard-link: Likewise. + * tests/du/inaccessible-cwd: Likewise. + * tests/du/long-from-unreadable: Likewise. + * tests/du/long-sloop: Likewise. + * tests/du/no-deref: Likewise. + * tests/du/no-x: Likewise. + * tests/du/restore-wd: Likewise. + * tests/du/slash: Likewise. + * tests/du/slink: Likewise. + * tests/du/trailing-slash: Likewise. + * tests/du/two-args: Likewise. + * tests/expr/basic: Likewise. + * tests/factor/basic: Likewise. + * tests/fmt/basic: Likewise. + * tests/fmt/long-line: Likewise. + * tests/general/Makefile.am: Likewise. + * tests/general/atgeneral.m4: Likewise. + * tests/general/dd.at: Likewise. + * tests/head/Makefile.am: Likewise. + * tests/head/Test.pm: Likewise. + * tests/install/basic-1: Likewise. + * tests/install/create-leading: Likewise. + * tests/install/d-slashdot: Likewise. + * tests/install/trap: Likewise. + * tests/join/Makefile.am: Likewise. + * tests/join/Test.pm: Likewise. + * tests/ln/backup-1: Likewise. + * tests/ln/misc: Likewise. + * tests/ln/sf-1: Likewise. + * tests/ln/target-1: Likewise. + * tests/ls/Makefile.am: Likewise. + * tests/ls/Test.pm: Likewise. + * tests/ls/dangle: Likewise. + * tests/ls/dired: Likewise. + * tests/ls/file-type: Likewise. + * tests/ls/follow-slink: Likewise. + * tests/ls/infloop: Likewise. + * tests/ls/inode: Likewise. + * tests/ls/m-option: Likewise. + * tests/ls/no-arg: Likewise. + * tests/ls/recursive: Likewise. + * tests/ls/rt-1: Likewise. + * tests/ls/stat-dtype: Likewise. + * tests/ls/stat-failed: Likewise. + * tests/ls/stat-vs-dirent: Likewise. + * tests/ls/symlink-slash: Likewise. + * tests/ls/time-1: Likewise. + * tests/ls-2/tests: Likewise. + * tests/md5sum/basic-1: Likewise. + * tests/md5sum/newline-1: Likewise. + * tests/misc/Makefile.am: Likewise. + * tests/misc/base64: Likewise. + * tests/misc/basename: Likewise. + * tests/misc/cat-proc: Likewise. + * tests/misc/close-stdout: Likewise. + * tests/misc/csplit: Likewise. + * tests/misc/date: Likewise. + * tests/misc/date-sec: Likewise. + * tests/misc/df: Likewise. + * tests/misc/dirname: Likewise. + * tests/misc/expand: Likewise. + * tests/misc/false-status: Likewise. + * tests/misc/fold: Likewise. + * tests/misc/head-c: Likewise. + * tests/misc/head-elide-tail: Likewise. + * tests/misc/head-pos: Likewise. + * tests/misc/mknod: Likewise. + * tests/misc/nice: Likewise. + * tests/misc/nl: Likewise. + * tests/misc/nohup: Likewise. + * tests/misc/paste-no-nl: Likewise. + * tests/misc/pathchk1: Likewise. + * tests/misc/printf: Likewise. + * tests/misc/printf-hex: Likewise. + * tests/misc/pwd-long: Likewise. + * tests/misc/sha224sum: Likewise. + * tests/misc/sha256sum: Likewise. + * tests/misc/sha384sum: Likewise. + * tests/misc/sha512sum: Likewise. + * tests/misc/shuf: Likewise. + * tests/misc/sort-merge: Likewise. + * tests/misc/sort-rand: Likewise. + * tests/misc/split-a: Likewise. + * tests/misc/split-fail: Likewise. + * tests/misc/split-l: Likewise. + * tests/misc/stat-fmt: Likewise. + * tests/misc/stat-printf: Likewise. + * tests/misc/tac-continue: Likewise. + * tests/misc/test-diag: Likewise. + * tests/misc/tty-eof: Likewise. + * tests/misc/wc-files0: Likewise. + * tests/misc/wc-files0-from: Likewise. + * tests/mkdir/concurrent-1: Likewise. + * tests/mkdir/p-1: Likewise. + * tests/mkdir/p-2: Likewise. + * tests/mkdir/p-3: Likewise. + * tests/mkdir/p-slashdot: Likewise. + * tests/mkdir/p-thru-slink: Likewise. + * tests/mkdir/parents: Likewise. + * tests/mkdir/perm: Likewise. + * tests/mkdir/special-1: Likewise. + * tests/mkdir/t-slash: Likewise. + * tests/mkdir/writable-under-readonly: Likewise. + * tests/mv/Makefile.am: Likewise. + * tests/mv/acl: Likewise. + * tests/mv/atomic: Likewise. + * tests/mv/backup-is-src: Likewise. + * tests/mv/childproof: Likewise. + * tests/mv/diag: Likewise. + * tests/mv/dir-file: Likewise. + * tests/mv/dir2dir: Likewise. + * tests/mv/dup-source: Likewise. + * tests/mv/force: Likewise. + * tests/mv/hard-2: Likewise. + * tests/mv/hard-3: Likewise. + * tests/mv/hard-4: Likewise. + * tests/mv/hard-link-1: Likewise. + * tests/mv/i-1: Likewise. + * tests/mv/i-2: Likewise. + * tests/mv/i-3: Likewise. + * tests/mv/i-4: Likewise. + * tests/mv/i-link-no: Likewise. + * tests/mv/into-self: Likewise. + * tests/mv/into-self-2: Likewise. + * tests/mv/into-self-3: Likewise. + * tests/mv/into-self-4: Likewise. + * tests/mv/leak-fd: Likewise. + * tests/mv/mv-special-1: Likewise. + * tests/mv/no-target-dir: Likewise. + * tests/mv/part-fail: Likewise. + * tests/mv/part-hardlink: Likewise. + * tests/mv/part-rename: Likewise. + * tests/mv/part-symlink: Likewise. + * tests/mv/partition-perm: Likewise. + * tests/mv/perm-1: Likewise. + * tests/mv/reply-no: Likewise. + * tests/mv/setup: Likewise. + * tests/mv/to-symlink: Likewise. + * tests/mv/trailing-slash: Likewise. + * tests/mv/update: Likewise. + * tests/mv/vfat: Likewise. + * tests/od/od-N: Likewise. + * tests/od/x8: Likewise. + * tests/pr/Makefile.am: Likewise. + * tests/pr/Test.pm: Likewise. + * tests/readlink/can-e: Likewise. + * tests/readlink/can-f: Likewise. + * tests/readlink/can-m: Likewise. + * tests/readlink/rl-1: Likewise. + * tests/rm/Makefile.am: Likewise. + * tests/rm/cycle: Likewise. + * tests/rm/dangling-symlink: Likewise. + * tests/rm/deep-1: Likewise. + * tests/rm/dir-no-w: Likewise. + * tests/rm/dir-nonrecur: Likewise. + * tests/rm/dot-rel: Likewise. + * tests/rm/empty-inacc: Likewise. + * tests/rm/empty-name: Likewise. + * tests/rm/f-1: Likewise. + * tests/rm/fail-2eperm: Likewise. + * tests/rm/fail-eperm: Likewise. + * tests/rm/hash: Likewise. + * tests/rm/i-1: Likewise. + * tests/rm/i-no-r: Likewise. + * tests/rm/inaccessible: Likewise. + * tests/rm/interactive-always: Likewise. + * tests/rm/interactive-once: Likewise. + * tests/rm/ir-1: Likewise. + * tests/rm/isatty: Likewise. + * tests/rm/no-give-up: Likewise. + * tests/rm/r-1: Likewise. + * tests/rm/r-2: Likewise. + * tests/rm/r-3: Likewise. + * tests/rm/rm1: Likewise. + * tests/rm/rm2: Likewise. + * tests/rm/rm3: Likewise. + * tests/rm/rm4: Likewise. + * tests/rm/rm5: Likewise. + * tests/rm/sunos-1: Likewise. + * tests/rm/unread2: Likewise. + * tests/rm/unread3: Likewise. + * tests/rm/unreadable: Likewise. + * tests/rmdir/fail-perm: Likewise. + * tests/rmdir/ignore: Likewise. + * tests/rmdir/t-slash: Likewise. + * tests/seq/basic: Likewise. + * tests/sha1sum/basic-1: Likewise. + * tests/sha1sum/sample-vec: Likewise. + * tests/shred/exact: Likewise. + * tests/shred/remove: Likewise. + * tests/sort/Makefile.am: Likewise. + * tests/sort/Test.pm: Likewise. + * tests/sort-time/Makefile: Likewise. + * tests/sort-time/README: Likewise. + * tests/sort-time/rand-gen: Likewise. + * tests/stty/basic-1: Likewise. + * tests/stty/row-col-1: Likewise. + * tests/sum/basic-1: Likewise. + * tests/sum/sysv: Likewise. + * tests/tac/Makefile.am: Likewise. + * tests/tac/Test.pm: Likewise. + * tests/tail/Makefile.am: Likewise. + * tests/tail/Test.pm: Likewise. + * tests/tail-2/Makefile.am: Likewise. + * tests/tail-2/append-only: Likewise. + * tests/tail-2/assert: Likewise. + * tests/tail-2/assert-2: Likewise. + * tests/tail-2/big-4gb: Likewise. + * tests/tail-2/fflush: Likewise. + * tests/tail-2/infloop-1: Likewise. + * tests/tail-2/proc-ksyms: Likewise. + * tests/tail-2/start-middle: Likewise. + * tests/tail-2/tail-n0f: Likewise. + * tests/tee/basic: Likewise. + * tests/tee/dash: Likewise. + * tests/test/Makefile.am: Likewise. + * tests/test/Test.pm: Likewise. + * tests/touch/Makefile.am: Likewise. + * tests/touch/dangling-symlink: Likewise. + * tests/touch/empty-file: Likewise. + * tests/touch/fail-diag: Likewise. + * tests/touch/fifo: Likewise. + * tests/touch/no-create-missing: Likewise. + * tests/touch/no-rights: Likewise. + * tests/touch/not-owner: Likewise. + * tests/touch/obsolescent: Likewise. + * tests/touch/read-only: Likewise. + * tests/touch/relative: Likewise. + * tests/tr/Makefile.am: Likewise. + * tests/tr/Test.pm: Likewise. + * tests/tr/failures: Likewise. + * tests/tsort/basic-1: Likewise. + * tests/unexpand/basic-1: Likewise. + * tests/uniq/Makefile.am: Likewise. + * tests/uniq/Test.pm: Likewise. + * tests/wc/Makefile.am: Likewise. + * tests/wc/Test.pm: Likewise. + +2006-08-17 Jim Meyering + + ls -CF would misalign columns in some cases. + * src/ls.c (get_type_indicator): New function. extracted from... + (print_type_indicator): ...here. Use it. + (length_of_file_name_and_frills): Use it here, too, rather than + assuming stat.st_mode is valid. + Reported by Andreas Schwab, here: + + See the test for this above. FYI, I did ls -CF /proc and visually + inspected the result. + + * src/copy.c (copy_internal, same_file_ok): Adjust comments not + to mention the now-removed cp_options.xstat member. + + * Makefile.maint (patch-check): Adapt to work now that the patch + modifies more than one file in src/. + + With this patch, permit building with Solaris cc on Solaris 7. + * src/c99-to-c89.diff: Add diffs to convert more c99-isms. + This integrates patches from Bruno Haible. + +2006-08-16 Paul Eggert + + Fix some problems reported by Bruno Haible. + * tests/chmod/setgid (abs_srcdir): Remove; not used or needed. + Skip this test if "chmod g+s d" silently does nothing. + * tests/ls-2/tests: Skip this test suite if we can't set up files + properly for the setuid-etc test. This simplifies some of the + hacks we were using to work around porting problems. + +2006-08-16 Jim Meyering + + * tests/cp/Makefile.am: Don't mark "acl" as XFAIL. + * tests/cp/acl: Instead, skip the test if either setfacl + or getfacl fails. + Reported by Michael Stone. + +2006-08-16 Paul Eggert + + * tests/lang-default (LC_ALL): Set to "C", so we get + English-language diagnostics. Unset the other variables; it + should be portable to use 'unset' for this stuff nowadays. + Problem reported by Bruno Haible. Using "C" reverses the + 2000-10-22 change to fileutils in this area. + + Fix bugs when printing plurals of numbers that are not + unsigned long int values. + * src/system.h (select_plural): New function. + * src/md5sum.c (digest_check): Use select_plural to avoid bug. + * src/uptime.c (print_uptime): Likewise. + * src/dd.c (print_stats): Likewise. Also, don't use ngettext to + print a floating point number, as reducing to 0 or 1 doesn't work + for some languages. Instead, just use "s" for seconds since it + doesn't need a plural form. + +2006-08-16 Bruno Haible + + Old versions of gzip would write --help output to stderr, and it + would be annoying to see that in the output of every "make" command. + * Makefile.maint (gzip_rsyncable): Throw away stderr output of + "gzip --help". + +2006-08-16 Andreas Schwab + + * tests/cp/acl: Don't use non-portable == operator for test. + +2006-08-16 Jim Meyering + + * tests/ls/stat-dtype: Use stat to test file system type, rather + than df -T, in case /etc/mtab lies. Reported by Michael Stone. + +2006-08-15 Paul Eggert + + * NEWS: Mention that df exits with nonzero status if it generates + no output. This change was in 6.0 but inadvertently unmentioned. + * src/df.c (file_systems_processed): Renamed from n_valid_args, and now + a boolean. + (show_dev): Don't set it until we actually output something. + Print the header if this is the first output. + (main): Don't print a header, as that is now show_dev's job. + * tests/misc/Makefile.am (TESTS): Add df. + * tests/misc/df: New file. + +2006-08-15 Eric Blake + + * src/stat.c (USE_STATVFS): Define to 0 if f_type is needed, but + statvfs.f_type not present. See + . + +2006-08-15 Paul Eggert + + * src/dd.c (print_stats): Don't substitute "1" for number, as this + causes confusion for the Hungarian translators. Problem reported + by Egmont Koblinger here: + http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/7726 + +2006-08-15 Jim Meyering + + * .x-sc_require_config_h: Add lib/at-func.c. + + * NEWS: Add a line for 6.1-cvs. + * configure.ac (AC_INIT): Bump to 6.1 and add "-cvs" suffix. + +2006-08-15 Jim Meyering + + * Version 6.0. + * NEWS: Record the 6.0 release date. + * configure.ac (AC_INIT): Remove "-cvs" suffix from version string. + + * TODO: Add an item (convert to use gnulib-tool), add to the plan + for id-vs-getgrouplist, and remove a few completed items. + + * Makefile.maint (alpha beta major): Fix syntax error. + +2006-08-13 Jim Meyering + + * src/shred.c (usage): Don't indent the second line of an item. + Otherwise, help2man would misformat the output. + Reported by Adam Buchbinder in . + +2006-08-11 Paul Eggert + + * configure.ac (AM_GNU_GETTEXT): Upgrade to need-formatstring-macros. + Suggested by Eric Blake to avoid problems like + . + +2006-08-11 Jim Meyering + + * tests/ls/stat-vs-dirent: Too many (losing) systems trigger the + failure that this test checks for (stat/dirent inode mismatch at + a mount point), so continue to give a diagnostic about the failure, + but don't actually count it as a failure. + +2006-08-10 Paul Eggert + + * ABOUT-NLS: Update from gettext 0.15. + * configure.ac (AM_GNU_GETTEXT_VERSION): Update from 0.13.1 to 0.15. + + * src/csplit.c (struct control): Remove fastmap member. + (extract_regexp): Allocate fastmap separately, since otherwise + it might move due to a realloc. This fixes a bug that led + to a core dump on 64-bit sparc Solaris 10 (Sun Studio 10). + +2006-08-10 Jim Meyering + + * tests/ls/stat-dtype: If "." is tmpfs, skip this test unless uname -s + reports "Linux". This avoids a failure on Solaris 10's tmpfs. + Redirect both stdout and stderr of df invocations. + + * src/dircolors.hin: Add a TERM directive for each of the following: + ansi, color-xterm, gnome, konsole, kterm, rxvt-cygwin, + rxvt-cygwin-native, screen.linux, xterm-256color. + Sort the TERM directives. + From Mike Frysinger. + +2006-08-09 Paul Eggert + + * src/dd.c (usage): Warn about oflag=append without conv=notrunc. + See Debian bug 373736. + + * src/dircolors.hin: Add mlterm, rxvt-unicode; this fixes Debian + bug 317503. + + * src/.cvsignore: Add shuf. + + * Makefile.maint: Remove the po-update procedure; it doesn't + work with the new repository on http://www.iro.umontreal.ca/. + For now I guess we'll have to fix things by hand. + (do-po-update, po-update): Remove. All references removed. + + * src/shuf.c (next_line): New function. + (read_input): Use it, to avoid relying on GCC-specific behavior + with void * arithmetic. Problem reported by Bob Proulx. + * Makefile.maint (my-distcheck): Compile with -Wpointer-arith + to detect this sort of problem automatically in the future. + +2006-08-09 Jim Meyering + + * src/ls.c: Add a compile-time check to ensure that filetype + and filetype_letter have the same number of elements. + + * tests/misc/sort-rand: Remove use of --seed=S. + +2006-08-08 Paul Eggert + + Add a command 'shuf', and modify shred and sort to use the new + random number generator library of 'shuf'. + + * AUTHORS: Add shuf. + * README: Likewise. + * NEWS: Likewise. Mention new --random-source option for shred + and sort. Move "sort +1 -2" notice to the appropriate section, + and clarify its role with respect to POSIXLY_CORRECT. + * man/.cvsignore: Add shuf.1. + * man/Makefile.am (dist_man_MANS): Add shuf.1. + (shuf.1): New dependency. + * man/shuf.x: New file. + * src/Makefile.am (bin_PROGRAMS): Add shuf. + (EXTRA_DIST): Remove rand-isaac.c. + (shuf_LDADD): New macro. + * src/rand-isaac.c: Remove, moving most of its contents to + lib/rand-isaac.c. + * src/shuf.c: New file. + * src/shred.c: Use new random-number interface rather than rand-isaac.c. + Don't include rand-isaac.c; include randint.h and randread.h instead. + (RANDOM_SOURCE_OPTION): New enum. + (long_opts, usage, main): New option --random-source. + * src/sort.c: Likewise. + * src/shred.c (struct irand_state, irand_init, irand32, irand_mod): Remove. + All callers changed to use randint interface. + (fillrand): Remove. All callers changed to use randread interface. + (dopass): Remove dependency on ISAAC buffer size. + (genpattern): Don't wipe the random state here. + (randint_source): New static var. + (clear_random_data): New function. + (main): Allocate random source, and arrange to wipe it on exit. + * src/sort.c: Include md5.h, randread.h, xmemxfrm.h. + (longopts, usage, main): Remove undocumented --seed option; + it's now replaced by --random-source. + (rand_state, get_hash): Remove. + (randread_source): New static var. + (random_state, cmp_hashes, compare_random): New functions; they guarantee + no collisions in the random hash function. + (keycompare): Use compare_random for -R; don't fall back on comparing + via memcoll, since compare_random does the right thing. + * tests/misc/Makefile.am (TESTS): Add shuf. + * tests/misc/shuf: New file. + +2006-07-29 Paul Eggert + + * src/copy.c (set_author): Preserve the st_author field via the + file descriptor dest_desc. + +2006-07-28 Paul Eggert + + * NEWS: chmod now preserves setuid and setgid bits on directories + if you use a numeric mode with them clear, e.g., "chmod 755 DIR". + + Fix test case problems if working directory is setgid, + reported by Bob Proulx. + * tests/cp/fail-perm: Use symbolic mode so that we clear + setgid bit more reliably on directories. + * tests/mkdir/special-1 (set_mode_string): Likewise. + +2006-07-27 Jim Meyering + + * src/chgrp.c (usage): Use correct grammar in description of the + --reference option + * src/chown.c (usage): Likewise. + +2006-07-26 Thomas Schwinge (tiny change) + + * src/copy.c (set_author) [HAVE_STRUCT_STAT_ST_AUTHOR]: + Correctly access SRC_SB's element ST_AUTHOR. + +2006-07-26 Jim Meyering + + * tests/ls/stat-failed: Adapt to match new expected output. + From Paul Eggert. + + * src/ls.c (print_color_indicator): Test for S_IFREG first, rather + than having the code test for all of the other types first. + Hoist the set-uid/gid-testing code "up" into this new block. + Classify any other type of file (e.g., S_TYPEISSHM, etc.) as + C_ORPHAN, not as C_FILE. + +2006-07-26 Jim Meyering + + Checking in a change from Paul. + + 2006-07-25 Paul Eggert + + * src/ls.c (DT_INIT): Remove. All uses removed. + (enum filetype): Use an ordinary enum rather than trying to keep + the values in sync with DT_FIFO etc. That way, we don't have + to make special assumptions about them. All uses changed. + (whiteout): New constant member of enum filetype. + (filetype_letter): New constant, for use with enum filetype. + (FILETYPE_INDICATORS): New initializer list. + (print_dir): Add case for DT_WHT. + (gobble_file): If stat fails, don't discard information from + readdir; instead, preserve it so it can be printed. + (print_long_format): Fall back on readdir result if stat info + is not available. Use "?" to denote each unknown mode char, + instead of an overall "?", since we now know some of the mode + typically. + (print_type_indicator): Now that MODE isn't necessarily + useful, guard all uses. + Now that two blocks in the type-checking tree can set "type = C_FILE", + move the suffix-handling code out and down. + +2006-07-26 Jim Meyering + + Prepare for the above change. + * src/ls.c [struct fileinfo] (stat_ok): Rename from stat_failed, + and adjust uses. From a patch by Paul Eggert. + +2006-07-26 Jim Meyering + + * src/ls.c: Correct indentation/formatting in a few places. + +2006-07-25 Paul Eggert + + * tests/cp/fail-perm: Use "chmod 0500" rather than "chmod 500". + Problem report and fix from Bob Proulx. + * NEWS: Clarify the "chmod 0500" news, and correct the vague + statements about compatibility with BSD. + +2006-07-25 Jim Meyering + + * src/ls.c (gobble_file): When handling a stat-failed entry, + print the entry name not the absolute_name -- to be consistent + with the usual case. + * tests/ls/stat-failed: Update accordingly. + + * src/ls.c: Add parens around the new uses of ?: ternary operator. + + * src/dircolors.hin: Mention that ORPHAN refers not just to dangling + symlinks. + + Get --dired offsets right when handling stat-failed entries. + * src/ls.c (print_long_format): Be careful to increment P by the + appropriate amount, even when inode_number_width and nlink_width + are zero. + * tests/ls/stat-failed: Test for the above. + + * src/ls.c (gobble_file) [USE_ACL]: Don't use-uninitialized the + have_acl member. That would happen for a directory with both a + non-stat'able entry and one with an ACL. + + * src/ls.c (gobble_file): Make it so failure to stat a + non-command-line file provokes an exit status of 1, not 0. + Say "cannot access" rather than "cannot stat". + * tests/ls/stat-failed: New file/test, for the above. + * tests/ls/Makefile.am (TESTS): Add stat-failed. + * tests/ls-2/tests (no-a-isdir-b): Update to reflect addition + of "cannot access " to diagnostic. + + * src/ls.c: Declare stat_failed to be "bool", not "int" everywhere. + + * src/ls.c [enum filetype] (command_line): Remove member. Not needed. + Replace all occurrences of "type == command_line" with the + equivalent, "command_line_arg". + + * src/ls.c: Apply the stat-failed parts of Red Hat's + coreutils-selinux.patch. From Ulrich Drepper. + This makes it so files not mentioned on the command line (e.g., + names read from a directory that *is* mentioned on the command + line) for which stat fails are still listed. With --color, + such files are colored just like ORPHANs (aka dangling symlinks). + + * src/df.c (n_valid_args): Declare global to be static. + +2006-07-24 Jim Meyering + + * tests/ls/stat-dtype: Skip this test on reiserfs, since that file + system lacks d_type support. + +2006-07-22 Paul Eggert + + * man/chmod.x: Update to reflect recent changes to coreutils.texi. + +2006-07-21 Jim Meyering + + * src/su.c (usage): Correct typo in --help output: s/commmand/command/ + Reported by Tim Waugh. + Also remove the comment duplicating much of --help output. + + * src/ls.c (FILE_TYPE_INDICATOR_OPTION): Reposition this new + name so the list remains alphabetized. + + Fix another bug: ls --indicator-style=file-type would call + stat for a symlink, even though it wasn't always needed. + In some cases, that unnecessary stat would cause ls to fail. + * src/ls.c (gobble_file): Don't treat symlinks specially (in + requiring a stat syscall). Remove the offending exclusion. + + * NEWS: Mention the fix. + + * tests/ls/stat-dtype: New file/test, for the above fix. + Also exercises the new df feature, below. + + * src/df.c (main): Fail and don't print the headers if no + file system is processed. This makes it easy to test whether + a specified directory is on a file system of a given type or types. + Otherwise, applications would have had to parse df's output. + E.g., is "." either ext3 or reiserfs: df -t ext3 -t reiserfs . + + Fix a bug: ls --file-type worked like --indicator-style=slash, + rather than like --indicator-style=file-type. + * src/ls.c (FILE_TYPE_INDICATOR_OPTION): New enum member. + (long_options): Map "file-type" to FILE_TYPE_INDICATOR_OPTION, + not to 'p'. + (decode_switches): Handle new case: FILE_TYPE_INDICATOR_OPTION. + * NEWS: Mention the fix. + * tests/ls-2/tests (file-type): New test, for the above fix. + +2006-07-19 Jim Meyering + + * src/ls.c (print_dir): Give a better diagnostic for failed opendir. + + * Makefile.am (EXTRA_DIST): Add build-aux/vc-list-files. + +2006-07-16 Paul Eggert + + * NEWS: chmod, install, and mkdir now leave setgid and setuid bits + of directories alone unless you specify them explicitly. + install and mkdir now implement X correctly. + install now creates parent directories with mode 755, without + changing their owner or group. + * src/chmod.c (process_file): Adjust to mode_adjust API change. + * src/install.c: Include mkancesdirs.h. + (announce_mkdir, make_ancestor): New functions. + (DEFAULT_MODE): New macro, specifying initial value of 'mode'. + (mode): Use it. + (dir_mode, dir_mode_bits): New vars. + (main): Set dir modes separately from nondir, so that the X + op of -m works correctly. + (main): Remove cwd_errno cruft, since make_dir_parents no longer + affects cwd. Adjust to new make_dir_parents API. + (install_file_in_file_parents): 2nd arg is now char *, not char + const *. Use mkancesdirs instead of rolling our own code. + (change_attributes): Don't worry about AFS, since that kludge + should not be needed any more. + * src/mkdir.c (struct mkdir_options): New struct. + (announce_mkdir, make_ancestor): New functions. + (main): Use them. Adjust to mode_adjust API change. Stick with + umask 0. Use make_dir_parents for all the work. + * src/mkfifo.c (main): Adjust to new mode_adjust API. + * src/mknod.c (main): Likewise. + * tests/chmod/setgid: Do the setgid test instead of bailing. + * tests/mkdir/p-3: Remove re_protect case that no longer applies. + GNU chmod now behaves like other versions of chmod. + * tests/mkdir/perm: Add a test for the X bug. + +2006-07-14 Paul Eggert + + * src/base64.c (do_decode): Output to parameter OUT, not to stdout. + This doesn't fix any bugs, since OUT always equals stdout, but it + makes the code easier to understand. + +2006-07-14 Jim Meyering + + * Makefile.maint (CVS_LIST): Use new file, build-aux/vc-list-files, + rather than open-coding it. Now supports mercurial, too. + * .hgignore: New file. + * Makefile.am (EXTRA_DIST): Add .hgignore, which ignores nearly + all generated files, including ones like configure and po/*.po + that are currently version-controlled in cvs. + + * Makefile.am (EXTRA_DIST): Add a few more .??* files. + They've been in CVS, just haven't been distributed before this. + Distribute ChangeLog-2005, too. + (MAINTAINERCLEANFILES): Add THANKS-to-translators. + +2006-07-11 Paul Eggert + + * src/system.h: Assume exists, since gnulib assumes + this now as well. + +2006-07-09 Jim Meyering + + * tests/mv/dir2dir: Adjust so failing with ENOTEMPTY is ok, too. + That happens with Linux/tmpfs. + * tests/mv/Makefile.am (TESTS): Add dir2dir. + +2006-07-09 Paul Eggert + + Adjust to recent updates from gnulib. + * src/dd.c (apply_translations): Use toupper rather than + islower followed by toupper; it's simpler and typically + faster now that we assume at least C89 semantics. Similarly + for tolower. + * src/sort.c (inittables): Likewise. + * src/expand.c (expand): Don't assume that isprint etc. return + booleans (needed for pre-C99 hosts). + * src/fmt.c (check_punctuation): Likewise. + * src/ptx.c (initialize_regex, fix_output_parameters): Likewise. + * src/tr.c (is_char_class_member): Likewise. + * src/unexpand.c (unexpand): Likewise. + * src/join.c (is_blank): Remove; no longer needed. All uses + replaced by isblank (to_uchar (...)). + * src/pinky.c (create_fullname): Don't assume char is unsigned. + * src/printf.c (print_esc): Likewise. + * src/ptx.c (SKIP_NON_WHITE, SKIP_WHITE, SKIP_WHITE_BACKWARDS): + (copy_unescaped_string): Likewise. + * src/stat.c (print_it): Likewise. + * src/system.h (_D_EXACT_NAMELEN): Renamed from NLENGTH, for + convenience on GNU systems. All uses changed. Don't bother + looking for any dirent.h substitute other than ndir.h. + (D_INO): Remove unnecessary parentheses. + (IN_CTYPE_DOMAIN, ISGRAPH, ISPRINT, ISALNUM, ISALPHA): + (ISCNTRL, ISLOWER, ISPUNCT, ISSPACE, ISUPPER, ISXDIGIT): + (ISDIGIT_LOCALE, TOLOWER, TOUPPER): Remove. All uses changed + to ctype.h equivalents. + (isblank): Renamed from ISBLANK. Check for HAVE_DECL_ISBLANK too. + All uses changed. + +2006-07-08 Jim Meyering + + * tests/mv/dir2dir: New file, test for 2006-07-05 fix in copy.c. + + * Makefile.maint (sc_the_the): New rule. + + * src/dd.c (skip): Remove one of two adjacent "the"s in a comment. + * tests/Coreutils.pm (run_tests): Remove one of two adjacent "then"s + in a comment. + +2006-07-07 Jim Meyering + + * NEWS: Mention that mv can now remove an empty destination directory, + and give an example. Prompted by a report from Florent Bayle. + +2006-07-05 Jim Meyering + + * src/ls.c (usage): Correct the description of -G: it is useful + only in a long listing. Reported by Martin Pool in + . + + * man/chmod.x: Correct the description of the sticky bit. Reported + by Chris Moore via Ian Jackson in . + + * src/copy.c (copy_internal): Don't work around old NFS clients like + SunOS-4.1.4 and Irix 5.3 that set errno to values like EIO and + ENOTEMPTY upon failed rename. Otherwise, we risk misinterpreting + a banal failure as a recursive move-into-self failure. + Reported by Florent Bayle in . + + * src/c99-to-c89.diff: Regenerate, to remove fuzz. + +2006-07-03 Jim Meyering + + Plug another unusual leak. + (AD_mark_helper): Free malloc'd filename if hash_insert says + that string is already in the hash table. + + The dev/inode of the topmost directory in each hierarchy were not + being recorded. + * src/remove.c (remove_cwd_entries): Don't call cycle_check here. + (AD_push): Call it from here instead. + + Fix two small leaks. + * src/remove.c (AD_stack_clear): New function. + (rm_1): Use it. + (AD_pop_and_chdir): Free *prev_dir just before longjmp. + + * tests/Makefile.am, tests/*/Makefile.am: (TESTS_ENVIRONMENT): + Add $VG_PATH_PREFIX as a prefix to $PATH + + * tests/envvar-check (vars): Add CDPATH and POSIXLY_CORRECT. + * tests/Makefile.am (evar-check): Remove rule. + (EXTRA_DIST): Remove .env-warn. + * tests/.env-warn: Remove file. No longer used. + Suggestion from Eric Blake. + +2006-07-02 Paul Eggert + + * src/system.h: Include unconditionally, since we + now assume the stdint module. + +2006-07-01 Paul Eggert + + * NEWS: With no operand, 'tail -f' now silently ignores the '-f' + only if standard input is a FIFO or pipe and POSIXLY_CORRECT is set. + * src/tail.c (main): Implement this. + * tests/tail/Test.pm (f-pipe-1): Renamed from f-1. + (test_vector): Set POSIXLY_CORRECT for the f-pipe-* tests. + +2006-07-01 Jim Meyering + + * src/ln.c (do_link): Use new, shorter URL, for ag-review link. + + * .x-sc_require_config_h: Add ^lib/xstrtold\.c$, so make distcheck + passes once again. + +2006-06-30 Paul Eggert + + * NEWS: seq now uses long double internally rather than double. + It now defaults to a minimal fixed point format if possible. + It lets you use %a, %A, %E, %F, %G. + * src/Makefile.am (seq_LDADD): Remove $(SEQ_LIBM); add $(POW_LIB). + * src/seq.c: Don't include or ; no longer needed. + (isfinite) [!defined isfinite]: New macro. + (separator, terminator): Now points to const. + (first, step, last): Remove. + (usage): Update to match new behavior. + (struct operand, operand): New type. + (scan_arg): Renamed from scan_double_arg, since we no longer use double. + All uses changed. + Compute and return a value of type operand, not double. + (long_double_format): Renamed from valid_format, and now returns a + new format with an "L" added if needed, if the original format was + valid. Allow %a, %A, %E, %F, and %G formats. + (print_numbers): Take numeric values as args rather than from globals. + Print long double, not double. + (get_width_format): Remove. + (get_default_format): New function. + (main): Implement new way of calculating default format. + Don't worry about locale's representation of the decimal point, since + the arguments are always processed in the C locale. + * tests/seq/basic (neg-2): Adjust to new default format. + (eq-wid-1, eq-wid-2): Resurrect these tests, since the new + implementation should do the right thing. + +2006-06-30 Jim Meyering + + * tests/stty/basic-1: Work around an intermittent test failure + on HP-UX 11.11. Report and analysis from Bob Proulx. + http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/7475 + +2006-06-28 Paul Eggert + + * NEWS: Support obsolete usages like "sort +1 -2" even when + conforming to POSIX 1003.1-2001, since this is a pure extension to + POSIX. Problem reported by Christian in: + http://lists.gnu.org/archive/html/bug-coreutils/2006-06/msg00220.html + * src/sort.c (main): Implement this. + + * src/system.h (CLOSEDIR): Remove. All uses changed to closedir. + Autoconf 2.60 says this stuff was obsolete. + +2006-06-28 Jim Meyering + + * src/c99-to-c89.diff: Regenerate, to remove fuzz. + +2006-06-28 Bob Proulx (tiny change) + + * tests/mv/i-link-no: Work around HP-UX /bin/sh tracing problem + (set -x when VERBOSE=yes) when stderr is redirected before stdout + causing shell tracing of the stdout redirection to be written to + the stderr file. Avoid problem and test failure on HP-UX by + redirecting stderr last. + * tests/dd/unblock-sync: Order shell file redirections for + stderr and stdout in the common style. + tests/acl: Likewise. + +2006-06-27 Jim Meyering + + * tests/misc/cat-proc: Try to avoid any spurious numeric + differences in frequently-changing /proc/cpuinfo. + Reported by Nelson Beebe. + +2006-06-26 Jim Meyering + + Attempt rmdir (actually, unlinkat-with-AT_REMOVEDIR) upon any + fd_to_subdirp failure, not just when errno == EACCES. + * src/remove.c (remove_dir): Use unlinkat-with-AT_REMOVEDIR, not + rmdir, here, even though rmdir may happen to be adequate. + + * NEWS: rm no longer fails to remove an empty, unreadable directory + * src/remove.c (remove_cwd_entries): If we can't open a directory, + and the failure is not being ignored, try to remove the directory + with rmdir (aka unlinkat-with-AT_REMOVEDIR), in case it's empty. + Problem report and test case from Paul Eggert in + . + + * tests/rm/empty-inacc: New test, for the above. + + Avoid a segfault for wc --files0=- < /dev/null. + * src/wc.c (compute_number_width): Return right away if nfiles == 0. + +2006-06-25 Jim Meyering + + * NEWS: wc accepts a new option --files0-from=FILE, where FILE + contains a list of NUL-separated file names. + + * src/wc.c: Include "readtokens.h". + (usage): Describe the new option, and adjust the `Usage': + with this option, no FILE may be specified on the command line. + (main): Handle the new option. + * tests/misc/wc-files0: New tests, for the above. + * tests/misc/wc-files0-from: Likewise. + * tests/misc/Makefile.am (TESTS): Add wc-files0. + +2006-06-24 Jim Meyering + + * src/md5sum.c (DIGEST_BUFFER): Remove now-unused definitions. + +2006-06-22 Jim Meyering + + * src/tee.c (tee_files): Rename from tee, to avoid conflict with + the function in glibc's . Reported by Andreas Schwab. + +2006-06-19 Jim Meyering + + * Makefile.cfg (local-checks-to-skip): Add changelog-check, + so this check is not run as part of "make distcheck". + +2006-06-18 Bob Proulx (tiny change) + + * tests/misc/pwd-long: Fix typo (s/neq/ne/) in previous change. + +2006-06-18 Jim Meyering + + * tests/misc/pwd-long: Make error output a little clearer. + +2006-06-17 Jim Meyering + + * tests/rm/inaccessible: Skip this test on systems without openat + support. Reported by Bob Proulx. + +2006-06-15 Bob Proulx (tiny change) + + * tests/misc/mknod: Improve permission checks to handle + running mkdir test in set-gid directories. + +2006-06-14 Jim Meyering + + * tests/du/basic: Revamp not to hard-code file system block sizes. + +2006-06-12 Ralf Wildenhues + + * tests/du/Makefile.am (TESTS_ENVIRONMENT): Pass $(PERL), for + files0-from test. + +2006-06-11 Jim Meyering + + * .gitignore: New file. + * Makefile.am (EXTRA_DIST): Add .gitignore. + + Setting TIME_STYLE=long-iso in the environment would make the + cp/same-file test fail. + * tests/envvar-check (vars): Add TIME_STYLE to the list. + * tests/cp/same-file: Revert last change. + Source the envvar-check script, to ensure that TIME_STYLE + settings don't affect these tests. + +2006-06-11 Paul Eggert + + * tests/cp/same-file: Execute 'ls' in the C locale, so that it + uses POSIX time stamp formats. Problem reported by John Nixon in + . + +2006-06-10 Jim Meyering + + * NEWS: Mention the AIX-strndup-bug vs. dircolors workaround. + + Require a "Version N.M" line at the top of the ChangeLog + file only when making the actual release, not when running + "make distcheck". + * Makefile.maint (maintainer-distcheck): Don't depend on + changelog-check. + (alpha beta major): Depend on it here, instead. + +2006-06-08 Jim Meyering + + Ensure that cat works with any of the options, -A -v -e -E -T, + when applied to files in /proc and /sys, even when the FIONREAD + ioctl produces nonsensical results. Before this change, cat would + produce no output (or truncated output), for some linux kernels. + + * src/cat.c (write_pending): New function, factored out of cat. + (cat): Also interpret a negative ioctl/FIONREAD count as indicating + that there are bytes to read. Some versions of linux-2.6.16 do that. + Write any pending output before returning. + Reported by Dan Jacobson in . + * NEWS: Mention this bug fix. + * tests/misc/cat-proc: New file. Test for the above. + * tests/misc/Makefile.am (TESTS): Add cat-proc. + +2006-06-07 Paul Eggert + + * src/expr.c (eval4): Detect overflow properly when multiplying + INTMAX_MIN * -1. + +2006-06-06 Paul Eggert + + * NEWS: The 'expr' command now detects and reports integer overflow. + (It would be better to use extended precision instead, but that + would be more work.) + * src/expr.c (integer_overflow): New function. + (eval4, eval3): Check for integer overflow. + +2006-06-05 Paul Eggert + + Fix problems when building with Solaris/SVR4/etc. make, which uses a + different and somewhat bogus implementation of VPATH. In the + directory tests/misc, rename tests whose names might appear in the + Automake-generated rules. For example, we can't use a test named + 'test', since Automake generates a rule that contains the text + "if test -f ./$$tst; ...", and this might expand to something like + "if ../../../coreutils-6.0/tests/misc/test -f ./$$test; ...", + which executes the 'test' script rather than the 'test' command. + * tests/misc/false-status: Renamed from tests/misc/false. + * tests/misc/pwd-long: Renamed from tests/misc/pwd. + * tests/misc/sort-merge: Renamed from tests/misc/sort. + ($prog): Set to 'sort' rather than to $PROG. + * tests/misc/test-diag: Renamed from tests/misc/test. + * tests/misc/Makefile.am (PROG): Take the basename of $$tst, + in case Solaris make has prepended the directory. + (TESTS): Adjust to above renamings. + * tests/misc/expand: Don't assign to PROG; no longer needed + now that Makefile.am sets PROG to the basename. + * tests/misc/fold: Likewise. + +2006-06-03 Jim Meyering + + Make `cp --link --no-dereference' work also on systems where the + link system call cannot create a hard link to a symbolic link. + * src/copy.c (copy_internal) [LINK_FOLLOWS_SYMLINKS]: Don't use + the link syscall on a symlink when it would do the wrong thing. + Based on the patch by Aurelien Jarno: + * tests/cp/link-no-deref: New file/test for the above. + * tests/cp/Makefile.am (TESTS): Add link-no-deref. + * NEWS: Mention the change (doesn't affect Linux). + +2006-06-01 Paul Eggert + + Fix some porting problems in the test cases reported by + Ralf Wildenhues for HP-UX 11.23 in: + http://lists.gnu.org/archive/html/bug-coreutils/2006-05/msg00238.html + * tests/help-version: Don't assume that \< \> works in sed. + * tests/misc/close-stdout: Don't assume that >&- works. + Add a /dev/full test. + * tests/touch/no-create-missing: Don't assume that >&- works. + +2006-05-30 Jim Meyering + + * src/ls.c (usage): Add `v' to the list of sorting-related options. + From Justin Pryzby. + +2006-05-28 Ralf Wildenhues + + * tests/cp/fail-perm: source lang-default. + * tests/rm/inaccessible: Likewise. + +2006-05-28 Jim Meyering + + * tests/rm/inaccessible: AIX 4.3.3 gives a different diagnostic. + Recognize it, too. Reported by Ralf Wildenhues, in + http://lists.gnu.org/archive/html/bug-coreutils/2006-05/msg00192.html + +2006-05-27 Jim Meyering + + * src/chgrp.c: Support new options: --preserve-root and + --no-preserve-root. Somehow this program was skipped when those + options were added to chown, chmod, and rm. Reported by + vaqflabuopac@spammotel.com in . + * NEWS: Mention this. + +2006-05-25 Paul Eggert + + * NEWS: Remove mention of --seed. We'll replace it with something + better, and don't want to indicate that it is supported. + * src/sort.c (usage): Likewise. + +2006-05-20 Jim Meyering + + * src/chmod.c (main): Use FTS_PHYSICAL here, too. + + * src/du.c (main): Rename local, s/symlink_deref_bit/symlink_deref_bits/ + and arrange for -D to set fts' FTS_PHYSICAL bit as well as + FTS_COMFOLLOW. Spotted by Justin Pryzby. + + * gnupload: Merge changes from automake, retaining the ""--to... + kludge to placate overzealous `make distcheck' check. + +2006-05-19 Jim Meyering + + * src/du.c (main): Don't let -D, -L, or -P turn off the internal + FTS_TIGHT_CYCLE_CHECK directory traversal option. + Reported by Justin Pryzby in http://bugs.debian.org/367691 + +2006-05-15 Jim Meyering + + * src/cp.c (usage): Correct description of -a: s/-dpR/-dpPR/. + From Tomas Pospisek. + +2006-05-13 Jim Meyering + + * tests/mv/no-target-dir: Test two more cases. + +2006-05-11 Jim Meyering + + mv -T DIR EMPTY_DIR no longer fails unconditionally + * src/copy.c (copy_internal): Don't manually prohibit a move where + the destination is an existing directory. Sometimes doing that is + valid. Let the rename system call enforce the rules. That is + allowed only when the source is a directory and the destination + directory (to be replaced) is empty. Reported by Eric Blake. + * tests/mv/no-target-dir: New file/test for this. + * tests/mv/Makefile.am (TESTS): Add no-target-dir. + * NEWS: Mention this. + + * tests/mv/atomic: New file/test for yesterday's fix. + * tests/mv/Makefile.am (TESTS): Add atomic. + + * tests/du/long-sloop: Avoid harmless `ambiguous redirect' diagnostic. + +2006-05-10 Jim Meyering + + * src/copy.c (copy_internal): Don't explicitly unlink the destination + when moving a symlink into the place of an existing non-directory. + Reported by Joshua Hudson. + * NEWS: mention this. + +2006-05-07 Jim Meyering + + * Makefile.maint (patch-check): Fail if patch generates any output, + even merely for changed offsets. + + * src/c99-to-c89.diff: Adjust to reflect new offsets. + + * NEWS: Mention changes affecting df, pwd, shred. + +2006-05-06 Jim Meyering + + * tests/ls/stat-vs-dirent: New test, to detect the bogus file + system condition where dirent.d_ino != stat.st_ino. + * tests/ls/Makefile.am (TESTS): Add stat-vs-dirent. + +2006-05-06 Eric Blake + + * tests/ls/inode: Expand to test inode from readdir case. + * tests/ls/follow-slink: Expand to test broken links encountered + implicitly, favoring Solaris 9 and OpenBSD 3.4 behavior. + +2006-05-06 Eric Blake + + * tests/mv/leak-fd: Work even on case-insensitive file system. + +2006-05-04 Jim Meyering + + * NEWS: Mention the 2006-03-19 pwd-related change that makes + lib/getcwd.c work around inconsistent file system dirent.d_ino data. + +2006-05-03 Jim Meyering + + * src/ls.c (DEFINE_SORT_FUNCTIONS, LIST_SORTFUNCTION_VARIANTS): + Use better macro parameter names: s/basename/key_name/, + s/basefunc/key_cmp_func. Fix typo in comment. + +2006-04-29 Eric Blake + + * src/ls.c (main): On systems with d_type, directories_first only + implies format_needs_type, not format_needs_stat. + +2006-05-03 Jim Meyering + + * src/ls.c (xstrcoll_df_version, rev_xstrcoll_df_version): Add space + after comma in arg list, from Eric Blake. + +2006-04-25 Paul Eggert + + * tests/misc/date (relative-3): New test, derived from a bug + report by John Thomas McDole. + +2006-04-23 Francesco Montorsi + + New option for ls: --group-directories-first. + It makes ls list directories before files. + * NEWS [New features]: Mention it. + * src/ls.c (sort_type): Rearrange to use as an array index when + choosing sort function; added new sort_numtypes member for + compile-time check. + (time_type): Add new time_numtypes member for compile-time check. + (directories_first): New global variable. + (GROUP_DIRECTORIES_FIRST_OPTION): New enum. + (long_options): Add --directories-first. + (main): Support new option. + (is_directory): New function. + (extract_dirs_from_files): Use it. + (DIRFIRST_CHECK, DEFINE_SORT_FUNCTIONS) + (LIST_SORTFUNCTION_VARIANTS): New macros. + (sort_functions): New global variable. + (sort_files): Use it. + (usage): Document new option. + +2006-04-18 Paul Eggert + + * src/shred.c (fillrand): The assertion was way too weak, due to + what must be a typo. Strengthen it to its intended value. + (dopass): Don't use alloca; it's not worth the aggravation here, + since it's used only to get a page-aligned buffer, and page + alignment doesn't buy us much here. I'm suspicious that alloca + causes problems on some hosts, due to a recent bug report by Adam + Waltman: http://bugs.gentoo.org/130246. + +2006-04-18 Jim Meyering + + * tests/misc/tty-eof: Add new programs, base64, sha224sum, sha256sum, + sha384sum, sha512sum. + +2006-04-17 Paul Eggert + + * src/chmod.c (describe_change): Adjust to filemode changes. + * src/ls.c (HAVE_ST_DM_MODE): Remove; moved to ../lib/filemode.c. + (print_long_format): Use (new) filemodestring rather than + (old) mode_string, so that we get more file types right, at least + in theory. Adjust to filemode changes. + * src/stat.c (human_access): Likewise. + +2006-04-18 Jim Meyering + + * src/ptx.c (main) [DEFAULT_IGNORE_FILE]: Remove code to use a default + ignore file. This has never been enabled. Reported by Eric Blake. + +2006-04-12 Paul Eggert + + * src/ln.c (linkfunc): Remove. This method ran into a compiler/linker + bug in Interix. Just call symlink or link directly. All uses changed. + * src/setuidgid.c (main) [! HAVE_SETGROUPS]: Don't call setgroups. + * src/stat.c (USE_STATVFS): New macro. + Include and use statvfs only if USE_STATVFS. + (NAMEMAX_FORMAT): define a bit more clearly, now that the + statvfs-using code is a bit more regular. + * src/system.h (sync) [!HAVE_SYNC]: New macro. + +2006-04-11 Paul Eggert + + * NEWS: csplit, nl, expr now conform to POSIX better, and are + more-compatible with traditional Unix, with respect to regular + expressions. + * src/csplit.c (extract_regexp): Set re_syntax_options to a + value that is compatible with what POSIX requires. + * src/nl.c (build_type_arg): Likewise. + * src/expr.c (docolon): Likewise. Also, don't let anchors match + newline; this fixes an incompatibility with tradition and with POSIX. + Don't warn about leading ^. POSIX says it is unspecified whether + ^ is a special character, which means that implementations can + either treat it as special or not, but either way a warning is not + allowed (unless the regexp is otherwise invalid). Instead, anchor + the expression but treat ^ as an anchor; this is the traditional + behavior (e.g., Solaris 10). + (eval4, eval3, eval2): Treat non-numeric args, division by zero, + and the like as invalid expressions (exit status 2), not as + failure of 'expr' (exit status 3). This is more consistent with + how Solaris behaves. + * tests/expr/basic (fail-a): Adjust exit status to match new expr + behavior, for status 2 versus 3. + (anchor): New test. + (bre1, bre2, bre3, bre4, bre5, bre6, bre7, bre8, bre9, bre10): + (bre11, bre12, bre13, bre14, bre15, bre16, bre17, bre18, bre19, bre20): + (bre21, bre22, bre23, bre24, bre25, bre26, bre27, bre28, bre29, bre30): + (bre31, bre32, bre33, bre34, bre35, bre36, bre37, bre38, bre39, bre40): + (bre41, bre42, bre43, bre44, bre45, bre46, bre47, bre48, bre49, bre50): + (bre51, bre52, bre53, bre54, bre55, bre56, bre57, bre58, bre59, bre60): + (bre61, bre62): New tests. + * tests/misc/csplit: Use \{...\} in test RE, to test that we're + conforming to POSIX. + + Port to Solaris 8. + * tests/du/long-from-unreachable: Solaris 8 sh doesn't understand + "if !". Do not assume that 'sed' can handle long, newline-free input. + * tests/du/long-sloop: Likewise. Evaluate expr once, not $n times. + +2006-04-10 Paul Eggert + + Adjust to new regex.h API (with new fastmap type), and clean + up the regex storage allocation a bit. + + * src/csplit.c (struct control): Put re_compiled member at the + end, since it's large. Change regexpr member from char * to bool; + all uses changed. Add new member fastmap. + (extract_regexp): regexp arg is now char const *, not char *. + Don't bother duplicating the regular expression; it's not needed. + Set fastmap from new fastmap member. Don't bother allocating + a buffer, as the regexp code does a better job than we do. + * src/expr.c (docolon): Allocate and use a fastmap. + Don't bother allocating a buffer. + * src/nl.c (body_fastmap, header_fastmap, footer_fastmap): + New vars. + (build_type_arg): New fastmap arg. All uses changed. + Don't bother allocating a buffer, but set a fastmap. + * src/ptx.c (context_regex_string, word_regex_string): Remove. + (context_regex, word_regex): New vars, replacing the above. + All uses changed. + (struct regex_data): New type. + (compile_regex): Renamed from alloc_and_compile_regex, since + we no longer allocate storage. Arg is now a struct regex_data *, + not a const char *. All uses changed. Don't allocate the fastmap; + instead, take it from the caller. Don't convert size_t to int, + to avoid arithmetic overflow problems. Don't bother freeing + storage afterwards; it's not worth the aggravation. + * src/tac.c (compiled_separator_fastmap): New ver. + (main): Use it. Don't bother allocating a buffer. + +2006-03-30 Jim Meyering + + * src/dd.c (iwrite): Remove assignment without effect. + Reported by Felix Rauch Valenti. + +2006-03-22 Eric Blake + + * src/ptx.c (usage): Remove mention of --copyright/-C. + (main): Alias --copyright to --version plus a deprecation warning. + * NEWS: Mention this. + +2006-03-27 Jim Meyering + + * src/Makefile.am (uptime_LDADD): Add $(POW_LIB), for uptime's + use of strtod. Tiny patch from Nickolai Zeldovich. + +2006-03-11 Eric Blake + + * tests/misc/dirname: New file. + * tests/basename/Makefile.am: Delete. + * tests/basename/basic: Move to... + * tests/misc/basename: ... this new file. Add some tests, + including fixed behavior for //. + * tests/misc/Makefile.am (TESTS): Sort. Add basename, dirname. + * tests/Makefile.am (SUBDIRS): Remove basename. + * configure.ac (AC_CONFIG_FILES): Remove tests/basename. + + Improvements to dirname/basename handling on platforms like + cygwin with distinct // and with drive letters. + * NEWS: Document new behavior. + * src/basename.c (main): Don't strip suffix from file system + roots. + * src/cp.c (target_directory_operand): Use new last_component. + (ASSIGN_BASENAME_STRDUPA): Likewise. Reduce time spent + traversing the string. + * src/dircolors.c (guess_shell_syntax): Use new last_component. + * src/install.c (target_directory_operand, install_file_in_dir): + Likewise. + * src/ln.c (target_directory_operand, main): Likewise. + * src/ls.c (basename_is_dot_or_dotdot): Likewise. + * src/mv.c (target_directory_operand, movefile): Likewise. + * src/remove.c (rm_1): Likewise. + * src/shred.c (wipename): Likewise. + * src/split.c (next_file_name): Likewise. + * src/su.c (log_su, run_shell): Likewise. + +2006-03-23 Paul Eggert + + * NEWS: nohup diagnostics are now more precise, and nohup now + redirects stderr to nohup.out if stdout is closed and stderr is a tty. + * src/nohup.c (main): Implement this. + * tests/misc/nohup: Test the new behavior. + +2006-03-12 Jim Meyering + + * src/copy.c (set_author): Rename function, from preserve_author. + + * src/remove.c (AD_pop_and_chdir): Use new macro, + CYCLE_CHECK_REFLECT_CHDIR_UP, rather than open-coding it. + + * src/system.h (SAME_INODE): Remove definition. + Include "same-inode.h", instead. + +2006-03-11 Eric Blake + + * src/pwd.c (robust_getcwd): Prepend only one slash, not two. + +2006-03-10 Jim Meyering + + Fix a bug whereby a user with write access to a directory being removed + could cause the removal of that directory to fail with an erroneous + diagnostic about a directory cycle. Reported by Vineet Chadha. + + * NEWS: Mention this. + * src/remove.c (AD_pop_and_chdir): If the directory we're about to + leave (and try to rmdir) is the one whose dev_ino is being used to + detect a cycle, reset cycle_check_state.dev_ino to that of the parent. + +2006-03-08 Paul Eggert + + * NEWS: Document dd's new 'directory' and 'nolinks' flags. + * src/dd.c (set_fd_flags): Handle file-creation flags on file + descriptors, rather than ignoring them. + * tests/dd/misc: Add test cases for append, nofollow, directory, + and nolinks flags. Simplify redirection to /dev/null in some cases. + + * tests/dd/misc: iflags->iflag. This fixes a typo that meant the + noatime test never tested anything. + +2006-03-05 Paul Eggert + + * src/dd.c (flags, usage): New flags directory, nolinks. + * src/system.h (O_NOLINKS): Define to 0 if not already defined. + + * src/ls.c (usage): Mention that -f disables --color. + Problem reported by Niels Möller. + +2006-03-03 Justin Pryzby + + * man/*.x: Add references to syscalls from utilities of the same name. + +2006-03-05 Jim Meyering + + * tests/help-version: Set SHELL, if not already set, in order to + avoid failure when `make check' is run through debuild; dircolors + would fail due to lack of $SHELL. Reported by Sven Joachim. + + Make `base64 --wrap=N' work for N=0, and for N larger than SIZE_MAX. + * src/base64.c (wrap_write, do_encode, main): Change type of + parameters and locals, wrap_column, form size_t to uintmax_t. + (main): Adjust to use xstrtoumax, accordingly. + +2006-03-03 Jim Meyering + + Don't fail when run from an environment with SHELL not a Bourne + shell, e.g. `env SHELL=/bin/csh make check' would fail this test. + * tests/dircolors/simple: Invoke each non-failing test with -b. + Reported by Michael Stone. + +2006-02-27 Jim Meyering + + * tests/misc/base64: Derive --decode-using tests from the + encode-based ones. + + * tests/misc/base64: Factor out a long constant string. + Split lines to stay within 80 columns. + + * tests/misc/Makefile.am (TESTS): Add base64. + * tests/misc/base64: Test base64. From Simon Josefsson. + + * src/base64.c (do_decode): Use correct type for parameter, + ignore_garbage: s/size_t/bool/. + + * src/base64.c: Don't include .h files already included by system.h: + , , , , . + Include "system.h" before the other lib/*.h header files. + Include before "system.h". + (wrap_write): Remove declaration of unused local, initial_column. + (wrap_write): Correct declaration syntax: s/size_t * V/size_t *V/. + + * README: Add base64 to the list. + +2006-02-17 Simon Josefsson + + New program: base64. + * AUTHORS: Mention base64. + * NEWS: Likewise. + * man/Makefile.am: Build base64.1. + * man/base64.x: New file. + * src/Makefile.am (bin_PROGRAMS): Add base64. + * src/base64.c: New file. + +2006-02-25 Eric Blake + + In ls, avoid calling stat for --inode (-i), when possible. + * src/pwd.c (NOT_AN_INODE_NUMBER, D_INO): Move to ... + * src/system.h: ... here, for use in ... + * src/ls.c (main): ... here. Prefer dirent.d_ino to stat when + possible. + (gobble_file): Add inode argument. + (print_dir): Pass inode if available. + (usage): Remove inaccuracy. + +2006-02-23 Jim Meyering + + * TODO: Update/correct some obsolete entries. + +2006-02-20 Paul Eggert + + * doc/coreutils.texi (join invocation): Mention `sort -k 1b,1'. + * src/join.c (usage): Likewise. + Documentation problem reported by Philip Kensche. + +2006-02-20 Eric Blake + + * man/rm.x: Update documentation to match previous patch. + +2006-02-18 Eric Blake + + New option for rm: --interactive=once (-I). + * NEWS: Document it, along with change to rm --interactive. + * TODO: Remove entry for implementing rm -I + * src/rm.c (INTERACTIVE_OPTION): New enum value. + (interactive_type): New enum. + (long_opts): Let interactive take an optional argument. + (interactive_args, interactive_types): New option arguments. + (usage): Document -I, --interactive=WHEN. Use program_name + instead of a basename. + (main): New -I option, new behavior to --interactive. + * tests/rm/interactive-once: New tests. + * tests/rm/interactive-always: Ditto. + * tests/rm/Makefile.am (TESTS): Run them. + +2006-02-18 Jim Meyering + + * Makefile.maint (sc_two_space_separator_in_usage): Make the regular + expression match more of the target lines, e.g., those that start with + `-S,' (short option followed by a comma) or that include `=[...]'. + Patch by Nicolas François. + Fix the four offenders thus exposed: + * src/join.c (usage): Use two spaces (not one) to separate the + --first-only option string from its description, so help2man formats + the derived man page properly. + * src/pr.c (usage): Likewise. + * src/uniq.c (usage): Likewise. + * src/install.c (usage): Likewise. + +2006-02-15 Jim Meyering + + * Makefile.maint (alpha beta major): For `make major', ensure that the + version string is of the form N.N[.N]*, where N is one or more digits. + +2006-02-14 Jim Meyering + + * INSTALL: Update from gnulib. + +2006-02-13 Jim Meyering + + * GNUmakefile (all): Emit diagnostics to stderr, not stdout. + +2006-02-12 Jim Meyering + + * Makefile.maint (patch-check): New target. + (local-checks-available): Add to the list. + +2006-02-11 Jim Meyering + + * src/c99-to-c89.diff: New file. + * src/Makefile.am (EXTRA_DIST): Add c99-to-c89.diff. + + * .x-po-check: New file, with exclusions so that `make distcheck' + passes once again. + * Makefile.am (EXTRA_DIST): Add .x-po-check. + + rm -r must remove an empty directory, even if it is inaccessible. + * src/remove.c (close_preserve_errno): New function. + (fd_to_subdirp): Don't print a diagnostic in this function. + Do it from the callers instead, unless rmdir succeeds. + (remove_cwd_entries, remove_dir): Adjust callers. + * tests/rm/empty-inacc: New test for the above. + * tests/rm/Makefile.am (TESTS): Add empty-inacc. + * NEWS: Mention this bug fix. + * tests/rm/rm2: Adjust two expected diagnostics, now that they're + a tiny bit less precise: cannot remove `a/1': ... instead of + cannot open directory `a/1': ... + + * Makefile.maint (syntax-check-rules): Automatically derive this + list of sc_-prefixed rule names. + +2006-02-10 Paul Eggert + + * Makefile.maint (CVS_LIST): Don't assume cvsu is available. + (CVS_LIST_EXCEPT): New macro, to simplify exception-processing. + Most uses of CVS_LIST changed to use CVS_LIST_EXCEPT. + (syntax-check-rules): Bring back sc_changelong. (Hmm, why did it + go away? was that an accident?) + (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value): + (sc_cast_of_alloca_return_value, sc_space_tab, sc_prohibit_atoi_atof): + (sc_error_exit_success, sc_file_system, sc_no_if_have_config_h): + (sc_system_h_headers, sc_sun_os_names, sc_trailing_blank): + (sc_two_space_separator_in_usage, sc_unmarked_diagnostics): + (sc_obsolete_symbols, sc_changelog, sc_prohibit_jm_in_m4): + (sc_useless_cpp_parens, makefile-check, m4-check, po-check): + (author_mark_check, makefile_path_separator_check): + Output line numbers, to simplify navigation of Emacs *compilation* + buffers. + (sc_prohibit_atoi_atof, sc_file_system): + Rework slightly so that Makefile.maint doesn't get reported as a + violation of its own syntax rules. + (sc_dd_max_sym_length): Use ifneq to do nothing, instead of doing + it at run-time (which didn't work with Bison). Fix a makefile typo, + caught by Makefile.maint itself: spaces where a tab should be. + (po-check): Check lib/*.[ch] even if not in CVS; used by Bison, + which copies from ../gnulib/lib/*.[ch] to lib/*.[ch]. + Ignore djgpp and man subdirectories, to avoid false matches with + Bison and coreutils, respectively. Use sort -u to remove the + resulting duplicates. + * gnupload: Rework slightly to avoid bogus warning from + sc_two_space_separator_in_usage. + +2006-02-10 Jim Meyering + + Use gzip's --rsyncable option only if it's available. + * Makefile.maint (gzip_rsyncable): New variable. + (GZIP_ENV): Use it. + +2006-02-08 Jim Meyering + + * Makefile.maint (local-checks-available): Define in terms of + the expansion, $(syntax-check-rules), rather than the single, + top-level target `syntax-check', so that it's easier to exclude + individual rules (via $(local-checks-to-skip)). + (tgz-md5, tgz-sha1, ...): Remove now-unused definitions. + +2006-02-07 Jim Meyering + + * src/system.h (!defined O_DIRECT): If O_DIRECTIO is defined (as it + is on Tru64), define O_DIRECT to that. Patch From James Lemley. + + * tests/help-version (expected_failure_status_vdir): + Redirect an expected disk-full diagnostic to /dev/null. + +2006-02-06 Jim Meyering + + * src/unexpand.c (usage): Use two spaces (not one) to separate the + --first-only option string from its description, so help2man formats + the derived man page properly. + * src/rm.c (usage): Likewise for --no-preserve-root. + * src/chown.c (usage): Likewise. + * src/chgrp.c (usage): Likewise. + + Add a rule to ensure that the above doesn't happen again. + * Makefile.maint (sc_two_space_separator_in_usage): New rule. + (syntax-check-rules): Add it. + * .x-sc_two_space_separator_in_usage: New empty file. + * Makefile.am (EXTRA_DIST): Add .x-sc_two_space_separator_in_usage. + +2006-02-06 Jim Meyering + + * src/cp.c (usage): Use two spaces (not one) to separate each + option string from its description, so help2man formats the + derived man page properly. + * src/mv.c (usage): Likewise. + Patch from Nicolas François in http://bugs.debian.org/351601. + +2006-02-04 Jim Meyering + + * src/copy.c (copy_internal): cp -RL would fail when encountering + the same directory more than once in the hierarchy beneath a single + command-line argument. That is legitimate, e.g. when there are + two or more symbolic links, each pointing to some directory that + would not otherwise be copied. Reported by Christophe LYON. + * tests/cp/cp-deref: New file. Test for today's fix. + * tests/cp/Makefile.am (TESTS): Add cp-deref. + * NEWS: Document this. + +2006-02-03 Jim Meyering + + * configure.ac: Require automake-1.9.6, not 1.8.3. + +2006-02-01 Paul Eggert + + * src/od.c (usage): Mention that -t a ignores high order bit. + Documentation problem reported by Ed Avis. + +2006-02-01 Jim Meyering + + * src/pwd.c (find_dir_entry): Remove unused local, `ent_sb_valid'. + +2006-01-30 Paul Eggert + + * src/head.c (main): Use a better diagnostic when someone uses a + trailing numeric option in an invalid way. Problem reported by + Karl Berry. + * src/tail.c (parse_options): Likewise. + +2006-01-30 Jim Meyering + + * man/wc.x: Include `count' keyword in man page synopsis, + per suggestion from http://bugs.debian.org/181585. + +2006-01-24 Paul Eggert + + * src/df.c (show_dev): If the file system claims to have + more available than total blocks, report the number of used + blocks as being total - available (a negative number) rather + than as garbage. Problem reported by Toralf Foerster. + +2006-01-24 Jim Meyering + + * src/tail.c (tail_forever): Don't exit-nonzero when an attempt + to put a regular file in O_NONBLOCK mode fails with EPERM. + That happens on Linux (up to 2.6.15) when using tail -f on a file with + the append-only attribute. Reported by Dean Gaudet. For details, + see http://savannah.gnu.org/bugs/?func=detailitem&item_id=15473. + * NEWS: Mention this fix. + * tests/tail-2/append-only: New file. Test for the above. + * tests/tail-2/Makefile.am (TESTS): Add append-only. + * tests/Makefile.am (check-root): Add tail-2/append-only + +2006-01-21 Jim Meyering + + * NEWS: Mention fts-related improvements and bug fixes. + +2006-01-19 Jim Meyering + + * tests/fmt/basic (pfx-1, pfx-2): New tests, to demonstrate the bug + reported as http://bugs.debian.org/147577. Forwarded by Thomas Hood. + +2006-01-18 Jim Meyering + + * tests/du/Makefile.am (TESTS): Add long-from-unreadable. + +2006-01-17 Jim Meyering + + Now that fts no longer changes the current working directory, adjust + its clients accordingly -- note that du.c uses fts but doesn't need + any adjustment, since it doesn't operate on the actual files, + but rather just uses the stat buffers provided by fts. + + * src/chown-core.c: Include "openat.h". + Don't include "lchown.h". + (restricted_chown): Accept a new parameter, CWD_FD, and use it in + calling openat, lchownat, chownat, rather than open, lchown, chown. + Update caller. + * src/chmod.c: Include "openat.h". + (process_file): Use chmodat (fts->fts_cwd_fd,... in place of chmod (... + + * tests/du/long-from-unreadable: New test, to exercise one small + corner of fts.c. + +2006-01-13 Jim Meyering + + * tests/Makefile.am (SUBDIRS): Add comments discouraging the + addition of new directories under tests/. + + * tests/acl: Redirect stdin to /dev/null. Otherwise, FreeBSD 5.0's + getfacl would hang. + +2006-01-12 Jim Meyering + + * tests/du/long-sloop: Adjust not to hard-code the expected + diagnostic corresponding to ELOOP. Solaris' diagnostic differs + from that of GNU libc. Reported by Paul Eggert. + + * tests/du/long-sloop: Create file at end of symlink chain. + + * tests/misc/test: New file, with a test for one of the + bugs fixed by yesterday's test.c changes. + * tests/misc/Makefile.am (TESTS): Add test. + +2006-01-11 Jim Meyering + + * tests/du/long-sloop: New file. Test for today's fts.c bug fix. + That bug could make du -L, chgrp -L, or chown -L fail to diagnose + a very long sequence of symbolic links (not necessarily a loop). + * tests/du/Makefile.am (TESTS): Add long-sloop. + +2006-01-11 Paul Eggert + + * src/test.c (test_syntax_error): Append a newline. All callers + changed, except for the ones that didn't already append a newline. + Bug reported by Eric Blake. + +2006-01-11 Jim Meyering + + * src/system.h (X2NREALLOC): Now that verify_true is no longer + void, cast its result to void, to avoid gcc's warning that + ``left-hand operand of comma expression has no effect''. + (DECIMAL_DIGIT_ACCUMULATE, X2REALLOC): Likewise. + +2006-01-10 Jim Meyering + + * tests/chmod/no-x: Add a test for today's fts.c fix. + +2006-01-10 Jim Meyering (tiny change) + + * src/ls.c (gobble_file): Use DTTOIF only if it's defined. + This is necessary for Dragonfly. Patch by Joerg Sonnenberger. + +2006-01-10 Paul Eggert + + * src/system.h (X2NREALLOC, X2REALLOC, DECIMAL_DIGIT_ACCUMULATE): + Use verify_true instead of verify_expr, to sync with gnulib. + +2006-01-08 Jim Meyering + + * src/date.c (usage): Adjust the formatting of the entries for + %::z and %:::z (separate with two spaces, not one) so that help2man + formats them properly. Reported by Philip Rowlands. + +2006-01-06 Paul Eggert + + * configure.ac (gl_IGNORE_UNUSED_LIBRARIES): Add. + +2006-01-06 Jim Meyering + + * Makefile.maint (copyright-check): Use date +%Y in place of + hard-coded 2005. + + * src/remove.c (rm_1): Remove `static' attribute on local `status'. + First off, the attribute should have been `volatile' (not static) + to avoid longjmp-related risk of clobber. Secondly, now there is + no longer any risk of a local variable being clobbered, so there's + no need for any attribute at all. + +2006-01-05 Jim Meyering + + * src/remove.c: Give a few functions the inline attribute. + (AD_pop_and_chdir): Use gotos to avoid some duplication. + (AD_push): Rewrite an assertion so that the entire computation + goes away when assertions are turned off. + + * src/tail.c (ENOSYS) [!defined ENOSYS]: Don't define here. + It's already defined in "system.h". + * Makefile.maint: Add a FIXME comment. + +2006-01-04 Jim Meyering + + * ChangeLog: Remove entries from 2005-10-22 and earlier. + * ChangeLog-2005: New file, for entries up to version 5.92. + +2006-01-03 Jim Meyering + + * tests/du/no-x: Also allow a slightly different diagnostic -- the + one you get when using openat-enabled fts.c and du (coming soon). + * tests/chmod/no-x: Likewise. + * tests/chgrp/no-x: Likewise. + + * src/system.h (O_DIRECTORY) [!defined O_DIRECTORY]: Define. + +2006-01-02 Paul Eggert + + * src/chown-core.c (RC_do_ordinary_chown): New enum value. + (restricted_chown): Return it, if the file cannot be accessed due + to EPERM, or if no uid or gid are required, or if the file is + neither a directory nor a regular file. Rewrite to avoid gotos. + (change_file_owner): Handle RC_do_ordinary_chown case. + Rewrite to avoid gotos. + * tests/chgrp/basic: Make sure we can change the group of + inaccessible files. + + * src/date.c (usage): Explain %g, %G, and %V a bit better. + +2006-01-02 Jim Meyering + + * src/copy.c (set_owner): Correct a comment. + + * src/tail.c (parse_options): Change warning to say that --retry + is useful `mainly' (not `only') when following by name. + Reported here: http://bugs.debian.org/273781 + +2006-01-01 Paul Eggert + + * NEWS: Document that mkfifo and mknod -m no longer set special bits. + * src/copy.c: Include lchmod.h. + (copy_internal): Use lchmod rather than chmod. + * src/cp.c: Include lchmod.h. + (re_protect, make_dir_parents_private): Use lchmod rather than chmod. + * src/mkdir.c: Include lchmod.h. + (usage): Clarify -m's operation. + (main): Use lchmod rather than chmod. Don't use lchmod unless the + new mode contains bits outside the 777 range. + * src/mkfifo.c (usage): Clarify -m's operation. + (main): If -m is given, don't invoke chmod; use umask 0 instead. + Report an error if -m asks for bits outside the 777 range. + * src/mknod.c (usage, main): Likewise. + + * src/mkdir.c, src/mkfifo.c, src/mknod.c: Undo 2005-12-19 changes. + + ----- + + Copyright (C) 2006 Free Software Foundation, Inc. + + Copying and distribution of this file, with or without + modification, are permitted provided the copyright notice + and this notice are preserved. diff --git a/src/bin/coreutils/ChangeLog-2007 b/src/bin/coreutils/ChangeLog-2007 new file mode 100644 index 0000000000..078e833b3f --- /dev/null +++ b/src/bin/coreutils/ChangeLog-2007 @@ -0,0 +1,4022 @@ +2007-12-31 Jim Meyering + + * doc/coreutils.texi (Block size): Put braces around multi-digit + exponents. Reported by Darrel Francis. + + Add a syntax check, so this doesn't recur. Reorganize existing checks. + * doc/Makefile.am (sc-exponent-grouping): + (syntax_checks): New variable. + (sc-avoid-io, sc-avoid-non-zero, sc-avoid-timezone): + (sc-avoid-zeroes, sc-use-small-caps-NUL): New rules, extracted + from check-texinfo. + (check-texinfo): Depend on $(syntax_checks). + +2007-12-30 Mike Frysinger + + * src/dircolors.hin (TERM): Add gnome-256color. + +2007-12-21 Ralf Wildenhues + + * doc/coreutils.texi: Fix a typo. Avoid the term `relationals'. + +2007-12-20 Jim Meyering + + Use comma-separated list in ./configure --help output. + * configure.ac: Map commas to spaces in excluded-program list. + Use a comma-separated list, not a space-separated one. + * m4/include-exclude-prog.m4 (gl_INCLUDE_EXCLUDE_PROG): + Expect list of program names to be comma-separated. + Reported by Jan Bauke Douma. + + Avoid another "make check" failure due to omitted programs. + * tests/test-lib.sh (require_built_): New function. + * tests/misc/groups-version: Use it to skip this test if + either groups or id is not built. + + Avoid spurious "make check" failures due to omitted programs. + * man/Makefile.am (distcheck-hook): Make check rules dependents of + this target, not of check-local, so that people aren't distracted by + failures due to programs omitted via --enable-no-install-program=... + +2007-12-19 Paul Eggert + + * src/uniq.c (usage): Improve wording in --help "Note". + +2007-12-18 Jim Meyering + + * src/uniq.c (usage): Note that sorting uniq's input is often useful. + Suggested by Eric Blake. + (usage): Say "key-selection", not "field-selection". + Quote example commands consistently. + +2007-12-15 Jim Meyering + + Version 6.9.91. + + * Makefile.cfg (gpg_key_ID): Use new, longer signing subkey. + +2007-12-12 Jim Meyering + + * tests/mv/part-symlink: Redirect diff output to stderr. + +2007-12-11 Jim Meyering + + Add a test to exercise today's bug fix. + * tests/misc/selinux: Test for today's bug fix. + * NEWS: Mention the SELinux "ls -l" fix. + +2007-12-11 Paul Eggert + + "ls -l" wouldn't output "+" on SELinux hosts unless -Z was also given. + * src/ls.c (gobble_file): Also get the file context if -l is specified. + Treat getfilecon failures like file_has_acl failures. + (UNKNOWN_SECURITY_CONTEXT): New constant. + (clear_files): Don't free it. + (gobble_file): Set unknown security contexts to it; that way, we + don't have to have special cases for unknown contexts. + (print_long_format, print_file_name_and_frills): Don't worry + about scontext being null, since it's always some string now. + +2007-12-11 Jim Meyering + + * NEWS: Add the "Bug fixes" heading. + +2007-12-09 Jim Meyering + + "rm" as root would fail to unlink a non-directory on OS X 10.4.x + * src/remove.c (remove_entry) ["can unlink directories"]: Fix a + mistakenly reversed condition. + * NEWS: Mention this bug fix. + Reported by Pieter Bowman. + +2007-12-08 Jim Meyering + + * src/c99-to-c89.diff: Adjust shred.c offsets. + +2007-12-04 Jim Meyering + + Reflect change in gnulib: don't include getpagesize.h, + now that it's provided by unistd.h. + * src/cat.c: Don't include getpagesize.h. + * src/copy.c: Likewise. + * src/dd.c: Likewise. + * src/shred.c: Likewise. + * src/split.c: Likewise. + +2007-12-02 Jim Meyering + + Copy a .po file into place also when the target doesn't exist. + * bootstrap (gnulib_tool): ... not just when the checksum differs. + So now, if I manually remove po/xx.po, rerunning bootstrap will + copy the latest into place. + + Make my-distcheck depend on "check". + * Makefile.maint (my-distcheck): Also depend on "check", so I can't tag + and release something that fails "make check" (however harmless) when + run in a checked-out-from-git dir, but not in the distributed tarball. + + * NEWS: Add the usual "Noteworthy changes in release 6.9.91..." line. + + Remove just-installed su, if unable to make it set-UID root. + Normally, su isn't even installed. However, if you configure with + --enable-install-program=su, and then install with insufficient + privileges, we now make sure to remove the just-installed binary. + * src/Makefile.am (install-exec-hook): Rename from install-exec-local, + so that this rule is guaranteed to be run *after* installation. + If unable to chown and chmod the installed "su" program, remove it. + Reported by Greg Schaefer. + +2007-12-01 Bob Proulx + + Make existing-perm-race executable. + * tests/cp/existing-perm-race: Update file mode. + +2007-12-01 Jim Meyering + + Version 6.9.90. + + * NEWS: Remove the now-untrue statement about cp vs. dangling symlinks + + Change release procedure: tag *before* running e.g., "make stable". + * Makefile.maint (vc-dist): Don't tag. Now, you must apply the tag + before running "make beta", "make stable", etc. + (vc-tag-check): Remove rule. No longer makes sense. + + * Makefile.maint (vc-tag-check): Correct check for existing git tag. + + Defer NEWS and ChangeLog checks until after the version-changing tag. + * Makefile.maint (alpha beta major): Don't depend on the + news-date-check changelog-check targets. They must fail before + applying the version-changing tag. Instead, run them after "vc-dist". + + * NEWS: Record release date and new version number. + Mention some of the SELinux changes. + * src/stat.c (main): Adjust a comment. + + * TODO: Add some entries (documentation needed), + and remove the one for mktemp. + + Add "extern" keyword to declaration of cp_options_default. + * src/copy.c (cp_options_default): Mark as "extern", so the + "sc_tight_scope" part of "make distcheck" passes. + +2007-12-01 Jim Meyering + + Change comments: say bug present up to coreutils-6.9, not fixed in 6.10. + * tests/cut/Test.pm: Adjust comment. + * tests/misc/cut: Likewise. + * tests/misc/ls-misc: Likewise. + * tests/misc/od: Likewise. + * tests/misc/stty-invalid: Likewise. + * tests/tr/Test.pm: Likewise. + +2007-11-29 Paul Eggert + + Add a test for cp -p and existing file permissions. + * tests/cp/Makefile.am (TESTS): Add existing-perm-race. + * tests/cp/existing-perm-race: New test. It isn't much of a + test yet, since it's hard to catch the race, but it has a FIXME + that will let us do a better test later. + +2007-11-28 Paul Eggert + + Fix a security race with "cp -p A B" when B already exists. + * src/copy.h (struct cp_options): New member owner_privileges. + * src/copy.c (USE_ACL): Define to 0 if not defined, for convenience. + (owner_failure_ok): New function. + (set_owner): Avoid a security-related race by doing an extra chmod + first if it looks like there might be trouble right after a chown. + Accept a source struct stat rather than a uid and gid, and + accept a boolean NEW_DST and destination struct stat. + All callers changed. + * src/copy.h (cp_options_default): New function, replacing the + old chown_privileges. + * src/copy.c (cp_options_default): Likewise. + * src/cp.c (cp_option_init): Use it. + * src/install.c (cp_option_init): Likewise. + * src/mv.c (cp_option_init): Likewise. + +2007-11-30 Jim Meyering + + Move the very-expensive file into test-lib.sh. + * tests/very-expensive: Remove file. + * tests/test-lib.sh (very_expensive_): New function. + * tests/Makefile.am (EXTRA_DIST): Remove very-expensive. + * tests/cp/perm: Call the new function, rather than sourcing the file. + * tests/tail-2/assert: Likewise. + * tests/tail-2/assert-2: Likewise. + * tests/du/2g: Likewise. + + Avoid a spurious test failure when build directory is set-GID. + * tests/cp/fail-perm: Ensure that '.'s set-GID bit is off. + + Be extra careful to quote $abs_top_builddir-derived names. + * tests/misc/ls-misc (shell_quote): New function. + Use it to quote file names derived from $abs_top_builddir, + in case it contains shell meta-characters. This is not currently + needed, since CuTmpdir detects the fishy name and skips the test. + But it's important enough to add the extra protection. + Reported by Ralf Wildenhues. + + Include test name in the "unsafe working directory name" diagnostic. + * tests/CuTmpdir.pm (import): If $ME is '-', use $prefix. + +2007-11-30 Ralf Wildenhues + + Add quotes to protect against white space in build dir name. + * tests/check.mk (TESTS_ENVIRONMENT): Quote $(abs_srcdir). + * tests/chmod/setgid: Quote absolute names. + * tests/misc/help-version: Likewise. + * tests/misc/pwd-unreadable-parent: Likewise. + * tests/rmdir/ignore: Likewise. + * tests/test-lib.sh: Likewise. + + Define `tst', for CU_TEST_NAME. + * build-aux/check.mk (am__check_pre): Set `tst', for + CU_TEST_NAME in tests/check.mk. + + * tests/CuTmpdir.pm (END): Do not do the cleanup if $dir is not + defined, because it then goes wild and changes the mode of all + directories below $HOME. Undefined $dir can happen if the test + is to be skipped because of an unsafe working directory name. + +2007-11-28 Paul Eggert + + Close a file descriptor leak when cp --preserve=context fails. + * src/copy.c (copy_reg): Close dest_desc too, if getfscreatecon + or fsetfilecon fail. + +2007-11-28 Jim Meyering + + * README: Document the known problem with gettext <= 0.17. + +2007-11-28 Paul Eggert + + * gl/modules/randread (Depends-on): Remove nonexistent rand-isaac. + +2007-11-27 Jim Meyering + + Don't block use of 'cat' or 'wc' in "make check". + * Makefile.maint (my-distcheck): Add "cat" and "wc" to the list + of programs that we can't blacklist. + + Fix md5sum+sha*sum on sparc: regenerate files with latest autoconf. + * configure et al: Regenerate with very latest version of autoconf + (v2.61a-312-gb524b0f), to fix md5sum and sha*sum miscompilation + on big-endian systems (like sparc) due to lack of the required + definition in of WORDS_BIGENDIAN in lib/config.h. + +2007-11-26 Jim Meyering + + setuidgid.c: more cleanup + * src/setuidgid.c: Include "mgetgroups.h". + (main): Don't presume there's a fixed limit on the maximum number + of group IDs. Don't use NGROUPS; it's artificially low. + Change the name of a local: s/gids_count/n_gids/. + Remove non-portable "const": s/const int tmp =.../int tmp =.../ + +2007-11-25 Jim Meyering + + Document install's -D option. + * doc/coreutils.texi (install invocation): Document -D. + Reported by Akim Demialle. + + setuidgid: Update --help output. + * src/setuidgid.c (usage): Describe -g GID[,GID1...] option. + Mention that USER may be a numeric ID or a user name. + +2007-11-24 Jim Meyering + + Tweak new test. + * tests/cp/preserve-gid: Split some long lines. + Prepend "+" to numeric uid and gid chown arguments, on principle. + Use skip_test_. + + setuidgid: minor clean-up. + * setuidgid.c: Include "xstrtoul.h". + (main): Detect overflow in string-to-gid_t and -to-uid_t conversions. + Improve diagnostics. + + * src/setuidgid.c: Normalize leading white space: no more TABs. + + Test the new feature: cp -p preserves the GID whenever possible. + * tests/cp/preserve-gid: New file. Test for today's change. + * tests/cp/Makefile.am (TESTS): Add preserve-gid. + * tests/Makefile.am (all_t): Add tc. + (tc): New target. + + setuidgid: accept numeric UID, and new option -g GID,GID1,GID2,... + * src/setuidgid.c: Add functionality for the new test above. + + "cp -p" tries to preserve GID even if preserving the UID fails. + * NEWS: Mention this new feature. + * src/copy.c (set_owner): Try to preserve just the GID, + when initial fchown/lchown fails. + * src/cp.c (re_protect): Likewise. + +2007-11-23 Jim Meyering + + * src/runcon.c (main): Remove unused parameter, "envp". + + Add tests to show new class of strings accepted by date -d. + * tests/misc/date (rel-1day, rel-plus1): New tests for the recent + change in gnulib's getdate.y. + * NEWS: Mention the fix. + +2007-11-22 Jim Meyering + + Quiet warnings about unused parameters. + * src/copy.c (set_author) [!HAVE_STRUCT_STAT_ST_AUTHOR]: + "Use" each of the parameters. + + * GNUmakefile: Correct the "rerunning..." diagnostic. + + Make it easier to diagnose PATH-induced "make distcheck" failures. + * Makefile.maint (write_loser): Define. + (my-distcheck): Use an always-failing wrapper script, that gives + a diagnostic, not "false". + Run only "make -C tests check" with the restrictive PATH. + Run the new gnulib-tests/ with the usual PATH. + + cp: by default, refuse to copy through a dangling destination symlink + * NEWS: Mention this change. + * doc/coreutils.texi (cp invocation): Describe the new behavior. + * src/copy.c: No longer include "canonicalize.h". + (copy_reg): Upon failure to open a dangling destination symlink, + don't canonicalize the name, but rather fail (default) or, with + POSIXLY_CORRECT, repeat the open call without O_EXCL (potentially + dangerous). + * src/copy.h (struct cp_options) [open_dangling_dest_symlink]: + New member. Reorder the others, grouping "bool" and "enum" + members together. + * tests/cp/thru-dangling: Test for changed and new behavior. + * src/cp.c (cp_option_init): Initialize new member. + * src/install.c (cp_option_init): Likewise. + * src/mv.c (cp_option_init): Likewise. + +2007-11-21 Pádraig Brady + + * doc/coreutils.texi (split invocation): Improve the + descriptions of the split command options. + +2007-11-21 Jim Meyering + + * src/c99-to-c89.diff: Adjust seq.c offsets. + +2007-11-18 Paul Eggert + + * src/seq.c (print_numbers): Rewrite in an attempt to avoid the + more-general rounding issues exposed by the previous patch. + +2007-11-18 Jim Meyering + + * src/c99-to-c89.diff: Adjust seq.c offsets. + + Remove unused parameter in remove.c. + * src/remove.c (fd_to_subdirp): Remove unused parameter. + (remove_cwd_entries, remove_dir): Update callers. + + bootstrap: work also with 4-argument variant of AC_INIT (from gnulib) + 2007-11-18 Sergey Poznyakoff + * bootstrap (gnulib_extra_files): Adjust sed command. + +2007-11-17 Jim Meyering + + Correct preceding patch. + * src/seq.c (print_numbers): Also handle first < last && step < 0. + * tests/misc/seq [empty-rev]: New test for this case. + + "seq .1 .1" would mistakenly generate no output on some systems + * NEWS: Say this. + * src/seq.c (print_numbers): Handle another floating point corner case. + This avoids failure of seq's eq-wid-7 test on FreeBSD 6.1. + +2007-11-16 Paul Eggert + + Port tests/rmdir/ignore away from GNU/Linux. + * tests/rmdir/ignore: Don't assume that rmdir($PWD) will fail + with errno==ENOTEMPTY when $PWD is not empty; Posix also allows + rmdir to fail with errno==EBUSY. + +2007-11-16 Jim Meyering + + Avoid an obscure new "make distcheck" failure. + * Makefile.maint (my-distcheck): Also allow 'mv', for its use + in gnulib-tests/Makefile. + +2007-11-16 Paul Eggert + + Port readlink-fp-loop to Solaris. + * tests/misc/readlink-fp-loop (symlink_loop_msg): New var, + which records the symlink-loop message, whose wording is + not standardized by Posix. Do not rely on "echo x > p/1" + to work when p/1 has a lot of indirect symlinks. (I'm surprised + that it works on Linux. Perhaps a Linux bug?) + +2007-11-15 Paul Eggert + + Port to Solaris 'make' and use a Posixish shell on Solaris. + * bootstrap.conf (gnulib_modules): Add gnu-make, posix-shell. + * build-aux/check.mk (SHELL): Set to $(PREFERABLY_POSIX_SHELL), + so that commands can assume Posix syntax. + (ENABLE_HARD_ERRORS, TEST_LOGS): Don't use GNU Make's "?=" syntax. + (SH_E_WORKAROUND): New macro. + (am__check_pre, $(TEST_SUITE_LOG)): Use it. + (am__check_pre): Fail if "mkdir" fails. Use $(SHELL) + rather than relying on the "#!/bin/sh" in the file, so that tests + can use Posix syntax. + (am__check_pre, am__tty_colors): Use $$src rather than $$<, to + support the Posix-make $(TEST_LOGS) rule. + (%.log: %.test, %.log: %$(EXEEXT)): Remove unused inference rules + that rely on a GNU Make extension and cause Solaris 'make' to fail. + (SUFFIXES): New macro, so that we can use Posix style inference rules. + (%.log: %): Use this rule only if GNU_MAKE. + Set $$src so that macros can use $$src rather than $$<. + (CHECK-FORCE, DEPENDENCY, $(TEST_LOGS)): New macros and rules, + which rely only on Posix 'make' semantics, and are used only with + non-GNU 'make' implementations. $(TEST_LOGS) invokes 'make' + recursively (and a bit inefficiently) to simulate the GNU 'make' + rules. + (.log.html): Renamed from "%.html: %.log", so that it relies only + on Posix 'make' semantics. + (check-clean, .PHONY): Do not depend on check-clean-local, since + Solaris 'make' complains about nonexistent rules like that. + * src/Makefile.am (SUFFIXES): Remove; no longer needed. + (groups): Use a specific rule rather than an inference rule that + is only instantiated once. The inference-rule approach does not + work with Solaris 'make', which gets confused by the "groups: + Makefile" line. It's not clear from the Posix spec that Solaris + 'make' is buggy here, so instead of worrying about it, rewrite + the makefile so that it clearly conforms to Posix. + * tests/check.mk (TESTS_ENVIRONMENT): Export PACKAGE_BUGREPORT. + GNU 'make' does this automatically for us, but Solaris 'make' + doesn't. + +2007-11-15 Paul Eggert + + Port to Solaris 8 perl, which does not support "use warnings;". + * tests/dd/skip-seek: Skip test if "use warnings;" fails. + * tests/du/files0-from: Likewise. + * tests/misc/base64: Likewise. + * tests/misc/basename: Likewise. + * tests/misc/cut: Likewise. + * tests/misc/date: Likewise. + * tests/misc/dircolors: Likewise. + * tests/misc/dirname: Likewise. + * tests/misc/expand: Likewise. + * tests/misc/expr: Likewise. + * tests/misc/factor: Likewise. + * tests/misc/fmt: Likewise. + * tests/misc/fold: Likewise. + * tests/misc/head-elide-tail: Likewise. + * tests/misc/ls-misc: Likewise. + * tests/misc/md5sum: Likewise. + * tests/misc/md5sum-newline: Likewise. + * tests/misc/mktemp: Likewise. + * tests/misc/od: Likewise. + * tests/misc/paste-no-nl: Likewise. + * tests/misc/pr: Likewise. + * tests/misc/seq: Likewise. + * tests/misc/sha1sum: Likewise. + * tests/misc/sha1sum-vec: Likewise. + * tests/misc/sha224sum: Likewise. + * tests/misc/sha256sum: Likewise. + * tests/misc/sha384sum: Likewise. + * tests/misc/sha512sum: Likewise. + * tests/misc/sort-merge: Likewise. + * tests/misc/stat-printf: Likewise. + * tests/misc/sum: Likewise. + * tests/misc/test-diag: Likewise. + * tests/misc/tsort: Likewise. + * tests/misc/unexpand: Likewise. + * tests/misc/wc-files0-from: Likewise. + * tests/misc/xstrtol: Likewise. + * tests/mv/i-1: Likewise. + * tests/rm/empty-name: Likewise. + * tests/rm/unreadable: Likewise. + +2007-11-15 Andreas Schwab + + * m4/include-exclude-prog.m4 (gl_REMOVE_PROG): Fix syntax error. + Remove trailing space from result. + +2007-11-15 Jim Meyering + + Avoid misbehavior of a cross-device "mv" or "install". + Those programs must not dereference a destination symlink. + * src/copy.c (copy_reg): Don't treat a dangling destination symlink + differently in move mode. In move mode, the only way the added + O_EXCL can cause failure is when some other process has recreated + the file this code unlinked a few instructions before. + +2007-11-14 Jim Meyering + + Another bootstrap kludge. + * bootstrap: Ensure gnulib-tests/test-*.sh are executable + + #ifdef-out matchpathcon-related code, for now. + * src/install.c (setdefaultfilecon): #ifdef-out all of the + matchpathcon-related code, until it's more efficient. + (setdefaultfilecon): Instead of the above, stub-out the entire function. + + Use gnulib's stpncpy module, now required by install.c + * bootstrap.conf (gnulib_modules): Add stpncpy. + + Enable gnulib-tool's --with-tests option. + * bootstrap: After all is done, transform the generated + gnulib-tests/gnulib.mk. + * bootstrap.conf (gnulib_tool_option_extras): Set it here. + * gnulib-tests/Makefile.am: New file. + * Makefile.am (SUBDIRS): Add gnulib-tests. + * configure.ac (AC_CONFIG_FILES): Add gnulib-tests/Makefile. + * m4/jm-macros.m4 (coreutils_MACROS) [ARGMATCH_DIE_DECL]: Omit the + "extern " prefix to "void usage ()", so that the macro string value can + be used to construct a function definition in gnulib's test-argmatch.c. + +2007-11-12 Benno Schulenberg + + Clarify description of cp's -a option. + * src/cp.c (usage) [-a]: Remove unnecessary 'P'. + Since option -d of 'cp' includes the function of -P, mentioning the + latter in the description of option -a is redundant and therefore + slightly confusing, as the reader tries to figure out what it adds. + * doc/coreutils.texi (cp invocation): Likewise: s/-dpPR/-dpR/. + +2007-11-09 Jim Meyering + + bootstrap: fix typo to enable use of $gnulib_tool_option_extras. + * bootstrap (gnulib_tool_options): Add a space before the use + of $gnulib_tool_option_extras, so that it's separated from the + preceding argument. + + install+SELinux: reduce a 12x performance hit to ~1.5x + * src/install.c (setdefaultfilecon): Call matchpathcon_init_prefix, + to mitigate what would otherwise be a large performance hit due to + the use of matchpathcon. + Dan Walsh suggested the use of matchpathcon_init_prefix. + * gl/lib/se-selinux.in.h (matchpathcon_init_prefix): Define. + +2007-11-08 Jim Meyering + + Adapt to gnulib's s/jm_/gl_/ cache variable renaming. + * configure.ac: Change the cache variable name prefix "jm_" to "gl_", + to match today's change in gnulib. + +2007-11-05 Jim Meyering + + Fix bootstrap failure to handle files like lib/uniwidth/cjk.h. + * bootstrap (cp_mark_as_generated): Create any required parent + destination directories before copying a file into place. + + * src/c99-to-c89.diff: Adjust offsets. + + Don't use GNU-sed-specific \< \> operators here, either. + * m4/include-exclude-prog.m4 (gl_REMOVE_PROG): Use a loop, as below. + + Use tighter regexps when performing name substitution. + * man/Makefile.am (mapped_name): Add ^ and $$ anchors. + + Don't use GNU-sed-specific \< \> operators. + * configure.ac (MAN): Transform ginstall.1 to install.1 using + a loop, rather than sed with \<...\>. + Problem reported by Bruno Haible. + Andreas Schwab reminded me that \< and \> are not portable. + + Get git-version-gen from gnulib. + * build-aux/git-version-gen: Remove file. + * build-aux/.gitignore: Add git-version-gen. + * bootstrap.conf (gnulib_modules): Add git-version-gen. + +2007-11-03 Jim Meyering + + git-version-gen: Sync from autoconf's version. + * build-aux/git-version-gen: Run git-status + + Sync copyright and scriptversion bits from gnulib. + * build-aux/git-version-gen: No semantic change. + + Change the first '-' to '.' in the snapshot version string, + e.g., 6.9-377-08144 -> 6.9.377-08144 + * build-aux/git-version-gen: ... and add comments. + + seq: add another test for the %% bug. + * tests/misc/seq (fmt-c): Test the other fixed case, too. + +2007-11-03 Paul Eggert + + Fix bug with "seq 10.8 0.1 10.95", plus another bug with %% in format. + + * NEWS: Mention the %%-in-format bug fix. + * src/seq.c (struct layout): New type. + (long_double_format): New arg LAYOUT. Fill it in. Fix mishandling + of %% in formats. + (print_numbers): New arg LAYOUT. Don't convert LAST to output format + when deciding whether to go slightly past LAST. Instead, convert + X to output format and back. This fixes a bug reported by + Andreas Schwab in + + where "seq 10.8 0.1 10.95" would output 11.0 on platforms where + 10.95 rounds to a value that prints as 11.0 when only one digit + past the decimal point is asked for. + (main): Compute layout, for benefit of print_numbers. + * tests/misc/seq (float-3): Undo previous change, since the bug + should be fixed now. + (fmt-b): New test, for the %% bug. + +2007-11-01 Jim Meyering + + * tests/misc/printf-surprise: Correct sed transform. + Reported by Bob Proulx. + + Add example inspired by "make dist" running gzip and lzma in sequence. + * doc/coreutils.texi (tee invocation): Show how to run tar just + once, compressing the tee'd output streams in parallel. + + Say that the first process substitution example is contrived. + * doc/coreutils.texi (tee invocation): ... and show how to do + it properly. Pointed out by James Antill. + + Use mktemp, not mkdtemp, to create test directories. + * tests/test-lib.sh: Use the mktemp binary we've just built, + not the mkdtemp script. + * tests/mkdtemp: Remove file. + * tests/Makefile.am (EXTRA_DIST): Remove mkdtemp. + + Adjust a seq subtest not to depend on the vagaries of floating point. + * tests/misc/seq (float-3): Use 10.94 as the endpoint, not 10.95, + since 10.95 was precisely in the middle of the interval, and with + a %.1f format could map to either 10.9 or 11.0. + Reported by Mike Frysinger + + Make the new printf-surprise test more precise. + * tests/test-lib.sh (require_ulimit_): New function. + * tests/misc/printf-surprise: Use ulimit -v to trigger the fixed bug, + and rather than checking printf's exit status (which would go wrong + on FreeBSD 6.1, since their printf(3) function doesn't require + lots of memory in this case) simply test whether it outputs + the first 10 bytes. + + Accommodate FreeBSD 6.1 hard-link-to-symlink differences. + * tests/cp/same-file: Detect when linking to a symlink links to + the target of the symlink (FreeBSD 6.1 does this, Linux does not), + and skip the few tests that would otherwise fail. + Redirect output of final comparison to stderr, since all stdout + is already redirected. + +2007-10-31 Jim Meyering + + Fix a "make distcheck" failure. + * Makefile.maint (my-distcheck): Don't stub-out dirname, + since build-aux/check.mk now uses it. + + * bootstrap.conf (gnulib_modules): Add xprintf-posix. + +2007-10-30 Jim Meyering + + Avoid seq floating-point test failure on FreeBSD 6.1. + * tests/misc/seq (float-4): Also accept -0.0. + +2007-10-29 Jim Meyering + + Change a "make dist" diagnostic. + * GNUmakefile: Don't imply that $(_curr-ver) is the new version string. + +2007-10-29 Bob Proulx + + Improve color terminal escape usage. + * build-aux/check.mk (am__tty_colors): Use 'tput' to deduce + terminal color capabilities. + +2007-10-29 Jim Meyering + + Don't try to colorize a dumb terminal. + * build-aux/check.mk (am__tty_colors): Skip colors if $TERM is "dumb". + Thanks to Bob Proulx. + + Remove gnulib's printf-posix module, for now. + * bootstrap.conf (gnulib_modules): It caused too many test failures. + + Remove spurious semicolon after "else". + * build-aux/check.mk (am__tty_colors): Fix syntax error. + + If $TERM is empty, don't use colors. This helps the buildbot, + since it produces its result in an environment with a tty, but + we don't want color codes in that case. + * build-aux/check.mk (am__tty_colors): Test for nonempty $TERM. + Suggestion from Bob Proulx. + + Always initialize terminal colorization string variables. + * build-aux/check.mk (am__tty_colors): Always initialize red, grn, etc., + In case they're defined in the environment. + + Avoid test failure in non-srcdir build vs. the git tree. + * tests/check.mk (vc_exe_in_TESTS): Run this test only in a + srcdir build directory. Reported by Andreas Schwab. + +2007-10-28 Jim Meyering + + Define ENOTSUP, not ENOSYS. Needed on OpenBSD 3.9. + * gl/lib/se-context.in.h (ENOTSUP): Define if missing. + * gl/lib/se-selinux.in.h: Likewise. + + Define ENODATA, for FreeBSD 5.0 and 6.1. + * src/system.h (ENODATA): Define, if missing. + + Run autoreconf, not just autoconf, to avoid warnings. + * GNUmakefile (dummy): Otherwise, we'd sometimes get a warning + about autoconf version mismatch between what was used to generate + aclocal.m4 and the currently-running autoconf. + + Require gnulib's printf-posix module, to support Interix. + * bootstrap.conf (gnulib_modules): Add printf-posix. + + Help xgettext recognize more printf-style format strings. + * bootstrap.conf (XGETTEXT_OPTIONS): Add directives for + error, error_at_line, xasprintf, xfprintf and xprintf. + +2007-10-27 Jim Meyering + + Adjust format string so msgfmt doesn't object. + * src/df.c (main): Use "%s%s" (not %smsg) to print "msg" with or + without a "Warning: " prefix. Reported by Clytie Siddall. + + Clean up tests/Makefile.am. + * tests/Makefile.am (EXTRA_DIST): Remove $(TESTS). No longer defined. + (TESTS_ENVIRONMENT): Remove definition. + +2007-10-26 Jim Meyering + + * build-aux/check.mk: Merge with latest from Akim. + + Add a test for the printf fix of 2007-10-21. + * tests/misc/printf-surprise: New file. Test for 2007-10-21's fix. + * tests/misc/Makefile.am (TESTS): Add printf-surprise. + +2007-10-24 Micah Cowan + + Remove vestiges of cvs-gnulib-checkout process. Now we use git. + * bootstrap: Remove support for now-unnecessary option, --cvs-user, + and envvars CVS_USER, CVS_RSH. + +2007-10-24 Micah Cowan + + Tell xgettext that "ARG1 % ARG2" is not a C format string. + * src/expr.c (usage): Add a comment to override xgettext's default + behavior, which would classify "ARG1 % ARG2" as a fprintf-style + format string. Reported by Clytie Siddall. + +2007-10-24 Jim Meyering + + Avoid diagnostics from sha1sum when there is no cached checksum. + * bootstrap (update_po_files): Skip the sha1sum check if the po.s1 + file hasn't been created yet. + + Get gnulib from the git repository, not from an obsolete cvs one. + * bootstrap: Suggestion from Micah Cowan. + + Doc improvements. + * README-hacking: Prefer the no-hyphen variant of git commands, + e.g., use "git pull" not "git-pull". + Don't presume that the only way to read this document is via a + prior git clone: provide instructions for cloning coreutils, too. + + * README-hacking: Add "cd automake" in build instructions. + From Bob Proulx. + + Don't fail part 2 of tests/rm/unreadable when run as root. + * tests/rm/unreadable: With UID == 0, expect different results. + Reported by Mike Frysinger. + +2007-10-23 Jim Meyering + + * README-hacking: Refer to LZMA Utils . + +2007-10-22 Paul Eggert + + * README-hacking: Describe how to build with LZMA. + +2007-10-22 Jim Meyering + + Remove git-version-gen's first parameter. + * build-aux/git-version-gen: Add comments. + Remove first command-line parameter. + * configure.ac: Remove corresponding first argument. + * GNUmakefile (_curr-ver): Likewise. + +2007-10-21 Jim Meyering + + * NEWS: Mention the printf fix. + + Reorder tests to run more basic ones earlier. + * tests/misc/Makefile.am (TESTS): Reorder. + * tests/Makefile.am (SUBDIRS): Reorder. + + tr: do not reject an unmatched [:lower:] or [:upper:] in SET1. + * NEWS: Mention this. + * src/tr.c (get_next) [RE_CHAR_CLASS]: Don't skip the loop when + processing [:lower:] and [:upper:]. + (main): Require [:lower:] or [:upper:] in SET1 only when + when one of those is specified in SET2. + * tests/tr/Test.pm: Add tests for this fix. + Reported by Per Starbäck. + +2007-10-20 Jim Meyering + + * tests/misc/help-version: Add a comment. + + Detect printf(3) failure due to ENOMEM. + * src/printf.c: Include "xprintf.h" + (print_direc): Use xprintf, rather than printf. + * bootstrap.conf (gnulib_modules): Add xprintf. + * po/POTFILES.in: Add lib/xprintf.c. + Reported by Bruno Haible. + + Put always-failing programs first in PATH, so tests cannot mistakenly + run installed versions. + * Makefile.maint (my-distcheck): Set up a bogus bin/ dir, to be used + for "make check". + + * doc/coreutils.texi (tee invocation): Fix typo. Add a little. + Add a cross-reference to bashref's Process Substitution node. + + Adjust tests to pass, now that Test.pm ones use check.mk. + * tests/check.mk (vc_exe_in_TESTS): Adjust regexp not to match the + "TESTS = $x-tests" line in each Test.pm-derived Makefile.am file. + * tests/sort/main: Remove this unused file. + + Ensure that Test.pm-derived tests use the right $PATH. + * tests/Makefile.am.in: Include $(top_srcdir)/tests/check.mk. + +2007-10-20 Bob Proulx + + Prevent "make check" from leaving mktemp /tmp/tmp.* files behind. + * tests/misc/help-version (mktemp_args): Tell mktemp to create + its temporary file in the current directory. + +2007-10-16 Jim Meyering + + Show how to make tee redirect to multiple processes. + * doc/coreutils.texi (tee invocation): Tee can redirect output + to multiple _processes_, too. + +2007-10-14 Jim Meyering + + Pull all TESTS_ENVIRONMENT settings "up" into tests/check.mk. + * tests/Makefile.am.in (TESTS_ENVIRONMENT): Remove definition. + * tests/chgrp/Makefile.am: Likewise. + * tests/chmod/Makefile.am: Likewise. + * tests/chown/Makefile.am: Likewise. + * tests/cp/Makefile.am: Likewise. + * tests/dd/Makefile.am: Likewise. + * tests/du/Makefile.am: Likewise. + * tests/install/Makefile.am: Likewise. + * tests/ln/Makefile.am: Likewise. + * tests/ls/Makefile.am: Likewise. + * tests/misc/Makefile.am: Likewise. + * tests/mkdir/Makefile.am: Likewise. + * tests/mv/Makefile.am: Likewise. + * tests/readlink/Makefile.am: Likewise. + * tests/rm/Makefile.am: Likewise. + * tests/rmdir/Makefile.am: Likewise. + * tests/tail-2/Makefile.am: Likewise. + * tests/touch/Makefile.am: Likewise. + * tests/check.mk (TESTS_ENVIRONMENT) [EXEEXT, EGREP, MAKE, PERL]: + [CONFIG_HEADER, build_programs, host_os, host_triplet, PATH]: + [REPLACE_GETCWD, CU_TEST_NAME]: Add definitions here. + * tests/misc/pwd-long: Use $abs_top_builddir/src, not $BUILD_SRC_DIR. + * tests/dd/skip-seek: Don't use $ENV{PROG}. + * tests/rm/empty-name: Likewise. + * tests/rm/unreadable: Likewise. + * tests/mv/i-1: Likewise. + + Fix a minor typo. + * configure.ac (AC_INIT): Fix a typo (s/9.6/6.9/) that makes a + difference only when running "make dist" without a .git/ subdir. + +2007-10-09 Jim Meyering + + Move the help-version test into misc/. + * tests/help-version: Move to... + * tests/misc/help-version: ...here. + Source test-lib.sh, as usual. + Use $abs_top_builddir, rather than ".." and "../..". + + Make the runcon-no-reorder test slightly more general. + * tests/misc/runcon-no-reorder: Don't hard-code "unconstrained_t". + Use slightly more general "runcon $(id -Z)". + Suggestion from Stephen Smalley. + + Skip the chcon test on a system with no SELinux support. + * tests/test-lib.sh (require_selinux_): New function. + * tests/misc/chcon: Use it. + * tests/misc/selinux: Use it here, too. + * tests/cp/cp-a-selinux: and here. + * tests/selinux: Remove file. + * tests/Makefile.am (EXTRA_DIST): Remove selinux. + Reported by Mike Frysinger and Bauke Jan Douma. + + * src/dircolors.hin: Recognize .lzma as a compressed-file suffix. + + * configure.ac (AM_INIT_AUTOMAKE): Use dist-lzma, rather than dist-bzip2. + + Now that we don't install su, don't make misleading suggestions. + * src/Makefile.am (install-exec-local) [$(INSTALL_SU) != yes]: + Don't suggest running "make install-root". + (uninstall-local) [$(INSTALL_SU) != yes]: Don't even check + the installed binary. + +2007-10-08 Jim Meyering + + When forming a truncated name, use the "[...]" prefix even for + an extremely long name in the current directory + * src/remove.c (full_filename_): Rename a local variable. + Use two separate "truncated" variables, in case the second + call to right_justify does not indicate any truncation -- which + would happen only if the single component FILENAME were longer + than 511 bytes and DIR_NAME were empty. + + rm could malfunction under unusual circumstances: + When operating on a relative name longer than 511 bytes, + and (when either processing a directory that is neither writable + nor readable (but still searchable) or when determining whether + to prompt), and encountering an ENOMEM error while forming the + file name, rm would operate on a truncated-to-511-byte name + starting with "[...]" rather than the intended one. + * NEWS: Describe the bugs. + * src/remove.c: Correct two misuses of full_filename: + (full_filename0, xfull_filename): New functions. + (full_filename_): Rewrite to use full_filename0. + (AD_pop_and_chdir): Use xfull_filename, not full_filename. + (write_protected_non_symlink): Likewise. + +2007-10-07 Jim Meyering + + Don't let a helper function modify errno. + * src/remove.c (full_filename_): Save and restore errno. + Spotted by Bruno Haible. + + Reflect 2->3 GPL copyright version update in gnulib. + * gl/lib/tempname.h: Update copyright from gnulib. + * gl/lib/tempname.c: Likewise. + * .x-sc_GPL_version: Don't make an exception for those two files. + + * configure.ac (AM_INIT_AUTOMAKE): Don't use dist-lzma just yet. + + New program: mktemp. + * NEWS: Mention this. + * README: Add mktemp to the list. + * AUTHORS: Add this: mktemp: Jim Meyering + * src/mktemp.c: New file. + * src/Makefile.am (bin_PROGRAMS): Add mktemp. + (mktemp_LDADD): Add $(LIB_GETHRXTIME). + * man/mktemp.x: New file. + * man/Makefile.am (dist_man_MANS): Add mktemp.1. + (mktemp.1): New dependency. + * man/.cvsignore: Add mktemp.1. + * man/.gitignore: New file. + * src/.cvsignore, src/.gitignore: Add mktemp. + * tests/misc/mktemp: New file. + * tests/misc/Makefile.am (TESTS): Add mktemp. + * tests/Coreutils.pm (run_tests): Give the POST-test function + access to stdout and stderr contents, so it can verify that + the named-on-stdout file/dir does indeed exist and has proper + permissions, etc. + [po/ChangeLog] + * POTFILES.in: Add src/mktemp.c. + + Make tempname more random, via the randint module. + * gl/modules/tempname (Depends-on): Add randint and stdbool. + * gl/lib/tempname.c: Include randint.h and stdbool.h. + (uint64_t): Remove definition. Not needed. + [_LIBC] (RANDOM_BITS): Remove this block, now that we have proper + random bits. + (check_x_suffix): New function. + (gen_tempname_len): Rename from __gen_tempname. + Add a parameter, x_suffix_len, telling how many X's there must be at + the end of the template. + Use pseudo-random numbers all the way, rather than adding 7777 + from one iteration to the next. + (__gen_tempname): New function, to call gen_tempname_len, requiring a + suffix length of 6. + * gl/lib/tempname.h: Add prototype for gen_tempname_len. + + Convert coreutils' rand*.{c,h,m4} into modules. + First step: move these files to gl/lib: + * lib/rand-isaac.c, lib/rand-isaac.h + * lib/randint.c, lib/randint.h + * lib/randperm.c, lib/randperm.h + * lib/randread.c, lib/randread.h + Step 2: add modules/rand* and remove now-unneeded .m4 files. + * gl/modules/randint: New file. + * gl/modules/randperm: New file. + * gl/modules/randread: New file. + * m4/randint.m4: Remove file. + * m4/randperm.m4: Remove file. + * m4/randread.m4: Remove file. + Step 3: use the new modules + * bootstrap.conf (gnulib_modules): Add randint and randperm. + * m4/prereq.m4 (gl_RANDINT, gl_RANDREAD, gl_RANDPERM): Don't require; + These have been removed. + (gl_ROOT_DEV_INO): Don't require; already handled via bootstrap.conf. + + Copy from gnulib the parts of tempname that we'll modify. + * gl/lib/tempname.c: Copy from gnulib. + * gl/lib/tempname.h: Likewise. + * gl/modules/tempname: Likewise. + Allow GPLv2 on temporarily(?)-imported file from gnulib/libc. + * .x-sc_GPL_version: New file. + * Makefile.am (EXTRA_DIST): Add .x-sc_GPL_version + +2007-10-07 Jim Meyering + + Avoid a pseudo-leak in sort. + * src/sort.c (main) [lint]: Avoid a nominal leak. + + Use puts, rather than printf ("%s\n". Slightly cleaner. + * src/tsort.c (tsort): ...and more efficient. + + Avoid seq malfunction on non-POSIX systems: mingw, BeOS, Interix. + * bootstrap.conf (gnulib_modules): Add vasprintf-posix. + Suggestion from Bruno Haible. + + Avoid a used-uninitialized error. + * src/copy.c (copy_internal): Don't overload "use_stat". + +2007-10-05 Jim Meyering + + Make a failing cross-partition mv give a sensible diagnostic. + A cross-partition move of a file in a sticky tmpdir and owned by + another user would evoke an invalid diagnostic after copying it: + mv: cannot remove `x': Operation not permitted + Either of the following (mv.c, remove.c) changes would fix the bug by + itself. I think it's slightly better to use both; the added cost is + minimal: mv: an extra lstat-per-mv-cmdline-arg-that-goes-cross-partition, + rm: an extra lstat-per-unlink-that-fails-w/EPERM. + * src/remove.c (remove_entry): Also lstat the file upon EPERM. + * src/mv.c (rm_option_init): Initialize root_dev_ino just as is done + in rm, so that a cross-partition invoked remove.c:rm call works the + same way as one invoked from the command-line use of "rm". That + setting of root_dev_ino makes rm() do the equivalent of an additional + lstat for each argument, which in turn gives rm enough information to + issue the right diagnostic. + * tests/mv/sticky-to-xpart (version): New file. Test for the above. + * tests/mv/Makefile.am (TESTS): Add sticky-to-xpart. + Arrange for "make check-root" to run the new root-only test. + * tests/Makefile.am (tb): New target, to run the new root-only test. + (all_t): Add tb. + * src/c99-to-c89.diff: Adjust offsets. + + Add PACKAGE_VERSION to TESTS_ENVIRONMENT via check.mk. + * tests/check.mk (TESTS_ENVIRONMENT): Add PACKAGE_VERSION here, + rather than in every Makefile.am that needs it. + * tests/rm/Makefile.am (TESTS_ENVIRONMENT): Remove PACKAGE_VERSION. + * tests/misc/Makefile.am (TESTS_ENVIRONMENT): Likewise. + +2007-10-04 Jim Meyering + + Adapt to new gnulib naming scheme. + * gl/lib/se-context.in.h: Rename from gl/lib/se-context_.h. + * gl/lib/se-selinux.in.h: Rename from gl/lib/se-selinux_.h. + * gl/m4/selinux-context-h.m4: Remove use of AC_LIBSOURCES. + * gl/m4/selinux-selinux-h.m4: Likewise. + * gl/modules/selinux-h (Files, Makefile.am): Reflect renaming. + (Makefile.am) [lib_SOURCES]: Add se-context.in.h and se-selinux.in.h. + + * lib/search_.h: Remove unused file. + + * bootstrap (slurp): Adapt to _.h -> .in.h name change. + (update_po_files): Work also when there are no .po files in po/. + + Remove test program: lib/t-fpending.c. + * lib/t-fpending.c: Remove file. Now, this test is in gnulib. + * lib/Makefile.am: Remove associated rules. + * .gitignore: Remove lib/t-fpending. + +2007-10-03 Jim Meyering + + * tests/misc/selinux: Skip this test if the initial chcon fails. + +2007-10-02 Jim Meyering + + Never copy through a symlink that cp has just created. + * src/copy.c (copy_internal): When same-file detection requires + 'stat'ing the destination file, also 'lstat' it and ensure that + it wasn't the destination of a preceding copy operation. + This bug was introduced on 2007-06-18. + * tests/cp/abuse: New test for the above. + * tests/cp/Makefile.am (TESTS): Add abuse. + +2007-09-30 Jim Meyering + + cp: do not abbreviate in --help output. + * src/cp.c (usage): Don't abbreviate: s/=link/=links/. + Reported by Géraud Meyer in . + +2007-09-29 Eric Blake + + Test previous patch. + * tests/misc/groups-dash: New test. + * tests/misc/Makefile.am (TESTS): Add it. + +2007-09-28 Eric Blake + + * src/groups.sh: Don't ignore first argument if later argument is --. + +2007-09-27 Jim Meyering + + Avoid spurious test failure when SELinux stats "selinux/class". + * tests/ls/stat-free-symlinks: Grep for more precise /^stat("x"/. + + Move file-set and hash-triple modules to gnulib. + * bootstrap.conf (gnulib_modules): Remove file-set, now that + it's in gnulib, and the canonicalize module requires it there. + * gl/lib/file-set.c, gl/lib/file-set.h, gl/modules/hash-triple: Remove. + * gl/lib/hash-triple.c, gl/lib/hash-triple.h, gl/modules/file-set: + Remove. + + Add a test to exercise a readlink bug. + * tests/misc/readlink-fp-loop: New file. Test for the readlink bug + fixed through today's change to Gnulib's canonicalize module. + * tests/misc/Makefile.am (TESTS): Add readlink-fp-loop. + Bug report and a test case from mpb.mail@gmail.com. + +2007-09-25 Pádraig Brady + + * doc/coreutils.texi (date invocation): + Make "Date input formats" easier to navigate to. + +2007-09-25 Jim Meyering + + Use XOR, not OR to combine bits. + * gl/lib/hash-triple.c (triple_hash): Use XOR (^), not OR (|), to + combine the bits from hashing the name and those of the inode number. + Add a few comments and remove out-of-context ones. + +2007-09-24 Jim Meyering + + * NEWS: The recent rm-diagnostic fix also affects cross-partition "mv". + + copy.c: Remove definitions of factored-out functions. + * src/copy.c: Include "file-set.h". + (seen_file, record_file): Remove functions that I factored + out on 2007-08-23. + +2007-09-22 Jim Meyering + + Don't print the commands of a 10-line script that's run in each subdir. + * tests/check.mk (vc_exe_in_TESTS): Add a leading "@", to reduce noise. + + rm: give a sensible diagnostic when failing to remove a symlink + On some systems (those with openat et al), when rm would fail to + remove a symlink, it would fail with the misleading diagnostic, + "Too many levels of symbolic links". + * NEWS: Mention the bug fix. + * src/remove.c (is_nondir_lstat): New function. + (remove_entry): Use it to catch failed-to-remove symlink (and any + other non-dir) here so that we don't fall through and try to treat + it as directory, which -- with a symlink -- would provoke the bogus + ELOOP failure. + * tests/rm/fail-eacces: Add a test for the above. + * src/c99-to-c89.diff: Adjust offsets. + + rm: fix a tiny, nearly inconsequential bug. + Don't perform a "."-relative lstat, when the file in question + may well not be in ".". Although this is a bug, a few attempts + to exercise it on a linux-2.6.22 system failed. You probably need + a pre-openat system to trigger the failure. The consequence of this + bug would be a lower-quality diagnostic upon failed dir removal. + * src/remove.c (is_dir_lstat): Add a parameter, fd_cwd. + Use it instead of hard-coding AT_FDCWD. + (remove_entry): Call is_dir_lstat with fd_cwd. + +2007-09-22 Karl Berry + + * TODO: It'd be nice to add renice. + +2007-09-21 Jim Meyering + + Avoid test failure due to now-parallelized tests. + * tests/du/two-args: Run "du .." from a sub-directory one level deeper. + +2007-09-16 Jim Meyering + + * tests/misc/tac-continue: Arrange to remove a temporary file. + + * tests/check.mk (vc_exe_in_TESTS): Don't rely on the value of + $(TESTS), so that "make check TESTS=test-name" works once again. + + * tests/CuTmpdir.pm: Use File::Find + chmod syscall, not chmod -R. + + Revamp most test scripts. + + * tests/rm/v-slash: Avoid test failure with non-C locale. + Reported by Michael Stone. + + Enable some previously omitted test scripts. Add a test cross-check. + * tests/rm/Makefile.am (TESTS): Add empty-name and unreadable. + * tests/rm/empty-name: Likewise. + * tests/rm/unreadable: Reenable this test. Adjust for new rm. + * tests/mkdir/Makefile.am: Add writable-under-readonly. + * tests/mkdir/writable-under-readonly: Add some comments. + This test is always skipped, for now. + * tests/Makefile.am (ta): Hook up the new root-only script. + * tests/tail-2/infloop-1: Make this test pass. + * tests/tail-2/Makefile.am (TESTS): Add infloop-1. + * tests/tail-2/fflush: Remove unused file. + * tests/check.mk (vc_executable_is_in_TESTS): More portable. + * tests/check.mk (check): Depend on the above. + * build-aux/check.mk: Remove comment mentioning AUTHORS file. + + Factor out definitions in TESTS_ENVIRONMENT of srcdir, top_srcdir, etc. + tests/check.mk (top_srcdir): Define. + tests/*/Makefile.am: Remove definitions of $(srcdir), $(top_srcdir), + $(abs_top_srcdir), and $(abs_top_builddir), since they're + defined via the included tests/check.mk. + + tests/general: Remove from VC, this long-unused directory and contents. + + Adapt tests/tail-2/ to use test-lib.sh. + Adapt tests/readlink/ to use test-lib.sh. + + Move the sole test in tests/ls-2/ to tests/misc/. + * tests/ls-2/basic-1: Move this file to ... + * tests/misc/ls-misc: ...here. Don't rely on $PROG in env. + * tests/misc/Makefile.am (TESTS): Add ls-misc. + * tests/Makefile.am (SUBDIRS): Remove ls-2. + * tests/ls-2: Remove the directory. + * configure.ac (AC_CONFIG_FILES): Remove tests/ls-2/Makefile. + + More misc, test-related changes. (some to allow running tests as root) + + Move all tests from test/{od,sha1sum,shred,stty} to tests/misc/. + Reflect these renamings: + od/od-N misc/od-N + od/x8 misc/od-x8 + sha1sum/basic-1 misc/sha1sum + sha1sum/sample-vec misc/sha1sum-vec + shred/exact misc/shred-exact + shred/remove misc/shred-remove + stty/basic-1 misc/stty + stty/invalid misc/stty-invalid + stty/row-col-1 misc/stty-row-col + * tests/misc/Makefile.am (TESTS): Add the new files. + * tests/Makefile.am (SUBDIRS): Remove the dir names. + * tests/od, tests/sha1sum, tests/shred, tests/stty: Remove the + directories. + * configure.ac (AC_CONFIG_FILES): Remove the corresponding Makefile + names. + + Move the two tests in tests/tee to tests/misc/. + * tests/tee/basic: Move this file to ... + * tests/misc/tee: ...here. Don't rely on $PROG in env. + * tests/tee/dash: Move this file to ... + * tests/misc/tee-dash: ...here. Don't rely on $PROG in env. + * tests/misc/Makefile.am (TESTS): Add tee. + * tests/Makefile.am (SUBDIRS): Remove tee. + * tests/tee: Remove the directory. + * configure.ac (AC_CONFIG_FILES): Remove tests/tee/Makefile + + Move the two tests in tests/sum/ to tests/misc/. + * tests/sum/basic-1: Move this file to ... + * tests/misc/sum: ...here. Don't rely on $PROG in env. + * tests/sum/sysv: Move this file to ... + * tests/misc/sum-sysv: ...here. Adapt it to use test-lib.sh. + * tests/misc/Makefile.am (TESTS): Add sum and sum-sysv. + * tests/Makefile.am (SUBDIRS): Remove sum. + * tests/sum: Remove the directory. + * configure.ac (AC_CONFIG_FILES): Remove tests/sum/Makefile. + + Move the sole test in tests/tsort/ to tests/misc/tsort. + * tests/tsort/basic-1: Move this file to ... + * tests/misc/tsort: ...here. Don't rely on $PROG in env. + * tests/misc/Makefile.am (TESTS): Add tsort. + * tests/Makefile.am (SUBDIRS): Remove tsort. + * tests/tsort: Remove the directory. + * configure.ac (AC_CONFIG_FILES): Remove tests/tsort/Makefile. + + Move the sole test in tests/unexpand to tests/misc/unexpand. + * tests/unexpand/basic-1: Move this file to ... + * tests/misc/unexpand: ...here. Don't rely on $PROG in env. + * tests/misc/Makefile.am (TESTS): Add unexpand. + * tests/Makefile.am (SUBDIRS): Remove unexpand. + * tests/unexpand: Remove the directory. + * configure.ac (AC_CONFIG_FILES): Remove tests/unexpand/Makefile. + + Move the sole test in tests/seq to tests/misc/seq. + * tests/seq/basic: Move this file to ... + * tests/misc/seq: ...here. Don't rely on $PROG in env. + * tests/misc/Makefile.am (TESTS): Add seq. + * tests/Makefile.am (SUBDIRS): Remove seq. + * tests/seq: Remove the directory. + * configure.ac (AC_CONFIG_FILES): Remove tests/seq/Makefile + + Convert tests/mkdir/ to use test-lib.sh. + + Move the two tests in tests/md5sum to tests/misc/md5sum. + * tests/md5sum/basic-1: Move this file to ... + * tests/misc/md5sum: ...here. Don't rely on $PROG in env. + * tests/md5sum/newline-1: Move this file to ... + * tests/misc/md5sum-newline: ...here. Don't rely on $PROG in env. + * tests/misc/Makefile.am (TESTS): Add md5sum. + * tests/Makefile.am (SUBDIRS): Remove md5sum. + * tests/md5sum: Remove the directory. + * configure.ac (AC_CONFIG_FILES): Remove tests/md5sum/Makefile + + tests/sample-test: Update to use test-lib.sh. + + Convert tests/misc/ to use test-lib.sh, too. + Convert tests/ls/, too. + Convert tests/ln/, too. + Convert tests/install/, too. + + Move the two tests in tests/fmt to tests/misc/fmt. + * tests/fmt/basic: Move this file to ... + * tests/misc/fmt: ...here. Don't rely on $PROG in env. + * tests/fmt/long-line: Move this file to ... + * tests/misc/fmt-long-line: ...here. + * tests/misc/Makefile.am (TESTS): Add fmt. + * tests/Makefile.am (SUBDIRS): Remove fmt. + * tests/fmt: Remove the directory. + * configure.ac (AC_CONFIG_FILES): Remove tests/fmt/Makefile + + Move the sole test in tests/factor to tests/misc/factor. + * tests/factor/basic: Move this file to ... + * tests/misc/factor: ...here. Don't rely on $PROG in env. + * tests/misc/Makefile.am (TESTS): Add factor. + * tests/Makefile.am (SUBDIRS): Remove factor. + * tests/factor: Remove the directory. + * configure.ac (AC_CONFIG_FILES): Remove tests/factor/Makefile + + Move the sole test in tests/expr to tests/misc/expr. + * tests/expr/basic: Move this file to ... + * tests/misc/expr: ...here. Don't rely on $PROG in env. + * tests/misc/Makefile.am (TESTS): Add expr. + * tests/Makefile.am (SUBDIRS): Remove expr. + * tests/expr: Remove the directory. + * configure.ac (AC_CONFIG_FILES): Remove tests/expr/Makefile + + Convert tests/du/*, too. + + Move the sole test in tests/dircolors to tests/misc/dircolors. + * tests/dircolors/simple: Move this file to... + * tests/misc/dircolors: ...here. Don't rely on $PROG in env. + * tests/misc/Makefile.am (TESTS): Add dircolors. + * tests/Makefile.am (SUBDIRS): Remove dircolors. + * tests/dircolors: Remove the directory. + * configure.ac (AC_CONFIG_FILES): Remove tests/dircolors/Makefile + + Convert tests/dd/*, too. + + Convert tests/mv, too. + * tests/other-fs-tmpdir: Before, all callers would exit 77 upon + failure to find the required dir. Now, exit 77 in this script so + callers don't have to. Adjust callers. + + Adjust chgrp, chmod, chown, cp tests to use test-lib.sh. + * tests/check.mk: Also define abs_top_builddir. + + Parallel "make check" support. + * build-aux/check.mk: New file, from The Vaucanson Group. + * .x-sc_GPL_version: New file, to allow "version 2 or later" + in build-aux/check.mk. + * Makefile.am (EXTRA_DIST): Add .x-sc_GPL_version. + * tests/check.mk: New file. + * tests/Makefile.am (EXTRA_DIST): Add check.mk, mkdtemp and test-lib.sh. + + Begin factoring "sample-test" out of test scripts. + * tests/test-lib.sh: New file, to be sourced by all tests that + were previously derived from the "sample-test" template. + * tests/mkdtemp: New file. + * tests/touch/dir-1: Use test-lib.sh. + * tests/touch/empty-file: Likewise. + * tests/touch/fail-diag: Likewise. + * tests/touch/fifo: Likewise. + * tests/touch/no-create-missing: Likewise. + * tests/touch/no-rights: Likewise. Also, don't sleep. + * tests/touch/not-owner: Likewise. + * tests/touch/obsolescent: Likewise. + * tests/touch/read-only: Likewise. + * tests/touch/relative: Likewise. + * tests/touch/Makefile.am: Include $(top_srcdir)/tests/check.mk, + to get the parallel-"make check" bits. + + Move a slow test into tests/misc. + * tests/check.mk: Wrapper. + * tests/ls/time-1: Move this file to tests/misc/ls-time. + * tests/misc/ls-time: New file. From tests/ls/time-1. + * tests/ls/Makefile.am (TESTS): Remove time-1. + * tests/misc/Makefile.am (TESTS): Add ls-time. + + Add support for parallel "make check" (in tests/misc, for now) + +2007-09-08 Jim Meyering + + Accommodate gnulib's renaming: __fpending.h -> fpending.h. + * lib/t-fpending.c: Include "fpending.h", not "__fpending.h". + +2007-09-07 Jim Meyering + + chmod: don't ignore a dangling symlink + * NEWS: Mention the bug fix. + * src/chmod.c (process_file): Handle the case of FTS_SLNONE, + i.e., give a diagnostic saying we cannot operate on such a file. + * tests/chmod/thru-dangling: Compare new stderr output with expected. + +2007-09-07 Bob Proulx + + Add a test: demonstrate that chmod ignores a dangling symlink + * tests/chmod/thru-dangling: New test. Fails. + * tests/chmod/Makefile.am (TESTS): Add thru-dangling. + +2007-09-05 Jim Meyering + + Adapt to new SELinux behavior: "?" vs. new "unlabeled" + * src/ls.c (gobble_file): Interpret the new "unlabeled" indicator + from getfilecon/lgetfilecon the same way we interpret a negative + return value: no security context. So we don't print the "+". + * tests/selinux: Recognize that "unlabeled" means insufficient + support for SELinux, just like "?". + +2007-09-03 Jim Meyering + + Invoke $(AUTOCONF) manually, if needed to get an updated version string. + * GNUmakefile: Don't actually touch configure.ac. + That would make git-version-gen always print "...-dirty". + + Don't change '-'s to '.'s in the string from git-describe. + * build-aux/git-version-gen: Leave '-'s in the string from git-describe. + Otherwise, s/-/./g would make it too hard to distinguish the base + version number from the appended .DD suffixes. + +2007-09-03 Jim Meyering + + * README-hacking: Require rsync, rather than wget. + +2007-09-02 Jim Meyering + + * bootstrap (WGET_COMMAND): Remove code to set this variable. + + Ensure that $(VERSION) is up to date for dist-related targets. + * GNUmakefile: Arrange to rerun autoconf, if the version reported by + git-version-gen doesn't match $(VERSION), but only for dist targets. + + bootstrap: uses rsync to download the .po files + * bootstrap (po_download_command_format): New global. + (download_po_files): Use rsync. + (update_po_files): Don't remove .po files after download, + so future rsync runs can take advantage of the copies. + +2007-09-01 Jim Meyering + + * bootstrap (gnulib_tool): Make sha1sum check quietly. + + Ensure that snapshot version changes make it to groups, too. + * src/Makefile.am (groups): Depend on Makefile. + + Make groups-version executable, + * tests/misc/groups-version: ... as it was in the patch. + +2007-08-31 Eric Blake + + Test yesterday's change to groups. + * tests/misc/groups-version: New test. + * tests/misc/Makefile.am (TESTS): Add groups-version. + +2007-08-31 Jim Meyering + + Solve the unnecessary-.po-file-regeneration problem once and for all. + * bootstrap (download_po_files): New function, renamed from + get_translations. Now, downloads, but doesn't update LINGUAS. + (update_po_files): New function. + +2007-08-30 Jim Meyering + + Shorten the snapshot version string by removing the "g". + * build-aux/git-version-gen: Remove git-describe's "g" that would + always precede the abbreviated SHA1. Suggestion from Dmitry V. Levin. + + Perform the s,rm,/bin/rm, fix-up properly. No more kludge. + * Makefile.am (EXTRA_DIST): Remove .kludge-stamp. + (.kludge-stamp): Remove rule. Instead, ... + (dist-hook): Do the job here, operating on the file in $(distdir). + (rm_subst): Adjust regexp to match "rm -f rm$(EXEEXT)", not "rm -f rm". + (MAINTAINERCLEANFILES): s/+=/=/, now that this is the sole use. + (dist-hook): Remove the legacy-from-cvs install-sh is-executable check. + * .gitignore: Remove .kludge-stamp. + + Make inter-release --version output more useful. + Now, each snapshot has a version "number" like 6.9-219-g58ddd, + which indicates that it is built using the 219th change set + (in _some_ repository) following the "v6.9" tag, and that 58ddd + is a prefix of the commit SHA1. + * build-aux/git-version-gen: New file. + * configure.ac: Run it to set the version. + * Makefile.am (dist-hook): Arrange so that .version appears only + in distribution tarballs, never in a checked-out repository. + * .gitignore: Add .version here, too. Just in case. + +2007-08-30 Eric Blake + + * src/.gitignore: Ignore *.exe for platforms with non-empty $(EXEEXT). + +2007-08-30 Eric Blake + + Use PACKAGE_NAME instead of GNU_PACKAGE. + * src/Makefile.am (.sh, uninstall-local): Adjust all users of + hand-rolled GNU_PACKAGE to instead use autoconf-provided + PACKAGE_NAME. + * src/basename.c (main): Likewise. + * src/chroot.c (main): Likewise. + * src/dirname.c (main): Likewise. + * src/echo.c (main): Likewise. + * src/expr.c (main): Likewise. + * src/factor.c (main): Likewise. + * src/groups.sh (version): Likewise. Also, reflect change in + --version output due to GPLv3. + * src/hostid.c (main): Likewise. + * src/hostname.c (main): Likewise. + * src/link.c (main): Likewise. + * src/logname.c (main): Likewise. + * src/nice.c (main): Likewise. + * src/nohup.c (main): Likewise. + * src/printenv.c (main): Likewise. + * src/printf.c (main): Likewise. + * src/pwd.c (main): Likewise. + * src/setuidgid.c (main): Likewise. + * src/sleep.c (main): Likewise. + * src/system.h (case_GETOPT_VERSION_CHAR): Likewise. + * src/test.c (main): Likewise. + * src/true.c (main): Likewise. + * src/unlink.c (main): Likewise. + * src/uptime.c (main): Likewise. + * src/users.c (main): Likewise. + * src/whoami.c (main): Likewise. + * src/yes.c (main): Likewise. + * configure.ac (AC_CHECK_DECLS): No need to check strtoimax, + strtoumax, since gnulib does this. + +2007-08-30 Jim Meyering + + Ensure that TMPDIR is valid. Otherwise, it would cause test failures. + * tests/misc/tty-eof: Set TMPDIR=. + * tests/misc/sort-compress: Likewise. + + Use EXIT_FAILURE, not EXIT_FAIL, now that EXIT_FAILURE is always 1. + * src/system.h (EXIT_FAIL): Remove definition. + * src/chroot.c (main): EXIT_FAIL -> EXIT_FAILURE. + * src/env.c (main): Likewise. + * src/nice.c (main): Likewise. + * src/su.c (change_identity, main): Likewise. + * src/tty.c (main): Likewise. + Suggestion from Eric Blake. + +2007-08-28 Jim Meyering + + * src/test.c (usage): Note that [ honors --help and --version, + but that test does not. Suggestion from Dan Jacobson. + + By default, do not install hostname anymore; no kidding, this time. + * src/Makefile.am (EXTRA_PROGRAMS): Remove hostname from this list, + now that it's no longer being installed by default. This should + have been part of the 2007-08-21 change. + (check-duplicate-no-install): New rule to ensure this doesn't + happen again. + (check): Depend on it. + + Reflect renaming: mreadlink-with-size -> areadlink-with-size. + * bootstrap.conf: Update module name. + * src/copy.c (copy_internal): Update header and function names. + * src/ls.c (get_link_name): Likewise. + * src/readlink.c (main): Likewise. + * src/stat.c (print_stat): Likewise. + + Add file system type names and magic numbers from "man 2 statfs". + * src/stat.c (human_fstype): Also handle BEFS, BFS, BINFMT_MISC, + FUSECTL, HUGETLBFS, NFSD and OPENPROM. + +2007-08-27 Jim Meyering + + Add some file system type names and magic numbers from glibc. + * src/stat.c (human_fstype): Add any file system names and values + present in glibc's linux_fsinfo.h but not in this list. + Alphabetize the S_* names and capitalize the hexadecimal constants. + +2007-08-26 Jim Meyering + + * tests/misc/fold: Fix a typo: missing \ in a diagnostic + no one is likely ever to see. + +2007-08-25 Jim Meyering + + * src/dircolors.hin: Add .dz and .svgz as archive suffixes. + + Remove all .cvsignore files from version control. + +2007-08-24 Jim Meyering + + bootstrap: Ignore more. + * bootstrap (symlink_to_dir): Add a directory name like + uniwidth to e.g., lib/.gitignore. + (slurp): Handle the sys_stat_.h -> sys mapping, too. + * .hgignore: Remove this file, too. + * Makefile.am (EXTRA_DIST): Remove .gitignore and .hgignore. + + No longer version-control .???ignore files in lib/, m4/, and po/. + * .gitignore: Ignore a few files in lib/, m4/, and po/ that are not + picked up automatically. + * lib/.gitignore, lib/.cvsignore: Remove files. + * m4/.gitignore, m4/.cvsignore: Remove files. + * po/.gitignore, po/.cvsignore: Remove files. + + bootstrap: when fetching .po files, do not remove .gmo files. + * bootstrap (get_translations): Don't remove *.gmo files! + They can be expensive to regenerate. + + Create .gitignore and/or .cvsignore from scratch, if absent. + This is in preparation for my removing those files from version + control in the directories managed by gnulib-tool. + * bootstrap: New setting: vc_ignore. + (insert_sorted_if_absent): Create $file if absent. + Adapt to new, possibly empty, list: $vc_ignore. + + * src/system.h (fseeko, ftello): Remove now-unneeded definitions. + * src/od.c (LDBL_DIG): Remove now-unneeded definition. + + Arrange to use tag names like vM.N, rather than COREUTILS-M_N. + * Makefile.maint (this-vc-tag) [git]: Simply use v$(VERSION). + (this-vc-tag-regexp): New variable. + (vc-tag-check): Use it, rather than $(this-vc-tag). + +2007-08-23 Jim Meyering + + * src/dircolors.hin: Add xterm-16color, xterm-88color and eterm-color. + Suggestion from Dan Nicolaescu. + + Don't let ln be a party to destroying user data. + * src/ln.c: Include "file-set.h", "hash.h" and "hash-triple.h". + (dest_set, DEST_INFO_INITIAL_CAPACITY): New globals. + (do_link): Refuse to remove a just-created link. + Record a name,dev,ino triple for each link we create. + (main): Initialize dest_set, if needed. + * tests/mv/childproof: Test for the above fix. + * NEWS: Document this. + Reported by Eric Blake. + + Move functions from copy.c into new modules, since ln needs them, too. + * bootstrap.conf (gnulib_modules): Add file-set. + * gl/lib/file-set.c (record_file, seen_file): Functions from copy.c. + * gl/lib/file-set.h: Add prototypes. + * gl/lib/hash-triple.c (triple_hash, triple_hash_no_name): + (triple_compare, triple_free): Functions from copy.c. + * gl/lib/hash-triple.h (struct F_triple): Define. From copy.c. + Add prototypes. + * gl/modules/file-set: New module. + * gl/modules/hash-triple: New module. + * src/Makefile.am (copy_sources): New variable. + (ginstall_SOURCES, cp_SOURCES, mv_SOURCES): Use it. + * src/copy.c: Include hash-triple.h. + No longer include hash-pjw.h. + (copy_internal): Don't pass a NULL third argument to record_file, + since that function no longer accepts that. + (record_file): Move this function to file-set.c. + Along the way, remove the code to allow a NULL stat-buffer pointer. + Adjust sole caller. + (seen_file): Move this function to file-set.c. + (struct F_triple): Move declaration to hash-triple.h. + (triple_compare, triple_free, triple_hash, triple_hash_no_name): + Move these functions to hash-triple.c. + + bootstrap: generate more ignorable names + * bootstrap (slurp): When generating ignorable names, also map + .sin to .sed, .gperf to .c, and .y to .c. + + * Makefile.maint (patch-check): Don't remove temporaries upon failure. + +2007-08-22 Jim Meyering + + * src/c99-to-c89.diff: Adjust offsets. + + Change "rm --verbose -r a//" not to print extra slashes in a///b + * src/remove.c (push_dir): Don't copy trailing slashes onto the stack. + Reported by François Pinard. + * tests/rm/v-slash: New file. Test for the above change. + * tests/rm/Makefile.am (TESTS): Add v-slash. + + * src/date.c: Don't include "getline.h", now removed from gnulib; + its declarations are now in . + * src/md5sum.c: Likewise. + * src/dircolors.c: Likewise. + + * src/copy.c (DEST_INFO_INITIAL_CAPACITY): Correct a comment. + +2007-08-21 Jim Meyering + + By default, do not install hostname anymore. + * configure.ac: Add "hostname" to the list of not-installed programs. + * src/Makefile.am (no_install__progs): Add "hostname" here, too. + * NEWS: Mention this. + +2007-08-20 Bob Proulx + + Clarify touch documentation of file arguments. + * src/touch.c (usage): Improve wording of documentation regarding + file argument handling and special handling of - argument. + * doc/coreutils.texi (touch invocation): Likewise. + Documentation problem reported by Vincent Lefevre. + +2007-08-20 Paul Eggert + + * NEWS: The old cp -p bug affected coreutils releases before 6.0. + Problem reported by Soren Spies in + . + To be conservative, just say the bug was in all versions through 6.6. + +2007-08-19 Eric Blake + + Avoid consuming too much seekable input when yesno is used. + * bootstrap.conf (gnulib_modules): Add closein. + * src/system.h (includes): Also include closein.h. + * src/mv.c (main): Use close_stdin, not close_stdout. + * src/cp.c (main): Likewise. + * src/ln.c (main): Likewise. + * src/rm.c (main): Likewise. + * src/install.c (main): Likewise. + * NEWS: Document the fix. + +2007-08-20 Jim Meyering + + Parallel "make check" support. + * build-aux/check.mk: New file, from The Vaucanson Group. + * .x-sc_GPL_version: New file, to allow "version 2 or later" + in build-aux/check.mk. + * Makefile.am (EXTRA_DIST): Add .x-sc_GPL_version. + * tests/check.mk: New file. + * tests/Makefile.am (EXTRA_DIST): Add check.mk, mkdtemp and test-lib.sh. + + Begin factoring "sample-test" out of test scripts. + * tests/test-lib.sh: New file, to be sourced by all tests that + were previously derived from the "sample-test" template. + * tests/mkdtemp: New file. + * tests/touch/dir-1: Use test-lib.sh. + * tests/touch/empty-file: Likewise. + * tests/touch/fail-diag: Likewise. + * tests/touch/fifo: Likewise. + * tests/touch/no-create-missing: Likewise. + * tests/touch/no-rights: Likewise. Also, don't sleep. + * tests/touch/not-owner: Likewise. + * tests/touch/obsolescent: Likewise. + * tests/touch/read-only: Likewise. + * tests/touch/relative: Likewise. + * tests/touch/Makefile.am: Include $(top_srcdir)/tests/check.mk, + to get the parallel-"make check" bits. + +2007-08-18 Jim Meyering + + Use new "idcache.h" header. + * src/ls.c: Remove ancient declarations of getuser and getgroup. + Include "idcache.h", instead. + + Run each Coreutils.pm-based test in its own subdirectory. + * tests/CuTmpdir.pm: New file. + * tests/Makefile.am (EXTRA_DIST): Add CuTmpdir.pm. + * tests/misc/od, tests/misc/base64, tests/misc/basename: + * tests/misc/cut, tests/misc/date, tests/misc/dirname: + * tests/misc/expand, tests/misc/fold, tests/misc/head-elide-tail: + * tests/misc/paste-no-nl, tests/misc/pr, tests/misc/sha224sum: + * tests/misc/sha256sum, tests/misc/sha384sum, tests/misc/sha512sum: + * tests/misc/sort-merge, tests/misc/stat-printf, tests/misc/test-diag: + * tests/misc/wc-files0-from, tests/misc/xstrtol: + * tests/dd/skip-seek, tests/dircolors/simple, tests/du/files0-from: + * tests/expr/basic, tests/factor/basic, tests/fmt/basic: + * tests/ls-2/tests, tests/md5sum/basic-1, tests/md5sum/newline-1: + * tests/seq/basic, tests/sha1sum/basic-1, tests/sha1sum/sample-vec: + * tests/sum/basic-1, tests/tsort/basic-1, tests/unexpand/basic-1: + * tests/mv/i-1, tests/rm/empty-name, tests/rm/unreadable: Use it. + * tests/misc/test-diag: Use "$ENV{abs_top_builddir}/src/test", + not "../../src/test", so it works when run from a subdirectory. + * tests/ls-2/tests: Create temp files and dirs from within the perl + script, so that they're removed, when run from a subdirectory. + * tests/ls-2/Makefile.am (TESTS_ENVIRONMENT): Define abs_top_builddir, + so we can use "$ENV{abs_top_builddir}/src/test" in a test script. + +2007-08-16 Jim Meyering + + Consolidate od tests. + * tests/misc/od: Perform od-zero-len's test here. + Include boilerplate code, so tests run in a subdirectory. + * tests/misc/od-zero-len: Remove this file. + + * tests/ls/time-1: Include sample-test boilerplate code. + Remove the then-unnecessary, hard-coded envvar "unset" commands. + +2007-08-15 Jim Meyering + + Move a slow test into tests/misc. + * tests/ls/time-1: Move this file to tests/misc/ls-time. + * tests/misc/ls-time: New file. From tests/ls/time-1. + * tests/ls/Makefile.am (TESTS): Remove time-1. + * tests/misc/Makefile.am (TESTS): Add ls-time. + + od --skip (-j) works even on files in /proc, when the kernel lies + * src/od.c (skip): Don't let kernel misinformation (nonempty files + in /proc with stat.st_size == 0) make "od -j N" misbehave. + Patch by Paul Eggert. + * NEWS: Document this work-around. + * tests/misc/od-zero-len: New file, test for the above. + + * src/printf.c (usage): Adjust summary to also mention OPTIONs. + From Karl Berry. + +2007-08-14 Jim Meyering + + od: fix a bug that arises when skipping exact length of file + * NEWS: Document the bug fix. + * src/od.c (skip): Call fseek even when n_skip is exactly the + same as the length of the current file. Otherwise, the next + iteration would use unadjusted input stream pointer, thus ignoring + the desired "skip". Report and patch by Paul GHALEB. + + * tests/misc/od: New file, test for the above. + * tests/misc/Makefile.am (TESTS): Add od. + +2007-08-10 Paul Eggert + + Accommodate more xstrtol changes. + * src/df.c (long_options): Don't bother prepending "--" to long + options that OPT_STR might decode, as that hack is no longer needed. + (main): Invoke xstrtol_fatal rather than STRTOL_FATAL_ERROR. + * src/du.c (long_options, main): Likewise. + * src/ls.c (decode_switches): Likewise. + * src/od.c (long_options, main): Likewise. + * src/pr.c (first_last_page, main): Likewise. + * src/sort.c (long_options, specify_sort_size): Likewise. + * src/pr.c (first_last_page): Accept option index and option char + instead of an assembled option string. All callers changed. + * src/sort.c (specify_sort_size): Likewise. + * src/system.h (OPT_STR, LONG_OPT_STR, short_opt_str, OPT_STR_INIT): + Remove. + +2007-08-05 Jim Meyering + + Encapsulate a static variable. + * src/system.h (opt_str_storage): Move static var into... + (short_opt_str): ... new static inline function. + (OPT_STR): Use the new function. + +2007-08-04 Jim Meyering + + Exercise xstrtol's diagnostics via pr's --pages option. + * tests/misc/xstrtol: New file. + * tests/misc/Makefile.am (TESTS): Add xstrtol. + +2007-08-04 Paul Eggert + + Adapt to new human and xstrtol API. + * src/df.c (long_options): Prepend "--" to long options that + OPT_STR might decode. + * src/du.c (long_options): Likewise. + * src/od.c (long_options): Likewise. + * src/sort.c (long_options): Likewise. + * src/df.c (main): Adjust to new human and xstrtol API. + * src/du.c (main): Likewise. + * src/ls.c (decode_switches): Likewise. + * src/od.c (main): Likewise. + * src/pr.c (first_last_page): Likewise. New argument OPTION. + All callers changed. + * src/sort.c (specify_sort_size): New arg OPTION. All callers + changed. Adjust to new xstrtol API. + * src/system.h (opt_str_storage): New static var. + (OPT_STR, LONG_OPT_STR, OPT_STR_INIT): New macros. + +2007-08-02 Jim Meyering + + Adjust one more test to accommodate the recent fts change. + This matters only on systems with insufficient openat support. + * tests/du/inacc-dest: Adjust expected diagnostic. + + Adjust the other two "no-x" tests and unify all three. + * tests/du/no-x: Factor out du-specific bits. + * tests/chmod/no-x: Use the same code. + * tests/chgrp/no-x: Use the same code. + + Adapt du's no-x test not to fail on older Linux systems. + * tests/du/no-x: Accept a third variant of the diagnostic. + +2007-07-31 Jim Meyering + + du: print size (probably incomplete) of each inaccessible directory + * src/du.c (process_file): Print what we know of the size of a + directory even when it is inaccessible. What we print is just the + size of the directory itself, not counting any of its contents. + * tests/du/inacc-dir: Test for this. + * NEWS: Mention this change. + + Add a test for du not counting size of inaccessible directories. + * tests/du/inacc-dir: New file. Test for fts.c bug fixed yesterday. + * tests/du/Makefile.am (TESTS): Add inacc-dir. + * NEWS: Mention the bug fix. + +2007-07-28 Jim Meyering + + Attempt to copy a regular file, even if stat says it is empty. + * NEWS: Document this bug fix. + * src/copy.c (copy_reg): Read from a regular file, even if it + appears (stat.st_size == 0) to be empty. This reverts an + optimization introduced on 2005-11-23 for coreutils-6.0. + Otherwise, "cp /proc/cpuinfo /tmp" creates an empty file, + on e.g., linux-2.6.20. + * tests/cp/proc-zero-len: New file. Test for the above. + * tests/cp/Makefile.am (TESTS): Add proc-zero-len. + Reported by Dan Berrangé. + +2007-07-26 Bob Proulx + + sort: Improve sort --random-sort test. + * tests/misc/sort-rand: If "locale" is available pick a random + non-C locale and check "sort --random-sort" behavior using it. + +2007-07-24 Jim Meyering + + sort: add a test to exercise the affected code. + * tests/sort/Test.pm (realloc-buf): Exercise the code that changed + yesterday. No other test in all of "make check" does this. + * NEWS: Mention the fix. + +2007-07-23 Paul Eggert + + sort: avoid unaligned access. + * src/sort.c (fillbuf): When enlarging the line buffer, ensure that + the new size is a multiple of "sizeof (struct line)". This avoids + alignment problems when indexing from the end of the buffer. + Problem reported by Andreas Schwab in + . + +2007-07-23 Jim Meyering + + Update all copyright notices to use the newer form (e.g., remove + the postal address, and add the 'licenses' URL). + + * COPYING: Update to Version 3. + + Update c99/c89 patch for new, copyright-change-induced offsets. + * Makefile.maint (patch-check): Filter out '^Only in...' lines. + * src/c99-to-c89.diff: Handle new c99'isms in seq.c. + +2007-07-22 Jim Meyering + + * configure.ac: Arrange to rerun configure whenever src/Makefile.am + changes. That file contains the list of program names that must be + substituted into files like man/Makefile. + Add quotes around AC_SUBST arguments. + +2007-07-21 Paul Eggert + + * bootstrap (slurp): Work even in environments where "ls" defaults + to "ls -A". Put in a FIXME, though, since the current code does + not slurp files whose names start with ".", and this looks like + it might be a troublesome area. + +2007-07-20 Jim Meyering + + Document and add a test for today's sort bug fix. + * NEWS: Describe the bug fix. + * tests/sort/Test.pm (obs-inval): Add a test for today's fix. + +2007-07-20 Andreas Schwab + + * src/sort.c (main): Don't free a pointer to non-malloc'd memory. + +2007-07-19 Jim Meyering + + Fix a portability bug in the new ls-color test. + * tests/ls/stat-free-symlinks: Don't rely on the ability of + a built-in printf to interpolate '\e'. Use '\033' instead. + +2007-07-18 Jim Meyering + + "cp -i --update older newer" no longer prompts; same for mv + * src/copy.c (copy_internal): Perform "update" check before the + possible interactive prompt. Reported by zeno_AT_biyg_DOT_org + in + * tests/mv/update: Add tests for the above. + * NEWS: Mention the bug fix. + +2007-07-15 Jim Meyering + + ls --color: Don't stat symlinks when neither ORPHAN nor MISSING + attribute has a color. + * src/ls.c (main): Don't set check_symlink_color when C_EXEC is + colored, unless ln=target (aka color_symlink_as_referent) is set. + (gobble_file): Set f->linkok = true also when !check_symlink_color. + http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/10608/focus=10927 + Reported by Jeremy Maitin-Shepard. + * tests/strace: New file, contents extracted from... + * tests/mv/atomic: ...here. Source strace. + * tests/ls/stat-free-symlinks: New file. Test for the above. + Use strace to ensure that in this corner case, ls does not call stat. + * tests/ls/Makefile.am (TESTS): Add stat-free-symlinks. + * tests/Makefile.am (EXTRA_DIST): Add strace. + +2007-07-14 Jim Meyering + + Remove long-deprecated options. + * NEWS: Mention this. + * src/df.c, src/ls.c: Remove --kilobytes option. + * src/du.c: Remove --kilobytes and --megabytes options. + * src/who.c: Remove -i and --idle options. + * src/ptx.c: Remove --copyright option. + + Change interface: make 2nd param _space_-separated, not comma-separated + * m4/include-exclude-prog.m4 (gl_INCLUDE_EXCLUDE_PROG): Remove now- + unnecessary use of tr. + Improve comments. + * configure.ac: Adjust caller, as well as the code that ensures the + 2nd parameter stays in sync with the list in src/Makefile.am. + +2007-07-14 Karel Zak + + * m4/include-exclude-prog.m4 (gl_REMOVE_PROG): Fix typo: s/$2/$1/. + (gl_INCLUDE_EXCLUDE_PROG): Quote first use of $2 parameter. + Don't mix comma- and space-separated lists. + Patch from Karel Zak. + +2007-07-13 Jim Meyering + + Warn about non-portable use of unescaped backslash at end of string, + and treat it as if it were escaped. + * src/tr.c (unquote): Considering that such usage would make GNU tr + from coreutils-5.2.1 and earlier *fail*, the least we can do now is + to warn about it. Solaris' tr ignores it. + * NEWS: Mention this. + + Use proper backslash-quoting inside backticks. + * configure.ac: Otherwise we run afoul of strict GNU tr: + a string ending in a lone backslash would provoke a failure. + +2007-07-12 Jim Meyering + + Expand default-no-install prog list in ./configure --help output, + and fix some []-quoting bugs in sed expressions. + * configure.ac: Hard-code the list, "arch,su" here as well + as in src/Makefile.am, and ensure the two stay in sync. + * m4/include-exclude-prog.m4 (gl_INCLUDE_EXCLUDE_PROG): Use $2, + rather than the nearly-equivalent shell variable. + Karel Zak reported that ./configure --help's output included + the literal string, $gl_no_install_progs_default. + + Clean up include-exclude-prog.m4. + * m4/include-exclude-prog.m4 (gl_ADD_PROG): Don't modify MAN. + (gl_REMOVE_PROG): Likewise. + Add omitted "\>" in sed regexp. + Remove any leading or trailing spaces. + (gl_ADD_PROG): Remove any leading space. + * configure.ac: Instead, derive $MAN from $optional_bin_progs. + Append $(EXEEXT) to *all* names, not just the first one. + +2007-07-11 Jim Meyering + + If there's a GPL vN copyright comment, require that N == 3. + * Makefile.maint (sc_GPL_version): New rule. + * tests/misc/arch: Fix the sole violation. + +2007-07-10 Jim Meyering + + Skip "arch" test if it's not built. + * tests/misc/Makefile.am (built_programs): Define. + (TESTS_ENVIRONMENT): Add $(built_programs), for... + * tests/misc/arch: ...this: skip the test if arch is not built. + * src/Makefile.am (built_programs.list): New rule. + * tests/Makefile.am (built_programs): Rename from all_programs. + (TESTS_ENVIRONMENT): Use built_programs, not all_programs. + * tests/help-version: Likewise. + * NEWS: Mention that using --enable-no-install-program=X may + cause "make check" to fail. + + Add support for enabling/disabling installation of specified programs. + * NEWS: Mention new configure-time options. + Mention that neither arch nor su is built/installed, by default. + * m4/include-exclude-prog.m4: New file. + * configure.ac: Use new macro, gl_ADD_PROG, rather than + manually appending to OPTIONAL_BIN_PROGS and MAN. + Move the code that adds "df" to the list of programs to build from + m4/jm-macros into this file. + Use gl_INCLUDE_EXCLUDE_PROG, then handle special cases: ginstall, [. + (NO_INSTALL_PROGS_DEFAULT): AC_SUBST it. Used by man/Makefile.am. + * man/Makefile.am (dist_man_MANS): Remove from this list all man pages + corresponding to "bin" programs. Add $(MAN) instead. + (optional_mans): Remove all uses. + (check-x-vs-1): Adapt to work even though arch and su are typically + no longer built (and neither are their .1 files). + * src/Makefile.am (install_su): Rename from INSTALL_SU, now that + INSTALL_SU has a different meaning. Use the new $(INSTALL_SU) value. + +2007-07-10 Karel Zak + + New program: arch + * NEWS: Mention arch. + * README: Add arch to the list of programs. + * AUTHORS: Add arch. + * src/uname.c: Include "uname.h". + (PROGRAM_NAME): Handle arch, too. + (ARCH_AUTHORS): Define. + (uname_long_options, arch_long_options): Renamed and new globals. + (usage): Handle arch-mode as well as uname-mode. + (decode_switches): New function, extracted from main, + to handle arch-mode as well as uname-mode. + (main): Handle both modes. + * src/uname-arch.c: New program, alias for "uname -m". + * src/uname-uname.c: New file, default uname mode. + * src/uname.h: New file, uname modes. + * src/Makefile.am (EXTRA_PROGRAMS): Add arch. + (uname_SOURCES, arch_SOURCES): Define. + * man/arch.x: New file. + * man/Makefile.am (dist_man_MANS): Add arch.1. + (arch.1): New dependency. + * tests/misc/arch: New test, compare "arch" with "uname -m" + * configure.ac (OPTIONAL_BIN_PROGS): Add arch. + (MAN): Add arch.1. + * .x-sc_require_config_h: Exempt uname-arch.c and uname-uname.c + from the always-include- rule. + +2007-07-10 Jim Meyering + + Change "version 2" to "version 3" in all copyright notices. + +2007-07-09 Jim Meyering + + Compensate for new c99'isms in seq.c. + * Makefile.maint (patch-check): Use -p1, not -p2, so a patch + generated via "make patch-check REGEN=1" actually works. + * src/c99-to-c89.diff: Handle new c99'isms in seq.c. + +2007-07-09 Pádraig Brady + + Fix the automatic number width formatting in seq. + * src/seq.c: Fix the -w logic. Ignore spaces and '+' + characters of input numbers when determining width. + Set format correctly for input numbers in scientific notation. + * tests/seq/basic: Add various number width tests. + Details: + +2007-07-08 Jim Meyering + + Run the coreutils-specific code only if tests/Makefile.am.in exists. + * bootstrap (mam_template): Move definition out of loop. + + Create symlinks for gl/{lib,m4}/*, just as for gnulib/{lib,m4}/*. + * bootstrap (symlink_to_dir): Rename function from symlink_to_gnulib. + Add a directory parameter. Update all callers. + (cp_mark_as_generated): Also check for -- and link to -- files in gl/. + + * THANKS: Add Pádraig Brady. + +2007-07-08 Jim Meyering + + Adapt to deeper hierarchy in gnulib. + * bootstrap (symlink_to_dir): If the destination directory doesn't + exist, create it. This is required at least for "lib/uniwidth/cjk.h". + + Use , not "wcwidth.h". + * src/wc.c: Now that gnulib provides the POSIX-specified , + include it and , rather than "wcwidth.h". + * src/ls.c: Include , rather than "wcwidth.h". + +2007-07-05 Jim Meyering + + setuidgid: set all groups, not just the primary one. + I wanted to use the xgetgroups function from id.c, so factored + it out and made it into a non-exiting function (hence the "m" + prefix rather than "x"). + * src/setuidgid.c (main): Use mgetgroups. + Include "mgetgroups.h". + + * src/id.c (xgetgroups): Remove function. + Include "mgetgroups.h". + (print_group_list): Use mgetgroups, not xgetgroups. + + * gl/modules/mgetgroups: New module. + * gl/lib/mgetgroups.c: New file. mgetgroups is derived from + id.c's xgetgroups function. + * bootstrap.conf (gnulib_modules): Add mgetgroups. + * gl/m4/mgetgroups.m4: New file. + * gl/lib/mgetgroups.h: New file. + + * bootstrap: Merge in changes from gnulib. + + * src/id.c: Include "getugroups.h" rather than declaring manually. + +2007-07-04 Paul Eggert + + * NEWS: pr -F no longer suppresses the footer or the first two blank + lines in the header. + * doc/coreutils.texi (pr invocation): Likewise. Also, a too-short + page length implies -t, not -T. + * src/pr.c (lines_per_header, lines_per_footer): Now constants. + (init_parameters): Don't try to change them. + (print_header): Use the same header and footer format regardless of + wither form feeds are being used. + (usage): Adjust to above change when describing too-short page length. + Too-short page length impliesy -t, not -T. + * tests/pr/2-S_f-t_notab: Adjust to the fact that -F now affects + only formfeed handling; it does not change the header. + * tests/pr/2-Sf-t_notab: Likewise. + * tests/pr/2f-t_notab: Likewise. + * tests/pr/2s_f-t_notab: Likewise. + * tests/pr/2s_w60f-t_nota: Likewise. + * tests/pr/2sf-t_notab: Likewise. + * tests/pr/2sw60f-t_notab: Likewise. + * tests/pr/2w60f-t_notab: Likewise. + * tests/pr/3a3f-0F: Likewise. + * tests/pr/3b3f-0F: Likewise. + * tests/pr/3b3f-0FF: Likewise. + * tests/pr/3b3f-FF: Likewise. + * tests/pr/3f-0F: Likewise. + * tests/pr/3f-FF: Likewise. + * tests/pr/Test.pm: Likewise. + * tests/pr/a3f-0F: Likewise. + * tests/pr/a3f-0FF: Likewise. + * tests/pr/a3f-FF: Likewise. + * tests/pr/b3f-0F: Likewise. + * tests/pr/b3f-0FF: Likewise. + * tests/pr/b3f-FF: Likewise. + * tests/pr/3-5l17f-t: Remove, since it's been renamed to another + file whose name has a line count 7 larger, + reflecting the new line count needed for this behavior. + * tests/pr/3a3l8f-t: Likewise. + * tests/pr/3b3l8f-t: Likewise. + * tests/pr/3l17f-t: Likewise. + * tests/pr/3ml17f-t: Likewise. + * tests/pr/Ja3l17f-lm: Likewise. + * tests/pr/Jb3l17f-lm: Likewise. + * tests/pr/Jml17f-lm-lo: Likewise. + * tests/pr/W-72l17f-ll: Likewise. + * tests/pr/W20l17f-ll: Likewise. + * tests/pr/W26l17f-ll: Likewise. + * tests/pr/W27l17f-ll: Likewise. + * tests/pr/W28l17f-ll: Likewise. + * tests/pr/W35Ja3l17f-lm: Likewise. + * tests/pr/W35Jb3l17f-lm: Likewise. + * tests/pr/W35Jml17f-lmlo: Likewise. + * tests/pr/W35a3l17f-lm: Likewise. + * tests/pr/W35b3l17f-lm: Likewise. + * tests/pr/W35ml17f-lm-lo: Likewise. + * tests/pr/W72Jl17f-ll: Likewise. + * tests/pr/a3l17f-lm: Likewise. + * tests/pr/a3l8f-t: Likewise. + * tests/pr/b3l17f-lm: Likewise. + * tests/pr/b3l8f-t: Likewise. + * tests/pr/l17f-t: Likewise. + * tests/pr/ml17f-0F: Likewise. + * tests/pr/ml17f-lm-lo: Likewise. + * tests/pr/ml17f-t: Likewise. + * tests/pr/ml17f-t-0F: Likewise. + * tests/pr/n+2-5l17f-0FF: Likewise. + * tests/pr/n+2l17f-0FF: Likewise. + * tests/pr/n+2l17f-bl: Likewise. + * tests/pr/n+3l17f-0FF: Likewise. + * tests/pr/n+3l17f-bl: Likewise. + * tests/pr/n+3ml13f-bl-FF: Likewise. + * tests/pr/n+3ml17f-bl-tn: Likewise. + * tests/pr/n+3ml17f-tn-bl: Likewise. + * tests/pr/n+4b2l10f-0FF: Likewise. + * tests/pr/n+5-8b3l10f-FF: Likewise. + * tests/pr/n+5a3l6f-0FF: Likewise. + * tests/pr/n+6b3l6f-FF: Likewise. + * tests/pr/nJml17f-lmlmlo: Likewise. + * tests/pr/nJml17f-lmlolm: Likewise. + * tests/pr/nN1+3l17f-bl: Likewise. + * tests/pr/nN15l17f-bl: Likewise. + * tests/pr/nSml13-bl-FF: Likewise. + * tests/pr/nSml13-t-t-FF: Likewise. + * tests/pr/nSml13-t-tFFFF: Likewise. + * tests/pr/nSml17-bl-FF: Likewise. + * tests/pr/nSml17-t-t-FF: Likewise. + * tests/pr/nSml17-t-tFFFF: Likewise. + * tests/pr/nl17f-bl: Likewise. + * tests/pr/o3Jml17f-lm-lo: Likewise. + * tests/pr/o3a3Sl17f-tn: Likewise. + * tests/pr/o3a3Snl17f-tn: Likewise. + * tests/pr/o3a3l17f-tn: Likewise. + * tests/pr/o3b3Sl17f-tn: Likewise. + * tests/pr/o3b3Snl17f-tn: Likewise. + * tests/pr/o3b3l17f-tn: Likewise. + * tests/pr/o3mSl17f-bl-tn: Likewise. + * tests/pr/o3mSnl17fbltn: Likewise. + * tests/pr/o3ml17f-bl-tn: Likewise. + * tests/pr/w72l17f-ll: Likewise. + * tests/pr/3-5l24f-t: New file, containing the contents of the + file with the same name but with the line count smaller by 7, + reflecting the new behavior with -F. + * tests/pr/3a3l15f-t: Likewise. + * tests/pr/3b3l15f-t: Likewise. + * tests/pr/3l24f-t: Likewise. + * tests/pr/3ml24f-t: Likewise. + * tests/pr/Ja3l24f-lm: Likewise. + * tests/pr/Jb3l24f-lm: Likewise. + * tests/pr/Jml24f-lm-lo: Likewise. + * tests/pr/W-72l24f-ll: Likewise. + * tests/pr/W20l24f-ll: Likewise. + * tests/pr/W26l24f-ll: Likewise. + * tests/pr/W27l24f-ll: Likewise. + * tests/pr/W28l24f-ll: Likewise. + * tests/pr/W35Ja3l24f-lm: Likewise. + * tests/pr/W35Jb3l24f-lm: Likewise. + * tests/pr/W35Jml24f-lmlo: Likewise. + * tests/pr/W35a3l24f-lm: Likewise. + * tests/pr/W35b3l24f-lm: Likewise. + * tests/pr/W35ml24f-lm-lo: Likewise. + * tests/pr/W72Jl24f-ll: Likewise. + * tests/pr/a3l15f-t: Likewise. + * tests/pr/a3l24f-lm: Likewise. + * tests/pr/b3l15f-t: Likewise. + * tests/pr/b3l24f-lm: Likewise. + * tests/pr/l24f-t: Likewise. + * tests/pr/ml24f-0F: Likewise. + * tests/pr/ml24f-lm-lo: Likewise. + * tests/pr/ml24f-t: Likewise. + * tests/pr/ml24f-t-0F: Likewise. + * tests/pr/n+2-5l24f-0FF: Likewise. + * tests/pr/n+2l24f-0FF: Likewise. + * tests/pr/n+2l24f-bl: Likewise. + * tests/pr/n+3l24f-0FF: Likewise. + * tests/pr/n+3l24f-bl: Likewise. + * tests/pr/n+3ml20f-bl-FF: Likewise. + * tests/pr/n+3ml24f-bl-tn: Likewise. + * tests/pr/n+3ml24f-tn-bl: Likewise. + * tests/pr/n+4b2l17f-0FF: Likewise. + * tests/pr/n+5-8b3l17f-FF: Likewise. + * tests/pr/n+5a3l13f-0FF: Likewise. + * tests/pr/n+6b3l13f-FF: Likewise. + * tests/pr/nJml24f-lmlmlo: Likewise. + * tests/pr/nJml24f-lmlolm: Likewise. + * tests/pr/nN1+3l24f-bl: Likewise. + * tests/pr/nN15l24f-bl: Likewise. + * tests/pr/nSml20-bl-FF: Likewise. + * tests/pr/nSml20-t-t-FF: Likewise. + * tests/pr/nSml20-t-tFFFF: Likewise. + * tests/pr/nSml24-bl-FF: Likewise. + * tests/pr/nSml24-t-t-FF: Likewise. + * tests/pr/nSml24-t-tFFFF: Likewise. + * tests/pr/nl24f-bl: Likewise. + * tests/pr/o3Jml24f-lm-lo: Likewise. + * tests/pr/o3a3Sl24f-tn: Likewise. + * tests/pr/o3a3Snl24f-tn: Likewise. + * tests/pr/o3a3l24f-tn: Likewise. + * tests/pr/o3b3Sl24f-tn: Likewise. + * tests/pr/o3b3Snl24f-tn: Likewise. + * tests/pr/o3b3l24f-tn: Likewise. + * tests/pr/o3mSl24f-bl-tn: Likewise. + * tests/pr/o3mSnl24fbltn: Likewise. + * tests/pr/o3ml24f-bl-tn: Likewise. + * tests/pr/w72l24f-ll: Likewise. + +2007-06-23 Jim Meyering + + Prefer "STREQ (a, b)" over "strcmp (a, b) == 0"; similar for != 0. + * src/base64.c (main): Likewise. + * src/install.c (setdefaultfilecon): Likewise. + * src/sort.c (main): Likewise. + * Makefile.maint (sc_prohibit_strcmp): New rule. + * .x-sc_prohibit_strcmp: New file, to list the few exceptions. + * Makefile.am (EXTRA_DIST): Add .x-sc_prohibit_strcmp. + +2007-06-22 Paul Eggert + + * NEWS: seq no longer mishandles obvious cases like + "seq 0 0.000001 0.000003" by omitting the last output number. + * doc/coreutils.texi (seq invocation): Remove advice about workaround + for seq off-by-one problem, since the bug is fixed now. Replace + it with more-generic advice about rounding errors. + * src/seq.c (long_double_format, print_numbers): + New arg NUMERIC_FORMAT. All uses changed. + +2007-06-22 Pádraig Brady (trivial change) + + * tests/seq/basic: Add test cases for seq off-by-one problem. + +2007-06-22 Jim Meyering + + * src/stat.c (long_options): Add a FIXME comment to help ensure + that the deprecated and undocumented "--filesystem" option is + removed someday. + +2007-06-18 Paul Eggert + + A few more symlink-related fixes. Fix a bug triggered by cp + --parents and symlinks. Close some race conditions possible when + the destination replaces a newly-created file with a symlink. + * NEWS: Document that 'cp --parents' no longer mishandles + symlinks in file name components of source. + * src/copy.c (HAVE_LCHOWN): Default to false. + (lchown) [!defined HAVE_LCHOWN]: Define to chown, for convenience. + * src/cp.c (lchown) [!HAVE_LCHOWN]: Likewise. + * src/install.c (lchown [!HAVE_LCHOWN]: Likewise. + * src/copy.c (set_owner): Use lchown instead of chown, for safety + in case the file got replaced by a symlink in the meantime. + * src/cp.c (re_protect): Likewise. + * src/install.c (change_attributes): Likewise. + * src/copy.c (copy_internal): Use ordinary C rather than an #if. + * src/cp.c (lchown) [!HAVE_LCHOWN]: Define to chown, for convenience. + (struct dir_attr): Cache the entire struct stat of the directory, + rather than just its mode, so that we needn't stat the directory + twice (which can lead to races). + (re_protect): Don't use XSTAT as that's not appropriate in + this context (symlinks should be followed here). Instead, use + the cached stat value. + (make_dir_parents_private): Save dir's entire struct stat, not + just its mode. + * tests/cp/cp-parents: Add test to check against bug with + cp --parents and symlinks. + +2007-06-18 Jim Meyering + + Use mreadlink_with_size (doesn't exit), not xreadlink_with_size. + * bootstrap.conf (gnulib_modules): Add readlink-with-size. + Remove xreadlink and xreadlink-with-size. + * src/copy.c (copy_internal): Use mreadlink_with_size, + not xreadlink_with_size. + * src/ls.c (get_link_name): Likewise. + * src/readlink.c (main): Likewise. + * src/stat.c (print_stat): Likewise. + + * README-hacking: Don't mention Gzip 1.2.4, now that 1.3.12 is out. + +2007-06-16 Jim Meyering + + Make chgrp and chown diagnostics consistent. + * src/chown.c (main): Emit the diagnostic before the file name, + not after it, to be consistent with chgrp's diagnostic. + * src/chgrp.c (parse_group): Emit a ":" between the diagnostic + and the file name. + Reported by Egmont Koblinger. + * THANKS: Add Egmont Koblinger. + +2007-06-15 Paul Eggert + + Correct cp's handling of destination symlinks in some cases. + * NEWS: "cp" no longer considers a destination symlink to be the + same as the referenced file when copying links or making backups. + * src/copy.c (copy_reg): When following a symlink, use the + followed name in later chown etc. requests, so that the created + file is affected, rather than the symlink. Use O_NOFOLLOW on + source when not dereferencing symlinks; this avoids a race. + Preserve errno correctly when doing multiple open attempts on the + destination. + (copy_internal): Follow destination symlinks only when copying a + regular file and only when we don't intend to remove or rename the + destination first, regardless of whether following source + symlinks; this is because since POSIX and tradition (e.g., + FreeBSD) say we should ordinarily follow destination symlinks if + the system calls would ordinarily do so. + * src/copy.h (struct cp_options): Add comment that 'dereference' + is only for source files. + * src/cp.c (usage): Note that --derereference etc. are only for + source files. + (make_dir_parents_private): Follow symlinks, regardless of whether + --dereference is specified, because these are destination symlinks. + * tests/cp/same-file: Adjust tests to match revised behavior. + Filter out perror output since it might vary from host to host. + Use sed alone instead of also using echo. + + * doc/coreutils.texi (cp invocation): Document the behavior better when + the destination is a symlink. Clarify source versus destination + symlinks. Describe the new behavior for destination symlinks. + +2007-06-15 Jim Meyering + + * src/copy.c: Include "canonicalize.h". + (copy_reg): Use canonicalize_filename_mode to follow the symlink, + so that we can always open with O_EXCL and avoid a race. + +2007-06-15 Jim Meyering + + Don't include "quote.h" when it is not used. + * src/md5sum.c: Remove unnecessary inclusion of "quote.h". + * src/expr.c: Likewise. + * src/shred.c: Likewise. + * Makefile.maint (sc_prohibit_quote_without_use): New rule. + * src/c99-to-c89.diff: Adjust offsets. + +2007-06-14 Paul Eggert + + Clarify what "cat" documentation means by "blank" lines. + * doc/coreutils.texi (cat invocation): "Blank" lines actually mean + empty lines. + * src/cat.c (usage): Say that "nonblank" means nonempty. Clarify + --squeeze-blank. + +2007-06-13 Jim Meyering + + rmdir: give better diagnostics + * src/rmdir.c (remove_parents): Give a more descriptive/consistent + diagnostic upon failure. + (main): Likewise. + Suggestion from Joey Hess. + * THANKS: Add Joey Hess. + + Don't include "quotearg.h" when it is not used. + * Makefile.maint (sc_prohibit_quotearg_without_use): New rule. + * src/cp.c: Don't include "quotearg.h". It wasn't used. + + * README-hacking: List Gperf as a build-requirement, too. + Reported by Steve Ward. + +2007-06-11 Jim Meyering + + * README: Mention README-hacking, for whose who start from + cloned/checked-out sources rather than from a distribution tarball. + Reported by Steve Ward. + * THANKS: Add Steve Ward. + +2007-06-10 Jim Meyering + + bug-fix: cp would fail to write through a dangling symlink + * NEWS: Mention the bug fix. + * src/copy.c (copy_reg): When open fails with EEXIST, the destination + is lstat'able, and a symlink, call open again, but now without O_EXCL. + * tests/cp/thru-dangling: New file, to test for the above fix. + * tests/cp/Makefile.am (TESTS): Add thru-dangling. + * THANKS: Add Michael McLagan. + Bug report from Michael McLagan in . + +2007-06-04 Paul Eggert + + * doc/coreutils.texi (Common options): Mention that -h and + --human-readable are equivalent to --block-size=human-readable. + Documentation problem reported by Steve Ward in + . + (du invocation): Use optSi rather than duplicating the macro's + contents (incorrectly, since we claimed a "B" was output). + +2007-05-31 Jim Meyering + + Pull printf-related code from gnulib, rather than using forked copy. + * bootstrap.conf (gnulib_modules): Don't avoid size_max and xsize + modules. While I dislike xsize-style overflow avoidance, maintaining + a forked version of e.g., vasnprintf.c was too much work. + +2007-05-29 Jim Meyering + + * src/dircolors.hin: Add screen-256color. + Suggested by sdl.web@gmail.com in . + +2007-05-26 Jim Meyering + + * TODO: Add an entry for comm --output-delimiter=STR + +2007-05-25 James Youngman + + wc: ignore multibyte-character decoding errors + * src/wc.c (wc): Don't issue an error message when mbrtowc + indicates that we have seen an invalid byte sequence. This + makes "wc /bin/sh" bearable (though the word and line counts + are likely not to be useful). + * NEWS: Mention the change. + +2007-05-22 Jim Meyering + + Check for an up-to-date copyright year in coreutils.texi. + * Makefile.maint (copyright-check): Also check for an up-to-date + copyright year in doc/$().texi, if that file exists. + * doc/coreutils.texi: Add 2007 to list of Copyright years. + Reported by Karl Berry. + + cut: diagnose a range starting with 0 (-f 0-2) as invalid, and + give a better diagnostic for a field-number/offset of 0. + * NEWS: Mention the fix. + * src/cut.c (ADD_RANGE_PAIR): Add an explicit check. + Based on a patch from James Youngman. + * tests/misc/cut: Add tests for the above. + + "cut -f 2-0" now fails; before, it was equivalent to "cut -f 2-" + Also, diagnose the '-' in "cut -f -" as an invalid range, rather + than interpreting it as the unlimited range, "1-". + * NEWS: Mention these changes. + * src/cut.c (set_fields): Don't interpret an accumulator "value" + of 0 as an unspecified range endpoint. + Give better diagnostics. + Adjust a comment so that it is true also for 64-bit size_t. + + * tests/cut/Test.pm: Add tests for the above. + + stty: fix a harmless syntax nit + * src/stty.c (visible): Use ";" as the statement terminator + between two assignments, not ",". + (integer_arg): Join an unnecessarily wrapped line. + +2007-05-20 Jim Meyering + + stty: diagnose an invalid hex value in 35-colon command-line argument + * NEWS: Mention this. + * src/stty.c (strtoul_tcflag_t, strtoul_cc_t): New functions. + (recover_mode): Use those functions (not sscanf), to parse the + string robustly. + * tests/stty/invalid: New file. Test for the above. + * tests/stty/Makefile.am (TESTS): Add invalid. + * .x-sc_prohibit_atoi_atof: Don't exempt stty.c from this check. + Add tests/stty/invalid so we don't have to obfuscate the comment + about sscanf therein. + * Makefile.maint (sc_prohibit_atoi_atof): Mention sscanf in the + diagnostic, too. + + * TODO: Remove some now-completed or no longer relevant items. + +2007-05-19 Jim Meyering + + Rename uses of futimens -> gl_futimens; glibc now declares the former. + * src/copy.c (copy_reg): Reflect renaming: futimens -> gl_futimens. + * src/touch.c (touch): Likewise. + +2007-05-18 Jim Meyering + + * Makefile.maint (my-distcheck): Remove -pedantic from $(CFLAGS) + for now, to avoid c89-check failure due to use of #include_next. + +2007-05-15 Jim Meyering + + Generate a dozen test-related Makefile.am files at bootstrap-time. + * README-hacking: Build-from-checkout now require Perl, too. + * bootstrap: Now that these generated Makefile.am files are no longer + under version control, they must be created at bootstrap time. + +2007-05-14 Paul Eggert + + * man/chmod.x: Document chmod's behavior with setuid and setgid bits. + Remove misleading implication about leading zero. Problem + reported by Jan Engelhardt in + . + +2007-05-13 Jim Meyering + + Remove the generated tests/*/Makefile.am files from version control. + * tests/cut/Makefile.am: git-remove this generated file. + * tests/head/Makefile.am: Likewise. + * tests/join/Makefile.am: Likewise. + * tests/pr/Makefile.am: Likewise. + * tests/sort/Makefile.am: Likewise. + * tests/tac/Makefile.am: Likewise. + * tests/tail/Makefile.am: Likewise. + * tests/test/Makefile.am: Likewise. + * tests/tr/Makefile.am: Likewise. + * tests/uniq/Makefile.am: Likewise. + * tests/wc/Makefile.am: Likewise. + * .cvsignore, .gitignore: Ignore these generated files. + + * src/.cvsignore, src/.gitignore: Add chcon here, ... + * .cvsignore, .gitignore: ... not here. + + Test uniq's new --zero-terminated (-z) option. + * tests/uniq/Test.pm: When possible, create a "-z"-testing variant + of each existing test. + (2z, 3z, 4z, 5z, 20z, 122, 123): New tests from James Youngman. + +2007-05-12 James Youngman + + Add -z option to uniq. Originally proposed by Egmont Koblinger. + * NEWS: Mention uniq's new option: --zero-terminated (-z). + * src/uniq.c: Add new option, --zero-terminated (-z), to make + uniq use the NUL byte as separator/delimiter rather than newline. + (check_file): Add a parameter: delimiter. Update caller. + Use readlinebuffer_delim in place of readlinebuffer everywhere. + (main): Handle the new option. + (usage): Describe new option the same way sort does. + * doc/coreutils.texi (uniq invocation): Describe the new option. + +2007-05-07 Jim Meyering + + * NEWS: Mention that last week's tr bug dates back to 1992. + +2007-05-04 Jim Meyering + + Avoid test failure when run with an unusual umask. + * tests/ls/color-dtype-dir: Set umask to 022. + Suggestion from AIDA Shinra. + + Avoid failure of root-only test when run with a restrictive umask. + * tests/rm/no-give-up: Ensure that non-root can access "d/" through + root-owned ".". Reported by AIDA Shinra. + + tr -c: don't abort when translating with S2 larger than complement of S1 + * src/tr.c (main): Remove invalid assertion triggered by e.g., + tr -c a '[b*256]'. There's nothing wrong with having Set2 larger + than Set1. Reported by Guntram Blohm. + * tests/tr/Test.pm (no-abort-1): Test for the above. + * NEWS: Mention this bug fix. + * THANKS: Add Guntram Blohm. + +2007-05-03 Jim Meyering + + Avoid test failure when run with a permissive umask. + * tests/rm/no-give-up: Set permissions of test directory properly, + i.e., not depending on umask prohibiting go=w. + Reported by AIDA Shinra. + +2007-05-02 Paul Eggert + + The following commands and options now support the standard size + suffixes kB, M, MB, G, GB, and so on for T, P, Y, Z, and Y: + head -c, head -n, od -j, od -N, od -S, split -b, split -C, + tail -c, tail -n. + * doc/coreutils.texi (od invocation, head invocation, tail invocation): + Document support for new size suffixes. + (head invocation, tail invocation): + Document that -n uses the same suffixes as -c. + (tail invocation): More-clearly document what leading "+" does. + * src/head.c (usage, string_to_integer): Support new suffixes. + * src/od.c (usage, main): Likewise. + * src/split.c (usage, main): Likewise. + * src/tail.c (usage, parse_options): Likewise. + Prompted by a patch from Evan Hunt. + +2007-05-02 Jim Meyering + + * src/du.c (usage): Tweak description of --dereference-args (-D) again. + Prompted by another request for clarification from Justin Pryzby. + + Invoke rm via 'setuidgid ... env PATH="$PATH" ...', as in fail-eperm. + * tests/rm/fail-2eperm: Patch from AIDA Shinra. + Reported by Peter Dyballa. + * THANKS: Add AIDA Shinra and Peter Dyballa. + +2007-04-28 Paul Eggert + + * src/nohup.c (usage): Describe how standard input and output + are redirected. + +2007-04-25 Jim Meyering + + * src/du.c (usage): Clarify description of --dereference-args (-D). + Prompted by a report from Justin Pryzby. + + * bootstrap.conf (gnulib_modules): Add fseeko and ftello. + (gnulib_modules): Add autobuild. + +2007-04-24 Jim Meyering + + * THANKS: Add Andreas Frische. + * NEWS: Mention today's ls --color fix. + * tests/ls-2/tests (sl-dangle): Add a test for today's fix. + +2007-04-24 Eric Blake + + ls --color once again colors dangling symlinks correctly + * src/ls.c (gobble_file): Much like the 2007-04-07 fix, + add a term to the expression that decides whether we need + stat and/or lstat calls. Reported by Andreas Frische. + +2007-04-16 Jim Meyering + + * src/cut.c (usage): Adjust synopsis to show that an OPTION is required. + Reported by Rudolf Kastl. + * THANKS: Add Rudolf Kastl. + +2007-04-11 Paul Eggert + + split --line-bytes=N (-C N): don't create an empty file. + * src/split.c (line_bytes_split): Don't create an empty line + afterwards if the last buffer happens to be exactly full. + * tests/misc/split-fail: Add a test case for this. + * NEWS: mention this. + +2007-04-10 Jim Meyering + + ls: don't form or compute the length of strings that won't be used. + * src/ls.c (gobble_file): Form and compute length of strings for + block size, owner, group, author, major+minor numbers and file size + only if they'll actually be used. I.e., don't form most of them + when not producing long format output. + +2007-04-07 Jim Meyering + + Add a test for, and document, today's fix. + * NEWS: Mention today's ls --color fix. + * tests/ls-2/tests (sl-target): Add a test for today's fix. + * THANKS: Add Kirk Kelsey. + +2007-04-07 Eric Blake + + Fix a bug in how the LS_COLORS ln=target attribute is handled. + * src/ls.c (gobble_file): Use "stat" (not lstat) also when the + ln=target attribute applies. Reported by Kirk Kelsey. + +2007-04-02 Jim Meyering + + * src/copy.c (copy_reg): Initialize local "con", before calling + getfscreatecon, in case that function (or its inline stub) does + not set it. + +2007-04-01 Paul Eggert + + * src/ls.c (print_horizontal): Fix bug reported by Mike Frysinger: + ls -x DIR would sometimes output the wrong string in place of the + first entry. + * NEWS: Mention the bug fix. + * tests/ls/x-option: New file. + * tests/ls/Makefile.am (TESTS): Add x-option. + + gnulib moved md5 and sha1 modules into a new crypt/ directory; adapt + * bootstrap.conf (gnulib_modules): Adjust to gnulib's renaming of + md5 to crypt/md5 and sha1 to crypt/sha1. + +2007-03-30 Jim Meyering + + * NEWS: Mention these SELinux changes. + + * ChangeLog-selinux: Remove file. + Move its contents into this file, removing old dates. + + * src/runcon.c (main): Don't reorder arguments. Reported by + Ulrich Drepper in . + * tests/misc/runcon-no-reorder: New file. Test for the above. + * tests/misc/Makefile.am (TESTS): Add runcon-no-reorder. + + * src/runcon.c (main): Remove "." at end of a diagnostic. + + * src/runcon.c: New program. + * src/Makefile.am (bin_PROGRAMS): Add runcon. + (runcon_LDADD): Define. + * README: Add runcon to the list of programs. + * AUTHORS: Add this: runcon: Russell Coker + * tests/help-version: Add runcon as an exception. + * man/Makefile.am (dist_man_MANS): Add runcon.1. + (runcon.1): New dependency. + + mkfifo, mknod: Accept new "-Z, --context=C" option. + * src/mkfifo.c, src/mknod.c: Include . + (main): Honor it. + * src/Makefile.am (mkfifo_LDADD, mknod_LDADD): Use $(LIB_SELINUX). + + mkdir: Accept new "-Z, --context=C" option. + * src/mkdir.c: Include . + (main): Honor it. + * src/Makefile.am (mkdir_LDADD): Use $(LIB_SELINUX). + + * tests/cp/cp-a-selinux: New file. Test for the bug reported in + . + * tests/cp/Makefile.am (TESTS): Add cp-a-selinux. + + * tests/selinux: New file. + * tests/Makefile.am (EXTRA_DIST): Add selinux. + * tests/misc/selinux: Source the new script, rather than open coding it. + + Change how "cp -a" and "cp --preserve=context" work with SELinux. + Now, cp -a attempts to preserve context, but failure to do so does + not change cp's exit status. However "cp --preserve=context" is + similar, but failure *does* cause cp to exit with nonzero status. + * src/copy.h (struct cp_options) [require_preserve_context]: New member. + * src/copy.c (copy_reg, copy_internal): Implement the above. + * src/mv.c (cp_option_init): Initialize the new member. + * src/install.c (cp_option_init): Likewise. + * src/cp.c (cp_option_init): Likewise. + (decode_preserve_arg): Set it or reset it. + + cp, mv, install: add SELinux support, but unlike with the Red Hat + patch, mv and cp do not provide the "-Z context" option. + * src/copy.c: Include . + (restore_default_fscreatecon): New function. + (copy_reg): Make cp --preserve=context work for existing destination. + (copy_internal): Likewise for new destinations. + * src/copy.h (cp_options) [preserve_security_context]: New member. + * src/cp.c: Include . + (selinux_enabled): New global. + (usage): Mention new --preserve=context option. + (PRESERVE_CONTEXT): Define/use. + (decode_preserve_arg): Handle PRESERVE_CONTEXT. + (main): Remove an obsolete comment. + If --preserve=context is specified on a system without SELinux + enabled, give a diagnostic and fail. + * src/mv.c: Include . + Set x->preserve_security_context if SELinux is enabled. + * src/install.c: Accept new "-Z, --context=C" option. + Accept --preserve-context option (but not -P option). + Accept alternate spelling: --preserve_context, for now. + Include and "quotearg.h". + (selinux_enabled, use_default_selinux_context): New globals. + (PRESERVE_CONTEXT_OPTION): Define. + (cp_option_init): Default: do not preserve security context. + (setdefaultfilecon): New function. + (main): Honor new options. + * src/Makefile.am (mv_LDADD, cp_LDADD, ginstall_LDADD): + Add $(LIB_SELINUX). + * src/system.h (GETOPT_SELINUX_CONTEXT_OPTION_DECL): Define. + + * tests/misc/selinux [VERBOSE]: Print version info for each + of the tested tools, not just ls. + + * src/c99-to-c89.diff: Remove the ls.c patch, now that I've + temporarily removed the offending c99'ism. + + * src/chcon.c (usage): Split a string literal that was longer than 509. + + * src/ls.c (gobble_file): Don't call getfilecon unless print_scontext. + Upon failed getfilecon, accept not just ENOTSUP, but also ENODATA. + + * src/c99-to-c89.diff: Adjust offsets. + + * AUTHORS: Add chcon. + + * src/c99-to-c89.diff: Remove trailing blanks. + + * src/chcon.c: Don't include "dirname.h". system.h already includes it. + + * gl/lib/selinux-at.c: Remove a use of HAVE_CONFIG_H. + + * src/c99-to-c89.diff: Handle a new c99'ism in ls.c. + + * src/id.c (main): Tweak id -Z diagnostic. + + id: Add SELinux support: -Z option. + * src/id.c (main): Apply patches from Fedora, with these changes: + Remove #ifdef WITH_SELINUX. + Use error (EXIT_FAILURE, not fprintf+exit(1). + * src/Makefile.am (id_LDADD): Define, so as to add $(LIB_SELINUX). + + stat: Add support for SELinux in the form of a %C format directive. + * src/stat.c (follow_links): Make this variable file-global. + (out_file_context): New function. + (print_statfs): Honor %C. + (print_stat): Honor %C. + (do_stat): Remove follow_links parameter. + (usage): Document the two %C directives. + (main): Accept -Z (though it's a no-op). + * src/Makefile.am (stat_LDADD): Define. + + ls: Add support for SELinux and a slightly modified -Z option. + I started with the patches from Red Hat. + The entries below tell how the code evolved. + + * src/ls.c (print_long_format, print_file_name_and_frills): When + there is no security context (due to getfilecon/lgetfilecon failing + with e.g. ENOTSUP), print it as "?", not "". + * src/ls.c (print_file_name_and_frills): Make -Z work without -l. + (length_of_file_name_and_frills): Likewise. + + * src/ls.c: Remove the --lcontext and --scontext options. + Change the way -Z, --context work so that it no longer implies -l. + Thus, -Z -l will work like -lcontext and -Z without -l will work + like --scontext. + + Adjust tests to reflect new 'ls -l' syntax -- affects only + systems with SELinux when operating on a file with no ACL. + These tests assumed that everything before the first space on + each line is the 10-byte mode string. But there may also be a "+" + in the 11th column, just before the space. However, note that this + is not new. The same thing would have happened even without the + change below, when listing a file with an ACL. + * tests/chmod/equals, tests/cp/cp-parents, tests/cp/fail-perm: + * tests/cp/link-preserve, tests/install/basic-1, tests/misc/mknod: + * tests/mkdir/parents, tests/mkdir/special-1, tests/mv/partition-perm: + + Don't make compilation depend on USE_ACL. An SELinux security + context counts as an "alternate access control method", so ls + must output a "+" for each file with a security context. + * src/ls.c [struct fileinfo] (have_acl): Declare unconditionally. + (FILE_HAS_ACL): Remove macro definition. Use f->have_acl directly. + (gobble_file): Record whether a file has a security context, and + update the condition used to determine whether to print the "+". + (gobble_file): Call getfilecon/lgetfilecon also when + format == long_format, so that we get the "+". + + * src/ls.c (gobble_file): Add a comment explaining why (with a + security context option) ls doesn't exit nonzero due to e.g., + getfilecon failing with errno == ENOTSUP. + + * src/ls.c (gobble_file): Ignore failure of getfilecon if it's due + to ENOTSUP. + + * src/ls.c (gobble_file): Factor out three small blocks using + getfilecon and lgetfilecon. + Don't ignore return value from getfilecon and lgetfilecon. + + * src/ls.c (print_long_format): Don't use ?: (empty 2nd arg with C + ternary operator). + (print_scontext_format): Likewise. + (print_scontext): Declare to be "bool", not int. Adjust uses. + + * src/Makefile.am (dir_LDADD, ls_LDADD, vdir_LDADD): Add $(LIB_SELINUX). + + * tests/misc/chcon: New file. + * tests/misc/chcon-fail: New file. + * tests/Makefile.am (check-root): Run new, root-only misc/chcon test. + * tests/misc/Makefile.am (TESTS): Add chcon and chcon-fail. + + * tests/misc/Makefile.am (TESTS): Add selinux. + * tests/misc/selinux: New file. + * tests/help-version: Skip chcon. + * man/chcon.x: New file. + * man/Makefile.am: Build chcon.1. + + New program: chcon + * gl/modules/selinux-at: New module. Check for libselinux and set + LIB_SELINUX here, unconditionally, rather than depending on + the configure-time --enable-selinux option. + * gl/modules/selinux-h: New module. + * bootstrap.conf (gnulib_modules): Add selinux-at. + * gl/lib/selinux-at.c, gl/lib/selinux-at.h: New files. + * gl/lib/se-selinux_.h: New file. + * gl/lib/se-context_.h: New file. + * gl/m4/selinux-selinux-h.m4: New file. + * gl/m4/selinux-context-h.m4: New file. + * src/Makefile.am (bin_PROGRAMS): Add chcon. + (chcon_LDADD): Define. + * README: Add chcon to the list of programs. + * src/chcon.c: Rewrite the original (Red Hat) chcon to use fts. + +2007-03-29 Jim Meyering + + * .vg-suppressions: Add libc-getpwuid-leak. + +2007-03-28 Jim Meyering + + Help translators include translation team's web or email address. + * src/system.h (emit_bug_reporting_address): New function. + * src/base64.c: Use it rather than a literal printf. + * src/basename.c, src/cat.c, src/chgrp.c, src/chmod.c: + * src/chown.c, src/chroot.c, src/cksum.c, src/comm.c, src/cp.c: + * src/csplit.c, src/cut.c, src/date.c, src/dd.c, src/df.c: + * src/dircolors.c, src/dirname.c, src/du.c, src/echo.c, src/env.c: + * src/expand.c, src/expr.c, src/factor.c, src/fmt.c, src/fold.c: + * src/head.c, src/hostid.c, src/hostname.c, src/id.c, src/install.c: + * src/join.c, src/kill.c, src/link.c, src/ln.c, src/logname.c: + * src/ls.c, src/md5sum.c, src/mkdir.c, src/mkfifo.c, src/mknod.c: + * src/mv.c, src/nice.c, src/nl.c, src/nohup.c, src/od.c: + * src/paste.c, src/pathchk.c, src/pinky.c, src/pr.c, src/printenv.c: + * src/printf.c, src/ptx.c, src/pwd.c, src/readlink.c, src/rm.c: + * src/rmdir.c, src/seq.c, src/setuidgid.c, src/shred.c, src/shuf.c: + * src/sleep.c, src/sort.c, src/split.c, src/stat.c, src/stty.c: + * src/su.c, src/sum.c, src/sync.c, src/system.h, src/tac.c: + * src/tail.c, src/tee.c, src/test.c, src/touch.c, src/tr.c: + * src/true.c, src/tsort.c, src/tty.c, src/uname.c, src/unexpand.c: + * src/uniq.c, src/unlink.c, src/uptime.c, src/users.c, src/wc.c: + * src/who.c, src/whoami.c, src/yes.c: Likewise. + + * src/stty.c: Don't include "vasprintf.h", now that its + declarations are guaranteed to be in gnulib's stdio.h. + * src/who.c: Likewise. + +2007-03-27 Jim Meyering + + * README: Use "install", not "ginstall" in the list of program names. + * src/Makefile.am (check-README): Substitute s/ginstall/install/. + +2007-03-25 Jim Meyering + + * src/c99-to-c89.diff: Regenerate. + +2007-03-25 Paul Eggert + + Avoid the need for euidaccess and/or lstat on every directory entry + with 'rm -r dir' (without -f), if we are root, or if we are removing + a directory tree that is full of symbolic links. + * bootstrap.conf (gnulib_modules): Add write-any-file. + * src/copy.c: Include write-any-file.h. + (UNWRITABLE): Remove macro, replacing with.... + (writable_destination): New function, which uses can_write_any_file + to avoid the need for euidaccess when we are privileged. + (overwrite_prompt, abandon_move): Use it. + * src/remove.c: Include write-any-file.h. + (D_TYPE): New macro. + (DT_UNKNOWN, DT_DIR, DT_LNK) [!HAVE_STRUCT_DIRENT_D_TYPE]: New macros. + (write_protected_non_symlink): Don't bother to stat if we can write + any file. + (prompt): New arg PDIRENT_TYPE. All callers changed. + Use readdir dirent type to avoid the need for 'lstat' on each directory + entry in cases like 'rm -r dir', if we are root, or if the tree is + full of symbolic links. + (DT_IS_KNOWN, DT_MUST_BE): Remove. + (remove_entry): New arg DIRENT_TYPE_ARG. All callers changed. + +2007-03-24 Jim Meyering + + If strace malfunctions, skip the test rather than failing it. + * tests/mv/atomic: Required on a mips-unknown-linux-gnu system + running the aging linux-2.4.27-mipscvs-20040814. + +2007-03-23 Paul Eggert + + * src/pathchk.c: Don't include euidaccess.h, as we don't call + euidaccess. + +2007-03-23 Jim Meyering + + * README-package-renamed-to-coreutils: Add a URL for the FAQ, + and a couple more archive links. + +2007-03-22 Jim Meyering + + Post-release version change. + * NEWS: Add a line for 6.9+. + * configure.ac (AC_INIT): Set new version string. + + Version 6.9. + * NEWS: Record release date and new version number. + * configure.ac (AC_INIT): New version number. + + * tests/mv/hard-3: Correct the preceding change: $3 -> $2. + +2007-03-22 Paul Eggert + + Improve a test script. + * tests/mv/hard-3: Check for 'ls' failure, too. + Generate more-useful debugging output when 'ls' fails. + +2007-03-21 Jim Meyering + + Fix a test script not to claim an ext2 file system is of type xfs. + * tests/du/slink: When using df --local and df --type=TYPE, + test only the exit code. Don't bother with stdout. + Prompted by a report by Thomas Schwinge of an inaccurate diagnostic. + + * gl/lib/savewd.c: Remove this file, since the savewd_save change + is now in gnulib. The other wasn't useful. + +2007-03-20 Jim Meyering + + * gl/lib/acl.c: Remove this file, now that gnulib's version subsumes it. + + Skip part of this test when "." is not a local file system. + * tests/install/basic-1: Otherwise, it would fail on some NFS + file systems. + * tests/mkdir/p-3: Likewise. + +2007-03-19 Paul Eggert + + * src/Makefile.am (dir_LDADD, ls_LDADD, vdir_LDADD): + Add $(LIB_ACL_TRIVIAL). + +2007-03-18 Jim Meyering + + Fix a generic NFS-related test failure. + * tests/mkdir/p-3: When setting up an unreadable "." in an + inaccessible parent, make the parent inaccessible *after* making "." + unreadable. Otherwise, running "chmod a-r ." in an already- + inaccessible parent would fail on NFS with "Stale NFS file handle". + + Fix a bug in how pr -m -s works. + * NEWS: Describe how the fix affects pr. + * src/pr.c (init_parameters): The --merge (-m) option does + not imply --expand-tabs (-e), so don't set "untabify_input". + Reported by Wis Macomson. + * tests/misc/pr: New file. Test for the above fix. + * tests/misc/Makefile.am (TESTS): Add pr. + * THANKS: Update. + +2007-03-17 Jim Meyering + + Detect use of AC_CONFIG_AUX_DIR also when its argument is quoted. + * bootstrap: Put ""s around use of $build_aux, in case + someone uses a name containing shell meta-characters. + Reported by Alfred M. Szmidt. + * tests/misc/tty-eof: Add shuf to the list of tested commands. + + Avoid test failure on NFS-mounted Solaris ZFS file system. + * tests/du/basic: Skip a test if "." is on a non-local file system. + + Avoid an obscure build failure, prefer waitpid over wait. + * src/install.c (strip): Use waitpid, not wait. It's equivalent, + but feels less obsolescent. + + * bootstrap: Don't use \> in grep regexp. For HP-UX. + +2007-03-16 Jim Meyering + + Begin adding support for Solaris ZFS (4 entries per trivial ACL) + * gl/lib/acl.c (ACL_NOT_WELL_SUPPORTED): New macro. + (file_has_acl, copy_acl): Use it, rather than enumerating errno values. + (is_trivial_acl): New function. Incomplete, for now. + (file_has_acl, copy_acl): Use the new function, rather than + counting the number of entries in an ACL. + + * bootstrap: Update from gnulib. + + * .x-sc_prohibit_atoi_atof: Add TODO here, too. + +2007-03-16 Paul Eggert + + * src/copy.c: Include filemode.h. + (overwrite_prompt): Say "try to overwrite", not "overwrite", to + make it clearer that the attempt may fail. Problem reported by + Dan Jacobson in: + http://lists.gnu.org/archive/html/bug-coreutils/2007-03/msg00130.html + Output symbolic mode as well as numeric. + * tests/mv/i-2 (fail): Adjust to new prompt format. + +2007-03-15 Jim Meyering + + Enforce policy: don't use *scanf functions. + * Makefile.maint (sc_prohibit_atoi_atof): Add to regexp and diagnostic. + * .x-sc_prohibit_atoi_atof: Give stty a temporary pass. + * TODO: note that stty.c needs this small clean-up. + +2007-03-13 Jim Meyering + + Prepare to work on ACL-related failure when using Solaris ZFS. + * gl/lib/acl.c: New file, copied from gnulib. + + Work around a failing test due to an NFS-based race condition. + * tests/cp/sparse: Accept a report that the copy is *smaller*. + +2007-03-12 Jim Meyering + + Make bootstrap.conf a tiny bit more generic. + * bootstrap.conf (XGETTEXT_OPTIONS): Exclude gettext-related .m4 + files when e.g., AM_GNU_GETTEXT([external] appears in configure.ac. + +2007-03-10 Jim Meyering + + Try to fix today's NFS-related failure: Treat ESTALE like EACCES. + * gl/lib/savewd.c: Copy this file from gnulib, then change + "errno != EACCES" to (errno != EACCES && errno != ESTALE). + The symptom was this failure in tests/install/basic-1: + ginstall: cannot create directory `rel/a': Stale NFS file handle + + The preceding change solved part of the problem. Now ginstall fails. + * tests/install/basic-1: Temporarily, don't redirect ginstall's + stderr to /dev/null, so I can see why the NFS autobuilder's NFS test + is failing. + + * tests/install/basic-1: When setting up an unreadable "." in an + inaccessible parent, make the parent inaccessible *after* making "." + unreadable. Otherwise, running "chmod a-r ." in an already- + inaccessible parent would fail on NFS with "Stale NFS file handle". + Reported by Bob Proulx. + + * Makefile.maint (po-check): Exclude c99-to-c89.diff. + +2007-03-09 Jim Meyering + + Avoid test failures on Darwin 7.9.0 (MacOS X 10.3.9) + * tests/chgrp/basic: Don't let failure by chgrp to set the + group of a symlink make this test fail. Do give a diagnostic. + In the chgrp-no-change-ctime test, add darwin7.9.0 as another + known-failing system. + When failing on some other system, print $host_triplet, too. + Also avoid test failures on Darwin 8.8.x (MacOS X 10.4). + Reported by Peter Fales. + +2007-03-08 Jim Meyering + + * src/c99-to-c89.diff: Reflect the new c99'ism, update offsets. + +2007-03-08 Paul Eggert + + rm without -f: give a better diagnostic when euidaccess fails. + * src/remove.c (write_protected_non_symlink): Return int, not bool, + so that we can indicate failure too (as a postive error number). + (prompt): If write_protected_non_symlink fails, report that error + number and fail rather than charging ahead and removing the dubious + entry. Redo the logic of printing a diagnostic so that we need to + invoke quote (full_filename (...)) only once. More details at: + + +2007-03-08 Jim Meyering + + Generalize a few more cvs-isms. + * bootstrap (checkout_only_file): Rename from CVS_only_file. + Change comments and diagnostics not to say "CVS". + + * bootstrap: Run libtool, if necessary. + + Make bootstrap a little more general. + * bootstrap (build_aux): Factor out/use this definition. + Formally require a "AC_CONFIG_AUX_DIR($build_aux)" line in configure.ac. + (insert_sorted_if_absent): Move function definition "up", to + precede new first use. + If $build_aux/ doesn't exist initially, create it, and + mark it as ignored. + +2007-03-03 Andrew Church (tiny change) + Paul Eggert + + Fix a bug: cp -x would fail to set mount point permissions. + * NEWS: mention cp -x bug fix + * src/copy.c (copy_internal): Don't return immediately after + copying a mount point that we do not intend to recurse under. + Based on a patch by Andrew Church. + +2007-03-03 Jim Meyering + + pwd-unreadable-parent: Skip test on ia64/Linux, too. + * tests/misc/pwd-unreadable-parent: Also skip when $REPLACE_GETCWD. + Reported by Bob Proulx. + +2007-03-02 Jim Meyering + + pwd-unreadable-parent: Skip test on non-Linux/GNU systems. + * tests/misc/pwd-unreadable-parent: Rather than trying to decide + whether this test has a chance of succeeding, run it only when + $(host_os) is linux-gnu. It was failing on powerpc-apple-darwin8.8.0 + * tests/misc/Makefile.am (TESTS_ENVIRONMENT): Add host_os=$(host_os). + + * tests/misc/pwd-long: Also allow "+" in $PWD. + + Remove another coreutils-ism. Formatting cleanup. + * Makefile.maint (my-distcheck): Update an outdated comment. + (emit_upload_commands): Use $(PACKAGE) rather than "coreutils". + (my-distcheck): Skip the c99/c89 check if there's no such .diff file. + +2007-03-01 Jim Meyering + + * Makefile.maint (warn_cflags): Hoist, adding "-Dlint -O". + (my-distcheck): Use the new variable, instead of too-long literal. + + Make "make syntax-check" rules less coreutils-specific. + * Makefile.maint (sc_cast_of_x_alloc_return_value): Use CVS_LIST_EXCEPT. + (sc_cast_of_alloca_return_value): Likewise. + (sc_root_tests): Do nothing if there is no check-root target + in tests/Makefile.am. + + Run the writable-files check only for release-building targets. + * Makefile.maint (local-checks-available): Remove writable-files. + (alpha beta major): Put it here, instead. + + "make syntax-check" now runs only Makefile.cfg-selected tests + * Makefile.maint (syntax-check-rules): Hoist this definition so that + it precedes the indirect use in the definition of $(local-check). + (local-check): Use :=, not just "=". + (syntax-check): Depend on $(local-check), not $(syntax-check-rules). + +2007-02-28 Bruno Haible + + * bootstrap.conf (gnulib_modules): Replace xreadlink with + xreadlink-with-size. Add xreadlink. + * src/copy.c (copy_internal): Update. + * src/ls.c (is_directory): Update. + * src/stat.c (print_stat): Update. + * src/readlink.c (main): Use the one-argument xreadlink function. + +2007-02-28 Paul Eggert + + * doc/coreutils.texi (Common options): --si outputs "M", not "MB". + Problem reported by Philip Rowlands in + . + +2007-02-28 Jim Meyering + + * .x-sc_file_system: Add the new test, tests/misc/df-P, to this + list of exceptions, for the "make distcheck" sc_file_system rule. + + * Makefile.maint (gnulib_snapshot_date): Remove now-unused definition. + +2007-02-27 Paul Eggert + + Make df -P immune to effects of e.g., the BLOCK_SIZE envvar. + * NEWS: With -P, the default block size and output format is not + affected by DF_BLOCK_SIZE, BLOCK_SIZE, or BLOCKSIZE. + * src/df.c (main): Implement this. + +2007-02-27 Jim Meyering + + Add a test for the above. + * tests/misc/df-P: New file. + * tests/misc/Makefile.am (TESTS): Add df-P. + +2007-02-25 Jim Meyering + + * Makefile.maint (announcement): Adjust so that it works with + announce-gen's --gnulib-snapshot-time-stamp option. + Indent one of the command lines using TAB, not 8 spaces. + + Post-release version change. + * NEWS: Add a line for 6.8+. + * configure.ac (AC_INIT): Set new version string. + +2007-02-24 Jim Meyering + + Version 6.8. + * NEWS: Record release date and new version number. + * configure.ac (AC_INIT): New version number. + + Don't skip this test on new-enough Linux/GNU systems. + * tests/misc/pwd-unreadable-parent: Test $REPLACE_GETCWD = 0, + rather than for __GETCWD_PREFIX in config.h (the latter is no + longer defined, ever, due to gnulib changes). + * tests/misc/Makefile.am (TESTS_ENVIRONMENT): Define REPLACE_GETCWD. + + Remove the "gnits" option; it prohibits my using "+" as a version + string suffix, and all it does (beyond the default "gnu" option) + is to _require_ the THANKS file. + * configure.ac (AM_INIT_AUTOMAKE): Remove it. + + Remove all AUTOMAKE_OPTIONS settings in Makefile.am files. + * tests/chgrp/Makefile.am, tests/chmod/Makefile.am: + * tests/chown/Makefile.am, tests/cp/Makefile.am: + * tests/du/Makefile.am, tests/expr/Makefile.am: + * tests/factor/Makefile.am, tests/general/Makefile.am: + * tests/install/Makefile.am, tests/ln/Makefile.am: + * tests/ls/Makefile.am, tests/mkdir/Makefile.am: + * tests/mv/Makefile.am, tests/readlink/Makefile.am: + * tests/rm/Makefile.am, tests/rmdir/Makefile.am: + * tests/seq/Makefile.am, tests/stty/Makefile.am: + * tests/tee/Makefile.am, tests/touch/Makefile.am: + + * README: Document the OSF/1 4.0d build failure and work-around. + Reported by Bruno Haible. + + * NEWS: Use a simple "+" suffix to denote pre-release, not "-dirty". + Nicer connotations. + * configure.ac: Use 6.7+, not 6.7-dirty. + +2007-02-24 Paul Eggert + + * NEWS: sort no longer compresses temporaries by default. + * bootstrap.conf: Remove findprog. + * doc/coreutils.texi (sort invocation): The default is to not + compress. Don't treat "" specially. + * src/sort.c: Don't include findprog.h. + (create_temp): Compress only if the user specified --compress-program. + * tests/misc/sort-compress: Adjusts tests to match new behavior. + +2007-02-24 Jim Meyering + + Avoid a shell syntax error, when building with an inadequate Perl. + * man/Makefile.am (.x.1): Add quotes around $(PERL) in case, since + it can expand to "/.../missing perl". + + * man/Makefile.am (.x.1): Warn when unable to update a man page. + Suggestion from Bruno Haible. + +2007-02-23 Bruno Haible + + Handle better the combination of old Perl and a pre-c99 compiler. + * man/Makefile.am (.x.1): If the autoconf test has determined that + perl is missing or not a sufficient version, do nothing. + + * tests/readlink/can-e: Put the closing double-quote at the end of a + backquoted word, not in the middle. Works around a bug in sh on + OSF/1 4.0d. + * tests/readlink/can-f: Likewise. + * tests/readlink/can-m: Likewise. + + * tests/du/slink: Skip the test if executing on an nfsv3 file system. + This avoids a test failure at least on OSF/1 4.0d. + +2007-02-23 Jim Meyering + + * src/date.c (usage): Split a diagnostic that had grown to be + longer than the C89 maximum of 509 bytes. + +2007-02-23 Ed Santiago + + * src/date.c (usage): Mention that --rfc-3339 uses space, not 'T', + for a separator. Include sample RFC 2822 and 3339 output. + +2007-02-23 Jim Meyering + + With -Dlint, make shuf free all heap-allocated storage. + * src/shuf.c (main): Move declaration of input_lines to + function scope, and initialize to NULL, so we can free it. + [lint]: Free all malloc'd memory. + * tests/misc/shuf: Also test shuf's -e and -i options. + +2007-02-22 Jim Meyering + + Merge in a change from some other incarnation of this file (gzip?) + * bootstrap (gnulib_tool): Skip get_translations if there is no po/ dir. + + Adjust preceding change not to perform an unaligned access. + * src/copy.c (copy_reg): Undo previous change. Instead, make + it clearer that we're using a single-byte sentinel, and + [lint]: Initialize sizeof (uintptr_t) - 1 bytes after the sentinel. + Reported by Andreas Schwab. + + Placate valgrind, wrt ./cp --sparse=always + * src/copy.c (copy_reg): Place the sentinel by setting a + full word's worth of bits, not just a single byte's worth. + This avoids a harmless (but distracting) case of memory being + used-uninitialized. + +2007-02-21 Paul Eggert + + Honor dd's noatime flag if possible, even if not supported on build fs + * doc/coreutils.texi (dd invocation): Warn that noatime might not be + reliable. + * src/dd.c (flags, usage): Look at O_NOATIME, not + HAVE_WORKING_O_NOATIME, to decide whether to support the noatime + flag, so that dd attempts O_NOATIME even if the build file system + does not support it. Problem reported by Jim Meyering today in + bug-coreutils. + * tests/dd/misc: Generate a warning, not a failure, if noatime + exists but fails. + +2007-02-21 Jim Meyering + + * tests/misc/date: Remove vestigial use of Data::Dumper. + +2007-02-20 Paul Eggert + + * src/copy.c (cached_umask): Cast -1 to mode_t to avoid a warning + about out-of-range initializer with Sun C 5.8. + +2007-02-20 Jim Meyering + + * bootstrap (CVS_only_file): Use README-hacking. + + Now that we use GIT, not cvs, rename README-cvs. + * README-hacking: Renamed from... + Update to reflect that we now use git. + + * README-cvs: ...this. + + * src/env.c (main): When invoked with no arguments (i.e. when printing + the environment), use a local variable to iterate through the global + "environ" array, rather than "environ" itself. This is solely to + avoid changing the environment for an LD_PRELOAD-substituted "puts" + or "exit" function. Tiny patch by Harvey Eneman. See + . + * THANKS: Update. + + * bootstrap: Move definitions of temporary directory names and the + new bt_regex "up" to precede all uses, so it's clearer what their + scope is. Also, use [.], rather than \\., since the former works + even if eval'd. + + * bootstrap: Remove occurrences of $bt (._bootmp) from lib/Makefile. + Based on the bison 2007-02-19 change by Joel E. Denny. + +2007-02-19 Paul Eggert + + * NEWS: sort now uses a --compress-program option rather than + an environment variable. + * doc/coreutils.texi (sort invocation): Document this. + * src/sort.c (usage): Likewise. + (COMPRESS_PROGRAM_OPTION): New const. + (long_options, create_temp, main): Support new option. + * tests/misc/sort-compress: Test it. + +2007-02-19 Jim Meyering + + * bootstrap: Fix typo s/dowloading/downloading/ in --help output. + +2007-02-18 Jim Meyering + + * src/system.h: Don't include exit.h, now that it's subsumed + by the gnulib-generated stdlib.h. + + * tests/rm/fail-eacces: Skip this test when running as root. + Reported by Matthew Woehlke. + + * bootstrap: Use "._bootmp" as the temporary directory name, + not ".#bootmp". The latter's "#" caused trouble with the new, + gnulib-added "LINK_WARNING_H = $(top_srcdir)/.#bootmp/..." line. + +2007-02-14 Paul Eggert + + * bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase. + * src/dircolors.c: Include c-strcase.h. + (dc_parse_stream): Use c_strcasecmp rather than + strcasecmp to avoid unreliable results in locales like Turkish + where strcasecmp is incompatible with the C locale. + +2007-02-13 Jim Meyering + + Also check for and print stderr output, in case a program fails. + * tests/misc/tty-eof: Occasionally (not reproducible), this + test would fail, with one or more programs exiting nonzero, e.g., + tty-eof: sha224sum exited with status 1 (expected 0) + Now, maybe we'll get a clue, the next time that happens. + +2007-02-12 Jim Meyering + + * .x-sc_useless_cpp_parens: Ignore a false-positive in a shell script. + + * tests/misc/pwd-unreadable-parent: Skip the test if we're + definitely using the replacement. + * tests/misc/Makefile.am (TESTS_ENVIRONMENT): Define CONFIG_HEADER. + +2007-02-10 Jim Meyering + + Remove excess leading spaces that would make help2man misbehave. + * src/printf.c (usage): Remove excess spaces on 2nd line of %b desc. + * src/nl.c (usage): Remove excess spaces on 2nd line of pBRE desc. + * src/dd.c (usage): Remove excess spaces on 2nd line of sync desc. + * src/date.c (usage): Use two spaces after each optional flag, not one. + Reported by Thomas Huriaux in . + + * Makefile.maint (longopt_re): Relax the regexp, making square + brackets optional, so it matches the newly reported violations, too. + + * src/csplit.c (usage): Use two spaces (not one) to separate + each option string from its description, so help2man formats + the derived man page properly. Reported by Thomas Huriaux in + . + * src/df.c (usage): Likewise. + * src/du.c (usage): Likewise. + * src/install.c (usage): Likewise. + * src/ls.c (usage): Likewise. + +2007-02-03 Jim Meyering + + Test for today's gnulib/lib/getcwd.c fix affecting pwd and readlink + * NEWS: Mention the bug fix. + * tests/misc/pwd-unreadable-parent: New file. + * tests/misc/Makefile.am (TESTS): Ad pwd-unreadable-parent. + +2007-02-02 Paul Eggert + + * NEWS: Document fix for cp --preserve=mode. + * src/copy.c (copy_internal): Omit the group- or other-writeable + permissions when creating a directory, to avoid a race condition + if the special mode bits aren't right just after the directory is + created. + * src/cp.c (make_dir_parents_private): Likewise. + * tests/cp/parent-perm-race: Test for the "cp --preserve=mode" + race fix in copy.c. + + * NEWS: Document fix for cp --parents. + * src/cp.c (make_dir_parents_private): Report the error sooner with + "cp --parents DIR/FILE DEST" when DIR is a non-directory, thus not + creating the directory, DEST/DIR. + * tests/cp/cp-parents: Test for the non-race-condition bug fixed + by the above change. + +2007-02-02 Jim Meyering + + * src/nl.c (proc_text): Use "NULL", not "(struct re_registers *) 0". + + * src/c99-to-c89.diff: Make shred.c Index: and a/b prefixes + consistent, so this can be applied with patch -p0. + Reported by Matthew Woehlke. + + Arrange for "make check-root" to run the new root-only test. + * tests/Makefile.am (t9): New target, to run tests/cp/cp-a-selinux. + (all_t): Add t9. + + * Makefile.maint (patch-check): Use patch with its -p2 option, + since that makes this check slightly more strict. + + Use a directory on a loopback device mounted with -o context=... + * tests/cp/cp-a-selinux: Since this test now runs mount and umount, + it is a root-only one. + +2007-01-29 Jim Meyering + + Plug a leak in ls. + * src/ls.c (print_dir): Don't leak a "DIR"+fd upon failure to + determine dev/inode or upon detecting a symlink loop. + + * src/ls.c: Rename three global variables. + (cwd_file): Rename from 'files'. + (cwd_n_alloc): Rename from 'nfiles'. + (cwd_n_used): Rename from 'files_index'. + + Shave 8 bytes off the size of "struct fileinfo". + * src/ls.c (fileinfo): Put all members of type "bool" together. + +2007-01-28 Paul Eggert + + Modify "ls" to sort its data faster, using the new gnulib mpsort + module rather than qsort. This is particularly a win in + environments where strcoll is slow, since mpsort typically calls + strcoll less often than qsort does. + * bootstrap.conf (gnulib_modules): Add mpsort. + * src/ls.c: Include mpsort.h. + (sorted_file, sorted_file_alloc): New vars, for a new vector of + pointers to the file info, for speed. + (clear_files, extract_dirs_from_files, sort_files, print_current_files): + (print_many_per_line, print_horizontal, print_with_commas): + (calculate_columns): Set and use new vector. + (initialize_ordering_vector): New function. + +2007-01-26 Paul Eggert + + Adjust to today's change to gnulib, which added a module for + string.h to replace the little include files like strcase.h. + * src/dircolors.c: Don't include strcase.h. + * src/system.h: Don't include mempcpy.h, memrchr.h, stpcpy.h, strpbrk.h. + +2007-01-26 Jim Meyering + + * src/dd.c (advance_input_after_read_error): Change diagnostic to + say "invalid file offset" rather than "screwy file offset". + + * .x-sc_cast_of_argument_to_free: Remove this file. + * Makefile.am (EXTRA_DIST): Likewise. + +2007-01-25 Dan Hipschman + + * src/sort.c (create_temp): Remove superfluous access-X_OK + check. find_in_path does this for us. + +2007-01-24 Jim Meyering + + Remove usually-skipped test. + * tests/cp/open-perm-race: Remove this file. It is subsumed + by parent-perm-race. + * tests/cp/Makefile.am (TESTS): Remove open-perm-race. + * tests/sort/Makefile.am: Regenerate. + + Pass "make distcheck" again. + * src/sort.c (usage): Split a diagnostic that had grown to be + longer than the C89 maximum of 509 bytes. + * .x-sc_cast_of_argument_to_free: New file. Allow a cast in sort.c. + FIXME: this is just temporary, while we wait to remove the offending + access-calling code. + * Makefile.am (EXTRA_DIST): Add .x-sc_cast_of_argument_to_free. + * Makefile.maint (sc_cast_of_argument_to_free): Use the + canonical, $$($(CVS_LIST_EXCEPT)). + * m4/.gitignore, m4/.cvsignore, lib/.gitignore, lib/.cvsignore: Update. + +2007-01-24 Paul Eggert + + * NEWS: New option sort -C, proposed by XCU ERN 127, which looks + like it will be approved. Also add --check=quiet, --check=silent + as long aliases, and --check=diagnose-first as an alias for -c. + * doc/coreutils.texi (sort invocation): Document this. + Also, mention that sort -c can take at most one file. + * src/sort.c: Implement this. + Include argmatch.h. + (usage): Document the change. + (CHECK_OPTION): New constant. + (long_options): --check now takes an optional argument, and is now + treated differently from 'c'. + (check_args, check_types): New constant arrays. + (check): New arg CHECKONLY, which suppresses diagnostic if -C. + (main): Parse the new options. + * tests/sort/Test.pm (02d, 02d, incompat5, incompat6): + New tests for -C. + +2007-01-24 Jim Meyering + + Fix a typo. + * tests/misc/sort-compress: Use $abs_top_builddir, not $top_builddir. + * tests/misc/Makefile.am (TESTS_ENVIRONMENT): Likewise. + + Don't depend on "which". + * tests/misc/sort-compress (SORT): Use $abs_builddir, now which. + * tests/misc/Makefile.am (TESTS_ENVIRONMENT): Export top_builddir. + +2007-01-24 Dan Hipschman + + Test sort compression. + * tests/misc/Makefile.am: Add the test. + * tests/misc/sort-compress: New file containing the tests. + +2007-01-24 Jim Meyering + + * NEWS: sort temp file compression: tweak wording. + * src/sort.c (struct sortfile) [name]: Declare member to be const. + +2007-01-21 Jim Meyering + + * src/sort.c (MAX_FORK_RETRIES_COMPRESS, MAX_FORK_RETRIES_DECOMPRESS): + In pipe_fork callers, use these named constants, not "2" and "8". + (proctab, nprocs): Declare to be "static". + (pipe_fork) [lint]: Initialize local, pid, + to avoid unwarranted may-be-used-uninitialized warning. + (create_temp): Use the active voice. Describe parameters, too. + +2007-01-21 James Youngman + + Centralize all the uses of sigprocmask(). Don't restore an invalid + saved mask. + * src/sort.c (enter_cs, leave_cs): New functions for protecting + code sequences against signal delivery. + * (exit_cleanup): Use enter_cs and leave_cs instead of + calling sigprocmask directly. + (create_temp_file, pipe_fork, zaptemp): Likewise + +2007-01-21 Dan Hipschman + + Add compression of temp files to sort. + * NEWS: Mention this. + * bootstrap.conf: Import findprog. + * configure.ac: Add AC_FUNC_FORK. + * doc/coreutils.texi: Document GNUSORT_COMPRESSOR environment + variable. + * src/sort.c (compress_program): New global, holds the name of the + external compression program. + (struct sortfile): New type used by mergepfs and friends instead + of filenames to hold PIDs of compressor processes. + (proctab): New global, holds compressor PIDs on which to wait. + (enum procstate, struct procnode): New types used by proctab. + (proctab_hasher, proctab_comparator): New functions for proctab. + (nprocs): New global, number of forked but unreaped children. + (reap, reap_some): New function, wait for/cleanup forked processes. + (register_proc, update_proc, wait_proc): New functions for adding, + modifying and removing proctab entries. + (create_temp_file): Change parameter type to pointer to file + descriptor, and return type to pointer to struct tempnode. + (dup2_or_die): New function used in create_temp and open_temp. + (pipe_fork): New function, creates a pipe and child process. + (create_temp): Creates a temp file and possibly a compression + program to which we filter output. + (open_temp): Opens a compressed temp file and creates a + decompression process through which to filter the input. + (mergefps): Change FILES parameter type to struct sortfile array + and update access accordingly. Use open_temp and reap_some. + (avoid_trashing_input, merge): Change FILES parameter like + mergefps and call create_temp instead of create_temp_file. + (sort): Call create_temp instead of create_temp_file. + Use reap_some. + (avoid_trashing_input, merge, sort, main): Adapt to mergefps. + + The idea of compressing sorts temporary files was first + suggested/implemented by Jay Soffian in 1998, and again + by Charles Randall in 2001. + +2007-01-20 Jim Meyering + + * tests/misc/pwd-long: Work properly even when run from the + wrong one of two or more bind-mounted sibling directories. + Suggestion from Mike Stone in . + +2007-01-20 Paul Eggert + + Standardize on list of signals when an app catches signals. + * src/csplit.c (main): Also catch SIGALRM, SIGPIPE, SIGPOLL, + SIGPROF, SIGVTALRM, SIGXCPU, SIGXFSZ. + * src/ls.c (main): Likewise (except SIGPIPE was already caught). + Note that ls.c is special, as it also catches SIGTSTP. + * src/sort.c (main): Likewise. Also catch SIGQUIT. More details in + . + +2007-01-19 Dan Hipschman + and Paul Eggert + + * src/sort.c (cleanup): Clear temphead at the end. + (exit_cleanup): New function. + (main): Don't invoke atexit until we're ready. + Invoke it with exit_cleanup, not with cleanup and close_stdout, + to avoid a race condition with cleanup and signal handling. More + details: http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/9508 + +2007-01-18 Jim Meyering + + * src/c99-to-c89.diff: Adjust remove.c offsets. + +2007-01-17 Jim Meyering + + Make "rm --interactive=never ..." never prompt. + * NEWS: Mention this. + * src/remove.h (enum rm_interactive): New ternary type. + (struct rm_options) [interactive]: Use it, here -- rather than bool. + * src/remove.c (prompt): Reflect type change. + * src/mv.c (rm_option_init): Initialize to RMI_NEVER now. + * src/rm.c (main): Add a FIXME comment for '-d' option. + Adapt to type change of rm_options.interactive. + + * tests/rm/i-never: New file. Test for the above fix. + * tests/rm/Makefile.am (TESTS): Add i-never. + +2007-01-15 Jim Meyering + + * bootstrap (gnulib_tool): When adding to .cvsignore and .gitignore, + emit foo.h, for each foo_.h. This yields one false-positive, fts.h, + but that's ok, since fts_.h will eventually be renamed. + + * src/remove.c (remove_dir): Don't use errno in diagnostic. + Root-only test failure reported by Alex van Hout and Jon Grosshart in + . + + * bootstrap.conf (avoided_gnulib_modules): Fix my typo: + s/--avoid=canonicalize-lgpl/--avoid=canonicalize-gpl/ + +2007-01-14 Bruno Haible + + Enable use of gnulib's new fchdir module. + * bootstrap.conf (avoided_gnulib_modules): Avoid canonicalize-lgpl, + since we use canonicalize. + (gnulib_modules): Add fchdir. + * m4/jm-macros.m4 (coreutils_MACROS): Remove fchdir-stub. + +2007-01-13 Jim Meyering + + * tests/cp/open-perm-race: Remove gdb-based test. + It would run only when compiled with -g, and besides is now + subsumed by file-perm-race. + * tests/cp/Makefile.am (TESTS): Remove open-perm-race. + + * Transform all Makefile.am files so that when running "make check", + CU_TEST_NAME is set to the name of the test. This is so that when I + run valgrind-enabled (--log-file-qualifier=CU_TEST_NAME) "make check" + on the entire package it is more convenient to map a leak or error + found in a valgrind log file back to the offending test. + Use this command: + (echo tests/Makefile.am.in; find tests -name Makefile.am) \ + |xargs perl -pi -e '/^(\s*)PATH=...VG_PATH_PREFIX/ and ' \ + -e 'print $1,q|CU_TEST_NAME=`basename $(abs_srcdir)`,$$tst |,"\\\n"' + +2007-01-11 Jim Meyering + + Avoid a leak in expr's implementation of the ":" (match) operator. + * src/expr.c (docolon): Free the regexp buffer using regfree, rather + than doing it manually, being careful to set fastmap to NULL first. + Free any re_regs.start and .end members, if necessary. + + * tests/misc/test-diag: Work also when libc's error function + reports the entire program name ("../../src/test"), rather than + just the final component. + +2007-01-10 Jim Meyering + + Don't use fts_statp uninitialized for "chown -RLh --preserve-root ...". + * src/chown-core.c (FTSENT_IS_DIRECTORY): New macro. + (change_file_owner): Perform the ROOT_DEV_INO_CHECK only for a + directory. Non-directory entries lack fts_statp data when using + the FTS_NOSTAT option. + +2007-01-07 Jim Meyering + + * tests/sample-test: Update copyright date to 2007. + * Makefile.maint (copyright-check): Also check the copyright date + in tests/sample-test. + +2007-01-06 Jim Meyering + + * tests/fmt/basic (pfx-only, pfx-of-pfx): New tests, + based on examples from G.P. Halkes in + . + +2007-01-06 G.P. Halkes + + * src/fmt.c (copy_rest): Correct prefix handling. + Don't elide a line with the prefix followed by only white space. + (get_line): Move EOF-check to loop-termination condition. + * tests/fmt/basic (pfx-1): Adjust test to expect desired result. + (pfx-2): Remove test; its premise was contrary to the documentation. + +2007-01-05 Jim Meyering + + Avoid a used-uninitialized bug for invalid input, i.e., when the size + of the input, not counting newlines, is 1 % 4. + * gl/lib/base64.c (base64_decode): Don't hard-code inlen==4. + It may be smaller when flushing. + +2007-01-05 Mike Frysinger + + * src/dircolors.hin: Add a TERM directive for cons25. + +2007-01-04 Jim Meyering + + * Makefile.cfg (local-checks-to-skip): Skip strftime-check, in + case you don't have convenient access to glibc info documentation. + + Use the release year, not the current year. + * src/groups.sh (version): Use a better name: @RELEASE_YEAR@. + * src/Makefile.am (RELEASE_YEAR): Define it. + (.sh): Use it. + Thanks to a prod from Eric Blake. + + Ensure that "group --version" always prints the current year. + * src/groups.sh (version): Use @CURRENT_YEAR@, rather than 2006. + * src/Makefile.am (.sh): Also substitute for @CURRENT_YEAR@. + Suggestion from Eric Blake. + + When decoding, always allow newlines in input, with almost no + performance impact. + * src/base64.c (do_decode): Initialize decode context. + Call base64_decode one more time, after all input is processed. + (usage): When decoding, newlines are always accepted. + + * tests/misc/base64: Add a bunch of tests, for the above. + * gl/lib/base64.c: Include . + (base64_decode_ctx_init, get_4, decode_4): New functions. + (base64_decode): Efficiently handle interspersed newlines. + (base64_decode_alloc): Update signature. + * gl/lib/base64.h (struct base64_decode_context): Define. + (base64_decode_ctx_init): Add prototype. + (base64_decode, base64_decode_alloc): Update prototypes. + + * gl/lib/base64.c: Copied from gnulib. + * gl/lib/base64.h: Likewise. + +2007-01-03 Jim Meyering + + * THANKS: Add Evan Hunt. + +2007-01-03 Bruno Haible + + Avoid spurious test failures on MacOS X 10.3.9, in a German locale. + * tests/chown/deref: Apply lang-default. + * tests/misc/split-a: Likewise. + * tests/mv/reply-no: Likewise. + + * src/copy.c (copy_internal): Use mkfifo as a fallback if mknod fails. + Needed on MacOS X. + +2007-01-02 Paul Eggert + + Now, "ls -FRL" always follows symbolic links on Linux. + * NEWS: Mention this bug fix. + * src/ls.c (gobble_file): Fix bug reported by + Nobuyuki Tsuchimura in + http://lists.gnu.org/archive/html/bug-coreutils/2006-12/msg00152.html + where "ls -FRL" didn't follow a symbolic link in some cases on Linux. + * tests/ls/follow-slink: Add a test for this case. + +2007-01-01 Jim Meyering + + * tests/rm/fail-eperm: Revert last change. The PATH=... setting + is not honored at least on HP-UX 11.23 systems. + Instead, simply transform the actual output diagnostic. + Test failure reported by Bob Proulx. + + + ----- + + Copyright (C) 2007 Free Software Foundation, Inc. + + Copying and distribution of this file, with or without + modification, are permitted provided the copyright notice + and this notice are preserved. diff --git a/src/bin/coreutils/ChangeLog-2008 b/src/bin/coreutils/ChangeLog-2008 new file mode 100644 index 0000000000..1079060afc --- /dev/null +++ b/src/bin/coreutils/ChangeLog-2008 @@ -0,0 +1,379 @@ +2008-12-16 Jim Meyering + + NB: ChangeLog files are no longer manually maintained. + See HACKING for details. + +2008-02-07 Jim Meyering + + We *do* need two different version files. + One for tarball-only, the other to be updated any time we + get a new value of $(VERSION). + * Makefile.am (dist-hook): Create .tarball-version in dist tarball. + * GNUmakefile (_curr-ver): Make git-version-gen use it. + * .gitignore: Ignore it. + + Fix a typo in description of size suffixes: s/GB/G/. + * doc/coreutils.texi (od invocation, head invocation, tail invocation): + Spotted by Bert Wesarg. + + * NEWS [6.9.90]: Mention the added feature that head, od, split and + tail now accept the standard size suffixes (kB, M, MB, G, GB, and + so on for T, P, Y, Z, and Y) on arguments to selected options. + +2008-02-06 Steven Schubiger + + mkdir, split: write --verbose output to stdout, not stderr. + * src/mkdir.c (verbose_output): New function. + (announce_mkdir): Use it. + * src/split.c (usage): Update. + * src/split.c (cwrite): Write to stdout, not stderr. + * doc/coreutils.texi (split invocation): Remove the mention + of --verbose output being printed to stderr. + * tests/mkdir/p-v: Redirect stdout, not stderr. + * tests/misc/split-a: Likewise. + * NEWS: Mention this change. + * TODO: Remove this item. + +2008-02-04 Jim Meyering + + * Makefile.maint (announcement): Remove stale comment. + +2008-02-02 Jim Meyering + + Clarify a comment. + * tests/sort/Test.pm: Replace a vague ChangeLog reference with a URL. + +2008-01-31 Bob Proulx + + Improve wording of date and time man page. + * man/date.x: Improve compact description of the --date=STRING. + * man/touch.x: Likewise. + Suggested by A. Costa. + +2008-01-31 Jim Meyering + + Remove alignment constraint from the sha*_read_ctx functions. + * lib/sha256.c (set_uint32): New function. + (sha256_read_ctx, sha224_read_ctx): Use it. + * lib/sha512.c (set_uint64): New function. + (sha512_read_ctx, sha384_read_ctx): Use it. + * lib/sha256.h: Remove warning about alignment constraint. + * lib/sha512.h: Likewise. + Prompted by similar changes in gnulib's sha1 and md[45] modules. + + Adapt to new version of vc-list-files. + * tests/check.mk (vc_exe_in_TESTS): Adapt to new constraint + that vc-list-files be run only from $(top_srcdir). + + Pull vc-list-files from gnulib. + * bootstrap.conf (gnulib_modules): Add vc-list-files. + * build-aux/vc-list-files: Remove file. + + Improve the cp/parent-perm test. + * tests/cp/parent-perm: Also check that perms of existing dest + dirs are changed to match those of corresponding src dir + +2008-01-30 Paul Eggert + + Don't modify argv in dd due to ',' in arguments. + * src/dd.c: Include quotearg.h. + (operand_matches): New function. + (parse_symbols, operand_is): Use it. + (parse_symbols): 1st arg is now const pointer. Don't modify it. + msgid arg is now just the message, not a format. + (scanargs): Add some 'const's to check for problems like the above. + +2008-01-30 Jim Meyering + + * src/c99-to-c89.diff: Adjust remove.c offsets, again. + + Now that system.h defines is_empty_dir, include "openat.h". + * src/system.h: Include "openat.h" here, ... + * src/chcon.c: ... not here. + * src/chmod.c: Likewise. + * src/chown-core.c: Likewise. + * src/remove.c: Likewise. + + * src/c99-to-c89.diff: Adjust remove.c offsets. + + Improve "rmdir --ignore-fail-on-non-empty" + * src/rmdir.c (remove_parents, main): With --ignore-fail-on-non-empty, + suppress a diagnostic also for other errno values, which can arise + with read-only media or when the parent directory has the immutable + attribute (set via chattr +i). + (errno_may_be_empty, ignorable_failure): New functions. + * src/remove.c (is_empty_dir): Move function to ... + * src/system.h (is_empty_dir): ...here, and make it inline. + Suggested by Josselin Mouette in + via Bob Proulx. + * NEWS: Mention the improvement. + +2008-01-29 Paul Eggert + + Don't modify argv in dd. + * src/dd.c (operand_is): New function. + (scanargs): Use it so that we don't need to modify argv, as a nicety. + Problem reported by Adam Goode in + . + +2008-01-29 Jim Meyering + + * Makefile.am (BUILT_SOURCES): Ensure that .version exists. + Reported by Bob Proulx. + +2008-01-29 Bob Proulx + + Improve the man pages of --date=STRING for 'date' and 'touch'. + * man/date.x: Add a compact description of the --date=STRING. + * man/touch.x: Likewise. + Reported by A. Costa in http://bugs.debian.org/363011 + +2008-01-29 Michael Stone + + Improve the description of when dd outputs its final statistics. + * doc/coreutils.texi (dd invocation): Say that dd prints stats + upon normal termination and upon SIGINT. + +2008-01-29 Jim Meyering + + Avoid "make distcheck" failure: newly-created man/*.1 files not removed + * Makefile.am (EXTRA_DIST): Add .version. + (.version): New rule. + (dist-hook): Don't create $(distdir)/.version here, now that it's + being distributed. + * man/Makefile.am (common_dep): Use ../.version, not ../VERSION. + (../VERSION): Remove rule. + * GNUmakefile (dummy): Create .version, not VERSION. + Add an extra "...:= $(shell..." statement to ensure that + .version exists even when the preceding code is not run. + * .gitignore: Remove both .version and VERSION. + + ls: don't segfault on files in /proc with an old libselinux + * src/ls.c (gobble_file): Work around a bug in libselinux1-2.0.15 + whereby getfilecon returns 0 yet sets the context to NULL. + Reported by Jan Moringen via Michael Stone in + http://bugs.debian.org/463043 + * tests/ls/Makefile.am (TESTS): Add proc-selinux-segfault. + * tests/ls/proc-selinux-segfault: Test for the above fix. + * NEWS: Mention the fix. + +2008-01-26 Jim Meyering + + Work around Darwin9's set-GID-like group ownership inheritance. + This avoids another spurious Mac OS 10.5.1 (Darwin 9.1) test failure. + * tests/cp/preserve-gid: Accept a group ID of 0, as well. + Reported by Elias Pipping. + + Emit "info coreutils 'PROG invocation'" into the man page, + rather than just "info PROG". The latter would often fail + or simply display the man page. + * man/help2man: Change the template. + Prompted by http://bugs.debian.org/399684 + + chcon: correct description of --no-dereference (-h) option. + * src/chcon.c (usage): Remove invalid reference to lchown. + Reported by Göran Uddeborg. + + Ensure that each version string change propagates to man pages. + * man/Makefile.am (common_dep): Don't depend on configure.ac for + version changes. Instead, depend on ../VERSION. + (../VERSION): New rule. + * Makefile.am (DISTCLEANFILES): Define. + * GNUmakefile: Update ./VERSION. + * .gitignore: List VERSION. + Reported by Sven Joachim. + + Avoid cp/preserve-gid test failure on Mac OS 10.5.1 (Darwin 9.1) + * tests/cp/preserve-gid: Set group as well as owner on ".". + Reported by Elias Pipping. + + Improve a warning about non-portable "mv" usage. + * doc/coreutils.texi (mv invocation): Adjust the warning: moving a + dir-symlink-specified-with-a-trailing-slash works in a surprising + manner only on some systems. Reported by Tomas Pospisek in + http://bugs.debian.org/343652. + +2008-01-26 Mike Frysinger + + * src/dircolors.hin (TERM): Add jfbterm. + +2008-01-23 Jim Meyering + + Clean up build-related rules. + * Makefile.cfg (gnulib_dir): Update comment. + * Makefile.maint (announcement) [cl_date, utc_date]: Don't set + now-unused variables. + + * TODO: Update the note on getgrouplist. + +2008-01-23 Zvi Har'El + + Add a ";", so "make install" works with --enable-install-program=su. + * src/Makefile.am (install_su): Add a semicolon. (tiny change) + +2008-01-23 Jim Meyering + + Avoid misinterpreting mgetgroups failure in running root-only tests. + * src/setuidgid.c (main): Don't misinterpret as size_t an error + return from mgetgroups. Reported by Theodoros V. Kalamatianos. + + * README: Remove/convert a few stray mentions of CVS. + +2008-01-22 Jim Meyering + + Require automake-1.10.1, for its support of dist-lzma. + * configure.ac (AM_INIT_AUTOMAKE): Require 1.10.1. + + Version 6.10. + + * NEWS: Record release date. + + * README-hacking: Update to reflect existence of automake-1.10.1. + +2008-01-18 Jim Meyering + + Update README. + * README: Remove a note about failing tests on SunOS 4. + On Mac OS 10.5.1 (Darwin 9.1), you'll need --disable-acl. + (Running tests as root): Recommend using "check-root", not "check". + +2008-01-17 Jim Meyering + + Do not define-away __attribute__ when __STRICT_ANSI__ is set. + * src/system.h (__attribute__): Remove the __STRICT_ANSI__ disjunct. + It has been unnecessary since approximately gcc-2.6, and now, leaving + it would cause gcc -Werror -ansi to fail to compile csplit.c. + * gl/lib/randread.c (__attribute__): Likewise. + +2008-01-16 Jim Meyering + + * NEWS: Mention the configure.ac fix. + + * TODO: Add an introduction. + Remove a few entries. Update a few others. + +2008-01-13 Jim Meyering + + Remove each output redirection target before writing to it. + * tests/check.mk (vc_exe_in_TESTS): Remove t1 and t2 _first_, + in case they exist beforehand and are not writable. + * build-aux/check.mk (am__check_pre): Likewise, remove $@-t. + +2008-01-13 Elias Pipping + + * configure.ac: Correct a non-portable use of sed. + +2008-01-12 Mike Frysinger + + * src/dircolors.hin (image formats): Add the .svg suffix. + +2008-01-12 Jim Meyering + + Use new version of announce-gen. + * Makefile.maint (announcement): Remove use of the + --gnulib-snapshot-time-stamp option. + Use new --gnulib-version option instead. + (gnulib-version): New variable. + +2008-01-11 Jim Meyering + + * Version 6.9.92. + + * tests/tr/Test.pm: Prefer en_US.ISO-8859-1 to en_US.iso88591. + Suggestions from James Youngman and Pádraig Brady in + http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/12218/focus=12227 + +2008-01-10 Jim Meyering + + * README-hacking: Add Git to the list of required tools. + +2008-01-08 Paul Eggert + + Fix a minor race condition when using cp -p --parents. + * src/cp.c (make_dir_parents_private): If stat fails on the parent + directory, do not add it to the list of directories whose modes + might need fixing later. Also, do not bother invoking 'stat' + unless the stat results might be needed later. + +2008-01-08 Jim Meyering + + parent-perm: avoid a bizarre test failure. + * tests/cp/parent-perm: Accommodate the situation in which + chmod ("dir", 02755) returns 0 yet fails to set the S_ISGID bit. + + Remove uses of now-undefined Makefile variable. + * src/Makefile.am (dir_LDADD, ls_LDADD, vdir_LDADD): Remove uses + of no-longer-defined variable, $(LIB_ACL_TRIVIAL). + +2008-01-07 Jim Meyering + + cp (but not copy.c): plug a small leak. + * src/cp.c (do_copy) [--parents]: Free the attribute list. + + Make a racy test failure less likely to happen. + * tests/misc/tty-eof: Uncomment a debug "warn". + This change happens to make this test far less likely to fail. + With that statement commented out, this test would fail about + 20% of the time on my desktop. Now, it's gone 100 iterations + in a row with no failure. + + * NEWS: Mention the cp bug fix. + +2008-01-07 Jan Blunck + + cp --parents: don't use uninitialized memory when restoring permissions + * src/cp.c (make_dir_parents_private): Always stat each source + directory, in case its permissions are required in re_protect, + when setting permissions of a just-created destination directory. + +2008-01-07 Jim Meyering + + cp: add a test for today's bug fix. + * tests/cp/parent-perm: New script. Test today's change. + Based on reproducer from Jan Blunck. + * tests/cp/Makefile.am (TESTS): Add parent-perm. + +2008-01-06 Jim Meyering + + touch: add a test for today's change. + * tests/touch/now-owned-by-other: New script. Test today's change. + * tests/touch/Makefile.am (TESTS): Add now-owned-by-other. + * tests/Makefile.am (all_t): Add td, a new root-only test. + (td): New target. + * NEWS: Mention the improvement. + +2008-01-06 Paul Eggert + + touch: ignore "-d now" option, when appropriate + * src/touch.c (main): Treat "-d now" as if it were absent, if + neither -a nor -m is specified. Problem reported by Dan Jacobson in: + http://lists.gnu.org/archive/html/bug-coreutils/2008-01/msg00010.html + +2008-01-05 Jim Meyering + + Avoid tr case-conversion failure in some locales. + * src/tr.c (skip_construct): New function. + (main): When processing a pair of case-converting classes, don't + iterate through the elements of each [:upper:] or [:lower:] class. + Reported by Gerald Pfeifer in + . + * tests/tr/Test.pm [tolower-F]: New test for the above fix. + [upcase-xtra, dncase-xtra]: New tests, for a related code path. + * NEWS: Mention the tr bug fix. + +2008-01-02 Jim Meyering + + * .gitignore: Ignore lzma-compressed files, too. + + Update copyright date. + * tests/sample-test: Likewise. + * doc/coreutils.texi: Likewise. + + + ----- + + Copyright (C) 2008 Free Software Foundation, Inc. + + Copying and distribution of this file, with or without + modification, are permitted provided the copyright notice + and this notice are preserved. diff --git a/src/bin/coreutils/GNUmakefile b/src/bin/coreutils/GNUmakefile index 38d55245e5..33eb3aa4d5 100644 --- a/src/bin/coreutils/GNUmakefile +++ b/src/bin/coreutils/GNUmakefile @@ -1,24 +1,24 @@ # Having a separate GNUmakefile lets me `include' the dynamically -# generated rules created via Makefile.maint as well as Makefile.maint itself. +# generated rules created via cfg.mk (package-local configuration) +# as well as maint.mk (generic maintainer rules). # This makefile is used only if you run GNU Make. # It is necessary if you want to build targets usually of interest # only to the maintainer. -# Copyright (C) 2001, 2003, 2006 Free Software Foundation, Inc. -# -# This program is free software; you can redistribute it and/or modify +# Copyright (C) 2001, 2003, 2006-2009 Free Software Foundation, Inc. + +# This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or +# the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# + # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . # Systems where /bin/sh is not the default shell need this. The $(shell) # command below won't work with e.g. stock DOS/Windows shells. @@ -30,22 +30,79 @@ else SHELL = sh endif -have-Makefile := $(shell test -f Makefile && echo yes) - # If the user runs GNU make but has not yet run ./configure, # give them a diagnostic. -ifeq ($(have-Makefile),yes) +_have-Makefile := $(shell test -f Makefile && echo yes) +ifeq ($(_have-Makefile),yes) # Make tar archive easier to reproduce. export TAR_OPTIONS = --owner=0 --group=0 --numeric-owner +# Allow the user to add to this in the Makefile. +ALL_RECURSIVE_TARGETS = + include Makefile -include $(srcdir)/Makefile.cfg -include $(srcdir)/Makefile.maint + +# Some projects override e.g., _autoreconf here. +-include $(srcdir)/cfg.mk +include $(srcdir)/maint.mk + +# Allow cfg.mk to override these. +_build-aux ?= build-aux +_autoreconf ?= autoreconf + +# Ensure that $(VERSION) is up to date for dist-related targets, but not +# for others: rerunning autoreconf and recompiling everything isn't cheap. +_have-git-version-gen := \ + $(shell test -f $(srcdir)/$(_build-aux)/git-version-gen && echo yes) +ifeq ($(_have-git-version-gen)0,yes$(MAKELEVEL)) + _is-dist-target ?= $(filter-out %clean, \ + $(filter maintainer-% dist% alpha beta major,$(MAKECMDGOALS))) + _is-install-target ?= $(filter-out %check, $(filter install%,$(MAKECMDGOALS))) + ifneq (,$(_is-dist-target)$(_is-install-target)) + _curr-ver := $(shell cd $(srcdir) \ + && $(_build-aux)/git-version-gen .tarball-version) + ifneq ($(_curr-ver),$(VERSION)) + ifeq ($(_curr-ver),UNKNOWN) + $(info WARNING: unable to verify if $(VERSION) is the correct version) + else + ifneq (,$(_is-install-target)) + # GNU Coding Standards state that 'make install' should not cause + # recompilation after 'make all'. But as long as changing the version + # string alters config.h, the cost of having 'make all' always have an + # up-to-date version is prohibitive. So, as a compromise, we merely + # warn when installing a version string that is out of date; the user + # should run 'autoreconf' (or something like 'make distcheck') to + # fix the version, 'make all' to propagate it, then 'make install'. + $(info WARNING: version string $(VERSION) is out of date;) + $(info run '$(MAKE) _version' to fix it) + else + $(info INFO: running autoreconf for new version string: $(_curr-ver)) + _dummy := $(shell $(MAKE) $(AM_MAKEFLAGS) _version) + endif + endif + endif + endif +endif + +.PHONY: _version +_version: + cd $(srcdir) && rm -rf autom4te.cache .version && $(_autoreconf) else -all: +.DEFAULT_GOAL := abort-due-to-no-makefile +srcdir = . + +# The package can override .DEFAULT_GOAL to run actions like autoreconf. +-include ./cfg.mk +include ./maint.mk + +ifeq ($(.DEFAULT_GOAL),abort-due-to-no-makefile) +$(MAKECMDGOALS): abort-due-to-no-makefile +endif + +abort-due-to-no-makefile: @echo There seems to be no Makefile in this directory. 1>&2 @echo "You must run ./configure before running \`make'." 1>&2 @exit 1 @@ -53,6 +110,18 @@ all: endif # Tell version 3.79 and up of GNU make to not build goals in this -# directory in parallel. This is necessary in case someone tries to -# build multiple targets on one command line. +# directory in parallel, in case someone tries to build multiple +# targets, and one of them can cause a recursive target to be invoked. + +# Only set this if Automake doesn't provide it. +AM_RECURSIVE_TARGETS ?= $(RECURSIVE_TARGETS:-recursive=) \ + $(RECURSIVE_CLEAN_TARGETS:-recursive=) \ + dist distcheck tags ctags + +ALL_RECURSIVE_TARGETS += $(AM_RECURSIVE_TARGETS) + +ifneq ($(word 2, $(MAKECMDGOALS)), ) +ifneq ($(filter $(ALL_RECURSIVE_TARGETS), $(MAKECMDGOALS)), ) .NOTPARALLEL: +endif +endif diff --git a/src/bin/coreutils/INSTALL b/src/bin/coreutils/INSTALL index 5458714e1e..2550dab752 100644 --- a/src/bin/coreutils/INSTALL +++ b/src/bin/coreutils/INSTALL @@ -2,15 +2,15 @@ Installation Instructions ************************* Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, -2006 Free Software Foundation, Inc. +2006, 2007, 2008, 2009 Free Software Foundation, Inc. -This file is free documentation; the Free Software Foundation gives + This file is free documentation; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. Basic Installation ================== -Briefly, the shell commands `./configure; make; make install' should + Briefly, the shell commands `./configure; make; make install' should configure, build, and install this package. The following more-detailed instructions are generic; see the `README' file for instructions specific to this package. @@ -67,12 +67,15 @@ The simplest way to compile this package is: all sorts of other programs in order to regenerate files that came with the distribution. + 6. Often, you can also type `make uninstall' to remove the installed + files again. + Compilers and Options ===================== -Some systems require unusual options for compilation or linking that the -`configure' script does not know about. Run `./configure --help' for -details on some of the pertinent environment variables. + Some systems require unusual options for compilation or linking that +the `configure' script does not know about. Run `./configure --help' +for details on some of the pertinent environment variables. You can give `configure' initial values for configuration parameters by setting variables in the command line or in the environment. Here @@ -85,7 +88,7 @@ is an example: Compiling For Multiple Architectures ==================================== -You can compile the package for more than one kind of computer at the + You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you can use GNU `make'. `cd' to the directory where you want the object files and executables to go and run @@ -97,10 +100,24 @@ architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. + On MacOS X 10.5 and later systems, you can create libraries and +executables that work on multiple system types--known as "fat" or +"universal" binaries--by specifying multiple `-arch' options to the +compiler but only a single `-arch' option to the preprocessor. Like +this: + + ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ + CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ + CPP="gcc -E" CXXCPP="g++ -E" + + This is not guaranteed to produce working output in all cases, you +may have to build one architecture at a time and combine the results +using the `lipo' tool if you have problems. + Installation Names ================== -By default, `make install' installs the package's commands under + By default, `make install' installs the package's commands under `/usr/local/bin', include files under `/usr/local/include', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PREFIX'. @@ -123,7 +140,7 @@ option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Optional Features ================= -Some packages pay attention to `--enable-FEATURE' options to + Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The @@ -135,14 +152,46 @@ find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. +Particular systems +================== + + On HP-UX, the default C compiler is not ANSI C compatible. If GNU +CC is not installed, it is recommended to use the following options in +order to use an ANSI C compiler: + + ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" + +and if that doesn't work, install pre-built binaries of GCC for HP-UX. + + On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot +parse its `' header file. The option `-nodtk' can be used as +a workaround. If GNU CC is not installed, it is therefore recommended +to try + + ./configure CC="cc" + +and if that doesn't work, try + + ./configure CC="cc -nodtk" + + On Solaris, don't put `/usr/ucb' early in your `PATH'. This +directory contains several dysfunctional programs; working variants of +these programs are available in `/usr/bin'. So, if you need `/usr/ucb' +in your `PATH', put it _after_ `/usr/bin'. + + On Haiku, software installed for all users goes in `/boot/common', +not `/usr/local'. It is recommended to use the following options: + + ./configure --prefix=/boot/common + Specifying the System Type ========================== -There may be some features `configure' cannot figure out automatically, -but needs to determine by the type of machine the package will run on. -Usually, assuming the package is built to be run on the _same_ -architectures, `configure' can figure that out, but if it prints a -message saying it cannot guess the machine type, give it the + There may be some features `configure' cannot figure out +automatically, but needs to determine by the type of machine the package +will run on. Usually, assuming the package is built to be run on the +_same_ architectures, `configure' can figure that out, but if it prints +a message saying it cannot guess the machine type, give it the `--build=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name which has the form: @@ -150,7 +199,8 @@ type, such as `sun4', or a canonical name which has the form: where SYSTEM can have one of these forms: - OS KERNEL-OS + OS + KERNEL-OS See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't @@ -168,9 +218,9 @@ eventually be run) with `--host=TYPE'. Sharing Defaults ================ -If you want to set default values for `configure' scripts to share, you -can create a site shell script called `config.site' that gives default -values for variables like `CC', `cache_file', and `prefix'. + If you want to set default values for `configure' scripts to share, +you can create a site shell script called `config.site' that gives +default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. @@ -179,7 +229,7 @@ A warning: not all `configure' scripts look for a site script. Defining Variables ================== -Variables not defined in a site shell script can be set in the + Variables not defined in a site shell script can be set in the environment passed to `configure'. However, some packages may run configure again during the build, and the customized values of these variables may be lost. In order to avoid this problem, you should set @@ -198,11 +248,19 @@ an Autoconf bug. Until the bug is fixed you can use this workaround: `configure' Invocation ====================== -`configure' recognizes the following options to control how it operates. + `configure' recognizes the following options to control how it +operates. `--help' `-h' - Print a summary of the options to `configure', and exit. + Print a summary of all of the options to `configure', and exit. + +`--help=short' +`--help=recursive' + Print a summary of the options unique to this package's + `configure', and exit. The `short' variant lists options used + only in the top level, while the `recursive' variant lists options + also present in any nested packages. `--version' `-V' @@ -229,6 +287,16 @@ an Autoconf bug. Until the bug is fixed you can use this workaround: Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. +`--prefix=DIR' + Use DIR as the installation prefix. *Note Installation Names:: + for more details, including other options available for fine-tuning + the installation locations. + +`--no-create' +`-n' + Run the configure checks, but stop before creating any output + files. + `configure' also accepts some other, not widely useful, options. Run `configure --help' for more details. diff --git a/src/bin/coreutils/Makefile.am b/src/bin/coreutils/Makefile.am index 1a6307717f..7670cd650e 100644 --- a/src/bin/coreutils/Makefile.am +++ b/src/bin/coreutils/Makefile.am @@ -1,10 +1,10 @@ # Make coreutils. -*-Makefile-*- -# Copyright (C) 1990, 1993-2007 Free Software Foundation, Inc. +# Copyright (C) 1990, 1993-2009 Free Software Foundation, Inc. -# This program is free software; you can redistribute it and/or modify +# This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or +# the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # This program is distributed in the hope that it will be useful, @@ -13,54 +13,73 @@ # GNU General Public License for more details. # You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -# 02110-1301, USA. +# along with this program. If not, see . -SUBDIRS = lib src doc man po tests -EXTRA_DIST = Makefile.cfg Makefile.maint GNUmakefile \ - .gitignore \ - .hgignore \ - .kludge-stamp .prev-version THANKS-to-translators THANKStt.in \ - .vg-suppressions \ - .x-po-check \ - .x-sc_file_system .x-sc_obsolete_symbols \ - .x-sc_prohibit_atoi_atof \ - .x-sc_require_config_h \ - .x-sc_space_tab .x-sc_sun_os_names \ - .x-sc_trailing_blank \ - .x-sc_unmarked_diagnostics \ - .x-sc_useless_cpp_parens \ - ChangeLog-2005 \ - bootstrap \ - bootstrap.conf \ - build-aux/cvsu \ - build-aux/vc-list-files \ - gl/modules/getloadavg.diff \ - m4/ChangeLog \ - old/fileutils/ChangeLog \ - old/fileutils/ChangeLog-1997 \ - old/fileutils/NEWS \ - old/sh-utils/ChangeLog \ - old/sh-utils/ChangeLog.0 \ - old/sh-utils/NEWS \ - old/textutils/ChangeLog \ - old/textutils/NEWS +ALL_RECURSIVE_TARGETS = +SUBDIRS = lib src doc man po tests gnulib-tests + +changelog_etc = \ + ChangeLog-2005 \ + ChangeLog-2006 \ + ChangeLog-2007 \ + ChangeLog-2008 \ + build-aux/ChangeLog-2007 \ + doc/ChangeLog-2007 \ + lib/ChangeLog-2007 \ + m4/ChangeLog-2007 \ + old/fileutils/ChangeLog \ + old/fileutils/ChangeLog-1997 \ + old/fileutils/NEWS \ + old/sh-utils/ChangeLog \ + old/sh-utils/ChangeLog.0 \ + old/sh-utils/NEWS \ + old/textutils/ChangeLog \ + old/textutils/NEWS \ + po/ChangeLog-2007 + +syntax_check_exceptions = \ + .x-sc_GPL_version \ + .x-sc_file_system \ + .x-sc_obsolete_symbols \ + .x-sc_po_check \ + .x-sc_program_name \ + .x-sc_prohibit_atoi_atof \ + .x-sc_prohibit_stat_st_blocks \ + .x-sc_prohibit_strcmp \ + .x-sc_require_config_h \ + .x-sc_space_tab \ + .x-sc_sun_os_names \ + .x-sc_trailing_blank \ + .x-sc_unmarked_diagnostics \ + .x-sc_useless_cpp_parens + +EXTRA_DIST = \ + $(changelog_etc) \ + $(syntax_check_exceptions) \ + .prev-version \ + .version \ + .vg-suppressions \ + THANKS-to-translators \ + THANKStt.in \ + bootstrap \ + bootstrap.conf \ + build-aux/cvsu \ + cfg.mk \ + dist-check.mk \ + gl/modules/getloadavg.diff \ + maint.mk + +ALL_RECURSIVE_TARGETS += install-root install-root: cd src && $(MAKE) $@ ACLOCAL_AMFLAGS = -I m4 # Some tests always need root privileges, others need them only sometimes. +ALL_RECURSIVE_TARGETS += check-root check-root: - cd tests && $(MAKE) $@ - -dist-hook: - test -x $(srcdir)/build-aux/install-sh - -distcheck-hook: - $(MAKE) my-distcheck + cd tests && $(MAKE) $@ SUBDIRS= # Just prior to distribution, ... # transform the automake-generated rule that runs `rm -f rm'. @@ -69,20 +88,55 @@ distcheck-hook: # in the shell's search path that running `rm' would run the `rm' # executable in the current directory. # Similarly, adjust the clean-binPROGRAMS rule. - rm_subst = \ - s!(rm -f (rm|\$$\(bin_PROGRAMS\)))$$!$$1 > /dev/null 2>&1 || /bin/$$1! -MAINTAINERCLEANFILES = .kludge-stamp -.kludge-stamp: $(srcdir)/src/Makefile.in - perl -pi -e '$(rm_subst)' $(srcdir)/src/Makefile.in - touch $@ + s!(rm -f (rm\b|\$$\(bin_PROGRAMS\)$$))!$$1 > /dev/null 2>&1 || /bin/$$1! +BUILT_SOURCES = .version +.version: + echo $(VERSION) > $@-t && mv $@-t $@ -MAINTAINERCLEANFILES += THANKS-to-translators +# Arrange so that .tarball-version appears only in the distribution +# tarball, and never in a checked-out repository. +# The perl substitution is to change some key uses of "rm" to "/bin/rm". +# See the rm_subst comment for details. +dist-hook: gen-ChangeLog + echo $(VERSION) > $(distdir)/.tarball-version + perl -pi -e '$(rm_subst)' $(distdir)/src/Makefile.in + +gen_start_date = 2008-02-08 +.PHONY: gen-ChangeLog +gen-ChangeLog: + if test -d .git; then \ + $(top_srcdir)/build-aux/gitlog-to-changelog \ + --since=$(gen_start_date) > $(distdir)/cl-t; \ + rm -f $(distdir)/ChangeLog; \ + mv $(distdir)/cl-t $(distdir)/ChangeLog; \ + fi + +ALL_RECURSIVE_TARGETS += distcheck-hook +distcheck-hook: check-ls-dircolors + $(MAKE) my-distcheck + +DISTCLEANFILES = VERSION +MAINTAINERCLEANFILES = THANKS-to-translators THANKS-to-translators: po/LINGUAS THANKStt.in ( \ cat $(srcdir)/THANKStt.in; \ - for lang in `cat $(srcdir)/po/LINGUAS`; do \ - echo http://www.iro.umontreal.ca/contrib/po/HTML/team-$$lang.html; \ + for lang in `cat $(srcdir)/po/LINGUAS`; do \ + echo http://translationproject.org/team/$$lang.html; \ done; \ ) > $@-tmp && mv $@-tmp $@ + +# Ensure that the sets of two-letter codes in ls.c and dircolors.c +# remain in sync. +.PHONY: check-ls-dircolors +check-ls-dircolors: + dc=$$(sed -n '/static.*ls_codes\[/,/};'/p \ + $(srcdir)/src/dircolors.c \ + |sed -n '/^ *"/p'|tr , '\n'|sed 's/^ *//' \ + |sed -n 's/^"\(..\)"/\1/p'|sort -u); \ + ls=$$(sed -n '/static.*indicator_name\[/,/};'/\p \ + $(srcdir)/src/ls.c \ + |sed -n '/^ *"/p'|tr , '\n'|sed 's/^ *//' \ + |sed -n 's/^"\(..\)"/\1/p'|sort -u); \ + test "$$dc" = "$$ls" diff --git a/src/bin/coreutils/Makefile.cfg b/src/bin/coreutils/Makefile.cfg deleted file mode 100644 index 4ade0bddb3..0000000000 --- a/src/bin/coreutils/Makefile.cfg +++ /dev/null @@ -1,40 +0,0 @@ -# Customize Makefile.maint. -*- makefile -*- -# Copyright (C) 2003-2007 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -# 02110-1301, USA. - -# Use alpha.gnu.org for alpha and beta releases. -# Use ftp.gnu.org for major releases. -gnu_ftp_host-alpha = alpha.gnu.org -gnu_ftp_host-beta = alpha.gnu.org -gnu_ftp_host-major = ftp.gnu.org -gnu_rel_host = $(gnu_ftp_host-$(RELEASE_TYPE)) - -url_dir_list = \ - ftp://$(gnu_rel_host)/gnu/coreutils - -# The GnuPG ID of the key used to sign the tarballs. -gpg_key_ID = D333CBA1 - -# Tests not to run as part of "make distcheck". -# Exclude changelog-check here so that there's less churn in ChangeLog -# files -- otherwise, you'd need to have the upcoming version number -# at the top of the file for each `make distcheck' run. -local-checks-to-skip = changelog-check strftime-check - -# The local directory containing the checked-out copy of gnulib used in -# this release. Used solely to get a date for the "announcement" target. -gnulib_dir = /gnulib diff --git a/src/bin/coreutils/Makefile.in b/src/bin/coreutils/Makefile.in index a2cd3ba9d2..769450a9b3 100644 --- a/src/bin/coreutils/Makefile.in +++ b/src/bin/coreutils/Makefile.in @@ -1,8 +1,9 @@ -# Makefile.in generated by automake 1.10 from Makefile.am. +# Makefile.in generated by automake 1.10c from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -16,11 +17,11 @@ # Make coreutils. -*-Makefile-*- -# Copyright (C) 1990, 1993-2007 Free Software Foundation, Inc. +# Copyright (C) 1990, 1993-2009 Free Software Foundation, Inc. -# This program is free software; you can redistribute it and/or modify +# This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or +# the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # This program is distributed in the hope that it will be useful, @@ -29,13 +30,12 @@ # GNU General Public License for more details. # You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -# 02110-1301, USA. +# along with this program. If not, see . VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c @@ -54,42 +54,50 @@ subdir = . DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(top_srcdir)/configure ABOUT-NLS \ AUTHORS COPYING ChangeLog INSTALL NEWS THANKS TODO \ - build-aux/ChangeLog build-aux/compile build-aux/config.guess \ + build-aux/compile build-aux/config.guess \ build-aux/config.rpath build-aux/config.sub build-aux/depcomp \ build-aux/install-sh build-aux/mdate-sh build-aux/missing \ build-aux/texinfo.tex build-aux/ylwrap ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/absolute-header.m4 \ +am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \ $(top_srcdir)/m4/acl.m4 $(top_srcdir)/m4/alloca.m4 \ - $(top_srcdir)/m4/allocsa.m4 $(top_srcdir)/m4/argmatch.m4 \ - $(top_srcdir)/m4/arpa_inet_h.m4 $(top_srcdir)/m4/assert.m4 \ - $(top_srcdir)/m4/atexit.m4 $(top_srcdir)/m4/autobuild.m4 \ - $(top_srcdir)/m4/backupfile.m4 $(top_srcdir)/m4/base64.m4 \ - $(top_srcdir)/m4/bison.m4 $(top_srcdir)/m4/boottime.m4 \ + $(top_srcdir)/m4/argmatch.m4 $(top_srcdir)/m4/arpa_inet_h.m4 \ + $(top_srcdir)/m4/assert.m4 $(top_srcdir)/m4/atexit.m4 \ + $(top_srcdir)/m4/autobuild.m4 $(top_srcdir)/m4/backupfile.m4 \ + $(top_srcdir)/m4/base64.m4 $(top_srcdir)/m4/bison.m4 \ + $(top_srcdir)/m4/boottime.m4 $(top_srcdir)/m4/btowc.m4 \ $(top_srcdir)/m4/c-strtod.m4 $(top_srcdir)/m4/calloc.m4 \ $(top_srcdir)/m4/canon-host.m4 \ $(top_srcdir)/m4/canonicalize.m4 \ $(top_srcdir)/m4/chdir-long.m4 $(top_srcdir)/m4/check-decl.m4 \ $(top_srcdir)/m4/chown.m4 $(top_srcdir)/m4/clock_time.m4 \ $(top_srcdir)/m4/cloexec.m4 $(top_srcdir)/m4/close-stream.m4 \ + $(top_srcdir)/m4/close.m4 $(top_srcdir)/m4/closein.m4 \ $(top_srcdir)/m4/closeout.m4 $(top_srcdir)/m4/codeset.m4 \ $(top_srcdir)/m4/config-h.m4 $(top_srcdir)/m4/cycle-check.m4 \ $(top_srcdir)/m4/d-ino.m4 $(top_srcdir)/m4/d-type.m4 \ - $(top_srcdir)/m4/dirfd.m4 $(top_srcdir)/m4/dirname.m4 \ - $(top_srcdir)/m4/dos.m4 $(top_srcdir)/m4/double-slash-root.m4 \ - $(top_srcdir)/m4/dup2.m4 $(top_srcdir)/m4/eealloc.m4 \ - $(top_srcdir)/m4/eoverflow.m4 $(top_srcdir)/m4/error.m4 \ + $(top_srcdir)/m4/dirent_h.m4 $(top_srcdir)/m4/dirfd.m4 \ + $(top_srcdir)/m4/dirname.m4 $(top_srcdir)/m4/dos.m4 \ + $(top_srcdir)/m4/double-slash-root.m4 $(top_srcdir)/m4/dup2.m4 \ + $(top_srcdir)/m4/eealloc.m4 $(top_srcdir)/m4/environ.m4 \ + $(top_srcdir)/m4/errno_h.m4 $(top_srcdir)/m4/error.m4 \ $(top_srcdir)/m4/euidaccess-stat.m4 \ $(top_srcdir)/m4/euidaccess.m4 $(top_srcdir)/m4/exclude.m4 \ - $(top_srcdir)/m4/exitfail.m4 $(top_srcdir)/m4/extensions.m4 \ - $(top_srcdir)/m4/fchdir.m4 $(top_srcdir)/m4/fcntl-safer.m4 \ + $(top_srcdir)/m4/exitfail.m4 $(top_srcdir)/m4/exponentd.m4 \ + $(top_srcdir)/m4/exponentf.m4 $(top_srcdir)/m4/exponentl.m4 \ + $(top_srcdir)/m4/extensions.m4 $(top_srcdir)/m4/fchdir.m4 \ + $(top_srcdir)/m4/fclose.m4 $(top_srcdir)/m4/fcntl-safer.m4 \ $(top_srcdir)/m4/fcntl_h.m4 $(top_srcdir)/m4/fd-reopen.m4 \ - $(top_srcdir)/m4/file-type.m4 $(top_srcdir)/m4/fileblocks.m4 \ - $(top_srcdir)/m4/filemode.m4 $(top_srcdir)/m4/filenamecat.m4 \ - $(top_srcdir)/m4/flexmember.m4 $(top_srcdir)/m4/fnmatch.m4 \ - $(top_srcdir)/m4/fpending.m4 $(top_srcdir)/m4/fprintftime.m4 \ - $(top_srcdir)/m4/free.m4 $(top_srcdir)/m4/fstypename.m4 \ - $(top_srcdir)/m4/fsusage.m4 $(top_srcdir)/m4/ftruncate.m4 \ + $(top_srcdir)/m4/fflush.m4 $(top_srcdir)/m4/file-type.m4 \ + $(top_srcdir)/m4/fileblocks.m4 $(top_srcdir)/m4/filemode.m4 \ + $(top_srcdir)/m4/filenamecat.m4 $(top_srcdir)/m4/flexmember.m4 \ + $(top_srcdir)/m4/float_h.m4 $(top_srcdir)/m4/fnmatch.m4 \ + $(top_srcdir)/m4/fpending.m4 $(top_srcdir)/m4/fpieee.m4 \ + $(top_srcdir)/m4/fprintftime.m4 $(top_srcdir)/m4/fpurge.m4 \ + $(top_srcdir)/m4/freading.m4 $(top_srcdir)/m4/frexp.m4 \ + $(top_srcdir)/m4/frexpl.m4 $(top_srcdir)/m4/fseeko.m4 \ + $(top_srcdir)/m4/fstypename.m4 $(top_srcdir)/m4/fsusage.m4 \ + $(top_srcdir)/m4/ftello.m4 $(top_srcdir)/m4/ftruncate.m4 \ $(top_srcdir)/m4/fts.m4 $(top_srcdir)/m4/getaddrinfo.m4 \ $(top_srcdir)/m4/getcwd-abort-bug.m4 \ $(top_srcdir)/m4/getcwd-path-max.m4 $(top_srcdir)/m4/getcwd.m4 \ @@ -102,49 +110,65 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/absolute-header.m4 \ $(top_srcdir)/m4/gettime.m4 $(top_srcdir)/m4/gettimeofday.m4 \ $(top_srcdir)/m4/getugroups.m4 \ $(top_srcdir)/m4/getusershell.m4 $(top_srcdir)/m4/glibc21.m4 \ + $(top_srcdir)/m4/gmp.m4 $(top_srcdir)/m4/gnu-make.m4 \ $(top_srcdir)/m4/gnulib-common.m4 \ $(top_srcdir)/m4/gnulib-comp.m4 \ $(top_srcdir)/m4/group-member.m4 \ $(top_srcdir)/m4/hard-locale.m4 $(top_srcdir)/m4/hash.m4 \ - $(top_srcdir)/m4/host-os.m4 $(top_srcdir)/m4/human.m4 \ - $(top_srcdir)/m4/i-ring.m4 $(top_srcdir)/m4/iconv.m4 \ - $(top_srcdir)/m4/idcache.m4 $(top_srcdir)/m4/inet_ntop.m4 \ - $(top_srcdir)/m4/inline.m4 $(top_srcdir)/m4/intmax_t.m4 \ + $(top_srcdir)/m4/host-os.m4 $(top_srcdir)/m4/hostent.m4 \ + $(top_srcdir)/m4/human.m4 $(top_srcdir)/m4/i-ring.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/iconv_h.m4 \ + $(top_srcdir)/m4/iconv_open.m4 $(top_srcdir)/m4/idcache.m4 \ + $(top_srcdir)/m4/include-exclude-prog.m4 \ + $(top_srcdir)/m4/include_next.m4 $(top_srcdir)/m4/inet_ntop.m4 \ + $(top_srcdir)/m4/inet_pton.m4 $(top_srcdir)/m4/inline.m4 \ + $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/intmax_t.m4 \ $(top_srcdir)/m4/inttostr.m4 $(top_srcdir)/m4/inttypes-pri.m4 \ $(top_srcdir)/m4/inttypes.m4 $(top_srcdir)/m4/inttypes_h.m4 \ - $(top_srcdir)/m4/isapipe.m4 $(top_srcdir)/m4/jm-macros.m4 \ - $(top_srcdir)/m4/jm-winsz1.m4 $(top_srcdir)/m4/jm-winsz2.m4 \ - $(top_srcdir)/m4/lchmod.m4 $(top_srcdir)/m4/lchown.m4 \ + $(top_srcdir)/m4/isapipe.m4 $(top_srcdir)/m4/isnand.m4 \ + $(top_srcdir)/m4/isnanf.m4 $(top_srcdir)/m4/isnanl.m4 \ + $(top_srcdir)/m4/jm-macros.m4 $(top_srcdir)/m4/jm-winsz1.m4 \ + $(top_srcdir)/m4/jm-winsz2.m4 $(top_srcdir)/m4/lchmod.m4 \ + $(top_srcdir)/m4/lchown.m4 $(top_srcdir)/m4/ldexpl.m4 \ $(top_srcdir)/m4/lib-check.m4 $(top_srcdir)/m4/lib-ignore.m4 \ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/link-follow.m4 \ - $(top_srcdir)/m4/localcharset.m4 \ - $(top_srcdir)/m4/long-options.m4 \ - $(top_srcdir)/m4/longdouble.m4 $(top_srcdir)/m4/longlong.m4 \ - $(top_srcdir)/m4/ls-mntd-fs.m4 $(top_srcdir)/m4/lstat.m4 \ + $(top_srcdir)/m4/localcharset.m4 $(top_srcdir)/m4/locale-fr.m4 \ + $(top_srcdir)/m4/locale-ja.m4 $(top_srcdir)/m4/locale-tr.m4 \ + $(top_srcdir)/m4/locale-zh.m4 $(top_srcdir)/m4/long-options.m4 \ + $(top_srcdir)/m4/longlong.m4 $(top_srcdir)/m4/ls-mntd-fs.m4 \ + $(top_srcdir)/m4/lseek.m4 $(top_srcdir)/m4/lstat.m4 \ + $(top_srcdir)/m4/malloc.m4 $(top_srcdir)/m4/malloca.m4 \ + $(top_srcdir)/m4/manywarnings.m4 $(top_srcdir)/m4/math_h.m4 \ $(top_srcdir)/m4/mbchar.m4 $(top_srcdir)/m4/mbiter.m4 \ - $(top_srcdir)/m4/mbrtowc.m4 $(top_srcdir)/m4/mbscasecmp.m4 \ + $(top_srcdir)/m4/mbrlen.m4 $(top_srcdir)/m4/mbrtowc.m4 \ + $(top_srcdir)/m4/mbsinit.m4 $(top_srcdir)/m4/mbsrtowcs.m4 \ $(top_srcdir)/m4/mbstate_t.m4 $(top_srcdir)/m4/mbswidth.m4 \ $(top_srcdir)/m4/md5.m4 $(top_srcdir)/m4/memcasecmp.m4 \ $(top_srcdir)/m4/memchr.m4 $(top_srcdir)/m4/memcmp.m4 \ $(top_srcdir)/m4/memcoll.m4 $(top_srcdir)/m4/memcpy.m4 \ $(top_srcdir)/m4/memmove.m4 $(top_srcdir)/m4/mempcpy.m4 \ $(top_srcdir)/m4/memrchr.m4 $(top_srcdir)/m4/memset.m4 \ - $(top_srcdir)/m4/memxfrm.m4 $(top_srcdir)/m4/mkancesdirs.m4 \ - $(top_srcdir)/m4/mkdir-p.m4 $(top_srcdir)/m4/mkdir-slash.m4 \ - $(top_srcdir)/m4/mkstemp.m4 $(top_srcdir)/m4/mktime.m4 \ - $(top_srcdir)/m4/modechange.m4 $(top_srcdir)/m4/mountlist.m4 \ - $(top_srcdir)/m4/mpsort.m4 $(top_srcdir)/m4/nanosleep.m4 \ - $(top_srcdir)/m4/netinet_in_h.m4 $(top_srcdir)/m4/nls.m4 \ - $(top_srcdir)/m4/openat.m4 $(top_srcdir)/m4/pathmax.m4 \ - $(top_srcdir)/m4/perl.m4 $(top_srcdir)/m4/physmem.m4 \ - $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/posixtm.m4 \ - $(top_srcdir)/m4/posixver.m4 $(top_srcdir)/m4/prereq.m4 \ - $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/putenv.m4 \ - $(top_srcdir)/m4/quote.m4 $(top_srcdir)/m4/quotearg.m4 \ - $(top_srcdir)/m4/randint.m4 $(top_srcdir)/m4/randperm.m4 \ - $(top_srcdir)/m4/randread.m4 $(top_srcdir)/m4/readlink.m4 \ - $(top_srcdir)/m4/readtokens.m4 $(top_srcdir)/m4/readutmp.m4 \ + $(top_srcdir)/m4/memxfrm.m4 $(top_srcdir)/m4/mgetgroups.m4 \ + $(top_srcdir)/m4/mkancesdirs.m4 $(top_srcdir)/m4/mkdir-p.m4 \ + $(top_srcdir)/m4/mkdir-slash.m4 $(top_srcdir)/m4/mkstemp.m4 \ + $(top_srcdir)/m4/mktime.m4 $(top_srcdir)/m4/modechange.m4 \ + $(top_srcdir)/m4/mountlist.m4 $(top_srcdir)/m4/mpsort.m4 \ + $(top_srcdir)/m4/multiarch.m4 $(top_srcdir)/m4/nanosleep.m4 \ + $(top_srcdir)/m4/netdb_h.m4 $(top_srcdir)/m4/netinet_in_h.m4 \ + $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/nocrash.m4 \ + $(top_srcdir)/m4/open.m4 $(top_srcdir)/m4/openat.m4 \ + $(top_srcdir)/m4/pathmax.m4 $(top_srcdir)/m4/perl.m4 \ + $(top_srcdir)/m4/perror.m4 $(top_srcdir)/m4/physmem.m4 \ + $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/posix-shell.m4 \ + $(top_srcdir)/m4/posixtm.m4 $(top_srcdir)/m4/posixver.m4 \ + $(top_srcdir)/m4/prereq.m4 $(top_srcdir)/m4/printf-frexp.m4 \ + $(top_srcdir)/m4/printf-frexpl.m4 $(top_srcdir)/m4/printf.m4 \ + $(top_srcdir)/m4/priv-set.m4 $(top_srcdir)/m4/progtest.m4 \ + $(top_srcdir)/m4/putenv.m4 $(top_srcdir)/m4/quote.m4 \ + $(top_srcdir)/m4/quotearg.m4 $(top_srcdir)/m4/read-file.m4 \ + $(top_srcdir)/m4/readlink.m4 $(top_srcdir)/m4/readtokens.m4 \ + $(top_srcdir)/m4/readutmp.m4 $(top_srcdir)/m4/realloc.m4 \ $(top_srcdir)/m4/regex.m4 \ $(top_srcdir)/m4/rename-dest-slash.m4 \ $(top_srcdir)/m4/rename.m4 $(top_srcdir)/m4/rmdir-errno.m4 \ @@ -152,10 +176,17 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/absolute-header.m4 \ $(top_srcdir)/m4/rpmatch.m4 $(top_srcdir)/m4/safe-read.m4 \ $(top_srcdir)/m4/safe-write.m4 $(top_srcdir)/m4/same.m4 \ $(top_srcdir)/m4/save-cwd.m4 $(top_srcdir)/m4/savedir.m4 \ - $(top_srcdir)/m4/savewd.m4 $(top_srcdir)/m4/setenv.m4 \ + $(top_srcdir)/m4/savewd.m4 $(top_srcdir)/m4/select.m4 \ + $(top_srcdir)/m4/selinux-context-h.m4 \ + $(top_srcdir)/m4/selinux-selinux-h.m4 \ + $(top_srcdir)/m4/servent.m4 $(top_srcdir)/m4/setenv.m4 \ $(top_srcdir)/m4/settime.m4 $(top_srcdir)/m4/sha1.m4 \ $(top_srcdir)/m4/sha256.m4 $(top_srcdir)/m4/sha512.m4 \ - $(top_srcdir)/m4/sig2str.m4 $(top_srcdir)/m4/snprintf.m4 \ + $(top_srcdir)/m4/sig2str.m4 $(top_srcdir)/m4/sigaction.m4 \ + $(top_srcdir)/m4/signal_h.m4 \ + $(top_srcdir)/m4/signalblocking.m4 $(top_srcdir)/m4/signbit.m4 \ + $(top_srcdir)/m4/size_max.m4 $(top_srcdir)/m4/sleep.m4 \ + $(top_srcdir)/m4/snprintf.m4 $(top_srcdir)/m4/sockets.m4 \ $(top_srcdir)/m4/socklen.m4 $(top_srcdir)/m4/sockpfaf.m4 \ $(top_srcdir)/m4/ssize_t.m4 $(top_srcdir)/m4/st_dm_mode.m4 \ $(top_srcdir)/m4/stat-prog.m4 $(top_srcdir)/m4/stat-time.m4 \ @@ -163,35 +194,44 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/absolute-header.m4 \ $(top_srcdir)/m4/stdint.m4 $(top_srcdir)/m4/stdint_h.m4 \ $(top_srcdir)/m4/stdio-safer.m4 $(top_srcdir)/m4/stdio_h.m4 \ $(top_srcdir)/m4/stdlib-safer.m4 $(top_srcdir)/m4/stdlib_h.m4 \ - $(top_srcdir)/m4/stpcpy.m4 $(top_srcdir)/m4/strcspn.m4 \ - $(top_srcdir)/m4/strdup.m4 $(top_srcdir)/m4/strftime.m4 \ + $(top_srcdir)/m4/stpcpy.m4 $(top_srcdir)/m4/stpncpy.m4 \ + $(top_srcdir)/m4/strcspn.m4 $(top_srcdir)/m4/strdup.m4 \ + $(top_srcdir)/m4/strerror.m4 $(top_srcdir)/m4/strftime.m4 \ $(top_srcdir)/m4/string_h.m4 $(top_srcdir)/m4/strndup.m4 \ $(top_srcdir)/m4/strnlen.m4 $(top_srcdir)/m4/strnumcmp.m4 \ $(top_srcdir)/m4/strpbrk.m4 $(top_srcdir)/m4/strtod.m4 \ $(top_srcdir)/m4/strtoimax.m4 $(top_srcdir)/m4/strtol.m4 \ $(top_srcdir)/m4/strtoll.m4 $(top_srcdir)/m4/strtoul.m4 \ $(top_srcdir)/m4/strtoull.m4 $(top_srcdir)/m4/strtoumax.m4 \ - $(top_srcdir)/m4/strverscmp.m4 \ + $(top_srcdir)/m4/strverscmp.m4 $(top_srcdir)/m4/sys_ioctl_h.m4 \ + $(top_srcdir)/m4/sys_select_h.m4 \ $(top_srcdir)/m4/sys_socket_h.m4 \ $(top_srcdir)/m4/sys_stat_h.m4 $(top_srcdir)/m4/sys_time_h.m4 \ $(top_srcdir)/m4/tempname.m4 $(top_srcdir)/m4/time_h.m4 \ $(top_srcdir)/m4/time_r.m4 $(top_srcdir)/m4/timespec.m4 \ $(top_srcdir)/m4/tm_gmtoff.m4 $(top_srcdir)/m4/tzset.m4 \ - $(top_srcdir)/m4/unicodeio.m4 $(top_srcdir)/m4/unistd-safer.m4 \ - $(top_srcdir)/m4/unistd_h.m4 $(top_srcdir)/m4/unlink-busy.m4 \ - $(top_srcdir)/m4/unlinkdir.m4 $(top_srcdir)/m4/unlocked-io.m4 \ - $(top_srcdir)/m4/uptime.m4 $(top_srcdir)/m4/userspec.m4 \ - $(top_srcdir)/m4/utimbuf.m4 $(top_srcdir)/m4/utime.m4 \ + $(top_srcdir)/m4/ungetc.m4 $(top_srcdir)/m4/unicodeio.m4 \ + $(top_srcdir)/m4/unistd-safer.m4 $(top_srcdir)/m4/unistd_h.m4 \ + $(top_srcdir)/m4/unlink-busy.m4 $(top_srcdir)/m4/unlinkdir.m4 \ + $(top_srcdir)/m4/unlocked-io.m4 $(top_srcdir)/m4/uptime.m4 \ + $(top_srcdir)/m4/userspec.m4 $(top_srcdir)/m4/utimbuf.m4 \ $(top_srcdir)/m4/utimecmp.m4 $(top_srcdir)/m4/utimens.m4 \ - $(top_srcdir)/m4/utimes-null.m4 $(top_srcdir)/m4/utimes.m4 \ - $(top_srcdir)/m4/vasnprintf.m4 $(top_srcdir)/m4/vasprintf.m4 \ + $(top_srcdir)/m4/utimes.m4 $(top_srcdir)/m4/vasnprintf.m4 \ + $(top_srcdir)/m4/vasprintf-posix.m4 \ + $(top_srcdir)/m4/vasprintf.m4 \ + $(top_srcdir)/m4/vfprintf-posix.m4 \ + $(top_srcdir)/m4/vprintf-posix.m4 $(top_srcdir)/m4/warnings.m4 \ $(top_srcdir)/m4/wchar.m4 $(top_srcdir)/m4/wchar_t.m4 \ + $(top_srcdir)/m4/wcrtomb.m4 $(top_srcdir)/m4/wctob.m4 \ $(top_srcdir)/m4/wctype.m4 $(top_srcdir)/m4/wcwidth.m4 \ - $(top_srcdir)/m4/wint_t.m4 $(top_srcdir)/m4/xalloc.m4 \ - $(top_srcdir)/m4/xfts.m4 $(top_srcdir)/m4/xgetcwd.m4 \ - $(top_srcdir)/m4/xnanosleep.m4 $(top_srcdir)/m4/xstrndup.m4 \ + $(top_srcdir)/m4/wint_t.m4 $(top_srcdir)/m4/write-any-file.m4 \ + $(top_srcdir)/m4/write.m4 $(top_srcdir)/m4/xalloc.m4 \ + $(top_srcdir)/m4/xattr.m4 $(top_srcdir)/m4/xfts.m4 \ + $(top_srcdir)/m4/xgetcwd.m4 $(top_srcdir)/m4/xnanosleep.m4 \ + $(top_srcdir)/m4/xsize.m4 $(top_srcdir)/m4/xstrndup.m4 \ $(top_srcdir)/m4/xstrtod.m4 $(top_srcdir)/m4/xstrtol.m4 \ - $(top_srcdir)/m4/yesno.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/xvasprintf.m4 $(top_srcdir)/m4/yesno.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ @@ -199,6 +239,13 @@ am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/lib/config.h CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) +am__v_GEN_0 = @echo " GEN " $@; +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) +am__v_at_0 = @ SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ @@ -210,6 +257,9 @@ RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ ps-recursive uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive +AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ + $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ + distdir dist dist-all distcheck ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) @@ -217,32 +267,44 @@ DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ - { test ! -d $(distdir) \ - || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ - && rm -fr $(distdir); }; } -DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2 + { test ! -d "$(distdir)" \ + || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -fr "$(distdir)"; }; } +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.xz GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print -ABSOLUTE_DIRENT_H = @ABSOLUTE_DIRENT_H@ -ABSOLUTE_FCNTL_H = @ABSOLUTE_FCNTL_H@ -ABSOLUTE_INTTYPES_H = @ABSOLUTE_INTTYPES_H@ -ABSOLUTE_NETINET_IN_H = @ABSOLUTE_NETINET_IN_H@ -ABSOLUTE_STDINT_H = @ABSOLUTE_STDINT_H@ -ABSOLUTE_STDIO_H = @ABSOLUTE_STDIO_H@ -ABSOLUTE_STDLIB_H = @ABSOLUTE_STDLIB_H@ -ABSOLUTE_STRING_H = @ABSOLUTE_STRING_H@ -ABSOLUTE_SYS_SOCKET_H = @ABSOLUTE_SYS_SOCKET_H@ -ABSOLUTE_SYS_STAT_H = @ABSOLUTE_SYS_STAT_H@ -ABSOLUTE_SYS_TIME_H = @ABSOLUTE_SYS_TIME_H@ -ABSOLUTE_TIME_H = @ABSOLUTE_TIME_H@ -ABSOLUTE_UNISTD_H = @ABSOLUTE_UNISTD_H@ -ABSOLUTE_WCHAR_H = @ABSOLUTE_WCHAR_H@ -ABSOLUTE_WCTYPE_H = @ABSOLUTE_WCTYPE_H@ ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ ALLOCA_H = @ALLOCA_H@ AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@ ARPA_INET_H = @ARPA_INET_H@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -256,46 +318,122 @@ BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ +CONFIG_STATUS_DEPENDENCIES = @CONFIG_STATUS_DEPENDENCIES@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFAULT_POSIX2_VERSION = @DEFAULT_POSIX2_VERSION@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DF_PROG = @DF_PROG@ DIRENT_H = @DIRENT_H@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -EOVERFLOW = @EOVERFLOW@ +EMULTIHOP_HIDDEN = @EMULTIHOP_HIDDEN@ +EMULTIHOP_VALUE = @EMULTIHOP_VALUE@ +ENOLINK_HIDDEN = @ENOLINK_HIDDEN@ +ENOLINK_VALUE = @ENOLINK_VALUE@ +EOVERFLOW_HIDDEN = @EOVERFLOW_HIDDEN@ +EOVERFLOW_VALUE = @EOVERFLOW_VALUE@ +ERRNO_H = @ERRNO_H@ EXEEXT = @EXEEXT@ FCNTL_H = @FCNTL_H@ +FLOAT_H = @FLOAT_H@ FNMATCH_H = @FNMATCH_H@ +GETADDRINFO_LIB = @GETADDRINFO_LIB@ GETLOADAVG_LIBS = @GETLOADAVG_LIBS@ GETOPT_H = @GETOPT_H@ +GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GLIBC21 = @GLIBC21@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ +GNULIB_ACCEPT = @GNULIB_ACCEPT@ +GNULIB_ALPHASORT = @GNULIB_ALPHASORT@ +GNULIB_ATOLL = @GNULIB_ATOLL@ +GNULIB_BIND = @GNULIB_BIND@ +GNULIB_BTOWC = @GNULIB_BTOWC@ +GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@ +GNULIB_CEILF = @GNULIB_CEILF@ +GNULIB_CEILL = @GNULIB_CEILL@ GNULIB_CHOWN = @GNULIB_CHOWN@ +GNULIB_CLOSE = @GNULIB_CLOSE@ +GNULIB_CONNECT = @GNULIB_CONNECT@ +GNULIB_DIRFD = @GNULIB_DIRFD@ +GNULIB_DPRINTF = @GNULIB_DPRINTF@ GNULIB_DUP2 = @GNULIB_DUP2@ +GNULIB_ENVIRON = @GNULIB_ENVIRON@ +GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@ GNULIB_FCHDIR = @GNULIB_FCHDIR@ +GNULIB_FCLOSE = @GNULIB_FCLOSE@ +GNULIB_FFLUSH = @GNULIB_FFLUSH@ +GNULIB_FLOORF = @GNULIB_FLOORF@ +GNULIB_FLOORL = @GNULIB_FLOORL@ +GNULIB_FOPEN = @GNULIB_FOPEN@ +GNULIB_FPRINTF = @GNULIB_FPRINTF@ GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@ +GNULIB_FPUTC = @GNULIB_FPUTC@ +GNULIB_FPUTS = @GNULIB_FPUTS@ +GNULIB_FREOPEN = @GNULIB_FREOPEN@ +GNULIB_FREXP = @GNULIB_FREXP@ +GNULIB_FREXPL = @GNULIB_FREXPL@ +GNULIB_FSEEK = @GNULIB_FSEEK@ +GNULIB_FSEEKO = @GNULIB_FSEEKO@ +GNULIB_FSYNC = @GNULIB_FSYNC@ +GNULIB_FTELL = @GNULIB_FTELL@ +GNULIB_FTELLO = @GNULIB_FTELLO@ GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@ +GNULIB_FWRITE = @GNULIB_FWRITE@ +GNULIB_GETADDRINFO = @GNULIB_GETADDRINFO@ GNULIB_GETCWD = @GNULIB_GETCWD@ +GNULIB_GETDELIM = @GNULIB_GETDELIM@ +GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@ +GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@ +GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@ +GNULIB_GETLINE = @GNULIB_GETLINE@ +GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@ GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ +GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@ +GNULIB_GETPEERNAME = @GNULIB_GETPEERNAME@ +GNULIB_GETSOCKNAME = @GNULIB_GETSOCKNAME@ +GNULIB_GETSOCKOPT = @GNULIB_GETSOCKOPT@ GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ +GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@ GNULIB_IMAXABS = @GNULIB_IMAXABS@ GNULIB_IMAXDIV = @GNULIB_IMAXDIV@ +GNULIB_INET_NTOP = @GNULIB_INET_NTOP@ +GNULIB_INET_PTON = @GNULIB_INET_PTON@ +GNULIB_IOCTL = @GNULIB_IOCTL@ +GNULIB_ISFINITE = @GNULIB_ISFINITE@ +GNULIB_ISINF = @GNULIB_ISINF@ +GNULIB_ISNAN = @GNULIB_ISNAN@ +GNULIB_ISNAND = @GNULIB_ISNAND@ +GNULIB_ISNANF = @GNULIB_ISNANF@ +GNULIB_ISNANL = @GNULIB_ISNANL@ +GNULIB_LCHMOD = @GNULIB_LCHMOD@ +GNULIB_LCHOWN = @GNULIB_LCHOWN@ +GNULIB_LDEXPL = @GNULIB_LDEXPL@ +GNULIB_LINK = @GNULIB_LINK@ +GNULIB_LISTEN = @GNULIB_LISTEN@ +GNULIB_LSEEK = @GNULIB_LSEEK@ +GNULIB_LSTAT = @GNULIB_LSTAT@ +GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@ +GNULIB_MATHL = @GNULIB_MATHL@ +GNULIB_MBRLEN = @GNULIB_MBRLEN@ +GNULIB_MBRTOWC = @GNULIB_MBRTOWC@ GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@ GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@ GNULIB_MBSCHR = @GNULIB_MBSCHR@ GNULIB_MBSCSPN = @GNULIB_MBSCSPN@ +GNULIB_MBSINIT = @GNULIB_MBSINIT@ GNULIB_MBSLEN = @GNULIB_MBSLEN@ GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@ +GNULIB_MBSNLEN = @GNULIB_MBSNLEN@ +GNULIB_MBSNRTOWCS = @GNULIB_MBSNRTOWCS@ GNULIB_MBSPBRK = @GNULIB_MBSPBRK@ GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@ GNULIB_MBSRCHR = @GNULIB_MBSRCHR@ +GNULIB_MBSRTOWCS = @GNULIB_MBSRTOWCS@ GNULIB_MBSSEP = @GNULIB_MBSSEP@ GNULIB_MBSSPN = @GNULIB_MBSSPN@ GNULIB_MBSSTR = @GNULIB_MBSSTR@ @@ -305,82 +443,230 @@ GNULIB_MEMPCPY = @GNULIB_MEMPCPY@ GNULIB_MEMRCHR = @GNULIB_MEMRCHR@ GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ GNULIB_MKSTEMP = @GNULIB_MKSTEMP@ +GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@ +GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@ +GNULIB_OPEN = @GNULIB_OPEN@ +GNULIB_PERROR = @GNULIB_PERROR@ +GNULIB_PRINTF = @GNULIB_PRINTF@ GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@ +GNULIB_PUTC = @GNULIB_PUTC@ +GNULIB_PUTCHAR = @GNULIB_PUTCHAR@ +GNULIB_PUTENV = @GNULIB_PUTENV@ +GNULIB_PUTS = @GNULIB_PUTS@ +GNULIB_RANDOM_R = @GNULIB_RANDOM_R@ +GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@ GNULIB_READLINK = @GNULIB_READLINK@ +GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@ +GNULIB_RECV = @GNULIB_RECV@ +GNULIB_RECVFROM = @GNULIB_RECVFROM@ +GNULIB_ROUND = @GNULIB_ROUND@ +GNULIB_ROUNDF = @GNULIB_ROUNDF@ +GNULIB_ROUNDL = @GNULIB_ROUNDL@ +GNULIB_RPMATCH = @GNULIB_RPMATCH@ +GNULIB_SCANDIR = @GNULIB_SCANDIR@ +GNULIB_SELECT = @GNULIB_SELECT@ +GNULIB_SEND = @GNULIB_SEND@ +GNULIB_SENDTO = @GNULIB_SENDTO@ +GNULIB_SETENV = @GNULIB_SETENV@ +GNULIB_SETSOCKOPT = @GNULIB_SETSOCKOPT@ +GNULIB_SHUTDOWN = @GNULIB_SHUTDOWN@ +GNULIB_SIGACTION = @GNULIB_SIGACTION@ +GNULIB_SIGNAL_H_SIGPIPE = @GNULIB_SIGNAL_H_SIGPIPE@ +GNULIB_SIGNBIT = @GNULIB_SIGNBIT@ +GNULIB_SIGPROCMASK = @GNULIB_SIGPROCMASK@ +GNULIB_SLEEP = @GNULIB_SLEEP@ GNULIB_SNPRINTF = @GNULIB_SNPRINTF@ +GNULIB_SOCKET = @GNULIB_SOCKET@ GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@ +GNULIB_STDIO_H_SIGPIPE = @GNULIB_STDIO_H_SIGPIPE@ GNULIB_STPCPY = @GNULIB_STPCPY@ GNULIB_STPNCPY = @GNULIB_STPNCPY@ GNULIB_STRCASESTR = @GNULIB_STRCASESTR@ GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@ GNULIB_STRDUP = @GNULIB_STRDUP@ +GNULIB_STRERROR = @GNULIB_STRERROR@ GNULIB_STRNDUP = @GNULIB_STRNDUP@ GNULIB_STRNLEN = @GNULIB_STRNLEN@ GNULIB_STRPBRK = @GNULIB_STRPBRK@ GNULIB_STRSEP = @GNULIB_STRSEP@ +GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@ +GNULIB_STRSTR = @GNULIB_STRSTR@ +GNULIB_STRTOD = @GNULIB_STRTOD@ GNULIB_STRTOIMAX = @GNULIB_STRTOIMAX@ GNULIB_STRTOK_R = @GNULIB_STRTOK_R@ +GNULIB_STRTOLL = @GNULIB_STRTOLL@ +GNULIB_STRTOULL = @GNULIB_STRTOULL@ GNULIB_STRTOUMAX = @GNULIB_STRTOUMAX@ +GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@ +GNULIB_TRUNC = @GNULIB_TRUNC@ +GNULIB_TRUNCF = @GNULIB_TRUNCF@ +GNULIB_TRUNCL = @GNULIB_TRUNCL@ +GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@ +GNULIB_UNSETENV = @GNULIB_UNSETENV@ +GNULIB_VASPRINTF = @GNULIB_VASPRINTF@ +GNULIB_VDPRINTF = @GNULIB_VDPRINTF@ +GNULIB_VFPRINTF = @GNULIB_VFPRINTF@ GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@ +GNULIB_VPRINTF = @GNULIB_VPRINTF@ GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@ GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@ GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@ -GNU_PACKAGE = @GNU_PACKAGE@ +GNULIB_WCRTOMB = @GNULIB_WCRTOMB@ +GNULIB_WCSNRTOMBS = @GNULIB_WCSNRTOMBS@ +GNULIB_WCSRTOMBS = @GNULIB_WCSRTOMBS@ +GNULIB_WCTOB = @GNULIB_WCTOB@ +GNULIB_WCWIDTH = @GNULIB_WCWIDTH@ +GNULIB_WRITE = @GNULIB_WRITE@ GREP = @GREP@ +HAVE_ALPHASORT = @HAVE_ALPHASORT@ +HAVE_ARPA_INET_H = @HAVE_ARPA_INET_H@ +HAVE_ATOLL = @HAVE_ATOLL@ +HAVE_BTOWC = @HAVE_BTOWC@ +HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@ +HAVE_DECL_ACOSL = @HAVE_DECL_ACOSL@ +HAVE_DECL_ASINL = @HAVE_DECL_ASINL@ +HAVE_DECL_ATANL = @HAVE_DECL_ATANL@ +HAVE_DECL_COSL = @HAVE_DECL_COSL@ +HAVE_DECL_DIRFD = @HAVE_DECL_DIRFD@ +HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@ +HAVE_DECL_EXPL = @HAVE_DECL_EXPL@ +HAVE_DECL_FREEADDRINFO = @HAVE_DECL_FREEADDRINFO@ +HAVE_DECL_FREXPL = @HAVE_DECL_FREXPL@ +HAVE_DECL_GAI_STRERROR = @HAVE_DECL_GAI_STRERROR@ +HAVE_DECL_GETADDRINFO = @HAVE_DECL_GETADDRINFO@ +HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@ +HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@ +HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@ HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ +HAVE_DECL_GETNAMEINFO = @HAVE_DECL_GETNAMEINFO@ HAVE_DECL_IMAXABS = @HAVE_DECL_IMAXABS@ HAVE_DECL_IMAXDIV = @HAVE_DECL_IMAXDIV@ +HAVE_DECL_INET_NTOP = @HAVE_DECL_INET_NTOP@ +HAVE_DECL_INET_PTON = @HAVE_DECL_INET_PTON@ +HAVE_DECL_LDEXPL = @HAVE_DECL_LDEXPL@ +HAVE_DECL_LOGL = @HAVE_DECL_LOGL@ HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@ HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@ +HAVE_DECL_OBSTACK_PRINTF = @HAVE_DECL_OBSTACK_PRINTF@ +HAVE_DECL_SINL = @HAVE_DECL_SINL@ HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@ +HAVE_DECL_SQRTL = @HAVE_DECL_SQRTL@ HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@ -HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@ +HAVE_DECL_STRERROR = @HAVE_DECL_STRERROR@ HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@ HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@ +HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@ HAVE_DECL_STRTOIMAX = @HAVE_DECL_STRTOIMAX@ HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@ HAVE_DECL_STRTOUMAX = @HAVE_DECL_STRTOUMAX@ +HAVE_DECL_TANL = @HAVE_DECL_TANL@ +HAVE_DECL_TRUNC = @HAVE_DECL_TRUNC@ +HAVE_DECL_TRUNCF = @HAVE_DECL_TRUNCF@ HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@ +HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@ +HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@ +HAVE_DPRINTF = @HAVE_DPRINTF@ HAVE_DUP2 = @HAVE_DUP2@ +HAVE_EUIDACCESS = @HAVE_EUIDACCESS@ +HAVE_FSEEKO = @HAVE_FSEEKO@ +HAVE_FSYNC = @HAVE_FSYNC@ +HAVE_FTELLO = @HAVE_FTELLO@ HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ +HAVE_GETDOMAINNAME = @HAVE_GETDOMAINNAME@ +HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@ +HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@ +HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@ HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ +HAVE_GETUSERSHELL = @HAVE_GETUSERSHELL@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ +HAVE_ISNAND = @HAVE_ISNAND@ +HAVE_ISNANF = @HAVE_ISNANF@ +HAVE_ISNANL = @HAVE_ISNANL@ +HAVE_ISWCNTRL = @HAVE_ISWCNTRL@ +HAVE_LCHMOD = @HAVE_LCHMOD@ +HAVE_LINK = @HAVE_LINK@ HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ +HAVE_LSTAT = @HAVE_LSTAT@ +HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@ +HAVE_MBRLEN = @HAVE_MBRLEN@ +HAVE_MBRTOWC = @HAVE_MBRTOWC@ +HAVE_MBSINIT = @HAVE_MBSINIT@ +HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@ +HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@ HAVE_MEMPCPY = @HAVE_MEMPCPY@ HAVE_MKDTEMP = @HAVE_MKDTEMP@ +HAVE_NETDB_H = @HAVE_NETDB_H@ HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@ +HAVE_OS_H = @HAVE_OS_H@ +HAVE_POSIX_SIGNALBLOCKING = @HAVE_POSIX_SIGNALBLOCKING@ +HAVE_RANDOM_H = @HAVE_RANDOM_H@ +HAVE_RANDOM_R = @HAVE_RANDOM_R@ +HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@ HAVE_READLINK = @HAVE_READLINK@ +HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@ +HAVE_RPMATCH = @HAVE_RPMATCH@ +HAVE_SCANDIR = @HAVE_SCANDIR@ +HAVE_SETENV = @HAVE_SETENV@ +HAVE_SIGACTION = @HAVE_SIGACTION@ +HAVE_SIGINFO_T = @HAVE_SIGINFO_T@ HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@ HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@ HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@ +HAVE_SIGSET_T = @HAVE_SIGSET_T@ +HAVE_SLEEP = @HAVE_SLEEP@ HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE_STPCPY = @HAVE_STPCPY@ HAVE_STPNCPY = @HAVE_STPNCPY@ -HAVE_STRCASECMP = @HAVE_STRCASECMP@ HAVE_STRCASESTR = @HAVE_STRCASESTR@ HAVE_STRCHRNUL = @HAVE_STRCHRNUL@ HAVE_STRNDUP = @HAVE_STRNDUP@ HAVE_STRPBRK = @HAVE_STRPBRK@ HAVE_STRSEP = @HAVE_STRSEP@ +HAVE_STRTOD = @HAVE_STRTOD@ +HAVE_STRTOLL = @HAVE_STRTOLL@ +HAVE_STRTOULL = @HAVE_STRTOULL@ +HAVE_STRUCT_ADDRINFO = @HAVE_STRUCT_ADDRINFO@ +HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@ +HAVE_STRUCT_SIGACTION_SA_SIGACTION = @HAVE_STRUCT_SIGACTION_SA_SIGACTION@ HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@ +HAVE_STRVERSCMP = @HAVE_STRVERSCMP@ HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@ +HAVE_SYS_IOCTL_H = @HAVE_SYS_IOCTL_H@ +HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@ +HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@ +HAVE_SYS_SELECT_H = @HAVE_SYS_SELECT_H@ HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@ HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ +HAVE_TYPE_VOLATILE_SIG_ATOMIC_T = @HAVE_TYPE_VOLATILE_SIG_ATOMIC_T@ HAVE_UNISTD_H = @HAVE_UNISTD_H@ +HAVE_UNSETENV = @HAVE_UNSETENV@ HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ +HAVE_VASPRINTF = @HAVE_VASPRINTF@ +HAVE_VDPRINTF = @HAVE_VDPRINTF@ +HAVE_WCHAR_H = @HAVE_WCHAR_H@ +HAVE_WCRTOMB = @HAVE_WCRTOMB@ +HAVE_WCSNRTOMBS = @HAVE_WCSNRTOMBS@ +HAVE_WCSRTOMBS = @HAVE_WCSRTOMBS@ HAVE_WCTYPE_H = @HAVE_WCTYPE_H@ HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@ HAVE_WINT_T = @HAVE_WINT_T@ HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@ HAVE__BOOL = @HAVE__BOOL@ HELP2MAN = @HELP2MAN@ +HOSTENT_LIB = @HOSTENT_LIB@ +ICONV_H = @ICONV_H@ +INCLUDE_NEXT = @INCLUDE_NEXT@ +INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTALL_SU = @INSTALL_SU@ +INT32_MAX_LT_INTMAX_MAX = @INT32_MAX_LT_INTMAX_MAX@ +INT64_MAX_EQ_LONG_MAX = @INT64_MAX_EQ_LONG_MAX@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ INTTYPES_H = @INTTYPES_H@ @@ -392,15 +678,26 @@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ +LIBSOCKET = @LIBSOCKET@ +LIBTESTS_LIBDEPS = @LIBTESTS_LIBDEPS@ LIB_ACL = @LIB_ACL@ -LIB_ACL_TRIVIAL = @LIB_ACL_TRIVIAL@ +LIB_CAP = @LIB_CAP@ LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@ LIB_CRYPT = @LIB_CRYPT@ LIB_EACCESS = @LIB_EACCESS@ LIB_FDATASYNC = @LIB_FDATASYNC@ LIB_GETHRXTIME = @LIB_GETHRXTIME@ +LIB_GMP = @LIB_GMP@ LIB_NANOSLEEP = @LIB_NANOSLEEP@ +LIB_SELINUX = @LIB_SELINUX@ +LIB_XATTR = @LIB_XATTR@ LN_S = @LN_S@ +LOCALCHARSET_TESTS_ENVIRONMENT = @LOCALCHARSET_TESTS_ENVIRONMENT@ +LOCALE_FR = @LOCALE_FR@ +LOCALE_FR_UTF8 = @LOCALE_FR_UTF8@ +LOCALE_JA = @LOCALE_JA@ +LOCALE_TR_UTF8 = @LOCALE_TR_UTF8@ +LOCALE_ZH_CN = @LOCALE_ZH_CN@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ @@ -411,7 +708,34 @@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ NEED_SETGID = @NEED_SETGID@ +NETDB_H = @NETDB_H@ NETINET_IN_H = @NETINET_IN_H@ +NEXT_ARPA_INET_H = @NEXT_ARPA_INET_H@ +NEXT_DIRENT_H = @NEXT_DIRENT_H@ +NEXT_ERRNO_H = @NEXT_ERRNO_H@ +NEXT_FCNTL_H = @NEXT_FCNTL_H@ +NEXT_FLOAT_H = @NEXT_FLOAT_H@ +NEXT_ICONV_H = @NEXT_ICONV_H@ +NEXT_INTTYPES_H = @NEXT_INTTYPES_H@ +NEXT_MATH_H = @NEXT_MATH_H@ +NEXT_NETDB_H = @NEXT_NETDB_H@ +NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@ +NEXT_SIGNAL_H = @NEXT_SIGNAL_H@ +NEXT_STDARG_H = @NEXT_STDARG_H@ +NEXT_STDINT_H = @NEXT_STDINT_H@ +NEXT_STDIO_H = @NEXT_STDIO_H@ +NEXT_STDLIB_H = @NEXT_STDLIB_H@ +NEXT_STRING_H = @NEXT_STRING_H@ +NEXT_SYS_IOCTL_H = @NEXT_SYS_IOCTL_H@ +NEXT_SYS_SELECT_H = @NEXT_SYS_SELECT_H@ +NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_H@ +NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@ +NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@ +NEXT_TIME_H = @NEXT_TIME_H@ +NEXT_UNISTD_H = @NEXT_UNISTD_H@ +NEXT_WCHAR_H = @NEXT_WCHAR_H@ +NEXT_WCTYPE_H = @NEXT_WCTYPE_H@ +NO_INSTALL_PROGS_DEFAULT = @NO_INSTALL_PROGS_DEFAULT@ OBJEXT = @OBJEXT@ OPTIONAL_BIN_PROGS = @OPTIONAL_BIN_PROGS@ PACKAGE = @PACKAGE@ @@ -419,56 +743,142 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ +POSIX_SHELL = @POSIX_SHELL@ POSUB = @POSUB@ POW_LIB = @POW_LIB@ +PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@ +PREFERABLY_POSIX_SHELL = @PREFERABLY_POSIX_SHELL@ PRIPTR_PREFIX = @PRIPTR_PREFIX@ PRI_MACROS_BROKEN = @PRI_MACROS_BROKEN@ PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ RANLIB = @RANLIB@ +REPLACE_BTOWC = @REPLACE_BTOWC@ +REPLACE_CEILF = @REPLACE_CEILF@ +REPLACE_CEILL = @REPLACE_CEILL@ REPLACE_CHOWN = @REPLACE_CHOWN@ +REPLACE_CLOSE = @REPLACE_CLOSE@ +REPLACE_DPRINTF = @REPLACE_DPRINTF@ REPLACE_FCHDIR = @REPLACE_FCHDIR@ +REPLACE_FCLOSE = @REPLACE_FCLOSE@ +REPLACE_FFLUSH = @REPLACE_FFLUSH@ +REPLACE_FLOORF = @REPLACE_FLOORF@ +REPLACE_FLOORL = @REPLACE_FLOORL@ +REPLACE_FOPEN = @REPLACE_FOPEN@ REPLACE_FPRINTF = @REPLACE_FPRINTF@ +REPLACE_FREOPEN = @REPLACE_FREOPEN@ +REPLACE_FREXP = @REPLACE_FREXP@ +REPLACE_FREXPL = @REPLACE_FREXPL@ +REPLACE_FSEEK = @REPLACE_FSEEK@ +REPLACE_FSEEKO = @REPLACE_FSEEKO@ +REPLACE_FTELL = @REPLACE_FTELL@ +REPLACE_FTELLO = @REPLACE_FTELLO@ REPLACE_GETCWD = @REPLACE_GETCWD@ +REPLACE_GETLINE = @REPLACE_GETLINE@ +REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@ REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@ +REPLACE_HUGE_VAL = @REPLACE_HUGE_VAL@ +REPLACE_ICONV = @REPLACE_ICONV@ +REPLACE_ICONV_OPEN = @REPLACE_ICONV_OPEN@ +REPLACE_ICONV_UTF = @REPLACE_ICONV_UTF@ +REPLACE_ISFINITE = @REPLACE_ISFINITE@ +REPLACE_ISINF = @REPLACE_ISINF@ +REPLACE_ISNAN = @REPLACE_ISNAN@ +REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@ +REPLACE_LCHOWN = @REPLACE_LCHOWN@ +REPLACE_LDEXPL = @REPLACE_LDEXPL@ REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@ +REPLACE_LSEEK = @REPLACE_LSEEK@ +REPLACE_LSTAT = @REPLACE_LSTAT@ +REPLACE_MBRLEN = @REPLACE_MBRLEN@ +REPLACE_MBRTOWC = @REPLACE_MBRTOWC@ +REPLACE_MBSINIT = @REPLACE_MBSINIT@ +REPLACE_MBSNRTOWCS = @REPLACE_MBSNRTOWCS@ +REPLACE_MBSRTOWCS = @REPLACE_MBSRTOWCS@ +REPLACE_MBSTATE_T = @REPLACE_MBSTATE_T@ +REPLACE_MEMMEM = @REPLACE_MEMMEM@ +REPLACE_MKDIR = @REPLACE_MKDIR@ REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ +REPLACE_NAN = @REPLACE_NAN@ REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@ +REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@ +REPLACE_OPEN = @REPLACE_OPEN@ +REPLACE_PERROR = @REPLACE_PERROR@ REPLACE_PRINTF = @REPLACE_PRINTF@ +REPLACE_PUTENV = @REPLACE_PUTENV@ +REPLACE_ROUND = @REPLACE_ROUND@ +REPLACE_ROUNDF = @REPLACE_ROUNDF@ +REPLACE_ROUNDL = @REPLACE_ROUNDL@ +REPLACE_SELECT = @REPLACE_SELECT@ +REPLACE_SIGNBIT = @REPLACE_SIGNBIT@ +REPLACE_SIGNBIT_USING_GCC = @REPLACE_SIGNBIT_USING_GCC@ REPLACE_SNPRINTF = @REPLACE_SNPRINTF@ REPLACE_SPRINTF = @REPLACE_SPRINTF@ +REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@ +REPLACE_STRCASESTR = @REPLACE_STRCASESTR@ +REPLACE_STRDUP = @REPLACE_STRDUP@ +REPLACE_STRERROR = @REPLACE_STRERROR@ REPLACE_STRPTIME = @REPLACE_STRPTIME@ +REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@ +REPLACE_STRSTR = @REPLACE_STRSTR@ +REPLACE_STRTOD = @REPLACE_STRTOD@ REPLACE_TIMEGM = @REPLACE_TIMEGM@ +REPLACE_TRUNCL = @REPLACE_TRUNCL@ +REPLACE_VASPRINTF = @REPLACE_VASPRINTF@ +REPLACE_VDPRINTF = @REPLACE_VDPRINTF@ REPLACE_VFPRINTF = @REPLACE_VFPRINTF@ REPLACE_VPRINTF = @REPLACE_VPRINTF@ REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@ REPLACE_VSPRINTF = @REPLACE_VSPRINTF@ +REPLACE_WCRTOMB = @REPLACE_WCRTOMB@ +REPLACE_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@ +REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@ +REPLACE_WCTOB = @REPLACE_WCTOB@ +REPLACE_WCWIDTH = @REPLACE_WCWIDTH@ +REPLACE_WRITE = @REPLACE_WRITE@ +SELINUX_CONTEXT_H = @SELINUX_CONTEXT_H@ +SELINUX_SELINUX_H = @SELINUX_SELINUX_H@ SEQ_LIBM = @SEQ_LIBM@ +SERVENT_LIB = @SERVENT_LIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@ SIZE_T_SUFFIX = @SIZE_T_SUFFIX@ +STDARG_H = @STDARG_H@ STDBOOL_H = @STDBOOL_H@ STDINT_H = @STDINT_H@ STRIP = @STRIP@ +SYS_IOCTL_H = @SYS_IOCTL_H@ +SYS_IOCTL_H_HAVE_WINSOCK2_H = @SYS_IOCTL_H_HAVE_WINSOCK2_H@ +SYS_SELECT_H = @SYS_SELECT_H@ SYS_SOCKET_H = @SYS_SOCKET_H@ SYS_STAT_H = @SYS_STAT_H@ SYS_TIME_H = @SYS_TIME_H@ SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@ TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@ U = @U@ +UINT32_MAX_LT_UINTMAX_MAX = @UINT32_MAX_LT_UINTMAX_MAX@ +UINT64_MAX_EQ_ULONG_MAX = @UINT64_MAX_EQ_ULONG_MAX@ +UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@ +USE_ACL = @USE_ACL@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ +VOID_UNSETENV = @VOID_UNSETENV@ +WARN_CFLAGS = @WARN_CFLAGS@ WCHAR_H = @WCHAR_H@ WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ WCTYPE_H = @WCTYPE_H@ +WERROR_CFLAGS = @WERROR_CFLAGS@ WINT_T_SUFFIX = @WINT_T_SUFFIX@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ +XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ YACC = @YACC@ YFLAGS = @YFLAGS@ +abs_aux_dir = @abs_aux_dir@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ @@ -493,6 +903,8 @@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gl_LIBOBJS = @gl_LIBOBJS@ gl_LTLIBOBJS = @gl_LTLIBOBJS@ +gltests_LIBOBJS = @gltests_LIBOBJS@ +gltests_LTLIBOBJS = @gltests_LTLIBOBJS@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ @@ -518,37 +930,63 @@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -SUBDIRS = lib src doc man po tests -EXTRA_DIST = Makefile.cfg Makefile.maint GNUmakefile \ - .gitignore \ - .hgignore \ - .kludge-stamp .prev-version THANKS-to-translators THANKStt.in \ - .vg-suppressions \ - .x-po-check \ - .x-sc_file_system .x-sc_obsolete_symbols \ - .x-sc_prohibit_atoi_atof \ - .x-sc_require_config_h \ - .x-sc_space_tab .x-sc_sun_os_names \ - .x-sc_trailing_blank \ - .x-sc_unmarked_diagnostics \ - .x-sc_useless_cpp_parens \ - ChangeLog-2005 \ - bootstrap \ - bootstrap.conf \ - build-aux/cvsu \ - build-aux/vc-list-files \ - gl/modules/getloadavg.diff \ - m4/ChangeLog \ - old/fileutils/ChangeLog \ - old/fileutils/ChangeLog-1997 \ - old/fileutils/NEWS \ - old/sh-utils/ChangeLog \ - old/sh-utils/ChangeLog.0 \ - old/sh-utils/NEWS \ - old/textutils/ChangeLog \ - old/textutils/NEWS + +# Some tests always need root privileges, others need them only sometimes. +ALL_RECURSIVE_TARGETS = install-root check-root distcheck-hook +SUBDIRS = lib src doc man po tests gnulib-tests +changelog_etc = \ + ChangeLog-2005 \ + ChangeLog-2006 \ + ChangeLog-2007 \ + ChangeLog-2008 \ + build-aux/ChangeLog-2007 \ + doc/ChangeLog-2007 \ + lib/ChangeLog-2007 \ + m4/ChangeLog-2007 \ + old/fileutils/ChangeLog \ + old/fileutils/ChangeLog-1997 \ + old/fileutils/NEWS \ + old/sh-utils/ChangeLog \ + old/sh-utils/ChangeLog.0 \ + old/sh-utils/NEWS \ + old/textutils/ChangeLog \ + old/textutils/NEWS \ + po/ChangeLog-2007 + +syntax_check_exceptions = \ + .x-sc_GPL_version \ + .x-sc_file_system \ + .x-sc_obsolete_symbols \ + .x-sc_po_check \ + .x-sc_program_name \ + .x-sc_prohibit_atoi_atof \ + .x-sc_prohibit_stat_st_blocks \ + .x-sc_prohibit_strcmp \ + .x-sc_require_config_h \ + .x-sc_space_tab \ + .x-sc_sun_os_names \ + .x-sc_trailing_blank \ + .x-sc_unmarked_diagnostics \ + .x-sc_useless_cpp_parens + +EXTRA_DIST = \ + $(changelog_etc) \ + $(syntax_check_exceptions) \ + .prev-version \ + .version \ + .vg-suppressions \ + THANKS-to-translators \ + THANKStt.in \ + bootstrap \ + bootstrap.conf \ + build-aux/cvsu \ + cfg.mk \ + dist-check.mk \ + gl/modules/getloadavg.diff \ + maint.mk ACLOCAL_AMFLAGS = -I m4 @@ -560,10 +998,14 @@ ACLOCAL_AMFLAGS = -I m4 # executable in the current directory. # Similarly, adjust the clean-binPROGRAMS rule. rm_subst = \ - s!(rm -f (rm|\$$\(bin_PROGRAMS\)))$$!$$1 > /dev/null 2>&1 || /bin/$$1! + s!(rm -f (rm\b|\$$\(bin_PROGRAMS\)$$))!$$1 > /dev/null 2>&1 || /bin/$$1! -MAINTAINERCLEANFILES = .kludge-stamp THANKS-to-translators -all: all-recursive +BUILT_SOURCES = .version +gen_start_date = 2008-02-08 +DISTCLEANFILES = VERSION +MAINTAINERCLEANFILES = THANKS-to-translators +all: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: am--refresh: @@ -572,15 +1014,15 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - echo ' cd $(srcdir) && $(AUTOMAKE) --gnu '; \ - cd $(srcdir) && $(AUTOMAKE) --gnu \ + echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \ + $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ && exit 0; \ exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu Makefile + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ @@ -596,9 +1038,10 @@ $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENC $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) - cd $(srcdir) && $(AUTOCONF) + $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) + $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) +$(am__aclocal_m4_deps): # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. @@ -624,7 +1067,7 @@ $(RECURSIVE_TARGETS): else \ local_target="$$target"; \ fi; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ @@ -658,16 +1101,16 @@ $(RECURSIVE_CLEAN_TARGETS): else \ local_target="$$target"; \ fi; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) @@ -675,14 +1118,14 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) - tags=; \ + set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ @@ -694,46 +1137,50 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ - tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique + $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(am__remove_distdir) - test -d $(distdir) || mkdir $(distdir) + test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ @@ -749,29 +1196,44 @@ distdir: $(DISTFILES) if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done - list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ - distdir=`$(am__cd) $(distdir) && pwd`; \ - top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ - (cd $$subdir && \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$$top_distdir" \ - distdir="$$distdir/$$subdir" \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ + am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ @@ -779,18 +1241,27 @@ distdir: $(DISTFILES) $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-hook - -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ + -test -n "$(am__skip_mode_fix)" \ + || find "$(distdir)" -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ - || chmod -R a+r $(distdir) + || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) + dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 $(am__remove_distdir) +dist-lzma: distdir + tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma + $(am__remove_distdir) +dist-xz: distdir + tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz + $(am__remove_distdir) + dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) @@ -806,7 +1277,7 @@ dist-zip: distdir dist dist-all: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz - tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 + tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz $(am__remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then @@ -818,6 +1289,10 @@ distcheck: dist GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ + *.tar.lzma*) \ + unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\ + *.tar.xz*) \ + xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ @@ -829,10 +1304,11 @@ distcheck: dist mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) + test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && $(MAKE) $(AM_MAKEFLAGS) distcheck-hook \ - && cd $(distdir)/_build \ + && $(am__cd) $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ @@ -860,7 +1336,7 @@ distcheck: dist list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: - @cd $(distuninstallcheck_dir) \ + @$(am__cd) '$(distuninstallcheck_dir)' \ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ @@ -878,11 +1354,13 @@ distcleancheck: distclean $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am -check: check-recursive +check: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: -install: install-recursive +install: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive @@ -902,10 +1380,13 @@ clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-recursive @@ -922,6 +1403,8 @@ dvi-am: html: html-recursive +html-am: + info: info-recursive info-am: @@ -930,18 +1413,28 @@ install-data-am: install-dvi: install-dvi-recursive +install-dvi-am: + install-exec-am: install-html: install-html-recursive +install-html-am: + install-info: install-info-recursive +install-info-am: + install-man: install-pdf: install-pdf-recursive +install-pdf-am: + install-ps: install-ps-recursive +install-ps-am: + installcheck-am: maintainer-clean: maintainer-clean-recursive @@ -964,47 +1457,71 @@ ps-am: uninstall-am: -.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ - install-strip +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all check \ + ctags-recursive install install-am install-strip \ + tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am am--refresh check check-am clean clean-generic \ ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \ - dist-hook dist-shar dist-tarZ dist-zip distcheck distclean \ - distclean-generic distclean-tags distcleancheck distdir \ - distuninstallcheck dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-ps install-ps-am \ - install-strip installcheck installcheck-am installdirs \ - installdirs-am maintainer-clean maintainer-clean-generic \ - mostlyclean mostlyclean-generic pdf pdf-am ps ps-am tags \ - tags-recursive uninstall uninstall-am - + dist-hook dist-lzma dist-shar dist-tarZ dist-xz dist-zip \ + distcheck distclean distclean-generic distclean-tags \ + distcleancheck distdir distuninstallcheck dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ + pdf-am ps ps-am tags tags-recursive uninstall uninstall-am install-root: cd src && $(MAKE) $@ - -# Some tests always need root privileges, others need them only sometimes. check-root: - cd tests && $(MAKE) $@ + cd tests && $(MAKE) $@ SUBDIRS= +.version: + echo $(VERSION) > $@-t && mv $@-t $@ -dist-hook: - test -x $(srcdir)/build-aux/install-sh - -distcheck-hook: +# Arrange so that .tarball-version appears only in the distribution +# tarball, and never in a checked-out repository. +# The perl substitution is to change some key uses of "rm" to "/bin/rm". +# See the rm_subst comment for details. +dist-hook: gen-ChangeLog + echo $(VERSION) > $(distdir)/.tarball-version + perl -pi -e '$(rm_subst)' $(distdir)/src/Makefile.in +.PHONY: gen-ChangeLog +gen-ChangeLog: + if test -d .git; then \ + $(top_srcdir)/build-aux/gitlog-to-changelog \ + --since=$(gen_start_date) > $(distdir)/cl-t; \ + rm -f $(distdir)/ChangeLog; \ + mv $(distdir)/cl-t $(distdir)/ChangeLog; \ + fi +distcheck-hook: check-ls-dircolors $(MAKE) my-distcheck -.kludge-stamp: $(srcdir)/src/Makefile.in - perl -pi -e '$(rm_subst)' $(srcdir)/src/Makefile.in - touch $@ THANKS-to-translators: po/LINGUAS THANKStt.in ( \ cat $(srcdir)/THANKStt.in; \ - for lang in `cat $(srcdir)/po/LINGUAS`; do \ - echo http://www.iro.umontreal.ca/contrib/po/HTML/team-$$lang.html; \ + for lang in `cat $(srcdir)/po/LINGUAS`; do \ + echo http://translationproject.org/team/$$lang.html; \ done; \ ) > $@-tmp && mv $@-tmp $@ + +# Ensure that the sets of two-letter codes in ls.c and dircolors.c +# remain in sync. +.PHONY: check-ls-dircolors +check-ls-dircolors: + dc=$$(sed -n '/static.*ls_codes\[/,/};'/p \ + $(srcdir)/src/dircolors.c \ + |sed -n '/^ *"/p'|tr , '\n'|sed 's/^ *//' \ + |sed -n 's/^"\(..\)"/\1/p'|sort -u); \ + ls=$$(sed -n '/static.*indicator_name\[/,/};'/\p \ + $(srcdir)/src/ls.c \ + |sed -n '/^ *"/p'|tr , '\n'|sed 's/^ *//' \ + |sed -n 's/^"\(..\)"/\1/p'|sort -u); \ + test "$$dc" = "$$ls" + # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff --git a/src/bin/coreutils/Makefile.maint b/src/bin/coreutils/Makefile.maint deleted file mode 100644 index 1c9d697120..0000000000 --- a/src/bin/coreutils/Makefile.maint +++ /dev/null @@ -1,623 +0,0 @@ -# -*-Makefile-*- -# This Makefile fragment is shared between the coreutils, -# CPPI, Bison, and Autoconf. - -## Copyright (C) 2001-2007 Free Software Foundation, Inc. -## -## This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2, or (at your option) -## any later version. -## -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with this program; if not, write to the Free Software -## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -## 02110-1301, USA. - -# This is reported not to work with make-3.79.1 -# ME := $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)) -ME := Makefile.maint - -# Do not save the original name or timestamp in the .tar.gz file. -# Use --rsyncable if available. -gzip_rsyncable := \ - $(shell gzip --help 2>/dev/null|grep rsyncable >/dev/null && echo --rsyncable) -GZIP_ENV = '--no-name --best $(gzip_rsyncable)' - -CVS = cvs -GIT = git -VC = $(GIT) -VC-tag = git-tag -s -m '$(VERSION)' - -CVS_LIST = build-aux/vc-list-files - -CVS_LIST_EXCEPT = \ - $(CVS_LIST) | if test -f .x-$@; then grep -vEf .x-$@; else grep -v ChangeLog; fi - -ifeq ($(origin prev_version_file), undefined) - prev_version_file = .prev-version -endif - -PREV_VERSION := $(shell cat $(prev_version_file)) -VERSION_REGEXP = $(subst .,\.,$(VERSION)) - -tag-package = $(shell echo "$(PACKAGE)" | tr '[:lower:]' '[:upper:]') -tag-this-version = $(subst .,_,$(VERSION)) -this-vc-tag = $(tag-package)-$(tag-this-version) -my_distdir = $(PACKAGE)-$(VERSION) - -# Old releases are stored here. -# Used for diffs and xdeltas. -release_archive_dir ?= ../release - -# Prevent programs like 'sort' from considering distinct strings to be equal. -# Doing it here saves us from having to set LC_ALL elsewhere in this file. -export LC_ALL = C - - - -## --------------- ## -## Sanity checks. ## -## --------------- ## - -# FIXME: add a check to prohibit definition in src/*.c of symbols defined -# in system.h. E.g. today I removed from tail.c a useless definition of -# ENOSYS. It was useless because system.h ensures it's defined. - -# Collect the names of rules starting with `sc_'. -syntax-check-rules := $(shell sed -n 's/^\(sc_[a-zA-Z0-9_-]*\):.*/\1/p' $(ME)) -.PHONY: $(syntax-check-rules) - -# Checks that don't require cvs. -# Run `changelog-check' last, as previous test may reveal problems requiring -# new ChangeLog entries. -local-checks-available = \ - po-check copyright-check m4-check author_mark_check \ - changelog-check patch-check strftime-check $(syntax-check-rules) \ - makefile_path_separator_check \ - makefile-check check-AUTHORS -.PHONY: $(local-checks-available) - -local-check := $(filter-out $(local-checks-to-skip), $(local-checks-available)) - -syntax-check: $(local-check) -# @grep -nE '# *include <(limits|std(def|arg|bool))\.h>' \ -# $$(find -type f -name '*.[chly]') && \ -# { echo '$(ME): found conditional include' 1>&2; \ -# exit 1; } || : - -# grep -nE '^# *include <(string|stdlib)\.h>' \ -# $(srcdir)/{lib,src}/*.[chy] && \ -# { echo '$(ME): FIXME' 1>&2; \ -# exit 1; } || : -# FIXME: don't allow `#include .strings\.h' anywhere - -sc_cast_of_argument_to_free: - @grep -nE '\&2; \ - exit 1; } || : - -sc_cast_of_x_alloc_return_value: - @grep -nE '\*\) *x(m|c|re)alloc\>' $$($(CVS_LIST_EXCEPT)) && \ - { echo '$(ME): don'\''t cast x*alloc return value' 1>&2; \ - exit 1; } || : - -sc_cast_of_alloca_return_value: - @grep -nE '\*\) *alloca\>' $$($(CVS_LIST_EXCEPT)) && \ - { echo '$(ME): don'\''t cast alloca return value' 1>&2; \ - exit 1; } || : - -sc_space_tab: - @grep -n '[ ] ' $$($(CVS_LIST_EXCEPT)) && \ - { echo '$(ME): found SPACE-TAB sequence; remove the SPACE' \ - 1>&2; exit 1; } || : - -# Don't use *scanf or the old ato* functions in `real' code. -# They provide no error checking mechanism. -# Instead, use strto* functions. -sc_prohibit_atoi_atof: - @grep -nE '\<([fs]?scanf|ato([filq]|ll))\>' $$($(CVS_LIST_EXCEPT)) && \ - { echo '$(ME): do not use *scan''f, ato''f, ato''i, ato''l, ato''ll, or ato''q' \ - 1>&2; exit 1; } || : - -# Using EXIT_SUCCESS as the first argument to error is misleading, -# since when that parameter is 0, error does not exit. Use `0' instead. -sc_error_exit_success: - @grep -nF 'error (EXIT_SUCCESS,' \ - $$(find -type f -name '*.[chly]') && \ - { echo '$(ME): found error (EXIT_SUCCESS' 1>&2; \ - exit 1; } || : - -sc_file_system: - @grep -ni 'file''system' $$($(CVS_LIST_EXCEPT)) && \ - { echo '$(ME): found use of "file''system";' \ - 'rewrite to use "file system"' 1>&2; \ - exit 1; } || : - -sc_no_have_config_h: - @grep -n 'HAVE''_CONFIG_H' $$($(CVS_LIST_EXCEPT)) && \ - { echo '$(ME): found use of HAVE''_CONFIG_H; remove' \ - 1>&2; exit 1; } || : - -# Nearly all .c files must include . -sc_require_config_h: - @if $(CVS_LIST_EXCEPT) | grep '\.c$$' > /dev/null; then \ - grep -L '^# *include ' \ - $$($(CVS_LIST_EXCEPT) | grep '\.c$$') \ - | grep . && \ - { echo '$(ME): the above files do not include ' \ - 1>&2; exit 1; } || :; \ - else :; \ - fi - -# Prohibit the inclusion of assert.h without an actual use of assert. -sc_prohibit_assert_without_use: - @if $(CVS_LIST_EXCEPT) | grep '\.c$$' > /dev/null; then \ - files=$$(grep -l '# *include ' \ - $$($(CVS_LIST_EXCEPT) | grep '\.c$$')) && \ - grep -L '\ but don't use it" \ - 1>&2; exit 1; } || :; \ - else :; \ - fi - -sc_obsolete_symbols: - @grep -nE '\<(HAVE''_FCNTL_H|O''_NDELAY)\>' \ - $$($(CVS_LIST_EXCEPT)) && \ - { echo '$(ME): do not use HAVE''_FCNTL_H or O''_NDELAY' \ - 1>&2; exit 1; } || : - -# FIXME: warn about definitions of EXIT_FAILURE, EXIT_SUCCESS, STREQ - -# Each nonempty line must start with a year number, or a TAB. -sc_changelog: - @grep -n '^[^12 ]' $$(find . -maxdepth 2 -name ChangeLog) && \ - { echo '$(ME): found unexpected prefix in a ChangeLog' 1>&2; \ - exit 1; } || : - -# Ensure that dd's definition of LONGEST_SYMBOL stays in sync -# with the strings from the two affected variables. -dd_c = $(srcdir)/src/dd.c -sc_dd_max_sym_length: -ifneq ($(wildcard $(dd_c)),) - @len=$$( (sed -n '/conversions\[\] =$$/,/^};/p' $(dd_c);\ - sed -n '/flags\[\] =$$/,/^};/p' $(dd_c) ) \ - |sed -n '/"/s/^[^"]*"\([^"]*\)".*/\1/p' \ - | wc --max-line-length); \ - max=$$(sed -n '/^#define LONGEST_SYMBOL /s///p' $(dd_c) \ - |tr -d '"' | wc --max-line-length); \ - if test "$$len" = "$$max"; then :; else \ - echo 'dd.c: LONGEST_SYMBOL is not longest' 1>&2; \ - exit 1; \ - fi -endif - -# Many m4 macros names once began with `jm_'. -# On 2004-04-13, they were all changed to start with gl_ instead. -# Make sure that none are inadvertently reintroduced. -sc_prohibit_jm_in_m4: - @grep -nE 'jm_[A-Z]' \ - $$($(CVS_LIST) m4 |grep '\.m4$$'; echo /dev/null) && \ - { echo '$(ME): do not use jm_ in m4 macro names' \ - 1>&2; exit 1; } || : - -sc_root_tests: - @if test -d tests \ - && grep check-root tests/Makefile.am>/dev/null 2>&1; then \ - t1=sc-root.expected; t2=sc-root.actual; \ - grep -nl '^PRIV_CHECK_ARG=require-root' \ - $$($(CVS_LIST) tests) |sed s,tests,., |sort > $$t1; \ - sed -n 's, cd \([^ ]*\) .*MAKE..check TESTS=\(.*\),./\1/\2,p' \ - $(srcdir)/tests/Makefile.am |sort > $$t2; \ - diff -u $$t1 $$t2 || diff=1; \ - rm -f $$t1 $$t2; \ - test "$$diff" \ - && { echo 'tests/Makefile.am: missing check-root action'>&2; \ - exit 1; } || :; \ - fi - -headers_with_interesting_macro_defs = \ - exit.h \ - fcntl_.h \ - fnmatch_.h \ - intprops.h \ - inttypes_.h \ - lchown.h \ - openat.h \ - stat-macros.h \ - stdint_.h - -# Create a list of regular expressions matching the names -# of macros that are guaranteed by parts of gnulib to be defined. -.re-defmac: - @(cd $(srcdir)/lib; \ - for f in $(headers_with_interesting_macro_defs); do \ - test -f $$f && \ - sed -n '/^# *define \([^_ (][^ (]*\)[ (].*/s//\1/p' $$f; \ - done; \ - ) | sort -u \ - | grep -Ev 'ATTRIBUTE_NORETURN|SIZE_MAX' \ - | sed 's/^/^# *define /' \ - > $@-t - @mv $@-t $@ - -# Don't define macros that we already get from gnulib header files. -sc_always_defined_macros: .re-defmac - @if test -f $(srcdir)/src/system.h; then \ - trap 'rc=$$?; rm -f .re-defmac; exit $$rc' 0 1 2 3 15; \ - grep -f .re-defmac $$($(CVS_LIST)) \ - && { echo '$(ME): define the above via some gnulib .h file' \ - 1>&2; exit 1; } || :; \ - fi - -# Create a list of regular expressions matching the names -# of files included from system.h. Exclude a couple. -.re-list: - @sed -n '/^# *include /s///p' $(srcdir)/src/system.h \ - | grep -Ev 'sys/(param|file)\.h' \ - | sed 's/ .*//;;s/^["<]/^# *include [<"]/;s/\.h[">]$$/\\.h[">]/' \ - > $@-t - @mv $@-t $@ - -# Files in src/ should not include directly any of -# the headers already included via system.h. -sc_system_h_headers: .re-list - @if test -f $(srcdir)/src/system.h; then \ - trap 'rc=$$?; rm -f .re-list; exit $$rc' 0 1 2 3 15; \ - grep -nE -f .re-list \ - $$($(CVS_LIST) src | \ - grep -Ev '((copy|system)\.h|parse-gram\.c)$$') \ - && { echo '$(ME): the above are already included via system.h'\ - 1>&2; exit 1; } || :; \ - fi - -sc_sun_os_names: - @grep -nEi \ - 'solaris[^[:alnum:]]*2\.(7|8|9|[1-9][0-9])|sunos[^[:alnum:]][6-9]' \ - $$($(CVS_LIST_EXCEPT)) && \ - { echo '$(ME): found misuse of Sun OS version numbers' 1>&2; \ - exit 1; } || : - -sc_the_the: - @grep -ni '\' $$($(CVS_LIST_EXCEPT)) && \ - { echo '$(ME): found use of "the ''the";' 1>&2; \ - exit 1; } || : - -sc_tight_scope: - $(MAKE) -C src $@ - -sc_trailing_blank: - @grep -n '[ ]$$' $$($(CVS_LIST_EXCEPT)) && \ - { echo '$(ME): found trailing blank(s)' \ - 1>&2; exit 1; } || : - -# Match lines like the following, but where there is only one space -# between the options and the description: -# -D, --all-repeated[=delimit-method] print all duplicate lines\n -longopt_re = --[a-z][0-9A-Za-z-]*(\[?=[0-9A-Za-z-]*\]?)? -sc_two_space_separator_in_usage: - @grep -nE '^ *(-[A-Za-z],)? $(longopt_re) [^ ].*\\$$' \ - $$($(CVS_LIST_EXCEPT)) && \ - { echo "$(ME): help2man requires at least two spaces between"; \ - echo "$(ME): an option and its description"; \ - 1>&2; exit 1; } || : - -# Look for diagnostics that aren't marked for translation. -# This won't find any for which error's format string is on a separate line. -sc_unmarked_diagnostics: - @grep -nE \ - '\&2; \ - exit 1; } || : - -# Avoid useless parentheses like those in this example: -# #if defined (SYMBOL) || defined (SYM2) -sc_useless_cpp_parens: - @grep -n '^# *if .*defined *(' $$($(CVS_LIST_EXCEPT)) && \ - { echo '$(ME): found useless parentheses in cpp directive' \ - 1>&2; exit 1; } || : - -# Ensure that the c99-to-c89 patch applies cleanly. -patch-check: - rm -rf src-c89 $@.1 $@.2 - cp -a src src-c89 - (cd src-c89; patch -p2 -V never --fuzz=0) < src/c99-to-c89.diff \ - > $@.1 2>&1 - if test "$${REGEN_PATCH+set}" = set; then \ - diff -upr src src-c89 > new-diff || : ; fi - grep -v '^patching file ' $@.1 > $@.2 || : - msg=ok; test -s $@.2 && msg='fuzzy patch' || : ; \ - rm -f src-c89/*.o || msg='rm failed'; \ - $(MAKE) -C src-c89 CFLAGS='-Wdeclaration-after-statement -Werror' \ - || msg='compile failure with extra options'; \ - rm -rf src-c89 $@.1 $@.2; \ - test "$$msg" = ok && : || echo "$$msg" 1>&2; \ - test "$$msg" = ok - -# Ensure that date's --help output stays in sync with the info -# documentation for GNU strftime. The only exception is %N, -# which date accepts but GNU strftime does not. -extract_char = sed 's/^[^%][^%]*%\(.\).*/\1/' -strftime-check: - if test -f $(srcdir)/src/date.c; then \ - grep '^ %. ' $(srcdir)/src/date.c | sort \ - | $(extract_char) > $@-src; \ - { echo N; \ - info libc date calendar format | grep '^ `%.'\' \ - | $(extract_char); } | sort > $@-info; \ - diff -u $@-src $@-info || exit 1; \ - rm -f $@-src $@-info; \ - fi - -check-AUTHORS: - $(MAKE) -C src $@ - -# Ensure that we use only the standard $(VAR) notation, -# not @...@ in Makefile.am, now that we can rely on automake -# to emit a definition for each substituted variable. -makefile-check: - grep -nE '@[A-Z_0-9]+@' `find . -name Makefile.am` \ - && { echo 'Makefile.maint: use $$(...), not @...@' 1>&2; exit 1; } || : - -news-date-check: NEWS - today=`date +%Y-%m-%d`; \ - if head NEWS | grep '^\*.* $(VERSION_REGEXP) ('$$today')' \ - >/dev/null; then \ - :; \ - else \ - echo "version or today's date is not in NEWS" 1>&2; \ - exit 1; \ - fi - -changelog-check: - if head ChangeLog | grep 'Version $(VERSION_REGEXP)\.$$' \ - >/dev/null; then \ - :; \ - else \ - echo "$(VERSION) not in ChangeLog" 1>&2; \ - exit 1; \ - fi - -m4-check: - @grep -n 'AC_DEFUN([^[]' m4/*.m4 \ - && { echo 'Makefile.maint: quote the first arg to AC_DEFUN' 1>&2; \ - exit 1; } || : - -# Verify that all source files using _() are listed in po/POTFILES.in. -# FIXME: don't hard-code file names below; use a more general mechanism. -po-check: - if test -f po/POTFILES.in; then \ - grep -E -v '^(#|$$)' po/POTFILES.in \ - | grep -v '^src/false\.c$$' | sort > $@-1; \ - files=; \ - for file in $$($(CVS_LIST_EXCEPT)) lib/*.[ch]; do \ - case $$file in \ - djgpp/* | man/*) continue;; \ - */c99-to-c89.diff) continue;; \ - esac; \ - case $$file in \ - *.[ch]) \ - base=`expr " $$file" : ' \(.*\)\..'`; \ - { test -f $$base.l || test -f $$base.y; } && continue;; \ - esac; \ - files="$$files $$file"; \ - done; \ - grep -E -l '\b(N?_|gettext *)\([^)"]*("|$$)' $$files \ - | sort -u > $@-2; \ - diff -u $@-1 $@-2 || exit 1; \ - rm -f $@-1 $@-2; \ - fi - -# In a definition of #define AUTHORS "... and ..." where the RHS contains -# the English word `and', the string must be marked with `N_ (...)' so that -# gettext recognizes it as a string requiring translation. -author_mark_check: - @grep -n '^# *define AUTHORS "[^"]* and ' src/*.c |grep -v ' N_ (' && \ - { echo 'Makefile.maint: enclose the above strings in N_ (...)' 1>&2; \ - exit 1; } || : - -# Sometimes it is useful to change the PATH environment variable -# in Makefiles. When doing so, it's better not to use the Unix-centric -# path separator of `:', but rather the automake-provided `@PATH_SEPARATOR@'. -# It'd be better to use `find -print0 ...|xargs -0 ...', but less portable, -# and there probably aren't many projects with so many Makefile.am files -# that we'd have to worry about limits on command line length. -msg = 'Makefile.maint: Do not use `:'\'' above; use @PATH_SEPARATOR@ instead' -makefile_path_separator_check: - @grep -n 'PATH=.*:' `find $(srcdir) -name Makefile.am` \ - && { echo $(msg) 1>&2; exit 1; } || : - -# Check that `make alpha' will not fail at the end of the process. -writable-files: - if test -d $(release_archive_dir); then :; else \ - mkdir $(release_archive_dir); \ - fi - for file in $(distdir).tar.gz $(xd-delta) \ - $(release_archive_dir)/$(distdir).tar.gz \ - $(release_archive_dir)/$(xd-delta); do \ - test -e $$file || continue; \ - test -w $$file \ - || { echo ERROR: $$file is not writable; fail=1; }; \ - done; \ - test "$$fail" && exit 1 || : - -v_etc_file = lib/version-etc.c -sample-test = tests/sample-test -# Make sure that the copyright date in $(v_etc_file) is up to date. -copyright-check: - @if test -f $(v_etc_file); then \ - grep 'enum { COPYRIGHT_YEAR = '$$(date +%Y)' };' $(v_etc_file) \ - >/dev/null \ - || { echo 'out of date copyright in $(v_etc_file); update it' 1>&2; \ - exit 1; }; \ - fi - @if test -f $(sample-test); then \ - grep '# Copyright (C) '$$(date +%Y)' Free' $(sample-test) \ - >/dev/null \ - || { echo 'out of date copyright in $(sample-test); update it' 1>&2; \ - exit 1; }; \ - fi - - -# Sanity checks with the repository. -# Abort early if this tag has already been used. -vc-tag-check: - used=no; \ - if $(VC) --help | grep CVS; then \ - $(CVS) -n log -h README|grep -e $(this-vc-tag): >/dev/null \ - && used=yes; \ - else \ - $(GIT) tag -l '^$(this-vc-tag)$$' && used=yes; \ - fi; \ - if test "$$used" = yes; then \ - echo "$(this-vc-tag) has already been used; not tagging" 1>&2; \ - exit 1; \ - fi - -vc-diff-check: - $(VC) diff > vc-diffs || : - if test -s vc-diffs; then \ - cat vc-diffs; \ - echo "Some files are locally modified:" 1>&2; \ - exit 1; \ - else \ - rm vc-diffs; \ - fi - -cvs-check: vc-diff-check vc-tag-check - -maintainer-distcheck: - $(MAKE) distcheck - $(MAKE) my-distcheck - - -# Tag before making distribution. Also, don't make a distribution if -# checks fail. Also, make sure the NEWS file is up-to-date. -# FIXME: use dist-hook/my-dist like distcheck-hook/my-distcheck. -vc-dist: $(local-check) cvs-check maintainer-distcheck - $(VC-tag) $(this-vc-tag) - $(MAKE) dist - -# Use this to make sure we don't run these programs when building -# from a virgin tgz file, below. -null_AM_MAKEFLAGS = \ - ACLOCAL=false \ - AUTOCONF=false \ - AUTOMAKE=false \ - AUTOHEADER=false \ - MAKEINFO=false - -warn_cflags = -Dlint -O -Werror -Wall -Wformat -Wshadow -Wpointer-arith - -# Use -Wformat -Werror to detect format-string/arg-list mismatches. -# Also, check for shadowing problems with -Wshadow, and for pointer -# arithmetic problems with -Wpointer-arith. -# These CFLAGS are pretty strict. If you build this target, you probably -# have to have a recent version of gcc and glibc headers. -TMPDIR ?= /tmp -t=$(TMPDIR)/$(PACKAGE)/test -my-distcheck: $(local-check) $(release_archive_dir)/$(prev-tgz) - -rm -rf $(t) - mkdir -p $(t) - GZIP=$(GZIP_ENV) $(AMTAR) -C $(t) -zxf $(distdir).tar.gz - cd $(t)/$(distdir) \ - && ./configure --disable-nls \ - && $(MAKE) CFLAGS='$(warn_cflags)' \ - AM_MAKEFLAGS='$(null_AM_MAKEFLAGS)' \ - && $(MAKE) dvi \ - && $(MAKE) check \ - && $(MAKE) distclean - (cd $(t) && mv $(distdir) $(distdir).old \ - && $(AMTAR) -zxf - ) < $(distdir).tar.gz - diff -ur $(t)/$(distdir).old $(t)/$(distdir) - if test -f $(srcdir)/src/c99-to-c89.diff; then \ - cd $(t)/$(distdir) \ - && (cd src && patch -V never --fuzz=0 $$md5_tmp; \ - md5sum -c $$md5_tmp < $$tarz - -prev-tgz = $(PACKAGE)-$(PREV_VERSION).tar.gz -xd-delta = $(PACKAGE)-$(PREV_VERSION)-$(VERSION).xdelta - -rel-files = $(xd-delta) $(DIST_ARCHIVES) - -# Approximate the date of last gnulib "update" by the ChangeLog file's -# mtime, and provide that date in the announcement. -announcement: NEWS ChangeLog $(rel-files) - @cl_date=$$(stat --printf @%Y $(gnulib_dir)/ChangeLog); \ - utc_date=$$(date -u --date $$cl_date '+%Y-%m-%d %T %z'); \ - ./build-aux/announce-gen \ - --release-type=$(RELEASE_TYPE) \ - --package=$(PACKAGE) \ - --prev=$(PREV_VERSION) \ - --curr=$(VERSION) \ - --gpg-key-id=$(gpg_key_ID) \ - --news=NEWS \ - --bootstrap-tools=autoconf,automake,bison,gnulib \ - --gnulib-snapshot-time-stamp="$$utc_date" \ - $(addprefix --url-dir=, $(url_dir_list)) - -## ---------------- ## -## Updating files. ## -## ---------------- ## - -ftp-gnu = ftp://ftp.gnu.org/gnu -www-gnu = http://www.gnu.org - -# Use mv, if you don't have/want move-if-change. -move_if_change ?= move-if-change - -emit_upload_commands: - @echo ===================================== - @echo ===================================== - @echo "$(srcdir)/build-aux/gnupload $(GNUPLOADFLAGS) \\" - @echo " --to $(gnu_rel_host):$(PACKAGE) \\" - @echo " $(rel-files)" - @echo '# send the /tmp/announcement e-mail' - @echo ===================================== - @echo ===================================== - -$(xd-delta): $(release_archive_dir)/$(prev-tgz) $(distdir).tar.gz - xdelta delta -9 $^ $@ || : - -.PHONY: alpha beta major -alpha beta major: news-date-check changelog-check $(local-check) writable-files - test $@ = major \ - && { echo $(VERSION) | grep -E '^[0-9]+(\.[0-9]+)+$$' \ - || { echo "invalid version string: $(VERSION)" 1>&2; exit 1;};}\ - || : - $(MAKE) vc-dist - $(MAKE) $(xd-delta) - $(MAKE) -s announcement RELEASE_TYPE=$@ > /tmp/announce-$(my_distdir) - ln $(rel-files) $(release_archive_dir) - chmod a-w $(rel-files) - $(MAKE) -s emit_upload_commands RELEASE_TYPE=$@ - echo $(VERSION) > $(prev_version_file) - $(VC) commit -m \ - '$(prev_version_file): Record previous version: $(VERSION).' \ - $(prev_version_file) diff --git a/src/bin/coreutils/NEWS b/src/bin/coreutils/NEWS index 16fe151ff9..df87175df0 100644 --- a/src/bin/coreutils/NEWS +++ b/src/bin/coreutils/NEWS @@ -1,5 +1,642 @@ GNU coreutils NEWS -*- outline -*- +* Noteworthy changes in release 7.4 (2009-05-07) [stable] + +** Bug fixes + + date -d 'next mon', when run on a Monday, now prints the date + 7 days in the future rather than the current day. Same for any other + day-of-the-week name, when run on that same day of the week. + [This bug appears to have been present in "the beginning". ] + + date -d tuesday, when run on a Tuesday -- using date built from the 7.3 + release tarball, not from git -- would print the date 7 days in the future. + Now, it works properly and prints the current date. That was due to + human error (including not-committed changes in a release tarball) + and the fact that there is no check to detect when the gnulib/ git + submodule is dirty. + +** Build-related + + make check: two tests have been corrected + +** Portability + + There have been some ACL-related portability fixes for *BSD, + inherited from gnulib. + + +* Noteworthy changes in release 7.3 (2009-05-01) [stable] + +** Bug fixes + + cp now diagnoses failure to preserve selinux/xattr attributes when + --preserve=context,xattr is specified in combination with -a. + Also, cp no longer suppresses attribute-preservation diagnostics + when preserving SELinux context was explicitly requested. + + ls now aligns output correctly in the presence of abbreviated month + names from the locale database that have differing widths. + + ls -v and sort -V now order names like "#.b#" properly + + mv: do not print diagnostics when failing to preserve xattr's on file + systems without xattr support. + + sort -m no longer segfaults when its output file is also an input file. + E.g., with this, touch 1; sort -m -o 1 1, sort would segfault. + [introduced in coreutils-7.2] + +** Changes in behavior + + shred, sort, shuf: now use an internal pseudorandom generator by default. + This is mainly noticable in shred where the 3 random passes it does by + default should proceed at the speed of the disk. Previously /dev/urandom + was used if available, which is relatively slow on GNU/Linux systems. + +** Improved robustness + + cp would exit successfully after copying less than the full contents + of a file larger than ~4000 bytes from a linux-/proc file system to a + destination file system with a fundamental block size of 4KiB or greater. + Reading into a 4KiB-or-larger buffer, cp's "read" syscall would return + a value smaller than 4096, and cp would interpret that as EOF (POSIX + allows this). This optimization, now removed, saved 50% of cp's read + syscalls when copying small files. Affected linux kernels: at least + 2.6.9 through 2.6.29. + [the optimization was introduced in coreutils-6.0] + +** Portability + + df now pre-mounts automountable directories even with automounters for + which stat-like syscalls no longer provoke mounting. Now, df uses open. + + `id -G $USER` now works correctly even on Darwin and NetBSD. Previously it + would either truncate the group list to 10, or go into an infinite loop, + due to their non-standard getgrouplist implementations. + [truncation introduced in coreutils-6.11] + [infinite loop introduced in coreutils-7.1] + + +* Noteworthy changes in release 7.2 (2009-03-31) [stable] + +** New features + + pwd now accepts the options --logical (-L) and --physical (-P). For + compatibility with existing scripts, -P is the default behavior + unless POSIXLY_CORRECT is requested. + +** Bug fixes + + cat once again immediately outputs data it has processed. + Previously it would have been buffered and only output if enough + data was read, or on process exit. + [bug introduced in coreutils-6.0] + + comm's new --check-order option would fail to detect disorder on any pair + of lines where one was a prefix of the other. For example, this would + fail to report the disorder: printf 'Xb\nX\n'>k; comm --check-order k k + [bug introduced in coreutils-7.0] + + cp once again diagnoses the invalid "cp -rl dir dir" right away, + rather than after creating a very deep dir/dir/dir/... hierarchy. + The bug strikes only with both --recursive (-r, -R) and --link (-l). + [bug introduced in coreutils-7.1] + + ls --sort=version (-v) sorted names beginning with "." inconsistently. + Now, names that start with "." are always listed before those that don't. + + pr: fix the bug whereby --indent=N (-o) did not indent header lines + [bug introduced in coreutils-6.9.90] + + sort now handles specified key ends correctly. + Previously -k1,1b would have caused leading space from field 2 to be + included in the sort while -k2,3.0 would have not included field 3. + +** Changes in behavior + + cat,cp,install,mv,split: these programs now read and write a minimum + of 32KiB at a time. This was seen to double throughput when reading + cached files on GNU/Linux-based systems. + + cp -a now tries to preserve extended attributes (xattr), but does not + diagnose xattr-preservation failure. However, cp --preserve=all still does. + + ls --color: hard link highlighting can be now disabled by changing the + LS_COLORS environment variable. To disable it you can add something like + this to your profile: eval `dircolors | sed s/hl=[^:]*:/hl=:/` + + +* Noteworthy changes in release 7.1 (2009-02-21) [stable] + +** New features + + Add extended attribute support available on certain filesystems like ext2 + and XFS. + cp: Tries to copy xattrs when --preserve=xattr or --preserve=all specified + mv: Always tries to copy xattrs + install: Never copies xattrs + + cp and mv accept a new option, --no-clobber (-n): silently refrain + from overwriting any existing destination file + + dd accepts iflag=cio and oflag=cio to open the file in CIO (concurrent I/O) + mode where this feature is available. + + install accepts a new option, --compare (-C): compare each pair of source + and destination files, and if the destination has identical content and + any specified owner, group, permissions, and possibly SELinux context, then + do not modify the destination at all. + + ls --color now highlights hard linked files, too + + stat -f recognizes the Lustre file system type + +** Bug fixes + + chgrp, chmod, chown --silent (--quiet, -f) no longer print some diagnostics + [bug introduced in coreutils-5.1] + + cp uses much less memory in some situations + + cp -a now correctly tries to preserve SELinux context (announced in 6.9.90), + doesn't inform about failure, unlike with --preserve=all + + du --files0-from=FILE no longer reads all of FILE into RAM before + processing the first file name + + seq 9223372036854775807 9223372036854775808 now prints only two numbers + on systems with extended long double support and good library support. + Even with this patch, on some systems, it still produces invalid output, + from 3 to at least 1026 lines long. [bug introduced in coreutils-6.11] + + seq -w now accounts for a decimal point added to the last number + to correctly print all numbers to the same width. + + wc --files0-from=FILE no longer reads all of FILE into RAM, before + processing the first file name, unless the list of names is known + to be small enough. + +** Changes in behavior + + cp and mv: the --reply={yes,no,query} option has been removed. + Using it has elicited a warning for the last three years. + + dd: user specified offsets that are too big are handled better. + Previously, erroneous parameters to skip and seek could result + in redundant reading of the file with no warnings or errors. + + du: -H (initially equivalent to --si) is now equivalent to + --dereference-args, and thus works as POSIX requires + + shred: now does 3 overwrite passes by default rather than 25. + + ls -l now marks SELinux-only files with the less obtrusive '.', + rather than '+'. A file with any other combination of MAC and ACL + is still marked with a '+'. + + +* Noteworthy changes in release 7.0 (2008-10-05) [beta] + +** New programs + + timeout: Run a command with bounded time. + truncate: Set the size of a file to a specified size. + +** New features + + chgrp, chmod, chown, chcon, du, rm: now all display linear performance, + even when operating on million-entry directories on ext3 and ext4 file + systems. Before, they would exhibit O(N^2) performance, due to linear + per-entry seek time cost when operating on entries in readdir order. + Rm was improved directly, while the others inherit the improvement + from the newer version of fts in gnulib. + + comm now verifies that the inputs are in sorted order. This check can + be turned off with the --nocheck-order option. + + comm accepts new option, --output-delimiter=STR, that allows specification + of an output delimiter other than the default single TAB. + + cp and mv: the deprecated --reply=X option is now also undocumented. + + dd accepts iflag=fullblock to make it accumulate full input blocks. + With this new option, after a short read, dd repeatedly calls read, + until it fills the incomplete block, reaches EOF, or encounters an error. + + df accepts a new option --total, which produces a grand total of all + arguments after all arguments have been processed. + + If the GNU MP library is available at configure time, factor and + expr support arbitrarily large numbers. Pollard's rho algorithm is + used to factor large numbers. + + install accepts a new option --strip-program to specify the program used to + strip binaries. + + ls now colorizes files with capabilities if libcap is available + + ls -v now uses filevercmp function as sort predicate (instead of strverscmp) + + md5sum now accepts the new option, --quiet, to suppress the printing of + 'OK' messages. sha1sum, sha224sum, sha384sum, and sha512sum accept it, too. + + sort accepts a new option, --files0-from=F, that specifies a file + containing a null-separated list of files to sort. This list is used + instead of filenames passed on the command-line to avoid problems with + maximum command-line (argv) length. + + sort accepts a new option --batch-size=NMERGE, where NMERGE + represents the maximum number of inputs that will be merged at once. + When processing more than NMERGE inputs, sort uses temporary files. + + sort accepts a new option --version-sort (-V, --sort=version), + specifying that ordering is to be based on filevercmp. + +** Bug fixes + + chcon --verbose now prints a newline after each message + + od no longer suffers from platform bugs in printf(3). This is + probably most noticeable when using 'od -tfL' to print long doubles. + + seq -0.1 0.1 2 now prints 2,0 when locale's decimal point is ",". + Before, it would mistakenly omit the final number in that example. + + shuf honors the --zero-terminated (-z) option, even with --input-range=LO-HI + + shuf --head-count is now correctly documented. The documentation + previously claimed it was called --head-lines. + +** Improvements + + Improved support for access control lists (ACLs): On MacOS X, Solaris 7..10, + HP-UX 11, Tru64, AIX, IRIX 6.5, and Cygwin, "ls -l" now displays the presence + of an ACL on a file via a '+' sign after the mode, and "cp -p" copies ACLs. + + join has significantly better performance due to better memory management + + ls now uses constant memory when not sorting and using one_per_line format, + no matter how many files are in a given directory + + od now aligns fields across lines when printing multiple -t + specifiers, and no longer prints fields that resulted entirely from + padding the input out to the least common multiple width. + +** Changes in behavior + + stat's --context (-Z) option has always been a no-op. + Now it evokes a warning that it is obsolete and will be removed. + + +* Noteworthy changes in release 6.12 (2008-05-31) [stable] + +** Bug fixes + + chcon, runcon: --help output now includes the bug-reporting address + + cp -p copies permissions more portably. For example, on MacOS X 10.5, + "cp -p some-fifo some-file" no longer fails while trying to copy the + permissions from the some-fifo argument. + + id with no options now prints the SELinux context only when invoked + with no USERNAME argument. + + id and groups once again print the AFS-specific nameless group-ID (PAG). + Printing of such large-numbered, kernel-only (not in /etc/group) group-IDs + was suppressed in 6.11 due to ignorance that they are useful. + + uniq: avoid subtle field-skipping malfunction due to isblank misuse. + In some locales on some systems, isblank(240) (aka  ) is nonzero. + On such systems, uniq --skip-fields=N would fail to skip the proper + number of fields for some inputs. + + tac: avoid segfault with --regex (-r) and multiple files, e.g., + "echo > x; tac -r x x". [bug present at least in textutils-1.8b, from 1992] + +** Changes in behavior + + install once again sets SELinux context, when possible + [it was deliberately disabled in 6.9.90] + + +* Noteworthy changes in release 6.11 (2008-04-19) [stable] + +** Bug fixes + + configure --enable-no-install-program=groups now works. + + "cp -fR fifo E" now succeeds with an existing E. Before this fix, using + -fR to copy a fifo or "special" file onto an existing file would fail + with EEXIST. Now, it once again unlinks the destination before trying + to create the destination file. [bug introduced in coreutils-5.90] + + dd once again works with unnecessary options like if=/dev/stdin and + of=/dev/stdout. [bug introduced in fileutils-4.0h] + + id now uses getgrouplist, when possible. This results in + much better performance when there are many users and/or groups. + + ls no longer segfaults on files in /proc when linked with an older version + of libselinux. E.g., ls -l /proc/sys would dereference a NULL pointer. + + md5sum would segfault for invalid BSD-style input, e.g., + echo 'MD5 (' | md5sum -c - Now, md5sum ignores that line. + sha1sum, sha224sum, sha384sum, and sha512sum are affected, too. + [bug introduced in coreutils-5.1.0] + + md5sum -c would accept a NUL-containing checksum string like "abcd\0..." + and would unnecessarily read and compute the checksum of the named file, + and then compare that checksum to the invalid one: guaranteed to fail. + Now, it recognizes that the line is not valid and skips it. + sha1sum, sha224sum, sha384sum, and sha512sum are affected, too. + [bug present in the original version, in coreutils-4.5.1, 1995] + + "mkdir -Z x dir" no longer segfaults when diagnosing invalid context "x" + mkfifo and mknod would fail similarly. Now they're fixed. + + mv would mistakenly unlink a destination file before calling rename, + when the destination had two or more hard links. It no longer does that. + [bug introduced in coreutils-5.3.0] + + "paste -d'\' file" no longer overruns memory (heap since coreutils-5.1.2, + stack before then) [bug present in the original version, in 1992] + + "pr -e" with a mix of backspaces and TABs no longer corrupts the heap + [bug present in the original version, in 1992] + + "ptx -F'\' long-file-name" would overrun a malloc'd buffer and corrupt + the heap. That was triggered by a lone backslash (or odd number of them) + at the end of the option argument to --flag-truncation=STRING (-F), + --word-regexp=REGEXP (-W), or --sentence-regexp=REGEXP (-S). + + "rm -r DIR" would mistakenly declare to be "write protected" -- and + prompt about -- full DIR-relative names longer than MIN (PATH_MAX, 8192). + + "rmdir --ignore-fail-on-non-empty" detects and ignores the failure + in more cases when a directory is empty. + + "seq -f % 1" would issue the erroneous diagnostic "seq: memory exhausted" + rather than reporting the invalid string format. + [bug introduced in coreutils-6.0] + +** New features + + join now verifies that the inputs are in sorted order. This check can + be turned off with the --nocheck-order option. + + sort accepts the new option --sort=WORD, where WORD can be one of + general-numeric, month, numeric or random. These are equivalent to the + options --general-numeric-sort/-g, --month-sort/-M, --numeric-sort/-n + and --random-sort/-R, resp. + +** Improvements + + id and groups work around an AFS-related bug whereby those programs + would print an invalid group number, when given no user-name argument. + + ls --color no longer outputs unnecessary escape sequences + + seq gives better diagnostics for invalid formats. + +** Portability + + rm now works properly even on systems like BeOS and Haiku, + which have negative errno values. + +** Consistency + + install, mkdir, rmdir and split now write --verbose output to stdout, + not to stderr. + + +* Noteworthy changes in release 6.10 (2008-01-22) [stable] + +** Bug fixes + + Fix a non-portable use of sed in configure.ac. + [bug introduced in coreutils-6.9.92] + + +* Noteworthy changes in release 6.9.92 (2008-01-12) [beta] + +** Bug fixes + + cp --parents no longer uses uninitialized memory when restoring the + permissions of a just-created destination directory. + [bug introduced in coreutils-6.9.90] + + tr's case conversion would fail in a locale with differing numbers + of lower case and upper case characters. E.g., this would fail: + env LC_CTYPE=en_US.ISO-8859-1 tr '[:upper:]' '[:lower:]' + [bug introduced in coreutils-6.9.90] + +** Improvements + + "touch -d now writable-but-owned-by-someone-else" now succeeds + whenever that same command would succeed without "-d now". + Before, it would work fine with no -d option, yet it would + fail with the ostensibly-equivalent "-d now". + + +* Noteworthy changes in release 6.9.91 (2007-12-15) [beta] + +** Bug fixes + + "ls -l" would not output "+" on SELinux hosts unless -Z was also given. + + "rm" would fail to unlink a non-directory when run in an environment + in which the user running rm is capable of unlinking a directory. + [bug introduced in coreutils-6.9] + + +* Noteworthy changes in release 6.9.90 (2007-12-01) [beta] + +** New programs + + arch: equivalent to uname -m, not installed by default + But don't install this program on Solaris systems. + + chcon: change the SELinux security context of a file + + mktemp: create a temporary file or directory (or names) + + runcon: run a program in a different SELinux security context + +** Programs no longer installed by default + + hostname, su + +** Changes in behavior + + cp, by default, refuses to copy through a dangling destination symlink + Set POSIXLY_CORRECT if you require the old, risk-prone behavior. + + pr -F no longer suppresses the footer or the first two blank lines in + the header. This is for compatibility with BSD and POSIX. + + tr now warns about an unescaped backslash at end of string. + The tr from coreutils-5.2.1 and earlier would fail for such usage, + and Solaris' tr ignores that final byte. + +** New features + + Add SELinux support, based on the patch from Fedora: + * cp accepts new --preserve=context option. + * "cp -a" works with SELinux: + Now, cp -a attempts to preserve context, but failure to do so does + not change cp's exit status. However "cp --preserve=context" is + similar, but failure *does* cause cp to exit with nonzero status. + * install accepts new "-Z, --context=C" option. + * id accepts new "-Z" option. + * stat honors the new %C format directive: SELinux security context string + * ls accepts a slightly modified -Z option. + * ls: contrary to Fedora version, does not accept --lcontext and --scontext + + The following commands and options now support the standard size + suffixes kB, M, MB, G, GB, and so on for T, P, Y, Z, and Y: + head -c, head -n, od -j, od -N, od -S, split -b, split -C, + tail -c, tail -n. + + cp -p tries to preserve the GID of a file even if preserving the UID + is not possible. + + uniq accepts a new option: --zero-terminated (-z). As with the sort + option of the same name, this makes uniq consume and produce + NUL-terminated lines rather than newline-terminated lines. + + wc no longer warns about character decoding errors in multibyte locales. + This means for example that "wc /bin/sh" now produces normal output + (though the word count will have no real meaning) rather than many + error messages. + +** New build options + + By default, "make install" no longer attempts to install (or even build) su. + To change that, use ./configure --enable-install-program=su. + If you also want to install the new "arch" program, do this: + ./configure --enable-install-program=arch,su. + + You can inhibit the compilation and installation of selected programs + at configure time. For example, to avoid installing "hostname" and + "uptime", use ./configure --enable-no-install-program=hostname,uptime + Note: currently, "make check" passes, even when arch and su are not + built (that's the new default). However, if you inhibit the building + and installation of other programs, don't be surprised if some parts + of "make check" fail. + +** Remove deprecated options + + df no longer accepts the --kilobytes option. + du no longer accepts the --kilobytes or --megabytes options. + ls no longer accepts the --kilobytes option. + ptx longer accepts the --copyright option. + who no longer accepts -i or --idle. + +** Improved robustness + + ln -f can no longer silently clobber a just-created hard link. + In some cases, ln could be seen as being responsible for data loss. + For example, given directories a, b, c, and files a/f and b/f, we + should be able to do this safely: ln -f a/f b/f c && rm -f a/f b/f + However, before this change, ln would succeed, and thus cause the + loss of the contents of a/f. + + stty no longer silently accepts certain invalid hex values + in its 35-colon command-line argument + +** Bug fixes + + chmod no longer ignores a dangling symlink. Now, chmod fails + with a diagnostic saying that it cannot operate on such a file. + [bug introduced in coreutils-5.1.0] + + cp attempts to read a regular file, even if stat says it is empty. + Before, "cp /proc/cpuinfo c" would create an empty file when the kernel + reports stat.st_size == 0, while "cat /proc/cpuinfo > c" would "work", + and create a nonempty one. [bug introduced in coreutils-6.0] + + cp --parents no longer mishandles symlinks to directories in file + name components in the source, e.g., "cp --parents symlink/a/b d" + no longer fails. Also, 'cp' no longer considers a destination + symlink to be the same as the referenced file when copying links + or making backups. For example, if SYM is a symlink to FILE, + "cp -l FILE SYM" now reports an error instead of silently doing + nothing. The behavior of 'cp' is now better documented when the + destination is a symlink. + + "cp -i --update older newer" no longer prompts; same for mv + + "cp -i" now detects read errors on standard input, and no longer consumes + too much seekable input; same for ln, install, mv, and rm. + + cut now diagnoses a range starting with zero (e.g., -f 0-2) as invalid; + before, it would treat it as if it started with 1 (-f 1-2). + + "cut -f 2-0" now fails; before, it was equivalent to "cut -f 2-" + + cut now diagnoses the '-' in "cut -f -" as an invalid range, rather + than interpreting it as the unlimited range, "1-". + + date -d now accepts strings of the form e.g., 'YYYYMMDD +N days', + in addition to the usual 'YYYYMMDD N days'. + + du -s now includes the size of any stat'able-but-inaccessible directory + in the total size. + + du (without -s) prints whatever it knows of the size of an inaccessible + directory. Before, du would print nothing for such a directory. + + ls -x DIR would sometimes output the wrong string in place of the + first entry. [introduced in coreutils-6.8] + + ls --color would mistakenly color a dangling symlink as if it were + a regular symlink. This would happen only when the dangling symlink + was not a command-line argument and in a directory with d_type support. + [introduced in coreutils-6.0] + + ls --color, (with a custom LS_COLORS envvar value including the + ln=target attribute) would mistakenly output the string "target" + before the name of each symlink. [introduced in coreutils-6.0] + + od's --skip (-j) option now works even when the kernel says that a + nonempty regular file has stat.st_size = 0. This happens at least + with files in /proc and linux-2.6.22. + + "od -j L FILE" had a bug: when the number of bytes to skip, L, is exactly + the same as the length of FILE, od would skip *no* bytes. When the number + of bytes to skip is exactly the sum of the lengths of the first N files, + od would skip only the first N-1 files. [introduced in textutils-2.0.9] + + ./printf %.10000000f 1 could get an internal ENOMEM error and generate + no output, yet erroneously exit with status 0. Now it diagnoses the error + and exits with nonzero status. [present in initial implementation] + + seq no longer mishandles obvious cases like "seq 0 0.000001 0.000003", + so workarounds like "seq 0 0.000001 0.0000031" are no longer needed. + + seq would mistakenly reject some valid format strings containing %%, + and would mistakenly accept some invalid ones. e.g., %g%% and %%g, resp. + + "seq .1 .1" would mistakenly generate no output on some systems + + Obsolete sort usage with an invalid ordering-option character, e.g., + "env _POSIX2_VERSION=199209 sort +1x" no longer makes sort free an + invalid pointer [introduced in coreutils-6.5] + + sorting very long lines (relative to the amount of available memory) + no longer provokes unaligned memory access + + split --line-bytes=N (-C N) no longer creates an empty file + [this bug is present at least as far back as textutils-1.22 (Jan, 1997)] + + tr -c no longer aborts when translating with Set2 larger than the + complement of Set1. [present in the original version, in 1992] + + tr no longer rejects an unmatched [:lower:] or [:upper:] in SET1. + [present in the original version] + + * Noteworthy changes in release 6.9 (2007-03-22) [stable] ** Bug fixes @@ -13,7 +650,6 @@ GNU coreutils NEWS -*- outline -*- Using pr -m -s (i.e. merging files, with TAB as the output separator) no longer inserts extraneous spaces between output columns. - * Noteworthy changes in release 6.8 (2007-02-24) [not-unstable] ** Bug fixes @@ -51,11 +687,33 @@ GNU coreutils NEWS -*- outline -*- pwd and "readlink -e ." no longer fail unnecessarily when a parent directory is unreadable. + rm (without -f) could prompt when it shouldn't, or fail to prompt + when it should, when operating on a full name longer than 511 bytes + and getting an ENOMEM error while trying to form the long name. + + rm could mistakenly traverse into the wrong directory under unusual + conditions: when a full name longer than 511 bytes specifies a search-only + directory, and when forming that name fails with ENOMEM, rm would attempt + to open a truncated-to-511-byte name with the first five bytes replaced + with "[...]". If such a directory were to actually exist, rm would attempt + to remove it. + "rm -rf /etc/passwd" (run by non-root) now prints a diagnostic. Before it would print nothing. "rm --interactive=never F" no longer prompts for an unwritable F + "rm -rf D" would emit an misleading diagnostic when failing to + remove a symbolic link within the unwritable directory, D. + Introduced in coreutils-6.0. Similarly, when a cross-partition + "mv" fails because the source directory is unwritable, it now gives + a reasonable diagnostic. Before, this would print + $ mkdir /tmp/x; touch /tmp/x/y; chmod -w /tmp/x; + $ test $(stat -c %d /tmp/x) -ne $(stat -c %d .) && mv /tmp/x/y . + mv: cannot remove `/tmp/x/y': Not a directory + Now it prints this: + mv: cannot remove `/tmp/x/y': Permission denied. + ** New features sort's new --compress-program=PROG option specifies a compression @@ -87,7 +745,7 @@ GNU coreutils NEWS -*- outline -*- Fix similar problems with cp options like -p that imply --preserve=ownership, with install -d when combined with either -o or -g, and with mv when copying across file system boundaries. - This bug affects coreutils 6.0 through 6.6. + This bug affects all versions of coreutils through 6.6. du --one-file-system (-x) would skip subdirectories of any directory listed as second or subsequent command line argument. This bug affects @@ -1842,8 +2500,7 @@ packages, see ./old/*/NEWS. ======================================================================== -Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006 Free Software -Foundation, Inc. +Copyright (C) 2001-2009 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or diff --git a/src/bin/coreutils/README b/src/bin/coreutils/README index 236b2d51ab..08e0babaf7 100644 --- a/src/bin/coreutils/README +++ b/src/bin/coreutils/README @@ -7,18 +7,21 @@ arbitrary limits. The programs that can be built with this package are: - [ base64 basename cat chgrp chmod chown chroot cksum comm cp csplit cut date - dd df dir dircolors dirname du echo env expand expr factor false fmt fold - ginstall groups head hostid hostname id join kill link ln logname ls - md5sum mkdir mkfifo mknod mv nice nl nohup od paste pathchk pinky pr - printenv printf ptx pwd readlink rm rmdir seq sha1sum sha224sum sha256sum - sha384sum sha512sum shred shuf sleep sort split stat stty su sum sync tac - tail tee test touch tr true tsort tty uname unexpand uniq unlink uptime - users vdir wc who whoami yes + [ arch base64 basename cat chcon chgrp chmod chown chroot cksum comm cp + csplit cut date dd df dir dircolors dirname du echo env expand expr + factor false fmt fold groups head hostid hostname id install join kill + link ln logname ls md5sum mkdir mkfifo mknod mktemp mv nice nl nohup + od paste pathchk pinky pr printenv printf ptx pwd readlink rm rmdir + runcon seq sha1sum sha224sum sha256sum sha384sum sha512sum shred shuf + sleep sort split stat stty su sum sync tac tail tee test timeout touch tr + true truncate tsort tty uname unexpand uniq unlink uptime users vdir wc who + whoami yes See the file NEWS for a list of major changes in the current release. -See the file INSTALL for compilation and installation instructions. +If you obtained this file as part of a "git clone", then see the +README-hacking file. If this file came to you as part of a tar archive, +then see the file INSTALL for compilation and installation instructions. These programs are intended to conform to POSIX (with BSD and other extensions), like the rest of the GNU system. By default they conform @@ -38,7 +41,7 @@ Special thanks to Paul Eggert, Brian Matthews, Bruce Evans, Karl Berry, Kaveh Ghazi, and François Pinard for help with debugging and porting these programs. Many thanks to all of the people who have taken the time to submit problem reports and fixes. All contributed changes are -attributed in the ChangeLog files. +attributed in the commit logs. And thanks to the following people who have provided accounts for portability testing on many different types of systems: Bob Proulx, @@ -55,9 +58,28 @@ and from the corresponding --help usage message. Patches to the template files (man/*.x) are welcome. However, the authoritative documentation is in texinfo form in the doc directory. -If you run the tests on a SunOS4.1.4 system, expect the ctime-part of -the ls `time-1' test to fail. I believe that is due to a bug in the -way Sun implemented link(2) and chmod(2). + +***************************************** +On Mac OS X 10.5.1 (Darwin 9.1), test failure +----------------------------------------- + +Mac OS X 10.5.1 (Darwin 9.1) provides only partial (and incompatible) +ACL support, so although "./configure && make" succeeds, "make check" +exposes numerous failures. The solution is to turn off ACL support +manually via "./configure --disable-acl". For details, see +. + + +***************************************** +Test failure with NLS and gettext <= 0.17 +----------------------------------------- + +Due to a conflict between libintl.h and gnulib's new xprintf module, +when you configure with NLS support, and with a gettext installation +older than 0.17.1 (not yet released, at the time of this writing), +then some tests fail, at least on NetBSD 1.6. To work around it in +the mean time, you can configure with --disable-nls. For details, +see . *********************** @@ -70,11 +92,15 @@ compiler, due to the use of declarations after non-declaration statements in several files in src/. There is code in configure to find and, if possible, enable an appropriate compiler. However, if configure doesn't find a C99 compiler, it continues nonetheless, and your build will fail. -If that happens, simply apply the included patch using the following +If that happens, simply[*] apply the included patch using the following command, and then run make again: cd src && patch < c99-to-c89.diff +[*] however, as of coreutils-7.1, the "c99-to-c89.diff" file is no longer +maintained, so even if the patches still apply, the result will be an +incomplete conversion. It's been 10 years. Get a decent compiler! ;-) + *********************** HPUX 11.x build failure @@ -124,7 +150,7 @@ I find that it is best to unpack and build as a non-privileged user, and then to run the following command as that user in order to run the privilege-requiring tests: - sudo env NON_ROOT_USERNAME=$USER make -k check + sudo env PATH="$PATH" NON_ROOT_USERNAME=$USER make -k check-root If you can run the tests as root, please do so and report any problems. We get much less test coverage in that mode, and it's @@ -139,17 +165,17 @@ Reporting bugs: IMPORTANT: if you take the time to report a test failure, please be sure to include the output of running `make check' in verbose mode for each failing test. For example, -if the test that fails is tests/mv/hard-link-1, then you -would run this command: +if the test that fails is tests/misc/df, then you would +run this command: - env VERBOSE=yes make check -C tests/mv TESTS=hard-link-1 >> log 2>&1 + (cd tests && make check TESTS=misc/df VERBOSE=yes) >> log 2>&1 -For some tests, you can get even more detail by including -DEBUG=yes in the environment: +For some tests, you can get even more detail by adding DEBUG=yes. +Then include the contents of the file `log' in your bug report. - env DEBUG=yes VERBOSE=yes make check -C tests/mv TESTS=hard-link-1 >> log 2>&1 - -and then include the contents of the file `log' in your bug report. +Send bug reports, questions, comments, etc. to bug-coreutils@gnu.org. +If you would like to suggest a patch, see the files README-hacking +and HACKING for tips. *************************************** @@ -163,14 +189,13 @@ If you sent a complete patch and, after a couple weeks you haven't received any acknowledgement, please ping us. A complete patch includes a well-written ChangeLog entry, unified (diff -u format) diffs relative to the most recent test release (or, better, relative to the latest -sources in the CVS repository), an explanation for why the patch is +sources in the public repository), an explanation for why the patch is necessary or useful, and if at all possible, enough information to reproduce whatever problem prompted it. Plus, you'll earn lots of karma if you include a test case to exercise any bug(s) you fix. -Instructions for checking out the latest source via CVS are here: - - http://savannah.gnu.org/cvs/?group=coreutils +Here are instructions for checking out the latest development sources: + http://savannah.gnu.org/git/?group=coreutils If your patch adds a new feature, please try to get some sort of consensus that it is a worthwhile change. One way to do that is to send mail to @@ -188,13 +213,7 @@ subtle bugs. WARNING: If you modify files like configure.in, m4/*.m4, aclocal.m4, or any Makefile.am, then don't be surprised if what gets regenerated no longer works. To make things work, you'll have to be using appropriate -versions of automake and autoconf. As for what versions are `appropriate', -use the versions of - - * autoconf specified via AC_PREREQ in m4/jm-macros.m4 - * automake specified via AM_INIT_AUTOMAKE in configure.ac - -Usually it's fine to use versions that are newer than those specified. +versions of the tools listed in bootstrap.conf's buildreq string. All of these programs except `test' recognize the `--version' option. When reporting bugs, please include in the subject line both the package @@ -210,8 +229,7 @@ the address on the last line of --help output. ======================================================================== -Copyright (C) 1998, 2002, 2003, 2004, 2005, 2006 Free Software -Foundation, Inc. +Copyright (C) 1998, 2002-2009 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or diff --git a/src/bin/coreutils/THANKS b/src/bin/coreutils/THANKS index ad05b13503..cf801c57ac 100644 --- a/src/bin/coreutils/THANKS +++ b/src/bin/coreutils/THANKS @@ -10,8 +10,10 @@ the bug-report mailing list (as seen on last line of e.g., cp --help). A Costa agcosta@gis.net Aaron Hawley ashawley@uvm.edu Achim Blumensath blume@corona.oche.de +Adam Jimerson vendion@charter.net Adam Klein aklein@debian.org Adrian Bunk bunk@stusta.de +AIDA Shinra shinra@j10n.org Akim Demaille demaille@inf.enst.fr Alain Magloire alain@qnx.com Alan Iwi iwi@atm.ox.ac.uk @@ -20,20 +22,26 @@ Albert Hopkins ahopkins@dynacare.com Alberto Accomazzi alberto@cfa0.harvard.edu aldomel aldomel@ix.netcom.com Alen Muzinic zveki@fly.cc.fer.hr +Alexander Nguyen vinh@seas.ucla.edu +Alexander V. Lukyanov lav@netis.ru +Allen Hewes allen@decisiv.net +Axel Dörfler axeld@pinc-software.de Alexandre Duret-Lutz duret_g@epita.fr Alexey Solovyov alekso@math.uu.se Alexey Vyskubov alexey@pippuri.mawhrin.net Alfred M. Szmidt ams@kemisten.nu Andi Kleen freitag@alancoxonachip.com Andre Novaes Cunha Andre.Cunha@br.global-one.net +Andreas Frische andreasfrische@gmail.com Andreas Gruenbacher ag@bestbits.at Andreas Jaeger jaeger@gnu.org Andreas Luik luik@isa.de -Andreas Schwab schwab@suse.de +Andreas Schwab schwab@linux-m68k.org Andreas Stolcke stolcke@ICSI.Berkeley.EDU Andrei Gaponenko andr@triumf.ca Andres Soolo andres@soolo.matti.ee Andrew Burgess aab@cichlid.com +Andrew Church achurch@achurch.org Andrew Dalke dalke@bioreason.com Andrew Fabbro andrew@fabbro.org Andrew Pham andpha@us.ibm.com @@ -54,6 +62,7 @@ Augey Mikus mikus@dqc.org Aurelien Jarno aurel32@debian.org Austin Donnelly Austin.Donnelly@cl.cam.ac.uk Axel Kittenberger Anshil@gmx.net +Barry Kelly http://barrkel.blogspot.com/ Bauke Jan Douma bjdouma@xs4all.nl Ben Elliston bje@air.net.au Ben Harris bjh21@netbsd.org @@ -67,6 +76,7 @@ Bernhard Baehr bernhard.baehr@gmx.de Bernhard Gabler bernhard@uni-koblenz.de Bernhard Rosenkraenzer bero@redhat.de Bert Deknuydt Bert.Deknuydt@esat.kuleuven.ac.be +Bert Wesarg bert.wesarg@googlemail.com Bill Peters peters@gaffel.as.arizona.edu Bjorn Helgaas helgaas@rsn.hp.com Bob McCracken kerouac@ravenet.com @@ -74,12 +84,16 @@ Bob Proulx rwp@fc.hp.com Branden Robinson branden@necrotic.deadbeast.net Brendan O'Dea bod@compusol.com.au Brian Kimball bfk@footbag.org +Brian M. Carlson sandals@crustytoothpaste.ath.cx +Brian Silverman bsilverman@conceptxdesign.com Brian Youmans 3diff@gnu.org Bruce Korb bkorb@veritas.com Bruce Robertson brucer@theodolite.dyndns.org Bruno Haible haible@clisp.cons.org +C de-Avillez hggdh2@gmail.com Carl Johnson carlj@cjlinux.home.org Carl Lowenstein cdl@mpl.UCSD.EDU +Carl Roth roth@urs.us Carlos Canau Carlos.Canau@relay.puug.pt Charles Karney karney@pppl.gov Charles Randall crandall@matchlogic.com @@ -102,17 +116,23 @@ Colin Plumb colin@nyx.net Colin Watson cjw44@riva.ucam.org Collin Rogowski collin@rogowski.de Cray-Cyber Project http://www.cray-cyber.org +Cristian Cadar cristic@stanford.edu Cyril Bouthors cyril@bouthors.org Dale Scheetz dwarf@polaris.net +Dameon G. Rogers dgr03@uark.edu Dan Hagerty hag@gnu.ai.it.edu -Dan Jacobson http://www.geocities.com/jidani +Dan Jacobson jidanni@jidanni.org Dan Pascu dan@services.iiruc.ro Daniel Bergstrom noa@melody.se +Daniel Dunbar ddunbar@stanford.edu +Daniel P. Berrangé berrange@redhat.com Dániel Varga danielv@axelero.hu Danny Levinson danny.levinson@overture.com +Darrel Francis d.francis@cheerful.com Darren Salt ds@youmustbejoking.demon.co.uk Dave Beckett dajobe@dajobe.org David Alan Gilbert gilbertd@treblig.org +David Bartley dtbartle@csclub.uwaterloo.ca David Dyck dcd@tc.fluke.COM David Eisner cradle@umd.edu David Flynn dav@chess.plus.com @@ -120,8 +140,11 @@ David Godfrey dave@delta.demon.co.uk David Luyer david_luyer@pacific.net.au David Madore david.madore@ens.fr David Malone dwmalone@cnri.dit.ie +Davide Canova kc.canova@gmail.com +Dawson Engler engler@stanford.edu Dean Gaudet dean-savannah@arctic.org Deepak Goel deego@gnufans.org +Denis Excoffier denis.excoffier@airbus.com Dennis Henriksen opus@flamingo.osrl.dk Dennis Smit ds@nerds-incorporated.org Derek Clegg dclegg@next.com @@ -139,10 +162,14 @@ Duncan Roe duncanr@optimation.com.au Ed Avis ed@membled.com Edward Welbourne eddy@opera.com Edzer Pebesma Edzer.Pebesma@rivm.nl +Egmont Koblinger egmont@uhulinux.hu Eirik Fuller eirik@hackrat.com Eivind eivindt@multinet.no +Elbert Pol elbert.pol@gmail.com Eli Zaretskii eliz@is.elta.co.il +Elias Pipping pipping@gentoo.org Emile LeBlanc leblanc@math.toronto.edu +Erik Auerswald auerswal@unix-ag.uni-kl.de Eric Backus ericb@lsid.hp.com Eric Blake ebb9@byu.net Eric G. Miller egm2@jps.net @@ -168,24 +195,29 @@ Gabor Z. Papp gzp@gzp.org.hu Gaël Quéri gqueri@mail.dotcom.fr Galen Hazelwood galenh@micron.net Gary Anderson ganderson@clark.net +Gary Johnson garyjohn@spk.agilent.com Gary V. Vaughan gary@gnu.org Gaute Hvoslef Kvalnes gaute@verdsveven.com Geoff Collyer geoff at collyer.net Geoff Kuenning geoff@cs.hmc.edu Geoff Odhner geoff@franklin.com Geoff Whale geoffw@cse.unsw.EDU.AU +Gerald Pfeifer gerald@pfeifer.com Gerhard Poul gpoul@gnu.org Germano Leichsenring germano@jedi.cs.kobe-u.ac.jp -Göran Uddeborg goeran@uddeborg.pp.se +Glen Lenker glen.lenker@gmail.com +Göran Uddeborg goeran@uddeborg.se Guochun Shi gshi@ncsa.uiuc.edu GOTO Masanori gotom@debian.or.jp Greg Louis glouis@dynamicro.on.ca Greg McGary gkm@gnu.org +Greg Metcalfe metcalfegreg@qwest.net Greg Schafer gschafer@zip.com.au Greg Troxel gdt@bbn.com Greg Wooledge gawooledge@sherwin.com Gregory Leblanc gleblanc@cu-portland.edu Guido Leenders guido.leenders@invantive.com +Guntram Blohm Extern.Guntram.Blohm@AUDI.DE H. J. Lu hjl@valinux.com Hans Ginzel hans@matfyz.cz Hans Lermen lermen@fgan.de @@ -194,6 +226,7 @@ Harald Dunkel harald.dunkel@t-online.de Harry Liu rliu@lek.ugcs.caltech.edu Harti Brandt brandt@fokus.fraunhofer.de Harvey Eneman Harvey.Eneman@oracle.com +Heiko Marr h.marr@webmasters.de Helen Faulkner helen_ml_faulkner@yahoo.co.uk Herbert Xu herbert@gondor.apana.org.au Holger Berger hberger@ess.nec.de @@ -202,29 +235,37 @@ Hugh Daniel hugh@xanadu.com Ian Bruce ian.bruce@myrealbox.com Iain Calder ic56@rogers.com Ian Jackson ijackson@chiark.greenend.org.uk +Ian Kent ikent@redhat.com Ian Lance Taylor ian@cygnus.com Ian Turner vectro@pipeline.com Iida Yosiaki iida@gnu.org +Ilya N. Golubev gin@mo.msk.ru Ingo Saitz ingo@debian.org Ivo Timmermans ivo@debian.org James james@albion.glarp.com James Antill jmanti%essex.ac.uk@seralph21.essex.ac.uk James Lemley James.Lemley@acxiom.com James Hunt jamesodhunt@hotmail.com +James Ralston ralston@pobox.com James Sneeringer jvs@ocslink.com James Tanis jtt@soscorp.com -James Youngman james+usenet@free-lunch.demon.co.uk +James Youngman jay@gnu.org Jamie Lokier jamie@imbolc.ucc.ie Jamie McClelland jm@mayfirst.org +Jan Engelhardt jengelh@medozas.de Jan Fedak J.Fedak@sh.cvut.cz +Jan Moringen jan.moringen@uni-bielefeld.de Jan Nieuwenhuizen janneke@gnu.org Janos Farkas chexum@shadow.banki.hu Jarkko Hietaniemi jhi@epsilon.hut.fi +Jarod Wilson jwilson@redhat.com Jean Charles Delepine delepine@u-picardie.fr Jeff Moore jbm@mordor.com Jeff Sheinberg jeff@bsrd.net Jens Elkner elkner@imsgroup.de Jens Schmidt jms@jsds.hamburg.com +Jeph Cowan jeph@ucar.edu +Jeremy Maitin-Shepard jbms@cmu.edu Jerome Abela abela@hsc.fr Jérôme Zago bug-coreutils-ml@agt-the-walker.net Jesse Kornblum kornblum@usna.edu @@ -236,6 +277,7 @@ Joakim Rosqvist dvljrt@cs.umu.se Jochen Hein jochen@jochen.org Joe Orton joe@manyfish.co.uk Joerg Sonnenberger joerg@britannica.bec.de +Joey Hess joeyh@debian.org Johan Boule bohan@bohan.dyndns.org Johan Danielsson joda@pdc.kth.se John Bley jbb6@acpub.duke.edu @@ -252,7 +294,9 @@ Jon Peatfield J.S.Peatfield@damtp.cam.ac.uk Joost van Baal joostvb@xs4all.nl Jorge Stolfi stolfi@ic.unicamp.br Joseph S. Myers jsm28@cam.ac.uk +Josh Triplett josh@freedesktop.org Joshua Hudson joshudson@gmail.com +Josselin Mouette joss@debian.org Juan F. Codagnone juam@arnet.com.ar Juan M. Guerrero st001906@hrz1.hrz.tu-darmstadt.de Jungshik Shin jshin@pantheon.yale.edu @@ -274,6 +318,7 @@ Keith Owens kaos@audio.apana.org.au Keith Thompson kst@cts.com Ken Pizzini kenp@halcyon.com Kevin Mudrick kmudrick@healthmarketscience.com +Kirk Kelsey kirk.kelsey@0x4b.net Kristin E Thomas kristint@us.ibm.com Kjetil Torgrim Homme kjetilho@ifi.uio.no Kristoffer Rose kris@diku.dk @@ -323,6 +368,7 @@ Mate Wierdl mw@moni.msci.memphis.edu Matej Vela mvela@public.srce.hr Matt Kraai kraai@ftbfs.org Matt Perry matt@primefactor.com +Matt Pham mattvpham@gmail.com Matt Schalit mschalit@pacbell.net Matt Swift swift@alum.mit.edu Matthew Arnison maffew@cat.org.au @@ -336,6 +382,7 @@ Matthew Woehlke mw_triad@users.sourceforge.net Matthias Urlichs smurf@noris.de Matti Aarnio matti.aarnio@zmailer.org Mattias Wadenstein maswan@acc.umu.se +Max Chang maxchang@ucla.edu Meelis Roos mroos@tartu.cyber.ee Michael michael@aplatform.com Michael ??? michael@roka.net @@ -347,6 +394,7 @@ Michael Hasselberg mikelh@zonta.ping.de Michael Hohn hohn@math.utah.edu Michael J. Croghan mcroghan@usatoday.com Michael McFarland sidlon@yahoo.com +Michael McLagan mmclagan@invlogic.com Michael Piefel piefel@informatik.hu-berlin.de Michael Steffens michael.steffens@s.netic.de Michael Stone mstone@debian.org @@ -358,6 +406,7 @@ Michal Politowski mpol@charybda.icm.edu.pl Michal Svec msvec@suse.cz Michel Robitaille robitail@IRO.UMontreal.CA Michiel Bacchiani bacchian@raven.bu.edu +Mikael Magnusson mikachu@gmail.com Mike Castle dalgoda@ix.netcom.com Mike Coleman mkc@mathdogs.com Mike Jetzer mjetzer@mke.catalystwms.com @@ -371,11 +420,13 @@ Neal H Walfield neal@cs.uml.edu Neil Brown neilb@cse.unsw.edu.au Nelson H. F. Beebe beebe@math.utah.edu Nick Estes debian@nickstoys.com +Nick Graham nick.d.graham@gmail.com Nick Lawes nlawes@silverplatter.com Nickolai Zeldovich nickolai@cs.stanford.edu Nicolas François nicolas.francois@centraliens.net Niklas Edmundsson nikke@acc.umu.se Nikola Milutinovic Nikola.Milutinovic@ev.co.yu +Nima Nikzad nnikzad@ucla.edu Noah Friedman friedman@splode.com Noel Cragg noel@red-bean.com Norbert Kiesel nkiesel@tbdnetworks.com @@ -385,8 +436,12 @@ Ole Laursen olau@hardworking.dk Oliver Kiddle okiddle@yahoo.co.uk Ørn E. Hansen oehansen@daimi.aau.dk Oskar Liljeblad osk@hem.passagen.se +Otavio Salvador otavio@ossystems.com.br +Pádraig Brady P@draigBrady.com Patrick Mauritz oxygene@studentenbude.ath.cx +Paul D. Smith psmith@gnu.org Paul Eggert eggert@twinsun.com +Paul Ghaleb paul.ghaleb@st.com Paul Jarc prj@po.cwru.edu Paul Nevai nevai@ops.mps.ohio-state.edu Paul Sauer paul@alexa.com @@ -396,7 +451,9 @@ Paul Worrall paul@basilisk.uklinux.net Pawel Prokop pablo@wizard.ae.krakow.pl Per Cederqvist ceder@lysator.liu.se Per Kristian Hove perhov@math.ntnu.no +Per Starbäck starback@stp.lingfil.uu.se Peter Breitenlohner peb@mppmu.mpg.de +Peter Dyballa peter_dyballa@web.de Peter Eriksson peter@ifm.liu.se Peter Fales psfales@lucent.com Peter Horst peter@ointment.org @@ -404,15 +461,19 @@ Peter Moulder reiter@netspace.net.au Peter O'Gorman bug-coreutils@mlists.thewrittenword.com Peter Samuelson psamuels@sampo.creighton.edu Peter Seebach seebs@taniemarie.solon.com +Petr Uzel petr.uzel@suse.cz Petter Reinholdtsen pere@hungry.com Phelippe Neveu pneveu@pcigeomatics.com Phil Richards phil.richards@vf.vodafone.co.uk +Philip Rowlands phr@doc.ic.ac.uk Philippe De Muyter phdm@macqel.be Philippe Schnoebelen Philippe.Schnoebelen@imag.fr Phillip Jones mouse@datastacks.com Piergiorgio Sartor sartor@sony.de +Pieter Bowman bowman@math.utah.edu Piotr Kwapulinski kwap@univ.gda.pl Prashant TR tr@eth.net +Priit Jõerüüt jemm4jemm@yahoo.com Rainer Orth ro@TechFak.Uni-Bielefeld.DE Ralf W. Stephan stephan@tmt.de Ralf Wildenhues Ralf.Wildenhues@gmx.de @@ -439,6 +500,8 @@ Ronald F. Guilmette rfg@netcom.com Ross Alexander r.alexander@auckland.ac.nz Ross Paterson rap@doc.ic.ac.uk Ross Ridge rridge@calum.csclub.uwaterloo.ca +Rudolf Kastl rkastl@redhat.com +Sahil Amoli sahilamoli@gmail.com Sami Farin sfarin@ratol.fi Samuel Tardieu sam@rfc1149.net Samuel Thibault samuel.thibault@ens-lyon.org @@ -447,7 +510,8 @@ Sander van Malssen svm@kozmix.ow.nl Santiago Vila Doncel sanvila@unex.es Savochkin Andrey Vladimirovich saw@msu.ru Scott Lurndal slurn@griffin.engr.sgi.com -Sébastien Maret smaret@umich.edu +Sébastien Maret smaret@umich.edu +Sergei Steshenko sergstesh@yahoo.com Shing-Shong Shei shei@cs.indiana.edu Soeren Sonnenburg sonnenburg@informatik.hu-berlin.de Solar Designer solar@owl.openwall.com @@ -460,16 +524,21 @@ Stephen Gildea gildea@stop.mail-abuse.org Stephen Smoogen smooge@mindspring.com Steve McConnel steve@acadcomp.sil.org Steve McIntyre steve@einval.com +Steve Ward planet36@gmail.com Steven G. Johnson stevenj@alum.mit.edu Steven Mocking ufo@quicknet.nl +Steven Parkes smparkes@smparkes.net +Steven Schveighoffer schveiguy@yahoo.com Steven P Watson steven@magelico.net Stuart Kemp skemp@peter.bmc.com -Sven Joachim sven_joachim@web.de +Stuart Shelton stuart@shelton.me +Sven Joachim svenjoac@gmx.de Szakacsits Szabolcs szaka@sienet.hu Tadayoshi Funaba tadf@kt.rim.or.jp TAKAI Kousuke takai@vlsi.kuee.kyoto-u.ac.jp Theodore Ts'o tytso@rsts-11.mit.edu The Wanderer inverseparadox@comcast.net +Theodoros V. Kalamatianos nyb@users.sourceforge.net Thomas Bushnell thomas@gnu.ai.mit.edu Thomas Goerlich thomas@schnappmatik.de Thomas Hood jdthood@yahoo.co.uk @@ -480,8 +549,10 @@ Thomas Schwinge tschwinge@gnu.org Thomas Wolff mined@towo.net Tim J. Robbins tjr@FreeBSD.org Tim Mooney mooney@dogbert.cc.ndsu.NoDak.edu +Tim Ryan Tim_Ryan@bnz.co.nz Tim Smithers mouse@dmouse.com.au Tim Waugh twaugh@redhat +Tobias Stoeckmann tobias@bugol.de Toby Peterson toby@opendarwin.org Todd A. Jacobs tjacobs@codegnome.org Tom Haynes thomas@netapp.com @@ -498,6 +569,7 @@ Torbjorn Granlund tege@nada.kth.se Torbjorn Lindgren tl@funcom.no Torsten Landschoff torsten@pclab.ifg.uni-kiel.de Tristan Miller psychonaut@nothingisreal.com +Tzvi Rotshtein tzvi.ro@gmail.com Ulrich Drepper drepper@gnu.org Ulrich Hermisson ulrich_hermisson@hotmail.com Urs Thuermann urs@isnogud.escape.de @@ -505,7 +577,9 @@ Uwe H. Steinfeld usteinfeld@gmx.net Vesselin Atanasov vesselin@bgnet.bg Vin Shelton acs@alumni.princeton.edu Vineet Chadha chadha@acis.ufl.edu +Vitali Lovich vlovich@gmail.com Vitaly A. Ostanin vyt@altlinux.org +Vito Caputo vcaputo@pengaru.com Vlada Macek tuttle@bbs.fsik.cvut.cz Volker Borchert bt@teknon.de Volker Paul vpaul@dohle.com diff --git a/src/bin/coreutils/THANKS-to-translators b/src/bin/coreutils/THANKS-to-translators index 34ef259450..6fe4cc5599 100644 --- a/src/bin/coreutils/THANKS-to-translators +++ b/src/bin/coreutils/THANKS-to-translators @@ -2,37 +2,39 @@ The following teams have translated the many diagnostics of this package into many different languages. Thank you! --- -http://www.iro.umontreal.ca/contrib/po/HTML/team-af.html -http://www.iro.umontreal.ca/contrib/po/HTML/team-be.html -http://www.iro.umontreal.ca/contrib/po/HTML/team-bg.html -http://www.iro.umontreal.ca/contrib/po/HTML/team-ca.html -http://www.iro.umontreal.ca/contrib/po/HTML/team-cs.html -http://www.iro.umontreal.ca/contrib/po/HTML/team-da.html -http://www.iro.umontreal.ca/contrib/po/HTML/team-de.html -http://www.iro.umontreal.ca/contrib/po/HTML/team-el.html -http://www.iro.umontreal.ca/contrib/po/HTML/team-es.html -http://www.iro.umontreal.ca/contrib/po/HTML/team-et.html -http://www.iro.umontreal.ca/contrib/po/HTML/team-eu.html -http://www.iro.umontreal.ca/contrib/po/HTML/team-fi.html -http://www.iro.umontreal.ca/contrib/po/HTML/team-fr.html -http://www.iro.umontreal.ca/contrib/po/HTML/team-ga.html -http://www.iro.umontreal.ca/contrib/po/HTML/team-gl.html -http://www.iro.umontreal.ca/contrib/po/HTML/team-hu.html -http://www.iro.umontreal.ca/contrib/po/HTML/team-it.html -http://www.iro.umontreal.ca/contrib/po/HTML/team-ja.html -http://www.iro.umontreal.ca/contrib/po/HTML/team-ko.html -http://www.iro.umontreal.ca/contrib/po/HTML/team-ms.html -http://www.iro.umontreal.ca/contrib/po/HTML/team-nb.html -http://www.iro.umontreal.ca/contrib/po/HTML/team-nl.html -http://www.iro.umontreal.ca/contrib/po/HTML/team-no.html -http://www.iro.umontreal.ca/contrib/po/HTML/team-pl.html -http://www.iro.umontreal.ca/contrib/po/HTML/team-pt.html -http://www.iro.umontreal.ca/contrib/po/HTML/team-pt_BR.html -http://www.iro.umontreal.ca/contrib/po/HTML/team-ru.html -http://www.iro.umontreal.ca/contrib/po/HTML/team-rw.html -http://www.iro.umontreal.ca/contrib/po/HTML/team-sk.html -http://www.iro.umontreal.ca/contrib/po/HTML/team-sl.html -http://www.iro.umontreal.ca/contrib/po/HTML/team-sv.html -http://www.iro.umontreal.ca/contrib/po/HTML/team-tr.html -http://www.iro.umontreal.ca/contrib/po/HTML/team-zh_CN.html -http://www.iro.umontreal.ca/contrib/po/HTML/team-zh_TW.html +http://translationproject.org/team/af.html +http://translationproject.org/team/be.html +http://translationproject.org/team/bg.html +http://translationproject.org/team/ca.html +http://translationproject.org/team/cs.html +http://translationproject.org/team/da.html +http://translationproject.org/team/de.html +http://translationproject.org/team/el.html +http://translationproject.org/team/es.html +http://translationproject.org/team/et.html +http://translationproject.org/team/eu.html +http://translationproject.org/team/fi.html +http://translationproject.org/team/fr.html +http://translationproject.org/team/ga.html +http://translationproject.org/team/gl.html +http://translationproject.org/team/hu.html +http://translationproject.org/team/id.html +http://translationproject.org/team/it.html +http://translationproject.org/team/ja.html +http://translationproject.org/team/ko.html +http://translationproject.org/team/lt.html +http://translationproject.org/team/ms.html +http://translationproject.org/team/nb.html +http://translationproject.org/team/nl.html +http://translationproject.org/team/pl.html +http://translationproject.org/team/pt.html +http://translationproject.org/team/pt_BR.html +http://translationproject.org/team/ru.html +http://translationproject.org/team/sk.html +http://translationproject.org/team/sl.html +http://translationproject.org/team/sv.html +http://translationproject.org/team/tr.html +http://translationproject.org/team/uk.html +http://translationproject.org/team/vi.html +http://translationproject.org/team/zh_CN.html +http://translationproject.org/team/zh_TW.html diff --git a/src/bin/coreutils/TODO b/src/bin/coreutils/TODO index 0e626306a1..9128ddf779 100644 --- a/src/bin/coreutils/TODO +++ b/src/bin/coreutils/TODO @@ -1,14 +1,43 @@ -stty.c: - use xstrtoul, not sscanf +If you're interested in helping, here are some tasks that we've considered +over the years. Beware: some are quite old and no longer valid. To avoid +wasting your time by duplicating work or by working on a task that is no +longer pertinent, please search the mailing list and post your intent +before embarking on a big project. + +================================================== +Modify chmod so that it does not change an inode's st_ctime + when the selected operation would have no other effect. + First suggested by Hans Ecke in + http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/2920 + Discussed more recently on . + +document the following in coreutils.texi: + mktemp + [ + pinky + +Suggestion from Paul Eggert: + More generally, there's not that much use for imaxtostr nowadays, + since the inttypes module and newer versions of gettext allow things + like _("truncating %s at %" PRIdMAX " bytes") to work portably. + I suspect that (if someone cares to take the time) we can remove + all instances of imaxtostr and umaxtostr in coreutils and gnulib. + +cp --recursive: use fts and *at functions to perform directory traversals + in source and destination hierarchy rather than forming full file names. + The latter (current) approach fails unnecessarily when the names + become very long, and requires space and time that is quadratic in the + depth of the hierarchy. [Bo Borgerson is working on this] printf: Now that gnulib supports *printf("%a"), import one of the *printf-posix modules so that printf(1) will support %a even on platforms where the native *printf(3) is deficient. - Suggestion form Eric Blake. + Suggestion from Eric Blake. -strip: add an option to specify the program used to strip binaries. - suggestion from Karl Berry +renice: POSIX utility, needs implementing. + suggestion from Karl Berry (among others). + Bob Proulx is working on this. doc/coreutils.texi: Address this comment: FIXME: mv's behavior in this case is system-dependent @@ -24,13 +53,6 @@ And once that's done, add an exclusion so that `cp --link' no longer incurs the overhead of saving src. dev/ino and dest. filename in the hash table. -See if we can be consistent about where --verbose sends its output: - These all send --verbose output to stdout: - head, tail, rm, cp, mv, ln, chmod, chown, chgrp, install, ln - These send it to stderr: - shred mkdir split - readlink is different - Write an autoconf test to work around build failure in HPUX's 64-bit mode. See notes in README -- and remove them once there's a work-around. @@ -44,19 +66,9 @@ Should printf '\0123' print "\n3"? printf: consider adapting builtins/printf.def from bash -df: add `--total' option, suggested here http://bugs.debian.org/186007 - -seq: give better diagnostics for invalid formats: - e.g. no or too many % directives -seq: consider allowing format string to contain no %-directives - -resolve RH report on cp -a forwarded by Tim Waugh - tail: don't use xlseek; it *exits*. Instead, maybe use a macro and return nonzero. -add mktemp? Suggested by Nelson Beebe - tr: support nontrivial equivalence classes, e.g. [=e=] with LC_COLLATE=fr_FR lib/strftime.c: Since %N is the only format that we need but that @@ -64,11 +76,6 @@ lib/strftime.c: Since %N is the only format that we need but that would expand /%(-_)?\d*N/ to the desired string and then pass the resulting string to glibc's strftime. -sort: Compress temporary files when doing large external sort/merges. - This improves performance when you can compress/uncompress faster than - you can read/write, which is common in these days of fast CPUs. - suggestion from Charles Randall on 2001-08-10 - unexpand: [http://www.opengroup.org/onlinepubs/007908799/xcu/unexpand.html] printf 'x\t \t y\n'|unexpand -t 8,9 should print its input, unmodified. printf 'x\t \t y\n'|unexpand -t 5,8 should print "x\ty\n" @@ -94,9 +101,8 @@ sort: Investigate better sorting algorithms; see Knuth vol. 3. 5.3.1, who credits Lester Ford, Jr. and Selmer Johnson, American Mathematical Monthly 66 (1959), 387-389. -cp --recursive: perform dir traversals in source and dest hierarchy rather - than forming full file names. The latter (current) approach fails - unnecessarily when the names become very long. +shred: Update shred as described here to conform to DoD 5220 rules: +http://lists.gnu.org/archive/html/bug-coreutils/2007-05/msg00075.html Remove suspicious uses of alloca (ones that may allocate more than about 4k) @@ -104,16 +110,15 @@ Remove suspicious uses of alloca (ones that may allocate more than Adapt these contribution guidelines for coreutils: http://sources.redhat.com/automake/contribute.html +Improve test coverage. + See HACKING for instructions on generating an html test coverage report. + Find a program that has poor coverage and improve. Changes expected to go in, someday. ====================================== dd patch from Olivier Delhomme - Andreas Gruenbacher's xattr changes - - Apply Bruno Haible's hostname changes - test/mv/*: clean up $other_partition_tmpdir in all cases ls: when both -l and --dereference-command-line-symlink-to-dir are @@ -122,27 +127,18 @@ Changes expected to go in, someday. an implicit --NO-dereference-command-line-symlink-to-dir meaning. Pointed out by Karl Berry. - A more efficient version of factor, and possibly one that - accepts inputs of size 2^64 and larger. - dd: consider adding an option to suppress `bytes/block read/written' output to stderr. Suggested here: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=165045 Pending copyright papers: ------------------------ - ls --color: Ed Avis' patch to suppress escape sequences for - non-highlighted files - getpwnam from Bruce Korb pb (progress bar) from Miika Pekkarinen ------------------------------ -Have euidaccess.m4 check for eaccess as well as euidaccess -If found, then do `#define euidaccess eaccess'. - Remove long-deprecated options. Search case-insensitive for `deprecated' and `remove in '. Automate this. @@ -150,43 +146,36 @@ Add a distcheck-time test to ensure that every distributed file is either read-only(indicating generated) or is version-controlled and up to date. -Implement Ulrich Drepper's suggestion to use getgrouplist rather - than getugroups. This affects only `id', but makes a big difference - on systems with many users and/or groups, and makes id usable once - again on systems where access restrictions make getugroups fail. - But first we'll need a run-test (either in an autoconf macro or at - run time) to avoid the segfault bug in libc-2.3.2's getgrouplist. - In that case, we'd revert to using a new (to-be-written) getgrouplist - module that does most of what `id' already does. Or just avoid the - buggy use of getgrouplist by never passing it a buffer of length zero. - See https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=200327 - -remove `%s' notation: +remove `%s' notation (now that they're all gone, add a maint.mk sc_ + rule to ensure no new ones are added): grep -E "\`%.{,4}s'" src/*.c +remove all uses of the `register' keyword: Done. add a maint.mk rule + for this, too. + remove or adjust chown's --changes option, since it can't always do what it currently says it does. +Support arbitrary-precision arithmetic in those tools for which it +makes sense. Factor and expr already support this via libgmp. +The "test" program is covered via its string-based comparison of +integers. To be converted: seq. + Adapt tools like wc, tr, fmt, etc. (most of the textutils) to be multibyte aware. The problem is that I want to avoid duplicating significant blocks of logic, yet I also want to incur only minimal (preferably `no') cost when operating in single-byte mode. -Remove all uses of the `register' keyword - pr's use of nstrftime can make it malloc a very large (up to SIZE_MAX) buffer -ls.c: use gettime rather than clock_gettime, gettimeofday, time - ----- -Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, -Inc. +Copyright (C) 2002-2009 Free Software Foundation, Inc. -This program is free software; you can redistribute it and/or modify +This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -194,5 +183,4 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software Foundation, -Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +along with this program. If not, see . diff --git a/src/bin/coreutils/aclocal.m4 b/src/bin/coreutils/aclocal.m4 index f425eb02bc..209aa74dcb 100644 --- a/src/bin/coreutils/aclocal.m4 +++ b/src/bin/coreutils/aclocal.m4 @@ -1,7 +1,7 @@ -# generated automatically by aclocal 1.10 -*- Autoconf -*- +# generated automatically by aclocal 1.10c -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 2005, 2006 Free Software Foundation, Inc. +# 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -11,12 +11,15 @@ # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. -m4_if(m4_PACKAGE_VERSION, [2.61a],, -[m4_fatal([this file was generated for autoconf 2.61a. -You have another version of autoconf. If you want to use that, -you should regenerate the build system entirely.], [63])]) +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.63b.42-b26d5],, +[m4_warning([this file was generated for autoconf 2.63b.42-b26d5. +You have another version of autoconf. It may work, but is not guaranteed to. +If you have problems, you may need to regenerate the build system entirely. +To do so, use the procedure documented by the package, typically `autoreconf'.])]) -# Copyright (C) 2002, 2003, 2005, 2006 Free Software Foundation, Inc. +# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -28,10 +31,10 @@ you should regenerate the build system entirely.], [63])]) # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], -[am__api_version='1.10' +[am__api_version='1.10c' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.10], [], +m4_if([$1], [1.10c], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -45,10 +48,12 @@ m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. -# This function is AC_REQUIREd by AC_INIT_AUTOMAKE. +# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.10])dnl -_AM_AUTOCONF_VERSION(m4_PACKAGE_VERSION)]) +[AM_AUTOMAKE_VERSION([1.10c])dnl +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- @@ -105,14 +110,14 @@ am_aux_dir=`cd $ac_aux_dir && pwd` # AM_CONDITIONAL -*- Autoconf -*- -# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006 +# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 8 +# serial 9 # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- @@ -125,6 +130,7 @@ AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl +m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' @@ -138,14 +144,14 @@ AC_CONFIG_COMMANDS_PRE( Usually this means the macro was only invoked conditionally.]]) fi])]) -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 9 +# serial 10 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, @@ -202,6 +208,16 @@ AC_CACHE_CHECK([dependency style of $depcc], if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi + am__universal=false + m4_case([$1], [CC], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac], + [CXX], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac]) + for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and @@ -219,7 +235,17 @@ AC_CACHE_CHECK([dependency style of $depcc], done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested @@ -229,19 +255,23 @@ AC_CACHE_CHECK([dependency style of $depcc], break fi ;; + msvisualcpp | msvcmsys) + # This compiler won't grok `-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; none) break ;; esac - # We check with `-c' and `-o' for the sake of the "dashmstdout" - # mode. It turns out that the SunPro C++ compiler does not properly - # handle `-M -o', and we need to detect this. if depmode=$depmode \ - source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message @@ -298,57 +328,68 @@ _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl # Generate code to set up dependency tracking. -*- Autoconf -*- -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -#serial 3 +#serial 5 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], -[for mf in $CONFIG_FILES; do - # Strip MF so we end up with the name of the file. - mf=`echo "$mf" | sed -e 's/:.*$//'` - # Check whether this is an Automake generated Makefile or not. - # We used to match only the files named `Makefile.in', but - # some people rename them; so instead we look at the file content. - # Grep'ing the first line is not enough: some people post-process - # each Makefile.in and add a new line on top of each file to say so. - # Grep'ing the whole file is not good either: AIX grep has a line - # limit of 2048, but all sed's we know have understand at least 4000. - if sed 10q "$mf" | grep '^#.*generated by automake' > /dev/null 2>&1; then - dirpart=`AS_DIRNAME("$mf")` - else - continue - fi - # Extract the definition of DEPDIR, am__include, and am__quote - # from the Makefile without running `make'. - DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` - test -z "$DEPDIR" && continue - am__include=`sed -n 's/^am__include = //p' < "$mf"` - test -z "am__include" && continue - am__quote=`sed -n 's/^am__quote = //p' < "$mf"` - # When using ansi2knr, U may be empty or an underscore; expand it - U=`sed -n 's/^U = //p' < "$mf"` - # Find all dependency output files, they are included files with - # $(DEPDIR) in their names. We invoke sed twice because it is the - # simplest approach to changing $(DEPDIR) to its actual value in the - # expansion. - for file in `sed -n " - s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ - sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do - # Make sure the directory exists. - test -f "$dirpart/$file" && continue - fdir=`AS_DIRNAME(["$file"])` - AS_MKDIR_P([$dirpart/$fdir]) - # echo "creating $dirpart/$file" - echo '# dummy' > "$dirpart/$file" +[{ + # Autoconf 2.62 quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`AS_DIRNAME("$mf")` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`AS_DIRNAME(["$file"])` + AS_MKDIR_P([$dirpart/$fdir]) + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done done -done +} ])# _AM_OUTPUT_DEPENDENCY_COMMANDS @@ -368,13 +409,13 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 2005, 2006 Free Software Foundation, Inc. +# 2005, 2006, 2008, 2009 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 12 +# serial 16 # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. @@ -391,7 +432,7 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], -[AC_PREREQ([2.60])dnl +[AC_PREREQ([2.62])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl @@ -442,8 +483,8 @@ AM_MISSING_PROG(AUTOCONF, autoconf) AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) AM_MISSING_PROG(AUTOHEADER, autoheader) AM_MISSING_PROG(MAKEINFO, makeinfo) -AM_PROG_INSTALL_SH -AM_PROG_INSTALL_STRIP +AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AM_PROG_MKDIR_P])dnl # We need awk for the "check" target. The system "awk" is bad on # some platforms. @@ -451,24 +492,37 @@ AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], - [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], - [_AM_PROG_TAR([v7])])]) + [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], - [_AM_DEPENDENCIES(CC)], - [define([AC_PROG_CC], - defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl + [_AM_DEPENDENCIES(CC)], + [define([AC_PROG_CC], + defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], - [_AM_DEPENDENCIES(CXX)], - [define([AC_PROG_CXX], - defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl + [_AM_DEPENDENCIES(CXX)], + [define([AC_PROG_CXX], + defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], - [_AM_DEPENDENCIES(OBJC)], - [define([AC_PROG_OBJC], - defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl + [_AM_DEPENDENCIES(OBJC)], + [define([AC_PROG_OBJC], + defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl ]) +_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl +dnl The `parallel-tests' driver may need to know about EXEEXT, so add the +dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro +dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. +AC_CONFIG_COMMANDS_PRE(dnl +[m4_provide_if([_AM_COMPILER_EXEEXT], + [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl ]) +dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not +dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further +dnl mangled by Autoconf and run in a shell conditional statement. +m4_define([_AC_COMPILER_EXEEXT], +m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) + # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header @@ -479,18 +533,19 @@ AC_PROVIDE_IFELSE([AC_PROG_OBJC], # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. +_am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in - $1 | $1:* ) + $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done -echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) +echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) -# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# Copyright (C) 2001, 2003, 2005, 2008 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -501,7 +556,14 @@ echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"} +if test x"${install_sh}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi AC_SUBST(install_sh)]) # Copyright (C) 2003, 2005 Free Software Foundation, Inc. @@ -527,13 +589,13 @@ AC_SUBST([am__leading_dot])]) # Check to see how 'make' treats includes. -*- Autoconf -*- -# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. +# Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 3 +# serial 4 # AM_MAKE_INCLUDE() # ----------------- @@ -542,7 +604,7 @@ AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: - @echo done + @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. @@ -552,24 +614,24 @@ am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf -# We grep out `Entering directory' and `Leaving directory' -# messages which can occur if `w' ends up in MAKEFLAGS. -# In particular we don't look at `^make:' because GNU make might -# be invoked under some other name (usually "gmake"), in which -# case it prints its new name instead of `make'. -if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then - am__include=include - am__quote= - _am_result=GNU -fi +# Ignore all kinds of additional output from `make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf - if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then - am__include=.include - am__quote="\"" - _am_result=BSD - fi + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac fi AC_SUBST([am__include]) AC_SUBST([am__quote]) @@ -577,14 +639,14 @@ AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) -# Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005 +# Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 5 +# serial 6 # AM_PROG_CC_C_O # -------------- @@ -596,8 +658,9 @@ AC_REQUIRE_AUX_FILE([compile])dnl # FIXME: we rely on the cache variable name because # there is no other way. set dummy $CC -ac_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']` -if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" != yes"; then +am_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']` +eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o +if test "$am_t" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. @@ -613,14 +676,14 @@ m4_define([AC_PROG_CC], # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- -# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005 +# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 5 +# serial 6 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ @@ -637,7 +700,14 @@ AC_SUBST($1)]) AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl -test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " @@ -675,13 +745,13 @@ esac # Helper functions for option handling. -*- Autoconf -*- -# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. +# Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 3 +# serial 4 # _AM_MANGLE_OPTION(NAME) # ----------------------- @@ -698,7 +768,7 @@ AC_DEFUN([_AM_SET_OPTION], # ---------------------------------- # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], -[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) +[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- @@ -734,14 +804,14 @@ AU_DEFUN([fp_C_PROTOTYPES], [AM_C_PROTOTYPES]) # Check to make sure that the build environment is sane. -*- Autoconf -*- -# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 +# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 4 +# serial 5 # AM_SANITY_CHECK # --------------- @@ -750,16 +820,29 @@ AC_DEFUN([AM_SANITY_CHECK], # Just in case sleep 1 echo timestamp > conftest.file +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[[\\\"\#\$\&\'\`$am_lf]]*) + AC_MSG_ERROR([unsafe absolute working directory name]);; +esac +case $srcdir in + *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) + AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; +esac + # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( - set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. - set X `ls -t $srcdir/configure conftest.file` + set X `ls -t "$srcdir/configure" conftest.file` fi rm -f conftest.file if test "$[*]" != "X $srcdir/configure conftest.file" \ @@ -784,6 +867,33 @@ Check your system clock]) fi AC_MSG_RESULT(yes)]) +# Copyright (C) 2009 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 1 + +# AM_SILENT_RULES([DEFAULT]) +# -------------------------- +# Enable less verbose build rules; with the default set to DEFAULT +# (`yes' being less verbose, `no' or empty being verbose). +AC_DEFUN([AM_SILENT_RULES], +[AC_ARG_ENABLE([silent-rules], +[ --enable-silent-rules less verbose build output (undo: `make V=1') + --disable-silent-rules verbose build output (undo: `make V=0')]) +case $enable_silent_rules in +yes) AM_DEFAULT_VERBOSITY=0;; +no) AM_DEFAULT_VERBOSITY=1;; +*) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; +esac +AC_SUBST([AM_DEFAULT_VERBOSITY])dnl +AM_BACKSLASH='\' +AC_SUBST([AM_BACKSLASH])dnl +_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl +]) + # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation @@ -812,18 +922,25 @@ fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) -# Copyright (C) 2006 Free Software Foundation, Inc. +# Copyright (C) 2006, 2008 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. +# serial 2 + # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- -# Prevent Automake from outputing VARIABLE = @VARIABLE@ in Makefile.in. +# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) +# AM_SUBST_NOTMAKE(VARIABLE) +# --------------------------- +# Public sister of _AM_SUBST_NOTMAKE. +AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) + # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004, 2005 Free Software Foundation, Inc. @@ -920,10 +1037,9 @@ AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR -m4_include([m4/absolute-header.m4]) +m4_include([m4/00gnulib.m4]) m4_include([m4/acl.m4]) m4_include([m4/alloca.m4]) -m4_include([m4/allocsa.m4]) m4_include([m4/argmatch.m4]) m4_include([m4/arpa_inet_h.m4]) m4_include([m4/assert.m4]) @@ -933,6 +1049,7 @@ m4_include([m4/backupfile.m4]) m4_include([m4/base64.m4]) m4_include([m4/bison.m4]) m4_include([m4/boottime.m4]) +m4_include([m4/btowc.m4]) m4_include([m4/c-strtod.m4]) m4_include([m4/calloc.m4]) m4_include([m4/canon-host.m4]) @@ -943,40 +1060,56 @@ m4_include([m4/chown.m4]) m4_include([m4/clock_time.m4]) m4_include([m4/cloexec.m4]) m4_include([m4/close-stream.m4]) +m4_include([m4/close.m4]) +m4_include([m4/closein.m4]) m4_include([m4/closeout.m4]) m4_include([m4/codeset.m4]) m4_include([m4/config-h.m4]) m4_include([m4/cycle-check.m4]) m4_include([m4/d-ino.m4]) m4_include([m4/d-type.m4]) +m4_include([m4/dirent_h.m4]) m4_include([m4/dirfd.m4]) m4_include([m4/dirname.m4]) m4_include([m4/dos.m4]) m4_include([m4/double-slash-root.m4]) m4_include([m4/dup2.m4]) m4_include([m4/eealloc.m4]) -m4_include([m4/eoverflow.m4]) +m4_include([m4/environ.m4]) +m4_include([m4/errno_h.m4]) m4_include([m4/error.m4]) m4_include([m4/euidaccess-stat.m4]) m4_include([m4/euidaccess.m4]) m4_include([m4/exclude.m4]) m4_include([m4/exitfail.m4]) +m4_include([m4/exponentd.m4]) +m4_include([m4/exponentf.m4]) +m4_include([m4/exponentl.m4]) m4_include([m4/extensions.m4]) m4_include([m4/fchdir.m4]) +m4_include([m4/fclose.m4]) m4_include([m4/fcntl-safer.m4]) m4_include([m4/fcntl_h.m4]) m4_include([m4/fd-reopen.m4]) +m4_include([m4/fflush.m4]) m4_include([m4/file-type.m4]) m4_include([m4/fileblocks.m4]) m4_include([m4/filemode.m4]) m4_include([m4/filenamecat.m4]) m4_include([m4/flexmember.m4]) +m4_include([m4/float_h.m4]) m4_include([m4/fnmatch.m4]) m4_include([m4/fpending.m4]) +m4_include([m4/fpieee.m4]) m4_include([m4/fprintftime.m4]) -m4_include([m4/free.m4]) +m4_include([m4/fpurge.m4]) +m4_include([m4/freading.m4]) +m4_include([m4/frexp.m4]) +m4_include([m4/frexpl.m4]) +m4_include([m4/fseeko.m4]) m4_include([m4/fstypename.m4]) m4_include([m4/fsusage.m4]) +m4_include([m4/ftello.m4]) m4_include([m4/ftruncate.m4]) m4_include([m4/fts.m4]) m4_include([m4/getaddrinfo.m4]) @@ -1000,29 +1133,42 @@ m4_include([m4/gettimeofday.m4]) m4_include([m4/getugroups.m4]) m4_include([m4/getusershell.m4]) m4_include([m4/glibc21.m4]) +m4_include([m4/gmp.m4]) +m4_include([m4/gnu-make.m4]) m4_include([m4/gnulib-common.m4]) m4_include([m4/gnulib-comp.m4]) m4_include([m4/group-member.m4]) m4_include([m4/hard-locale.m4]) m4_include([m4/hash.m4]) m4_include([m4/host-os.m4]) +m4_include([m4/hostent.m4]) m4_include([m4/human.m4]) m4_include([m4/i-ring.m4]) m4_include([m4/iconv.m4]) +m4_include([m4/iconv_h.m4]) +m4_include([m4/iconv_open.m4]) m4_include([m4/idcache.m4]) +m4_include([m4/include-exclude-prog.m4]) +m4_include([m4/include_next.m4]) m4_include([m4/inet_ntop.m4]) +m4_include([m4/inet_pton.m4]) m4_include([m4/inline.m4]) +m4_include([m4/intlmacosx.m4]) m4_include([m4/intmax_t.m4]) m4_include([m4/inttostr.m4]) m4_include([m4/inttypes-pri.m4]) m4_include([m4/inttypes.m4]) m4_include([m4/inttypes_h.m4]) m4_include([m4/isapipe.m4]) +m4_include([m4/isnand.m4]) +m4_include([m4/isnanf.m4]) +m4_include([m4/isnanl.m4]) m4_include([m4/jm-macros.m4]) m4_include([m4/jm-winsz1.m4]) m4_include([m4/jm-winsz2.m4]) m4_include([m4/lchmod.m4]) m4_include([m4/lchown.m4]) +m4_include([m4/ldexpl.m4]) m4_include([m4/lib-check.m4]) m4_include([m4/lib-ignore.m4]) m4_include([m4/lib-ld.m4]) @@ -1030,15 +1176,25 @@ m4_include([m4/lib-link.m4]) m4_include([m4/lib-prefix.m4]) m4_include([m4/link-follow.m4]) m4_include([m4/localcharset.m4]) +m4_include([m4/locale-fr.m4]) +m4_include([m4/locale-ja.m4]) +m4_include([m4/locale-tr.m4]) +m4_include([m4/locale-zh.m4]) m4_include([m4/long-options.m4]) -m4_include([m4/longdouble.m4]) m4_include([m4/longlong.m4]) m4_include([m4/ls-mntd-fs.m4]) +m4_include([m4/lseek.m4]) m4_include([m4/lstat.m4]) +m4_include([m4/malloc.m4]) +m4_include([m4/malloca.m4]) +m4_include([m4/manywarnings.m4]) +m4_include([m4/math_h.m4]) m4_include([m4/mbchar.m4]) m4_include([m4/mbiter.m4]) +m4_include([m4/mbrlen.m4]) m4_include([m4/mbrtowc.m4]) -m4_include([m4/mbscasecmp.m4]) +m4_include([m4/mbsinit.m4]) +m4_include([m4/mbsrtowcs.m4]) m4_include([m4/mbstate_t.m4]) m4_include([m4/mbswidth.m4]) m4_include([m4/md5.m4]) @@ -1052,6 +1208,7 @@ m4_include([m4/mempcpy.m4]) m4_include([m4/memrchr.m4]) m4_include([m4/memset.m4]) m4_include([m4/memxfrm.m4]) +m4_include([m4/mgetgroups.m4]) m4_include([m4/mkancesdirs.m4]) m4_include([m4/mkdir-p.m4]) m4_include([m4/mkdir-slash.m4]) @@ -1060,27 +1217,36 @@ m4_include([m4/mktime.m4]) m4_include([m4/modechange.m4]) m4_include([m4/mountlist.m4]) m4_include([m4/mpsort.m4]) +m4_include([m4/multiarch.m4]) m4_include([m4/nanosleep.m4]) +m4_include([m4/netdb_h.m4]) m4_include([m4/netinet_in_h.m4]) m4_include([m4/nls.m4]) +m4_include([m4/nocrash.m4]) +m4_include([m4/open.m4]) m4_include([m4/openat.m4]) m4_include([m4/pathmax.m4]) m4_include([m4/perl.m4]) +m4_include([m4/perror.m4]) m4_include([m4/physmem.m4]) m4_include([m4/po.m4]) +m4_include([m4/posix-shell.m4]) m4_include([m4/posixtm.m4]) m4_include([m4/posixver.m4]) m4_include([m4/prereq.m4]) +m4_include([m4/printf-frexp.m4]) +m4_include([m4/printf-frexpl.m4]) +m4_include([m4/printf.m4]) +m4_include([m4/priv-set.m4]) m4_include([m4/progtest.m4]) m4_include([m4/putenv.m4]) m4_include([m4/quote.m4]) m4_include([m4/quotearg.m4]) -m4_include([m4/randint.m4]) -m4_include([m4/randperm.m4]) -m4_include([m4/randread.m4]) +m4_include([m4/read-file.m4]) m4_include([m4/readlink.m4]) m4_include([m4/readtokens.m4]) m4_include([m4/readutmp.m4]) +m4_include([m4/realloc.m4]) m4_include([m4/regex.m4]) m4_include([m4/rename-dest-slash.m4]) m4_include([m4/rename.m4]) @@ -1094,13 +1260,24 @@ m4_include([m4/same.m4]) m4_include([m4/save-cwd.m4]) m4_include([m4/savedir.m4]) m4_include([m4/savewd.m4]) +m4_include([m4/select.m4]) +m4_include([m4/selinux-context-h.m4]) +m4_include([m4/selinux-selinux-h.m4]) +m4_include([m4/servent.m4]) m4_include([m4/setenv.m4]) m4_include([m4/settime.m4]) m4_include([m4/sha1.m4]) m4_include([m4/sha256.m4]) m4_include([m4/sha512.m4]) m4_include([m4/sig2str.m4]) +m4_include([m4/sigaction.m4]) +m4_include([m4/signal_h.m4]) +m4_include([m4/signalblocking.m4]) +m4_include([m4/signbit.m4]) +m4_include([m4/size_max.m4]) +m4_include([m4/sleep.m4]) m4_include([m4/snprintf.m4]) +m4_include([m4/sockets.m4]) m4_include([m4/socklen.m4]) m4_include([m4/sockpfaf.m4]) m4_include([m4/ssize_t.m4]) @@ -1116,8 +1293,10 @@ m4_include([m4/stdio_h.m4]) m4_include([m4/stdlib-safer.m4]) m4_include([m4/stdlib_h.m4]) m4_include([m4/stpcpy.m4]) +m4_include([m4/stpncpy.m4]) m4_include([m4/strcspn.m4]) m4_include([m4/strdup.m4]) +m4_include([m4/strerror.m4]) m4_include([m4/strftime.m4]) m4_include([m4/string_h.m4]) m4_include([m4/strndup.m4]) @@ -1132,6 +1311,8 @@ m4_include([m4/strtoul.m4]) m4_include([m4/strtoull.m4]) m4_include([m4/strtoumax.m4]) m4_include([m4/strverscmp.m4]) +m4_include([m4/sys_ioctl_h.m4]) +m4_include([m4/sys_select_h.m4]) m4_include([m4/sys_socket_h.m4]) m4_include([m4/sys_stat_h.m4]) m4_include([m4/sys_time_h.m4]) @@ -1141,6 +1322,7 @@ m4_include([m4/time_r.m4]) m4_include([m4/timespec.m4]) m4_include([m4/tm_gmtoff.m4]) m4_include([m4/tzset.m4]) +m4_include([m4/ungetc.m4]) m4_include([m4/unicodeio.m4]) m4_include([m4/unistd-safer.m4]) m4_include([m4/unistd_h.m4]) @@ -1150,23 +1332,32 @@ m4_include([m4/unlocked-io.m4]) m4_include([m4/uptime.m4]) m4_include([m4/userspec.m4]) m4_include([m4/utimbuf.m4]) -m4_include([m4/utime.m4]) m4_include([m4/utimecmp.m4]) m4_include([m4/utimens.m4]) -m4_include([m4/utimes-null.m4]) m4_include([m4/utimes.m4]) m4_include([m4/vasnprintf.m4]) +m4_include([m4/vasprintf-posix.m4]) m4_include([m4/vasprintf.m4]) +m4_include([m4/vfprintf-posix.m4]) +m4_include([m4/vprintf-posix.m4]) +m4_include([m4/warnings.m4]) m4_include([m4/wchar.m4]) m4_include([m4/wchar_t.m4]) +m4_include([m4/wcrtomb.m4]) +m4_include([m4/wctob.m4]) m4_include([m4/wctype.m4]) m4_include([m4/wcwidth.m4]) m4_include([m4/wint_t.m4]) +m4_include([m4/write-any-file.m4]) +m4_include([m4/write.m4]) m4_include([m4/xalloc.m4]) +m4_include([m4/xattr.m4]) m4_include([m4/xfts.m4]) m4_include([m4/xgetcwd.m4]) m4_include([m4/xnanosleep.m4]) +m4_include([m4/xsize.m4]) m4_include([m4/xstrndup.m4]) m4_include([m4/xstrtod.m4]) m4_include([m4/xstrtol.m4]) +m4_include([m4/xvasprintf.m4]) m4_include([m4/yesno.m4]) diff --git a/src/bin/coreutils/bootstrap b/src/bin/coreutils/bootstrap index 3294085057..5e7fe9ac62 100755 --- a/src/bin/coreutils/bootstrap +++ b/src/bin/coreutils/bootstrap @@ -2,12 +2,12 @@ # Bootstrap this package from checked-out sources. -# Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. +# Copyright (C) 2003-2009 Free Software Foundation, Inc. -# This program is free software; you can redistribute it and/or modify +# This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -15,9 +15,7 @@ # GNU General Public License for more details. # You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -# 02110-1301, USA. +# along with this program. If not, see . # Written by Paul Eggert. @@ -25,10 +23,11 @@ nl=' ' # Ensure file names are sorted consistently across platforms. -# Also, ensure diagnostics are in English, e.g., "wget --help" below. LC_ALL=C export LC_ALL +local_gl_dir=gl + # Temporary directory names. bt='._bootmp' bt_regex=`echo "$bt"| sed 's/\./[.]/g'` @@ -49,34 +48,42 @@ Options: --force Attempt to bootstrap even if the sources seem not to have been checked out. --skip-po Do not download po files. - --cvs-user=USERNAME Set the username to use when checking out - sources from the gnulib repository. -If the file .bootstrap.conf exists in the current working directory, its +If the file $0.conf exists in the same directory as this script, its contents are read as shell variables to configure the bootstrap. +For build prerequisites, environment variables like \$AUTOCONF and \$AMTAR +are honored. + Running without arguments will suffice in most cases. " } # Configuration. +# Name of the Makefile.am +gnulib_mk=gnulib.mk + # List of gnulib modules needed. gnulib_modules= # Any gnulib files needed that are not in modules. gnulib_files= -# Translation Project URL, for the registry of all projects -# and for the translation-team master directory. -TP_URL='http://www.iro.umontreal.ca/translation/registry.cgi?domain=' -TP_PO_URL='http://www.iro.umontreal.ca/translation/teams/PO/' +# The command to download all .po files for a specified domain into +# a specified directory. Fill in the first %s is the domain name, and +# the second with the destination directory. Use rsync's -L and -r +# options because the latest/%s directory and the .po files within are +# all symlinks. +po_download_command_format=\ +"rsync -Lrtvz 'translationproject.org::tp/latest/%s/' '%s'" extract_package_name=' /^AC_INIT(/{ - /.*,.*,.*,/{ + /.*,.*,.*, */{ s/// s/[][]//g + s/)$// p q } @@ -92,6 +99,11 @@ package=`sed -n "$extract_package_name" configure.ac` || exit gnulib_name=lib$package build_aux=build-aux +source_base=lib +m4_base=m4 +doc_base=doc +tests_base=tests + # Extra files from gnulib, which override files from other sources. gnulib_extra_files=" $build_aux/install-sh @@ -104,6 +116,9 @@ gnulib_extra_files=" doc/INSTALL " +# Additional gnulib-tool options to use. Use "\newline" to break lines. +gnulib_tool_option_extras= + # Other locale categories that need message catalogs. EXTRA_LOCALE_CATEGORIES= @@ -114,6 +129,9 @@ XGETTEXT_OPTIONS='\\\ --flag=error:3:c-format --flag=error_at_line:5:c-format\\\ ' +# Package bug report address for gettext files +MSGID_BUGS_ADDRESS=bug-$package@gnu.org + # Files we don't want to import. excluded_files= @@ -124,8 +142,26 @@ checkout_only_file=README-hacking # Whether to use copies instead of symlinks. copy=false +# Set this to '.cvsignore .gitignore' in bootstrap.conf if you want +# those files to be generated in directories like lib/, m4/, and po/. +# Or set it to 'auto' to make this script select which to use based +# on which version control system (if any) is used in the source directory. +vc_ignore=auto + # Override the default configuration, if necessary. -test -r bootstrap.conf && . ./bootstrap.conf +# Make sure that bootstrap.conf is sourced from the current directory +# if we were invoked as "sh bootstrap". +case "$0" in + */*) test -r "$0.conf" && . "$0.conf" ;; + *) test -r "$0.conf" && . ./"$0.conf" ;; +esac + + +if test "$vc_ignore" = auto; then + vc_ignore= + test -d .git && vc_ignore=.gitignore + test -d CVS && vc_ignore="$vc_ignore .cvsignore" +fi # Translate configuration into internal form. @@ -138,9 +174,7 @@ do usage exit;; --gnulib-srcdir=*) - GNULIB_SRCDIR=`expr "$option" : '--gnulib-srcdir=\(.*\)'`;; - --cvs-user=*) - CVS_USER=`expr "$option" : '--cvs-user=\(.*\)'`;; + GNULIB_SRCDIR=`expr "X$option" : 'X--gnulib-srcdir=\(.*\)'`;; --skip-po) SKIP_PO=t;; --force) @@ -163,7 +197,8 @@ fi insert_sorted_if_absent() { file=$1 str=$2 - echo "$str" | sort -u - $file | cmp -s - $file \ + test -f $file || touch $file + echo "$str" | sort -u - $file | cmp - $file > /dev/null \ || echo "$str" | sort -u - $file -o $file \ || exit 1 } @@ -176,55 +211,175 @@ grep '^[ ]*AC_CONFIG_AUX_DIR('"$build_aux"')' configure.ac \ >/dev/null && found_aux_dir=yes if test $found_aux_dir = no; then echo "$0: expected line not found in configure.ac. Add the following:" >&2 - echo " AC_CONFIG_AUX_DIR([$build_aux])" >&2. + echo " AC_CONFIG_AUX_DIR([$build_aux])" >&2 + exit 1 fi # If $build_aux doesn't exist, create it now, otherwise some bits # below will malfunction. If creating it, also mark it as ignored. if test ! -d $build_aux; then mkdir $build_aux - for ig in .cvsignore .gitignore; do - test -f $ig && insert_sorted_if_absent $ig $build_aux + for dot_ig in x $vc_ignore; do + test $dot_ig = x && continue + insert_sorted_if_absent $dot_ig $build_aux done fi +# Note this deviates from the version comparison in automake +# in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a +# but this should suffice as we won't be specifying old +# version formats or redundant trailing .0 in bootstrap.conf. +# If we did want full compatibility then we should probably +# use m4_version_compare from autoconf. +sort_ver() { # sort -V is not generally available + ver1="$1" + ver2="$2" + + # split on '.' and compare each component + i=1 + while : ; do + p1=$(echo "$ver1" | cut -d. -f$i) + p2=$(echo "$ver2" | cut -d. -f$i) + if [ ! "$p1" ]; then + echo "$1 $2" + break + elif [ ! "$p2" ]; then + echo "$2 $1" + break + elif [ ! "$p1" = "$p2" ]; then + if [ "$p1" -gt "$p2" ] 2>/dev/null; then # numeric comparison + echo "$2 $1" + elif [ "$p2" -gt "$p1" ] 2>/dev/null; then # numeric comparison + echo "$1 $2" + else # numeric, then lexicographic comparison + lp=$(printf "$p1\n$p2\n" | LANG=C sort -n | tail -n1) + if [ "$lp" = "$p2" ]; then + echo "$1 $2" + else + echo "$2 $1" + fi + fi + break + fi + i=$(($i+1)) + done +} + +get_version() { + app=$1 + + $app --version >/dev/null 2>&1 || return 1 + + $app --version 2>&1 | + sed -n 's/[^0-9.]*\([0-9]\{1,\}\.[.a-z0-9-]*\).*/\1/p + t done + d + :done + q' +} + +check_versions() { + ret=0 + + while read app req_ver; do + # Honor $APP variables ($TAR, $AUTOCONF, etc.) + appvar=`echo $app | tr '[a-z]' '[A-Z]'` + test "$appvar" = TAR && appvar=AMTAR + eval "app=\${$appvar-$app}" + inst_ver=$(get_version $app) + if [ ! "$inst_ver" ]; then + echo "Error: '$app' not found" >&2 + ret=1 + elif [ ! "$req_ver" = "-" ]; then + latest_ver=$(sort_ver $req_ver $inst_ver | cut -d' ' -f2) + if [ ! "$latest_ver" = "$inst_ver" ]; then + echo "Error: '$app' version == $inst_ver is too old" >&2 + echo " '$app' version >= $req_ver is required" >&2 + ret=1 + fi + fi + done + + return $ret +} + +print_versions() { + echo "Program Min_version" + echo "----------------------" + printf "$buildreq" + echo "----------------------" + # can't depend on column -t +} + +if ! printf "$buildreq" | check_versions; then + test -f README-prereq && + echo "Please see README-prereq for notes on obtaining these prerequisite programs:" >&2 + echo + print_versions + exit 1 +fi + echo "$0: Bootstrapping from checked-out $package sources..." +# See if we can use gnulib's git-merge-changelog merge driver. +if test -d .git && (git --version) >/dev/null 2>/dev/null ; then + if git config merge.merge-changelog.driver >/dev/null ; then + : + elif (git-merge-changelog --version) >/dev/null 2>/dev/null ; then + echo "initializing git-merge-changelog driver" + git config merge.merge-changelog.name 'GNU-style ChangeLog merge driver' + git config merge.merge-changelog.driver 'git-merge-changelog %O %A %B' + else + echo "consider installing git-merge-changelog from gnulib" + fi +fi + + cleanup_gnulib() { status=$? rm -fr gnulib exit $status } +git_modules_config () { + GIT_CONFIG=.gitmodules git config "$@" +} + # Get gnulib files. case ${GNULIB_SRCDIR--} in -) - if [ ! -d gnulib ]; then + if git_modules_config submodule.gnulib.url >/dev/null; then echo "$0: getting gnulib files..." + git submodule init || exit $? + git submodule update || exit $? - case ${CVS_AUTH-pserver} in - pserver) - CVS_PREFIX=':pserver:anonymous@';; - ssh) - CVS_PREFIX="$CVS_USER${CVS_USER+@}";; - *) - echo "$0: $CVS_AUTH: Unknown CVS access method" >&2 - exit 1;; - esac - - case $CVS_RSH in - '') CVS_RSH=ssh; export CVS_RSH;; - esac + elif [ ! -d gnulib ]; then + echo "$0: getting gnulib files..." trap cleanup_gnulib 1 2 13 15 - cvs -z3 -q -d ${CVS_PREFIX}cvs.savannah.gnu.org:/cvsroot/gnulib co gnulib || + git clone --help|grep depth > /dev/null && shallow='--depth 2' || shallow= + git clone $shallow git://git.sv.gnu.org/gnulib || cleanup_gnulib trap - 1 2 13 15 fi GNULIB_SRCDIR=gnulib + ;; +*) + # Redirect the gnulib submodule to the directory on the command line + # if possible. + if test -d "$GNULIB_SRCDIR"/.git && \ + git_modules_config submodule.gnulib.url >/dev/null; then + git submodule init + GNULIB_SRCDIR=`cd $GNULIB_SRCDIR && pwd` + git config --replace-all submodule.gnulib.url $GNULIB_SRCDIR + echo "$0: getting gnulib files..." + git submodule update || exit $? + GNULIB_SRCDIR=gnulib + fi + ;; esac gnulib_tool=$GNULIB_SRCDIR/gnulib-tool @@ -232,71 +387,81 @@ gnulib_tool=$GNULIB_SRCDIR/gnulib-tool # Get translations. -get_translations() { +download_po_files() { subdir=$1 domain=$2 + echo "$0: getting translations into $subdir for $domain..." + cmd=`printf "$po_download_command_format" "$domain" "$subdir"` + eval "$cmd" +} - case $WGET_COMMAND in - '') - echo "$0: wget not available; skipping translations";; - ?*) - echo "$0: getting translations into $subdir for $domain..." && +# Download .po files to $po_dir/.reference and copy only the new +# or modified ones into $po_dir. Also update $po_dir/LINGUAS. +update_po_files() { + # Directory containing primary .po files. + # Overwrite them only when we're sure a .po file is new. + po_dir=$1 + domain=$2 - (cd $subdir && rm -f dummy `ls | sed -n '/\.gmo$/p; /\.po/p'`) && - $WGET_COMMAND -O "$subdir/$domain.html" "$TP_URL$domain" && + # Download *.po files into this dir. + # Usually contains *.s1 checksum files. + ref_po_dir="$po_dir/.reference" - sed -n 's|.*"http://[^"]*/translation/teams/PO/\([^/"]*\)/'"$domain"'-\([^/"]*\)\.[^."]*\.po".*|\1.\2|p' <"$subdir/$domain.html" | - sort -k 1,1 -k 2,2n -k2,2 -k3,3n -k3,3 -k4,4n -k4,4 -k5,5n -k5.5 | - awk -F. ' - { if (lang && $1 != lang) print lang, ver } - { lang = $1; ver = substr($0, index($0, ".") + 1) } - END { if (lang) print lang, ver } - ' | awk -v domain="$domain" -v subdir="$subdir" ' - { - lang = $1 - ver = $2 - urlfmt = "" - printf "{ $WGET_COMMAND -O %s/%s.po '\'"$TP_PO_URL"'/%s/%s-%s.%s.po'\'' &&\n", subdir, lang, lang, domain, ver, lang - printf " msgfmt -c -o /dev/null %s/%s.po || {\n", subdir, lang - printf " echo >&2 '\'"$0"': omitting translation for %s'\''\n", lang - printf " rm -f %s/%s.po; }; } &&\n", subdir, lang - } - END { print ":" } - ' | WGET_COMMAND="$WGET_COMMAND" sh;; - esac && - ls "$subdir"/*.po 2>/dev/null | - sed 's|.*/||; s|\.po$||' >"$subdir/LINGUAS" && - rm -f "$subdir/$domain.html" + test -d $ref_po_dir || mkdir $ref_po_dir || return + download_po_files $ref_po_dir $domain \ + && ls "$ref_po_dir"/*.po 2>/dev/null | + sed 's|.*/||; s|\.po$||' > "$po_dir/LINGUAS" + + langs=`cd $ref_po_dir && echo *.po|sed 's/\.po//g'` + test "$langs" = '*' && langs=x + for po in $langs; do + case $po in x) continue;; esac + new_po="$ref_po_dir/$po.po" + cksum_file="$ref_po_dir/$po.s1" + if ! test -f "$cksum_file" || + ! test -f "$po_dir/$po.po" || + ! ${SHA1SUM-sha1sum} -c --status "$cksum_file" < "$new_po" > /dev/null; then + echo "updated $po_dir/$po.po..." + cp "$new_po" "$po_dir/$po.po" && ${SHA1SUM-sha1sum} < "$new_po" > "$cksum_file" + fi + done } case $SKIP_PO in '') - case `wget --help` in - *'--no-cache'*) - WGET_COMMAND='wget -nv --no-cache';; - *'--cache=on/off'*) - WGET_COMMAND='wget -nv --cache=off';; - *'--non-verbose'*) - WGET_COMMAND='wget -nv';; - *) - WGET_COMMAND='';; - esac - if test -d po; then - get_translations po $package || exit + update_po_files po $package || exit fi if test -d runtime-po; then - get_translations runtime-po $package-runtime || exit + update_po_files runtime-po $package-runtime || exit fi;; esac -symlink_to_gnulib() +symlink_to_dir() { - src=$GNULIB_SRCDIR/$1 - dst=${2-$1} + src=$1/$2 + dst=${3-$2} test -f "$src" && { + + # If the destination directory doesn't exist, create it. + # This is required at least for "lib/uniwidth/cjk.h". + dst_dir=`dirname "$dst"` + if ! test -d "$dst_dir"; then + mkdir -p "$dst_dir" + + # If we've just created a directory like lib/uniwidth, + # tell version control system(s) it's ignorable. + # FIXME: for now, this does only one level + parent=`dirname "$dst_dir"` + for dot_ig in x $vc_ignore; do + test $dot_ig = x && continue + ig=$parent/$dot_ig + insert_sorted_if_absent $ig `echo "$dst_dir"|sed 's,.*/,,'` + done + fi + if $copy; then { test ! -h "$dst" || { @@ -341,7 +506,9 @@ cp_mark_as_generated() cp_dst=$2 if cmp -s "$cp_src" "$GNULIB_SRCDIR/$cp_dst"; then - symlink_to_gnulib "$cp_dst" + symlink_to_dir "$GNULIB_SRCDIR" "$cp_dst" + elif cmp -s "$cp_src" "$local_gl_dir/$cp_dst"; then + symlink_to_dir $local_gl_dir "$cp_dst" else case $cp_dst in *.[ch]) c1='/* '; c2=' */';; @@ -350,11 +517,20 @@ cp_mark_as_generated() *) c1= ; c2= ;; esac + # If the destination directory doesn't exist, create it. + # This is required at least for "lib/uniwidth/cjk.h". + dst_dir=`dirname "$cp_dst"` + test -d "$dst_dir" || mkdir -p "$dst_dir" + if test -z "$c1"; then cmp -s "$cp_src" "$cp_dst" || { + # Copy the file first to get proper permissions if it + # doesn't already exist. Then overwrite the copy. echo "$0: cp -f $cp_src $cp_dst" && rm -f "$cp_dst" && - sed "s!$bt_regex/!!g" "$cp_src" > "$cp_dst" + cp "$cp_src" "$cp_dst-t" && + sed "s!$bt_regex/!!g" "$cp_src" > "$cp_dst-t" && + mv -f "$cp_dst-t" "$cp_dst" } else # Copy the file first to get proper permissions if it @@ -363,6 +539,7 @@ cp_mark_as_generated() ( echo "$c1-*- buffer-read-only: t -*- vi: set ro:$c2" && echo "${c1}DO NOT EDIT! GENERATED AUTOMATICALLY!$c2" && + echo '#line 1' && sed "s!$bt_regex/!!g" "$cp_src" ) > $cp_dst-t && if cmp -s "$cp_dst-t" "$cp_dst"; then @@ -383,7 +560,9 @@ version_controlled_file() { grep -F "/$file/" $dir/CVS/Entries 2>/dev/null | grep '^/[^/]*/[0-9]' > /dev/null && found=yes elif test -d .git; then - git-rm -n "$dir/$file" > /dev/null 2>&1 && found=yes + git rm -n "$dir/$file" > /dev/null 2>&1 && found=yes + elif test -d .svn; then + svn log -r HEAD "$dir/$file" > /dev/null 2>&1 && found=yes else echo "$0: no version control for $dir/$file?" >&2 fi @@ -394,18 +573,22 @@ slurp() { for dir in . `(cd $1 && find * -type d -print)`; do copied= sep= - for file in `ls $1/$dir`; do + for file in `ls -a $1/$dir`; do + case $file in + .|..) continue;; + .*) continue;; # FIXME: should all file names starting with "." be ignored? + esac test -d $1/$dir/$file && continue for excluded_file in $excluded_files; do test "$dir/$file" = "$excluded_file" && continue 2 done if test $file = Makefile.am; then - copied=$copied${sep}gnulib.mk; sep=$nl + copied=$copied${sep}$gnulib_mk; sep=$nl remove_intl='/^[^#].*\/intl/s/^/#/;'"s!$bt_regex/!!g" - sed "$remove_intl" $1/$dir/$file | cmp -s - $dir/gnulib.mk || { - echo "$0: Copying $1/$dir/$file to $dir/gnulib.mk ..." && - rm -f $dir/gnulib.mk && - sed "$remove_intl" $1/$dir/$file >$dir/gnulib.mk + sed "$remove_intl" $1/$dir/$file | cmp - $dir/$gnulib_mk > /dev/null || { + echo "$0: Copying $1/$dir/$file to $dir/$gnulib_mk ..." && + rm -f $dir/$gnulib_mk && + sed "$remove_intl" $1/$dir/$file >$dir/$gnulib_mk } elif { test "${2+set}" = set && test -r $2/$dir/$file; } || version_controlled_file $dir $file; then @@ -429,14 +612,21 @@ slurp() { fi || exit done - for dot_ig in .cvsignore .gitignore; do + for dot_ig in x $vc_ignore; do + test $dot_ig = x && continue ig=$dir/$dot_ig - if test -n "$copied" && test -f $ig; then + if test -n "$copied"; then insert_sorted_if_absent $ig "$copied" - # If an ignored file name ends with _.h, then also add + # If an ignored file name ends with .in.h, then also add # the name with just ".h". Many gnulib headers are generated, - # e.g., stdint_.h -> stdint.h, dirent_.h ->..., etc. - f=`echo "$copied"|sed 's/_\.h$/.h/'` + # e.g., stdint.in.h -> stdint.h, dirent.in.h ->..., etc. + # Likewise for .gperf -> .h, .y -> .c, and .sin -> .sed + f=`echo "$copied"|sed 's/\.in\.h$/.h/;s/\.sin$/.sed/;s/\.y$/.c/;s/\.gperf$/.h/'` + insert_sorted_if_absent $ig "$f" + + # For files like sys_stat.in.h and sys_time.in.h, record as + # ignorable the directory we might eventually create: sys/. + f=`echo "$copied"|sed 's/sys_.*\.in\.h$/sys/'` insert_sorted_if_absent $ig "$f" fi done @@ -454,19 +644,20 @@ gnulib_tool_options="\ --import\ --no-changelog\ --aux-dir $bt/$build_aux\ - --doc-base $bt/doc\ + --doc-base $bt/$doc_base\ --lib $gnulib_name\ - --m4-base $bt/m4/\ - --source-base $bt/lib/\ - --tests-base $bt/tests\ - --local-dir gl\ + --m4-base $bt/$m4_base/\ + --source-base $bt/$source_base/\ + --tests-base $bt/$tests_base\ + --local-dir $local_gl_dir\ + $gnulib_tool_option_extras\ " echo "$0: $gnulib_tool $gnulib_tool_options --import ..." $gnulib_tool $gnulib_tool_options --import $gnulib_modules && slurp $bt || exit for file in $gnulib_files; do - symlink_to_gnulib $file || exit + symlink_to_dir "$GNULIB_SRCDIR" $file || exit done @@ -476,28 +667,46 @@ grep '^[ ]*AM_GNU_GETTEXT_VERSION(' configure.ac >/dev/null || \ with_gettext=no if test $with_gettext = yes; then - echo "$0: (cd $bt2; autopoint) ..." + echo "$0: (cd $bt2; ${AUTOPOINT-autopoint}) ..." cp configure.ac $bt2 && - (cd $bt2 && autopoint && rm configure.ac) && + (cd $bt2 && ${AUTOPOINT-autopoint} && rm configure.ac) && slurp $bt2 $bt || exit - - rm -fr $bt $bt2 || exit fi +rm -fr $bt $bt2 || exit +# Remove any dangling symlink matching "*.m4" or "*.[ch]" in some +# gnulib-populated directories. Such .m4 files would cause aclocal to fail. +# The following requires GNU find 4.2.3 or newer. Considering the usual +# portability constraints of this script, that may seem a very demanding +# requirement, but it should be ok. Ignore any failure, which is fine, +# since this is only a convenience to help developers avoid the relatively +# unusual case in which a symlinked-to .m4 file is git-removed from gnulib +# between successive runs of this script. +find "$m4_base" "$source_base" \ + -depth \( -name '*.m4' -o -name '*.[ch]' \) \ + -type l -xtype l -delete > /dev/null 2>&1 # Reconfigure, getting other files. for command in \ libtool \ - 'aclocal --force -I m4' \ - 'autoconf --force' \ - 'autoheader --force' \ - 'automake --add-missing --copy --force-missing'; + "${ACLOCAL-aclocal} --force -I m4" \ + "${AUTOCONF-autoconf} --force" \ + "${AUTOHEADER-autoheader} --force" \ + "${AUTOMAKE-automake} --add-missing --copy --force-missing" do if test "$command" = libtool; then - grep '^[ ]*AM_PROG_LIBTOOL\>' configure.ac >/dev/null || - continue - command='libtoolize -c -f' + use_libtool=0 + # We'd like to use grep -E, to see if any of LT_INIT, + # AC_PROG_LIBTOOL, AM_PROG_LIBTOOL is used in configure.ac, + # but that's not portable enough (e.g., for Solaris). + grep '^[ ]*A[CM]_PROG_LIBTOOL' configure.ac >/dev/null \ + && use_libtool=1 + grep '^[ ]*LT_INIT' configure.ac >/dev/null \ + && use_libtool=1 + test $use_libtool = 0 \ + && continue + command="${LIBTOOLIZE-libtoolize} -c -f" fi echo "$0: $command ..." $command || exit @@ -505,13 +714,13 @@ done # Get some extra files from gnulib, overriding existing files. - for file in $gnulib_extra_files; do case $file in */INSTALL) dst=INSTALL;; + build-aux/*) dst=$build_aux/`expr "$file" : 'build-aux/\(.*\)'`;; *) dst=$file;; esac - symlink_to_gnulib $file $dst || exit + symlink_to_dir "$GNULIB_SRCDIR" $file $dst || exit done if test $with_gettext = yes; then @@ -520,7 +729,7 @@ if test $with_gettext = yes; then rm -f po/Makevars sed ' /^EXTRA_LOCALE_CATEGORIES *=/s/=.*/= '"$EXTRA_LOCALE_CATEGORIES"'/ - /^MSGID_BUGS_ADDRESS *=/s/=.*/= bug-'"$package"'@gnu.org/ + /^MSGID_BUGS_ADDRESS *=/s/=.*/= '"$MSGID_BUGS_ADDRESS"'/ /^XGETTEXT_OPTIONS *=/{ s/$/ \\/ a\ @@ -547,4 +756,10 @@ if test $with_gettext = yes; then fi fi +# Horrible, coreutils-specific kludges. +# Change paths in gnulib-tests/gnulib.mk from "../.." to "..". +m=gnulib-tests/gnulib.mk +sed 's,\.\./\.\.,..,g' $m > $m-t +mv -f $m-t $m + echo "$0: done. Now you can run './configure'." diff --git a/src/bin/coreutils/bootstrap.conf b/src/bin/coreutils/bootstrap.conf index 30433216d2..d8c7013c6e 100644 --- a/src/bin/coreutils/bootstrap.conf +++ b/src/bin/coreutils/bootstrap.conf @@ -1,11 +1,11 @@ # Bootstrap configuration. -# Copyright (C) 2006, 2007 Free Software Foundation, Inc. +# Copyright (C) 2006-2009 Free Software Foundation, Inc. -# This program is free software; you can redistribute it and/or modify +# This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,61 +13,232 @@ # GNU General Public License for more details. # You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -# 02110-1301, USA. +# along with this program. If not, see . -# We don't need these modules, even though gnulib-tool mistakenly -# includes them because of gettext and fchdir dependencies. +# We don't need these modules. avoided_gnulib_modules=' - --avoid=lock - --avoid=size_max - --avoid=xsize - --avoid=canonicalize-lgpl + --avoid=canonicalize-lgpl + --avoid=dummy + --avoid=lock ' # These modules are obsolete and can probably be removed soon, # but leave them in for now to minimize changes. obsolete_gnulib_modules=' - atexit free memchr memcmp memcpy memmove memset rename - strcspn strtod strtol utime + atexit + memchr + memcmp + memcpy + memmove + memset + rename + strcspn + strtod + strtol ' # gnulib modules used by this package. gnulib_modules=" - $avoided_gnulib_modules - $obsolete_gnulib_modules - acl alloca announce-gen argmatch assert backupfile base64 - c-strcase c-strtod - c-strtold calloc canon-host canonicalize chown cloexec - config-h configmake - closeout cycle-check d-ino d-type diacrit dirfd dirname dup2 - error euidaccess exclude exitfail fchdir fcntl fcntl-safer fdl - file-type fileblocks filemode filenamecat fnmatch-gnu - fopen-safer - fprintftime fsusage ftruncate fts getdate getgroups gethrxtime - getline getloadavg getndelim2 getopt getpagesize getpass-gnu - gettext gettime gettimeofday getugroups getusershell gnupload - group-member hard-locale hash hash-pjw host-os human idcache - inttostr inttypes isapipe - lchmod lchown lib-ignore linebuffer link-follow - long-options lstat malloc mbswidth md5 memcasecmp mempcpy - memrchr mkancesdirs mkdir mkdir-p mkstemp mktime modechange - mountlist mpsort obstack pathmax perl physmem posixtm posixver putenv - quote quotearg raise readlink readtokens readtokens0 readutmp - realloc regex rename-dest-slash rmdir rmdir-errno - root-dev-ino - rpmatch - safe-read same - save-cwd savedir savewd settime sha1 sig2str ssize_t stat-macros - stat-time stdbool stdlib-safer stpcpy strftime - strpbrk strtoimax strtoumax strverscmp sys_stat timespec tzset - unicodeio unistd-safer unlink-busy unlinkdir unlocked-io - uptime userspec utimecmp utimens vasprintf verify version-etc-fsf - wcwidth winsz-ioctl winsz-termios xalloc xgetcwd xgethostname - xmemcoll xnanosleep xreadlink xreadlink-with-size xstrtod xstrtoimax - xstrtol xstrtold xstrtoumax yesno + $avoided_gnulib_modules + $obsolete_gnulib_modules + acl + alloca + announce-gen + areadlink-with-size + argmatch + argv-iter + assert + autobuild + backupfile + base64 + c-strcase + c-strtod + c-strtold + calloc + canon-host + canonicalize + chown + cloexec + closein + closeout + config-h + configmake + crypto/md5 + crypto/sha1 + crypto/sha256 + crypto/sha512 + cycle-check + d-ino + d-type + diacrit + dirfd + dirname + dup2 + error + euidaccess + exclude + exitfail + fchdir + fcntl + fcntl-safer + fdl + file-type + fileblocks + filemode + filenamecat + filevercmp + fnmatch-gnu + fopen-safer + fprintftime + fseeko + fsusage + ftello + ftruncate + fts + gendocs + getdate + getgroups + gethrxtime + getline + getloadavg + getndelim2 + getopt + getpagesize + getpass-gnu + gettext + gettime + gettimeofday + getugroups + getusershell + git-version-gen + gitlog-to-changelog + gnu-make + gnumakefile + gnupload + group-member + hard-locale + hash + hash-pjw + host-os + human + idcache + ignore-value + inttostr + inttypes + isapipe + lchmod + lchown + lib-ignore + linebuffer + link-follow + long-options + lstat + maintainer-makefile + malloc + manywarnings + mbrtowc + mbsalign + mbswidth + memcasecmp + memcmp2 + mempcpy + memrchr + mgetgroups + mkancesdirs + mkdir + mkdir-p + mkstemp + mktime + modechange + mountlist + mpsort + obstack + pathmax + perl + physmem + posix-shell + posixtm + posixver + priv-set + progname + propername + putenv + quote + quotearg + raise + randint + randperm + readlink + readtokens + readtokens0 + readutmp + realloc + regex + rename-dest-slash + rmdir + rmdir-errno + root-dev-ino + rpmatch + safe-read + same + save-cwd + savedir + savewd + selinux-at + settime + sig2str + sigaction + ssize_t + stat-macros + stat-time + stdbool + stdlib-safer + stpcpy + stpncpy + strdup + strftime + strpbrk + strtoimax + strtoumax + strverscmp + sys_stat + timespec + tzset + unicodeio + unistd-safer + unlink-busy + unlinkdir + unlocked-io + uptime + useless-if-before-free + userspec + utimecmp + utimens + vasprintf-posix + vc-list-files + verify + verror + version-etc-fsf + warnings + wcwidth + winsz-ioctl + winsz-termios + write-any-file + xalloc + xfreopen + xgetcwd + xgethostname + xmemcoll + xnanosleep + xprintf + xprintf-posix + xstrtod + xstrtoimax + xstrtol + xstrtold + xstrtoumax + yesno " # Other locale categories that need message catalogs. @@ -75,10 +246,27 @@ EXTRA_LOCALE_CATEGORIES=LC_TIME # Additional xgettext options to use. Use "\\\newline" to break lines. XGETTEXT_OPTIONS=$XGETTEXT_OPTIONS'\\\ - --from-code=UTF-8\\\ - --flag=asprintf:2:c-format --flag=vasprintf:2:c-format\\\ - --flag=asnprintf:3:c-format --flag=vasnprintf:3:c-format\\\ + --flag=asnprintf:3:c-format\\\ + --flag=asprintf:2:c-format\\\ + --flag=error:3:c-format\\\ + --flag=error_at_line:5:c-format\\\ + --flag=vasnprintf:3:c-format\\\ + --flag=vasprintf:2:c-format\\\ + --flag=verror:3:c-format\\\ + --flag=verror_at_line:5:c-format\\\ --flag=wrapf:1:c-format\\\ + --flag=xasprintf:1:c-format\\\ + --flag=xfprintf:2:c-format\\\ + --flag=xprintf:1:c-format\\\ + --from-code=UTF-8\\\ +' + +# Append these, since we use the propername module. +see_manual='"This is a proper name. See the gettext manual, section Names."' +see_manual=\'"$see_manual"\' +XGETTEXT_OPTIONS=$XGETTEXT_OPTIONS'\\\ + --keyword=proper_name:1,'"$see_manual"'\\\ + --keyword=proper_name_utf8:1,'"$see_manual"'\\\ ' # If "AM_GNU_GETTEXT(external" or "AM_GNU_GETTEXT([external]" @@ -102,11 +290,29 @@ if test $gettext_external = 1; then m4/intdiv0.m4 m4/lcmessage.m4 m4/lock.m4 - m4/printf-posix.m4 - m4/size_max.m4 m4/uintmax_t.m4 m4/ulonglong.m4 m4/visibility.m4 - m4/xsize.m4 ' fi + +gnulib_tool_option_extras="--tests-base=$bt/gnulib-tests --with-tests" + +# Build prerequisites +buildreq="\ +autoconf 2.61 +automake 1.10b +autopoint - +bison - +gettext - +git 1.4.4 +gperf - +gzip - +makeinfo - +perl 5.5 +rsync - +tar - +" + +# Automake requires that ChangeLog exist. +touch ChangeLog diff --git a/src/bin/coreutils/configure b/src/bin/coreutils/configure index 889236099b..1d6fda6980 100755 --- a/src/bin/coreutils/configure +++ b/src/bin/coreutils/configure @@ -1,44 +1,38 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.61a for GNU coreutils 6.9. +# Generated by GNU Autoconf 2.63b.42-b26d5 for GNU coreutils 7.4. # # Report bugs to . # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software +# Foundation, Inc. +# # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. -## --------------------- ## -## M4sh Initialization. ## -## --------------------- ## +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; esac - fi - - -# PATH needs CR -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - as_nl=' ' export as_nl @@ -46,7 +40,13 @@ export as_nl as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else @@ -57,7 +57,7 @@ else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; - case $arg in + case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; @@ -73,22 +73,11 @@ fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh -fi - -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } fi @@ -100,15 +89,15 @@ fi IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. -case $0 in +case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done IFS=$as_save_IFS ;; @@ -120,31 +109,268 @@ if test "x$as_myself" = x; then fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - { (exit 1); exit 1; } + exit 1 fi -# Work around bugs in pre-3.0 UWIN ksh. -for as_var in ENV MAIL MAILPATH -do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - fi -done +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : + +else + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 +test \$(( 1 + 1 )) = 2 || exit 1" + if (eval "$as_required") 2>/dev/null; then : + as_have_required=yes +else + as_have_required=no +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + as_found=: + case $as_dir in #( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir/$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + CONFIG_SHELL=$as_shell as_have_required=yes + if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + break 2 +fi +fi + done;; + esac + as_found=false +done +$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi; } +IFS=$as_save_IFS + + + if test "x$CONFIG_SHELL" != x; then : + # We cannot yet assume a decent shell, so we have to provide a + # neutralization value for shells without unset; and this also + # works around shells that cannot unset nonexistent variables. + BASH_ENV=/dev/null + ENV=/dev/null + (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} +fi + + if test x$as_have_required = xno; then : + $as_echo "$0: This script requires a shell more modern than all" + $as_echo "$0: the shells that I found on your system." + if test x${ZSH_VERSION+set} = xset ; then + $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" + $as_echo "$0: be upgraded to zsh 4.3.4 or later." + else + $as_echo "$0: Please tell bug-autoconf@gnu.org and +$0: bug-coreutils@gnu.org about your system, including any +$0: error possibly output before this message. Then install +$0: a modern shell, or manually run the script under such a +$0: shell if you do have one." + fi + exit 1 +fi +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit [STATUS=$?] +# ---------------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + as_status=$? + set +e + as_fn_set_status ${1-$as_status} + exit ${1-$as_status} +} # as_fn_exit + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +# as_fn_error ERROR [LINENO LOG_FD] +# --------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with status $?, using 1 if that was 0. +as_fn_error () +{ + as_status=$?; test $as_status -eq 0 && as_status=1 + if test "$3"; then + as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3 + fi + $as_echo "$as_me: error: $1" >&2 + as_fn_exit $as_status +} # as_fn_error -# Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr @@ -158,8 +384,12 @@ else as_basename=false fi +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi -# Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ @@ -179,294 +409,19 @@ $as_echo X/"$0" | } s/.*/./; q'` -# CDPATH. -$as_unset CDPATH +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits -if test "x$CONFIG_SHELL" = x; then - if (eval ":") 2>/dev/null; then - as_have_required=yes -else - as_have_required=no -fi - - if test $as_have_required = yes && (eval ": -(as_func_return () { - (exit \$1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} - -exitcode=0 -if as_func_success; then - : -else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. -fi - -if as_func_ret_success; then - : -else - exitcode=1 - echo as_func_ret_success failed. -fi - -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. -fi - -if ( set x; as_func_ret_success y && test x = \"\$1\" ); then - : -else - exitcode=1 - echo positional parameters were not saved. -fi - -test \$exitcode = 0) || { (exit 1); exit 1; } - -( - as_lineno_1=\$LINENO - as_lineno_2=\$LINENO - test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && - test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } -") 2> /dev/null; then - : -else - as_candidate_shells= - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - case $as_dir in - /*) - for as_base in sh bash ksh sh5; do - as_candidate_shells="$as_candidate_shells $as_dir/$as_base" - done;; - esac -done -IFS=$as_save_IFS - - - for as_shell in $as_candidate_shells $SHELL; do - # Try only shells that exist, to save several forks. - if { test -f "$as_shell" || test -f "$as_shell.exe"; } && - { ("$as_shell") 2> /dev/null <<\_ASEOF -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; -esac - -fi - - -: -_ASEOF -}; then - CONFIG_SHELL=$as_shell - as_have_required=yes - if { "$as_shell" 2> /dev/null <<\_ASEOF -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; -esac - -fi - - -: -(as_func_return () { - (exit $1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} - -exitcode=0 -if as_func_success; then - : -else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. -fi - -if as_func_ret_success; then - : -else - exitcode=1 - echo as_func_ret_success failed. -fi - -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. -fi - -if ( set x; as_func_ret_success y && test x = "$1" ); then - : -else - exitcode=1 - echo positional parameters were not saved. -fi - -test $exitcode = 0) || { (exit 1); exit 1; } - -( - as_lineno_1=$LINENO - as_lineno_2=$LINENO - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } - -_ASEOF -}; then - break -fi - -fi - - done - - if test "x$CONFIG_SHELL" != x; then - for as_var in BASH_ENV ENV - do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - done - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} -fi - - - if test $as_have_required = no; then - echo This script requires a shell more modern than all the - echo shells that I found on your system. Please install a - echo modern shell, or manually run the script under such a - echo shell if you do have one. - { (exit 1); exit 1; } -fi - - -fi - -fi - - - -(eval "as_func_return () { - (exit \$1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} - -exitcode=0 -if as_func_success; then - : -else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. -fi - -if as_func_ret_success; then - : -else - exitcode=1 - echo as_func_ret_success failed. -fi - -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. -fi - -if ( set x; as_func_ret_success y && test x = \"\$1\" ); then - : -else - exitcode=1 - echo positional parameters were not saved. -fi - -test \$exitcode = 0") || { - echo No shell found that supports shell functions. - echo Please tell autoconf@gnu.org about your system, - echo including any error possibly output before this - echo message -} - - - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { - - # Create $as_me.lineno as a copy of $as_myself, but with $LINENO - # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line after each line using $LINENO; the second 'sed' - # does the real work. The second script uses 'N' to pair each - # line-number line with the line containing $LINENO, and appends - # trailing '-' during substitution so that $LINENO is not a special - # case at line end. - # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # scripts with optimization help from Paolo Bonzini. Blame Lee - # E. McMahon (1931-1989) for sed's syntax. :-) + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= @@ -483,8 +438,7 @@ test \$exitcode = 0") || { s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || - { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 - { (exit 1); exit 1; }; } + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the @@ -494,15 +448,8 @@ test \$exitcode = 0") || { exit } - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in +case `echo -n x` in #(((( -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. @@ -511,31 +458,28 @@ case `echo -n x` in *) ECHO_N='-n';; esac -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir - mkdir conf$$.dir + mkdir conf$$.dir 2>/dev/null fi -echo >conf$$.file -if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else as_ln_s='cp -p' -elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln + fi else as_ln_s='cp -p' fi @@ -543,7 +487,7 @@ rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then - as_mkdir_p=: + as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false @@ -560,12 +504,12 @@ else as_test_x=' eval sh -c '\'' if test -d "$1"; then - test -d "$1/."; + test -d "$1/."; else - case $1 in - -*)set "./$1";; + case $1 in #( + -*)set "./$1";; esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( ???[sx]*):;;*)false;;esac;fi '\'' sh ' @@ -579,7 +523,6 @@ as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - exec 7<&0 &1 # Name of the host. @@ -598,14 +541,14 @@ cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= -SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='GNU coreutils' PACKAGE_TARNAME='coreutils' -PACKAGE_VERSION='6.9' -PACKAGE_STRING='GNU coreutils 6.9' +PACKAGE_VERSION='7.4' +PACKAGE_STRING='GNU coreutils 7.4' PACKAGE_BUGREPORT='bug-coreutils@gnu.org' +PACKAGE_URL='http://www.gnu.org/software/coreutils/' ac_unique_file="src/ls.c" # Factoring default headers for most tests. @@ -646,303 +589,669 @@ ac_includes_default="\ ac_header_list= ac_func_list= +gl_fnmatch_required=POSIX gt_needs= -ac_subst_vars='SHELL -PATH_SEPARATOR -PACKAGE_NAME -PACKAGE_TARNAME -PACKAGE_VERSION -PACKAGE_STRING -PACKAGE_BUGREPORT -exec_prefix -prefix -program_transform_name -bindir -sbindir -libexecdir -datarootdir -datadir -sysconfdir -sharedstatedir -localstatedir -includedir -oldincludedir -docdir -infodir -htmldir -dvidir -pdfdir -psdir -libdir -localedir -mandir -DEFS -ECHO_C -ECHO_N -ECHO_T -LIBS -build_alias -host_alias -target_alias -build -build_cpu -build_vendor -build_os -host -host_cpu -host_vendor -host_os -INSTALL_PROGRAM -INSTALL_SCRIPT -INSTALL_DATA -am__isrc -CYGPATH_W -PACKAGE -VERSION -ACLOCAL -AUTOCONF -AUTOMAKE -AUTOHEADER -MAKEINFO -install_sh -STRIP -INSTALL_STRIP_PROGRAM -mkdir_p -AWK -SET_MAKE -am__leading_dot -AMTAR -am__tar -am__untar -CC -CFLAGS -LDFLAGS -CPPFLAGS -ac_ct_CC -EXEEXT -OBJEXT -DEPDIR -am__include -am__quote -AMDEP_TRUE -AMDEP_FALSE -AMDEPBACKSLASH -CCDEPMODE -am__fastdepCC_TRUE -am__fastdepCC_FALSE -CPP -GREP -EGREP -RANLIB -LN_S -GL_COND_LIBTOOL_TRUE -GL_COND_LIBTOOL_FALSE -LIB_ACL -LIB_ACL_TRIVIAL -ALLOCA -ALLOCA_H -ARPA_INET_H -GNULIB_CHOWN -GNULIB_DUP2 -GNULIB_FCHDIR -GNULIB_FTRUNCATE -GNULIB_GETCWD -GNULIB_GETLOGIN_R -GNULIB_READLINK -HAVE_DUP2 -HAVE_FTRUNCATE -HAVE_READLINK -HAVE_DECL_GETLOGIN_R -REPLACE_CHOWN -REPLACE_FCHDIR -REPLACE_GETCWD -LIB_CLOCK_GETTIME -LIB_EACCESS -ABSOLUTE_DIRENT_H -DIRENT_H -ABSOLUTE_FCNTL_H -FCNTL_H -FNMATCH_H -ABSOLUTE_SYS_SOCKET_H -HAVE_SYS_SOCKET_H -HAVE_WINSOCK2_H -HAVE_WS2TCPIP_H -SYS_SOCKET_H -STDBOOL_H -HAVE__BOOL -YACC -YFLAGS -LIB_GETHRXTIME -NEED_SETGID -KMEM_GROUP -GETLOADAVG_LIBS -GETOPT_H -ABSOLUTE_SYS_TIME_H -HAVE_SYS_TIME_H -HAVE_STRUCT_TIMEVAL -REPLACE_GETTIMEOFDAY -SYS_TIME_H -LIBICONV -LTLIBICONV -HAVE_LONG_LONG_INT -HAVE_UNSIGNED_LONG_LONG_INT -HAVE_INTTYPES_H -HAVE_SYS_TYPES_H -ABSOLUTE_STDINT_H -HAVE_STDINT_H -HAVE_SYS_INTTYPES_H -HAVE_SYS_BITYPES_H -BITSIZEOF_PTRDIFF_T -BITSIZEOF_SIG_ATOMIC_T -BITSIZEOF_SIZE_T -BITSIZEOF_WCHAR_T -BITSIZEOF_WINT_T -HAVE_SIGNED_SIG_ATOMIC_T -HAVE_SIGNED_WCHAR_T -HAVE_SIGNED_WINT_T -PTRDIFF_T_SUFFIX +ac_subst_vars='gltests_LTLIBOBJS +gltests_LIBOBJS +gl_LTLIBOBJS +gl_LIBOBJS +am__EXEEXT_FALSE +am__EXEEXT_TRUE +LTLIBOBJS +POSUB +INTLLIBS +INTL_MACOSX_LIBS +XGETTEXT_EXTRA_OPTIONS +MSGMERGE +XGETTEXT_015 +XGETTEXT +GMSGFMT_015 +MSGFMT_015 +GMSGFMT +MSGFMT +GETTEXT_MACRO_VERSION +USE_NLS +CONFIG_STATUS_DEPENDENCIES +CROSS_COMPILING_FALSE +CROSS_COMPILING_TRUE +NO_INSTALL_PROGS_DEFAULT +OPTIONAL_BIN_PROGS +INSTALL_SU +LIB_GMP +LIB_CRYPT +WERROR_CFLAGS +SEQ_LIBM +LIB_CAP +LIB_FDATASYNC +LIB_XATTR +LIBOBJS +ANSI2KNR +U +MAN +HELP2MAN +LIBTESTS_LIBDEPS +LIBCOREUTILS_LTLIBDEPS +LIBCOREUTILS_LIBDEPS +abs_aux_dir +NEXT_SYS_IOCTL_H +HAVE_SYS_IOCTL_H +LIBSOCKET +LOCALE_TR_UTF8 +REPLACE_ISWCNTRL +WCTYPE_H +HAVE_WCTYPE_H +NEXT_WCTYPE_H +HAVE_ISWCNTRL +NEXT_WCHAR_H +HAVE_WCHAR_H +HAVE_WINT_T +WARN_CFLAGS +HAVE_UNISTD_H +NEXT_UNISTD_H +SYS_TIME_H_DEFINES_STRUCT_TIMESPEC +TIME_H_DEFINES_STRUCT_TIMESPEC +NEXT_TIME_H +SYS_STAT_H +NEXT_SYS_STAT_H +HAVE_LSTAT +POW_LIB +NEXT_STRING_H +HAVE_RANDOM_H +NEXT_STDLIB_H +NEXT_STDIO_H +NEXT_STDARG_H +STDARG_H +NEXT_SIGNAL_H +HAVE_TYPE_VOLATILE_SIG_ATOMIC_T +HAVE_STRUCT_SIGACTION_SA_SIGACTION +HAVE_SIGACTION +HAVE_SIGINFO_T +HAVE_SIGSET_T +HAVE_POSIX_SIGNALBLOCKING +GNULIB_SIGACTION +GNULIB_SIGPROCMASK +GNULIB_SIGNAL_H_SIGPIPE +SELINUX_CONTEXT_H +SELINUX_SELINUX_H +LIB_SELINUX +SYS_SELECT_H +HAVE_SYS_SELECT_H +NEXT_SYS_SELECT_H +REPLACE_SELECT +GNULIB_SELECT +DEFAULT_POSIX2_VERSION +PREFERABLY_POSIX_SHELL +POSIX_SHELL +PERL +NETINET_IN_H +HAVE_NETINET_IN_H +NEXT_NETINET_IN_H +LIB_NANOSLEEP +REPLACE_TIMEGM +REPLACE_STRPTIME +REPLACE_NANOSLEEP +REPLACE_LOCALTIME_R +REPLACE_STRSIGNAL +REPLACE_STRERROR +REPLACE_STRCASESTR +REPLACE_STRSTR +REPLACE_STRDUP +REPLACE_MEMMEM +HAVE_STRVERSCMP +HAVE_DECL_STRSIGNAL +HAVE_DECL_STRERROR +HAVE_DECL_STRTOK_R +HAVE_STRCASESTR +HAVE_STRSEP +HAVE_STRPBRK +HAVE_DECL_STRNLEN +HAVE_DECL_STRNDUP +HAVE_STRNDUP +HAVE_DECL_STRDUP +HAVE_STRCHRNUL +HAVE_STPNCPY +HAVE_STPCPY +HAVE_RAWMEMCHR +HAVE_DECL_MEMRCHR +HAVE_MEMPCPY +HAVE_DECL_MEMMEM +GNULIB_STRVERSCMP +GNULIB_STRSIGNAL +GNULIB_STRERROR +GNULIB_MBSTOK_R +GNULIB_MBSSEP +GNULIB_MBSSPN +GNULIB_MBSPBRK +GNULIB_MBSCSPN +GNULIB_MBSCASESTR +GNULIB_MBSPCASECMP +GNULIB_MBSNCASECMP +GNULIB_MBSCASECMP +GNULIB_MBSSTR +GNULIB_MBSRCHR +GNULIB_MBSCHR +GNULIB_MBSNLEN +GNULIB_MBSLEN +GNULIB_STRTOK_R +GNULIB_STRCASESTR +GNULIB_STRSTR +GNULIB_STRSEP +GNULIB_STRPBRK +GNULIB_STRNLEN +GNULIB_STRNDUP +GNULIB_STRDUP +GNULIB_STRCHRNUL +GNULIB_STPNCPY +GNULIB_STPCPY +GNULIB_RAWMEMCHR +GNULIB_MEMRCHR +GNULIB_MEMPCPY +GNULIB_MEMMEM +LOCALE_FR_UTF8 +LOCALE_ZH_CN +LOCALE_JA +NEXT_MATH_H +LOCALCHARSET_TESTS_ENVIRONMENT +GLIBC21 +REPLACE_MKDIR +REPLACE_LSTAT +HAVE_LCHMOD +GNULIB_LSTAT +GNULIB_LCHMOD +INTTYPES_H +UINT64_MAX_EQ_ULONG_MAX +UINT32_MAX_LT_UINTMAX_MAX +INT64_MAX_EQ_LONG_MAX +INT32_MAX_LT_INTMAX_MAX +PRIPTR_PREFIX +NEXT_INTTYPES_H +HAVE_DECL_STRTOUMAX +HAVE_DECL_STRTOIMAX +HAVE_DECL_IMAXDIV +HAVE_DECL_IMAXABS +GNULIB_STRTOUMAX +GNULIB_STRTOIMAX +GNULIB_IMAXDIV +GNULIB_IMAXABS +PRI_MACROS_BROKEN +STDINT_H +WINT_T_SUFFIX +WCHAR_T_SUFFIX SIG_ATOMIC_T_SUFFIX SIZE_T_SUFFIX -WCHAR_T_SUFFIX -WINT_T_SUFFIX -STDINT_H -PRI_MACROS_BROKEN -GNULIB_IMAXABS -GNULIB_IMAXDIV -GNULIB_STRTOIMAX -GNULIB_STRTOUMAX -HAVE_DECL_IMAXABS -HAVE_DECL_IMAXDIV -HAVE_DECL_STRTOIMAX -HAVE_DECL_STRTOUMAX -ABSOLUTE_INTTYPES_H -PRIPTR_PREFIX -INTTYPES_H -GLIBC21 -GNULIB_MEMMEM -GNULIB_MEMPCPY -GNULIB_MEMRCHR -GNULIB_STPCPY -GNULIB_STPNCPY -GNULIB_STRCHRNUL -GNULIB_STRDUP -GNULIB_STRNDUP -GNULIB_STRNLEN -GNULIB_STRPBRK -GNULIB_STRSEP -GNULIB_STRCASESTR -GNULIB_STRTOK_R -GNULIB_MBSLEN -GNULIB_MBSCHR -GNULIB_MBSRCHR -GNULIB_MBSSTR -GNULIB_MBSCASECMP -GNULIB_MBSNCASECMP -GNULIB_MBSPCASECMP -GNULIB_MBSCASESTR -GNULIB_MBSCSPN -GNULIB_MBSPBRK -GNULIB_MBSSPN -GNULIB_MBSSEP -GNULIB_MBSTOK_R -HAVE_DECL_MEMMEM -HAVE_MEMPCPY -HAVE_DECL_MEMRCHR -HAVE_STPCPY -HAVE_STPNCPY -HAVE_STRCASECMP -HAVE_DECL_STRNCASECMP -HAVE_STRCHRNUL -HAVE_DECL_STRDUP -HAVE_STRNDUP -HAVE_DECL_STRNDUP -HAVE_DECL_STRNLEN -HAVE_STRPBRK -HAVE_STRSEP -HAVE_STRCASESTR -HAVE_DECL_STRTOK_R -GNULIB_GETSUBOPT -GNULIB_MKDTEMP -GNULIB_MKSTEMP -HAVE_GETSUBOPT -HAVE_MKDTEMP -REPLACE_MKSTEMP -REPLACE_LOCALTIME_R -REPLACE_NANOSLEEP -REPLACE_STRPTIME -REPLACE_TIMEGM -LIB_NANOSLEEP -ABSOLUTE_NETINET_IN_H -HAVE_NETINET_IN_H -NETINET_IN_H -PERL -DEFAULT_POSIX2_VERSION -GNULIB_FPRINTF_POSIX -GNULIB_PRINTF_POSIX -GNULIB_SNPRINTF -GNULIB_SPRINTF_POSIX -GNULIB_VFPRINTF_POSIX -GNULIB_VPRINTF_POSIX -GNULIB_VSNPRINTF -GNULIB_VSPRINTF_POSIX -REPLACE_FPRINTF -REPLACE_VFPRINTF -REPLACE_PRINTF -REPLACE_VPRINTF -REPLACE_SNPRINTF -HAVE_DECL_SNPRINTF -REPLACE_VSNPRINTF -HAVE_DECL_VSNPRINTF -REPLACE_SPRINTF -REPLACE_VSPRINTF -ABSOLUTE_STDIO_H -ABSOLUTE_STDLIB_H -ABSOLUTE_STRING_H -POW_LIB -ABSOLUTE_SYS_STAT_H -SYS_STAT_H -ABSOLUTE_TIME_H -TIME_H_DEFINES_STRUCT_TIMESPEC -SYS_TIME_H_DEFINES_STRUCT_TIMESPEC -HAVE_UNISTD_H -ABSOLUTE_UNISTD_H -EOVERFLOW -ABSOLUTE_WCHAR_H -WCHAR_H -HAVE_WINT_T -ABSOLUTE_WCTYPE_H -HAVE_WCTYPE_H -WCTYPE_H -LIBCOREUTILS_LIBDEPS -LIBCOREUTILS_LTLIBDEPS -GNU_PACKAGE -HELP2MAN -OPTIONAL_BIN_PROGS -MAN -DF_PROG -U -ANSI2KNR -LIBOBJS -LIB_FDATASYNC -SEQ_LIBM -LIB_CRYPT -USE_NLS -MSGFMT -GMSGFMT -MSGFMT_015 -GMSGFMT_015 -XGETTEXT -XGETTEXT_015 -MSGMERGE -INTL_MACOSX_LIBS -INTLLIBS -LIBINTL +PTRDIFF_T_SUFFIX +HAVE_SIGNED_WINT_T +HAVE_SIGNED_WCHAR_T +HAVE_SIGNED_SIG_ATOMIC_T +BITSIZEOF_WINT_T +BITSIZEOF_WCHAR_T +BITSIZEOF_SIG_ATOMIC_T +BITSIZEOF_SIZE_T +BITSIZEOF_PTRDIFF_T +APPLE_UNIVERSAL_BUILD +HAVE_SYS_BITYPES_H +HAVE_SYS_INTTYPES_H +HAVE_STDINT_H +NEXT_STDINT_H +HAVE_SYS_TYPES_H +HAVE_INTTYPES_H +HAVE_UNSIGNED_LONG_LONG_INT +HAVE_LONG_LONG_INT +NEXT_ICONV_H +ICONV_H +REPLACE_ICONV_UTF +REPLACE_ICONV_OPEN +REPLACE_ICONV +LTLIBICONV +LIBICONV +GNU_MAKE_FALSE +GNU_MAKE_TRUE +SYS_TIME_H +REPLACE_GETTIMEOFDAY +HAVE_STRUCT_TIMEVAL +HAVE_SYS_TIME_H +NEXT_SYS_TIME_H LTLIBINTL -POSUB -LTLIBOBJS -gl_LIBOBJS -gl_LTLIBOBJS' +LIBINTL +GETOPT_H +GETLOADAVG_LIBS +KMEM_GROUP +NEED_SETGID +LIB_GETHRXTIME +YFLAGS +YACC +HAVE__BOOL +STDBOOL_H +GETADDRINFO_LIB +SERVENT_LIB +HOSTENT_LIB +NETDB_H +HAVE_NETDB_H +NEXT_NETDB_H +HAVE_DECL_GETNAMEINFO +HAVE_DECL_GETADDRINFO +HAVE_DECL_GAI_STRERROR +HAVE_DECL_FREEADDRINFO +HAVE_STRUCT_ADDRINFO +GNULIB_GETADDRINFO +SYS_SOCKET_H +HAVE_WS2TCPIP_H +HAVE_SYS_SOCKET_H +NEXT_SYS_SOCKET_H +GNULIB_SHUTDOWN +GNULIB_SETSOCKOPT +GNULIB_SENDTO +GNULIB_RECVFROM +GNULIB_SEND +GNULIB_RECV +GNULIB_LISTEN +GNULIB_GETSOCKOPT +GNULIB_GETSOCKNAME +GNULIB_GETPEERNAME +GNULIB_BIND +GNULIB_ACCEPT +GNULIB_CONNECT +GNULIB_SOCKET +REPLACE_TRUNCL +REPLACE_SIGNBIT_USING_GCC +REPLACE_SIGNBIT +REPLACE_ROUNDL +REPLACE_ROUNDF +REPLACE_ROUND +REPLACE_NAN +REPLACE_LDEXPL +REPLACE_ISNAN +REPLACE_ISINF +REPLACE_ISFINITE +REPLACE_HUGE_VAL +REPLACE_FREXPL +REPLACE_FREXP +REPLACE_FLOORL +REPLACE_FLOORF +REPLACE_CEILL +REPLACE_CEILF +HAVE_DECL_TRUNCF +HAVE_DECL_TRUNC +HAVE_DECL_TANL +HAVE_DECL_SQRTL +HAVE_DECL_SINL +HAVE_DECL_LOGL +HAVE_DECL_LDEXPL +HAVE_DECL_FREXPL +HAVE_DECL_EXPL +HAVE_DECL_COSL +HAVE_DECL_ATANL +HAVE_DECL_ASINL +HAVE_DECL_ACOSL +HAVE_ISNANL +HAVE_ISNAND +HAVE_ISNANF +GNULIB_TRUNCL +GNULIB_TRUNCF +GNULIB_TRUNC +GNULIB_SIGNBIT +GNULIB_ROUNDL +GNULIB_ROUNDF +GNULIB_ROUND +GNULIB_MATHL +GNULIB_LDEXPL +GNULIB_ISNANL +GNULIB_ISNAND +GNULIB_ISNANF +GNULIB_ISNAN +GNULIB_ISINF +GNULIB_ISFINITE +GNULIB_FREXPL +GNULIB_FREXP +GNULIB_FLOORL +GNULIB_FLOORF +GNULIB_CEILL +GNULIB_CEILF +FNMATCH_H +FLOAT_H +NEXT_FLOAT_H +FCNTL_H +NEXT_FCNTL_H +REPLACE_OPEN +GNULIB_OPEN +LIB_EACCESS +EOVERFLOW_VALUE +EOVERFLOW_HIDDEN +ENOLINK_VALUE +ENOLINK_HIDDEN +EMULTIHOP_VALUE +EMULTIHOP_HIDDEN +ERRNO_H +NEXT_ERRNO_H +NEXT_DIRENT_H +DIRENT_H +HAVE_ALPHASORT +HAVE_SCANDIR +HAVE_DECL_DIRFD +GNULIB_ALPHASORT +GNULIB_SCANDIR +GNULIB_DIRFD +REPLACE_PERROR +REPLACE_GETLINE +HAVE_DECL_GETLINE +HAVE_DECL_GETDELIM +REPLACE_FCLOSE +REPLACE_FFLUSH +REPLACE_FTELL +REPLACE_FTELLO +HAVE_FTELLO +REPLACE_FSEEK +REPLACE_FSEEKO +HAVE_FSEEKO +REPLACE_FREOPEN +REPLACE_FOPEN +REPLACE_OBSTACK_PRINTF +HAVE_DECL_OBSTACK_PRINTF +REPLACE_VASPRINTF +HAVE_VASPRINTF +REPLACE_VDPRINTF +HAVE_VDPRINTF +REPLACE_DPRINTF +HAVE_DPRINTF +REPLACE_VSPRINTF +REPLACE_SPRINTF +HAVE_DECL_VSNPRINTF +REPLACE_VSNPRINTF +HAVE_DECL_SNPRINTF +REPLACE_SNPRINTF +REPLACE_VPRINTF +REPLACE_PRINTF +REPLACE_VFPRINTF +REPLACE_FPRINTF +REPLACE_STDIO_WRITE_FUNCS +GNULIB_STDIO_H_SIGPIPE +GNULIB_PERROR +GNULIB_GETLINE +GNULIB_GETDELIM +GNULIB_FWRITE +GNULIB_PUTS +GNULIB_FPUTS +GNULIB_PUTCHAR +GNULIB_PUTC +GNULIB_FPUTC +GNULIB_FCLOSE +GNULIB_FFLUSH +GNULIB_FTELLO +GNULIB_FTELL +GNULIB_FSEEKO +GNULIB_FSEEK +GNULIB_FREOPEN +GNULIB_FOPEN +GNULIB_OBSTACK_PRINTF_POSIX +GNULIB_OBSTACK_PRINTF +GNULIB_VASPRINTF +GNULIB_VDPRINTF +GNULIB_DPRINTF +GNULIB_VSPRINTF_POSIX +GNULIB_VSNPRINTF +GNULIB_VPRINTF_POSIX +GNULIB_VPRINTF +GNULIB_VFPRINTF_POSIX +GNULIB_VFPRINTF +GNULIB_SPRINTF_POSIX +GNULIB_SNPRINTF +GNULIB_PRINTF_POSIX +GNULIB_PRINTF +GNULIB_FPRINTF_POSIX +GNULIB_FPRINTF +HAVE_WINSOCK2_H +SYS_IOCTL_H +SYS_IOCTL_H_HAVE_WINSOCK2_H +GNULIB_IOCTL +LIB_CLOCK_GETTIME +UNISTD_H_HAVE_WINSOCK2_H +REPLACE_WRITE +REPLACE_LSEEK +REPLACE_LCHOWN +REPLACE_GETPAGESIZE +REPLACE_GETCWD +REPLACE_FCHDIR +REPLACE_CLOSE +REPLACE_CHOWN +HAVE_SYS_PARAM_H +HAVE_OS_H +HAVE_DECL_GETLOGIN_R +HAVE_DECL_ENVIRON +HAVE_SLEEP +HAVE_READLINK +HAVE_LINK +HAVE_GETUSERSHELL +HAVE_GETPAGESIZE +HAVE_GETHOSTNAME +HAVE_GETDTABLESIZE +HAVE_GETDOMAINNAME +HAVE_FTRUNCATE +HAVE_FSYNC +HAVE_EUIDACCESS +HAVE_DUP2 +GNULIB_WRITE +GNULIB_UNISTD_H_SIGPIPE +GNULIB_SLEEP +GNULIB_READLINK +GNULIB_LSEEK +GNULIB_LINK +GNULIB_LCHOWN +GNULIB_GETUSERSHELL +GNULIB_GETPAGESIZE +GNULIB_GETLOGIN_R +GNULIB_GETHOSTNAME +GNULIB_GETDTABLESIZE +GNULIB_GETDOMAINNAME +GNULIB_GETCWD +GNULIB_FTRUNCATE +GNULIB_FSYNC +GNULIB_FCHDIR +GNULIB_EUIDACCESS +GNULIB_ENVIRON +GNULIB_DUP2 +GNULIB_CLOSE +GNULIB_CHOWN +VOID_UNSETENV +REPLACE_STRTOD +REPLACE_PUTENV +REPLACE_MKSTEMP +HAVE_DECL_GETLOADAVG +HAVE_UNSETENV +HAVE_SYS_LOADAVG_H +HAVE_STRUCT_RANDOM_DATA +HAVE_STRTOULL +HAVE_STRTOLL +HAVE_STRTOD +HAVE_SETENV +HAVE_RPMATCH +HAVE_RANDOM_R +HAVE_REALLOC_POSIX +HAVE_MKDTEMP +HAVE_MALLOC_POSIX +HAVE_GETSUBOPT +HAVE_ATOLL +GNULIB_UNSETENV +GNULIB_STRTOULL +GNULIB_STRTOLL +GNULIB_STRTOD +GNULIB_SETENV +GNULIB_RPMATCH +GNULIB_RANDOM_R +GNULIB_PUTENV +GNULIB_MKSTEMP +GNULIB_MKDTEMP +GNULIB_GETSUBOPT +GNULIB_GETLOADAVG +GNULIB_ATOLL +GNULIB_CALLOC_POSIX +GNULIB_REALLOC_POSIX +GNULIB_MALLOC_POSIX +HAVE_CALLOC_POSIX +LOCALE_FR +WCHAR_H +REPLACE_WCWIDTH +REPLACE_WCSNRTOMBS +REPLACE_WCSRTOMBS +REPLACE_WCRTOMB +REPLACE_MBSNRTOWCS +REPLACE_MBSRTOWCS +REPLACE_MBRLEN +REPLACE_MBRTOWC +REPLACE_MBSINIT +REPLACE_WCTOB +REPLACE_BTOWC +REPLACE_MBSTATE_T +HAVE_DECL_WCWIDTH +HAVE_DECL_WCTOB +HAVE_WCSNRTOMBS +HAVE_WCSRTOMBS +HAVE_WCRTOMB +HAVE_MBSNRTOWCS +HAVE_MBSRTOWCS +HAVE_MBRLEN +HAVE_MBRTOWC +HAVE_MBSINIT +HAVE_BTOWC +GNULIB_WCWIDTH +GNULIB_WCSNRTOMBS +GNULIB_WCSRTOMBS +GNULIB_WCRTOMB +GNULIB_MBSNRTOWCS +GNULIB_MBSRTOWCS +GNULIB_MBRLEN +GNULIB_MBRTOWC +GNULIB_MBSINIT +GNULIB_WCTOB +GNULIB_BTOWC +NEXT_ARPA_INET_H +PRAGMA_SYSTEM_HEADER +INCLUDE_NEXT_AS_FIRST_DIRECTIVE +INCLUDE_NEXT +HAVE_ARPA_INET_H +ARPA_INET_H +HAVE_DECL_INET_PTON +HAVE_DECL_INET_NTOP +GNULIB_INET_PTON +GNULIB_INET_NTOP +ALLOCA_H +ALLOCA +USE_ACL +LIB_ACL +GL_COND_LIBTOOL_FALSE +GL_COND_LIBTOOL_TRUE +host_os +host_vendor +host_cpu +host +build_os +build_vendor +build_cpu +build +LN_S +RANLIB +EGREP +GREP +CPP +am__fastdepCC_FALSE +am__fastdepCC_TRUE +CCDEPMODE +AMDEPBACKSLASH +AMDEP_FALSE +AMDEP_TRUE +am__quote +am__include +DEPDIR +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +AM_BACKSLASH +AM_DEFAULT_VERBOSITY +am__untar +am__tar +AMTAR +am__leading_dot +SET_MAKE +AWK +mkdir_p +MKDIR_P +INSTALL_STRIP_PROGRAM +STRIP +install_sh +MAKEINFO +AUTOHEADER +AUTOMAKE +AUTOCONF +ACLOCAL +VERSION +PACKAGE +CYGPATH_W +am__isrc +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_URL +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL' ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_silent_rules +enable_dependency_tracking +enable_acl +enable_assert +with_gnu_ld +enable_rpath +with_libiconv_prefix +enable_largefile +with_included_regex +enable_xattr +enable_libcap +enable_gcc_warnings +with_gmp +enable_install_program +enable_no_install_program +enable_nls +with_libintl_prefix +' ac_precious_vars='build_alias host_alias target_alias @@ -960,6 +1269,8 @@ DEFAULT_POSIX2_VERSION' # Initialize some variables set by options. ac_init_help= ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null @@ -1060,10 +1371,17 @@ do -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-._$as_cr_alnum]" >/dev/null && - { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 - { (exit 1); exit 1; }; } - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-.]/_/g'` + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) @@ -1079,10 +1397,17 @@ do -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-._$as_cr_alnum]" >/dev/null && - { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 - { (exit 1); exit 1; }; } - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-.]/_/g'` + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ @@ -1276,19 +1601,33 @@ do -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-._$as_cr_alnum]" >/dev/null && - { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 - { (exit 1); exit 1; }; } - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-.]/_/g'` + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-._$as_cr_alnum]" >/dev/null && - { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 - { (exit 1); exit 1; }; } - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-.]/_/g'` + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac eval with_$ac_useropt=no ;; --x) @@ -1309,17 +1648,17 @@ do | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; - -*) { $as_echo "$as_me: error: unrecognized option: $ac_option -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; } + -*) as_fn_error "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information." ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. - expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && - { $as_echo "$as_me: error: invalid variable name: $ac_envvar" >&2 - { (exit 1); exit 1; }; } + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error "invalid variable name: \`$ac_envvar'" ;; + esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; @@ -1336,23 +1675,36 @@ done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` - { $as_echo "$as_me: error: missing argument to $ac_option" >&2 - { (exit 1); exit 1; }; } + as_fn_error "missing argument to $ac_option" fi -# Be sure to have absolute directory names. +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) as_fn_error "unrecognized options: $ac_unrecognized_opts" ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac - { $as_echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; } + as_fn_error "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' @@ -1382,23 +1734,21 @@ test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || - { $as_echo "$as_me: error: Working directory cannot be determined" >&2 - { (exit 1); exit 1; }; } + as_fn_error "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || - { $as_echo "$as_me: error: pwd does not report name of working directory" >&2 - { (exit 1); exit 1; }; } + as_fn_error "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. - ac_confdir=`$as_dirname -- "$0" || -$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$0" : 'X\(//\)[^/]' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$0" | + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -1425,13 +1775,11 @@ else fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." - { $as_echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 - { (exit 1); exit 1; }; } + as_fn_error "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( - cd "$srcdir" && test -r "./$ac_unique_file" || { $as_echo "$as_me: error: $ac_msg" >&2 - { (exit 1); exit 1; }; } + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then @@ -1457,7 +1805,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures GNU coreutils 6.9 to adapt to many kinds of systems. +\`configure' configures GNU coreutils 7.4 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1479,9 +1827,9 @@ Configuration: Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] + [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [PREFIX] + [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify @@ -1491,25 +1839,25 @@ for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: - --bindir=DIR user executables [EPREFIX/bin] - --sbindir=DIR system admin executables [EPREFIX/sbin] - --libexecdir=DIR program executables [EPREFIX/libexec] - --sysconfdir=DIR read-only single-machine data [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] - --localstatedir=DIR modifiable single-machine data [PREFIX/var] - --libdir=DIR object code libraries [EPREFIX/lib] - --includedir=DIR C header files [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc [/usr/include] - --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] - --datadir=DIR read-only architecture-independent data [DATAROOTDIR] - --infodir=DIR info documentation [DATAROOTDIR/info] - --localedir=DIR locale-dependent data [DATAROOTDIR/locale] - --mandir=DIR man documentation [DATAROOTDIR/man] - --docdir=DIR documentation root [DATAROOTDIR/doc/coreutils] - --htmldir=DIR html documentation [DOCDIR] - --dvidir=DIR dvi documentation [DOCDIR] - --pdfdir=DIR pdf documentation [DOCDIR] - --psdir=DIR ps documentation [DOCDIR] + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/coreutils] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF @@ -1527,18 +1875,31 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of GNU coreutils 6.9:";; + short | recursive ) echo "Configuration of GNU coreutils 7.4:";; esac cat <<\_ACEOF Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-silent-rules less verbose build output (undo: `make V=1') + --disable-silent-rules verbose build output (undo: `make V=0') --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors + --disable-acl do not support ACLs --disable-assert turn off assertions --disable-rpath do not hardcode runtime library paths --disable-largefile omit support for large files + --disable-xattr do not support extended attributes + --disable-libcap disable libcap support + --enable-gcc-warnings turn on lots of GCC warnings (for developers) + --enable-install-program=PROG_LIST + install the programs in PROG_LIST (comma-separated, + default: none) + --enable-no-install-program=PROG_LIST + do NOT install the programs in PROG_LIST + (comma-separated, default: arch,hostname,su) --disable-nls do not use Native Language Support Optional Packages: @@ -1548,12 +1909,11 @@ Optional Packages: --with-libiconv-prefix[=DIR] search for libiconv in DIR/include and DIR/lib --without-libiconv-prefix don't search for libiconv in includedir and libdir --without-included-regex - don't compile regex; this is the default on 32-bit - systems with recent-enough versions of the GNU C - Library (use with caution on other systems). On - systems with 64-bit ptrdiff_t and 32-bit int, - --with-included-regex is the default, in case regex - functions operate on very long strings (>2GB) + don't compile regex; this is the default on systems + with recent-enough versions of the GNU C Library + (use with caution on other systems). + --without-gmp do not use the GNU MP library for arbitrary + precision calculation (default: use it if available) --with-libintl-prefix[=DIR] search for libintl in DIR/include and DIR/lib --without-libintl-prefix don't search for libintl in includedir and libdir @@ -1580,6 +1940,8 @@ Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . +GNU coreutils home page: . +General help using GNU software: . _ACEOF ac_status=$? fi @@ -1587,15 +1949,17 @@ fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d "$ac_dir" || continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's,^\.[\\/],,'` + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; @@ -1640,22 +2004,707 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -GNU coreutils configure 6.9 -generated by GNU Autoconf 2.61a +GNU coreutils configure 7.4 +generated by GNU Autoconf 2.63b.42-b26d5 -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +Copyright (C) 2009 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi + +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## + +# ac_fn_c_try_compile LINENO +# -------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + return $ac_retval + +} # ac_fn_c_try_compile + +# ac_fn_c_try_cpp LINENO +# ---------------------- +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + return $ac_retval + +} # ac_fn_c_try_cpp + +# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists, giving a warning if it cannot be compiled using +# the include files in INCLUDES and setting the cache variable VAR +# accordingly. +ac_fn_c_check_header_mongrel () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 +$as_echo_n "checking $2 usability... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_header_compiler=yes +else + ac_header_compiler=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 +$as_echo_n "checking $2 presence... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <$2> +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + ac_header_preproc=yes +else + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( + yes:no: ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; + no:yes:* ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} +( cat <<\_ASBOX +## ------------------------------------ ## +## Report this to bug-coreutils@gnu.org ## +## ------------------------------------ ## +_ASBOX + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=\$ac_header_compiler" +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +fi + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + +} # ac_fn_c_check_header_mongrel + +# ac_fn_c_try_run LINENO +# ---------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes +# that executables *can* be run. +ac_fn_c_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then : + ac_retval=0 +else + $as_echo "$as_me: program exited with status $ac_status" >&5 + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + return $ac_retval + +} # ac_fn_c_try_run + +# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists and can be compiled using the include files in +# INCLUDES, setting the cache variable VAR accordingly. +ac_fn_c_check_header_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + +} # ac_fn_c_check_header_compile + +# ac_fn_c_try_link LINENO +# ----------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + return $ac_retval + +} # ac_fn_c_try_link + +# ac_fn_c_check_func LINENO FUNC VAR +# ---------------------------------- +# Tests whether FUNC exists, setting the cache variable VAR accordingly +ac_fn_c_check_func () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Define $2 to an innocuous variant, in case declares $2. + For example, HP-UX 11i declares gettimeofday. */ +#define $2 innocuous_$2 + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $2 (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $2 + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $2 (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$2 || defined __stub___$2 +choke me +#endif + +int +main () +{ +return $2 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + +} # ac_fn_c_check_func + +# ac_fn_c_check_type LINENO TYPE VAR INCLUDES +# ------------------------------------------- +# Tests whether TYPE exists after having included INCLUDES, setting cache +# variable VAR accordingly. +ac_fn_c_check_type () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=no" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof ($2)) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof (($2))) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + eval "$3=yes" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + +} # ac_fn_c_check_type + +# ac_fn_c_check_decl LINENO SYMBOL VAR +# ------------------------------------ +# Tests whether SYMBOL is declared, setting cache variable VAR accordingly. +ac_fn_c_check_decl () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $2 is declared" >&5 +$as_echo_n "checking whether $2 is declared... " >&6; } +if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +#ifndef $2 + (void) $2; +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + +} # ac_fn_c_check_decl + +# ac_fn_c_compute_int LINENO EXPR VAR INCLUDES +# -------------------------------------------- +# Tries to find the compile-time value of EXPR in a program that includes +# INCLUDES, setting VAR accordingly. Returns whether the value could be +# computed +ac_fn_c_compute_int () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) >= 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_lo=0 ac_mid=0 + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_hi=$ac_mid; break +else + as_fn_arith $ac_mid + 1 && ac_lo=$as_val + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) < 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_hi=-1 ac_mid=-1 + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) >= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_lo=$ac_mid; break +else + as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + ac_lo= ac_hi= +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_hi=$ac_mid +else + as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in #(( +?*) eval "$3=\$ac_lo"; ac_retval=0 ;; +'') ac_retval=1 ;; +esac + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +static long int longval () { return $2; } +static unsigned long int ulongval () { return $2; } +#include +#include +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + return 1; + if (($2) < 0) + { + long int i = longval (); + if (i != ($2)) + return 1; + fprintf (f, "%ld", i); + } + else + { + unsigned long int i = ulongval (); + if (i != ($2)) + return 1; + fprintf (f, "%lu", i); + } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + echo >>conftest.val; read $3 &5 +$as_echo_n "checking for $2.$3... " >&6; } +if { as_var=$4; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$5 +int +main () +{ +static $2 ac_aggr; +if (ac_aggr.$3) +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$4=yes" +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$5 +int +main () +{ +static $2 ac_aggr; +if (sizeof ac_aggr.$3) +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$4=yes" +else + eval "$4=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$4 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + +} # ac_fn_c_check_member cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by GNU coreutils $as_me 6.9, which was -generated by GNU Autoconf 2.61a. Invocation command line was +It was created by GNU coreutils $as_me 7.4, which was +generated by GNU Autoconf 2.63b.42-b26d5. Invocation command line was $ $0 $@ @@ -1691,8 +2740,8 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - $as_echo "PATH: $as_dir" -done + $as_echo "PATH: $as_dir" + done IFS=$as_save_IFS } >&5 @@ -1729,9 +2778,9 @@ do ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in - 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) - ac_configure_args1="$ac_configure_args1 '$ac_arg'" + as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else @@ -1747,13 +2796,13 @@ do -* ) ac_must_keep_next=true ;; esac fi - ac_configure_args="$ac_configure_args '$ac_arg'" + as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done -$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } -$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there @@ -1778,13 +2827,13 @@ _ASBOX case $ac_val in #( *${as_nl}*) case $ac_var in #( - *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 -$as_echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) $as_unset $ac_var ;; + *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done @@ -1856,55 +2905,60 @@ _ASBOX exit $exit_status ' 0 for ac_signal in 1 2 13 15; do - trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h +$as_echo "/* confdefs.h */" > confdefs.h + # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF - cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF - cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF - cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF - cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF +cat >>confdefs.h <<_ACEOF +#define PACKAGE_URL "$PACKAGE_URL" +_ACEOF + # Let the site file select an alternate cache file if it wants to. -# Prefer explicitly selected file to automatically selected ones. +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE if test -n "$CONFIG_SITE"; then - set x "$CONFIG_SITE" + ac_site_file1=$CONFIG_SITE elif test "x$prefix" != xNONE; then - set x "$prefix/share/config.site" "$prefix/etc/config.site" + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site else - set x "$ac_default_prefix/share/config.site" \ - "$ac_default_prefix/etc/config.site" + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site fi -shift -for ac_site_file +for ac_site_file in "$ac_site_file1" "$ac_site_file2" do + test "x$ac_site_file" = xNONE && continue if test -r "$ac_site_file"; then - { $as_echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" @@ -1915,7 +2969,7 @@ if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then - { $as_echo "$as_me:$LINENO: loading cache $cache_file" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; @@ -1923,111 +2977,133 @@ $as_echo "$as_me: loading cache $cache_file" >&6;} esac fi else - { $as_echo "$as_me:$LINENO: creating cache $cache_file" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi -ac_header_list="$ac_header_list arpa/inet.h" -ac_func_list="$ac_func_list pathconf" -ac_header_list="$ac_header_list sys/param.h" -ac_func_list="$ac_func_list canonicalize_file_name" -ac_func_list="$ac_func_list resolvepath" -ac_func_list="$ac_func_list dup2" -ac_header_list="$ac_header_list libgen.h" -ac_func_list="$ac_func_list fchdir" -ac_header_list="$ac_header_list dirent.h" -ac_header_list="$ac_header_list fcntl.h" -ac_func_list="$ac_func_list mempcpy" -ac_func_list="$ac_func_list btowc" -ac_func_list="$ac_func_list iswctype" -ac_func_list="$ac_func_list mbsrtowcs" -ac_func_list="$ac_func_list wmemchr" -ac_func_list="$ac_func_list wmemcpy" -ac_func_list="$ac_func_list wmempcpy" -ac_header_list="$ac_header_list wctype.h" -ac_header_list="$ac_header_list stdio_ext.h" -ac_header_list="$ac_header_list sys/vfs.h" -ac_header_list="$ac_header_list sys/fs_types.h" -ac_func_list="$ac_func_list ftruncate" -ac_func_list="$ac_func_list lchmod" -ac_func_list="$ac_func_list fdopendir" -ac_header_list="$ac_header_list sys/socket.h" -ac_header_list="$ac_header_list netinet/in.h" -ac_header_list="$ac_header_list netdb.h" -ac_func_list="$ac_func_list microuptime" -ac_func_list="$ac_func_list nanouptime" -ac_header_list="$ac_header_list termios.h" -ac_func_list="$ac_func_list __fsetlocking" -ac_func_list="$ac_func_list tcgetattr" -ac_func_list="$ac_func_list tcsetattr" -ac_func_list="$ac_func_list gettimeofday" -ac_func_list="$ac_func_list nanotime" -ac_header_list="$ac_header_list sys/time.h" -ac_header_list="$ac_header_list stdint.h" -ac_header_list="$ac_header_list inttypes.h" -ac_header_list="$ac_header_list wchar.h" -ac_func_list="$ac_func_list isascii" -ac_func_list="$ac_func_list mbsinit" -ac_header_list="$ac_header_list unistd.h" -ac_func_list="$ac_func_list fchmod" -ac_func_list="$ac_func_list alarm" -ac_header_list="$ac_header_list sys/statvfs.h" -ac_func_list="$ac_func_list siginterrupt" -ac_header_list="$ac_header_list sys/select.h" -ac_func_list="$ac_func_list readlink" -ac_header_list="$ac_header_list utmp.h" -ac_header_list="$ac_header_list utmpx.h" -ac_func_list="$ac_func_list utmpname" -ac_func_list="$ac_func_list utmpxname" -ac_header_list="$ac_header_list locale.h" -ac_func_list="$ac_func_list mbrtowc" -ac_func_list="$ac_func_list wcrtomb" -ac_func_list="$ac_func_list wcscoll" -ac_func_list="$ac_func_list setenv" -ac_func_list="$ac_func_list settimeofday" -ac_func_list="$ac_func_list stime" -ac_header_list="$ac_header_list stdio.h" -ac_header_list="$ac_header_list stdlib.h" -ac_func_list="$ac_func_list mblen" -ac_func_list="$ac_func_list mbrlen" -ac_func_list="$ac_func_list tzset" -ac_header_list="$ac_header_list string.h" -ac_func_list="$ac_func_list lstat" -ac_header_list="$ac_header_list sys/stat.h" -ac_header_list="$ac_header_list time.h" -ac_func_list="$ac_func_list pipe" -ac_header_list="$ac_header_list priv.h" -ac_header_list="$ac_header_list utime.h" -ac_func_list="$ac_func_list futimes" -ac_func_list="$ac_func_list futimesat" -ac_func_list="$ac_func_list vasnprintf" -ac_func_list="$ac_func_list iswcntrl" -ac_func_list="$ac_func_list wcwidth" -ac_header_list="$ac_header_list hurd.h" -ac_header_list="$ac_header_list paths.h" -ac_header_list="$ac_header_list stropts.h" -ac_header_list="$ac_header_list sys/ioctl.h" -ac_header_list="$ac_header_list sys/resource.h" -ac_header_list="$ac_header_list sys/systeminfo.h" -ac_header_list="$ac_header_list sys/wait.h" -ac_header_list="$ac_header_list syslog.h" -ac_header_list="$ac_header_list grp.h" -ac_header_list="$ac_header_list pwd.h" -ac_func_list="$ac_func_list strxfrm" -ac_func_list="$ac_func_list directio" -ac_func_list="$ac_func_list endgrent" -ac_func_list="$ac_func_list endpwent" -ac_func_list="$ac_func_list fchown" -ac_func_list="$ac_func_list iswspace" -ac_func_list="$ac_func_list mkfifo" -ac_func_list="$ac_func_list setgroups" -ac_func_list="$ac_func_list sethostname" -ac_func_list="$ac_func_list sync" -ac_func_list="$ac_func_list sysctl" -ac_func_list="$ac_func_list sysinfo" -ac_func_list="$ac_func_list tcgetpgrp" -ac_header_list="$ac_header_list OS.h" +as_fn_append ac_header_list " arpa/inet.h" +as_fn_append ac_func_list " pathconf" +as_fn_append ac_func_list " btowc" +as_fn_append ac_header_list " sys/param.h" +as_fn_append ac_func_list " canonicalize_file_name" +as_fn_append ac_func_list " resolvepath" +as_fn_append ac_header_list " sys/socket.h" +as_fn_append ac_header_list " dirent.h" +as_fn_append ac_func_list " dup2" +as_fn_append ac_header_list " errno.h" +as_fn_append ac_header_list " libgen.h" +as_fn_append ac_func_list " fchdir" +as_fn_append ac_header_list " fcntl.h" +as_fn_append ac_func_list " mempcpy" +as_fn_append ac_header_list " float.h" +as_fn_append ac_func_list " isblank" +as_fn_append ac_func_list " iswctype" +as_fn_append ac_func_list " mbsrtowcs" +as_fn_append ac_func_list " wmemchr" +as_fn_append ac_func_list " wmemcpy" +as_fn_append ac_func_list " wmempcpy" +as_fn_append ac_header_list " wctype.h" +gl_fnmatch_required=GNU +as_fn_append ac_header_list " stdio_ext.h" +as_fn_append ac_func_list " __fpending" +as_fn_append ac_func_list " fpurge" +as_fn_append ac_func_list " __fpurge" +as_fn_append ac_func_list " __freading" +as_fn_append ac_header_list " sys/vfs.h" +as_fn_append ac_header_list " sys/fs_types.h" +as_fn_append ac_func_list " ftruncate" +as_fn_append ac_func_list " lchmod" +as_fn_append ac_func_list " fdopendir" +as_fn_append ac_func_list " fstatfs" +as_fn_append ac_header_list " netdb.h" +as_fn_append ac_header_list " netinet/in.h" +as_fn_append ac_func_list " microuptime" +as_fn_append ac_func_list " nanouptime" +as_fn_append ac_func_list " flockfile" +as_fn_append ac_func_list " funlockfile" +as_fn_append ac_header_list " termios.h" +as_fn_append ac_func_list " __fsetlocking" +as_fn_append ac_func_list " tcgetattr" +as_fn_append ac_func_list " tcsetattr" +as_fn_append ac_func_list " gettimeofday" +as_fn_append ac_func_list " nanotime" +as_fn_append ac_header_list " sys/time.h" +as_fn_append ac_header_list " iconv.h" +as_fn_append ac_header_list " stdint.h" +as_fn_append ac_header_list " wchar.h" +as_fn_append ac_header_list " inttypes.h" +as_fn_append ac_func_list " lstat" +as_fn_append ac_header_list " math.h" +as_fn_append ac_func_list " mbsinit" +as_fn_append ac_func_list " mbrtowc" +as_fn_append ac_func_list " mbrlen" +as_fn_append ac_func_list " isascii" +as_fn_append ac_header_list " unistd.h" +as_fn_append ac_func_list " fchmod" +as_fn_append ac_func_list " alarm" +as_fn_append ac_header_list " sys/statvfs.h" +as_fn_append ac_header_list " sys/select.h" +gl_printf_safe=yes +as_fn_append ac_func_list " readlink" +as_fn_append ac_header_list " utmp.h" +as_fn_append ac_header_list " utmpx.h" +as_fn_append ac_func_list " utmpname" +as_fn_append ac_func_list " utmpxname" +as_fn_append ac_header_list " locale.h" +as_fn_append ac_func_list " wcscoll" +as_fn_append ac_func_list " setenv" +as_fn_append ac_func_list " settimeofday" +as_fn_append ac_func_list " stime" +as_fn_append ac_func_list " sigaction" +as_fn_append ac_func_list " sigaltstack" +as_fn_append ac_func_list " siginterrupt" +as_fn_append ac_header_list " signal.h" +as_fn_append ac_header_list " stdarg.h" +as_fn_append ac_header_list " stdio.h" +as_fn_append ac_header_list " stdlib.h" +as_fn_append ac_func_list " tzset" +as_fn_append ac_header_list " string.h" +as_fn_append ac_header_list " sys/stat.h" +as_fn_append ac_header_list " time.h" +as_fn_append ac_func_list " pipe" +as_fn_append ac_header_list " priv.h" +as_fn_append ac_header_list " utime.h" +as_fn_append ac_func_list " futimes" +as_fn_append ac_func_list " futimesat" +as_fn_append ac_func_list " futimens" +as_fn_append ac_func_list " utimensat" +as_fn_append ac_func_list " vasnprintf" +as_fn_append ac_func_list " wcrtomb" +as_fn_append ac_func_list " iswcntrl" +as_fn_append ac_func_list " wcwidth" +as_fn_append ac_header_list " sys/wait.h" +as_fn_append ac_header_list " sys/ioctl.h" +as_fn_append ac_func_list " wctob" +as_fn_append ac_header_list " hurd.h" +as_fn_append ac_header_list " paths.h" +as_fn_append ac_header_list " stropts.h" +as_fn_append ac_header_list " sys/resource.h" +as_fn_append ac_header_list " sys/systeminfo.h" +as_fn_append ac_header_list " syslog.h" +as_fn_append ac_header_list " grp.h" +as_fn_append ac_header_list " pwd.h" +as_fn_append ac_func_list " strxfrm" +as_fn_append ac_func_list " directio" +as_fn_append ac_func_list " matchpathcon_init_prefix" +as_fn_append ac_func_list " nl_langinfo" +as_fn_append ac_func_list " endgrent" +as_fn_append ac_func_list " endpwent" +as_fn_append ac_func_list " fchown" +as_fn_append ac_func_list " iswspace" +as_fn_append ac_func_list " mkfifo" +as_fn_append ac_func_list " setgroups" +as_fn_append ac_func_list " sethostname" +as_fn_append ac_func_list " sync" +as_fn_append ac_func_list " sysctl" +as_fn_append ac_func_list " sysinfo" +as_fn_append ac_func_list " tcgetpgrp" +as_fn_append ac_header_list " OS.h" gt_needs="$gt_needs need-formatstring-macros" # Check that the precious variables saved in the cache have kept the same # value. @@ -2039,23 +3115,32 @@ for ac_var in $ac_precious_vars; do eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) - { $as_echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) - { $as_echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then - { $as_echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - { $as_echo "$as_me:$LINENO: former value: $ac_old_val" >&5 -$as_echo "$as_me: former value: $ac_old_val" >&2;} - { $as_echo "$as_me:$LINENO: current value: $ac_new_val" >&5 -$as_echo "$as_me: current value: $ac_new_val" >&2;} - ac_cache_corrupted=: + ac_cache_corrupted=: + else + { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. @@ -2066,41 +3151,20 @@ $as_echo "$as_me: current value: $ac_new_val" >&2;} esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. - *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; + *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then - { $as_echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} - { { $as_echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 -$as_echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi - - - - - - - - - - - - - - - - - - - - - - - - +## -------------------- ## +## Main body of script. ## +## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -2111,26 +3175,19 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu + ac_aux_dir= for ac_dir in build-aux "$srcdir"/build-aux; do - if test -f "$ac_dir/install-sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install-sh -c" - break - elif test -f "$ac_dir/install.sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install.sh -c" - break - elif test -f "$ac_dir/shtool"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/shtool install -c" - break - fi + for ac_t in install-sh install.sh shtool; do + if test -f "$ac_dir/$ac_t"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/$ac_t -c" + break 2 + fi + done done if test -z "$ac_aux_dir"; then - { { $as_echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in build-aux \"$srcdir\"/build-aux" >&5 -$as_echo "$as_me: error: cannot find install-sh or install.sh in build-aux \"$srcdir\"/build-aux" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "cannot find install-sh, install.sh, or shtool in build-aux \"$srcdir\"/build-aux" "$LINENO" 5 fi # These three variables are undocumented and unsupported, @@ -2145,113 +3202,7 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. ac_config_headers="$ac_config_headers lib/config.h:lib/config.hin" -# Make sure we can run config.sub. -$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || - { { $as_echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 -$as_echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} - { (exit 1); exit 1; }; } - -{ $as_echo "$as_me:$LINENO: checking build system type" >&5 -$as_echo_n "checking build system type... " >&6; } -if test "${ac_cv_build+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_build_alias=$build_alias -test "x$ac_build_alias" = x && - ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` -test "x$ac_build_alias" = x && - { { $as_echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 -$as_echo "$as_me: error: cannot guess build type; you must specify one" >&2;} - { (exit 1); exit 1; }; } -ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || - { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 -$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} - { (exit 1); exit 1; }; } - -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_build" >&5 -$as_echo "$ac_cv_build" >&6; } -case $ac_cv_build in -*-*-*) ;; -*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 -$as_echo "$as_me: error: invalid value of canonical build" >&2;} - { (exit 1); exit 1; }; };; -esac -build=$ac_cv_build -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_build -shift -build_cpu=$1 -build_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -build_os=$* -IFS=$ac_save_IFS -case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac - - -{ $as_echo "$as_me:$LINENO: checking host system type" >&5 -$as_echo_n "checking host system type... " >&6; } -if test "${ac_cv_host+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test "x$host_alias" = x; then - ac_cv_host=$ac_cv_build -else - ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || - { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 -$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} - { (exit 1); exit 1; }; } -fi - -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_host" >&5 -$as_echo "$ac_cv_host" >&6; } -case $ac_cv_host in -*-*-*) ;; -*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 -$as_echo "$as_me: error: invalid value of canonical host" >&2;} - { (exit 1); exit 1; }; };; -esac -host=$ac_cv_host -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_host -shift -host_cpu=$1 -host_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -host_os=$* -IFS=$ac_save_IFS -case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac - - - - - - - { $as_echo "$as_me:$LINENO: autobuild project... ${PACKAGE_NAME:-$PACKAGE}" >&5 -$as_echo "$as_me: autobuild project... ${PACKAGE_NAME:-$PACKAGE}" >&6;} - { $as_echo "$as_me:$LINENO: autobuild revision... ${PACKAGE_VERSION:-$VERSION}" >&5 -$as_echo "$as_me: autobuild revision... ${PACKAGE_VERSION:-$VERSION}" >&6;} - hostname=`hostname` - if test "$hostname"; then - { $as_echo "$as_me:$LINENO: autobuild hostname... $hostname" >&5 -$as_echo "$as_me: autobuild hostname... $hostname" >&6;} - fi - - date=`date +%Y%m%d-%H%M%S` - if test "$?" != 0; then - date=`date` - fi - if test "$date"; then - { $as_echo "$as_me:$LINENO: autobuild timestamp... $date" >&5 -$as_echo "$as_me: autobuild timestamp... $date" >&6;} - fi - -am__api_version='1.10' +am__api_version='1.10c' # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or @@ -2266,10 +3217,11 @@ am__api_version='1.10' # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. -{ $as_echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +# Reject install programs that cannot install multiple files. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then -if test "${ac_cv_path_install+set}" = set; then +if test "${ac_cv_path_install+set}" = set; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -2277,11 +3229,11 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - # Account for people who put trailing slashes in PATH elements. -case $as_dir/ in - ./ | .// | /cC/* | \ + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in #(( + ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ - ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ + ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. @@ -2299,17 +3251,29 @@ case $as_dir/ in # program-specific install script used by HP pwplus--don't use. : else - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" - break 3 + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi fi fi done done ;; esac -done + + done IFS=$as_save_IFS +rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then @@ -2322,7 +3286,7 @@ fi INSTALL=$ac_install_sh fi fi -{ $as_echo "$as_me:$LINENO: result: $INSTALL" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. @@ -2333,21 +3297,34 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' -{ $as_echo "$as_me:$LINENO: checking whether build environment is sane" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Just in case sleep 1 echo timestamp > conftest.file +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[\\\"\#\$\&\'\`$am_lf]*) + as_fn_error "unsafe absolute working directory name" "$LINENO" 5;; +esac +case $srcdir in + *[\\\"\#\$\&\'\`$am_lf\ \ ]*) + as_fn_error "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;; +esac + # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( - set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. - set X `ls -t $srcdir/configure conftest.file` + set X `ls -t "$srcdir/configure" conftest.file` fi rm -f conftest.file if test "$*" != "X $srcdir/configure conftest.file" \ @@ -2357,11 +3334,8 @@ if ( # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". - { { $as_echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken -alias in your environment" >&5 -$as_echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken -alias in your environment" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "ls -t appears to fail. Make sure there is not a broken +alias in your environment" "$LINENO" 5 fi test "$2" = conftest.file @@ -2370,13 +3344,10 @@ then # Ok. : else - { { $as_echo "$as_me:$LINENO: error: newly created file is older than distributed files! -Check your system clock" >&5 -$as_echo "$as_me: error: newly created file is older than distributed files! -Check your system clock" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "newly created file is older than distributed files! +Check your system clock" "$LINENO" 5 fi -{ $as_echo "$as_me:$LINENO: result: yes" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" @@ -2391,20 +3362,136 @@ program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` -test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= - { $as_echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi -{ $as_echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5 +if test x"${install_sh}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi + +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_STRIP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then - if test "${ac_cv_path_mkdir+set}" = set; then + if test "${ac_cv_path_mkdir+set}" = set; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -2412,7 +3499,7 @@ for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_prog in mkdir gmkdir; do + for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( @@ -2424,7 +3511,7 @@ do esac done done -done + done IFS=$as_save_IFS fi @@ -2440,7 +3527,7 @@ fi MKDIR_P="$ac_install_sh -d" fi fi -{ $as_echo "$as_me:$LINENO: result: $MKDIR_P" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } mkdir_p="$MKDIR_P" @@ -2453,9 +3540,9 @@ for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_AWK+set}" = set; then +if test "${ac_cv_prog_AWK+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then @@ -2466,24 +3553,24 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AWK="$ac_prog" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then - { $as_echo "$as_me:$LINENO: result: $AWK" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -2491,11 +3578,11 @@ fi test -n "$AWK" && break done -{ $as_echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` -if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then +if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF @@ -2513,11 +3600,11 @@ esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then - { $as_echo "$as_me:$LINENO: result: yes" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi @@ -2537,9 +3624,7 @@ if test "`cd $srcdir && pwd`" != "`pwd`"; then am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then - { { $as_echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 -$as_echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi @@ -2555,7 +3640,7 @@ fi # Define the identity of the package. PACKAGE='coreutils' - VERSION='6.9' + VERSION='7.4' cat >>confdefs.h <<_ACEOF @@ -2583,112 +3668,6 @@ AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} -install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"} - -# Installed binaries are usually stripped using `strip' when the user -# run `make install-strip'. However `strip' might not be the right -# tool to use in cross-compilation environments, therefore Automake -# will honor the `STRIP' environment variable to overrule this program. -if test "$cross_compiling" != no; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. -set dummy ${ac_tool_prefix}strip; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_STRIP+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test -n "$STRIP"; then - ac_cv_prog_STRIP="$STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_STRIP="${ac_tool_prefix}strip" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -STRIP=$ac_cv_prog_STRIP -if test -n "$STRIP"; then - { $as_echo "$as_me:$LINENO: result: $STRIP" >&5 -$as_echo "$STRIP" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_STRIP"; then - ac_ct_STRIP=$STRIP - # Extract the first word of "strip", so it can be a program name with args. -set dummy strip; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_STRIP"; then - ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_STRIP="strip" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP -if test -n "$ac_ct_STRIP"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 -$as_echo "$ac_ct_STRIP" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_STRIP" = x; then - STRIP=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -$as_echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} -ac_tool_warned=yes ;; -esac - STRIP=$ac_ct_STRIP - fi -else - STRIP="$ac_cv_prog_STRIP" -fi - -fi -INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" - # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. @@ -2701,6 +3680,18 @@ am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' +# Check whether --enable-silent-rules was given. +if test "${enable_silent_rules+set}" = set; then : + enableval=$enable_silent_rules; +fi + +case $enable_silent_rules in +yes) AM_DEFAULT_VERBOSITY=0;; +no) AM_DEFAULT_VERBOSITY=1;; +*) AM_DEFAULT_VERBOSITY=0;; +esac +AM_BACKSLASH='\' + # make --enable-silent-rules the default. DEPDIR="${am__leading_dot}deps" @@ -2710,44 +3701,44 @@ ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: - @echo done + @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. -{ $as_echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf -# We grep out `Entering directory' and `Leaving directory' -# messages which can occur if `w' ends up in MAKEFLAGS. -# In particular we don't look at `^make:' because GNU make might -# be invoked under some other name (usually "gmake"), in which -# case it prints its new name instead of `make'. -if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then - am__include=include - am__quote= - _am_result=GNU -fi +# Ignore all kinds of additional output from `make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf - if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then - am__include=.include - am__quote="\"" - _am_result=BSD - fi + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac fi -{ $as_echo "$as_me:$LINENO: result: $_am_result" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 $as_echo "$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. -if test "${enable_dependency_tracking+set}" = set; then +if test "${enable_dependency_tracking+set}" = set; then : enableval=$enable_dependency_tracking; fi @@ -2772,9 +3763,9 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then +if test "${ac_cv_prog_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -2785,24 +3776,24 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:$LINENO: result: $CC" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -2812,9 +3803,9 @@ if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then @@ -2825,24 +3816,24 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -2851,12 +3842,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -$as_echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC @@ -2869,9 +3856,9 @@ if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then +if test "${ac_cv_prog_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -2882,24 +3869,24 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:$LINENO: result: $CC" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -2909,9 +3896,9 @@ fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then +if test "${ac_cv_prog_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -2923,18 +3910,18 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then @@ -2953,10 +3940,10 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:$LINENO: result: $CC" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -2968,9 +3955,9 @@ if test -z "$CC"; then do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then +if test "${ac_cv_prog_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -2981,24 +3968,24 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:$LINENO: result: $CC" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -3012,9 +3999,9 @@ if test -z "$CC"; then do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then @@ -3025,24 +4012,24 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -3055,12 +4042,8 @@ done else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -$as_echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC @@ -3070,55 +4053,37 @@ fi fi -test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error "no acceptable C compiler found in \$PATH +See \`config.log' for more details." "$LINENO" 5; } # Provide some information about the compiler. -$as_echo "$as_me:$LINENO: checking for C compiler version" >&5 +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 -{ (ac_try="$ac_compiler --version >&5" +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compiler --version >&5") 2>&5 +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (ac_try="$ac_compiler -v >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compiler -v >&5") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (ac_try="$ac_compiler -V >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compiler -V >&5") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + rm -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -3130,43 +4095,38 @@ main () } _ACEOF ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.exe b.out" +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. -{ $as_echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` -# -# List of possible output files, starting from the most likely. -# The algorithm is not robust to junk in `.', hence go to wildcards (a.*) -# only as a last resort. b.out is created by i960 compilers. -ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' -# -# The IRIX 6 linker writes into existing files which may not be -# executable, retaining their permissions. Remove them first so a -# subsequent execution test works. + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + ac_rmfiles= for ac_file in $ac_files do case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles -if { (ac_try="$ac_link_default" +if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, @@ -3176,14 +4136,14 @@ for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) - if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi @@ -3202,80 +4162,76 @@ test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi - -{ $as_echo "$as_me:$LINENO: result: $ac_file" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } -if test -z "$ac_file"; then +if test -z "$ac_file"; then : $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { $as_echo "$as_me:$LINENO: error: C compiler cannot create executables -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: C compiler cannot create executables -See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ as_fn_set_status 77 +as_fn_error "C compiler cannot create executables +See \`config.log' for more details." "$LINENO" 5; }; } fi - ac_exeext=$ac_cv_exeext # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -{ $as_echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' - { (case "(($ac_try" in + { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else - { { $as_echo "$as_me:$LINENO: error: cannot run C compiled programs. + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error "cannot run C compiled programs. If you meant to cross compile, use \`--host'. -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } +See \`config.log' for more details." "$LINENO" 5; } fi fi fi -{ $as_echo "$as_me:$LINENO: result: yes" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } -rm -f a.out a.exe conftest$ac_cv_exeext b.out +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -{ $as_echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } -{ $as_echo "$as_me:$LINENO: result: $cross_compiling" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } -{ $as_echo "$as_me:$LINENO: checking for suffix of executables" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } -if { (ac_try="$ac_link" +if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with @@ -3283,37 +4239,31 @@ $as_echo "$ac_try_echo") >&5 for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else - { { $as_echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." "$LINENO" 5; } fi - rm -f conftest$ac_cv_exeext -{ $as_echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT -{ $as_echo "$as_me:$LINENO: checking for suffix of object files" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } -if test "${ac_cv_objext+set}" = set; then +if test "${ac_cv_objext+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -3325,21 +4275,21 @@ main () } _ACEOF rm -f conftest.o conftest.obj -if { (ac_try="$ac_compile" +if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac @@ -3348,29 +4298,23 @@ else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute suffix of object files: cannot compile -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error "cannot compute suffix of object files: cannot compile +See \`config.log' for more details." "$LINENO" 5; } fi - rm -f conftest.$ac_cv_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT -{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if test "${ac_cv_c_compiler_gnu+set}" = set; then +if test "${ac_cv_c_compiler_gnu+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -3384,37 +4328,16 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_compiler_gnu=no + ac_compiler_gnu=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes @@ -3423,20 +4346,16 @@ else fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS -{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } -if test "${ac_cv_prog_cc_g+set}" = set; then +if test "${ac_cv_prog_cc_g+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -3447,35 +4366,11 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - CFLAGS="" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -3486,36 +4381,12 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - : -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +if ac_fn_c_try_compile "$LINENO"; then : - ac_c_werror_flag=$ac_save_c_werror_flag +else + ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -3526,42 +4397,17 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS @@ -3578,18 +4424,14 @@ else CFLAGS= fi fi -{ $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if test "${ac_cv_prog_cc_c89+set}" = set; then +if test "${ac_cv_prog_cc_c89+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include @@ -3646,32 +4488,9 @@ for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" - rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then + if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - fi - rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done @@ -3682,17 +4501,19 @@ fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) - { $as_echo "$as_me:$LINENO: result: none needed" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) - { $as_echo "$as_me:$LINENO: result: unsupported" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" - { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac +if test "x$ac_cv_prog_cc_c89" != xno; then : +fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -3702,9 +4523,9 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= -{ $as_echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } -if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then +if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then @@ -3730,6 +4551,11 @@ else if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and @@ -3747,7 +4573,17 @@ else done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested @@ -3757,19 +4593,23 @@ else break fi ;; + msvisualcpp | msvcmsys) + # This compiler won't grok `-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; none) break ;; esac - # We check with `-c' and `-o' for the sake of the "dashmstdout" - # mode. It turns out that the SunPro C++ compiler does not properly - # handle `-M -o', and we need to detect this. if depmode=$depmode \ - source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message @@ -3793,7 +4633,7 @@ else fi fi -{ $as_echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type @@ -3808,20 +4648,18 @@ else fi - case $ac_cv_prog_cc_stdc in - no) ac_cv_prog_cc_c99=no; ac_cv_prog_cc_c89=no ;; - *) { $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C99" >&5 + case $ac_cv_prog_cc_stdc in #( + no) : + ac_cv_prog_cc_c99=no; ac_cv_prog_cc_c89=no ;; #( + *) : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C99" >&5 $as_echo_n "checking for $CC option to accept ISO C99... " >&6; } -if test "${ac_cv_prog_cc_c99+set}" = set; then +if test "${ac_cv_prog_cc_c99+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c99=no ac_save_CC=$CC -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include @@ -3960,35 +4798,12 @@ main () return 0; } _ACEOF -for ac_arg in '' -std=gnu99 -c99 -xc99=all -qlanglvl=extc99 +for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -xc99=all -qlanglvl=extc99 do CC="$ac_save_CC $ac_arg" - rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then + if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c99=$ac_arg -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - fi - rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c99" != "xno" && break done @@ -3999,31 +4814,27 @@ fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c99" in x) - { $as_echo "$as_me:$LINENO: result: none needed" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) - { $as_echo "$as_me:$LINENO: result: unsupported" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c99" - { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c99" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 $as_echo "$ac_cv_prog_cc_c99" >&6; } ;; esac -if test "x$ac_cv_prog_cc_c99" != xno; then +if test "x$ac_cv_prog_cc_c99" != xno; then : ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 else - { $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if test "${ac_cv_prog_cc_c89+set}" = set; then +if test "${ac_cv_prog_cc_c89+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include @@ -4080,32 +4891,9 @@ for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" - rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then + if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - fi - rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done @@ -4116,60 +4904,56 @@ fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) - { $as_echo "$as_me:$LINENO: result: none needed" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) - { $as_echo "$as_me:$LINENO: result: unsupported" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" - { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac -if test "x$ac_cv_prog_cc_c89" != xno; then +if test "x$ac_cv_prog_cc_c89" != xno; then : ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 else ac_cv_prog_cc_stdc=no fi - fi - ;; esac - { $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO Standard C" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO Standard C" >&5 $as_echo_n "checking for $CC option to accept ISO Standard C... " >&6; } - if test "${ac_cv_prog_cc_stdc+set}" = set; then + if test "${ac_cv_prog_cc_stdc+set}" = set; then : $as_echo_n "(cached) " >&6 fi - case $ac_cv_prog_cc_stdc in - no) { $as_echo "$as_me:$LINENO: result: unsupported" >&5 -$as_echo "unsupported" >&6; } ;; - '') { $as_echo "$as_me:$LINENO: result: none needed" >&5 -$as_echo "none needed" >&6; } ;; - *) { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 + case $ac_cv_prog_cc_stdc in #( + no) : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; #( + '') : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; #( + *) : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_stdc" >&5 $as_echo "$ac_cv_prog_cc_stdc" >&6; } ;; esac - if test "x$CC" != xcc; then - { $as_echo "$as_me:$LINENO: checking whether $CC and cc understand -c and -o together" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC and cc understand -c and -o together" >&5 $as_echo_n "checking whether $CC and cc understand -c and -o together... " >&6; } else - { $as_echo "$as_me:$LINENO: checking whether cc understands -c and -o together" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cc understands -c and -o together" >&5 $as_echo_n "checking whether cc understands -c and -o together... " >&6; } fi set dummy $CC; ac_cc=`$as_echo "$2" | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` -if { as_var=ac_cv_prog_cc_${ac_cc}_c_o; eval "test \"\${$as_var+set}\" = set"; }; then +if { as_var=ac_cv_prog_cc_${ac_cc}_c_o; eval "test \"\${$as_var+set}\" = set"; }; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -4185,63 +4969,63 @@ _ACEOF # existing .o file with -o, though they will create one. ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5' rm -f conftest2.* -if { (case "(($ac_try" in +if { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - test -f conftest2.$ac_objext && { (case "(($ac_try" in + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && + test -f conftest2.$ac_objext && { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then eval ac_cv_prog_cc_${ac_cc}_c_o=yes if test "x$CC" != xcc; then # Test first that cc exists at all. if { ac_try='cc -c conftest.$ac_ext >&5' - { (case "(($ac_try" in + { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5' rm -f conftest2.* - if { (case "(($ac_try" in + if { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - test -f conftest2.$ac_objext && { (case "(($ac_try" in + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && + test -f conftest2.$ac_objext && { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then # cc works too. : @@ -4258,23 +5042,22 @@ rm -f core conftest* fi if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then - { $as_echo "$as_me:$LINENO: result: yes" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } -cat >>confdefs.h <<\_ACEOF -#define NO_MINUS_C_MINUS_O 1 -_ACEOF +$as_echo "#define NO_MINUS_C_MINUS_O 1" >>confdefs.h fi # FIXME: we rely on the cache variable name because # there is no other way. set dummy $CC -ac_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` -if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" != yes"; then +am_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` +eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o +if test "$am_t" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. @@ -4289,14 +5072,14 @@ ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then - if test "${ac_cv_prog_CPP+set}" = set; then + if test "${ac_cv_prog_CPP+set}" = set; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded @@ -4311,11 +5094,7 @@ do # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include @@ -4324,78 +5103,34 @@ cat >>conftest.$ac_ext <<_ACEOF #endif Syntax error _ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - : -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +if ac_fn_c_try_cpp "$LINENO"; then : +else # Broken: fails on valid input. continue fi - rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then +if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - # Passes both tests. ac_preproc_ok=: break fi - rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then +if $ac_preproc_ok; then : break fi @@ -4407,7 +5142,7 @@ fi else ac_cv_prog_CPP=$CPP fi -{ $as_echo "$as_me:$LINENO: result: $CPP" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes @@ -4418,11 +5153,7 @@ do # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include @@ -4431,85 +5162,40 @@ cat >>conftest.$ac_ext <<_ACEOF #endif Syntax error _ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - : -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +if ac_fn_c_try_cpp "$LINENO"; then : +else # Broken: fails on valid input. continue fi - rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then +if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - # Passes both tests. ac_preproc_ok=: break fi - rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - : +if $ac_preproc_ok; then : + else - { { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." "$LINENO" 5; } fi ac_ext=c @@ -4520,29 +5206,24 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } -if test "${ac_cv_path_GREP+set}" = set; then - $as_echo_n "(cached) " >&6 -else - # Extract the first word of "grep ggrep" to use in msg output -if test -z "$GREP"; then -set dummy grep ggrep; ac_prog_name=$2 -if test "${ac_cv_path_GREP+set}" = set; then +if test "${ac_cv_path_GREP+set}" = set; then : $as_echo_n "(cached) " >&6 else + if test -z "$GREP"; then ac_path_GREP_found=false -# Loop through the user's path and test for each of PROGNAME-LIST -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_prog in grep ggrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue - # Check for GNU ac_path_GREP and select it if it is found. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue +# Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) @@ -4558,7 +5239,7 @@ case `"$ac_path_GREP" --version 2>&1` in $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - ac_count=`expr $ac_count + 1` + as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" @@ -4570,61 +5251,45 @@ case `"$ac_path_GREP" --version 2>&1` in rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac - - $ac_path_GREP_found && break 3 + $ac_path_GREP_found && break 3 + done + done done -done - -done IFS=$as_save_IFS - - -fi - -GREP="$ac_cv_path_GREP" -if test -z "$GREP"; then - { { $as_echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 -$as_echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} - { (exit 1); exit 1; }; } -fi - + if test -z "$ac_cv_path_GREP"; then + as_fn_error "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi else ac_cv_path_GREP=$GREP fi - fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" -{ $as_echo "$as_me:$LINENO: checking for egrep" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } -if test "${ac_cv_path_EGREP+set}" = set; then +if test "${ac_cv_path_EGREP+set}" = set; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else - # Extract the first word of "egrep" to use in msg output -if test -z "$EGREP"; then -set dummy egrep; ac_prog_name=$2 -if test "${ac_cv_path_EGREP+set}" = set; then - $as_echo_n "(cached) " >&6 -else + if test -z "$EGREP"; then ac_path_EGREP_found=false -# Loop through the user's path and test for each of PROGNAME-LIST -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_prog in egrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue - # Check for GNU ac_path_EGREP and select it if it is found. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue +# Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) @@ -4640,7 +5305,7 @@ case `"$ac_path_EGREP" --version 2>&1` in $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - ac_count=`expr $ac_count + 1` + as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" @@ -4652,54 +5317,39 @@ case `"$ac_path_EGREP" --version 2>&1` in rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac - - $ac_path_EGREP_found && break 3 + $ac_path_EGREP_found && break 3 + done + done done -done - -done IFS=$as_save_IFS - - -fi - -EGREP="$ac_cv_path_EGREP" -if test -z "$EGREP"; then - { { $as_echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 -$as_echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} - { (exit 1); exit 1; }; } -fi - + if test -z "$ac_cv_path_EGREP"; then + as_fn_error "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi else ac_cv_path_EGREP=$EGREP fi - fi fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" if test $ac_cv_c_compiler_gnu = yes; then - { $as_echo "$as_me:$LINENO: checking whether $CC needs -traditional" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC needs -traditional" >&5 $as_echo_n "checking whether $CC needs -traditional... " >&6; } -if test "${ac_cv_prog_gcc_traditional+set}" = set; then +if test "${ac_cv_prog_gcc_traditional+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_pattern="Autoconf.*'x'" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include Autoconf TIOCGETP _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "$ac_pattern" >/dev/null 2>&1; then + $EGREP "$ac_pattern" >/dev/null 2>&1; then : ac_cv_prog_gcc_traditional=yes else ac_cv_prog_gcc_traditional=no @@ -4708,24 +5358,20 @@ rm -f conftest* if test $ac_cv_prog_gcc_traditional = no; then - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include Autoconf TCGETA _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "$ac_pattern" >/dev/null 2>&1; then + $EGREP "$ac_pattern" >/dev/null 2>&1; then : ac_cv_prog_gcc_traditional=yes fi rm -f conftest* fi fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_gcc_traditional" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_gcc_traditional" >&5 $as_echo "$ac_cv_prog_gcc_traditional" >&6; } if test $ac_cv_prog_gcc_traditional = yes; then CC="$CC -traditional" @@ -4735,9 +5381,9 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_RANLIB+set}" = set; then +if test "${ac_cv_prog_RANLIB+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then @@ -4748,24 +5394,24 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then - { $as_echo "$as_me:$LINENO: result: $RANLIB" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -4775,9 +5421,9 @@ if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then +if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then @@ -4788,24 +5434,24 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_RANLIB="ranlib" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -4814,12 +5460,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -$as_echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB @@ -4828,62 +5470,94 @@ else RANLIB="$ac_cv_prog_RANLIB" fi -{ $as_echo "$as_me:$LINENO: checking whether ln -s works" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 $as_echo_n "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then - { $as_echo "$as_me:$LINENO: result: yes" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else - { $as_echo "$as_me:$LINENO: result: no, using $LN_S" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 $as_echo "no, using $LN_S" >&6; } fi +# Make sure we can run config.sub. +$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || + as_fn_error "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 -cat >>confdefs.h <<\_ACEOF -#define _GNU_SOURCE 1 -_ACEOF - - - -{ $as_echo "$as_me:$LINENO: checking for AIX" >&5 -$as_echo_n "checking for AIX... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef _AIX - yes -#endif - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes" >/dev/null 2>&1; then - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } -cat >>confdefs.h <<\_ACEOF -#define _ALL_SOURCE 1 -_ACEOF - -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi -rm -f conftest* - - -{ $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5 -$as_echo_n "checking for ANSI C header files... " >&6; } -if test "${ac_cv_header_stdc+set}" = set; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +$as_echo_n "checking build system type... " >&6; } +if test "${ac_cv_build+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` +test "x$ac_build_alias" = x && + as_fn_error "cannot guess build type; you must specify one" "$LINENO" 5 +ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || + as_fn_error "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +$as_echo "$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) as_fn_error "invalid value of canonical build" "$LINENO" 5;; +esac +build=$ac_cv_build +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +$as_echo_n "checking host system type... " >&6; } +if test "${ac_cv_host+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || + as_fn_error "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +$as_echo "$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) as_fn_error "invalid value of canonical host" "$LINENO" 5;; +esac +host=$ac_cv_host +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if test "${ac_cv_header_stdc+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include @@ -4898,48 +5572,23 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_header_stdc=no + ac_cv_header_stdc=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then - : + $EGREP "memchr" >/dev/null 2>&1; then : + else ac_cv_header_stdc=no fi @@ -4949,18 +5598,14 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then - : + $EGREP "free" >/dev/null 2>&1; then : + else ac_cv_header_stdc=no fi @@ -4970,14 +5615,10 @@ fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then + if test "$cross_compiling" = yes; then : : else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include @@ -5004,116 +5645,34 @@ main () return 0; } _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : +if ac_fn_c_try_run "$LINENO"; then : + else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_header_stdc=no + ac_cv_header_stdc=no fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi - fi fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then -cat >>confdefs.h <<\_ACEOF -#define STDC_HEADERS 1 -_ACEOF +$as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. - - - - - - - - - for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default - -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - eval "$as_ac_Header=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_Header=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if test `eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` = yes; then +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +eval as_val=\$$as_ac_Header + if test "x$as_val" = x""yes; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF @@ -5123,183 +5682,44 @@ fi done -if test "${ac_cv_header_minix_config_h+set}" = set; then - { $as_echo "$as_me:$LINENO: checking for minix/config.h" >&5 -$as_echo_n "checking for minix/config.h... " >&6; } -if test "${ac_cv_header_minix_config_h+set}" = set; then - $as_echo_n "(cached) " >&6 -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_minix_config_h" >&5 -$as_echo "$ac_cv_header_minix_config_h" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking minix/config.h usability" >&5 -$as_echo_n "checking minix/config.h usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_compiler=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking minix/config.h presence" >&5 -$as_echo_n "checking minix/config.h presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: minix/config.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: minix/config.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: minix/config.h: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: minix/config.h: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: minix/config.h: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: minix/config.h: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: minix/config.h: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: minix/config.h: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-coreutils@gnu.org ## -## ------------------------------------ ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for minix/config.h" >&5 -$as_echo_n "checking for minix/config.h... " >&6; } -if test "${ac_cv_header_minix_config_h+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_cv_header_minix_config_h=$ac_header_preproc -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_minix_config_h" >&5 -$as_echo "$ac_cv_header_minix_config_h" >&6; } - -fi -if test $ac_cv_header_minix_config_h = yes; then + ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default" +if test "x$ac_cv_header_minix_config_h" = x""yes; then : MINIX=yes else MINIX= fi -if test "$MINIX" = yes; then + if test "$MINIX" = yes; then -cat >>confdefs.h <<\_ACEOF -#define _POSIX_SOURCE 1 -_ACEOF +$as_echo "#define _POSIX_SOURCE 1" >>confdefs.h -cat >>confdefs.h <<\_ACEOF -#define _POSIX_1_SOURCE 2 -_ACEOF +$as_echo "#define _POSIX_1_SOURCE 2" >>confdefs.h -cat >>confdefs.h <<\_ACEOF -#define _MINIX 1 -_ACEOF +$as_echo "#define _MINIX 1" >>confdefs.h -fi + fi + + case "$host_os" in + hpux*) + +$as_echo "#define _XOPEN_SOURCE 500" >>confdefs.h + + ;; + esac - - - - - - - - - - { $as_echo "$as_me:$LINENO: checking whether it is safe to define __EXTENSIONS__" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5 $as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; } -if test "${ac_cv_safe_to_define___extensions__+set}" = set; then +if test "${ac_cv_safe_to_define___extensions__+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ # define __EXTENSIONS__ 1 @@ -5312,48 +5732,127 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_safe_to_define___extensions__=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_safe_to_define___extensions__=no + ac_cv_safe_to_define___extensions__=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_safe_to_define___extensions__" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5 $as_echo "$ac_cv_safe_to_define___extensions__" >&6; } test $ac_cv_safe_to_define___extensions__ = yes && - cat >>confdefs.h <<\_ACEOF -#define __EXTENSIONS__ 1 + $as_echo "#define __EXTENSIONS__ 1" >>confdefs.h + + $as_echo "#define _ALL_SOURCE 1" >>confdefs.h + + $as_echo "#define _GNU_SOURCE 1" >>confdefs.h + + $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h + + $as_echo "#define _TANDEM_SOURCE 1" >>confdefs.h + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGEFILE_SOURCE value needed for large files" >&5 +$as_echo_n "checking for _LARGEFILE_SOURCE value needed for large files... " >&6; } +if test "${ac_cv_sys_largefile_source+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include /* for off_t */ + #include +int +main () +{ +int (*fp) (FILE *, off_t, int) = fseeko; + return fseeko (stdin, 0, 0) && fp (stdin, 0, 0); + ; + return 0; +} _ACEOF - - cat >>confdefs.h <<\_ACEOF -#define _POSIX_PTHREAD_SEMANTICS 1 +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_sys_largefile_source=no; break +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#define _LARGEFILE_SOURCE 1 +#include /* for off_t */ + #include +int +main () +{ +int (*fp) (FILE *, off_t, int) = fseeko; + return fseeko (stdin, 0, 0) && fp (stdin, 0, 0); + ; + return 0; +} _ACEOF - - cat >>confdefs.h <<\_ACEOF -#define _TANDEM_SOURCE 1 +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_sys_largefile_source=1; break +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + ac_cv_sys_largefile_source=unknown + break +done +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_source" >&5 +$as_echo "$ac_cv_sys_largefile_source" >&6; } +case $ac_cv_sys_largefile_source in #( + no | unknown) ;; + *) +cat >>confdefs.h <<_ACEOF +#define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source _ACEOF +;; +esac +rm -rf conftest* + +# We used to try defining _XOPEN_SOURCE=500 too, to work around a bug +# in glibc 2.1.3, but that breaks too many other things. +# If you want fseeko and ftello with glibc, upgrade to a fixed glibc. +if test $ac_cv_sys_largefile_source != unknown; then + +$as_echo "#define HAVE_FSEEKO 1" >>confdefs.h + +fi + + + + + # IEEE behaviour is the default on all CPUs except Alpha and SH + # (according to the test results of Bruno Haible's ieeefp/fenv_default.m4 + # and the GCC 4.1.2 manual). + case "$host_cpu" in + alpha*) + # On Alpha systems, a compiler option provides the behaviour. + # See the ieee(3) manual page, also available at + # + if test -n "$GCC"; then + # GCC has the option -mieee. + CPPFLAGS="$CPPFLAGS -mieee" + else + # Compaq (ex-DEC) C has the option -ieee. + CPPFLAGS="$CPPFLAGS -ieee" + fi + ;; + sh*) + if test -n "$GCC"; then + # GCC has the option -mieee. + CPPFLAGS="$CPPFLAGS -mieee" + fi + ;; + esac @@ -5362,19 +5861,97 @@ _ACEOF + if test -z "$AB_PACKAGE"; then + AB_PACKAGE=${PACKAGE_NAME:-$PACKAGE} + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: autobuild project... $AB_PACKAGE" >&5 +$as_echo "$as_me: autobuild project... $AB_PACKAGE" >&6;} + + if test -z "$AB_VERSION"; then + AB_VERSION=${PACKAGE_VERSION:-$VERSION} + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: autobuild revision... $AB_VERSION" >&5 +$as_echo "$as_me: autobuild revision... $AB_VERSION" >&6;} + + hostname=`hostname` + if test "$hostname"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: autobuild hostname... $hostname" >&5 +$as_echo "$as_me: autobuild hostname... $hostname" >&6;} + fi + + + + date=`TZ=UTC0 date +%Y%m%dT%H%M%SZ` + if test "$?" != 0; then + date=`date` + fi + if test "$date"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: autobuild timestamp... $date" >&5 +$as_echo "$as_me: autobuild timestamp... $date" >&6;} + fi + + + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 +$as_echo_n "checking for inline... " >&6; } +if test "${ac_cv_c_inline+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_c_inline=no +for ac_kw in inline __inline__ __inline; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __cplusplus +typedef int foo_t; +static $ac_kw foo_t static_foo () {return 0; } +$ac_kw foo_t foo () {return 0; } +#endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_inline=$ac_kw +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + test "$ac_cv_c_inline" != no && break +done + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 +$as_echo "$ac_cv_c_inline" >&6; } + +case $ac_cv_c_inline in + inline | yes) ;; + *) + case $ac_cv_c_inline in + no) ac_val=;; + *) ac_val=$ac_cv_c_inline;; + esac + cat >>confdefs.h <<_ACEOF +#ifndef __cplusplus +#define inline $ac_val +#endif +_ACEOF + ;; +esac # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! -{ $as_echo "$as_me:$LINENO: checking for working alloca.h" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5 $as_echo_n "checking for working alloca.h... " >&6; } -if test "${ac_cv_working_alloca_h+set}" = set; then +if test "${ac_cv_working_alloca_h+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int @@ -5386,56 +5963,28 @@ char *p = (char *) alloca (2 * sizeof (int)); return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then +if ac_fn_c_try_link "$LINENO"; then : ac_cv_working_alloca_h=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_working_alloca_h=no + ac_cv_working_alloca_h=no fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_working_alloca_h" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_alloca_h" >&5 $as_echo "$ac_cv_working_alloca_h" >&6; } if test $ac_cv_working_alloca_h = yes; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_ALLOCA_H 1 -_ACEOF +$as_echo "#define HAVE_ALLOCA_H 1" >>confdefs.h fi -{ $as_echo "$as_me:$LINENO: checking for alloca" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5 $as_echo_n "checking for alloca... " >&6; } -if test "${ac_cv_func_alloca_works+set}" = set; then +if test "${ac_cv_func_alloca_works+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __GNUC__ # define alloca __builtin_alloca @@ -5467,44 +6016,20 @@ char *p = (char *) alloca (1); return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then +if ac_fn_c_try_link "$LINENO"; then : ac_cv_func_alloca_works=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_func_alloca_works=no + ac_cv_func_alloca_works=no fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_alloca_works" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5 $as_echo "$ac_cv_func_alloca_works" >&6; } if test $ac_cv_func_alloca_works = yes; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_ALLOCA 1 -_ACEOF +$as_echo "#define HAVE_ALLOCA 1" >>confdefs.h else # The SVR3 libPW and SVR4 libucb both contain incompatible functions @@ -5512,23 +6037,21 @@ else # contain a buggy version. If you still want to use their alloca, # use ar to extract alloca.o from them instead of compiling alloca.c. + + + + ALLOCA=\${LIBOBJDIR}alloca.$ac_objext -cat >>confdefs.h <<\_ACEOF -#define C_ALLOCA 1 -_ACEOF +$as_echo "#define C_ALLOCA 1" >>confdefs.h -{ $as_echo "$as_me:$LINENO: checking whether \`alloca.c' needs Cray hooks" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether \`alloca.c' needs Cray hooks" >&5 $as_echo_n "checking whether \`alloca.c' needs Cray hooks... " >&6; } -if test "${ac_cv_os_cray+set}" = set; then +if test "${ac_cv_os_cray+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if defined CRAY && ! defined CRAY2 webecray @@ -5538,7 +6061,7 @@ wenotbecray _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "webecray" >/dev/null 2>&1; then + $EGREP "webecray" >/dev/null 2>&1; then : ac_cv_os_cray=yes else ac_cv_os_cray=no @@ -5546,97 +6069,14 @@ fi rm -f conftest* fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_os_cray" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_os_cray" >&5 $as_echo "$ac_cv_os_cray" >&6; } if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if test `eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` = yes; then +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +eval as_val=\$$as_ac_var + if test "x$as_val" = x""yes; then : cat >>confdefs.h <<_ACEOF #define CRAY_STACKSEG_END $ac_func @@ -5648,19 +6088,15 @@ fi done fi -{ $as_echo "$as_me:$LINENO: checking stack direction for C alloca" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5 $as_echo_n "checking stack direction for C alloca... " >&6; } -if test "${ac_cv_c_stack_direction+set}" = set; then +if test "${ac_cv_c_stack_direction+set}" = set; then : $as_echo_n "(cached) " >&6 else - if test "$cross_compiling" = yes; then + if test "$cross_compiling" = yes; then : ac_cv_c_stack_direction=0 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int @@ -5683,45 +6119,18 @@ main () return find_stack_direction () < 0; } _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_run "$LINENO"; then : ac_cv_c_stack_direction=1 else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_c_stack_direction=-1 + ac_cv_c_stack_direction=-1 fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi - fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_stack_direction" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5 $as_echo "$ac_cv_c_stack_direction" >&6; } - cat >>confdefs.h <<_ACEOF #define STACK_DIRECTION $ac_cv_c_stack_direction _ACEOF @@ -5730,148 +6139,22 @@ _ACEOF fi + GNULIB_INET_NTOP=0; + GNULIB_INET_PTON=0; + HAVE_DECL_INET_NTOP=1; + HAVE_DECL_INET_PTON=1; + ARPA_INET_H=''; -for ac_header in stdlib.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_compiler=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-coreutils@gnu.org ## -## ------------------------------------ ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - -fi -if test `eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` = yes; then + for ac_header in $ac_header_list +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +eval as_val=\$$as_ac_Header + if test "x$as_val" = x""yes; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF @@ -5880,521 +6163,148 @@ fi done -{ $as_echo "$as_me:$LINENO: checking for GNU libc compatible malloc" >&5 -$as_echo_n "checking for GNU libc compatible malloc... " >&6; } -if test "${ac_cv_func_malloc_0_nonnull+set}" = set; then + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the preprocessor supports include_next" >&5 +$as_echo_n "checking whether the preprocessor supports include_next... " >&6; } +if test "${gl_cv_have_include_next+set}" = set; then : $as_echo_n "(cached) " >&6 else - if test "$cross_compiling" = yes; then - ac_cv_func_malloc_0_nonnull=no -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#if defined STDC_HEADERS || defined HAVE_STDLIB_H -# include + rm -rf conftestd1a conftestd1b conftestd2 + mkdir conftestd1a conftestd1b conftestd2 + cat < conftestd1a/conftest.h +#define DEFINED_IN_CONFTESTD1 +#include_next +#ifdef DEFINED_IN_CONFTESTD2 +int foo; #else -char *malloc (); +#error "include_next doesn't work" #endif - -int -main () -{ -return ! malloc (0); - ; - return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_malloc_0_nonnull=yes -else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_func_malloc_0_nonnull=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi - - -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_malloc_0_nonnull" >&5 -$as_echo "$ac_cv_func_malloc_0_nonnull" >&6; } -if test $ac_cv_func_malloc_0_nonnull = yes; then - gl_cv_func_malloc_0_nonnull=1 -else - gl_cv_func_malloc_0_nonnull=0 -fi - - - -cat >>confdefs.h <<_ACEOF -#define MALLOC_0_IS_NONNULL $gl_cv_func_malloc_0_nonnull -_ACEOF - - - - { $as_echo "$as_me:$LINENO: checking for long long int" >&5 -$as_echo_n "checking for long long int... " >&6; } -if test "${ac_cv_type_long_long_int+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +EOF + cat < conftestd1b/conftest.h +#define DEFINED_IN_CONFTESTD1 +#include +#include_next +#ifdef DEFINED_IN_CONFTESTD2 +int foo; +#else +#error "include_next doesn't work" +#endif +EOF + cat < conftestd2/conftest.h +#ifndef DEFINED_IN_CONFTESTD1 +#error "include_next test doesn't work" +#endif +#define DEFINED_IN_CONFTESTD2 +EOF + gl_save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$gl_save_CPPFLAGS -Iconftestd1b -Iconftestd2" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -long long int ll = 9223372036854775807ll; - long long int nll = -9223372036854775807LL; - typedef int a[((-9223372036854775807LL < 0 - && 0 < 9223372036854775807ll) - ? 1 : -1)]; - int i = 63; -int -main () -{ -long long int llmax = 9223372036854775807ll; - return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i) - | (llmax / ll) | (llmax % ll)); - ; - return 0; -} +#include _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - if test "$cross_compiling" = yes; then - ac_cv_type_long_long_int=yes +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_have_include_next=yes else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + CPPFLAGS="$gl_save_CPPFLAGS -Iconftestd1a -Iconftestd2" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include - #ifndef LLONG_MAX - # define HALF \ - (1LL << (sizeof (long long int) * CHAR_BIT - 2)) - # define LLONG_MAX (HALF - 1 + HALF) - #endif -int -main () -{ -long long int n = 1; - int i; - for (i = 0; ; i++) - { - long long int m = n << i; - if (m >> i != n) - return 1; - if (LLONG_MAX / 2 < m) - break; - } - return 0; - ; - return 0; -} +#include _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_type_long_long_int=yes +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_have_include_next=buggy else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_type_long_long_int=no + gl_cv_have_include_next=no fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi - - -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_long_long_int=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_long_long_int" >&5 -$as_echo "$ac_cv_type_long_long_int" >&6; } - if test $ac_cv_type_long_long_int = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_LONG_LONG_INT 1 -_ACEOF - - fi - - - { $as_echo "$as_me:$LINENO: checking for long double" >&5 -$as_echo_n "checking for long double... " >&6; } -if test "${gt_cv_c_long_double+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test "$GCC" = yes; then - gt_cv_c_long_double=yes - else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - - /* The Stardent Vistra knows sizeof(long double), but does not support it. */ - long double foo = 0.0; - /* On Ultrix 4.3 cc, long double is 4 and double is 8. */ - int array [2*(sizeof(long double) >= sizeof(double)) - 1]; - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - gt_cv_c_long_double=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - gt_cv_c_long_double=no -fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi + fi -{ $as_echo "$as_me:$LINENO: result: $gt_cv_c_long_double" >&5 -$as_echo "$gt_cv_c_long_double" >&6; } - if test $gt_cv_c_long_double = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_LONG_DOUBLE 1 -_ACEOF +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CPPFLAGS="$gl_save_CPPFLAGS" + rm -rf conftestd1a conftestd1b conftestd2 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_include_next" >&5 +$as_echo "$gl_cv_have_include_next" >&6; } + PRAGMA_SYSTEM_HEADER= + if test $gl_cv_have_include_next = yes; then + INCLUDE_NEXT=include_next + INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include_next + if test -n "$GCC"; then + PRAGMA_SYSTEM_HEADER='#pragma GCC system_header' + fi + else + if test $gl_cv_have_include_next = buggy; then + INCLUDE_NEXT=include + INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include_next + else + INCLUDE_NEXT=include + INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include + fi fi - -for ac_header in $ac_header_list -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-coreutils@gnu.org ## -## ------------------------------------ ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - -fi -if test `eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - - -{ $as_echo "$as_me:$LINENO: checking for d_ino member in directory struct" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for d_ino member in directory struct" >&5 $as_echo_n "checking for d_ino member in directory struct... " >&6; } -if test "${jm_cv_struct_dirent_d_ino+set}" = set; then +if test "${gl_cv_struct_dirent_d_ino+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + if test "$cross_compiling" = yes; then : + gl_cv_struct_dirent_d_ino=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - #include -#include + #include + #include int main () { -struct dirent dp; dp.d_ino = 0; +DIR *dp = opendir ("."); + struct dirent *e; + struct stat st; + if (! dp) + return 1; + e = readdir (dp); + return ! (e + && stat (e->d_name, &st) == 0 + && e->d_ino == st.st_ino); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - jm_cv_struct_dirent_d_ino=yes +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_struct_dirent_d_ino=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - jm_cv_struct_dirent_d_ino=no + gl_cv_struct_dirent_d_ino=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext - - fi -{ $as_echo "$as_me:$LINENO: result: $jm_cv_struct_dirent_d_ino" >&5 -$as_echo "$jm_cv_struct_dirent_d_ino" >&6; } - if test $jm_cv_struct_dirent_d_ino = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_struct_dirent_d_ino" >&5 +$as_echo "$gl_cv_struct_dirent_d_ino" >&6; } + if test $gl_cv_struct_dirent_d_ino = yes; then -cat >>confdefs.h <<\_ACEOF -#define D_INO_IN_DIRENT 1 -_ACEOF +$as_echo "#define D_INO_IN_DIRENT 1" >>confdefs.h fi - { $as_echo "$as_me:$LINENO: checking whether system is Windows or MSDOS" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether system is Windows or MSDOS" >&5 $as_echo_n "checking whether system is Windows or MSDOS... " >&6; } -if test "${ac_cv_win_or_dos+set}" = set; then +if test "${ac_cv_win_or_dos+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -6407,52 +6317,27 @@ neither MSDOS nor Windows return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_win_or_dos=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_win_or_dos=no + ac_cv_win_or_dos=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_win_or_dos" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_win_or_dos" >&5 $as_echo "$ac_cv_win_or_dos" >&6; } if test x"$ac_cv_win_or_dos" = xyes; then ac_fs_accepts_drive_letter_prefix=1 ac_fs_backslash_is_file_name_separator=1 - { $as_echo "$as_me:$LINENO: checking whether drive letter can start relative path" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether drive letter can start relative path" >&5 $as_echo_n "checking whether drive letter can start relative path... " >&6; } -if test "${ac_cv_drive_letter_can_be_relative+set}" = set; then +if test "${ac_cv_drive_letter_can_be_relative+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -6465,36 +6350,15 @@ drive letters are always absolute return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_drive_letter_can_be_relative=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_drive_letter_can_be_relative=no + ac_cv_drive_letter_can_be_relative=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_drive_letter_can_be_relative" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_drive_letter_can_be_relative" >&5 $as_echo "$ac_cv_drive_letter_can_be_relative" >&6; } if test x"$ac_cv_drive_letter_can_be_relative" = xyes; then ac_fs_drive_letter_can_be_relative=1 @@ -6516,7 +6380,6 @@ _ACEOF - cat >>confdefs.h <<_ACEOF #define FILE_SYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR $ac_fs_backslash_is_file_name_separator _ACEOF @@ -6528,9 +6391,9 @@ cat >>confdefs.h <<_ACEOF _ACEOF -{ $as_echo "$as_me:$LINENO: checking for long file names" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for long file names" >&5 $as_echo_n "checking for long file names... " >&6; } -if test "${ac_cv_sys_long_file_names+set}" = set; then +if test "${ac_cv_sys_long_file_names+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_cv_sys_long_file_names=yes @@ -6560,109 +6423,23 @@ for ac_dir in . "$TMPDIR" /tmp /var/tmp /usr/tmp "$prefix/lib" "$exec_prefix/lib test $ac_cv_sys_long_file_names = no && break done fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_sys_long_file_names" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_long_file_names" >&5 $as_echo "$ac_cv_sys_long_file_names" >&6; } if test $ac_cv_sys_long_file_names = yes; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_LONG_FILE_NAMES 1 -_ACEOF +$as_echo "#define HAVE_LONG_FILE_NAMES 1" >>confdefs.h fi - -for ac_func in $ac_func_list -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if test `eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` = yes; then + for ac_func in $ac_func_list +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +eval as_val=\$$as_ac_var + if test "x$as_val" = x""yes; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF @@ -6672,145 +6449,45 @@ done -{ $as_echo "$as_me:$LINENO: checking for inline" >&5 -$as_echo_n "checking for inline... " >&6; } -if test "${ac_cv_c_inline+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_cv_c_inline=no -for ac_kw in inline __inline__ __inline; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifndef __cplusplus -typedef int foo_t; -static $ac_kw foo_t static_foo () {return 0; } -$ac_kw foo_t foo () {return 0; } -#endif - -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_c_inline=$ac_kw -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - test "$ac_cv_c_inline" != no && break -done - -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5 -$as_echo "$ac_cv_c_inline" >&6; } - - -case $ac_cv_c_inline in - inline | yes) ;; - *) - case $ac_cv_c_inline in - no) ac_val=;; - *) ac_val=$ac_cv_c_inline;; - esac - cat >>confdefs.h <<_ACEOF -#ifndef __cplusplus -#define inline $ac_val -#endif -_ACEOF - ;; -esac - -{ $as_echo "$as_me:$LINENO: checking for C/C++ restrict keyword" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C/C++ restrict keyword" >&5 $as_echo_n "checking for C/C++ restrict keyword... " >&6; } -if test "${ac_cv_c_restrict+set}" = set; then +if test "${ac_cv_c_restrict+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_cv_c_restrict=no - # Try the official restrict keyword, then gcc's __restrict, and - # the less common variants. - for ac_kw in restrict __restrict __restrict__ _Restrict; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + # The order here caters to the fact that C++ does not require restrict. + for ac_kw in __restrict __restrict__ _Restrict restrict; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ typedef int * int_ptr; - int foo (int_ptr $ac_kw ip) { - return ip[0]; + int foo (int_ptr $ac_kw ip) { + return ip[0]; } int main () { int s[1]; - int * $ac_kw t = s; - t[0] = 0; - return foo(t) + int * $ac_kw t = s; + t[0] = 0; + return foo(t) ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_restrict=$ac_kw -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext test "$ac_cv_c_restrict" != no && break done fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_restrict" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_restrict" >&5 $as_echo "$ac_cv_c_restrict" >&6; } + case $ac_cv_c_restrict in restrict) ;; - no) -cat >>confdefs.h <<\_ACEOF -#define restrict -_ACEOF + no) $as_echo "#define restrict /**/" >>confdefs.h ;; *) cat >>confdefs.h <<_ACEOF #define restrict $ac_cv_c_restrict @@ -6819,16 +6496,186 @@ _ACEOF esac - { $as_echo "$as_me:$LINENO: checking whether strtold conforms to C99" >&5 -$as_echo_n "checking whether strtold conforms to C99... " >&6; } -if test "${gl_cv_func_c99_strtold+set}" = set; then + GNULIB_BTOWC=0; + GNULIB_WCTOB=0; + GNULIB_MBSINIT=0; + GNULIB_MBRTOWC=0; + GNULIB_MBRLEN=0; + GNULIB_MBSRTOWCS=0; + GNULIB_MBSNRTOWCS=0; + GNULIB_WCRTOMB=0; + GNULIB_WCSRTOMBS=0; + GNULIB_WCSNRTOMBS=0; + GNULIB_WCWIDTH=0; + HAVE_BTOWC=1; + HAVE_MBSINIT=1; + HAVE_MBRTOWC=1; + HAVE_MBRLEN=1; + HAVE_MBSRTOWCS=1; + HAVE_MBSNRTOWCS=1; + HAVE_WCRTOMB=1; + HAVE_WCSRTOMBS=1; + HAVE_WCSNRTOMBS=1; + HAVE_DECL_WCTOB=1; + HAVE_DECL_WCWIDTH=1; + REPLACE_MBSTATE_T=0; + REPLACE_BTOWC=0; + REPLACE_WCTOB=0; + REPLACE_MBSINIT=0; + REPLACE_MBRTOWC=0; + REPLACE_MBRLEN=0; + REPLACE_MBSRTOWCS=0; + REPLACE_MBSNRTOWCS=0; + REPLACE_WCRTOMB=0; + REPLACE_WCSRTOMBS=0; + REPLACE_WCSNRTOMBS=0; + REPLACE_WCWIDTH=0; + WCHAR_H=''; + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nl_langinfo and CODESET" >&5 +$as_echo_n "checking for nl_langinfo and CODESET... " >&6; } +if test "${am_cv_langinfo_codeset+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +char* cs = nl_langinfo(CODESET); return !cs; + ; + return 0; +} _ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + am_cv_langinfo_codeset=yes +else + am_cv_langinfo_codeset=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_langinfo_codeset" >&5 +$as_echo "$am_cv_langinfo_codeset" >&6; } + if test $am_cv_langinfo_codeset = yes; then + +$as_echo "#define HAVE_LANGINFO_CODESET 1" >>confdefs.h + + fi + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5 +$as_echo_n "checking for a traditional french locale... " >&6; } +if test "${gt_cv_locale_fr+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () { + /* Check whether the given locale name is recognized by the system. */ + if (setlocale (LC_ALL, "") == NULL) return 1; + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only + one byte long. This excludes the UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1; + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO-8859-1 + else + # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name. + if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO8859-1 + else + # Test for the HP-UX locale name. + if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.iso88591 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr + else + # None found. + gt_cv_locale_fr=none + fi + fi + fi + fi + fi + fi + rm -fr conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5 +$as_echo "$gt_cv_locale_fr" >&6; } + LOCALE_FR=$gt_cv_locale_fr + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strtold conforms to C99" >&5 +$as_echo_n "checking whether strtold conforms to C99... " >&6; } +if test "${gl_cv_func_c99_strtold+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* On HP-UX before 11.23, strtold returns a struct instead of long double. Reject implementations like that, by requiring @@ -6850,102 +6697,25 @@ return test ("1.0", NULL) != 1 || p ("1.0", NULL) != 1; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then +if ac_fn_c_try_link "$LINENO"; then : gl_cv_func_c99_strtold=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - gl_cv_func_c99_strtold=no + gl_cv_func_c99_strtold=no fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_c99_strtold" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_c99_strtold" >&5 $as_echo "$gl_cv_func_c99_strtold" >&6; } if test $gl_cv_func_c99_strtold = yes; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_C99_STRTOLD 1 -_ACEOF +$as_echo "#define HAVE_C99_STRTOLD 1" >>confdefs.h fi -{ $as_echo "$as_me:$LINENO: checking for size_t" >&5 -$as_echo_n "checking for size_t... " >&6; } -if test "${ac_cv_type_size_t+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -typedef size_t ac__type_new_; -int -main () -{ -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type_size_t=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" +if test "x$ac_cv_type_size_t" = x""yes; then : - ac_cv_type_size_t=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 -$as_echo "$ac_cv_type_size_t" >&6; } -if test $ac_cv_type_size_t = yes; then - : else cat >>confdefs.h <<_ACEOF @@ -6955,112 +6725,153 @@ _ACEOF fi - -{ $as_echo "$as_me:$LINENO: checking whether canonicalize_file_name is declared" >&5 -$as_echo_n "checking whether canonicalize_file_name is declared... " >&6; } -if test "${ac_cv_have_decl_canonicalize_file_name+set}" = set; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether malloc, realloc, calloc are POSIX compliant" >&5 +$as_echo_n "checking whether malloc, realloc, calloc are POSIX compliant... " >&6; } +if test "${gl_cv_func_malloc_posix+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -$ac_includes_default + int main () { -#ifndef canonicalize_file_name - (void) canonicalize_file_name; -#endif +#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ + choke me + #endif ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_canonicalize_file_name=yes +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_func_malloc_posix=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_canonicalize_file_name=no + gl_cv_func_malloc_posix=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_malloc_posix" >&5 +$as_echo "$gl_cv_func_malloc_posix" >&6; } + + + GNULIB_MALLOC_POSIX=0; + GNULIB_REALLOC_POSIX=0; + GNULIB_CALLOC_POSIX=0; + GNULIB_ATOLL=0; + GNULIB_GETLOADAVG=0; + GNULIB_GETSUBOPT=0; + GNULIB_MKDTEMP=0; + GNULIB_MKSTEMP=0; + GNULIB_PUTENV=0; + GNULIB_RANDOM_R=0; + GNULIB_RPMATCH=0; + GNULIB_SETENV=0; + GNULIB_STRTOD=0; + GNULIB_STRTOLL=0; + GNULIB_STRTOULL=0; + GNULIB_UNSETENV=0; + HAVE_ATOLL=1; + HAVE_CALLOC_POSIX=1; + HAVE_GETSUBOPT=1; + HAVE_MALLOC_POSIX=1; + HAVE_MKDTEMP=1; + HAVE_REALLOC_POSIX=1; + HAVE_RANDOM_R=1; + HAVE_RPMATCH=1; + HAVE_SETENV=1; + HAVE_STRTOD=1; + HAVE_STRTOLL=1; + HAVE_STRTOULL=1; + HAVE_STRUCT_RANDOM_DATA=1; + HAVE_SYS_LOADAVG_H=0; + HAVE_UNSETENV=1; + HAVE_DECL_GETLOADAVG=1; + REPLACE_MKSTEMP=0; + REPLACE_PUTENV=0; + REPLACE_STRTOD=0; + VOID_UNSETENV=0; + + + +ac_fn_c_check_decl "$LINENO" "canonicalize_file_name" "ac_cv_have_decl_canonicalize_file_name" "$ac_includes_default" +if test "x$ac_cv_have_decl_canonicalize_file_name" = x""yes; then : + ac_have_decl=1 +else + ac_have_decl=0 fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_canonicalize_file_name" >&5 -$as_echo "$ac_cv_have_decl_canonicalize_file_name" >&6; } -if test $ac_cv_have_decl_canonicalize_file_name = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_CANONICALIZE_FILE_NAME 1 +#define HAVE_DECL_CANONICALIZE_FILE_NAME $ac_have_decl _ACEOF -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_CANONICALIZE_FILE_NAME 0 -_ACEOF - - -fi - - - GNULIB_CHOWN=0; + GNULIB_CLOSE=0; GNULIB_DUP2=0; + GNULIB_ENVIRON=0; + GNULIB_EUIDACCESS=0; GNULIB_FCHDIR=0; + GNULIB_FSYNC=0; GNULIB_FTRUNCATE=0; GNULIB_GETCWD=0; + GNULIB_GETDOMAINNAME=0; + GNULIB_GETDTABLESIZE=0; + GNULIB_GETHOSTNAME=0; GNULIB_GETLOGIN_R=0; + GNULIB_GETPAGESIZE=0; + GNULIB_GETUSERSHELL=0; + GNULIB_LCHOWN=0; + GNULIB_LINK=0; + GNULIB_LSEEK=0; GNULIB_READLINK=0; + GNULIB_SLEEP=0; + GNULIB_UNISTD_H_SIGPIPE=0; + GNULIB_WRITE=0; HAVE_DUP2=1; + HAVE_EUIDACCESS=1; + HAVE_FSYNC=1; HAVE_FTRUNCATE=1; + HAVE_GETDOMAINNAME=1; + HAVE_GETDTABLESIZE=1; + HAVE_GETHOSTNAME=1; + HAVE_GETPAGESIZE=1; + HAVE_GETUSERSHELL=1; + HAVE_LINK=1; HAVE_READLINK=1; + HAVE_SLEEP=1; + HAVE_DECL_ENVIRON=1; HAVE_DECL_GETLOGIN_R=1; + HAVE_OS_H=0; + HAVE_SYS_PARAM_H=0; REPLACE_CHOWN=0; + REPLACE_CLOSE=0; REPLACE_FCHDIR=0; REPLACE_GETCWD=0; + REPLACE_GETPAGESIZE=0; + REPLACE_LCHOWN=0; + REPLACE_LSEEK=0; + REPLACE_WRITE=0; + UNISTD_H_HAVE_WINSOCK2_H=0; -{ $as_echo "$as_me:$LINENO: checking for uid_t in sys/types.h" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uid_t in sys/types.h" >&5 $as_echo_n "checking for uid_t in sys/types.h... " >&6; } -if test "${ac_cv_type_uid_t+set}" = set; then +if test "${ac_cv_type_uid_t+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "uid_t" >/dev/null 2>&1; then + $EGREP "uid_t" >/dev/null 2>&1; then : ac_cv_type_uid_t=yes else ac_cv_type_uid_t=no @@ -7068,184 +6879,38 @@ fi rm -f conftest* fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_uid_t" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uid_t" >&5 $as_echo "$ac_cv_type_uid_t" >&6; } if test $ac_cv_type_uid_t = no; then -cat >>confdefs.h <<\_ACEOF -#define uid_t int -_ACEOF +$as_echo "#define uid_t int" >>confdefs.h -cat >>confdefs.h <<\_ACEOF -#define gid_t int -_ACEOF +$as_echo "#define gid_t int" >>confdefs.h fi - for ac_header in unistd.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-coreutils@gnu.org ## -## ------------------------------------ ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - -fi -if test `eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` = yes; then +do : + ac_fn_c_check_header_mongrel "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default" +if test "x$ac_cv_header_unistd_h" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define HAVE_UNISTD_H 1 _ACEOF fi done -{ $as_echo "$as_me:$LINENO: checking for working chown" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working chown" >&5 $as_echo_n "checking for working chown... " >&6; } -if test "${ac_cv_func_chown_works+set}" = set; then +if test "${ac_cv_func_chown_works+set}" = set; then : $as_echo_n "(cached) " >&6 else - if test "$cross_compiling" = yes; then + if test "$cross_compiling" = yes; then : ac_cv_func_chown_works=no else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default #include @@ -7270,70 +6935,38 @@ main () return 0; } _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_chown_works=yes else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_func_chown_works=no + ac_cv_func_chown_works=no fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi - rm -f conftest.chown fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_chown_works" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_chown_works" >&5 $as_echo "$ac_cv_func_chown_works" >&6; } if test $ac_cv_func_chown_works = yes; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_CHOWN 1 -_ACEOF +$as_echo "#define HAVE_CHOWN 1" >>confdefs.h fi - { $as_echo "$as_me:$LINENO: checking whether chown(2) dereferences symlinks" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether chown(2) dereferences symlinks" >&5 $as_echo_n "checking whether chown(2) dereferences symlinks... " >&6; } -if test "${gl_cv_func_chown_follows_symlink+set}" = set; then +if test "${gl_cv_func_chown_follows_symlink+set}" = set; then : $as_echo_n "(cached) " >&6 else - if test "$cross_compiling" = yes; then + if test "$cross_compiling" = yes; then : gl_cv_func_chown_follows_symlink=yes else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -7356,60 +6989,346 @@ cat >>conftest.$ac_ext <<_ACEOF } _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_run "$LINENO"; then : gl_cv_func_chown_follows_symlink=yes else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -gl_cv_func_chown_follows_symlink=no + gl_cv_func_chown_follows_symlink=no fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi - fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_chown_follows_symlink" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_chown_follows_symlink" >&5 $as_echo "$gl_cv_func_chown_follows_symlink" >&6; } if test $gl_cv_func_chown_follows_symlink = no; then -cat >>confdefs.h <<\_ACEOF -#define CHOWN_MODIFIES_SYMLINK 1 -_ACEOF +$as_echo "#define CHOWN_MODIFIES_SYMLINK 1" >>confdefs.h fi + GNULIB_IOCTL=0; + SYS_IOCTL_H_HAVE_WINSOCK2_H=0; + SYS_IOCTL_H=''; - { $as_echo "$as_me:$LINENO: checking whether // is distinct from /" >&5 + + + + GNULIB_FPRINTF=0; + GNULIB_FPRINTF_POSIX=0; + GNULIB_PRINTF=0; + GNULIB_PRINTF_POSIX=0; + GNULIB_SNPRINTF=0; + GNULIB_SPRINTF_POSIX=0; + GNULIB_VFPRINTF=0; + GNULIB_VFPRINTF_POSIX=0; + GNULIB_VPRINTF=0; + GNULIB_VPRINTF_POSIX=0; + GNULIB_VSNPRINTF=0; + GNULIB_VSPRINTF_POSIX=0; + GNULIB_DPRINTF=0; + GNULIB_VDPRINTF=0; + GNULIB_VASPRINTF=0; + GNULIB_OBSTACK_PRINTF=0; + GNULIB_OBSTACK_PRINTF_POSIX=0; + GNULIB_FOPEN=0; + GNULIB_FREOPEN=0; + GNULIB_FSEEK=0; + GNULIB_FSEEKO=0; + GNULIB_FTELL=0; + GNULIB_FTELLO=0; + GNULIB_FFLUSH=0; + GNULIB_FCLOSE=0; + GNULIB_FPUTC=0; + GNULIB_PUTC=0; + GNULIB_PUTCHAR=0; + GNULIB_FPUTS=0; + GNULIB_PUTS=0; + GNULIB_FWRITE=0; + GNULIB_GETDELIM=0; + GNULIB_GETLINE=0; + GNULIB_PERROR=0; + GNULIB_STDIO_H_SIGPIPE=0; + REPLACE_STDIO_WRITE_FUNCS=0; + REPLACE_FPRINTF=0; + REPLACE_VFPRINTF=0; + REPLACE_PRINTF=0; + REPLACE_VPRINTF=0; + REPLACE_SNPRINTF=0; + HAVE_DECL_SNPRINTF=1; + REPLACE_VSNPRINTF=0; + HAVE_DECL_VSNPRINTF=1; + REPLACE_SPRINTF=0; + REPLACE_VSPRINTF=0; + HAVE_DPRINTF=1; + REPLACE_DPRINTF=0; + HAVE_VDPRINTF=1; + REPLACE_VDPRINTF=0; + HAVE_VASPRINTF=1; + REPLACE_VASPRINTF=0; + HAVE_DECL_OBSTACK_PRINTF=1; + REPLACE_OBSTACK_PRINTF=0; + REPLACE_FOPEN=0; + REPLACE_FREOPEN=0; + HAVE_FSEEKO=1; + REPLACE_FSEEKO=0; + REPLACE_FSEEK=0; + HAVE_FTELLO=1; + REPLACE_FTELLO=0; + REPLACE_FTELL=0; + REPLACE_FFLUSH=0; + REPLACE_FCLOSE=0; + HAVE_DECL_GETDELIM=1; + HAVE_DECL_GETLINE=1; + REPLACE_GETLINE=0; + REPLACE_PERROR=0; + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 +$as_echo_n "checking whether byte ordering is bigendian... " >&6; } +if test "${ac_cv_c_bigendian+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_c_bigendian=unknown + # See if we're dealing with a universal compiler. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __APPLE_CC__ + not a universal capable compiler + #endif + typedef int dummy; + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + # Check for potential -arch flags. It is not universal unless + # there are at least two -arch flags with different values. + ac_arch= + ac_prev= + for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do + if test -n "$ac_prev"; then + case $ac_word in + i?86 | x86_64 | ppc | ppc64) + if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then + ac_arch=$ac_word + else + ac_cv_c_bigendian=universal + break + fi + ;; + esac + ac_prev= + elif test "x$ac_word" = "x-arch"; then + ac_prev=arch + fi + done +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if test $ac_cv_c_bigendian = unknown; then + # See if sys/param.h defines the BYTE_ORDER macro. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + +int +main () +{ +#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ + && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ + && LITTLE_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + # It does; now see whether it defined to BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + +int +main () +{ +#if BYTE_ORDER != BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_bigendian=yes +else + ac_cv_c_bigendian=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main () +{ +#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + # It does; now see whether it defined to _BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main () +{ +#ifndef _BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_bigendian=yes +else + ac_cv_c_bigendian=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # Compile a test program. + if test "$cross_compiling" = yes; then : + # Try to guess by grepping values from an object file. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +short int ascii_mm[] = + { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; + short int ascii_ii[] = + { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; + int use_ascii (int i) { + return ascii_mm[i] + ascii_ii[i]; + } + short int ebcdic_ii[] = + { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; + short int ebcdic_mm[] = + { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; + int use_ebcdic (int i) { + return ebcdic_mm[i] + ebcdic_ii[i]; + } + extern int foo; + +int +main () +{ +return use_ascii (foo) == use_ebcdic (foo); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then + ac_cv_c_bigendian=yes + fi + if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then + if test "$ac_cv_c_bigendian" = unknown; then + ac_cv_c_bigendian=no + else + # finding both strings is unlikely to happen, but who knows? + ac_cv_c_bigendian=unknown + fi + fi +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ + + /* Are we little or big endian? From Harbison&Steele. */ + union + { + long int l; + char c[sizeof (long int)]; + } u; + u.l = 1; + return u.c[sizeof (long int) - 1] == 1; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_c_bigendian=no +else + ac_cv_c_bigendian=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 +$as_echo "$ac_cv_c_bigendian" >&6; } + case $ac_cv_c_bigendian in #( + yes) + $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h +;; #( + no) + ;; #( + universal) + +$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h + + ;; #( + *) + as_fn_error "unknown endianness + presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; + esac + + + + GNULIB_DIRFD=0; + GNULIB_SCANDIR=0; + GNULIB_ALPHASORT=0; + HAVE_DECL_DIRFD=1; + HAVE_SCANDIR=1; + HAVE_ALPHASORT=1; + DIRENT_H=''; + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether // is distinct from /" >&5 $as_echo_n "checking whether // is distinct from /... " >&6; } -if test "${gl_cv_double_slash_root+set}" = set; then +if test "${gl_cv_double_slash_root+set}" = set; then : $as_echo_n "(cached) " >&6 else if test x"$cross_compiling" = xyes ; then @@ -7428,205 +7347,374 @@ else gl_cv_double_slash_root='unknown, assuming no' ;; esac else - set x `ls -di / //` - if test $2 = $4 && wc //dev/null >/dev/null 2>&1; then + set x `ls -di / // 2>/dev/null` + if test "$2" = "$4" && wc //dev/null >/dev/null 2>&1; then gl_cv_double_slash_root=no else gl_cv_double_slash_root=yes fi fi fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_double_slash_root" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_double_slash_root" >&5 $as_echo "$gl_cv_double_slash_root" >&6; } if test "$gl_cv_double_slash_root" = yes; then -cat >>confdefs.h <<\_ACEOF -#define DOUBLE_SLASH_IS_DISTINCT_ROOT 1 -_ACEOF +$as_echo "#define DOUBLE_SLASH_IS_DISTINCT_ROOT 1" >>confdefs.h fi -{ $as_echo "$as_me:$LINENO: checking whether strerror_r is declared" >&5 -$as_echo_n "checking whether strerror_r is declared... " >&6; } -if test "${ac_cv_have_decl_strerror_r+set}" = set; then + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for complete errno.h" >&5 +$as_echo_n "checking for complete errno.h... " >&6; } +if test "${gl_cv_header_errno_h_complete+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef strerror_r - (void) strerror_r; + +#include +#if !defined ENOMSG +booboo +#endif +#if !defined EIDRM +booboo +#endif +#if !defined ENOLINK +booboo +#endif +#if !defined EPROTO +booboo +#endif +#if !defined EMULTIHOP +booboo +#endif +#if !defined EBADMSG +booboo +#endif +#if !defined EOVERFLOW +booboo +#endif +#if !defined ENOTSUP +booboo +#endif +#if !defined ECANCELED +booboo #endif - ; - return 0; -} _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_strerror_r=yes +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "booboo" >/dev/null 2>&1; then : + gl_cv_header_errno_h_complete=no else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + gl_cv_header_errno_h_complete=yes +fi +rm -f conftest* + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_complete" >&5 +$as_echo "$gl_cv_header_errno_h_complete" >&6; } + if test $gl_cv_header_errno_h_complete = yes; then + ERRNO_H='' + else + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_errno_h='<'errno.h'>' + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +$as_echo_n "checking absolute name of ... " >&6; } +if test "${gl_cv_next_errno_h+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + if test $ac_cv_header_errno_h = yes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + gl_cv_next_errno_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n '\#/errno.h#{ + s#.*"\(.*/errno.h\)".*#\1# + s#^/[^/]#//&# + p + q + }'`'"' + else + gl_cv_next_errno_h='<'errno.h'>' + fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_errno_h" >&5 +$as_echo "$gl_cv_next_errno_h" >&6; } + fi + NEXT_ERRNO_H=$gl_cv_next_errno_h + + + + ERRNO_H='errno.h' + fi + + + if test -n "$ERRNO_H"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EMULTIHOP value" >&5 +$as_echo_n "checking for EMULTIHOP value... " >&6; } +if test "${gl_cv_header_errno_h_EMULTIHOP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifdef EMULTIHOP +yes +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "yes" >/dev/null 2>&1; then : + gl_cv_header_errno_h_EMULTIHOP=yes +else + gl_cv_header_errno_h_EMULTIHOP=no +fi +rm -f conftest* + + if test $gl_cv_header_errno_h_EMULTIHOP = no; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#define _XOPEN_SOURCE_EXTENDED 1 +#include +#ifdef EMULTIHOP +yes +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "yes" >/dev/null 2>&1; then : + gl_cv_header_errno_h_EMULTIHOP=hidden +fi +rm -f conftest* + + if test $gl_cv_header_errno_h_EMULTIHOP = hidden; then + if ac_fn_c_compute_int "$LINENO" "EMULTIHOP" "gl_cv_header_errno_h_EMULTIHOP" " +#define _XOPEN_SOURCE_EXTENDED 1 +#include +/* The following two lines are a workaround against an autoconf-2.52 bug. */ +#include +#include +"; then : - ac_cv_have_decl_strerror_r=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_EMULTIHOP" >&5 +$as_echo "$gl_cv_header_errno_h_EMULTIHOP" >&6; } + case $gl_cv_header_errno_h_EMULTIHOP in + yes | no) + EMULTIHOP_HIDDEN=0; EMULTIHOP_VALUE= + ;; + *) + EMULTIHOP_HIDDEN=1; EMULTIHOP_VALUE="$gl_cv_header_errno_h_EMULTIHOP" + ;; + esac + + + fi + + + if test -n "$ERRNO_H"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ENOLINK value" >&5 +$as_echo_n "checking for ENOLINK value... " >&6; } +if test "${gl_cv_header_errno_h_ENOLINK+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifdef ENOLINK +yes +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "yes" >/dev/null 2>&1; then : + gl_cv_header_errno_h_ENOLINK=yes +else + gl_cv_header_errno_h_ENOLINK=no +fi +rm -f conftest* + + if test $gl_cv_header_errno_h_ENOLINK = no; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#define _XOPEN_SOURCE_EXTENDED 1 +#include +#ifdef ENOLINK +yes +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "yes" >/dev/null 2>&1; then : + gl_cv_header_errno_h_ENOLINK=hidden +fi +rm -f conftest* + + if test $gl_cv_header_errno_h_ENOLINK = hidden; then + if ac_fn_c_compute_int "$LINENO" "ENOLINK" "gl_cv_header_errno_h_ENOLINK" " +#define _XOPEN_SOURCE_EXTENDED 1 +#include +/* The following two lines are a workaround against an autoconf-2.52 bug. */ +#include +#include +"; then : + +fi + + fi + fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_ENOLINK" >&5 +$as_echo "$gl_cv_header_errno_h_ENOLINK" >&6; } + case $gl_cv_header_errno_h_ENOLINK in + yes | no) + ENOLINK_HIDDEN=0; ENOLINK_VALUE= + ;; + *) + ENOLINK_HIDDEN=1; ENOLINK_VALUE="$gl_cv_header_errno_h_ENOLINK" + ;; + esac + + + fi + + + if test -n "$ERRNO_H"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EOVERFLOW value" >&5 +$as_echo_n "checking for EOVERFLOW value... " >&6; } +if test "${gl_cv_header_errno_h_EOVERFLOW+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifdef EOVERFLOW +yes +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "yes" >/dev/null 2>&1; then : + gl_cv_header_errno_h_EOVERFLOW=yes +else + gl_cv_header_errno_h_EOVERFLOW=no +fi +rm -f conftest* + + if test $gl_cv_header_errno_h_EOVERFLOW = no; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#define _XOPEN_SOURCE_EXTENDED 1 +#include +#ifdef EOVERFLOW +yes +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "yes" >/dev/null 2>&1; then : + gl_cv_header_errno_h_EOVERFLOW=hidden +fi +rm -f conftest* + + if test $gl_cv_header_errno_h_EOVERFLOW = hidden; then + if ac_fn_c_compute_int "$LINENO" "EOVERFLOW" "gl_cv_header_errno_h_EOVERFLOW" " +#define _XOPEN_SOURCE_EXTENDED 1 +#include +/* The following two lines are a workaround against an autoconf-2.52 bug. */ +#include +#include +"; then : + +fi + + fi + fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_EOVERFLOW" >&5 +$as_echo "$gl_cv_header_errno_h_EOVERFLOW" >&6; } + case $gl_cv_header_errno_h_EOVERFLOW in + yes | no) + EOVERFLOW_HIDDEN=0; EOVERFLOW_VALUE= + ;; + *) + EOVERFLOW_HIDDEN=1; EOVERFLOW_VALUE="$gl_cv_header_errno_h_EOVERFLOW" + ;; + esac + + + fi + + +ac_fn_c_check_decl "$LINENO" "strerror_r" "ac_cv_have_decl_strerror_r" "$ac_includes_default" +if test "x$ac_cv_have_decl_strerror_r" = x""yes; then : + ac_have_decl=1 +else + ac_have_decl=0 fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_strerror_r" >&5 -$as_echo "$ac_cv_have_decl_strerror_r" >&6; } -if test $ac_cv_have_decl_strerror_r = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_STRERROR_R 1 +#define HAVE_DECL_STRERROR_R $ac_have_decl _ACEOF - -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_STRERROR_R 0 -_ACEOF - - -fi - - - for ac_func in strerror_r -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if test `eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` = yes; then +do : + ac_fn_c_check_func "$LINENO" "strerror_r" "ac_cv_func_strerror_r" +if test "x$ac_cv_func_strerror_r" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define HAVE_STRERROR_R 1 _ACEOF fi done -{ $as_echo "$as_me:$LINENO: checking whether strerror_r returns char *" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strerror_r returns char *" >&5 $as_echo_n "checking whether strerror_r returns char *... " >&6; } -if test "${ac_cv_func_strerror_r_char_p+set}" = set; then +if test "${ac_cv_func_strerror_r_char_p+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_cv_func_strerror_r_char_p=no if test $ac_cv_have_decl_strerror_r = yes; then - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int @@ -7642,32 +7730,9 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_func_strerror_r_char_p=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else # strerror_r is not declared. Choose between @@ -7676,14 +7741,10 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # former has a strerror_r that returns char*, while the latter # has a strerror_r that returns `int'. # This test should segfault on the DEC system. - if test "$cross_compiling" = yes; then + if test "$cross_compiling" = yes; then : : else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default extern char *strerror_r (); @@ -7697,205 +7758,49 @@ char buf[100]; return 0; } _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_strerror_r_char_p=yes -else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi - fi fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_strerror_r_char_p" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strerror_r_char_p" >&5 $as_echo "$ac_cv_func_strerror_r_char_p" >&6; } if test $ac_cv_func_strerror_r_char_p = yes; then -cat >>confdefs.h <<\_ACEOF -#define STRERROR_R_CHAR_P 1 -_ACEOF +$as_echo "#define STRERROR_R_CHAR_P 1" >>confdefs.h fi -{ $as_echo "$as_me:$LINENO: checking whether euidaccess is declared" >&5 -$as_echo_n "checking whether euidaccess is declared... " >&6; } -if test "${ac_cv_have_decl_euidaccess+set}" = set; then - $as_echo_n "(cached) " >&6 + + XGETTEXT_EXTRA_OPTIONS= + + + +ac_fn_c_check_decl "$LINENO" "setregid" "ac_cv_have_decl_setregid" "$ac_includes_default" +if test "x$ac_cv_have_decl_setregid" = x""yes; then : + ac_have_decl=1 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef euidaccess - (void) euidaccess; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_euidaccess=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_euidaccess=no + ac_have_decl=0 fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_euidaccess" >&5 -$as_echo "$ac_cv_have_decl_euidaccess" >&6; } -if test $ac_cv_have_decl_euidaccess = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_EUIDACCESS 1 +#define HAVE_DECL_SETREGID $ac_have_decl _ACEOF - -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_EUIDACCESS 0 -_ACEOF - - -fi - - - - -{ $as_echo "$as_me:$LINENO: checking whether setregid is declared" >&5 -$as_echo_n "checking whether setregid is declared... " >&6; } -if test "${ac_cv_have_decl_setregid+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef setregid - (void) setregid; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_setregid=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_setregid=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_setregid" >&5 -$as_echo "$ac_cv_have_decl_setregid" >&6; } -if test $ac_cv_have_decl_setregid = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_SETREGID 1 -_ACEOF - - -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_SETREGID 0 -_ACEOF - - -fi - - -{ $as_echo "$as_me:$LINENO: checking type of array argument to getgroups" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking type of array argument to getgroups" >&5 $as_echo_n "checking type of array argument to getgroups... " >&6; } -if test "${ac_cv_type_getgroups+set}" = set; then +if test "${ac_cv_type_getgroups+set}" = set; then : $as_echo_n "(cached) " >&6 else - if test "$cross_compiling" = yes; then + if test "$cross_compiling" = yes; then : ac_cv_type_getgroups=cross else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Thanks to Mike Rendell for this test. */ $ac_includes_default @@ -7921,53 +7826,23 @@ main () return n > 0 && gidset[n] != val.gval; } _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_run "$LINENO"; then : ac_cv_type_getgroups=gid_t else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_type_getgroups=int + ac_cv_type_getgroups=int fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi - if test $ac_cv_type_getgroups = cross; then - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "getgroups.*int.*gid_t" >/dev/null 2>&1; then + $EGREP "getgroups.*int.*gid_t" >/dev/null 2>&1; then : ac_cv_type_getgroups=gid_t else ac_cv_type_getgroups=int @@ -7976,7 +7851,7 @@ rm -f conftest* fi fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_getgroups" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_getgroups" >&5 $as_echo "$ac_cv_type_getgroups" >&6; } cat >>confdefs.h <<_ACEOF @@ -7984,106 +7859,24 @@ cat >>confdefs.h <<_ACEOF _ACEOF -{ $as_echo "$as_me:$LINENO: checking for getgroups" >&5 -$as_echo_n "checking for getgroups... " >&6; } -if test "${ac_cv_func_getgroups+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define getgroups to an innocuous variant, in case declares getgroups. - For example, HP-UX 11i declares gettimeofday. */ -#define getgroups innocuous_getgroups +ac_fn_c_check_func "$LINENO" "getgroups" "ac_cv_func_getgroups" +if test "x$ac_cv_func_getgroups" = x""yes; then : -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char getgroups (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef getgroups - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char getgroups (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_getgroups || defined __stub___getgroups -choke me -#endif - -int -main () -{ -return getgroups (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_func_getgroups=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_func_getgroups=no fi -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_getgroups" >&5 -$as_echo "$ac_cv_func_getgroups" >&6; } - # If we don't yet have getgroups, see if it's in -lbsd. # This is reported to be necessary on an ITOS 3000WS running SEIUX 3.1. ac_save_LIBS=$LIBS if test $ac_cv_func_getgroups = no; then - { $as_echo "$as_me:$LINENO: checking for getgroups in -lbsd" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getgroups in -lbsd" >&5 $as_echo_n "checking for getgroups in -lbsd... " >&6; } -if test "${ac_cv_lib_bsd_getgroups+set}" = set; then +if test "${ac_cv_lib_bsd_getgroups+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbsd $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. @@ -8101,40 +7894,18 @@ return getgroups (); return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_bsd_getgroups=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_bsd_getgroups=no + ac_cv_lib_bsd_getgroups=no fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_getgroups" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bsd_getgroups" >&5 $as_echo "$ac_cv_lib_bsd_getgroups" >&6; } -if test $ac_cv_lib_bsd_getgroups = yes; then +if test "x$ac_cv_lib_bsd_getgroups" = x""yes; then : GETGROUPS_LIB=-lbsd fi @@ -8143,19 +7914,15 @@ fi # Run the program to test the functionality of the system-supplied # getgroups function only if there is such a function. if test $ac_cv_func_getgroups = yes; then - { $as_echo "$as_me:$LINENO: checking for working getgroups" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working getgroups" >&5 $as_echo_n "checking for working getgroups... " >&6; } -if test "${ac_cv_func_getgroups_works+set}" = set; then +if test "${ac_cv_func_getgroups_works+set}" = set; then : $as_echo_n "(cached) " >&6 else - if test "$cross_compiling" = yes; then + if test "$cross_compiling" = yes; then : ac_cv_func_getgroups_works=no else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int @@ -8167,71 +7934,43 @@ main () return 0; } _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_getgroups_works=yes else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_func_getgroups_works=no + ac_cv_func_getgroups_works=no fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi - fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_getgroups_works" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_getgroups_works" >&5 $as_echo "$ac_cv_func_getgroups_works" >&6; } - if test $ac_cv_func_getgroups_works = yes; then +else + ac_cv_func_getgroups_works=no +fi +if test $ac_cv_func_getgroups_works = yes; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_GETGROUPS 1 -_ACEOF +$as_echo "#define HAVE_GETGROUPS 1" >>confdefs.h - fi fi LIBS=$ac_save_LIBS + GNULIB_OPEN=0; + REPLACE_OPEN=0; -{ $as_echo "$as_me:$LINENO: checking for st_dm_mode in struct stat" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for st_dm_mode in struct stat" >&5 $as_echo_n "checking for st_dm_mode in struct stat... " >&6; } -if test "${ac_cv_struct_st_dm_mode+set}" = set; then +if test "${ac_cv_struct_st_dm_mode+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include @@ -8243,127 +7982,46 @@ struct stat s; s.st_dm_mode; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_struct_st_dm_mode=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_struct_st_dm_mode=no + ac_cv_struct_st_dm_mode=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_struct_st_dm_mode" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_st_dm_mode" >&5 $as_echo "$ac_cv_struct_st_dm_mode" >&6; } if test $ac_cv_struct_st_dm_mode = yes; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_ST_DM_MODE 1 -_ACEOF +$as_echo "#define HAVE_ST_DM_MODE 1" >>confdefs.h fi -{ $as_echo "$as_me:$LINENO: checking whether strmode is declared" >&5 -$as_echo_n "checking whether strmode is declared... " >&6; } -if test "${ac_cv_have_decl_strmode+set}" = set; then - $as_echo_n "(cached) " >&6 +ac_fn_c_check_decl "$LINENO" "strmode" "ac_cv_have_decl_strmode" "$ac_includes_default" +if test "x$ac_cv_have_decl_strmode" = x""yes; then : + ac_have_decl=1 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef strmode - (void) strmode; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_strmode=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_strmode=no + ac_have_decl=0 fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_strmode" >&5 -$as_echo "$ac_cv_have_decl_strmode" >&6; } -if test $ac_cv_have_decl_strmode = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_STRMODE 1 +#define HAVE_DECL_STRMODE $ac_have_decl _ACEOF -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_STRMODE 0 -_ACEOF - - -fi -{ $as_echo "$as_me:$LINENO: checking for mbstate_t" >&5 + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mbstate_t" >&5 $as_echo_n "checking for mbstate_t... " >&6; } -if test "${ac_cv_type_mbstate_t+set}" = set; then +if test "${ac_cv_type_mbstate_t+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default # include @@ -8375,47 +8033,22 @@ mbstate_t x; return sizeof x; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_type_mbstate_t=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_mbstate_t=no + ac_cv_type_mbstate_t=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_mbstate_t" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_mbstate_t" >&5 $as_echo "$ac_cv_type_mbstate_t" >&6; } if test $ac_cv_type_mbstate_t = yes; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_MBSTATE_T 1 -_ACEOF +$as_echo "#define HAVE_MBSTATE_T 1" >>confdefs.h else -cat >>confdefs.h <<\_ACEOF -#define mbstate_t int -_ACEOF +$as_echo "#define mbstate_t int" >>confdefs.h fi @@ -8444,20 +8077,203 @@ _ACEOF + GNULIB_CEILF=0; + GNULIB_CEILL=0; + GNULIB_FLOORF=0; + GNULIB_FLOORL=0; + GNULIB_FREXP=0; + GNULIB_FREXPL=0; + GNULIB_ISFINITE=0; + GNULIB_ISINF=0; + GNULIB_ISNAN=0; + GNULIB_ISNANF=0; + GNULIB_ISNAND=0; + GNULIB_ISNANL=0; + GNULIB_LDEXPL=0; + GNULIB_MATHL=0; + GNULIB_ROUND=0; + GNULIB_ROUNDF=0; + GNULIB_ROUNDL=0; + GNULIB_SIGNBIT=0; + GNULIB_TRUNC=0; + GNULIB_TRUNCF=0; + GNULIB_TRUNCL=0; + HAVE_ISNANF=1; + HAVE_ISNAND=1; + HAVE_ISNANL=1; + HAVE_DECL_ACOSL=1; + HAVE_DECL_ASINL=1; + HAVE_DECL_ATANL=1; + HAVE_DECL_COSL=1; + HAVE_DECL_EXPL=1; + HAVE_DECL_FREXPL=1; + HAVE_DECL_LDEXPL=1; + HAVE_DECL_LOGL=1; + HAVE_DECL_SINL=1; + HAVE_DECL_SQRTL=1; + HAVE_DECL_TANL=1; + HAVE_DECL_TRUNC=1; + HAVE_DECL_TRUNCF=1; + REPLACE_CEILF=0; + REPLACE_CEILL=0; + REPLACE_FLOORF=0; + REPLACE_FLOORL=0; + REPLACE_FREXP=0; + REPLACE_FREXPL=0; + REPLACE_HUGE_VAL=0; + REPLACE_ISFINITE=0; + REPLACE_ISINF=0; + REPLACE_ISNAN=0; + REPLACE_LDEXPL=0; + REPLACE_NAN=0; + REPLACE_ROUND=0; + REPLACE_ROUNDF=0; + REPLACE_ROUNDL=0; + REPLACE_SIGNBIT=0; + REPLACE_SIGNBIT_USING_GCC=0; + REPLACE_TRUNCL=0; + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stdin defaults to large file offsets" >&5 +$as_echo_n "checking whether stdin defaults to large file offsets... " >&6; } +if test "${gl_cv_var_stdin_large_offset+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +#if defined __SL64 && defined __SCLE /* cygwin */ + /* Cygwin 1.5.24 and earlier fail to put stdin in 64-bit mode, making + fseeko/ftello needlessly fail. This bug was fixed in 1.5.25, and + it is easier to do a version check than building a runtime test. */ +# include +# if CYGWIN_VERSION_DLL_COMBINED < CYGWIN_VERSION_DLL_MAKE_COMBINED (1005, 25) + choke me +# endif +#endif + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_var_stdin_large_offset=yes +else + gl_cv_var_stdin_large_offset=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_var_stdin_large_offset" >&5 +$as_echo "$gl_cv_var_stdin_large_offset" >&6; } - { $as_echo "$as_me:$LINENO: checking whether is self-contained" >&5 + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether lstat dereferences a symlink specified with a trailing slash" >&5 +$as_echo_n "checking whether lstat dereferences a symlink specified with a trailing slash... " >&6; } +if test "${ac_cv_func_lstat_dereferences_slashed_symlink+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + rm -f conftest.sym conftest.file +echo >conftest.file +if test "$as_ln_s" = "ln -s" && ln -s conftest.file conftest.sym; then + if test "$cross_compiling" = yes; then : + ac_cv_func_lstat_dereferences_slashed_symlink=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +struct stat sbuf; + /* Linux will dereference the symlink and fail. + That is better in the sense that it means we will not + have to compile and use the lstat wrapper. */ + return lstat ("conftest.sym/", &sbuf) == 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_func_lstat_dereferences_slashed_symlink=yes +else + ac_cv_func_lstat_dereferences_slashed_symlink=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi + +else + # If the `ln -s' command failed, then we probably don't even + # have an lstat function. + ac_cv_func_lstat_dereferences_slashed_symlink=no +fi +rm -f conftest.sym conftest.file + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_lstat_dereferences_slashed_symlink" >&5 +$as_echo "$ac_cv_func_lstat_dereferences_slashed_symlink" >&6; } + +test $ac_cv_func_lstat_dereferences_slashed_symlink = yes && + +cat >>confdefs.h <<_ACEOF +#define LSTAT_FOLLOWS_SLASHED_SYMLINK 1 +_ACEOF + + +if test $ac_cv_func_lstat_dereferences_slashed_symlink = no; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS lstat.$ac_objext" + +fi + + + + + GNULIB_SOCKET=0; + GNULIB_CONNECT=0; + GNULIB_ACCEPT=0; + GNULIB_BIND=0; + GNULIB_GETPEERNAME=0; + GNULIB_GETSOCKNAME=0; + GNULIB_GETSOCKOPT=0; + GNULIB_LISTEN=0; + GNULIB_RECV=0; + GNULIB_SEND=0; + GNULIB_RECVFROM=0; + GNULIB_SENDTO=0; + GNULIB_SETSOCKOPT=0; + GNULIB_SHUTDOWN=0; + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether is self-contained" >&5 $as_echo_n "checking whether is self-contained... " >&6; } -if test "${gl_cv_header_sys_socket_h_selfcontained+set}" = set; then +if test "${gl_cv_header_sys_socket_h_selfcontained+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int @@ -8468,387 +8284,126 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : gl_cv_header_sys_socket_h_selfcontained=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - gl_cv_header_sys_socket_h_selfcontained=no + gl_cv_header_sys_socket_h_selfcontained=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_header_sys_socket_h_selfcontained" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_sys_socket_h_selfcontained" >&5 $as_echo "$gl_cv_header_sys_socket_h_selfcontained" >&6; } if test $gl_cv_header_sys_socket_h_selfcontained = yes; then SYS_SOCKET_H='' - else - SYS_SOCKET_H='sys/socket.h' - - -for ac_header in sys/socket.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-coreutils@gnu.org ## -## ------------------------------------ ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - -fi -if test `eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` = yes; then + for ac_func in shutdown +do : + ac_fn_c_check_func "$LINENO" "shutdown" "ac_cv_func_shutdown" +if test "x$ac_cv_func_shutdown" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define HAVE_SHUTDOWN 1 _ACEOF fi - done - { $as_echo "$as_me:$LINENO: checking absolute name of " >&5 -$as_echo_n "checking absolute name of ... " >&6; } -if test "${gl_cv_absolute_sys_socket_h+set}" = set; then + if test $ac_cv_func_shutdown = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether defines the SHUT_* macros" >&5 +$as_echo_n "checking whether defines the SHUT_* macros... " >&6; } +if test "${gl_cv_header_sys_socket_h_shut+set}" = set; then : $as_echo_n "(cached) " >&6 else - - - - - if test $ac_cv_header_sys_socket_h = yes; then - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include +int +main () +{ +int a[] = { SHUT_RD, SHUT_WR, SHUT_RDWR }; + ; + return 0; +} _ACEOF - gl_cv_absolute_sys_socket_h=`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | -sed -n '\#/sys/socket.h#{s#.*"\(.*/sys/socket.h\)".*#\1#;s#^/[^/]#//&#;p;q;}'` - fi +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_header_sys_socket_h_shut=yes +else + gl_cv_header_sys_socket_h_shut=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_absolute_sys_socket_h" >&5 -$as_echo "$gl_cv_absolute_sys_socket_h" >&6; } -cat >>confdefs.h <<_ACEOF -#define ABSOLUTE_SYS_SOCKET_H "$gl_cv_absolute_sys_socket_h" +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_sys_socket_h_shut" >&5 +$as_echo "$gl_cv_header_sys_socket_h_shut" >&6; } + if test $gl_cv_header_sys_socket_h_shut = no; then + SYS_SOCKET_H='sys/socket.h' + fi + fi + else + SYS_SOCKET_H='sys/socket.h' + fi + if test -n "$SYS_SOCKET_H"; then + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_sys_socket_h='<'sys/socket.h'>' + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +$as_echo_n "checking absolute name of ... " >&6; } +if test "${gl_cv_next_sys_socket_h+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + if test $ac_cv_header_sys_socket_h = yes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + _ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + gl_cv_next_sys_socket_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n '\#/sys/socket.h#{ + s#.*"\(.*/sys/socket.h\)".*#\1# + s#^/[^/]#//&# + p + q + }'`'"' + else + gl_cv_next_sys_socket_h='<'sys/socket.h'>' + fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_socket_h" >&5 +$as_echo "$gl_cv_next_sys_socket_h" >&6; } + fi + NEXT_SYS_SOCKET_H=$gl_cv_next_sys_socket_h - ABSOLUTE_SYS_SOCKET_H=\"$gl_cv_absolute_sys_socket_h\" if test $ac_cv_header_sys_socket_h = yes; then HAVE_SYS_SOCKET_H=1 - HAVE_WINSOCK2_H=0 HAVE_WS2TCPIP_H=0 else HAVE_SYS_SOCKET_H=0 - - -for ac_header in winsock2.h ws2tcpip.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-coreutils@gnu.org ## -## ------------------------------------ ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - -fi -if test `eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` = yes; then + for ac_header in ws2tcpip.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "ws2tcpip.h" "ac_cv_header_ws2tcpip_h" "$ac_includes_default" +if test "x$ac_cv_header_ws2tcpip_h" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define HAVE_WS2TCPIP_H 1 _ACEOF fi done - if test $ac_cv_header_winsock2_h = yes; then - HAVE_WINSOCK2_H=1 - else - HAVE_WINSOCK2_H=0 - fi if test $ac_cv_header_ws2tcpip_h = yes; then HAVE_WS2TCPIP_H=1 else @@ -8858,6 +8413,353 @@ done + + if test $ac_cv_header_sys_socket_h != yes; then + for ac_header in winsock2.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default" +if test "x$ac_cv_header_winsock2_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_WINSOCK2_H 1 +_ACEOF + +fi + +done + + fi + if test "$ac_cv_header_winsock2_h" = yes; then + HAVE_WINSOCK2_H=1 + UNISTD_H_HAVE_WINSOCK2_H=1 + SYS_IOCTL_H_HAVE_WINSOCK2_H=1 + else + HAVE_WINSOCK2_H=0 + fi + + + + + fi + + + + GNULIB_GETADDRINFO=0; + HAVE_STRUCT_ADDRINFO=1; + HAVE_DECL_FREEADDRINFO=1; + HAVE_DECL_GAI_STRERROR=1; + HAVE_DECL_GETADDRINFO=1; + HAVE_DECL_GETNAMEINFO=1; + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_netdb_h='<'netdb.h'>' + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +$as_echo_n "checking absolute name of ... " >&6; } +if test "${gl_cv_next_netdb_h+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + if test $ac_cv_header_netdb_h = yes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + gl_cv_next_netdb_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n '\#/netdb.h#{ + s#.*"\(.*/netdb.h\)".*#\1# + s#^/[^/]#//&# + p + q + }'`'"' + else + gl_cv_next_netdb_h='<'netdb.h'>' + fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_netdb_h" >&5 +$as_echo "$gl_cv_next_netdb_h" >&6; } + fi + NEXT_NETDB_H=$gl_cv_next_netdb_h + + + + if test $ac_cv_header_netdb_h = yes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + struct addrinfo a; + int b = EAI_OVERFLOW; + int c = AI_NUMERICSERV; + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + NETDB_H='' +else + NETDB_H='netdb.h' +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + HAVE_NETDB_H=1 + else + NETDB_H='netdb.h' + HAVE_NETDB_H=0 + fi + + + + + HOSTENT_LIB= + gl_saved_libs="$LIBS" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing gethostbyname" >&5 +$as_echo_n "checking for library containing gethostbyname... " >&6; } +if test "${ac_cv_search_gethostbyname+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char gethostbyname (); +int +main () +{ +return gethostbyname (); + ; + return 0; +} +_ACEOF +for ac_lib in '' nsl network net; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_gethostbyname=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if test "${ac_cv_search_gethostbyname+set}" = set; then : + break +fi +done +if test "${ac_cv_search_gethostbyname+set}" = set; then : + +else + ac_cv_search_gethostbyname=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_gethostbyname" >&5 +$as_echo "$ac_cv_search_gethostbyname" >&6; } +ac_res=$ac_cv_search_gethostbyname +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + if test "$ac_cv_search_gethostbyname" != "none required"; then + HOSTENT_LIB="$ac_cv_search_gethostbyname" + fi +fi + + LIBS="$gl_saved_libs" + if test -z "$HOSTENT_LIB"; then + for ac_func in gethostbyname +do : + ac_fn_c_check_func "$LINENO" "gethostbyname" "ac_cv_func_gethostbyname" +if test "x$ac_cv_func_gethostbyname" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_GETHOSTBYNAME 1 +_ACEOF + +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in winsock2.h and -lws2_32" >&5 +$as_echo_n "checking for gethostbyname in winsock2.h and -lws2_32... " >&6; } +if test "${gl_cv_w32_gethostbyname+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + gl_cv_w32_gethostbyname=no + gl_save_LIBS="$LIBS" + LIBS="$LIBS -lws2_32" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifdef HAVE_WINSOCK2_H +#include +#endif +#include + +int +main () +{ +gethostbyname(NULL); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_w32_gethostbyname=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$gl_save_LIBS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_w32_gethostbyname" >&5 +$as_echo "$gl_cv_w32_gethostbyname" >&6; } + if test "$gl_cv_w32_gethostbyname" = "yes"; then + HOSTENT_LIB="-lws2_32" + fi + +fi +done + + fi + + + + SERVENT_LIB= + gl_saved_libs="$LIBS" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing getservbyname" >&5 +$as_echo_n "checking for library containing getservbyname... " >&6; } +if test "${ac_cv_search_getservbyname+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char getservbyname (); +int +main () +{ +return getservbyname (); + ; + return 0; +} +_ACEOF +for ac_lib in '' socket network net; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_getservbyname=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if test "${ac_cv_search_getservbyname+set}" = set; then : + break +fi +done +if test "${ac_cv_search_getservbyname+set}" = set; then : + +else + ac_cv_search_getservbyname=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_getservbyname" >&5 +$as_echo "$ac_cv_search_getservbyname" >&6; } +ac_res=$ac_cv_search_getservbyname +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + if test "$ac_cv_search_getservbyname" != "none required"; then + SERVENT_LIB="$ac_cv_search_getservbyname" + fi +fi + + LIBS="$gl_saved_libs" + if test -z "$SERVENT_LIB"; then + for ac_func in getservbyname +do : + ac_fn_c_check_func "$LINENO" "getservbyname" "ac_cv_func_getservbyname" +if test "x$ac_cv_func_getservbyname" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_GETSERVBYNAME 1 +_ACEOF + +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getservbyname in winsock2.h and -lws2_32" >&5 +$as_echo_n "checking for getservbyname in winsock2.h and -lws2_32... " >&6; } +if test "${gl_cv_w32_getservbyname+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + gl_cv_w32_getservbyname=no + gl_save_LIBS="$LIBS" + LIBS="$LIBS -lws2_32" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifdef HAVE_WINSOCK2_H +#include +#endif +#include + +int +main () +{ +getservbyname(NULL,NULL); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_w32_getservbyname=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$gl_save_LIBS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_w32_getservbyname" >&5 +$as_echo "$gl_cv_w32_getservbyname" >&6; } + if test "$gl_cv_w32_getservbyname" = "yes"; then + SERVENT_LIB="-lws2_32" + fi + +fi +done + fi @@ -8867,21 +8769,12 @@ done - - - - - - { $as_echo "$as_me:$LINENO: checking for IPv4 sockets" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPv4 sockets" >&5 $as_echo_n "checking for IPv4 sockets... " >&6; } - if test "${gl_cv_socket_ipv4+set}" = set; then + if test "${gl_cv_socket_ipv4+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #ifdef HAVE_SYS_SOCKET_H @@ -8902,55 +8795,28 @@ int x = AF_INET; struct in_addr y; struct sockaddr_in z; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : gl_cv_socket_ipv4=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - gl_cv_socket_ipv4=no + gl_cv_socket_ipv4=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi - { $as_echo "$as_me:$LINENO: result: $gl_cv_socket_ipv4" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_socket_ipv4" >&5 $as_echo "$gl_cv_socket_ipv4" >&6; } if test $gl_cv_socket_ipv4 = yes; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_IPV4 1 -_ACEOF +$as_echo "#define HAVE_IPV4 1" >>confdefs.h fi - { $as_echo "$as_me:$LINENO: checking for IPv6 sockets" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPv6 sockets" >&5 $as_echo_n "checking for IPv6 sockets... " >&6; } - if test "${gl_cv_socket_ipv6+set}" = set; then + if test "${gl_cv_socket_ipv6+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #ifdef HAVE_SYS_SOCKET_H @@ -8971,61 +8837,32 @@ int x = AF_INET6; struct in6_addr y; struct sockaddr_in6 z; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : gl_cv_socket_ipv6=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - gl_cv_socket_ipv6=no + gl_cv_socket_ipv6=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi - { $as_echo "$as_me:$LINENO: result: $gl_cv_socket_ipv6" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_socket_ipv6" >&5 $as_echo "$gl_cv_socket_ipv6" >&6; } if test $gl_cv_socket_ipv6 = yes; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_IPV6 1 -_ACEOF +$as_echo "#define HAVE_IPV6 1" >>confdefs.h fi - - - { $as_echo "$as_me:$LINENO: checking whether getcwd (NULL, 0) allocates memory for result" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getcwd (NULL, 0) allocates memory for result" >&5 $as_echo_n "checking whether getcwd (NULL, 0) allocates memory for result... " >&6; } -if test "${gl_cv_func_getcwd_null+set}" = set; then +if test "${gl_cv_func_getcwd_null+set}" = set; then : $as_echo_n "(cached) " >&6 else - if test "$cross_compiling" = yes; then + if test "$cross_compiling" = yes; then : gl_cv_func_getcwd_null=no else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ # include @@ -9045,124 +8882,36 @@ cat >>conftest.$ac_ext <<_ACEOF } } _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_run "$LINENO"; then : gl_cv_func_getcwd_null=yes else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -gl_cv_func_getcwd_null=no + gl_cv_func_getcwd_null=no fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi - fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_getcwd_null" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getcwd_null" >&5 $as_echo "$gl_cv_func_getcwd_null" >&6; } -{ $as_echo "$as_me:$LINENO: checking whether getcwd is declared" >&5 -$as_echo_n "checking whether getcwd is declared... " >&6; } -if test "${ac_cv_have_decl_getcwd+set}" = set; then - $as_echo_n "(cached) " >&6 +ac_fn_c_check_decl "$LINENO" "getcwd" "ac_cv_have_decl_getcwd" "$ac_includes_default" +if test "x$ac_cv_have_decl_getcwd" = x""yes; then : + ac_have_decl=1 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef getcwd - (void) getcwd; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_getcwd=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_getcwd=no + ac_have_decl=0 fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_getcwd" >&5 -$as_echo "$ac_cv_have_decl_getcwd" >&6; } -if test $ac_cv_have_decl_getcwd = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_GETCWD 1 +#define HAVE_DECL_GETCWD $ac_have_decl _ACEOF - -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_GETCWD 0 -_ACEOF - - -fi - - -{ $as_echo "$as_me:$LINENO: checking for stdbool.h that conforms to C99" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5 $as_echo_n "checking for stdbool.h that conforms to C99... " >&6; } -if test "${ac_cv_header_stdbool_h+set}" = set; then +if test "${ac_cv_header_stdbool_h+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -9240,91 +8989,17 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdbool_h=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_header_stdbool_h=no + ac_cv_header_stdbool_h=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdbool_h" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5 $as_echo "$ac_cv_header_stdbool_h" >&6; } - { $as_echo "$as_me:$LINENO: checking for _Bool" >&5 -$as_echo_n "checking for _Bool... " >&6; } -if test "${ac_cv_type__Bool+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -typedef _Bool ac__type_new_; -int -main () -{ -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type__Bool=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type__Bool=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_type__Bool" >&5 -$as_echo "$ac_cv_type__Bool" >&6; } -if test $ac_cv_type__Bool = yes; then + ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default" +if test "x$ac_cv_type__Bool" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE__BOOL 1 @@ -9335,9 +9010,7 @@ fi if test $ac_cv_header_stdbool_h = yes; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_STDBOOL_H 1 -_ACEOF +$as_echo "#define HAVE_STDBOOL_H 1" >>confdefs.h fi @@ -9367,18 +9040,14 @@ _ACEOF : ${YACC='bison -y'} - { $as_echo "$as_me:$LINENO: checking for compound literals" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for compound literals" >&5 $as_echo_n "checking for compound literals... " >&6; } -if test "${gl_cv_compound_literals+set}" = set; then +if test "${gl_cv_compound_literals+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -struct s { int i, j; }; struct s s = (struct s) { 1, 2 }; +struct s { int i, j; }; int main () { @@ -9388,54 +9057,27 @@ struct s t = (struct s) { 3, 4 }; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : gl_cv_compound_literals=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - gl_cv_compound_literals=no + gl_cv_compound_literals=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_compound_literals" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_compound_literals" >&5 $as_echo "$gl_cv_compound_literals" >&6; } if test $gl_cv_compound_literals = yes; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_COMPOUND_LITERALS 1 -_ACEOF +$as_echo "#define HAVE_COMPOUND_LITERALS 1" >>confdefs.h fi -{ $as_echo "$as_me:$LINENO: checking whether struct tm is in sys/time.h or time.h" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5 $as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; } -if test "${ac_cv_struct_tm+set}" = set; then +if test "${ac_cv_struct_tm+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include @@ -9445,237 +9087,55 @@ main () { struct tm tm; int *p = &tm.tm_sec; - return !p; + return !p; ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_struct_tm=time.h else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_struct_tm=sys/time.h + ac_cv_struct_tm=sys/time.h fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_struct_tm" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5 $as_echo "$ac_cv_struct_tm" >&6; } if test $ac_cv_struct_tm = sys/time.h; then -cat >>confdefs.h <<\_ACEOF -#define TM_IN_SYS_TIME 1 -_ACEOF +$as_echo "#define TM_IN_SYS_TIME 1" >>confdefs.h fi - { $as_echo "$as_me:$LINENO: checking for struct tm.tm_gmtoff" >&5 -$as_echo_n "checking for struct tm.tm_gmtoff... " >&6; } -if test "${ac_cv_member_struct_tm_tm_gmtoff+set}" = set; then - $as_echo_n "(cached) " >&6 + ac_fn_c_check_member "$LINENO" "struct tm" "tm_gmtoff" "ac_cv_member_struct_tm_tm_gmtoff" "#include +" +if test "x$ac_cv_member_struct_tm_tm_gmtoff" = x""yes; then : + +$as_echo "#define HAVE_TM_GMTOFF 1" >>confdefs.h + +fi + + +ac_fn_c_check_decl "$LINENO" "getdelim" "ac_cv_have_decl_getdelim" "$ac_includes_default" +if test "x$ac_cv_have_decl_getdelim" = x""yes; then : + ac_have_decl=1 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -int -main () -{ -static struct tm ac_aggr; -if (ac_aggr.tm_gmtoff) -return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_member_struct_tm_tm_gmtoff=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -int -main () -{ -static struct tm ac_aggr; -if (sizeof ac_aggr.tm_gmtoff) -return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_member_struct_tm_tm_gmtoff=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_member_struct_tm_tm_gmtoff=no + ac_have_decl=0 fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_tm_tm_gmtoff" >&5 -$as_echo "$ac_cv_member_struct_tm_tm_gmtoff" >&6; } -if test $ac_cv_member_struct_tm_tm_gmtoff = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_TM_GMTOFF 1 -_ACEOF - -fi - - -{ $as_echo "$as_me:$LINENO: checking whether getdelim is declared" >&5 -$as_echo_n "checking whether getdelim is declared... " >&6; } -if test "${ac_cv_have_decl_getdelim+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef getdelim - (void) getdelim; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_getdelim=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_getdelim=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_getdelim" >&5 -$as_echo "$ac_cv_have_decl_getdelim" >&6; } -if test $ac_cv_have_decl_getdelim = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_GETDELIM 1 +#define HAVE_DECL_GETDELIM $ac_have_decl _ACEOF -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_GETDELIM 0 -_ACEOF - -fi - - - - - { $as_echo "$as_me:$LINENO: checking for arithmetic hrtime_t" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for arithmetic hrtime_t" >&5 $as_echo_n "checking for arithmetic hrtime_t... " >&6; } -if test "${gl_cv_arithmetic_hrtime_t+set}" = set; then +if test "${gl_cv_arithmetic_hrtime_t+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int @@ -9686,41 +9146,109 @@ hrtime_t x = 0; return x/x; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : gl_cv_arithmetic_hrtime_t=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - gl_cv_arithmetic_hrtime_t=no + gl_cv_arithmetic_hrtime_t=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_arithmetic_hrtime_t" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_arithmetic_hrtime_t" >&5 $as_echo "$gl_cv_arithmetic_hrtime_t" >&6; } if test $gl_cv_arithmetic_hrtime_t = yes; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_ARITHMETIC_HRTIME_T 1 +$as_echo "#define HAVE_ARITHMETIC_HRTIME_T 1" >>confdefs.h + + fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for long long int" >&5 +$as_echo_n "checking for long long int... " >&6; } +if test "${ac_cv_type_long_long_int+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + /* For now, do not test the preprocessor; as of 2007 there are too many + implementations with broken preprocessors. Perhaps this can + be revisited in 2012. In the meantime, code should not expect + #if to work with literals wider than 32 bits. */ + /* Test literals. */ + long long int ll = 9223372036854775807ll; + long long int nll = -9223372036854775807LL; + unsigned long long int ull = 18446744073709551615ULL; + /* Test constant expressions. */ + typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll) + ? 1 : -1)]; + typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1 + ? 1 : -1)]; + int i = 63; +int +main () +{ +/* Test availability of runtime routines for shift and division. */ + long long int llmax = 9223372036854775807ll; + unsigned long long int ullmax = 18446744073709551615ull; + return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i) + | (llmax / ll) | (llmax % ll) + | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i) + | (ullmax / ull) | (ullmax % ull)); + ; + return 0; +} + _ACEOF +if ac_fn_c_try_link "$LINENO"; then : + if test "$cross_compiling" = yes; then : + ac_cv_type_long_long_int=yes +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #ifndef LLONG_MAX + # define HALF \ + (1LL << (sizeof (long long int) * CHAR_BIT - 2)) + # define LLONG_MAX (HALF - 1 + HALF) + #endif +int +main () +{ +long long int n = 1; + int i; + for (i = 0; ; i++) + { + long long int m = n << i; + if (m >> i != n) + return 1; + if (LLONG_MAX / 2 < m) + break; + } + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_type_long_long_int=yes +else + ac_cv_type_long_long_int=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi + +else + ac_cv_type_long_long_int=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_long_long_int" >&5 +$as_echo "$ac_cv_type_long_long_int" >&6; } + if test $ac_cv_type_long_long_int = yes; then + +$as_echo "#define HAVE_LONG_LONG_INT 1" >>confdefs.h fi @@ -9733,17 +9261,24 @@ _ACEOF +ac_fn_c_check_decl "$LINENO" "getline" "ac_cv_have_decl_getline" "$ac_includes_default" +if test "x$ac_cv_have_decl_getline" = x""yes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi - { $as_echo "$as_me:$LINENO: checking for ssize_t" >&5 +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_GETLINE $ac_have_decl +_ACEOF + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ssize_t" >&5 $as_echo_n "checking for ssize_t... " >&6; } -if test "${gt_cv_ssize_t+set}" = set; then +if test "${gt_cv_ssize_t+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int @@ -9755,190 +9290,33 @@ int x = sizeof (ssize_t *) + sizeof (ssize_t); return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : gt_cv_ssize_t=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - gt_cv_ssize_t=no + gt_cv_ssize_t=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $gt_cv_ssize_t" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_ssize_t" >&5 $as_echo "$gt_cv_ssize_t" >&6; } if test $gt_cv_ssize_t = no; then -cat >>confdefs.h <<\_ACEOF -#define ssize_t int -_ACEOF +$as_echo "#define ssize_t int" >>confdefs.h fi + + + + if test -z "$GETOPT_H"; then - -for ac_header in getopt.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-coreutils@gnu.org ## -## ------------------------------------ ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - -fi -if test `eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` = yes; then + for ac_header in getopt.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "getopt.h" "ac_cv_header_getopt_h" "$ac_includes_default" +if test "x$ac_cv_header_getopt_h" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define HAVE_GETOPT_H 1 _ACEOF else @@ -9950,98 +9328,12 @@ done fi if test -z "$GETOPT_H"; then - -for ac_func in getopt_long_only -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if test `eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` = yes; then + for ac_func in getopt_long_only +do : + ac_fn_c_check_func "$LINENO" "getopt_long_only" "ac_cv_func_getopt_long_only" +if test "x$ac_cv_func_getopt_long_only" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define HAVE_GETOPT_LONG_ONLY 1 _ACEOF else @@ -10052,139 +9344,31 @@ done fi if test -z "$GETOPT_H"; then - { $as_echo "$as_me:$LINENO: checking whether optreset is declared" >&5 -$as_echo_n "checking whether optreset is declared... " >&6; } -if test "${ac_cv_have_decl_optreset+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -int -main () -{ -#ifndef optreset - (void) optreset; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_optreset=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_optreset=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_optreset" >&5 -$as_echo "$ac_cv_have_decl_optreset" >&6; } -if test $ac_cv_have_decl_optreset = yes; then + ac_fn_c_check_decl "$LINENO" "optreset" "ac_cv_have_decl_optreset" "#include +" +if test "x$ac_cv_have_decl_optreset" = x""yes; then : GETOPT_H=getopt.h fi fi if test -z "$GETOPT_H"; then - { $as_echo "$as_me:$LINENO: checking for working GNU getopt function" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working GNU getopt function" >&5 $as_echo_n "checking for working GNU getopt function... " >&6; } -if test "${gl_cv_func_gnu_getopt+set}" = set; then +if test "${gl_cv_func_gnu_getopt+set}" = set; then : $as_echo_n "(cached) " >&6 else - if test "$cross_compiling" = yes; then - { $as_echo "$as_me:$LINENO: checking whether getopt_clip is declared" >&5 -$as_echo_n "checking whether getopt_clip is declared... " >&6; } -if test "${ac_cv_have_decl_getopt_clip+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -int -main () -{ -#ifndef getopt_clip - (void) getopt_clip; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_getopt_clip=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_getopt_clip=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_getopt_clip" >&5 -$as_echo "$ac_cv_have_decl_getopt_clip" >&6; } -if test $ac_cv_have_decl_getopt_clip = yes; then + if test "$cross_compiling" = yes; then : + ac_fn_c_check_decl "$LINENO" "getopt_clip" "ac_cv_have_decl_getopt_clip" "#include +" +if test "x$ac_cv_have_decl_getopt_clip" = x""yes; then : gl_cv_func_gnu_getopt=no else gl_cv_func_gnu_getopt=yes fi else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int @@ -10201,606 +9385,174 @@ main () return 0; } _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_run "$LINENO"; then : gl_cv_func_gnu_getopt=yes else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -gl_cv_func_gnu_getopt=no + gl_cv_func_gnu_getopt=no fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi - fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_gnu_getopt" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_gnu_getopt" >&5 $as_echo "$gl_cv_func_gnu_getopt" >&6; } if test "$gl_cv_func_gnu_getopt" = "no"; then GETOPT_H=getopt.h fi fi -{ $as_echo "$as_me:$LINENO: checking whether getenv is declared" >&5 -$as_echo_n "checking whether getenv is declared... " >&6; } -if test "${ac_cv_have_decl_getenv+set}" = set; then - $as_echo_n "(cached) " >&6 +ac_fn_c_check_decl "$LINENO" "getenv" "ac_cv_have_decl_getenv" "$ac_includes_default" +if test "x$ac_cv_have_decl_getenv" = x""yes; then : + ac_have_decl=1 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef getenv - (void) getenv; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_getenv=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_getenv=no + ac_have_decl=0 fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_getenv" >&5 -$as_echo "$ac_cv_have_decl_getenv" >&6; } -if test $ac_cv_have_decl_getenv = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_GETENV 1 +#define HAVE_DECL_GETENV $ac_have_decl _ACEOF - +ac_fn_c_check_decl "$LINENO" "getpass" "ac_cv_have_decl_getpass" "$ac_includes_default" +if test "x$ac_cv_have_decl_getpass" = x""yes; then : + ac_have_decl=1 else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_GETENV 0 -_ACEOF - - + ac_have_decl=0 fi - -{ $as_echo "$as_me:$LINENO: checking whether getpass is declared" >&5 -$as_echo_n "checking whether getpass is declared... " >&6; } -if test "${ac_cv_have_decl_getpass+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef getpass - (void) getpass; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_getpass=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_getpass=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_getpass" >&5 -$as_echo "$ac_cv_have_decl_getpass" >&6; } -if test $ac_cv_have_decl_getpass = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_GETPASS 1 +#define HAVE_DECL_GETPASS $ac_have_decl _ACEOF + + + + + + + +ac_fn_c_check_decl "$LINENO" "fflush_unlocked" "ac_cv_have_decl_fflush_unlocked" "$ac_includes_default" +if test "x$ac_cv_have_decl_fflush_unlocked" = x""yes; then : + ac_have_decl=1 else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_GETPASS 0 -_ACEOF - - + ac_have_decl=0 fi - - - - - - - - - -{ $as_echo "$as_me:$LINENO: checking whether fflush_unlocked is declared" >&5 -$as_echo_n "checking whether fflush_unlocked is declared... " >&6; } -if test "${ac_cv_have_decl_fflush_unlocked+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef fflush_unlocked - (void) fflush_unlocked; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_fflush_unlocked=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_fflush_unlocked=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_fflush_unlocked" >&5 -$as_echo "$ac_cv_have_decl_fflush_unlocked" >&6; } -if test $ac_cv_have_decl_fflush_unlocked = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FFLUSH_UNLOCKED 1 +#define HAVE_DECL_FFLUSH_UNLOCKED $ac_have_decl _ACEOF - +ac_fn_c_check_decl "$LINENO" "flockfile" "ac_cv_have_decl_flockfile" "$ac_includes_default" +if test "x$ac_cv_have_decl_flockfile" = x""yes; then : + ac_have_decl=1 else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FFLUSH_UNLOCKED 0 -_ACEOF - - + ac_have_decl=0 fi - -{ $as_echo "$as_me:$LINENO: checking whether flockfile is declared" >&5 -$as_echo_n "checking whether flockfile is declared... " >&6; } -if test "${ac_cv_have_decl_flockfile+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef flockfile - (void) flockfile; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_flockfile=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_flockfile=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_flockfile" >&5 -$as_echo "$ac_cv_have_decl_flockfile" >&6; } -if test $ac_cv_have_decl_flockfile = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FLOCKFILE 1 +#define HAVE_DECL_FLOCKFILE $ac_have_decl _ACEOF - +ac_fn_c_check_decl "$LINENO" "fputs_unlocked" "ac_cv_have_decl_fputs_unlocked" "$ac_includes_default" +if test "x$ac_cv_have_decl_fputs_unlocked" = x""yes; then : + ac_have_decl=1 else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FLOCKFILE 0 -_ACEOF - - + ac_have_decl=0 fi - -{ $as_echo "$as_me:$LINENO: checking whether fputs_unlocked is declared" >&5 -$as_echo_n "checking whether fputs_unlocked is declared... " >&6; } -if test "${ac_cv_have_decl_fputs_unlocked+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef fputs_unlocked - (void) fputs_unlocked; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_fputs_unlocked=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_fputs_unlocked=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_fputs_unlocked" >&5 -$as_echo "$ac_cv_have_decl_fputs_unlocked" >&6; } -if test $ac_cv_have_decl_fputs_unlocked = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FPUTS_UNLOCKED 1 +#define HAVE_DECL_FPUTS_UNLOCKED $ac_have_decl _ACEOF - +ac_fn_c_check_decl "$LINENO" "funlockfile" "ac_cv_have_decl_funlockfile" "$ac_includes_default" +if test "x$ac_cv_have_decl_funlockfile" = x""yes; then : + ac_have_decl=1 else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FPUTS_UNLOCKED 0 -_ACEOF - - + ac_have_decl=0 fi - -{ $as_echo "$as_me:$LINENO: checking whether funlockfile is declared" >&5 -$as_echo_n "checking whether funlockfile is declared... " >&6; } -if test "${ac_cv_have_decl_funlockfile+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef funlockfile - (void) funlockfile; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_funlockfile=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_funlockfile=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_funlockfile" >&5 -$as_echo "$ac_cv_have_decl_funlockfile" >&6; } -if test $ac_cv_have_decl_funlockfile = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FUNLOCKFILE 1 +#define HAVE_DECL_FUNLOCKFILE $ac_have_decl _ACEOF - +ac_fn_c_check_decl "$LINENO" "putc_unlocked" "ac_cv_have_decl_putc_unlocked" "$ac_includes_default" +if test "x$ac_cv_have_decl_putc_unlocked" = x""yes; then : + ac_have_decl=1 else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FUNLOCKFILE 0 -_ACEOF - - + ac_have_decl=0 fi - -{ $as_echo "$as_me:$LINENO: checking whether putc_unlocked is declared" >&5 -$as_echo_n "checking whether putc_unlocked is declared... " >&6; } -if test "${ac_cv_have_decl_putc_unlocked+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef putc_unlocked - (void) putc_unlocked; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_putc_unlocked=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_putc_unlocked=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_putc_unlocked" >&5 -$as_echo "$ac_cv_have_decl_putc_unlocked" >&6; } -if test $ac_cv_have_decl_putc_unlocked = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_PUTC_UNLOCKED 1 +#define HAVE_DECL_PUTC_UNLOCKED $ac_have_decl _ACEOF + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_sys_time_h='<'sys/time.h'>' + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +$as_echo_n "checking absolute name of ... " >&6; } +if test "${gl_cv_next_sys_time_h+set}" = set; then : + $as_echo_n "(cached) " >&6 else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_PUTC_UNLOCKED 0 -_ACEOF + if test $ac_cv_header_sys_time_h = yes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + gl_cv_next_sys_time_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n '\#/sys/time.h#{ + s#.*"\(.*/sys/time.h\)".*#\1# + s#^/[^/]#//&# + p + q + }'`'"' + else + gl_cv_next_sys_time_h='<'sys/time.h'>' + fi fi - - - - - - - - - - - - - +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_time_h" >&5 +$as_echo "$gl_cv_next_sys_time_h" >&6; } + fi + NEXT_SYS_TIME_H=$gl_cv_next_sys_time_h if test $ac_cv_header_sys_time_h = yes; then - { $as_echo "$as_me:$LINENO: checking absolute name of " >&5 -$as_echo_n "checking absolute name of ... " >&6; } -if test "${gl_cv_absolute_sys_time_h+set}" = set; then - $as_echo_n "(cached) " >&6 -else - - - - - - if test $ac_cv_header_sys_time_h = yes; then - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF - gl_cv_absolute_sys_time_h=`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | -sed -n '\#/sys/time.h#{s#.*"\(.*/sys/time.h\)".*#\1#;s#^/[^/]#//&#;p;q;}'` - fi - -fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_absolute_sys_time_h" >&5 -$as_echo "$gl_cv_absolute_sys_time_h" >&6; } -cat >>confdefs.h <<_ACEOF -#define ABSOLUTE_SYS_TIME_H "$gl_cv_absolute_sys_time_h" -_ACEOF - - - ABSOLUTE_SYS_TIME_H=\"$gl_cv_absolute_sys_time_h\" HAVE_SYS_TIME_H=1 else - ABSOLUTE_SYS_TIME_H=\"no/such/file/sys/time.h\" HAVE_SYS_TIME_H=0 fi - - { $as_echo "$as_me:$LINENO: checking for struct timeval" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timeval" >&5 $as_echo_n "checking for struct timeval... " >&6; } -if test "${gl_cv_sys_struct_timeval+set}" = set; then +if test "${gl_cv_sys_struct_timeval+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if HAVE_SYS_TIME_H #include @@ -10815,35 +9567,14 @@ static struct timeval x; x.tv_sec = x.tv_usec; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : gl_cv_sys_struct_timeval=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - gl_cv_sys_struct_timeval=no + gl_cv_sys_struct_timeval=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_sys_struct_timeval" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timeval" >&5 $as_echo "$gl_cv_sys_struct_timeval" >&6; } if test $gl_cv_sys_struct_timeval = yes; then HAVE_STRUCT_TIMEVAL=1 @@ -10882,7 +9613,7 @@ $as_echo "$gl_cv_sys_struct_timeval" >&6; } # Check whether --with-gnu-ld was given. -if test "${with_gnu_ld+set}" = set; then +if test "${with_gnu_ld+set}" = set; then : withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no @@ -10904,7 +9635,7 @@ fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. - { $as_echo "$as_me:$LINENO: checking for ld used by GCC" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by GCC" >&5 $as_echo_n "checking for ld used by GCC... " >&6; } case $host in *-*-mingw*) @@ -10934,13 +9665,13 @@ $as_echo_n "checking for ld used by GCC... " >&6; } ;; esac elif test "$with_gnu_ld" = yes; then - { $as_echo "$as_me:$LINENO: checking for GNU ld" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else - { $as_echo "$as_me:$LINENO: checking for non-GNU ld" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi -if test "${acl_cv_path_LD+set}" = set; then +if test "${acl_cv_path_LD+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then @@ -10968,18 +9699,16 @@ fi LD="$acl_cv_path_LD" if test -n "$LD"; then - { $as_echo "$as_me:$LINENO: result: $LD" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5 $as_echo "$LD" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi -test -z "$LD" && { { $as_echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 -$as_echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} - { (exit 1); exit 1; }; } -{ $as_echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 +test -z "$LD" && as_fn_error "no acceptable ld found in \$PATH" "$LINENO" 5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } -if test "${acl_cv_prog_gnu_ld+set}" = set; then +if test "${acl_cv_prog_gnu_ld+set}" = set; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU ld's only accept -v. @@ -10990,16 +9719,16 @@ case `$LD -v 2>&1 &5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $acl_cv_prog_gnu_ld" >&5 $as_echo "$acl_cv_prog_gnu_ld" >&6; } with_gnu_ld=$acl_cv_prog_gnu_ld - { $as_echo "$as_me:$LINENO: checking for shared library run path origin" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shared library run path origin" >&5 $as_echo_n "checking for shared library run path origin... " >&6; } -if test "${acl_cv_rpath+set}" = set; then +if test "${acl_cv_rpath+set}" = set; then : $as_echo_n "(cached) " >&6 else @@ -11010,7 +9739,7 @@ else acl_cv_rpath=done fi -{ $as_echo "$as_me:$LINENO: result: $acl_cv_rpath" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $acl_cv_rpath" >&5 $as_echo "$acl_cv_rpath" >&6; } wl="$acl_cv_wl" acl_libext="$acl_cv_libext" @@ -11022,7 +9751,7 @@ $as_echo "$acl_cv_rpath" >&6; } acl_hardcode_direct="$acl_cv_hardcode_direct" acl_hardcode_minus_L="$acl_cv_hardcode_minus_L" # Check whether --enable-rpath was given. -if test "${enable_rpath+set}" = set; then +if test "${enable_rpath+set}" = set; then : enableval=$enable_rpath; : else enable_rpath=yes @@ -11030,23 +9759,70 @@ fi - acl_libdirstem=lib - searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` - if test -n "$searchpath"; then - acl_save_IFS="${IFS= }"; IFS=":" - for searchdir in $searchpath; do - if test -d "$searchdir"; then - case "$searchdir" in - */lib64/ | */lib64 ) acl_libdirstem=lib64 ;; - *) searchdir=`cd "$searchdir" && pwd` - case "$searchdir" in - */lib64 ) acl_libdirstem=lib64 ;; - esac ;; + + acl_libdirstem=lib + acl_libdirstem2= + case "$host_os" in + solaris*) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit host" >&5 +$as_echo_n "checking for 64-bit host... " >&6; } +if test "${gl_cv_solaris_64bit+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifdef _LP64 +sixtyfour bits +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "sixtyfour bits" >/dev/null 2>&1; then : + gl_cv_solaris_64bit=yes +else + gl_cv_solaris_64bit=no +fi +rm -f conftest* + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_solaris_64bit" >&5 +$as_echo "$gl_cv_solaris_64bit" >&6; } + if test $gl_cv_solaris_64bit = yes; then + acl_libdirstem=lib/64 + case "$host_cpu" in + sparc*) acl_libdirstem2=lib/sparcv9 ;; + i*86 | x86_64) acl_libdirstem2=lib/amd64 ;; esac fi - done - IFS="$acl_save_IFS" - fi + ;; + *) + searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` + if test -n "$searchpath"; then + acl_save_IFS="${IFS= }"; IFS=":" + for searchdir in $searchpath; do + if test -d "$searchdir"; then + case "$searchdir" in + */lib64/ | */lib64 ) acl_libdirstem=lib64 ;; + */../ | */.. ) + # Better ignore directories of this form. They are misleading. + ;; + *) searchdir=`cd "$searchdir" && pwd` + case "$searchdir" in + */lib64 ) acl_libdirstem=lib64 ;; + esac ;; + esac + fi + done + IFS="$acl_save_IFS" + fi + ;; + esac + test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem" + + + @@ -11071,7 +9847,7 @@ fi # Check whether --with-libiconv-prefix was given. -if test "${with_libiconv_prefix+set}" = set; then +if test "${with_libiconv_prefix+set}" = set; then : withval=$with_libiconv_prefix; if test "X$withval" = "Xno"; then use_additional=no @@ -11092,6 +9868,10 @@ if test "${with_libiconv_prefix+set}" = set; then else additional_includedir="$withval/include" additional_libdir="$withval/$acl_libdirstem" + if test "$acl_libdirstem2" != "$acl_libdirstem" \ + && ! test -d "$withval/$acl_libdirstem"; then + additional_libdir="$withval/$acl_libdirstem2" + fi fi fi @@ -11243,7 +10023,9 @@ fi if test "X$found_dir" != "X"; then LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$found_dir -l$name" if test "X$found_so" != "X"; then - if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/$acl_libdirstem"; then + if test "$enable_rpath" = no \ + || test "X$found_dir" = "X/usr/$acl_libdirstem" \ + || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" else haveit= @@ -11310,7 +10092,16 @@ fi case "$found_dir" in */$acl_libdirstem | */$acl_libdirstem/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` - LIBICONV_PREFIX="$basedir" + if test "$name" = 'iconv'; then + LIBICONV_PREFIX="$basedir" + fi + additional_includedir="$basedir/include" + ;; + */$acl_libdirstem2 | */$acl_libdirstem2/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'` + if test "$name" = 'iconv'; then + LIBICONV_PREFIX="$basedir" + fi additional_includedir="$basedir/include" ;; esac @@ -11359,9 +10150,11 @@ fi case "$dep" in -L*) additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` - if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then + if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \ + && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then haveit= - if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then + if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \ + || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; @@ -11488,62 +10281,22 @@ fi fi -{ $as_echo "$as_me:$LINENO: checking for off_t" >&5 -$as_echo_n "checking for off_t... " >&6; } -if test "${ac_cv_type_off_t+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -typedef off_t ac__type_new_; -int -main () -{ -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type_off_t=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_off_t=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5 -$as_echo "$ac_cv_type_off_t" >&6; } -if test $ac_cv_type_off_t = yes; then - : + + + + + REPLACE_ICONV=0; + REPLACE_ICONV_OPEN=0; + REPLACE_ICONV_UTF=0; + ICONV_H=''; + + + +ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default" +if test "x$ac_cv_type_off_t" = x""yes; then : + else cat >>confdefs.h <<_ACEOF @@ -11553,68 +10306,56 @@ _ACEOF fi - { $as_echo "$as_me:$LINENO: checking for unsigned long long int" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for unsigned long long int" >&5 $as_echo_n "checking for unsigned long long int... " >&6; } -if test "${ac_cv_type_unsigned_long_long_int+set}" = set; then +if test "${ac_cv_type_unsigned_long_long_int+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -unsigned long long int ull = 18446744073709551615ULL; - typedef int a[(18446744073709551615ULL <= (unsigned long long int) -1 - ? 1 : -1)]; - int i = 63; + + /* For now, do not test the preprocessor; as of 2007 there are too many + implementations with broken preprocessors. Perhaps this can + be revisited in 2012. In the meantime, code should not expect + #if to work with literals wider than 32 bits. */ + /* Test literals. */ + long long int ll = 9223372036854775807ll; + long long int nll = -9223372036854775807LL; + unsigned long long int ull = 18446744073709551615ULL; + /* Test constant expressions. */ + typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll) + ? 1 : -1)]; + typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1 + ? 1 : -1)]; + int i = 63; int main () { -unsigned long long int ullmax = 18446744073709551615ull; - return (ull << 63 | ull >> 63 | ull << i | ull >> i - | ullmax / ull | ullmax % ull); +/* Test availability of runtime routines for shift and division. */ + long long int llmax = 9223372036854775807ll; + unsigned long long int ullmax = 18446744073709551615ull; + return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i) + | (llmax / ll) | (llmax % ll) + | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i) + | (ullmax / ull) | (ullmax % ull)); ; return 0; } + _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then +if ac_fn_c_try_link "$LINENO"; then : ac_cv_type_unsigned_long_long_int=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_unsigned_long_long_int=no + ac_cv_type_unsigned_long_long_int=no fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_unsigned_long_long_int" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_unsigned_long_long_int" >&5 $as_echo "$ac_cv_type_unsigned_long_long_int" >&6; } if test $ac_cv_type_unsigned_long_long_int = yes; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_UNSIGNED_LONG_LONG_INT 1 -_ACEOF +$as_echo "#define HAVE_UNSIGNED_LONG_LONG_INT 1" >>confdefs.h fi @@ -11623,6 +10364,53 @@ _ACEOF + gl_cv_c_multiarch=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __APPLE_CC__ + not a universal capable compiler + #endif + typedef int dummy; + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + arch= + prev= + for word in ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}; do + if test -n "$prev"; then + case $word in + i?86 | x86_64 | ppc | ppc64) + if test -z "$arch" || test "$arch" = "$word"; then + arch="$word" + else + gl_cv_c_multiarch=yes + fi + ;; + esac + prev= + else + if test "x$word" = "x-arch"; then + prev=arch + fi + fi + done + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if test $gl_cv_c_multiarch = yes; then + +$as_echo "#define AA_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h + + APPLE_UNIVERSAL_BUILD=1 + else + APPLE_UNIVERSAL_BUILD=0 + fi + + + + + if test $ac_cv_type_long_long_int = yes; then HAVE_LONG_LONG_INT=1 else @@ -11651,66 +10439,89 @@ _ACEOF fi - if test $ac_cv_header_stdint_h = yes; then - { $as_echo "$as_me:$LINENO: checking absolute name of " >&5 + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_stdint_h='<'stdint.h'>' + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 $as_echo_n "checking absolute name of ... " >&6; } -if test "${gl_cv_absolute_stdint_h+set}" = set; then +if test "${gl_cv_next_stdint_h+set}" = set; then : $as_echo_n "(cached) " >&6 else - - - - - if test $ac_cv_header_stdint_h = yes; then - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + if test $ac_cv_header_stdint_h = yes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include + _ACEOF - gl_cv_absolute_stdint_h=`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | -sed -n '\#/stdint.h#{s#.*"\(.*/stdint.h\)".*#\1#;s#^/[^/]#//&#;p;q;}'` - fi + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + gl_cv_next_stdint_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n '\#/stdint.h#{ + s#.*"\(.*/stdint.h\)".*#\1# + s#^/[^/]#//&# + p + q + }'`'"' + else + gl_cv_next_stdint_h='<'stdint.h'>' + fi fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_absolute_stdint_h" >&5 -$as_echo "$gl_cv_absolute_stdint_h" >&6; } -cat >>confdefs.h <<_ACEOF -#define ABSOLUTE_STDINT_H "$gl_cv_absolute_stdint_h" -_ACEOF +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdint_h" >&5 +$as_echo "$gl_cv_next_stdint_h" >&6; } + fi + NEXT_STDINT_H=$gl_cv_next_stdint_h - ABSOLUTE_STDINT_H=\"$gl_cv_absolute_stdint_h\" + + if test $ac_cv_header_stdint_h = yes; then HAVE_STDINT_H=1 else - ABSOLUTE_STDINT_H=\"no/such/file/stdint.h\" HAVE_STDINT_H=0 fi - - if test $ac_cv_header_stdint_h = yes; then - { $as_echo "$as_me:$LINENO: checking whether stdint.h conforms to C99" >&5 + if test $ac_cv_header_stdint_h = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stdint.h conforms to C99" >&5 $as_echo_n "checking whether stdint.h conforms to C99... " >&6; } -if test "${gl_cv_header_working_stdint_h+set}" = set; then +if test "${gl_cv_header_working_stdint_h+set}" = set; then : $as_echo_n "(cached) " >&6 else gl_cv_header_working_stdint_h=no - cat >conftest.$ac_ext <<_ACEOF - - /* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include + #define __STDC_LIMIT_MACROS 1 /* to make it work also in C++ mode */ #define __STDC_CONSTANT_MACROS 1 /* to make it work also in C++ mode */ -#include ABSOLUTE_STDINT_H +#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ +#include +/* Dragonfly defines WCHAR_MIN, WCHAR_MAX only in . */ +#if !(defined WCHAR_MIN && defined WCHAR_MAX) +#error "WCHAR_MIN, WCHAR_MAX not defined in " +#endif + + + /* BSD/OS 4.0.1 has a bug: , and must be + included before . */ + #include + #include + #if HAVE_WCHAR_H + # include + # include + # include + #endif + + #ifdef INT8_MAX int8_t a1 = INT8_MAX; int8_t a1min = INT8_MIN; @@ -11782,12 +10593,32 @@ uintptr_t h = UINTPTR_MAX; #endif intmax_t i = INTMAX_MAX; uintmax_t j = UINTMAX_MAX; + +#include /* for CHAR_BIT */ +#define TYPE_MINIMUM(t) \ + ((t) ((t) 0 < (t) -1 ? (t) 0 : ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1))) +#define TYPE_MAXIMUM(t) \ + ((t) ((t) 0 < (t) -1 ? (t) -1 : ~ (~ (t) 0 << (sizeof (t) * CHAR_BIT - 1)))) struct s { - int check_PTRDIFF: PTRDIFF_MIN < 0 && 0 < PTRDIFF_MAX ? 1 : -1; - int check_SIG_ATOMIC: SIG_ATOMIC_MIN <= 0 && 0 < SIG_ATOMIC_MAX ? 1 : -1; - int check_SIZE: 0 < SIZE_MAX ? 1 : -1; - int check_WCHAR: WCHAR_MIN <= 0 && 0 < WCHAR_MAX ? 1 : -1; - int check_WINT: WINT_MIN <= 0 && 0 < WINT_MAX ? 1 : -1; + int check_PTRDIFF: + PTRDIFF_MIN == TYPE_MINIMUM (ptrdiff_t) + && PTRDIFF_MAX == TYPE_MAXIMUM (ptrdiff_t) + ? 1 : -1; + /* Detect bug in FreeBSD 6.0 / ia64. */ + int check_SIG_ATOMIC: + SIG_ATOMIC_MIN == TYPE_MINIMUM (sig_atomic_t) + && SIG_ATOMIC_MAX == TYPE_MAXIMUM (sig_atomic_t) + ? 1 : -1; + int check_SIZE: SIZE_MAX == TYPE_MAXIMUM (size_t) ? 1 : -1; + int check_WCHAR: + WCHAR_MIN == TYPE_MINIMUM (wchar_t) + && WCHAR_MAX == TYPE_MAXIMUM (wchar_t) + ? 1 : -1; + /* Detect bug in mingw. */ + int check_WINT: + WINT_MIN == TYPE_MINIMUM (wint_t) + && WINT_MAX == TYPE_MAXIMUM (wint_t) + ? 1 : -1; /* Detect bugs in glibc 2.4 and Solaris 10 stdint.h, among others. */ int check_UINT8_C: @@ -11829,183 +10660,112 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - gl_cv_header_working_stdint_h=yes +if ac_fn_c_try_compile "$LINENO"; then : + if test "$cross_compiling" = yes; then : + gl_cv_header_working_stdint_h=yes + else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +#define __STDC_LIMIT_MACROS 1 /* to make it work also in C++ mode */ +#define __STDC_CONSTANT_MACROS 1 /* to make it work also in C++ mode */ +#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ +#include + + + /* BSD/OS 4.0.1 has a bug: , and must be + included before . */ + #include + #include + #if HAVE_WCHAR_H + # include + # include + # include + #endif + + +#include +#include +#define MVAL(macro) MVAL1(macro) +#define MVAL1(expression) #expression +static const char *macro_values[] = + { +#ifdef INT8_MAX + MVAL (INT8_MAX), +#endif +#ifdef INT16_MAX + MVAL (INT16_MAX), +#endif +#ifdef INT32_MAX + MVAL (INT32_MAX), +#endif +#ifdef INT64_MAX + MVAL (INT64_MAX), +#endif +#ifdef UINT8_MAX + MVAL (UINT8_MAX), +#endif +#ifdef UINT16_MAX + MVAL (UINT16_MAX), +#endif +#ifdef UINT32_MAX + MVAL (UINT32_MAX), +#endif +#ifdef UINT64_MAX + MVAL (UINT64_MAX), +#endif + NULL + }; + +int +main () +{ + + const char **mv; + for (mv = macro_values; *mv != NULL; mv++) + { + const char *value = *mv; + /* Test whether it looks like a cast expression. */ + if (strncmp (value, "((unsigned int)"/*)*/, 15) == 0 + || strncmp (value, "((unsigned short)"/*)*/, 17) == 0 + || strncmp (value, "((unsigned char)"/*)*/, 16) == 0 + || strncmp (value, "((int)"/*)*/, 6) == 0 + || strncmp (value, "((signed short)"/*)*/, 15) == 0 + || strncmp (value, "((signed char)"/*)*/, 14) == 0) + return 1; + } + return 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_header_working_stdint_h=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_header_working_stdint_h" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_working_stdint_h" >&5 $as_echo "$gl_cv_header_working_stdint_h" >&6; } fi if test "$gl_cv_header_working_stdint_h" = yes; then STDINT_H= else - - -for ac_header in sys/inttypes.h sys/bitypes.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-coreutils@gnu.org ## -## ------------------------------------ ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - -fi -if test `eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` = yes; then + for ac_header in sys/inttypes.h sys/bitypes.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +eval as_val=\$$as_ac_Header + if test "x$as_val" = x""yes; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF @@ -12031,394 +10791,82 @@ done + if test $APPLE_UNIVERSAL_BUILD = 0; then - - - for gltype in ptrdiff_t sig_atomic_t size_t wchar_t wint_t ; do - { $as_echo "$as_me:$LINENO: checking for bit size of $gltype" >&5 + for gltype in ptrdiff_t size_t ; do + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bit size of $gltype" >&5 $as_echo_n "checking for bit size of $gltype... " >&6; } -if { as_var=gl_cv_bitsizeof_${gltype}; eval "test \"\${$as_var+set}\" = set"; }; then +if { as_var=gl_cv_bitsizeof_${gltype}; eval "test \"\${$as_var+set}\" = set"; }; then : $as_echo_n "(cached) " >&6 else - if test "$cross_compiling" = yes; then - # Depending upon the size, compute the lo and hi bounds. -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - + if ac_fn_c_compute_int "$LINENO" "sizeof ($gltype) * CHAR_BIT" "result" " /* BSD/OS 4.0.1 has a bug: , and must be included before . */ #include #include - #include - #include - #include + #if HAVE_WCHAR_H + # include + # include + # include + #endif -#include -int -main () -{ -static int test_array [1 - 2 * !((sizeof ($gltype) * CHAR_BIT) >= 0)]; -test_array [0] = 0 +#include "; then : - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_lo=0 ac_mid=0 - while :; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - - /* BSD/OS 4.0.1 has a bug: , and must be - included before . */ - #include - #include - #include - #include - #include - -#include -int -main () -{ -static int test_array [1 - 2 * !((sizeof ($gltype) * CHAR_BIT) <= $ac_mid)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_hi=$ac_mid; break else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_lo=`expr $ac_mid + 1` - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid + 1` + result=unknown fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - - /* BSD/OS 4.0.1 has a bug: , and must be - included before . */ - #include - #include - #include - #include - #include - -#include -int -main () -{ -static int test_array [1 - 2 * !((sizeof ($gltype) * CHAR_BIT) < 0)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_hi=-1 ac_mid=-1 - while :; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - - /* BSD/OS 4.0.1 has a bug: , and must be - included before . */ - #include - #include - #include - #include - #include - -#include -int -main () -{ -static int test_array [1 - 2 * !((sizeof ($gltype) * CHAR_BIT) >= $ac_mid)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_lo=$ac_mid; break -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_hi=`expr '(' $ac_mid ')' - 1` - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid` -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_lo= ac_hi= -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -# Binary search between lo and hi bounds. -while test "x$ac_lo" != "x$ac_hi"; do - ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - - /* BSD/OS 4.0.1 has a bug: , and must be - included before . */ - #include - #include - #include - #include - #include - -#include -int -main () -{ -static int test_array [1 - 2 * !((sizeof ($gltype) * CHAR_BIT) <= $ac_mid)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_hi=$ac_mid -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_lo=`expr '(' $ac_mid ')' + 1` -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -done -case $ac_lo in -?*) result=$ac_lo;; -'') result=unknown ;; -esac -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - - /* BSD/OS 4.0.1 has a bug: , and must be - included before . */ - #include - #include - #include - #include - #include - -#include -static long int longval () { return sizeof ($gltype) * CHAR_BIT; } -static unsigned long int ulongval () { return sizeof ($gltype) * CHAR_BIT; } -#include -#include -int -main () -{ - - FILE *f = fopen ("conftest.val", "w"); - if (! f) - return 1; - if ((sizeof ($gltype) * CHAR_BIT) < 0) - { - long int i = longval (); - if (i != (sizeof ($gltype) * CHAR_BIT)) - return 1; - fprintf (f, "%ld", i); - } - else - { - unsigned long int i = ulongval (); - if (i != (sizeof ($gltype) * CHAR_BIT)) - return 1; - fprintf (f, "%lu", i); - } - /* Do not output a trailing newline, as this causes \r\n confusion - on some platforms. */ - return ferror (f) || fclose (f) != 0; - - ; - return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - result=`cat conftest.val` -else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -result=unknown -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -rm -f conftest.val eval gl_cv_bitsizeof_${gltype}=\$result fi -ac_res=`eval 'as_val=${'gl_cv_bitsizeof_${gltype}'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +eval ac_res=\$gl_cv_bitsizeof_${gltype} + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval result=\$gl_cv_bitsizeof_${gltype} + if test $result = unknown; then + result=0 + fi + GLTYPE=`echo "$gltype" | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` + cat >>confdefs.h <<_ACEOF +#define BITSIZEOF_${GLTYPE} $result +_ACEOF + + eval BITSIZEOF_${GLTYPE}=\$result + done + + + fi + + + for gltype in sig_atomic_t wchar_t wint_t ; do + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bit size of $gltype" >&5 +$as_echo_n "checking for bit size of $gltype... " >&6; } +if { as_var=gl_cv_bitsizeof_${gltype}; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "sizeof ($gltype) * CHAR_BIT" "result" " + /* BSD/OS 4.0.1 has a bug: , and must be + included before . */ + #include + #include + #if HAVE_WCHAR_H + # include + # include + # include + #endif + +#include "; then : + +else + result=unknown +fi + + eval gl_cv_bitsizeof_${gltype}=\$result + +fi +eval ac_res=\$gl_cv_bitsizeof_${gltype} + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval result=\$gl_cv_bitsizeof_${gltype} if test $result = unknown; then @@ -12435,29 +10883,24 @@ _ACEOF - - - for gltype in sig_atomic_t wchar_t wint_t ; do - { $as_echo "$as_me:$LINENO: checking whether $gltype is signed" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gltype is signed" >&5 $as_echo_n "checking whether $gltype is signed... " >&6; } -if { as_var=gl_cv_type_${gltype}_signed; eval "test \"\${$as_var+set}\" = set"; }; then +if { as_var=gl_cv_type_${gltype}_signed; eval "test \"\${$as_var+set}\" = set"; }; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* BSD/OS 4.0.1 has a bug: , and must be included before . */ #include #include - #include - #include - #include + #if HAVE_WCHAR_H + # include + # include + # include + #endif int verify[2 * (($gltype) -1 < ($gltype) 0) - 1]; int @@ -12468,39 +10911,17 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : result=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - result=no + result=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext eval gl_cv_type_${gltype}_signed=\$result fi -ac_res=`eval 'as_val=${'gl_cv_type_${gltype}_signed'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +eval ac_res=\$gl_cv_type_${gltype}_signed + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval result=\$gl_cv_type_${gltype}_signed GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` @@ -12518,17 +10939,13 @@ _ACEOF gl_cv_type_ptrdiff_t_signed=yes gl_cv_type_size_t_signed=no + if test $APPLE_UNIVERSAL_BUILD = 0; then - - - - - - for gltype in ptrdiff_t sig_atomic_t size_t wchar_t wint_t ; do - { $as_echo "$as_me:$LINENO: checking for $gltype integer literal suffix" >&5 + for gltype in ptrdiff_t size_t ; do + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $gltype integer literal suffix" >&5 $as_echo_n "checking for $gltype integer literal suffix... " >&6; } -if { as_var=gl_cv_type_${gltype}_suffix; eval "test \"\${$as_var+set}\" = set"; }; then +if { as_var=gl_cv_type_${gltype}_suffix; eval "test \"\${$as_var+set}\" = set"; }; then : $as_echo_n "(cached) " >&6 else eval gl_cv_type_${gltype}_suffix=no @@ -12549,20 +10966,18 @@ else ull) gltype1='unsigned long long int';; ui64)gltype1='unsigned __int64';; esac - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* BSD/OS 4.0.1 has a bug: , and must be included before . */ #include #include - #include - #include - #include + #if HAVE_WCHAR_H + # include + # include + # include + #endif extern $gltype foo; extern $gltype1 foo; @@ -12574,40 +10989,88 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : eval gl_cv_type_${gltype}_suffix=\$glsuf -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext eval result=\$gl_cv_type_${gltype}_suffix test "$result" != no && break done fi -ac_res=`eval 'as_val=${'gl_cv_type_${gltype}_suffix'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +eval ac_res=\$gl_cv_type_${gltype}_suffix + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` + eval result=\$gl_cv_type_${gltype}_suffix + test "$result" = no && result= + eval ${GLTYPE}_SUFFIX=\$result + cat >>confdefs.h <<_ACEOF +#define ${GLTYPE}_SUFFIX $result +_ACEOF + + done + + + fi + + + for gltype in sig_atomic_t wchar_t wint_t ; do + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $gltype integer literal suffix" >&5 +$as_echo_n "checking for $gltype integer literal suffix... " >&6; } +if { as_var=gl_cv_type_${gltype}_suffix; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 +else + eval gl_cv_type_${gltype}_suffix=no + eval result=\$gl_cv_type_${gltype}_signed + if test "$result" = yes; then + glsufu= + else + glsufu=u + fi + for glsuf in "$glsufu" ${glsufu}l ${glsufu}ll ${glsufu}i64; do + case $glsuf in + '') gltype1='int';; + l) gltype1='long int';; + ll) gltype1='long long int';; + i64) gltype1='__int64';; + u) gltype1='unsigned int';; + ul) gltype1='unsigned long int';; + ull) gltype1='unsigned long long int';; + ui64)gltype1='unsigned __int64';; + esac + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + /* BSD/OS 4.0.1 has a bug: , and must be + included before . */ + #include + #include + #if HAVE_WCHAR_H + # include + # include + # include + #endif + + extern $gltype foo; + extern $gltype1 foo; +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval gl_cv_type_${gltype}_suffix=\$glsuf +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + eval result=\$gl_cv_type_${gltype}_suffix + test "$result" != no && break + done +fi +eval ac_res=\$gl_cv_type_${gltype}_suffix + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` eval result=\$gl_cv_type_${gltype}_suffix @@ -12626,150 +11089,12 @@ _ACEOF - -for ac_header in inttypes.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-coreutils@gnu.org ## -## ------------------------------------ ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - -fi -if test `eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` = yes; then + for ac_header in inttypes.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "inttypes.h" "ac_cv_header_inttypes_h" "$ac_includes_default" +if test "x$ac_cv_header_inttypes_h" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define HAVE_INTTYPES_H 1 _ACEOF fi @@ -12777,17 +11102,13 @@ fi done if test $ac_cv_header_inttypes_h = yes; then - { $as_echo "$as_me:$LINENO: checking whether the inttypes.h PRIxNN macros are broken" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the inttypes.h PRIxNN macros are broken" >&5 $as_echo_n "checking whether the inttypes.h PRIxNN macros are broken... " >&6; } -if test "${gt_cv_inttypes_pri_broken+set}" = set; then +if test "${gt_cv_inttypes_pri_broken+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #ifdef PRId32 @@ -12802,36 +11123,15 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : gt_cv_inttypes_pri_broken=no else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - gt_cv_inttypes_pri_broken=yes + gt_cv_inttypes_pri_broken=yes fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $gt_cv_inttypes_pri_broken" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_inttypes_pri_broken" >&5 $as_echo "$gt_cv_inttypes_pri_broken" >&6; } fi if test "$gt_cv_inttypes_pri_broken" = yes; then @@ -12846,283 +11146,51 @@ _ACEOF fi -{ $as_echo "$as_me:$LINENO: checking whether imaxabs is declared" >&5 -$as_echo_n "checking whether imaxabs is declared... " >&6; } -if test "${ac_cv_have_decl_imaxabs+set}" = set; then - $as_echo_n "(cached) " >&6 +ac_fn_c_check_decl "$LINENO" "imaxabs" "ac_cv_have_decl_imaxabs" "$ac_includes_default" +if test "x$ac_cv_have_decl_imaxabs" = x""yes; then : + ac_have_decl=1 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef imaxabs - (void) imaxabs; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_imaxabs=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_imaxabs=no + ac_have_decl=0 fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_imaxabs" >&5 -$as_echo "$ac_cv_have_decl_imaxabs" >&6; } -if test $ac_cv_have_decl_imaxabs = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_IMAXABS 1 +#define HAVE_DECL_IMAXABS $ac_have_decl _ACEOF - +ac_fn_c_check_decl "$LINENO" "imaxdiv" "ac_cv_have_decl_imaxdiv" "$ac_includes_default" +if test "x$ac_cv_have_decl_imaxdiv" = x""yes; then : + ac_have_decl=1 else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_IMAXABS 0 -_ACEOF - - + ac_have_decl=0 fi - -{ $as_echo "$as_me:$LINENO: checking whether imaxdiv is declared" >&5 -$as_echo_n "checking whether imaxdiv is declared... " >&6; } -if test "${ac_cv_have_decl_imaxdiv+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef imaxdiv - (void) imaxdiv; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_imaxdiv=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_imaxdiv=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_imaxdiv" >&5 -$as_echo "$ac_cv_have_decl_imaxdiv" >&6; } -if test $ac_cv_have_decl_imaxdiv = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_IMAXDIV 1 +#define HAVE_DECL_IMAXDIV $ac_have_decl _ACEOF - +ac_fn_c_check_decl "$LINENO" "strtoimax" "ac_cv_have_decl_strtoimax" "$ac_includes_default" +if test "x$ac_cv_have_decl_strtoimax" = x""yes; then : + ac_have_decl=1 else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_IMAXDIV 0 -_ACEOF - - + ac_have_decl=0 fi - -{ $as_echo "$as_me:$LINENO: checking whether strtoimax is declared" >&5 -$as_echo_n "checking whether strtoimax is declared... " >&6; } -if test "${ac_cv_have_decl_strtoimax+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef strtoimax - (void) strtoimax; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_strtoimax=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_strtoimax=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_strtoimax" >&5 -$as_echo "$ac_cv_have_decl_strtoimax" >&6; } -if test $ac_cv_have_decl_strtoimax = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_STRTOIMAX 1 +#define HAVE_DECL_STRTOIMAX $ac_have_decl _ACEOF - +ac_fn_c_check_decl "$LINENO" "strtoumax" "ac_cv_have_decl_strtoumax" "$ac_includes_default" +if test "x$ac_cv_have_decl_strtoumax" = x""yes; then : + ac_have_decl=1 else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_STRTOIMAX 0 -_ACEOF - - + ac_have_decl=0 fi - -{ $as_echo "$as_me:$LINENO: checking whether strtoumax is declared" >&5 -$as_echo_n "checking whether strtoumax is declared... " >&6; } -if test "${ac_cv_have_decl_strtoumax+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef strtoumax - (void) strtoumax; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_strtoumax=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_strtoumax=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_strtoumax" >&5 -$as_echo "$ac_cv_have_decl_strtoumax" >&6; } -if test $ac_cv_have_decl_strtoumax = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_STRTOUMAX 1 +#define HAVE_DECL_STRTOUMAX $ac_have_decl _ACEOF -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_STRTOUMAX 0 -_ACEOF - - -fi - - - GNULIB_IMAXABS=0; GNULIB_IMAXDIV=0; GNULIB_STRTOIMAX=0; @@ -13134,217 +11202,140 @@ fi -{ $as_echo "$as_me:$LINENO: checking whether lchown is declared" >&5 -$as_echo_n "checking whether lchown is declared... " >&6; } -if test "${ac_cv_have_decl_lchown+set}" = set; then + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the exponent in a 'float'" >&5 +$as_echo_n "checking where to find the exponent in a 'float'... " >&6; } +if test "${gl_cv_cc_float_expbit0+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef lchown - (void) lchown; -#endif - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_lchown=yes + if test "$cross_compiling" = yes; then : + gl_cv_cc_float_expbit0="word 0 bit 23" else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - ac_cv_have_decl_lchown=no +#include +#include +#include +#include +#define NWORDS \ + ((sizeof (float) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) +typedef union { float value; unsigned int word[NWORDS]; } memory_float; +static unsigned int ored_words[NWORDS]; +static unsigned int anded_words[NWORDS]; +static void add_to_ored_words (float x) +{ + memory_float m; + size_t i; + /* Clear it first, in case + sizeof (float) < sizeof (memory_float). */ + memset (&m, 0, sizeof (memory_float)); + m.value = x; + for (i = 0; i < NWORDS; i++) + { + ored_words[i] |= m.word[i]; + anded_words[i] &= m.word[i]; + } +} +int main () +{ + size_t j; + FILE *fp = fopen ("conftest.out", "w"); + if (fp == NULL) + return 1; + for (j = 0; j < NWORDS; j++) + anded_words[j] = ~ (unsigned int) 0; + add_to_ored_words (0.25f); + add_to_ored_words (0.5f); + add_to_ored_words (1.0f); + add_to_ored_words (2.0f); + add_to_ored_words (4.0f); + /* Remove bits that are common (e.g. if representation of the first mantissa + bit is explicit). */ + for (j = 0; j < NWORDS; j++) + ored_words[j] &= ~anded_words[j]; + /* Now find the nonzero word. */ + for (j = 0; j < NWORDS; j++) + if (ored_words[j] != 0) + break; + if (j < NWORDS) + { + size_t i; + for (i = j + 1; i < NWORDS; i++) + if (ored_words[i] != 0) + { + fprintf (fp, "unknown"); + return (fclose (fp) != 0); + } + for (i = 0; ; i++) + if ((ored_words[j] >> i) & 1) + { + fprintf (fp, "word %d bit %d", (int) j, (int) i); + return (fclose (fp) != 0); + } + } + fprintf (fp, "unknown"); + return (fclose (fp) != 0); +} + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_cc_float_expbit0=`cat conftest.out` +else + gl_cv_cc_float_expbit0="unknown" +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + rm -f conftest.out + fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_lchown" >&5 -$as_echo "$ac_cv_have_decl_lchown" >&6; } -if test $ac_cv_have_decl_lchown = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_float_expbit0" >&5 +$as_echo "$gl_cv_cc_float_expbit0" >&6; } + case "$gl_cv_cc_float_expbit0" in + word*bit*) + word=`echo "$gl_cv_cc_float_expbit0" | sed -e 's/word //' -e 's/ bit.*//'` + bit=`echo "$gl_cv_cc_float_expbit0" | sed -e 's/word.*bit //'` cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_LCHOWN 1 +#define FLT_EXPBIT0_WORD $word _ACEOF -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_LCHOWN 0 -_ACEOF - - -fi - - - - { $as_echo "$as_me:$LINENO: checking for nl_langinfo and CODESET" >&5 -$as_echo_n "checking for nl_langinfo and CODESET... " >&6; } -if test "${am_cv_langinfo_codeset+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -int -main () -{ -char* cs = nl_langinfo(CODESET); return !cs; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - am_cv_langinfo_codeset=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - am_cv_langinfo_codeset=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext - -fi -{ $as_echo "$as_me:$LINENO: result: $am_cv_langinfo_codeset" >&5 -$as_echo "$am_cv_langinfo_codeset" >&6; } - if test $am_cv_langinfo_codeset = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_LANGINFO_CODESET 1 -_ACEOF - - fi - -{ $as_echo "$as_me:$LINENO: checking whether getc_unlocked is declared" >&5 -$as_echo_n "checking whether getc_unlocked is declared... " >&6; } -if test "${ac_cv_have_decl_getc_unlocked+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef getc_unlocked - (void) getc_unlocked; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_getc_unlocked=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_getc_unlocked=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_getc_unlocked" >&5 -$as_echo "$ac_cv_have_decl_getc_unlocked" >&6; } -if test $ac_cv_have_decl_getc_unlocked = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_GETC_UNLOCKED 1 +#define FLT_EXPBIT0_BIT $bit _ACEOF + ;; + esac + + GNULIB_LCHMOD=0; + GNULIB_LSTAT=0; + HAVE_LCHMOD=1; + REPLACE_LSTAT=0; + REPLACE_MKDIR=0; + +ac_fn_c_check_decl "$LINENO" "getc_unlocked" "ac_cv_have_decl_getc_unlocked" "$ac_includes_default" +if test "x$ac_cv_have_decl_getc_unlocked" = x""yes; then : + ac_have_decl=1 else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_GETC_UNLOCKED 0 -_ACEOF - - + ac_have_decl=0 fi +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_GETC_UNLOCKED $ac_have_decl +_ACEOF - { $as_echo "$as_me:$LINENO: checking whether we are using the GNU C Library 2.1 or newer" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C Library 2.1 or newer" >&5 $as_echo_n "checking whether we are using the GNU C Library 2.1 or newer... " >&6; } -if test "${ac_cv_gnu_library_2_1+set}" = set; then +if test "${ac_cv_gnu_library_2_1+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -13356,7 +11347,7 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "Lucky GNU user" >/dev/null 2>&1; then + $EGREP "Lucky GNU user" >/dev/null 2>&1; then : ac_cv_gnu_library_2_1=yes else ac_cv_gnu_library_2_1=no @@ -13366,81 +11357,814 @@ rm -f conftest* fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_gnu_library_2_1" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_gnu_library_2_1" >&5 $as_echo "$ac_cv_gnu_library_2_1" >&6; } GLIBC21="$ac_cv_gnu_library_2_1" - { $as_echo "$as_me:$LINENO: checking whether mbrtowc and mbstate_t are properly declared" >&5 -$as_echo_n "checking whether mbrtowc and mbstate_t are properly declared... " >&6; } -if test "${gl_cv_func_mbrtowc+set}" = set; then + + + for ac_header in stdlib.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" +if test "x$ac_cv_header_stdlib_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_STDLIB_H 1 +_ACEOF + +fi + +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5 +$as_echo_n "checking for GNU libc compatible malloc... " >&6; } +if test "${ac_cv_func_malloc_0_nonnull+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ + if test "$cross_compiling" = yes; then : + ac_cv_func_malloc_0_nonnull=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if defined STDC_HEADERS || defined HAVE_STDLIB_H +# include +#else +char *malloc (); +#endif + +int +main () +{ +return ! malloc (0); + ; + return 0; +} _ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_func_malloc_0_nonnull=yes +else + ac_cv_func_malloc_0_nonnull=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_malloc_0_nonnull" >&5 +$as_echo "$ac_cv_func_malloc_0_nonnull" >&6; } +if test $ac_cv_func_malloc_0_nonnull = yes; then : + gl_cv_func_malloc_0_nonnull=1 +else + gl_cv_func_malloc_0_nonnull=0 +fi + + +cat >>confdefs.h <<_ACEOF +#define MALLOC_0_IS_NONNULL $gl_cv_func_malloc_0_nonnull +_ACEOF + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc and mbstate_t are properly declared" >&5 +$as_echo_n "checking whether mbrtowc and mbstate_t are properly declared... " >&6; } +if test "${ac_cv_func_mbrtowc+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { wchar_t wc; - char const s[] = ""; - size_t n = 1; - mbstate_t state; - return ! (sizeof state && (mbrtowc) (&wc, s, n, &state)); + char const s[] = ""; + size_t n = 1; + mbstate_t state; + return ! (sizeof state && (mbrtowc) (&wc, s, n, &state)); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - gl_cv_func_mbrtowc=yes +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_func_mbrtowc=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - gl_cv_func_mbrtowc=no + ac_cv_func_mbrtowc=no fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_mbrtowc" >&5 -$as_echo "$gl_cv_func_mbrtowc" >&6; } - if test $gl_cv_func_mbrtowc = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_mbrtowc" >&5 +$as_echo "$ac_cv_func_mbrtowc" >&6; } + if test $ac_cv_func_mbrtowc = yes; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_MBRTOWC 1 -_ACEOF +$as_echo "#define HAVE_MBRTOWC 1" >>confdefs.h fi + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a traditional japanese locale" >&5 +$as_echo_n "checking for a traditional japanese locale... " >&6; } +if test "${gt_cv_locale_ja+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () +{ + const char *p; + /* Check whether the given locale name is recognized by the system. */ + if (setlocale (LC_ALL, "") == NULL) return 1; + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether MB_CUR_MAX is > 1. This excludes the dysfunctional locales + on Cygwin 1.5.x. */ + if (MB_CUR_MAX == 1) + return 1; + /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. + This excludes the UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; + for (p = buf; *p != '\0'; p++) + if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) + return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the AIX locale name. + if (LC_ALL=ja_JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=ja_JP.EUC-JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.EUC-JP + else + # Test for the HP-UX, OSF/1, NetBSD locale name. + if (LC_ALL=ja_JP.eucJP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.eucJP + else + # Test for the IRIX, FreeBSD locale name. + if (LC_ALL=ja_JP.EUC LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.EUC + else + # Test for the Solaris 7 locale name. + if (LC_ALL=ja LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja + else + # Special test for NetBSD 1.6. + if test -f /usr/share/locale/ja_JP.eucJP/LC_CTYPE; then + gt_cv_locale_ja=ja_JP.eucJP + else + # None found. + gt_cv_locale_ja=none + fi + fi + fi + fi + fi + fi + fi + rm -fr conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_ja" >&5 +$as_echo "$gt_cv_locale_ja" >&6; } + LOCALE_JA=$gt_cv_locale_ja + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a transitional chinese locale" >&5 +$as_echo_n "checking for a transitional chinese locale... " >&6; } +if test "${gt_cv_locale_zh_CN+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () +{ + const char *p; + /* Check whether the given locale name is recognized by the system. */ + if (setlocale (LC_ALL, "") == NULL) return 1; + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. + This excludes the UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; + for (p = buf; *p != '\0'; p++) + if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) + return 1; + /* Check whether a typical GB18030 multibyte sequence is recognized as a + single wide character. This excludes the GB2312 and GBK encodings. */ + if (mblen ("\203\062\332\066", 5) != 4) + return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the locale name without encoding suffix. + if (LC_ALL=zh_CN LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=zh_CN + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=zh_CN.GB18030 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=zh_CN.GB18030 + else + # None found. + gt_cv_locale_zh_CN=none + fi + fi + else + # If there was a link error, due to mblen(), the system is so old that + # it certainly doesn't have a chinese locale. + gt_cv_locale_zh_CN=none + fi + rm -fr conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_zh_CN" >&5 +$as_echo "$gt_cv_locale_zh_CN" >&6; } + LOCALE_ZH_CN=$gt_cv_locale_zh_CN + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5 +$as_echo_n "checking for a french Unicode locale... " >&6; } +if test "${gt_cv_locale_fr_utf8+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () { + /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl + imitates locale dependent behaviour by looking at the environment + variables, and all locales use the UTF-8 encoding. */ +#if !(defined __BEOS__ || defined __HAIKU__) + /* Check whether the given locale name is recognized by the system. */ + if (setlocale (LC_ALL, "") == NULL) return 1; + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +# if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +# endif +# ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +# endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is + two bytes long, with UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 4 + || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v') + return 1; +#endif + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR.UTF-8 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr.UTF-8 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + fi + fi + fi + rm -fr conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5 +$as_echo "$gt_cv_locale_fr_utf8" >&6; } + LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8 + + + + + + + + + + + + + if test $ac_cv_func_mbsinit = yes && test $ac_cv_func_mbrtowc = yes; then + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles incomplete characters" >&5 +$as_echo_n "checking whether mbrtowc handles incomplete characters... " >&6; } +if test "${gl_cv_func_mbrtowc_incomplete_state+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + case "$host_os" in + # Guess no on AIX and OSF/1. + osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;; + esac + if test $LOCALE_JA != none; then + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +int main () +{ + if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) + { + const char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) + if (mbsinit (&state)) + return 1; + } + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_mbrtowc_incomplete_state=yes +else + gl_cv_func_mbrtowc_incomplete_state=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi + + fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_incomplete_state" >&5 +$as_echo "$gl_cv_func_mbrtowc_incomplete_state" >&6; } + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works as well as mbtowc" >&5 +$as_echo_n "checking whether mbrtowc works as well as mbtowc... " >&6; } +if test "${gl_cv_func_mbrtowc_sanitycheck+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + case "$host_os" in + # Guess no on Solaris 8. + solaris2.8) gl_cv_func_mbrtowc_sanitycheck="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_sanitycheck="guessing yes" ;; + esac + if test $LOCALE_ZH_CN != none; then + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +int main () +{ + /* This fails on Solaris 8: + mbrtowc returns 2, and sets wc to 0x00F0. + mbtowc returns 4 (correct) and sets wc to 0x5EDC. */ + if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) + { + char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 3, 6, &state) != 4 + && mbtowc (&wc, input + 3, 6) == 4) + return 1; + } + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_mbrtowc_sanitycheck=yes +else + gl_cv_func_mbrtowc_sanitycheck=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi + + fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_sanitycheck" >&5 +$as_echo "$gl_cv_func_mbrtowc_sanitycheck" >&6; } + + REPLACE_MBSTATE_T=0 + case "$gl_cv_func_mbrtowc_incomplete_state" in + *yes) ;; + *) REPLACE_MBSTATE_T=1 ;; + esac + case "$gl_cv_func_mbrtowc_sanitycheck" in + *yes) ;; + *) REPLACE_MBSTATE_T=1 ;; + esac + else + REPLACE_MBSTATE_T=1 + fi + if test $REPLACE_MBSTATE_T = 1; then + + + WCHAR_H=wchar.h + + fi + + if test $REPLACE_MBSTATE_T = 1; then + REPLACE_MBRTOWC=1 + fi + + if test $ac_cv_func_mbrtowc = no; then + HAVE_MBRTOWC=0 + fi + if test $HAVE_MBRTOWC != 0 && test $REPLACE_MBRTOWC != 1; then + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles a NULL string argument" >&5 +$as_echo_n "checking whether mbrtowc handles a NULL string argument... " >&6; } +if test "${gl_cv_func_mbrtowc_null_arg+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + case "$host_os" in + # Guess no on OSF/1. + osf*) gl_cv_func_mbrtowc_null_arg="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_null_arg="guessing yes" ;; + esac + if test $LOCALE_FR_UTF8 != none; then + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +int main () +{ + if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) + { + mbstate_t state; + wchar_t wc; + int ret; + + memset (&state, '\0', sizeof (mbstate_t)); + wc = (wchar_t) 0xBADFACE; + mbrtowc (&wc, NULL, 5, &state); + /* Check that wc was not modified. */ + if (wc != (wchar_t) 0xBADFACE) + return 1; + } + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_mbrtowc_null_arg=yes +else + gl_cv_func_mbrtowc_null_arg=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi + + fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_null_arg" >&5 +$as_echo "$gl_cv_func_mbrtowc_null_arg" >&6; } + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc has a correct return value" >&5 +$as_echo_n "checking whether mbrtowc has a correct return value... " >&6; } +if test "${gl_cv_func_mbrtowc_retval+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + case "$host_os" in + # Guess no on HP-UX and Solaris. + hpux* | solaris*) gl_cv_func_mbrtowc_retval="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_retval="guessing yes" ;; + esac + if test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none; then + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +int main () +{ + /* This fails on Solaris. */ + if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) + { + char input[] = "B\303\274\303\237er"; /* "Büßer" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) + { + input[1] = '\0'; + if (mbrtowc (&wc, input + 2, 5, &state) != 1) + return 1; + } + } + /* This fails on HP-UX 11.11. */ + if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) + { + char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) + { + input[1] = '\0'; + if (mbrtowc (&wc, input + 2, 5, &state) != 2) + return 1; + } + } + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_mbrtowc_retval=yes +else + gl_cv_func_mbrtowc_retval=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi + + fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_retval" >&5 +$as_echo "$gl_cv_func_mbrtowc_retval" >&6; } + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc returns 0 when parsing a NUL character" >&5 +$as_echo_n "checking whether mbrtowc returns 0 when parsing a NUL character... " >&6; } +if test "${gl_cv_func_mbrtowc_nul_retval+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + case "$host_os" in + # Guess no on Solaris 8 and 9. + solaris2.[89]) gl_cv_func_mbrtowc_nul_retval="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_nul_retval="guessing yes" ;; + esac + if test $LOCALE_ZH_CN != none; then + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +int main () +{ + /* This fails on Solaris 8 and 9. */ + if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) + { + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, "", 1, &state) != 0) + return 1; + } + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_mbrtowc_nul_retval=yes +else + gl_cv_func_mbrtowc_nul_retval=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi + + fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_nul_retval" >&5 +$as_echo "$gl_cv_func_mbrtowc_nul_retval" >&6; } + + case "$gl_cv_func_mbrtowc_null_arg" in + *yes) ;; + *) +$as_echo "#define MBRTOWC_NULL_ARG_BUG 1" >>confdefs.h + + REPLACE_MBRTOWC=1 + ;; + esac + case "$gl_cv_func_mbrtowc_retval" in + *yes) ;; + *) +$as_echo "#define MBRTOWC_RETVAL_BUG 1" >>confdefs.h + + REPLACE_MBRTOWC=1 + ;; + esac + case "$gl_cv_func_mbrtowc_nul_retval" in + *yes) ;; + *) +$as_echo "#define MBRTOWC_NUL_RETVAL_BUG 1" >>confdefs.h + + REPLACE_MBRTOWC=1 + ;; + esac + fi + if test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1; then + + + WCHAR_H=wchar.h + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS mbrtowc.$ac_objext" + + + : + + fi + + + + GNULIB_MEMMEM=0; GNULIB_MEMPCPY=0; GNULIB_MEMRCHR=0; + GNULIB_RAWMEMCHR=0; GNULIB_STPCPY=0; GNULIB_STPNCPY=0; GNULIB_STRCHRNUL=0; @@ -13449,9 +12173,11 @@ _ACEOF GNULIB_STRNLEN=0; GNULIB_STRPBRK=0; GNULIB_STRSEP=0; + GNULIB_STRSTR=0; GNULIB_STRCASESTR=0; GNULIB_STRTOK_R=0; GNULIB_MBSLEN=0; + GNULIB_MBSNLEN=0; GNULIB_MBSCHR=0; GNULIB_MBSRCHR=0; GNULIB_MBSSTR=0; @@ -13464,13 +12190,15 @@ _ACEOF GNULIB_MBSSPN=0; GNULIB_MBSSEP=0; GNULIB_MBSTOK_R=0; + GNULIB_STRERROR=0; + GNULIB_STRSIGNAL=0; + GNULIB_STRVERSCMP=0; HAVE_DECL_MEMMEM=1; HAVE_MEMPCPY=1; HAVE_DECL_MEMRCHR=1; + HAVE_RAWMEMCHR=1; HAVE_STPCPY=1; HAVE_STPNCPY=1; - HAVE_STRCASECMP=1; - HAVE_DECL_STRNCASECMP=1; HAVE_STRCHRNUL=1; HAVE_DECL_STRDUP=1; HAVE_STRNDUP=1; @@ -13480,345 +12208,43 @@ _ACEOF HAVE_STRSEP=1; HAVE_STRCASESTR=1; HAVE_DECL_STRTOK_R=1; + HAVE_DECL_STRERROR=1; + HAVE_DECL_STRSIGNAL=1; + HAVE_STRVERSCMP=1; + REPLACE_MEMMEM=0; + REPLACE_STRDUP=0; + REPLACE_STRSTR=0; + REPLACE_STRCASESTR=0; + REPLACE_STRERROR=0; + REPLACE_STRSIGNAL=0; - - - - -{ $as_echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 -$as_echo_n "checking whether byte ordering is bigendian... " >&6; } -if test "${ac_cv_c_bigendian+set}" = set; then - $as_echo_n "(cached) " >&6 +ac_fn_c_check_decl "$LINENO" "memrchr" "ac_cv_have_decl_memrchr" "$ac_includes_default" +if test "x$ac_cv_have_decl_memrchr" = x""yes; then : + ac_have_decl=1 else - # See if sys/param.h defines the BYTE_ORDER macro. -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include - -int -main () -{ -#if ! (defined BYTE_ORDER && defined BIG_ENDIAN && defined LITTLE_ENDIAN \ - && BYTE_ORDER && BIG_ENDIAN && LITTLE_ENDIAN) - bogus endian macros -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - # It does; now see whether it defined to BIG_ENDIAN or not. -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include - -int -main () -{ -#if BYTE_ORDER != BIG_ENDIAN - not big endian -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_c_bigendian=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_c_bigendian=no + ac_have_decl=0 fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # It does not; compile a test program. -if test "$cross_compiling" = yes; then - # try to guess the endianness by grepping values into an object file - ac_cv_c_bigendian=unknown - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; -short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; -void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; } -short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; -short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; -void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; } -int -main () -{ - _ascii (); _ebcdic (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then - ac_cv_c_bigendian=yes -fi -if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then - if test "$ac_cv_c_bigendian" = unknown; then - ac_cv_c_bigendian=no - else - # finding both strings is unlikely to happen, but who knows? - ac_cv_c_bigendian=unknown - fi -fi -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ - - /* Are we little or big endian? From Harbison&Steele. */ - union - { - long int l; - char c[sizeof (long int)]; - } u; - u.l = 1; - return u.c[sizeof (long int) - 1] == 1; - - ; - return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_c_bigendian=no -else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_c_bigendian=yes -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 -$as_echo "$ac_cv_c_bigendian" >&6; } -case $ac_cv_c_bigendian in - yes) - -cat >>confdefs.h <<\_ACEOF -#define WORDS_BIGENDIAN 1 -_ACEOF - ;; - no) - ;; - *) - { { $as_echo "$as_me:$LINENO: error: unknown endianness -presetting ac_cv_c_bigendian=no (or yes) will help" >&5 -$as_echo "$as_me: error: unknown endianness -presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} - { (exit 1); exit 1; }; } ;; -esac - -{ $as_echo "$as_me:$LINENO: checking whether memrchr is declared" >&5 -$as_echo_n "checking whether memrchr is declared... " >&6; } -if test "${ac_cv_have_decl_memrchr+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef memrchr - (void) memrchr; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_memrchr=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_memrchr=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_memrchr" >&5 -$as_echo "$ac_cv_have_decl_memrchr" >&6; } -if test $ac_cv_have_decl_memrchr = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_MEMRCHR 1 +#define HAVE_DECL_MEMRCHR $ac_have_decl _ACEOF -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_MEMRCHR 0 -_ACEOF -fi - - - - - - - - GNULIB_GETSUBOPT=0; - GNULIB_MKDTEMP=0; - GNULIB_MKSTEMP=0; - HAVE_GETSUBOPT=1; - HAVE_MKDTEMP=1; - REPLACE_MKSTEMP=0; # Check whether --enable-largefile was given. -if test "${enable_largefile+set}" = set; then +if test "${enable_largefile+set}" = set; then : enableval=$enable_largefile; fi if test "$enable_largefile" != no; then - { $as_echo "$as_me:$LINENO: checking for special C compiler options needed for large files" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5 $as_echo_n "checking for special C compiler options needed for large files... " >&6; } -if test "${ac_cv_sys_largefile_CC+set}" = set; then +if test "${ac_cv_sys_largefile_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_cv_sys_largefile_CC=no @@ -13827,11 +12253,7 @@ else while :; do # IRIX 6.2 and later do not support large files by default, # so use the C compiler's -n32 option if that helps. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. @@ -13850,60 +12272,14 @@ main () return 0; } _ACEOF - rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then + if ac_fn_c_try_compile "$LINENO"; then : break -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - fi - rm -f core conftest.err conftest.$ac_objext CC="$CC -n32" - rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then + if ac_fn_c_try_compile "$LINENO"; then : ac_cv_sys_largefile_CC=' -n32'; break -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - fi - rm -f core conftest.err conftest.$ac_objext break done @@ -13911,23 +12287,19 @@ rm -f core conftest.err conftest.$ac_objext rm -f conftest.$ac_ext fi fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_CC" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5 $as_echo "$ac_cv_sys_largefile_CC" >&6; } if test "$ac_cv_sys_largefile_CC" != no; then CC=$CC$ac_cv_sys_largefile_CC fi - { $as_echo "$as_me:$LINENO: checking for _FILE_OFFSET_BITS value needed for large files" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5 $as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } -if test "${ac_cv_sys_file_offset_bits+set}" = set; then +if test "${ac_cv_sys_file_offset_bits+set}" = set; then : $as_echo_n "(cached) " >&6 else while :; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. @@ -13946,38 +12318,11 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_sys_file_offset_bits=no; break -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _FILE_OFFSET_BITS 64 #include @@ -13997,38 +12342,15 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_sys_file_offset_bits=64; break -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_sys_file_offset_bits=unknown break done fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_sys_file_offset_bits" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5 $as_echo "$ac_cv_sys_file_offset_bits" >&6; } case $ac_cv_sys_file_offset_bits in #( no | unknown) ;; @@ -14038,19 +12360,15 @@ cat >>confdefs.h <<_ACEOF _ACEOF ;; esac -rm -f conftest* +rm -rf conftest* if test $ac_cv_sys_file_offset_bits = unknown; then - { $as_echo "$as_me:$LINENO: checking for _LARGE_FILES value needed for large files" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5 $as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; } -if test "${ac_cv_sys_large_files+set}" = set; then +if test "${ac_cv_sys_large_files+set}" = set; then : $as_echo_n "(cached) " >&6 else while :; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. @@ -14069,38 +12387,11 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_sys_large_files=no; break -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _LARGE_FILES 1 #include @@ -14120,38 +12411,15 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_sys_large_files=1; break -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_sys_large_files=unknown break done fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_sys_large_files" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5 $as_echo "$ac_cv_sys_large_files" >&6; } case $ac_cv_sys_large_files in #( no | unknown) ;; @@ -14161,7 +12429,7 @@ cat >>confdefs.h <<_ACEOF _ACEOF ;; esac -rm -f conftest* +rm -rf conftest* fi fi @@ -14177,18 +12445,12 @@ fi - - -{ $as_echo "$as_me:$LINENO: checking for external symbol _system_configuration" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for external symbol _system_configuration" >&5 $as_echo_n "checking for external symbol _system_configuration... " >&6; } -if test "${gl_cv_var__system_configuration+set}" = set; then +if test "${gl_cv_var__system_configuration+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -14196,55 +12458,31 @@ int main () { double x = _system_configuration.physmem; - if (x > 0.0) return 0; + if (x > 0.0) return 0; ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then +if ac_fn_c_try_link "$LINENO"; then : gl_cv_var__system_configuration=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - gl_cv_var__system_configuration=no + gl_cv_var__system_configuration=no fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_var__system_configuration" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_var__system_configuration" >&5 $as_echo "$gl_cv_var__system_configuration" >&6; } if test $gl_cv_var__system_configuration = yes; then -cat >>confdefs.h <<\_ACEOF -#define HAVE__SYSTEM_CONFIGURATION 1 -_ACEOF +$as_echo "#define HAVE__SYSTEM_CONFIGURATION 1" >>confdefs.h fi - { $as_echo "$as_me:$LINENO: checking for desired default level of POSIX conformance" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for desired default level of POSIX conformance" >&5 $as_echo_n "checking for desired default level of POSIX conformance... " >&6; } gl_default_posix2_version=none-specified if test -n "$ac_cv_env_DEFAULT_POSIX2_VERSION_set"; then @@ -14255,7 +12493,7 @@ cat >>confdefs.h <<_ACEOF _ACEOF fi - { $as_echo "$as_me:$LINENO: result: $gl_default_posix2_version" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_default_posix2_version" >&5 $as_echo "$gl_default_posix2_version" >&6; } @@ -14273,23 +12511,15 @@ $as_echo "$gl_default_posix2_version" >&6; } - - - - -{ $as_echo "$as_me:$LINENO: checking whether lstat accepts an empty string" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether lstat accepts an empty string" >&5 $as_echo_n "checking whether lstat accepts an empty string... " >&6; } -if test "${ac_cv_func_lstat_empty_string_bug+set}" = set; then +if test "${ac_cv_func_lstat_empty_string_bug+set}" = set; then : $as_echo_n "(cached) " >&6 else - if test "$cross_compiling" = yes; then + if test "$cross_compiling" = yes; then : ac_cv_func_lstat_empty_string_bug=yes else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int @@ -14301,47 +12531,30 @@ struct stat sbuf; return 0; } _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_lstat_empty_string_bug=no else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_func_lstat_empty_string_bug=yes + ac_cv_func_lstat_empty_string_bug=yes fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi - fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_lstat_empty_string_bug" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_lstat_empty_string_bug" >&5 $as_echo "$ac_cv_func_lstat_empty_string_bug" >&6; } if test $ac_cv_func_lstat_empty_string_bug = yes; then + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS lstat.$ac_objext" + cat >>confdefs.h <<_ACEOF #define HAVE_LSTAT_EMPTY_STRING_BUG 1 _ACEOF @@ -14349,368 +12562,350 @@ _ACEOF fi + GNULIB_SELECT=0; + REPLACE_SELECT=0; - - - GNULIB_FPRINTF_POSIX=0; - GNULIB_PRINTF_POSIX=0; - GNULIB_SNPRINTF=0; - GNULIB_SPRINTF_POSIX=0; - GNULIB_VFPRINTF_POSIX=0; - GNULIB_VPRINTF_POSIX=0; - GNULIB_VSNPRINTF=0; - GNULIB_VSPRINTF_POSIX=0; - REPLACE_FPRINTF=0; - REPLACE_VFPRINTF=0; - REPLACE_PRINTF=0; - REPLACE_VPRINTF=0; - REPLACE_SNPRINTF=0; - HAVE_DECL_SNPRINTF=1; - REPLACE_VSNPRINTF=0; - HAVE_DECL_VSNPRINTF=1; - REPLACE_SPRINTF=0; - REPLACE_VSPRINTF=0; - -{ $as_echo "$as_me:$LINENO: checking whether snprintf is declared" >&5 -$as_echo_n "checking whether snprintf is declared... " >&6; } -if test "${ac_cv_have_decl_snprintf+set}" = set; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether is self-contained" >&5 +$as_echo_n "checking whether is self-contained... " >&6; } +if test "${gl_cv_header_sys_select_h_selfcontained+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -$ac_includes_default +#include int main () { -#ifndef snprintf - (void) snprintf; -#endif - +struct timeval b; ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_snprintf=yes +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_header_sys_select_h_selfcontained=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_snprintf=no + gl_cv_header_sys_select_h_selfcontained=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_snprintf" >&5 -$as_echo "$ac_cv_have_decl_snprintf" >&6; } -if test $ac_cv_have_decl_snprintf = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_SNPRINTF 1 -_ACEOF - - -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_SNPRINTF 0 -_ACEOF - fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_sys_select_h_selfcontained" >&5 +$as_echo "$gl_cv_header_sys_select_h_selfcontained" >&6; } + if test $gl_cv_header_sys_select_h_selfcontained = yes; then + SYS_SELECT_H='' + else + SYS_SELECT_H='sys/select.h' -{ $as_echo "$as_me:$LINENO: checking whether strdup is declared" >&5 -$as_echo_n "checking whether strdup is declared... " >&6; } -if test "${ac_cv_have_decl_strdup+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef strdup - (void) strdup; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_strdup=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_strdup=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_strdup" >&5 -$as_echo "$ac_cv_have_decl_strdup" >&6; } -if test $ac_cv_have_decl_strdup = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_STRDUP 1 -_ACEOF - - -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_STRDUP 0 -_ACEOF - - -fi - - - - - - - - - - - - - - { $as_echo "$as_me:$LINENO: checking absolute name of " >&5 -$as_echo_n "checking absolute name of ... " >&6; } -if test "${gl_cv_absolute_string_h+set}" = set; then + if test $gl_cv_have_include_next = yes; then + gl_cv_next_sys_select_h='<'sys/select.h'>' + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +$as_echo_n "checking absolute name of ... " >&6; } +if test "${gl_cv_next_sys_select_h+set}" = set; then : $as_echo_n "(cached) " >&6 else - - - - - if test $ac_cv_header_string_h = yes; then - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + if test $ac_cv_header_sys_select_h = yes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include +#include + _ACEOF - gl_cv_absolute_string_h=`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | -sed -n '\#/string.h#{s#.*"\(.*/string.h\)".*#\1#;s#^/[^/]#//&#;p;q;}'` + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + gl_cv_next_sys_select_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n '\#/sys/select.h#{ + s#.*"\(.*/sys/select.h\)".*#\1# + s#^/[^/]#//&# + p + q + }'`'"' + else + gl_cv_next_sys_select_h='<'sys/select.h'>' + fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_select_h" >&5 +$as_echo "$gl_cv_next_sys_select_h" >&6; } + fi + NEXT_SYS_SELECT_H=$gl_cv_next_sys_select_h + + + + if test $ac_cv_header_sys_select_h = yes; then + HAVE_SYS_SELECT_H=1 + else + HAVE_SYS_SELECT_H=0 fi + + + + + if test $ac_cv_header_sys_socket_h != yes; then + for ac_header in winsock2.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default" +if test "x$ac_cv_header_winsock2_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_WINSOCK2_H 1 +_ACEOF + fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_absolute_string_h" >&5 -$as_echo "$gl_cv_absolute_string_h" >&6; } + +done + + fi + if test "$ac_cv_header_winsock2_h" = yes; then + HAVE_WINSOCK2_H=1 + UNISTD_H_HAVE_WINSOCK2_H=1 + SYS_IOCTL_H_HAVE_WINSOCK2_H=1 + else + HAVE_WINSOCK2_H=0 + fi + + + fi + + + + + + + + + + GNULIB_SIGNAL_H_SIGPIPE=0; + GNULIB_SIGPROCMASK=0; + GNULIB_SIGACTION=0; + HAVE_POSIX_SIGNALBLOCKING=1; + HAVE_SIGSET_T=1; + HAVE_SIGINFO_T=1; + HAVE_SIGACTION=1; + HAVE_STRUCT_SIGACTION_SA_SIGACTION=1; + + HAVE_TYPE_VOLATILE_SIG_ATOMIC_T=1; + + + + + + + + + + +ac_fn_c_check_decl "$LINENO" "snprintf" "ac_cv_have_decl_snprintf" "$ac_includes_default" +if test "x$ac_cv_have_decl_snprintf" = x""yes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + cat >>confdefs.h <<_ACEOF -#define ABSOLUTE_STRING_H "$gl_cv_absolute_string_h" +#define HAVE_DECL_SNPRINTF $ac_have_decl _ACEOF - ABSOLUTE_STRING_H=\"$gl_cv_absolute_string_h\" -{ $as_echo "$as_me:$LINENO: checking whether strndup is declared" >&5 -$as_echo_n "checking whether strndup is declared... " >&6; } -if test "${ac_cv_have_decl_strndup+set}" = set; then + + + +ac_fn_c_check_decl "$LINENO" "strdup" "ac_cv_have_decl_strdup" "$ac_includes_default" +if test "x$ac_cv_have_decl_strdup" = x""yes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_STRDUP $ac_have_decl +_ACEOF + + + + + if test -z "$ERRNO_H"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working strerror function" >&5 +$as_echo_n "checking for working strerror function... " >&6; } +if test "${gl_cv_func_working_strerror+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + if test "$cross_compiling" = yes; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -$ac_includes_default +#include + int main () { -#ifndef strndup - (void) strndup; -#endif - +return !*strerror (-2); ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_strndup=yes +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_func_working_strerror=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_strndup=no + gl_cv_func_working_strerror=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_strndup" >&5 -$as_echo "$ac_cv_have_decl_strndup" >&6; } -if test $ac_cv_have_decl_strndup = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_STRNDUP 1 -_ACEOF - else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_STRNDUP 0 -_ACEOF - - -fi - - -{ $as_echo "$as_me:$LINENO: checking whether strnlen is declared" >&5 -$as_echo_n "checking whether strnlen is declared... " >&6; } -if test "${ac_cv_have_decl_strnlen+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -$ac_includes_default +#include + int main () { -#ifndef strnlen - (void) strnlen; -#endif - +return !*strerror (-2); ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_strnlen=yes +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_working_strerror=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_strnlen=no + gl_cv_func_working_strerror=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_working_strerror" >&5 +$as_echo "$gl_cv_func_working_strerror" >&6; } + if test $gl_cv_func_working_strerror = no; then + REPLACE_STRERROR=1 + fi + else + REPLACE_STRERROR=1 + fi + if test $REPLACE_STRERROR = 1; then + + ac_fn_c_check_decl "$LINENO" "strerror" "ac_cv_have_decl_strerror" "$ac_includes_default" +if test "x$ac_cv_have_decl_strerror" = x""yes; then : + ac_have_decl=1 +else + ac_have_decl=0 fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_strnlen" >&5 -$as_echo "$ac_cv_have_decl_strnlen" >&6; } -if test $ac_cv_have_decl_strnlen = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_STRNLEN 1 +#define HAVE_DECL_STRERROR $ac_have_decl _ACEOF -else + if test $ac_cv_header_sys_socket_h != yes; then + for ac_header in winsock2.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default" +if test "x$ac_cv_header_winsock2_h" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_STRNLEN 0 +#define HAVE_WINSOCK2_H 1 _ACEOF - fi +done + + fi + + fi -{ $as_echo "$as_me:$LINENO: checking whether stat file-mode macros are broken" >&5 + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_string_h='<'string.h'>' + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +$as_echo_n "checking absolute name of ... " >&6; } +if test "${gl_cv_next_string_h+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + if test $ac_cv_header_string_h = yes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + gl_cv_next_string_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n '\#/string.h#{ + s#.*"\(.*/string.h\)".*#\1# + s#^/[^/]#//&# + p + q + }'`'"' + else + gl_cv_next_string_h='<'string.h'>' + fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_string_h" >&5 +$as_echo "$gl_cv_next_string_h" >&6; } + fi + NEXT_STRING_H=$gl_cv_next_string_h + + + + +ac_fn_c_check_decl "$LINENO" "strndup" "ac_cv_have_decl_strndup" "$ac_includes_default" +if test "x$ac_cv_have_decl_strndup" = x""yes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_STRNDUP $ac_have_decl +_ACEOF + +ac_fn_c_check_decl "$LINENO" "strnlen" "ac_cv_have_decl_strnlen" "$ac_includes_default" +if test "x$ac_cv_have_decl_strnlen" = x""yes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_STRNLEN $ac_have_decl +_ACEOF + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stat file-mode macros are broken" >&5 $as_echo_n "checking whether stat file-mode macros are broken... " >&6; } -if test "${ac_cv_header_stat_broken+set}" = set; then +if test "${ac_cv_header_stat_broken+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include @@ -14732,41 +12927,18 @@ extern char c4[S_ISSOCK (S_IFREG) ? -1 : 1]; #endif _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stat_broken=no else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_header_stat_broken=yes + ac_cv_header_stat_broken=yes fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stat_broken" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stat_broken" >&5 $as_echo "$ac_cv_header_stat_broken" >&6; } if test $ac_cv_header_stat_broken = yes; then -cat >>confdefs.h <<\_ACEOF -#define STAT_MACROS_BROKEN 1 -_ACEOF +$as_echo "#define STAT_MACROS_BROKEN 1" >>confdefs.h fi @@ -14776,21 +12948,12 @@ fi - - - - - - { $as_echo "$as_me:$LINENO: checking for struct timespec in " >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timespec in " >&5 $as_echo_n "checking for struct timespec in ... " >&6; } -if test "${gl_cv_sys_struct_timespec_in_time_h+set}" = set; then +if test "${gl_cv_sys_struct_timespec_in_time_h+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -14802,35 +12965,14 @@ static struct timespec x; x.tv_sec = x.tv_nsec; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : gl_cv_sys_struct_timespec_in_time_h=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - gl_cv_sys_struct_timespec_in_time_h=no + gl_cv_sys_struct_timespec_in_time_h=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_sys_struct_timespec_in_time_h" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_time_h" >&5 $as_echo "$gl_cv_sys_struct_timespec_in_time_h" >&6; } TIME_H_DEFINES_STRUCT_TIMESPEC=0 @@ -14838,16 +12980,12 @@ $as_echo "$gl_cv_sys_struct_timespec_in_time_h" >&6; } if test $gl_cv_sys_struct_timespec_in_time_h = yes; then TIME_H_DEFINES_STRUCT_TIMESPEC=1 else - { $as_echo "$as_me:$LINENO: checking for struct timespec in " >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timespec in " >&5 $as_echo_n "checking for struct timespec in ... " >&6; } -if test "${gl_cv_sys_struct_timespec_in_sys_time_h+set}" = set; then +if test "${gl_cv_sys_struct_timespec_in_sys_time_h+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -14859,37 +12997,16 @@ static struct timespec x; x.tv_sec = x.tv_nsec; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : gl_cv_sys_struct_timespec_in_sys_time_h=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - gl_cv_sys_struct_timespec_in_sys_time_h=no + gl_cv_sys_struct_timespec_in_sys_time_h=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_sys_struct_timespec_in_sys_time_h" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_sys_time_h" >&5 $as_echo "$gl_cv_sys_struct_timespec_in_sys_time_h" >&6; } - if test $gl_cv_sys_struct_timespec_in_time_h = yes; then + if test $gl_cv_sys_struct_timespec_in_sys_time_h = yes; then SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=1 fi fi @@ -14899,38 +13016,47 @@ $as_echo "$gl_cv_sys_struct_timespec_in_sys_time_h" >&6; } - { $as_echo "$as_me:$LINENO: checking absolute name of " >&5 + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_time_h='<'time.h'>' + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 $as_echo_n "checking absolute name of ... " >&6; } -if test "${gl_cv_absolute_time_h+set}" = set; then +if test "${gl_cv_next_time_h+set}" = set; then : $as_echo_n "(cached) " >&6 else - - - - - if test $ac_cv_header_time_h = yes; then - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + if test $ac_cv_header_time_h = yes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include + _ACEOF - gl_cv_absolute_time_h=`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | -sed -n '\#/time.h#{s#.*"\(.*/time.h\)".*#\1#;s#^/[^/]#//&#;p;q;}'` - fi + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + gl_cv_next_time_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n '\#/time.h#{ + s#.*"\(.*/time.h\)".*#\1# + s#^/[^/]#//&# + p + q + }'`'"' + else + gl_cv_next_time_h='<'time.h'>' + fi fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_absolute_time_h" >&5 -$as_echo "$gl_cv_absolute_time_h" >&6; } -cat >>confdefs.h <<_ACEOF -#define ABSOLUTE_TIME_H "$gl_cv_absolute_time_h" -_ACEOF - - - ABSOLUTE_TIME_H=\"$gl_cv_absolute_time_h\" +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_time_h" >&5 +$as_echo "$gl_cv_next_time_h" >&6; } + fi + NEXT_TIME_H=$gl_cv_next_time_h @@ -14938,805 +13064,118 @@ _ACEOF -{ $as_echo "$as_me:$LINENO: checking whether clearerr_unlocked is declared" >&5 -$as_echo_n "checking whether clearerr_unlocked is declared... " >&6; } -if test "${ac_cv_have_decl_clearerr_unlocked+set}" = set; then - $as_echo_n "(cached) " >&6 + + +ac_fn_c_check_decl "$LINENO" "clearerr_unlocked" "ac_cv_have_decl_clearerr_unlocked" "$ac_includes_default" +if test "x$ac_cv_have_decl_clearerr_unlocked" = x""yes; then : + ac_have_decl=1 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef clearerr_unlocked - (void) clearerr_unlocked; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_clearerr_unlocked=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_clearerr_unlocked=no + ac_have_decl=0 fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_clearerr_unlocked" >&5 -$as_echo "$ac_cv_have_decl_clearerr_unlocked" >&6; } -if test $ac_cv_have_decl_clearerr_unlocked = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_CLEARERR_UNLOCKED 1 +#define HAVE_DECL_CLEARERR_UNLOCKED $ac_have_decl _ACEOF - +ac_fn_c_check_decl "$LINENO" "feof_unlocked" "ac_cv_have_decl_feof_unlocked" "$ac_includes_default" +if test "x$ac_cv_have_decl_feof_unlocked" = x""yes; then : + ac_have_decl=1 else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_CLEARERR_UNLOCKED 0 -_ACEOF - - + ac_have_decl=0 fi - -{ $as_echo "$as_me:$LINENO: checking whether feof_unlocked is declared" >&5 -$as_echo_n "checking whether feof_unlocked is declared... " >&6; } -if test "${ac_cv_have_decl_feof_unlocked+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef feof_unlocked - (void) feof_unlocked; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_feof_unlocked=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_feof_unlocked=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_feof_unlocked" >&5 -$as_echo "$ac_cv_have_decl_feof_unlocked" >&6; } -if test $ac_cv_have_decl_feof_unlocked = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FEOF_UNLOCKED 1 +#define HAVE_DECL_FEOF_UNLOCKED $ac_have_decl _ACEOF - +ac_fn_c_check_decl "$LINENO" "ferror_unlocked" "ac_cv_have_decl_ferror_unlocked" "$ac_includes_default" +if test "x$ac_cv_have_decl_ferror_unlocked" = x""yes; then : + ac_have_decl=1 else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FEOF_UNLOCKED 0 -_ACEOF - - + ac_have_decl=0 fi - -{ $as_echo "$as_me:$LINENO: checking whether ferror_unlocked is declared" >&5 -$as_echo_n "checking whether ferror_unlocked is declared... " >&6; } -if test "${ac_cv_have_decl_ferror_unlocked+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef ferror_unlocked - (void) ferror_unlocked; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_ferror_unlocked=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_ferror_unlocked=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_ferror_unlocked" >&5 -$as_echo "$ac_cv_have_decl_ferror_unlocked" >&6; } -if test $ac_cv_have_decl_ferror_unlocked = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FERROR_UNLOCKED 1 +#define HAVE_DECL_FERROR_UNLOCKED $ac_have_decl _ACEOF - +ac_fn_c_check_decl "$LINENO" "fgets_unlocked" "ac_cv_have_decl_fgets_unlocked" "$ac_includes_default" +if test "x$ac_cv_have_decl_fgets_unlocked" = x""yes; then : + ac_have_decl=1 else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FERROR_UNLOCKED 0 -_ACEOF - - + ac_have_decl=0 fi - -{ $as_echo "$as_me:$LINENO: checking whether fgets_unlocked is declared" >&5 -$as_echo_n "checking whether fgets_unlocked is declared... " >&6; } -if test "${ac_cv_have_decl_fgets_unlocked+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef fgets_unlocked - (void) fgets_unlocked; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_fgets_unlocked=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_fgets_unlocked=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_fgets_unlocked" >&5 -$as_echo "$ac_cv_have_decl_fgets_unlocked" >&6; } -if test $ac_cv_have_decl_fgets_unlocked = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FGETS_UNLOCKED 1 +#define HAVE_DECL_FGETS_UNLOCKED $ac_have_decl _ACEOF - +ac_fn_c_check_decl "$LINENO" "fputc_unlocked" "ac_cv_have_decl_fputc_unlocked" "$ac_includes_default" +if test "x$ac_cv_have_decl_fputc_unlocked" = x""yes; then : + ac_have_decl=1 else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FGETS_UNLOCKED 0 -_ACEOF - - + ac_have_decl=0 fi - -{ $as_echo "$as_me:$LINENO: checking whether fputc_unlocked is declared" >&5 -$as_echo_n "checking whether fputc_unlocked is declared... " >&6; } -if test "${ac_cv_have_decl_fputc_unlocked+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef fputc_unlocked - (void) fputc_unlocked; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_fputc_unlocked=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_fputc_unlocked=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_fputc_unlocked" >&5 -$as_echo "$ac_cv_have_decl_fputc_unlocked" >&6; } -if test $ac_cv_have_decl_fputc_unlocked = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FPUTC_UNLOCKED 1 +#define HAVE_DECL_FPUTC_UNLOCKED $ac_have_decl _ACEOF - +ac_fn_c_check_decl "$LINENO" "fread_unlocked" "ac_cv_have_decl_fread_unlocked" "$ac_includes_default" +if test "x$ac_cv_have_decl_fread_unlocked" = x""yes; then : + ac_have_decl=1 else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FPUTC_UNLOCKED 0 -_ACEOF - - + ac_have_decl=0 fi - -{ $as_echo "$as_me:$LINENO: checking whether fread_unlocked is declared" >&5 -$as_echo_n "checking whether fread_unlocked is declared... " >&6; } -if test "${ac_cv_have_decl_fread_unlocked+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef fread_unlocked - (void) fread_unlocked; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_fread_unlocked=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_fread_unlocked=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_fread_unlocked" >&5 -$as_echo "$ac_cv_have_decl_fread_unlocked" >&6; } -if test $ac_cv_have_decl_fread_unlocked = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FREAD_UNLOCKED 1 +#define HAVE_DECL_FREAD_UNLOCKED $ac_have_decl _ACEOF - +ac_fn_c_check_decl "$LINENO" "fwrite_unlocked" "ac_cv_have_decl_fwrite_unlocked" "$ac_includes_default" +if test "x$ac_cv_have_decl_fwrite_unlocked" = x""yes; then : + ac_have_decl=1 else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FREAD_UNLOCKED 0 -_ACEOF - - + ac_have_decl=0 fi - -{ $as_echo "$as_me:$LINENO: checking whether fwrite_unlocked is declared" >&5 -$as_echo_n "checking whether fwrite_unlocked is declared... " >&6; } -if test "${ac_cv_have_decl_fwrite_unlocked+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef fwrite_unlocked - (void) fwrite_unlocked; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_fwrite_unlocked=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_fwrite_unlocked=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_fwrite_unlocked" >&5 -$as_echo "$ac_cv_have_decl_fwrite_unlocked" >&6; } -if test $ac_cv_have_decl_fwrite_unlocked = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FWRITE_UNLOCKED 1 +#define HAVE_DECL_FWRITE_UNLOCKED $ac_have_decl _ACEOF - +ac_fn_c_check_decl "$LINENO" "getchar_unlocked" "ac_cv_have_decl_getchar_unlocked" "$ac_includes_default" +if test "x$ac_cv_have_decl_getchar_unlocked" = x""yes; then : + ac_have_decl=1 else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FWRITE_UNLOCKED 0 -_ACEOF - - + ac_have_decl=0 fi - -{ $as_echo "$as_me:$LINENO: checking whether getchar_unlocked is declared" >&5 -$as_echo_n "checking whether getchar_unlocked is declared... " >&6; } -if test "${ac_cv_have_decl_getchar_unlocked+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef getchar_unlocked - (void) getchar_unlocked; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_getchar_unlocked=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_getchar_unlocked=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_getchar_unlocked" >&5 -$as_echo "$ac_cv_have_decl_getchar_unlocked" >&6; } -if test $ac_cv_have_decl_getchar_unlocked = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_GETCHAR_UNLOCKED 1 +#define HAVE_DECL_GETCHAR_UNLOCKED $ac_have_decl _ACEOF - +ac_fn_c_check_decl "$LINENO" "putchar_unlocked" "ac_cv_have_decl_putchar_unlocked" "$ac_includes_default" +if test "x$ac_cv_have_decl_putchar_unlocked" = x""yes; then : + ac_have_decl=1 else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_GETCHAR_UNLOCKED 0 -_ACEOF - - + ac_have_decl=0 fi - -{ $as_echo "$as_me:$LINENO: checking whether putchar_unlocked is declared" >&5 -$as_echo_n "checking whether putchar_unlocked is declared... " >&6; } -if test "${ac_cv_have_decl_putchar_unlocked+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef putchar_unlocked - (void) putchar_unlocked; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_putchar_unlocked=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_putchar_unlocked=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_putchar_unlocked" >&5 -$as_echo "$ac_cv_have_decl_putchar_unlocked" >&6; } -if test $ac_cv_have_decl_putchar_unlocked = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_PUTCHAR_UNLOCKED 1 +#define HAVE_DECL_PUTCHAR_UNLOCKED $ac_have_decl _ACEOF -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_PUTCHAR_UNLOCKED 0 -_ACEOF - - -fi - - - - - - - - - - -{ $as_echo "$as_me:$LINENO: checking whether utime accepts a null argument" >&5 -$as_echo_n "checking whether utime accepts a null argument... " >&6; } -if test "${ac_cv_func_utime_null+set}" = set; then - $as_echo_n "(cached) " >&6 -else - rm -f conftest.data; >conftest.data -# Sequent interprets utime(file, 0) to mean use start of epoch. Wrong. -if test "$cross_compiling" = yes; then - ac_cv_func_utime_null=no -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default - #ifdef HAVE_UTIME_H - # include - #endif -int -main () -{ -struct stat s, t; - return ! (stat ("conftest.data", &s) == 0 - && utime ("conftest.data", 0) == 0 - && stat ("conftest.data", &t) == 0 - && t.st_mtime >= s.st_mtime - && t.st_mtime - s.st_mtime < 120); - ; - return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_utime_null=yes -else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_func_utime_null=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi - - -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_utime_null" >&5 -$as_echo "$ac_cv_func_utime_null" >&6; } -if test $ac_cv_func_utime_null = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_UTIME_NULL 1 -_ACEOF - -fi -rm -f conftest.data - - - - - - - - - - - { $as_echo "$as_me:$LINENO: checking for struct utimbuf" >&5 -$as_echo_n "checking for struct utimbuf... " >&6; } -if test "${gl_cv_sys_struct_utimbuf+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#if HAVE_SYS_TIME_H - #include - #endif - #include - #ifdef HAVE_UTIME_H - #include - #endif - -int -main () -{ -static struct utimbuf x; x.actime = x.modtime; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - gl_cv_sys_struct_utimbuf=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - gl_cv_sys_struct_utimbuf=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_sys_struct_utimbuf" >&5 -$as_echo "$gl_cv_sys_struct_utimbuf" >&6; } - - if test $gl_cv_sys_struct_utimbuf = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_STRUCT_UTIMBUF 1 -_ACEOF - - fi - - - { $as_echo "$as_me:$LINENO: checking determine whether the utimes function works" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking determine whether the utimes function works" >&5 $as_echo_n "checking determine whether the utimes function works... " >&6; } -if test "${gl_cv_func_working_utimes+set}" = set; then +if test "${gl_cv_func_working_utimes+set}" = set; then : $as_echo_n "(cached) " >&6 else - if test "$cross_compiling" = yes; then + if test "$cross_compiling" = yes; then : gl_cv_func_working_utimes=no else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -15790,50 +13229,22 @@ main () } _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_run "$LINENO"; then : gl_cv_func_working_utimes=yes else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -gl_cv_func_working_utimes=no + gl_cv_func_working_utimes=no fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi - fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_working_utimes" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_working_utimes" >&5 $as_echo "$gl_cv_func_working_utimes" >&6; } if test $gl_cv_func_working_utimes = yes; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_WORKING_UTIMES 1 -_ACEOF +$as_echo "#define HAVE_WORKING_UTIMES 1" >>confdefs.h fi @@ -15841,440 +13252,62 @@ _ACEOF - - - { $as_echo "$as_me:$LINENO: checking for EOVERFLOW" >&5 -$as_echo_n "checking for EOVERFLOW... " >&6; } -if test "${ac_cv_decl_EOVERFLOW+set}" = set; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct utimbuf" >&5 +$as_echo_n "checking for struct utimbuf... " >&6; } +if test "${gl_cv_sys_struct_utimbuf+set}" = set; then : $as_echo_n "(cached) " >&6 else - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - -#include -#ifdef EOVERFLOW -yes -#endif - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes" >/dev/null 2>&1; then - have_eoverflow=1 -fi -rm -f conftest* - - if test -n "$have_eoverflow"; then - ac_cv_decl_EOVERFLOW=yes - else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -#define _XOPEN_SOURCE_EXTENDED 1 -#include -#ifdef EOVERFLOW -yes -#endif - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes" >/dev/null 2>&1; then - have_eoverflow=1 -fi -rm -f conftest* - - if test -n "$have_eoverflow"; then - if test "$cross_compiling" = yes; then - # Depending upon the size, compute the lo and hi bounds. -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -#define _XOPEN_SOURCE_EXTENDED 1 -#include -/* The following two lines are a workaround against an autoconf-2.52 bug. */ -#include -#include +#if HAVE_SYS_TIME_H + #include + #endif + #include + #ifdef HAVE_UTIME_H + #include + #endif int main () { -static int test_array [1 - 2 * !((EOVERFLOW) >= 0)]; -test_array [0] = 0 - +static struct utimbuf x; x.actime = x.modtime; ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_lo=0 ac_mid=0 - while :; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -#define _XOPEN_SOURCE_EXTENDED 1 -#include -/* The following two lines are a workaround against an autoconf-2.52 bug. */ -#include -#include - -int -main () -{ -static int test_array [1 - 2 * !((EOVERFLOW) <= $ac_mid)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_hi=$ac_mid; break +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_sys_struct_utimbuf=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_lo=`expr $ac_mid + 1` - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid + 1` + gl_cv_sys_struct_utimbuf=no fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -#define _XOPEN_SOURCE_EXTENDED 1 -#include -/* The following two lines are a workaround against an autoconf-2.52 bug. */ -#include -#include - -int -main () -{ -static int test_array [1 - 2 * !((EOVERFLOW) < 0)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_hi=-1 ac_mid=-1 - while :; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -#define _XOPEN_SOURCE_EXTENDED 1 -#include -/* The following two lines are a workaround against an autoconf-2.52 bug. */ -#include -#include - -int -main () -{ -static int test_array [1 - 2 * !((EOVERFLOW) >= $ac_mid)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_lo=$ac_mid; break -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_hi=`expr '(' $ac_mid ')' - 1` - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid` -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_lo= ac_hi= -fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_utimbuf" >&5 +$as_echo "$gl_cv_sys_struct_utimbuf" >&6; } -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -# Binary search between lo and hi bounds. -while test "x$ac_lo" != "x$ac_hi"; do - ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ + if test $gl_cv_sys_struct_utimbuf = yes; then -#define _XOPEN_SOURCE_EXTENDED 1 -#include -/* The following two lines are a workaround against an autoconf-2.52 bug. */ -#include -#include - -int -main () -{ -static int test_array [1 - 2 * !((EOVERFLOW) <= $ac_mid)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_hi=$ac_mid -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_lo=`expr '(' $ac_mid ')' + 1` -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -done -case $ac_lo in -?*) ac_cv_decl_EOVERFLOW=$ac_lo;; -'') ;; -esac -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -#define _XOPEN_SOURCE_EXTENDED 1 -#include -/* The following two lines are a workaround against an autoconf-2.52 bug. */ -#include -#include - -static long int longval () { return EOVERFLOW; } -static unsigned long int ulongval () { return EOVERFLOW; } -#include -#include -int -main () -{ - - FILE *f = fopen ("conftest.val", "w"); - if (! f) - return 1; - if ((EOVERFLOW) < 0) - { - long int i = longval (); - if (i != (EOVERFLOW)) - return 1; - fprintf (f, "%ld", i); - } - else - { - unsigned long int i = ulongval (); - if (i != (EOVERFLOW)) - return 1; - fprintf (f, "%lu", i); - } - /* Do not output a trailing newline, as this causes \r\n confusion - on some platforms. */ - return ferror (f) || fclose (f) != 0; - - ; - return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_decl_EOVERFLOW=`cat conftest.val` -else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -rm -f conftest.val - else - ac_cv_decl_EOVERFLOW=E2BIG - fi - fi - -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_decl_EOVERFLOW" >&5 -$as_echo "$ac_cv_decl_EOVERFLOW" >&6; } - if test "$ac_cv_decl_EOVERFLOW" != yes; then - -cat >>confdefs.h <<_ACEOF -#define EOVERFLOW $ac_cv_decl_EOVERFLOW -_ACEOF - - EOVERFLOW="$ac_cv_decl_EOVERFLOW" +$as_echo "#define HAVE_STRUCT_UTIMBUF 1" >>confdefs.h fi - { $as_echo "$as_me:$LINENO: checking for wchar_t" >&5 + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wchar_t" >&5 $as_echo_n "checking for wchar_t... " >&6; } -if test "${gt_cv_c_wchar_t+set}" = set; then +if test "${gt_cv_c_wchar_t+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include wchar_t foo = (wchar_t)'\0'; @@ -16286,55 +13319,28 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : gt_cv_c_wchar_t=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - gt_cv_c_wchar_t=no + gt_cv_c_wchar_t=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $gt_cv_c_wchar_t" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_c_wchar_t" >&5 $as_echo "$gt_cv_c_wchar_t" >&6; } if test $gt_cv_c_wchar_t = yes; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_WCHAR_T 1 -_ACEOF +$as_echo "#define HAVE_WCHAR_T 1" >>confdefs.h fi - { $as_echo "$as_me:$LINENO: checking for wint_t" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wint_t" >&5 $as_echo_n "checking for wint_t... " >&6; } -if test "${gt_cv_c_wint_t+set}" = set; then +if test "${gt_cv_c_wint_t+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Tru64 with Desktop Toolkit C has a bug: must be included before @@ -16354,55 +13360,28 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : gt_cv_c_wint_t=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - gt_cv_c_wint_t=no + gt_cv_c_wint_t=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $gt_cv_c_wint_t" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_c_wint_t" >&5 $as_echo "$gt_cv_c_wint_t" >&6; } if test $gt_cv_c_wint_t = yes; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_WINT_T 1 -_ACEOF +$as_echo "#define HAVE_WINT_T 1" >>confdefs.h fi - { $as_echo "$as_me:$LINENO: checking for inttypes.h" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inttypes.h" >&5 $as_echo_n "checking for inttypes.h... " >&6; } -if test "${gl_cv_header_inttypes_h+set}" = set; then +if test "${gl_cv_header_inttypes_h+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include @@ -16414,35 +13393,14 @@ uintmax_t i = (uintmax_t) -1; return !i; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : gl_cv_header_inttypes_h=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - gl_cv_header_inttypes_h=no + gl_cv_header_inttypes_h=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_header_inttypes_h" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_inttypes_h" >&5 $as_echo "$gl_cv_header_inttypes_h" >&6; } if test $gl_cv_header_inttypes_h = yes; then @@ -16453,16 +13411,12 @@ _ACEOF fi - { $as_echo "$as_me:$LINENO: checking for stdint.h" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdint.h" >&5 $as_echo_n "checking for stdint.h... " >&6; } -if test "${gl_cv_header_stdint_h+set}" = set; then +if test "${gl_cv_header_stdint_h+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include @@ -16474,35 +13428,14 @@ uintmax_t i = (uintmax_t) -1; return !i; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : gl_cv_header_stdint_h=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - gl_cv_header_stdint_h=no + gl_cv_header_stdint_h=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_header_stdint_h" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_stdint_h" >&5 $as_echo "$gl_cv_header_stdint_h" >&6; } if test $gl_cv_header_stdint_h = yes; then @@ -16514,28 +13447,13 @@ _ACEOF - ac_cv_type_long_long=$ac_cv_type_long_long_int - if test $ac_cv_type_long_long = yes; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_LONG_LONG 1 -_ACEOF - - fi - - - - - { $as_echo "$as_me:$LINENO: checking for intmax_t" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for intmax_t" >&5 $as_echo_n "checking for intmax_t... " >&6; } -if test "${gt_cv_c_intmax_t+set}" = set; then +if test "${gt_cv_c_intmax_t+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -16555,45 +13473,22 @@ intmax_t x = -1; return !x; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : gt_cv_c_intmax_t=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - gt_cv_c_intmax_t=no + gt_cv_c_intmax_t=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $gt_cv_c_intmax_t" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_c_intmax_t" >&5 $as_echo "$gt_cv_c_intmax_t" >&6; } if test $gt_cv_c_intmax_t = yes; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_INTMAX_T 1 -_ACEOF +$as_echo "#define HAVE_INTMAX_T 1" >>confdefs.h else - test $ac_cv_type_long_long = yes \ + test $ac_cv_type_long_long_int = yes \ && ac_type='long long' \ || ac_type='long' @@ -16607,16 +13502,1371 @@ _ACEOF -{ $as_echo "$as_me:$LINENO: checking POSIX termios" >&5 -$as_echo_n "checking POSIX termios... " >&6; } -if test "${ac_cv_sys_posix_termios+set}" = set; then + + for ac_func in snprintf strnlen wcslen wcsnlen mbrtowc wcrtomb +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +eval as_val=\$$as_ac_var + if test "x$as_val" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + ac_fn_c_check_decl "$LINENO" "_snprintf" "ac_cv_have_decl__snprintf" "#include +" +if test "x$ac_cv_have_decl__snprintf" = x""yes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL__SNPRINTF $ac_have_decl +_ACEOF + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether printf supports size specifiers as in C99" >&5 +$as_echo_n "checking whether printf supports size specifiers as in C99... " >&6; } +if test "${gl_cv_func_printf_sizes_c99+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ + + if test "$cross_compiling" = yes; then : + + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_printf_sizes_c99="guessing yes";; + # Guess yes on FreeBSD >= 5. + freebsd[1-4]*) gl_cv_func_printf_sizes_c99="guessing no";; + freebsd* | kfreebsd*) gl_cv_func_printf_sizes_c99="guessing yes";; + # Guess yes on MacOS X >= 10.3. + darwin[1-6].*) gl_cv_func_printf_sizes_c99="guessing no";; + darwin*) gl_cv_func_printf_sizes_c99="guessing yes";; + # Guess yes on OpenBSD >= 3.9. + openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*) + gl_cv_func_printf_sizes_c99="guessing no";; + openbsd*) gl_cv_func_printf_sizes_c99="guessing yes";; + # Guess yes on Solaris >= 2.10. + solaris2.[0-9]*) gl_cv_func_printf_sizes_c99="guessing no";; + solaris*) gl_cv_func_printf_sizes_c99="guessing yes";; + # Guess yes on NetBSD >= 3. + netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*) + gl_cv_func_printf_sizes_c99="guessing no";; + netbsd*) gl_cv_func_printf_sizes_c99="guessing yes";; + # If we don't know, assume the worst. + *) gl_cv_func_printf_sizes_c99="guessing no";; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +#include +#if HAVE_STDINT_H_WITH_UINTMAX +# include +#endif +#if HAVE_INTTYPES_H_WITH_UINTMAX +# include +#endif +static char buf[100]; +int main () +{ +#if HAVE_STDINT_H_WITH_UINTMAX || HAVE_INTTYPES_H_WITH_UINTMAX + buf[0] = '\0'; + if (sprintf (buf, "%ju %d", (uintmax_t) 12345671, 33, 44, 55) < 0 + || strcmp (buf, "12345671 33") != 0) + return 1; +#endif + buf[0] = '\0'; + if (sprintf (buf, "%zu %d", (size_t) 12345672, 33, 44, 55) < 0 + || strcmp (buf, "12345672 33") != 0) + return 1; + buf[0] = '\0'; + if (sprintf (buf, "%tu %d", (ptrdiff_t) 12345673, 33, 44, 55) < 0 + || strcmp (buf, "12345673 33") != 0) + return 1; + buf[0] = '\0'; + if (sprintf (buf, "%Lg %d", (long double) 1.5, 33, 44, 55) < 0 + || strcmp (buf, "1.5 33") != 0) + return 1; + return 0; +} _ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_printf_sizes_c99=yes +else + gl_cv_func_printf_sizes_c99=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_sizes_c99" >&5 +$as_echo "$gl_cv_func_printf_sizes_c99" >&6; } + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether printf supports 'long double' arguments" >&5 +$as_echo_n "checking whether printf supports 'long double' arguments... " >&6; } +if test "${gl_cv_func_printf_long_double+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + + case "$host_os" in + beos*) gl_cv_func_printf_long_double="guessing no";; + mingw* | pw*) gl_cv_func_printf_long_double="guessing no";; + *) gl_cv_func_printf_long_double="guessing yes";; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +static char buf[10000]; +int main () +{ + buf[0] = '\0'; + if (sprintf (buf, "%Lf %d", 1.75L, 33, 44, 55) < 0 + || strcmp (buf, "1.750000 33") != 0) + return 1; + buf[0] = '\0'; + if (sprintf (buf, "%Le %d", 1.75L, 33, 44, 55) < 0 + || strcmp (buf, "1.750000e+00 33") != 0) + return 1; + buf[0] = '\0'; + if (sprintf (buf, "%Lg %d", 1.75L, 33, 44, 55) < 0 + || strcmp (buf, "1.75 33") != 0) + return 1; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_printf_long_double=yes +else + gl_cv_func_printf_long_double=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_long_double" >&5 +$as_echo "$gl_cv_func_printf_long_double" >&6; } + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether printf supports infinite 'double' arguments" >&5 +$as_echo_n "checking whether printf supports infinite 'double' arguments... " >&6; } +if test "${gl_cv_func_printf_infinite+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_printf_infinite="guessing yes";; + # Guess yes on FreeBSD >= 6. + freebsd[1-5]*) gl_cv_func_printf_infinite="guessing no";; + freebsd* | kfreebsd*) gl_cv_func_printf_infinite="guessing yes";; + # Guess yes on MacOS X >= 10.3. + darwin[1-6].*) gl_cv_func_printf_infinite="guessing no";; + darwin*) gl_cv_func_printf_infinite="guessing yes";; + # Guess yes on HP-UX >= 11. + hpux[7-9]* | hpux10*) gl_cv_func_printf_infinite="guessing no";; + hpux*) gl_cv_func_printf_infinite="guessing yes";; + # Guess yes on NetBSD >= 3. + netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*) + gl_cv_func_printf_infinite="guessing no";; + netbsd*) gl_cv_func_printf_infinite="guessing yes";; + # Guess yes on BeOS. + beos*) gl_cv_func_printf_infinite="guessing yes";; + # If we don't know, assume the worst. + *) gl_cv_func_printf_infinite="guessing no";; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +static int +strisnan (const char *string, size_t start_index, size_t end_index) +{ + if (start_index < end_index) + { + if (string[start_index] == '-') + start_index++; + if (start_index + 3 <= end_index + && memcmp (string + start_index, "nan", 3) == 0) + { + start_index += 3; + if (start_index == end_index + || (string[start_index] == '(' && string[end_index - 1] == ')')) + return 1; + } + } + return 0; +} +static int +have_minus_zero () +{ + static double plus_zero = 0.0; + double minus_zero = - plus_zero; + return memcmp (&plus_zero, &minus_zero, sizeof (double)) != 0; +} +static char buf[10000]; +static double zero = 0.0; +int main () +{ + if (sprintf (buf, "%f", 1.0 / 0.0) < 0 + || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0)) + return 1; + if (sprintf (buf, "%f", -1.0 / 0.0) < 0 + || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0)) + return 1; + if (sprintf (buf, "%f", zero / zero) < 0 + || !strisnan (buf, 0, strlen (buf))) + return 1; + if (sprintf (buf, "%e", 1.0 / 0.0) < 0 + || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0)) + return 1; + if (sprintf (buf, "%e", -1.0 / 0.0) < 0 + || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0)) + return 1; + if (sprintf (buf, "%e", zero / zero) < 0 + || !strisnan (buf, 0, strlen (buf))) + return 1; + if (sprintf (buf, "%g", 1.0 / 0.0) < 0 + || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0)) + return 1; + if (sprintf (buf, "%g", -1.0 / 0.0) < 0 + || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0)) + return 1; + if (sprintf (buf, "%g", zero / zero) < 0 + || !strisnan (buf, 0, strlen (buf))) + return 1; + /* This test fails on HP-UX 10.20. */ + if (have_minus_zero ()) + if (sprintf (buf, "%g", - zero) < 0 + || strcmp (buf, "-0") != 0) + return 1; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_printf_infinite=yes +else + gl_cv_func_printf_infinite=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_infinite" >&5 +$as_echo "$gl_cv_func_printf_infinite" >&6; } + + + + + + if test -n "$gl_printf_safe"; then + +$as_echo "#define CHECK_PRINTF_SAFE 1" >>confdefs.h + + fi + case "$gl_cv_func_printf_long_double" in + *yes) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether printf supports infinite 'long double' arguments" >&5 +$as_echo_n "checking whether printf supports infinite 'long double' arguments... " >&6; } +if test "${gl_cv_func_printf_infinite_long_double+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + + case "$host_cpu" in + # Guess no on ia64, x86_64, i386. + ia64 | x86_64 | i*86) gl_cv_func_printf_infinite_long_double="guessing no";; + *) + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_printf_infinite_long_double="guessing yes";; + # Guess yes on FreeBSD >= 6. + freebsd[1-5]*) gl_cv_func_printf_infinite_long_double="guessing no";; + freebsd* | kfreebsd*) gl_cv_func_printf_infinite_long_double="guessing yes";; + # Guess yes on MacOS X >= 10.3. + darwin[1-6].*) gl_cv_func_printf_infinite_long_double="guessing no";; + darwin*) gl_cv_func_printf_infinite_long_double="guessing yes";; + # Guess yes on HP-UX >= 11. + hpux[7-9]* | hpux10*) gl_cv_func_printf_infinite_long_double="guessing no";; + hpux*) gl_cv_func_printf_infinite_long_double="guessing yes";; + # Guess yes on NetBSD >= 3. + netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*) + gl_cv_func_printf_infinite_long_double="guessing no";; + netbsd*) gl_cv_func_printf_infinite_long_double="guessing yes";; + # If we don't know, assume the worst. + *) gl_cv_func_printf_infinite_long_double="guessing no";; + esac + ;; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +#include +#if defined __MACH__ && defined __APPLE__ +/* Avoid a crash on MacOS X. */ +#include +#include +#include +#include +#include +#include +/* The exception port on which our thread listens. */ +static mach_port_t our_exception_port; +/* The main function of the thread listening for exceptions of type + EXC_BAD_ACCESS. */ +static void * +mach_exception_thread (void *arg) +{ + /* Buffer for a message to be received. */ + struct { + mach_msg_header_t head; + mach_msg_body_t msgh_body; + char data[1024]; + } msg; + mach_msg_return_t retval; + /* Wait for a message on the exception port. */ + retval = mach_msg (&msg.head, MACH_RCV_MSG | MACH_RCV_LARGE, 0, sizeof (msg), + our_exception_port, MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL); + if (retval != MACH_MSG_SUCCESS) + abort (); + exit (1); +} +static void +nocrash_init (void) +{ + mach_port_t self = mach_task_self (); + /* Allocate a port on which the thread shall listen for exceptions. */ + if (mach_port_allocate (self, MACH_PORT_RIGHT_RECEIVE, &our_exception_port) + == KERN_SUCCESS) { + /* See http://web.mit.edu/darwin/src/modules/xnu/osfmk/man/mach_port_insert_right.html. */ + if (mach_port_insert_right (self, our_exception_port, our_exception_port, + MACH_MSG_TYPE_MAKE_SEND) + == KERN_SUCCESS) { + /* The exceptions we want to catch. Only EXC_BAD_ACCESS is interesting + for us. */ + exception_mask_t mask = EXC_MASK_BAD_ACCESS; + /* Create the thread listening on the exception port. */ + pthread_attr_t attr; + pthread_t thread; + if (pthread_attr_init (&attr) == 0 + && pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED) == 0 + && pthread_create (&thread, &attr, mach_exception_thread, NULL) == 0) { + pthread_attr_destroy (&attr); + /* Replace the exception port info for these exceptions with our own. + Note that we replace the exception port for the entire task, not only + for a particular thread. This has the effect that when our exception + port gets the message, the thread specific exception port has already + been asked, and we don't need to bother about it. + See http://web.mit.edu/darwin/src/modules/xnu/osfmk/man/task_set_exception_ports.html. */ + task_set_exception_ports (self, mask, our_exception_port, + EXCEPTION_DEFAULT, MACHINE_THREAD_STATE); + } + } + } +} +#else +/* Avoid a crash on POSIX systems. */ +#include +/* A POSIX signal handler. */ +static void +exception_handler (int sig) +{ + exit (1); +} +static void +nocrash_init (void) +{ +#ifdef SIGSEGV + signal (SIGSEGV, exception_handler); +#endif +#ifdef SIGBUS + signal (SIGBUS, exception_handler); +#endif +} +#endif + +#include +#include +#include +static int +strisnan (const char *string, size_t start_index, size_t end_index) +{ + if (start_index < end_index) + { + if (string[start_index] == '-') + start_index++; + if (start_index + 3 <= end_index + && memcmp (string + start_index, "nan", 3) == 0) + { + start_index += 3; + if (start_index == end_index + || (string[start_index] == '(' && string[end_index - 1] == ')')) + return 1; + } + } + return 0; +} +static char buf[10000]; +static long double zeroL = 0.0L; +int main () +{ + nocrash_init(); + if (sprintf (buf, "%Lf", 1.0L / 0.0L) < 0 + || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0)) + return 1; + if (sprintf (buf, "%Lf", -1.0L / 0.0L) < 0 + || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0)) + return 1; + if (sprintf (buf, "%Lf", zeroL / zeroL) < 0 + || !strisnan (buf, 0, strlen (buf))) + return 1; + if (sprintf (buf, "%Le", 1.0L / 0.0L) < 0 + || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0)) + return 1; + if (sprintf (buf, "%Le", -1.0L / 0.0L) < 0 + || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0)) + return 1; + if (sprintf (buf, "%Le", zeroL / zeroL) < 0 + || !strisnan (buf, 0, strlen (buf))) + return 1; + if (sprintf (buf, "%Lg", 1.0L / 0.0L) < 0 + || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0)) + return 1; + if (sprintf (buf, "%Lg", -1.0L / 0.0L) < 0 + || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0)) + return 1; + if (sprintf (buf, "%Lg", zeroL / zeroL) < 0 + || !strisnan (buf, 0, strlen (buf))) + return 1; +#if CHECK_PRINTF_SAFE && ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_)) +/* Representation of an 80-bit 'long double' as an initializer for a sequence + of 'unsigned int' words. */ +# ifdef WORDS_BIGENDIAN +# define LDBL80_WORDS(exponent,manthi,mantlo) \ + { ((unsigned int) (exponent) << 16) | ((unsigned int) (manthi) >> 16), \ + ((unsigned int) (manthi) << 16) | (unsigned int) (mantlo) >> 16), \ + (unsigned int) (mantlo) << 16 \ + } +# else +# define LDBL80_WORDS(exponent,manthi,mantlo) \ + { mantlo, manthi, exponent } +# endif + { /* Quiet NaN. */ + static union { unsigned int word[4]; long double value; } x = + { LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) }; + if (sprintf (buf, "%Lf", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + return 1; + if (sprintf (buf, "%Le", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + return 1; + if (sprintf (buf, "%Lg", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + return 1; + } + { + /* Signalling NaN. */ + static union { unsigned int word[4]; long double value; } x = + { LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) }; + if (sprintf (buf, "%Lf", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + return 1; + if (sprintf (buf, "%Le", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + return 1; + if (sprintf (buf, "%Lg", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + return 1; + } + { /* Pseudo-NaN. */ + static union { unsigned int word[4]; long double value; } x = + { LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) }; + if (sprintf (buf, "%Lf", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + return 1; + if (sprintf (buf, "%Le", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + return 1; + if (sprintf (buf, "%Lg", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + return 1; + } + { /* Pseudo-Infinity. */ + static union { unsigned int word[4]; long double value; } x = + { LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) }; + if (sprintf (buf, "%Lf", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + return 1; + if (sprintf (buf, "%Le", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + return 1; + if (sprintf (buf, "%Lg", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + return 1; + } + { /* Pseudo-Zero. */ + static union { unsigned int word[4]; long double value; } x = + { LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) }; + if (sprintf (buf, "%Lf", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + return 1; + if (sprintf (buf, "%Le", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + return 1; + if (sprintf (buf, "%Lg", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + return 1; + } + { /* Unnormalized number. */ + static union { unsigned int word[4]; long double value; } x = + { LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) }; + if (sprintf (buf, "%Lf", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + return 1; + if (sprintf (buf, "%Le", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + return 1; + if (sprintf (buf, "%Lg", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + return 1; + } + { /* Pseudo-Denormal. */ + static union { unsigned int word[4]; long double value; } x = + { LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) }; + if (sprintf (buf, "%Lf", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + return 1; + if (sprintf (buf, "%Le", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + return 1; + if (sprintf (buf, "%Lg", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + return 1; + } +#endif + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_printf_infinite_long_double=yes +else + gl_cv_func_printf_infinite_long_double=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_infinite_long_double" >&5 +$as_echo "$gl_cv_func_printf_infinite_long_double" >&6; } + ;; + *) + gl_cv_func_printf_infinite_long_double="irrelevant" + ;; + esac + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether printf supports the 'a' and 'A' directives" >&5 +$as_echo_n "checking whether printf supports the 'a' and 'A' directives... " >&6; } +if test "${gl_cv_func_printf_directive_a+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + + case "$host_os" in + # Guess yes on glibc >= 2.5 systems. + *-gnu*) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #ifdef __GNU_LIBRARY__ + #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 5) || (__GLIBC__ > 2) + BZ2908 + #endif + #endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "BZ2908" >/dev/null 2>&1; then : + gl_cv_func_printf_directive_a="guessing yes" +else + gl_cv_func_printf_directive_a="guessing no" +fi +rm -f conftest* + + ;; + # If we don't know, assume the worst. + *) gl_cv_func_printf_directive_a="guessing no";; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +static char buf[100]; +int main () +{ + if (sprintf (buf, "%a %d", 3.1416015625, 33, 44, 55) < 0 + || (strcmp (buf, "0x1.922p+1 33") != 0 + && strcmp (buf, "0x3.244p+0 33") != 0 + && strcmp (buf, "0x6.488p-1 33") != 0 + && strcmp (buf, "0xc.91p-2 33") != 0)) + return 1; + if (sprintf (buf, "%A %d", -3.1416015625, 33, 44, 55) < 0 + || (strcmp (buf, "-0X1.922P+1 33") != 0 + && strcmp (buf, "-0X3.244P+0 33") != 0 + && strcmp (buf, "-0X6.488P-1 33") != 0 + && strcmp (buf, "-0XC.91P-2 33") != 0)) + return 1; + /* This catches a FreeBSD 6.1 bug: it doesn't round. */ + if (sprintf (buf, "%.2a %d", 1.51, 33, 44, 55) < 0 + || (strcmp (buf, "0x1.83p+0 33") != 0 + && strcmp (buf, "0x3.05p-1 33") != 0 + && strcmp (buf, "0x6.0ap-2 33") != 0 + && strcmp (buf, "0xc.14p-3 33") != 0)) + return 1; + /* This catches a FreeBSD 6.1 bug. See + */ + if (sprintf (buf, "%010a %d", 1.0 / 0.0, 33, 44, 55) < 0 + || buf[0] == '0') + return 1; + /* This catches a MacOS X 10.3.9 (Darwin 7.9) bug. */ + if (sprintf (buf, "%.1a", 1.999) < 0 + || (strcmp (buf, "0x1.0p+1") != 0 + && strcmp (buf, "0x2.0p+0") != 0 + && strcmp (buf, "0x4.0p-1") != 0 + && strcmp (buf, "0x8.0p-2") != 0)) + return 1; + /* This catches the same MacOS X 10.3.9 (Darwin 7.9) bug and also a + glibc 2.4 bug . */ + if (sprintf (buf, "%.1La", 1.999L) < 0 + || (strcmp (buf, "0x1.0p+1") != 0 + && strcmp (buf, "0x2.0p+0") != 0 + && strcmp (buf, "0x4.0p-1") != 0 + && strcmp (buf, "0x8.0p-2") != 0)) + return 1; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_printf_directive_a=yes +else + gl_cv_func_printf_directive_a=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_directive_a" >&5 +$as_echo "$gl_cv_func_printf_directive_a" >&6; } + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether printf supports the 'F' directive" >&5 +$as_echo_n "checking whether printf supports the 'F' directive... " >&6; } +if test "${gl_cv_func_printf_directive_f+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_printf_directive_f="guessing yes";; + # Guess yes on FreeBSD >= 6. + freebsd[1-5]*) gl_cv_func_printf_directive_f="guessing no";; + freebsd* | kfreebsd*) gl_cv_func_printf_directive_f="guessing yes";; + # Guess yes on MacOS X >= 10.3. + darwin[1-6].*) gl_cv_func_printf_directive_f="guessing no";; + darwin*) gl_cv_func_printf_directive_f="guessing yes";; + # Guess yes on Solaris >= 2.10. + solaris2.[0-9]*) gl_cv_func_printf_directive_f="guessing no";; + solaris*) gl_cv_func_printf_directive_f="guessing yes";; + # If we don't know, assume the worst. + *) gl_cv_func_printf_directive_f="guessing no";; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +static char buf[100]; +int main () +{ + if (sprintf (buf, "%F %d", 1234567.0, 33, 44, 55) < 0 + || strcmp (buf, "1234567.000000 33") != 0) + return 1; + if (sprintf (buf, "%F", 1.0 / 0.0) < 0 + || (strcmp (buf, "INF") != 0 && strcmp (buf, "INFINITY") != 0)) + return 1; + /* This catches a Cygwin 1.5.x bug. */ + if (sprintf (buf, "%.F", 1234.0) < 0 + || strcmp (buf, "1234") != 0) + return 1; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_printf_directive_f=yes +else + gl_cv_func_printf_directive_f=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_directive_f" >&5 +$as_echo "$gl_cv_func_printf_directive_f" >&6; } + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether printf supports the 'n' directive" >&5 +$as_echo_n "checking whether printf supports the 'n' directive... " >&6; } +if test "${gl_cv_func_printf_directive_n+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + + case "$host_os" in + *) gl_cv_func_printf_directive_n="guessing yes";; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +static char fmtstring[10]; +static char buf[100]; +int main () +{ + int count = -1; + /* Copy the format string. Some systems (glibc with _FORTIFY_SOURCE=2) + support %n in format strings in read-only memory but not in writable + memory. */ + strcpy (fmtstring, "%d %n"); + if (sprintf (buf, fmtstring, 123, &count, 33, 44, 55) < 0 + || strcmp (buf, "123 ") != 0 + || count != 4) + return 1; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_printf_directive_n=yes +else + gl_cv_func_printf_directive_n=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_directive_n" >&5 +$as_echo "$gl_cv_func_printf_directive_n" >&6; } + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether printf supports the 'ls' directive" >&5 +$as_echo_n "checking whether printf supports the 'ls' directive... " >&6; } +if test "${gl_cv_func_printf_directive_ls+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + + case "$host_os" in + openbsd*) gl_cv_func_printf_directive_ls="guessing no";; + irix*) gl_cv_func_printf_directive_ls="guessing no";; + solaris*) gl_cv_func_printf_directive_ls="guessing no";; + cygwin*) gl_cv_func_printf_directive_ls="guessing no";; + beos* | haiku*) gl_cv_func_printf_directive_ls="guessing no";; + *) gl_cv_func_printf_directive_ls="guessing yes";; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include +#include +int main () +{ + char buf[100]; + /* Test whether %ls works at all. + This test fails on OpenBSD 4.0, IRIX 6.5, Solaris 2.6, Haiku, but not on + Cygwin 1.5. */ + { + static const wchar_t wstring[] = { 'a', 'b', 'c', 0 }; + buf[0] = '\0'; + if (sprintf (buf, "%ls", wstring) < 0 + || strcmp (buf, "abc") != 0) + return 1; + } + /* This test fails on IRIX 6.5, Solaris 2.6, Cygwin 1.5, Haiku (with an + assertion failure inside libc), but not on OpenBSD 4.0. */ + { + static const wchar_t wstring[] = { 'a', 0 }; + buf[0] = '\0'; + if (sprintf (buf, "%ls", wstring) < 0 + || strcmp (buf, "a") != 0) + return 1; + } + /* Test whether precisions in %ls are supported as specified in ISO C 99 + section 7.19.6.1: + "If a precision is specified, no more than that many bytes are written + (including shift sequences, if any), and the array shall contain a + null wide character if, to equal the multibyte character sequence + length given by the precision, the function would need to access a + wide character one past the end of the array." + This test fails on Solaris 10. */ + { + static const wchar_t wstring[] = { 'a', 'b', (wchar_t) 0xfdfdfdfd, 0 }; + buf[0] = '\0'; + if (sprintf (buf, "%.2ls", wstring) < 0 + || strcmp (buf, "ab") != 0) + return 1; + } + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_printf_directive_ls=yes +else + gl_cv_func_printf_directive_ls=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_directive_ls" >&5 +$as_echo "$gl_cv_func_printf_directive_ls" >&6; } + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether printf supports POSIX/XSI format strings with positions" >&5 +$as_echo_n "checking whether printf supports POSIX/XSI format strings with positions... " >&6; } +if test "${gl_cv_func_printf_positions+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + + case "$host_os" in + netbsd[1-3]* | netbsdelf[1-3]* | netbsdaout[1-3]* | netbsdcoff[1-3]*) + gl_cv_func_printf_positions="guessing no";; + beos*) gl_cv_func_printf_positions="guessing no";; + mingw* | pw*) gl_cv_func_printf_positions="guessing no";; + *) gl_cv_func_printf_positions="guessing yes";; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +/* The string "%2$d %1$d", with dollar characters protected from the shell's + dollar expansion (possibly an autoconf bug). */ +static char format[] = { '%', '2', '$', 'd', ' ', '%', '1', '$', 'd', '\0' }; +static char buf[100]; +int main () +{ + sprintf (buf, format, 33, 55); + return (strcmp (buf, "55 33") != 0); +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_printf_positions=yes +else + gl_cv_func_printf_positions=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_positions" >&5 +$as_echo "$gl_cv_func_printf_positions" >&6; } + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether printf supports the grouping flag" >&5 +$as_echo_n "checking whether printf supports the grouping flag... " >&6; } +if test "${gl_cv_func_printf_flag_grouping+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + + case "$host_os" in + cygwin*) gl_cv_func_printf_flag_grouping="guessing no";; + netbsd*) gl_cv_func_printf_flag_grouping="guessing no";; + mingw* | pw*) gl_cv_func_printf_flag_grouping="guessing no";; + *) gl_cv_func_printf_flag_grouping="guessing yes";; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +static char buf[100]; +int main () +{ + if (sprintf (buf, "%'d %d", 1234567, 99) < 0 + || buf[strlen (buf) - 1] != '9') + return 1; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_printf_flag_grouping=yes +else + gl_cv_func_printf_flag_grouping=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_flag_grouping" >&5 +$as_echo "$gl_cv_func_printf_flag_grouping" >&6; } + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether printf supports the left-adjust flag correctly" >&5 +$as_echo_n "checking whether printf supports the left-adjust flag correctly... " >&6; } +if test "${gl_cv_func_printf_flag_leftadjust+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + + case "$host_os" in + # Guess yes on HP-UX 11. + hpux11*) gl_cv_func_printf_flag_leftadjust="guessing yes";; + # Guess no on HP-UX 10 and older. + hpux*) gl_cv_func_printf_flag_leftadjust="guessing no";; + # Guess yes otherwise. + *) gl_cv_func_printf_flag_leftadjust="guessing yes";; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +static char buf[100]; +int main () +{ + /* Check that a '-' flag is not annihilated by a negative width. */ + if (sprintf (buf, "a%-*sc", -3, "b") < 0 + || strcmp (buf, "ab c") != 0) + return 1; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_printf_flag_leftadjust=yes +else + gl_cv_func_printf_flag_leftadjust=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_flag_leftadjust" >&5 +$as_echo "$gl_cv_func_printf_flag_leftadjust" >&6; } + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether printf supports the zero flag correctly" >&5 +$as_echo_n "checking whether printf supports the zero flag correctly... " >&6; } +if test "${gl_cv_func_printf_flag_zero+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_printf_flag_zero="guessing yes";; + # Guess yes on BeOS. + beos*) gl_cv_func_printf_flag_zero="guessing yes";; + # If we don't know, assume the worst. + *) gl_cv_func_printf_flag_zero="guessing no";; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +static char buf[100]; +int main () +{ + if (sprintf (buf, "%010f", 1.0 / 0.0, 33, 44, 55) < 0 + || (strcmp (buf, " inf") != 0 + && strcmp (buf, " infinity") != 0)) + return 1; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_printf_flag_zero=yes +else + gl_cv_func_printf_flag_zero=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_flag_zero" >&5 +$as_echo "$gl_cv_func_printf_flag_zero" >&6; } + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether printf supports large precisions" >&5 +$as_echo_n "checking whether printf supports large precisions... " >&6; } +if test "${gl_cv_func_printf_precision+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + + case "$host_os" in + # Guess no only on native Win32 and BeOS systems. + mingw* | pw*) gl_cv_func_printf_precision="guessing no" ;; + beos*) gl_cv_func_printf_precision="guessing no" ;; + *) gl_cv_func_printf_precision="guessing yes" ;; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +static char buf[5000]; +int main () +{ +#ifdef __BEOS__ + /* On BeOS, this would crash and show a dialog box. Avoid the crash. */ + return 1; +#endif + if (sprintf (buf, "%.4000d %d", 1, 33, 44) < 4000 + 3) + return 1; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_printf_precision=yes +else + gl_cv_func_printf_precision=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_precision" >&5 +$as_echo "$gl_cv_func_printf_precision" >&6; } + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether printf survives out-of-memory conditions" >&5 +$as_echo_n "checking whether printf survives out-of-memory conditions... " >&6; } +if test "${gl_cv_func_printf_enomem+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + gl_cv_func_printf_enomem="guessing no" + if test "$cross_compiling" = no; then + if test $APPLE_UNIVERSAL_BUILD = 0; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +#include +#if defined __MACH__ && defined __APPLE__ +/* Avoid a crash on MacOS X. */ +#include +#include +#include +#include +#include +#include +/* The exception port on which our thread listens. */ +static mach_port_t our_exception_port; +/* The main function of the thread listening for exceptions of type + EXC_BAD_ACCESS. */ +static void * +mach_exception_thread (void *arg) +{ + /* Buffer for a message to be received. */ + struct { + mach_msg_header_t head; + mach_msg_body_t msgh_body; + char data1024; + } msg; + mach_msg_return_t retval; + /* Wait for a message on the exception port. */ + retval = mach_msg (&msg.head, MACH_RCV_MSG | MACH_RCV_LARGE, 0, sizeof (msg), + our_exception_port, MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL); + if (retval != MACH_MSG_SUCCESS) + abort (); + exit (1); +} +static void +nocrash_init (void) +{ + mach_port_t self = mach_task_self (); + /* Allocate a port on which the thread shall listen for exceptions. */ + if (mach_port_allocate (self, MACH_PORT_RIGHT_RECEIVE, &our_exception_port) + == KERN_SUCCESS) { + /* See http://web.mit.edu/darwin/src/modules/xnu/osfmk/man/mach_port_insert_right.html. */ + if (mach_port_insert_right (self, our_exception_port, our_exception_port, + MACH_MSG_TYPE_MAKE_SEND) + == KERN_SUCCESS) { + /* The exceptions we want to catch. Only EXC_BAD_ACCESS is interesting + for us. */ + exception_mask_t mask = EXC_MASK_BAD_ACCESS; + /* Create the thread listening on the exception port. */ + pthread_attr_t attr; + pthread_t thread; + if (pthread_attr_init (&attr) == 0 + && pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED) == 0 + && pthread_create (&thread, &attr, mach_exception_thread, NULL) == 0) { + pthread_attr_destroy (&attr); + /* Replace the exception port info for these exceptions with our own. + Note that we replace the exception port for the entire task, not only + for a particular thread. This has the effect that when our exception + port gets the message, the thread specific exception port has already + been asked, and we don't need to bother about it. + See http://web.mit.edu/darwin/src/modules/xnu/osfmk/man/task_set_exception_ports.html. */ + task_set_exception_ports (self, mask, our_exception_port, + EXCEPTION_DEFAULT, MACHINE_THREAD_STATE); + } + } + } +} +#else +/* Avoid a crash on POSIX systems. */ +#include +/* A POSIX signal handler. */ +static void +exception_handler (int sig) +{ + exit (1); +} +static void +nocrash_init (void) +{ +#ifdef SIGSEGV + signal (SIGSEGV, exception_handler); +#endif +#ifdef SIGBUS + signal (SIGBUS, exception_handler); +#endif +} +#endif + +#include +#include +#include +#include +#include +int main() +{ + struct rlimit limit; + int ret; + nocrash_init (); + /* Some printf implementations allocate temporary space with malloc. */ + /* On BSD systems, malloc() is limited by RLIMIT_DATA. */ +#ifdef RLIMIT_DATA + if (getrlimit (RLIMIT_DATA, &limit) < 0) + return 77; + if (limit.rlim_max == RLIM_INFINITY || limit.rlim_max > 5000000) + limit.rlim_max = 5000000; + limit.rlim_cur = limit.rlim_max; + if (setrlimit (RLIMIT_DATA, &limit) < 0) + return 77; +#endif + /* On Linux systems, malloc() is limited by RLIMIT_AS. */ +#ifdef RLIMIT_AS + if (getrlimit (RLIMIT_AS, &limit) < 0) + return 77; + if (limit.rlim_max == RLIM_INFINITY || limit.rlim_max > 5000000) + limit.rlim_max = 5000000; + limit.rlim_cur = limit.rlim_max; + if (setrlimit (RLIMIT_AS, &limit) < 0) + return 77; +#endif + /* Some printf implementations allocate temporary space on the stack. */ +#ifdef RLIMIT_STACK + if (getrlimit (RLIMIT_STACK, &limit) < 0) + return 77; + if (limit.rlim_max == RLIM_INFINITY || limit.rlim_max > 5000000) + limit.rlim_max = 5000000; + limit.rlim_cur = limit.rlim_max; + if (setrlimit (RLIMIT_STACK, &limit) < 0) + return 77; +#endif + ret = printf ("%.5000000f", 1.0); + return !(ret == 5000002 || (ret < 0 && errno == ENOMEM)); +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + (./conftest + result=$? + if test $result != 0 && test $result != 77; then result=1; fi + exit $result + ) >/dev/null 2>/dev/null + case $? in + 0) gl_cv_func_printf_enomem="yes" ;; + 77) gl_cv_func_printf_enomem="guessing no" ;; + *) gl_cv_func_printf_enomem="no" ;; + esac + else + gl_cv_func_printf_enomem="guessing no" + fi + rm -fr conftest* + else + gl_cv_func_printf_enomem="guessing no" + fi + fi + if test "$gl_cv_func_printf_enomem" = "guessing no"; then + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_printf_enomem="guessing yes";; + # Guess yes on Solaris. + solaris*) gl_cv_func_printf_enomem="guessing yes";; + # Guess yes on AIX. + aix*) gl_cv_func_printf_enomem="guessing yes";; + # Guess yes on HP-UX/hppa. + hpux*) case "$host_cpu" in + hppa*) gl_cv_func_printf_enomem="guessing yes";; + *) gl_cv_func_printf_enomem="guessing no";; + esac + ;; + # Guess yes on IRIX. + irix*) gl_cv_func_printf_enomem="guessing yes";; + # Guess yes on OSF/1. + osf*) gl_cv_func_printf_enomem="guessing yes";; + # Guess yes on BeOS. + beos*) gl_cv_func_printf_enomem="guessing yes";; + # Guess yes on Haiku. + haiku*) gl_cv_func_printf_enomem="guessing yes";; + # If we don't know, assume the worst. + *) gl_cv_func_printf_enomem="guessing no";; + esac + fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_enomem" >&5 +$as_echo "$gl_cv_func_printf_enomem" >&6; } + + + + case "$gl_cv_func_printf_long_double" in + *yes) + ;; + *) + +$as_echo "#define NEED_PRINTF_LONG_DOUBLE 1" >>confdefs.h + + ;; + esac + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking POSIX termios" >&5 +$as_echo_n "checking POSIX termios... " >&6; } +if test "${ac_cv_sys_posix_termios+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include @@ -16631,53 +14881,27 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then +if ac_fn_c_try_link "$LINENO"; then : ac_cv_sys_posix_termios=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_sys_posix_termios=no + ac_cv_sys_posix_termios=no fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_sys_posix_termios" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_posix_termios" >&5 $as_echo "$ac_cv_sys_posix_termios" >&6; } - { $as_echo "$as_me:$LINENO: checking whether use of TIOCGWINSZ requires termios.h" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether use of TIOCGWINSZ requires termios.h" >&5 $as_echo_n "checking whether use of TIOCGWINSZ requires termios.h... " >&6; } -if test "${jm_cv_sys_tiocgwinsz_needs_termios_h+set}" = set; then +if test "${gl_cv_sys_tiocgwinsz_needs_termios_h+set}" = set; then : $as_echo_n "(cached) " >&6 else - jm_cv_sys_tiocgwinsz_needs_termios_h=no + gl_cv_sys_tiocgwinsz_needs_termios_h=no if test $ac_cv_sys_posix_termios = yes; then - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include # include @@ -16687,16 +14911,75 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes" >/dev/null 2>&1; then - jm_cv_sys_tiocgwinsz_needs_termios_h=yes + $EGREP "yes" >/dev/null 2>&1; then : + gl_cv_sys_tiocgwinsz_needs_termios_h=yes fi rm -f conftest* fi fi -{ $as_echo "$as_me:$LINENO: result: $jm_cv_sys_tiocgwinsz_needs_termios_h" >&5 -$as_echo "$jm_cv_sys_tiocgwinsz_needs_termios_h" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_tiocgwinsz_needs_termios_h" >&5 +$as_echo "$gl_cv_sys_tiocgwinsz_needs_termios_h" >&6; } + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ungetc works on arbitrary bytes" >&5 +$as_echo_n "checking whether ungetc works on arbitrary bytes... " >&6; } +if test "${gl_cv_func_ungetc_works+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + gl_cv_func_ungetc_works='guessing no' +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include + +int +main () +{ +FILE *f; long l; + if (!(f = fopen ("conftest.tmp", "w+"))) return 1; + if (fputs ("abc", f) < 0) return 2; + rewind (f); + if (fgetc (f) != 'a') return 3; + if (fgetc (f) != 'b') return 4; + if (ungetc ('d', f) != 'd') return 5; + if (ftell (f) != 1) return 6; + if (fgetc (f) != 'd') return 7; + if (ftell (f) != 2) return 8; + if (fseek (f, 0, SEEK_CUR) != 0) return 9; + if (ftell (f) != 2) return 10; + if (fgetc (f) != 'c') return 11; + fclose (f); remove ("conftest.tmp"); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_ungetc_works=yes +else + gl_cv_func_ungetc_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_ungetc_works" >&5 +$as_echo "$gl_cv_func_ungetc_works" >&6; } + if test "$gl_cv_func_ungetc_works" != yes; then + +$as_echo "#define FUNC_UNGETC_BROKEN 1" >>confdefs.h + + fi + + + @@ -16713,270 +14996,52 @@ fi gl_cond_libtool=false gl_libdeps= gl_ltlibdeps= + + + + + + + + + gl_source_base='lib' - gl_LIBOBJS="$gl_LIBOBJS acl.$ac_objext" - gl_LIBOBJS="$gl_LIBOBJS file-has-acl.$ac_objext" - - -for ac_header in sys/acl.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } + # Check whether --enable-acl was given. +if test "${enable_acl+set}" = set; then : + enableval=$enable_acl; else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no + enable_acl=auto fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + LIB_ACL= + use_acl=0 - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-coreutils@gnu.org ## -## ------------------------------------ ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - -fi -if test `eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` = yes; then + if test "x$enable_acl" != "xno"; then + for ac_header in sys/acl.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "sys/acl.h" "ac_cv_header_sys_acl_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_acl_h" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define HAVE_SYS_ACL_H 1 _ACEOF fi done + if test $ac_cv_header_sys_acl_h = yes; then + ac_save_LIBS=$LIBS -for ac_func in acl -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if test `eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - - ac_save_LIBS="$LIBS" - { $as_echo "$as_me:$LINENO: checking for library containing acl_get_file" >&5 + if test $use_acl = 0; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing acl_get_file" >&5 $as_echo_n "checking for library containing acl_get_file... " >&6; } -if test "${ac_cv_search_acl_get_file+set}" = set; then +if test "${ac_cv_search_acl_get_file+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. @@ -16994,314 +15059,49 @@ return acl_get_file (); return 0; } _ACEOF -for ac_lib in '' acl; do +for ac_lib in '' acl pacl; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi - rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_acl_get_file=$ac_res -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext - if test "${ac_cv_search_acl_get_file+set}" = set; then +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if test "${ac_cv_search_acl_get_file+set}" = set; then : break fi done -if test "${ac_cv_search_acl_get_file+set}" = set; then - : +if test "${ac_cv_search_acl_get_file+set}" = set; then : + else ac_cv_search_acl_get_file=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_acl_get_file" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_acl_get_file" >&5 $as_echo "$ac_cv_search_acl_get_file" >&6; } ac_res=$ac_cv_search_acl_get_file -if test "$ac_res" != no; then +if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - test "$ac_cv_search_acl_get_file" = "none required" || - LIB_ACL=$ac_cv_search_acl_get_file -fi - - - -for ac_header in acl/libacl.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-coreutils@gnu.org ## -## ------------------------------------ ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - -fi -if test `eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - - - - - - - - - -for ac_func in acl_get_file acl_get_fd acl_set_file acl_set_fd \ - acl_free acl_from_mode acl_from_text \ - acl_delete_def_file acl_extended_file -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if test `eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` = yes; then + if test "$ac_cv_search_acl_get_file" != "none required"; then + LIB_ACL=$ac_cv_search_acl_get_file + fi + for ac_func in acl_get_file acl_get_fd acl_set_file acl_set_fd \ + acl_free acl_from_mode acl_from_text \ + acl_delete_def_file acl_extended_file \ + acl_delete_fd_np acl_delete_file_np \ + acl_copy_ext_native acl_create_entry_np \ + acl_to_short_text acl_free_text +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +eval as_val=\$$as_ac_var + if test "x$as_val" = x""yes; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF @@ -17309,24 +15109,17 @@ _ACEOF fi done - if test $ac_cv_header_sys_acl_h = yes; then - use_acl=1 - if test $ac_cv_func_acl_get_file = yes; then - # If we detect the acl_get_file bug, disable ACL support altogether. + # If the acl_get_file bug is detected, don't enable the ACL support. - { $as_echo "$as_me:$LINENO: checking for working acl_get_file" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working acl_get_file" >&5 $as_echo_n "checking for working acl_get_file... " >&6; } -if test "${gl_cv_func_working_acl_get_file+set}" = set; then +if test "${gl_cv_func_working_acl_get_file+set}" = set; then : $as_echo_n "(cached) " >&6 else - if test "$cross_compiling" = yes; then + if test "$cross_compiling" = yes; then : gl_cv_func_working_acl_get_file=cross-compiling else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include @@ -17341,173 +15134,138 @@ return !! (!acl_get_file (".", ACL_TYPE_ACCESS) return 0; } _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_run "$LINENO"; then : gl_cv_func_working_acl_get_file=yes else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -gl_cv_func_working_acl_get_file=no + gl_cv_func_working_acl_get_file=no fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi - fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_working_acl_get_file" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_working_acl_get_file" >&5 $as_echo "$gl_cv_func_working_acl_get_file" >&6; } - if test $gl_cv_func_working_acl_get_file = yes; then - : -else - use_acl=0 + if test $gl_cv_func_working_acl_get_file = yes; then : + use_acl=1 fi - - fi - else - use_acl=0 - fi - if test $use_acl = 1 && - test $ac_cv_func_acl_get_file = yes && - test $ac_cv_func_acl_free = yes; then - -for ac_func in acl_entries -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if test `eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` = yes; then + if test $use_acl = 1; then + for ac_header in acl/libacl.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "acl/libacl.h" "ac_cv_header_acl_libacl_h" "$ac_includes_default" +if test "x$ac_cv_header_acl_libacl_h" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define HAVE_ACL_LIBACL_H 1 +_ACEOF + +fi + +done + + + + + + + + + + for ac_func in acl_entries +do : + ac_fn_c_check_func "$LINENO" "acl_entries" "ac_cv_func_acl_entries" +if test "x$ac_cv_func_acl_entries" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_ACL_ENTRIES 1 _ACEOF else - gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" + + gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" + fi done - fi - LIBS="$ac_save_LIBS" - if test $use_acl = 1; then - ac_save_LIBS="$LIBS" - { $as_echo "$as_me:$LINENO: checking for library containing acl_trivial" >&5 + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ACL_FIRST_ENTRY" >&5 +$as_echo_n "checking for ACL_FIRST_ENTRY... " >&6; } +if test "${gl_cv_acl_ACL_FIRST_ENTRY+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +int type = ACL_FIRST_ENTRY; +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_acl_ACL_FIRST_ENTRY=yes +else + gl_cv_acl_ACL_FIRST_ENTRY=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_acl_ACL_FIRST_ENTRY" >&5 +$as_echo "$gl_cv_acl_ACL_FIRST_ENTRY" >&6; } + if test $gl_cv_acl_ACL_FIRST_ENTRY = yes; then + +$as_echo "#define HAVE_ACL_FIRST_ENTRY 1" >>confdefs.h + + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ACL_TYPE_EXTENDED" >&5 +$as_echo_n "checking for ACL_TYPE_EXTENDED... " >&6; } +if test "${gl_cv_acl_ACL_TYPE_EXTENDED+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +int type = ACL_TYPE_EXTENDED; +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_acl_ACL_TYPE_EXTENDED=yes +else + gl_cv_acl_ACL_TYPE_EXTENDED=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_acl_ACL_TYPE_EXTENDED" >&5 +$as_echo "$gl_cv_acl_ACL_TYPE_EXTENDED" >&6; } + if test $gl_cv_acl_ACL_TYPE_EXTENDED = yes; then + +$as_echo "#define HAVE_ACL_TYPE_EXTENDED 1" >>confdefs.h + + fi + else + LIB_ACL= + fi + +fi + + fi + + if test $use_acl = 0; then + for ac_func in acl +do : + ac_fn_c_check_func "$LINENO" "acl" "ac_cv_func_acl" +if test "x$ac_cv_func_acl" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_ACL 1 +_ACEOF + +fi +done + + if test $ac_cv_func_acl = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing acl_trivial" >&5 $as_echo_n "checking for library containing acl_trivial... " >&6; } -if test "${ac_cv_search_acl_trivial+set}" = set; then +if test "${ac_cv_search_acl_trivial+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. @@ -17532,69 +15290,114 @@ for ac_lib in '' sec; do ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi - rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_acl_trivial=$ac_res -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext - if test "${ac_cv_search_acl_trivial+set}" = set; then +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if test "${ac_cv_search_acl_trivial+set}" = set; then : break fi done -if test "${ac_cv_search_acl_trivial+set}" = set; then - : +if test "${ac_cv_search_acl_trivial+set}" = set; then : + else ac_cv_search_acl_trivial=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_acl_trivial" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_acl_trivial" >&5 $as_echo "$ac_cv_search_acl_trivial" >&6; } ac_res=$ac_cv_search_acl_trivial -if test "$ac_res" != no; then +if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + if test "$ac_cv_search_acl_trivial" != "none required"; then + LIB_ACL=$ac_cv_search_acl_trivial + fi -cat >>confdefs.h <<\_ACEOF +fi + + for ac_func in acl_trivial +do : + ac_fn_c_check_func "$LINENO" "acl_trivial" "ac_cv_func_acl_trivial" +if test "x$ac_cv_func_acl_trivial" = x""yes; then : + cat >>confdefs.h <<_ACEOF #define HAVE_ACL_TRIVIAL 1 _ACEOF - test "$ac_cv_search_acl_trivial" = "none required" || - LIB_ACL_TRIVIAL="$ac_cv_search_acl_trivial" fi +done + use_acl=1 + fi + fi - LIBS="$ac_save_LIBS" + if test $use_acl = 0 || test "$ac_cv_func_acl" = yes; then + for ac_func in getacl +do : + ac_fn_c_check_func "$LINENO" "getacl" "ac_cv_func_getacl" +if test "x$ac_cv_func_getacl" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_GETACL 1 +_ACEOF + +fi +done + + if test $ac_cv_func_getacl = yes; then + use_acl=1 + fi + fi + + if test $use_acl = 0; then + for ac_func in aclx_get +do : + ac_fn_c_check_func "$LINENO" "aclx_get" "ac_cv_func_aclx_get" +if test "x$ac_cv_func_aclx_get" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_ACLX_GET 1 +_ACEOF + +fi +done + + if test $ac_cv_func_aclx_get = yes; then + use_acl=1 + fi + fi + + if test $use_acl = 0 || test "$ac_cv_func_aclx_get" = yes; then + for ac_func in statacl +do : + ac_fn_c_check_func "$LINENO" "statacl" "ac_cv_func_statacl" +if test "x$ac_cv_func_statacl" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_STATACL 1 +_ACEOF + +fi +done + + if test $ac_cv_func_statacl = yes; then + use_acl=1 + fi + fi + + LIBS=$ac_save_LIBS + fi + if test "x$enable_acl$use_acl" = "xyes0"; then + as_fn_error "ACLs enabled but support not detected" "$LINENO" 5 + fi fi + cat >>confdefs.h <<_ACEOF #define USE_ACL $use_acl _ACEOF + USE_ACL=$use_acl + @@ -17607,17 +15410,13 @@ _ACEOF # Define an additional variable used in the Makefile substitution. if test $ac_cv_working_alloca_h = yes; then - { $as_echo "$as_me:$LINENO: checking for alloca as a compiler built-in" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca as a compiler built-in" >&5 $as_echo_n "checking for alloca as a compiler built-in... " >&6; } -if test "${gl_cv_rpl_alloca+set}" = set; then +if test "${gl_cv_rpl_alloca+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if defined __GNUC__ || defined _AIX || defined _MSC_VER @@ -17626,7 +15425,7 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "Need own alloca" >/dev/null 2>&1; then + $EGREP "Need own alloca" >/dev/null 2>&1; then : gl_cv_rpl_alloca=yes else gl_cv_rpl_alloca=no @@ -17635,13 +15434,11 @@ rm -f conftest* fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_rpl_alloca" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_rpl_alloca" >&5 $as_echo "$gl_cv_rpl_alloca" >&6; } if test $gl_cv_rpl_alloca = yes; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_ALLOCA 1 -_ACEOF +$as_echo "#define HAVE_ALLOCA 1" >>confdefs.h ALLOCA_H=alloca.h else @@ -17653,9 +15450,6 @@ _ACEOF -cat >>confdefs.h <<\_ACEOF -#define HAVE_ALLOCA_H 1 -_ACEOF @@ -17671,176 +15465,105 @@ _ACEOF - - if test $ac_cv_header_arpa_inet_h = yes; then - ARPA_INET_H='' + HAVE_ARPA_INET_H=1 else ARPA_INET_H='arpa/inet.h' + HAVE_ARPA_INET_H=0 fi - { $as_echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5 -$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } -if test -z "$MKDIR_P"; then - if test "${ac_cv_path_mkdir+set}" = set; then + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_arpa_inet_h='<'arpa/inet.h'>' + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +$as_echo_n "checking absolute name of ... " >&6; } +if test "${gl_cv_next_arpa_inet_h+set}" = set; then : $as_echo_n "(cached) " >&6 else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in mkdir gmkdir; do - for ac_exec_ext in '' $ac_executable_extensions; do - { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue - case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( - 'mkdir (GNU coreutils) '* | \ - 'mkdir (coreutils) '* | \ - 'mkdir (fileutils) '4.1*) - ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext - break 3;; - esac - done - done -done -IFS=$as_save_IFS + + if test $ac_cv_header_arpa_inet_h = yes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + gl_cv_next_arpa_inet_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n '\#/arpa/inet.h#{ + s#.*"\(.*/arpa/inet.h\)".*#\1# + s#^/[^/]#//&# + p + q + }'`'"' + else + gl_cv_next_arpa_inet_h='<'arpa/inet.h'>' + fi fi - - if test "${ac_cv_path_mkdir+set}" = set; then - MKDIR_P="$ac_cv_path_mkdir -p" - else - # As a last resort, use the slow shell script. Don't cache a - # value for MKDIR_P within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the value is a relative name. - test -d ./--version && rmdir ./--version - MKDIR_P="$ac_install_sh -d" - fi -fi -{ $as_echo "$as_me:$LINENO: result: $MKDIR_P" >&5 -$as_echo "$MKDIR_P" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_arpa_inet_h" >&5 +$as_echo "$gl_cv_next_arpa_inet_h" >&6; } + fi + NEXT_ARPA_INET_H=$gl_cv_next_arpa_inet_h - { $as_echo "$as_me:$LINENO: checking whether to enable assertions" >&5 + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable assertions" >&5 $as_echo_n "checking whether to enable assertions... " >&6; } # Check whether --enable-assert was given. -if test "${enable_assert+set}" = set; then - enableval=$enable_assert; { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } +if test "${enable_assert+set}" = set; then : + enableval=$enable_assert; if test "x$enableval" = xno; then : -cat >>confdefs.h <<\_ACEOF -#define NDEBUG 1 -_ACEOF +$as_echo "#define NDEBUG 1" >>confdefs.h +elif test "x$enableval" != xyes; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: invalid argument supplied to --enable-assert" >&5 +$as_echo "$as_me: WARNING: invalid argument supplied to --enable-assert" >&2;} + enable_assert=yes +fi else - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } - + enable_assert=yes fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_assert" >&5 +$as_echo "$enable_assert" >&6; } -for ac_func in atexit -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ -#ifdef __STDC__ -# include -#else -# include -#endif -#undef $ac_func -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - eval "$as_ac_var=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if test `eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` = yes; then + for ac_func in atexit +do : + ac_fn_c_check_func "$LINENO" "atexit" "ac_cv_func_atexit" +if test "x$ac_cv_func_atexit" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define HAVE_ATEXIT 1 _ACEOF else - gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" + + gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" + fi done + if test $ac_cv_func_atexit = no; then : @@ -17848,6 +15571,14 @@ done fi + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS backupfile.$ac_objext" @@ -17866,32 +15597,132 @@ done + if test $ac_cv_func_btowc = no; then + HAVE_BTOWC=0 + else + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether btowc(EOF) is correct" >&5 +$as_echo_n "checking whether btowc(EOF) is correct... " >&6; } +if test "${gl_cv_func_btowc_eof+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + case "$host_os" in + # Guess no on IRIX. + irix*) gl_cv_func_btowc_eof="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_btowc_eof="guessing yes" ;; + esac + if test $LOCALE_FR != none; then + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +#include +int main () +{ + if (setlocale (LC_ALL, "$LOCALE_FR") != NULL) + { + if (btowc (EOF) != WEOF) + return 1; + } + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_btowc_eof=yes +else + gl_cv_func_btowc_eof=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi + + fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_btowc_eof" >&5 +$as_echo "$gl_cv_func_btowc_eof" >&6; } + case "$gl_cv_func_btowc_eof" in + *yes) ;; + *) REPLACE_BTOWC=1 ;; + esac + fi + if test $HAVE_BTOWC = 0 || test $REPLACE_BTOWC = 1; then + + + WCHAR_H=wchar.h + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS btowc.$ac_objext" + + + : + + fi + + + + GNULIB_BTOWC=1 + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS c-strtod.$ac_objext" + + + : + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS c-strtold.$ac_objext" + + + : - { $as_echo "$as_me:$LINENO: checking for GNU libc compatible calloc" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible calloc" >&5 $as_echo_n "checking for GNU libc compatible calloc... " >&6; } -if test "${ac_cv_func_calloc_0_nonnull+set}" = set; then +if test "${ac_cv_func_calloc_0_nonnull+set}" = set; then : $as_echo_n "(cached) " >&6 else - if test "$cross_compiling" = yes; then + if test "$cross_compiling" = yes; then : ac_cv_func_calloc_0_nonnull=no else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int @@ -17902,73 +15733,83 @@ exit (!calloc (0, 0) || calloc ((size_t) -1 / 8 + 1, 8)); return 0; } _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_calloc_0_nonnull=yes else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_func_calloc_0_nonnull=no + ac_cv_func_calloc_0_nonnull=no fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi - fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_calloc_0_nonnull" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_calloc_0_nonnull" >&5 $as_echo "$ac_cv_func_calloc_0_nonnull" >&6; } -if test $ac_cv_func_calloc_0_nonnull = yes; then +if test $ac_cv_func_calloc_0_nonnull = yes; then : -cat >>confdefs.h <<\_ACEOF -#define HAVE_CALLOC 1 -_ACEOF +$as_echo "#define HAVE_CALLOC 1" >>confdefs.h else - cat >>confdefs.h <<\_ACEOF -#define HAVE_CALLOC 0 -_ACEOF + $as_echo "#define HAVE_CALLOC 0" >>confdefs.h - gl_LIBOBJS="$gl_LIBOBJS calloc.$ac_objext" -cat >>confdefs.h <<\_ACEOF -#define calloc rpl_calloc -_ACEOF + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS calloc.$ac_objext" + + +$as_echo "#define calloc rpl_calloc" >>confdefs.h fi + if test $gl_cv_func_malloc_posix = yes; then + HAVE_CALLOC_POSIX=1 + +$as_echo "#define HAVE_CALLOC_POSIX 1" >>confdefs.h + + else + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS calloc.$ac_objext" + + HAVE_CALLOC_POSIX=0 + fi + + + + + GNULIB_CALLOC_POSIX=1 + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS canon-host.$ac_objext" + : - gl_LIBOBJS="$gl_LIBOBJS canonicalize.$ac_objext" @@ -17977,6 +15818,7 @@ fi + gl_LIBOBJS="$gl_LIBOBJS canonicalize.$ac_objext" @@ -17985,28 +15827,16 @@ fi +$as_echo "#define GNULIB_CANONICALIZE 1" >>confdefs.h - - - -cat >>confdefs.h <<\_ACEOF -#define GNULIB_CANONICALIZE 1 -_ACEOF - - - - { $as_echo "$as_me:$LINENO: checking whether this system has an arbitrary file name length limit" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether this system has an arbitrary file name length limit" >&5 $as_echo_n "checking whether this system has an arbitrary file name length limit... " >&6; } -if test "${gl_cv_have_arbitrary_file_name_length_limit+set}" = set; then +if test "${gl_cv_have_arbitrary_file_name_length_limit+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include @@ -18015,7 +15845,7 @@ have_arbitrary_file_name_length_limit #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "have_arbitrary_file_name_length_limit" >/dev/null 2>&1; then + $EGREP "have_arbitrary_file_name_length_limit" >/dev/null 2>&1; then : gl_cv_have_arbitrary_file_name_length_limit=yes else gl_cv_have_arbitrary_file_name_length_limit=no @@ -18023,11 +15853,20 @@ fi rm -f conftest* fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_have_arbitrary_file_name_length_limit" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_arbitrary_file_name_length_limit" >&5 $as_echo "$gl_cv_have_arbitrary_file_name_length_limit" >&6; } if test $gl_cv_have_arbitrary_file_name_length_limit = yes; then - gl_LIBOBJS="$gl_LIBOBJS chdir-long.$ac_objext" + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS chdir-long.$ac_objext" + : @@ -18041,9 +15880,7 @@ $as_echo "$gl_cv_have_arbitrary_file_name_length_limit" >&6; } if test $ac_cv_func_chown_works = no; then -cat >>confdefs.h <<\_ACEOF -#define CHOWN_FAILS_TO_HONOR_ID_OF_NEGATIVE_ONE 1 -_ACEOF +$as_echo "#define CHOWN_FAILS_TO_HONOR_ID_OF_NEGATIVE_ONE 1" >>confdefs.h fi @@ -18052,94 +15889,31 @@ _ACEOF : # no wrapper needed else REPLACE_CHOWN=1 - gl_LIBOBJS="$gl_LIBOBJS chown.$ac_objext" - { $as_echo "$as_me:$LINENO: checking for fchown" >&5 -$as_echo_n "checking for fchown... " >&6; } -if test "${ac_cv_func_fchown+set}" = set; then - $as_echo_n "(cached) " >&6 + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS chown.$ac_objext" + + + ac_fn_c_check_func "$LINENO" "fchown" "ac_cv_func_fchown" +if test "x$ac_cv_func_fchown" = x""yes; then : + else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define fchown to an innocuous variant, in case declares fchown. - For example, HP-UX 11i declares gettimeofday. */ -#define fchown innocuous_fchown -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char fchown (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ -#ifdef __STDC__ -# include -#else -# include -#endif -#undef fchown -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char fchown (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_fchown || defined __stub___fchown -choke me -#endif -int -main () -{ -return fchown (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_func_fchown=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_func_fchown=no -fi -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_fchown" >&5 -$as_echo "$ac_cv_func_fchown" >&6; } -if test $ac_cv_func_fchown = yes; then - : -else + gl_LIBOBJS="$gl_LIBOBJS fchown-stub.$ac_objext" + fi @@ -18159,17 +15933,13 @@ fi # programs in the package would end up linked with that potentially-shared # library, inducing unnecessary run-time overhead. gl_saved_libs=$LIBS - { $as_echo "$as_me:$LINENO: checking for library containing clock_gettime" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing clock_gettime" >&5 $as_echo_n "checking for library containing clock_gettime... " >&6; } -if test "${ac_cv_search_clock_gettime+set}" = set; then +if test "${ac_cv_search_clock_gettime+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. @@ -18194,148 +15964,39 @@ for ac_lib in '' rt posix4; do ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi - rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_clock_gettime=$ac_res -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext - if test "${ac_cv_search_clock_gettime+set}" = set; then +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if test "${ac_cv_search_clock_gettime+set}" = set; then : break fi done -if test "${ac_cv_search_clock_gettime+set}" = set; then - : +if test "${ac_cv_search_clock_gettime+set}" = set; then : + else ac_cv_search_clock_gettime=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_clock_gettime" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_clock_gettime" >&5 $as_echo "$ac_cv_search_clock_gettime" >&6; } ac_res=$ac_cv_search_clock_gettime -if test "$ac_res" != no; then +if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" test "$ac_cv_search_clock_gettime" = "none required" || LIB_CLOCK_GETTIME=$ac_cv_search_clock_gettime fi - - -for ac_func in clock_gettime clock_settime -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if test `eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` = yes; then + for ac_func in clock_gettime clock_settime +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +eval as_val=\$$as_ac_var + if test "x$as_val" = x""yes; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF @@ -18346,106 +16007,264 @@ done LIBS=$gl_saved_libs + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS cloexec.$ac_objext" + + + + + + + if test $ac_cv_header_sys_socket_h != yes; then + for ac_header in winsock2.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default" +if test "x$ac_cv_header_winsock2_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_WINSOCK2_H 1 +_ACEOF + +fi + +done + + fi + if test "$ac_cv_header_winsock2_h" = yes; then + HAVE_WINSOCK2_H=1 + UNISTD_H_HAVE_WINSOCK2_H=1 + SYS_IOCTL_H_HAVE_WINSOCK2_H=1 + else + HAVE_WINSOCK2_H=0 + fi + + + if test $UNISTD_H_HAVE_WINSOCK2_H = 1; then + + + if test $REPLACE_CLOSE != 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS close.$ac_objext" + + fi + REPLACE_CLOSE=1 + + + if test $REPLACE_FCLOSE != 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS fclose.$ac_objext" + + fi + REPLACE_FCLOSE=1 + + + fi + + + + + GNULIB_CLOSE=1 + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS close-stream.$ac_objext" + : -cat >>confdefs.h <<\_ACEOF -#define GNULIB_CLOSE_STREAM 1 -_ACEOF +$as_echo "#define GNULIB_CLOSE_STREAM 1" >>confdefs.h + + + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS closein.$ac_objext" + + + : + + + + + + + gl_LIBOBJS="$gl_LIBOBJS closeout.$ac_objext" + : + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS md5.$ac_objext" + + + + + : + + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS sha1.$ac_objext" + + + + + : + + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS sha256.$ac_objext" + + + + + + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS sha512.$ac_objext" + + + + + + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS cycle-check.$ac_objext" - { $as_echo "$as_me:$LINENO: checking for d_ino member in directory struct" >&5 + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for d_ino member in directory struct" >&5 $as_echo_n "checking for d_ino member in directory struct... " >&6; } -if test "${jm_cv_struct_dirent_d_ino+set}" = set; then +if test "${gl_cv_struct_dirent_d_ino+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + if test "$cross_compiling" = yes; then : + gl_cv_struct_dirent_d_ino=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - #include -#include + #include + #include int main () { -struct dirent dp; dp.d_ino = 0; +DIR *dp = opendir ("."); + struct dirent *e; + struct stat st; + if (! dp) + return 1; + e = readdir (dp); + return ! (e + && stat (e->d_name, &st) == 0 + && e->d_ino == st.st_ino); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - jm_cv_struct_dirent_d_ino=yes +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_struct_dirent_d_ino=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - jm_cv_struct_dirent_d_ino=no + gl_cv_struct_dirent_d_ino=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext - - fi -{ $as_echo "$as_me:$LINENO: result: $jm_cv_struct_dirent_d_ino" >&5 -$as_echo "$jm_cv_struct_dirent_d_ino" >&6; } - if test $jm_cv_struct_dirent_d_ino = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_struct_dirent_d_ino" >&5 +$as_echo "$gl_cv_struct_dirent_d_ino" >&6; } + if test $gl_cv_struct_dirent_d_ino = yes; then -cat >>confdefs.h <<\_ACEOF -#define D_INO_IN_DIRENT 1 -_ACEOF +$as_echo "#define D_INO_IN_DIRENT 1" >>confdefs.h fi - { $as_echo "$as_me:$LINENO: checking for d_type member in directory struct" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for d_type member in directory struct" >&5 $as_echo_n "checking for d_type member in directory struct... " >&6; } -if test "${jm_cv_struct_dirent_d_type+set}" = set; then +if test "${gl_cv_struct_dirent_d_type+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -18459,45 +16278,21 @@ struct dirent dp; dp.d_type = 0; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - jm_cv_struct_dirent_d_type=yes +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_struct_dirent_d_type=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - jm_cv_struct_dirent_d_type=no + gl_cv_struct_dirent_d_type=no fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $jm_cv_struct_dirent_d_type" >&5 -$as_echo "$jm_cv_struct_dirent_d_type" >&6; } - if test $jm_cv_struct_dirent_d_type = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_struct_dirent_d_type" >&5 +$as_echo "$gl_cv_struct_dirent_d_type" >&6; } + if test $gl_cv_struct_dirent_d_type = yes; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_STRUCT_DIRENT_D_TYPE 1 -_ACEOF +$as_echo "#define HAVE_STRUCT_DIRENT_D_TYPE 1" >>confdefs.h fi @@ -18506,184 +16301,96 @@ _ACEOF -for ac_func in dirfd -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_dirent_h='<'dirent.h'>' + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +$as_echo_n "checking absolute name of ... " >&6; } +if test "${gl_cv_next_dirent_h+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + + if test $ac_cv_header_dirent_h = yes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func +#include -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + gl_cv_next_dirent_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n '\#/dirent.h#{ + s#.*"\(.*/dirent.h\)".*#\1# + s#^/[^/]#//&# + p + q + }'`'"' + else + gl_cv_next_dirent_h='<'dirent.h'>' + fi - eval "$as_ac_var=no" fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_dirent_h" >&5 +$as_echo "$gl_cv_next_dirent_h" >&6; } + fi + NEXT_DIRENT_H=$gl_cv_next_dirent_h -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if test `eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` = yes; then + + + + + + + + DIRENT_H='dirent.h' + + + + + + + + for ac_func in dirfd +do : + ac_fn_c_check_func "$LINENO" "dirfd" "ac_cv_func_dirfd" +if test "x$ac_cv_func_dirfd" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define HAVE_DIRFD 1 _ACEOF fi done - { $as_echo "$as_me:$LINENO: checking whether dirfd is declared" >&5 -$as_echo_n "checking whether dirfd is declared... " >&6; } -if test "${ac_cv_have_decl_dirfd+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include + ac_fn_c_check_decl "$LINENO" "dirfd" "ac_cv_have_decl_dirfd" "#include #include - -int -main () -{ -#ifndef dirfd - (void) dirfd; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_dirfd=yes +" +if test "x$ac_cv_have_decl_dirfd" = x""yes; then : + ac_have_decl=1 else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_dirfd=no + ac_have_decl=0 fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_dirfd" >&5 -$as_echo "$ac_cv_have_decl_dirfd" >&6; } -if test $ac_cv_have_decl_dirfd = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_DIRFD 1 +#define HAVE_DECL_DIRFD $ac_have_decl _ACEOF + if test $ac_cv_have_decl_dirfd = no; then + HAVE_DECL_DIRFD=0 + fi -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_DIRFD 0 -_ACEOF - - -fi - - - - { $as_echo "$as_me:$LINENO: checking whether dirfd is a macro" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether dirfd is a macro" >&5 $as_echo_n "checking whether dirfd is a macro... " >&6; } -if test "${gl_cv_func_dirfd_macro+set}" = set; then +if test "${gl_cv_func_dirfd_macro+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -18693,7 +16400,7 @@ cat >>conftest.$ac_ext <<_ACEOF #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "dirent_header_defines_dirfd" >/dev/null 2>&1; then + $EGREP "dirent_header_defines_dirfd" >/dev/null 2>&1; then : gl_cv_func_dirfd_macro=yes else gl_cv_func_dirfd_macro=no @@ -18701,7 +16408,7 @@ fi rm -f conftest* fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_dirfd_macro" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_dirfd_macro" >&5 $as_echo "$gl_cv_func_dirfd_macro" >&6; } # Use the replacement only if we have no function, macro, @@ -18709,107 +16416,32 @@ $as_echo "$gl_cv_func_dirfd_macro" >&6; } if test $ac_cv_func_dirfd,$ac_cv_have_decl_dirfd,$gl_cv_func_dirfd_macro \ = no,no,no; then -for ac_func in dirfd -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ -#ifdef __STDC__ -# include -#else -# include -#endif -#undef $ac_func -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - eval "$as_ac_var=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if test `eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` = yes; then + for ac_func in dirfd +do : + ac_fn_c_check_func "$LINENO" "dirfd" "ac_cv_func_dirfd" +if test "x$ac_cv_func_dirfd" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define HAVE_DIRFD 1 _ACEOF else - gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" + + gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" + fi done - { $as_echo "$as_me:$LINENO: checking how to get the file descriptor associated with an open DIR*" >&5 + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to get the file descriptor associated with an open DIR*" >&5 $as_echo_n "checking how to get the file descriptor associated with an open DIR*... " >&6; } -if test "${gl_cv_sys_dir_fd_member_name+set}" = set; then +if test "${gl_cv_sys_dir_fd_member_name+set}" = set; then : $as_echo_n "(cached) " >&6 else @@ -18817,11 +16449,7 @@ else for ac_expr in d_fd dd_fd; do CFLAGS="$CFLAGS -DDIR_FD_MEMBER_NAME=$ac_expr" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include @@ -18833,33 +16461,10 @@ DIR *dir_p = opendir("."); (void) dir_p->DIR_FD_MEMBER_NAME; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : dir_fd_found=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS=$dirfd_save_CFLAGS test "$dir_fd_found" = yes && break @@ -18870,7 +16475,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_sys_dir_fd_member_name" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_dir_fd_member_name" >&5 $as_echo "$gl_cv_sys_dir_fd_member_name" >&6; } if test $gl_cv_sys_dir_fd_member_name != no_such_member; then @@ -18880,12 +16485,41 @@ _ACEOF fi - fi + + GNULIB_DIRFD=1 + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS basename.$ac_objext" + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS dirname.$ac_objext" + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS stripslash.$ac_objext" @@ -18894,9 +16528,10 @@ _ACEOF - { $as_echo "$as_me:$LINENO: checking whether // is distinct from /" >&5 + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether // is distinct from /" >&5 $as_echo_n "checking whether // is distinct from /... " >&6; } -if test "${gl_cv_double_slash_root+set}" = set; then +if test "${gl_cv_double_slash_root+set}" = set; then : $as_echo_n "(cached) " >&6 else if test x"$cross_compiling" = xyes ; then @@ -18915,35 +16550,37 @@ else gl_cv_double_slash_root='unknown, assuming no' ;; esac else - set x `ls -di / //` - if test $2 = $4 && wc //dev/null >/dev/null 2>&1; then + set x `ls -di / // 2>/dev/null` + if test "$2" = "$4" && wc //dev/null >/dev/null 2>&1; then gl_cv_double_slash_root=no else gl_cv_double_slash_root=yes fi fi fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_double_slash_root" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_double_slash_root" >&5 $as_echo "$gl_cv_double_slash_root" >&6; } if test "$gl_cv_double_slash_root" = yes; then -cat >>confdefs.h <<\_ACEOF -#define DOUBLE_SLASH_IS_DISTINCT_ROOT 1 -_ACEOF +$as_echo "#define DOUBLE_SLASH_IS_DISTINCT_ROOT 1" >>confdefs.h fi - - - - - if test $ac_cv_func_dup2 = no; then HAVE_DUP2=0 - gl_LIBOBJS="$gl_LIBOBJS dup2.$ac_objext" + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS dup2.$ac_objext" + fi @@ -18951,16 +16588,73 @@ _ACEOF GNULIB_DUP2=1 - { $as_echo "$as_me:$LINENO: checking for error_at_line" >&5 -$as_echo_n "checking for error_at_line... " >&6; } -if test "${ac_cv_lib_error_at_line+set}" = set; then + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if environ is properly declared" >&5 +$as_echo_n "checking if environ is properly declared... " >&6; } + if test "${gt_cv_var_environ_declaration+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + extern struct { int foo; } environ; +int +main () +{ +environ.foo = 1; + ; + return 0; +} _ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gt_cv_var_environ_declaration=no +else + gt_cv_var_environ_declaration=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_var_environ_declaration" >&5 +$as_echo "$gt_cv_var_environ_declaration" >&6; } + if test $gt_cv_var_environ_declaration = yes; then + +$as_echo "#define HAVE_ENVIRON_DECL 1" >>confdefs.h + + fi + + + if test $gt_cv_var_environ_declaration != yes; then + HAVE_DECL_ENVIRON=0 + fi + + + + GNULIB_ENVIRON=1 + + + + + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for error_at_line" >&5 +$as_echo_n "checking for error_at_line... " >&6; } +if test "${ac_cv_lib_error_at_line+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int @@ -18971,40 +16665,27 @@ error_at_line (0, 0, "", 0, "an error occurred"); return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_error_at_line=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_error_at_line=no + ac_cv_lib_error_at_line=no fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_error_at_line" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_error_at_line" >&5 $as_echo "$ac_cv_lib_error_at_line" >&6; } if test $ac_cv_lib_error_at_line = no; then + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS error.$ac_objext" + fi @@ -19014,119 +16695,43 @@ fi + XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=error:3:c-format" + + + + XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=error_at_line:5:c-format" -for ac_func in euidaccess -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ -#ifdef __STDC__ -# include -#else -# include -#endif -#undef $ac_func -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - eval "$as_ac_var=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if test `eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` = yes; then + + for ac_func in euidaccess +do : + ac_fn_c_check_func "$LINENO" "euidaccess" "ac_cv_func_euidaccess" +if test "x$ac_cv_func_euidaccess" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define HAVE_EUIDACCESS 1 _ACEOF else - gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" + + gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" + fi done + if test $ac_cv_func_euidaccess = no; then - - - - - - - - + HAVE_EUIDACCESS=0 @@ -19137,17 +16742,13 @@ done # programs in the package would end up linked with that potentially-shared # library, inducing unnecessary run-time overhead. gl_saved_libs=$LIBS - { $as_echo "$as_me:$LINENO: checking for library containing eaccess" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing eaccess" >&5 $as_echo_n "checking for library containing eaccess... " >&6; } -if test "${ac_cv_search_eaccess+set}" = set; then +if test "${ac_cv_search_eaccess+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. @@ -19172,149 +16773,39 @@ for ac_lib in '' gen; do ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi - rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_eaccess=$ac_res -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext - if test "${ac_cv_search_eaccess+set}" = set; then +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if test "${ac_cv_search_eaccess+set}" = set; then : break fi done -if test "${ac_cv_search_eaccess+set}" = set; then - : +if test "${ac_cv_search_eaccess+set}" = set; then : + else ac_cv_search_eaccess=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_eaccess" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_eaccess" >&5 $as_echo "$ac_cv_search_eaccess" >&6; } ac_res=$ac_cv_search_eaccess -if test "$ac_res" != no; then +if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" test "$ac_cv_search_eaccess" = "none required" || LIB_EACCESS=$ac_cv_search_eaccess fi - -for ac_func in eaccess -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if test `eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` = yes; then + for ac_func in eaccess +do : + ac_fn_c_check_func "$LINENO" "eaccess" "ac_cv_func_eaccess" +if test "x$ac_cv_func_eaccess" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define HAVE_EACCESS 1 _ACEOF fi @@ -19325,87 +16816,135 @@ done fi + + GNULIB_EUIDACCESS=1 + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS exclude.$ac_objext" + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS exitfail.$ac_objext" + : - - - - if test $ac_cv_func_fchdir = no; then REPLACE_FCHDIR=1 - gl_LIBOBJS="$gl_LIBOBJS fchdir.$ac_objext" + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS fchdir.$ac_objext" + : -cat >>confdefs.h <<\_ACEOF -#define FCHDIR_REPLACEMENT 1 -_ACEOF +$as_echo "#define FCHDIR_REPLACEMENT 1" >>confdefs.h - { $as_echo "$as_me:$LINENO: checking absolute name of " >&5 -$as_echo_n "checking absolute name of ... " >&6; } -if test "${gl_cv_absolute_dirent_h+set}" = set; then - $as_echo_n "(cached) " >&6 -else + + + if test $REPLACE_OPEN != 1; then - if test $ac_cv_header_dirent_h = yes; then - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF - gl_cv_absolute_dirent_h=`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | -sed -n '\#/dirent.h#{s#.*"\(.*/dirent.h\)".*#\1#;s#^/[^/]#//&#;p;q;}'` - fi - -fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_absolute_dirent_h" >&5 -$as_echo "$gl_cv_absolute_dirent_h" >&6; } -cat >>confdefs.h <<_ACEOF -#define ABSOLUTE_DIRENT_H "$gl_cv_absolute_dirent_h" -_ACEOF - ABSOLUTE_DIRENT_H=\"$gl_cv_absolute_dirent_h\" - DIRENT_H='dirent.h' - else - DIRENT_H= + + gl_LIBOBJS="$gl_LIBOBJS open.$ac_objext" + + + + : + fi + REPLACE_OPEN=1 + if test $REPLACE_CLOSE != 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS close.$ac_objext" + + fi + REPLACE_CLOSE=1 + + + if test $REPLACE_FCLOSE != 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS fclose.$ac_objext" + + fi + REPLACE_FCLOSE=1 + + + + + DIRENT_H='dirent.h' + + fi + GNULIB_FCHDIR=1 - { $as_echo "$as_me:$LINENO: checking for working fcntl.h" >&5 + + + + GNULIB_FCLOSE=1 + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working fcntl.h" >&5 $as_echo_n "checking for working fcntl.h... " >&6; } -if test "${gl_cv_header_working_fcntl_h+set}" = set; then +if test "${gl_cv_header_working_fcntl_h+set}" = set; then : $as_echo_n "(cached) " >&6 else - if test "$cross_compiling" = yes; then + if test "$cross_compiling" = yes; then : gl_cv_header_working_fcntl_h=cross-compiling else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include @@ -19453,48 +16992,22 @@ main () return 0; } _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_run "$LINENO"; then : gl_cv_header_working_fcntl_h=yes else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -case $? in #( + case $? in #( 32) gl_cv_header_working_fcntl_h='no (bad O_NOFOLLOW)';; #( 64) gl_cv_header_working_fcntl_h='no (bad O_NOATIME)';; #( 96) gl_cv_header_working_fcntl_h='no (bad O_NOATIME, O_NOFOLLOW)';; #( *) gl_cv_header_working_fcntl_h='no';; esac fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi - fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_header_working_fcntl_h" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_working_fcntl_h" >&5 $as_echo "$gl_cv_header_working_fcntl_h" >&6; } case $gl_cv_header_working_fcntl_h in #( @@ -19517,182 +17030,243 @@ cat >>confdefs.h <<_ACEOF _ACEOF - { $as_echo "$as_me:$LINENO: checking absolute name of " >&5 + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_fcntl_h='<'fcntl.h'>' + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 $as_echo_n "checking absolute name of ... " >&6; } -if test "${gl_cv_absolute_fcntl_h+set}" = set; then +if test "${gl_cv_next_fcntl_h+set}" = set; then : $as_echo_n "(cached) " >&6 else - - - - - if test $ac_cv_header_fcntl_h = yes; then - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + if test $ac_cv_header_fcntl_h = yes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include + _ACEOF - gl_cv_absolute_fcntl_h=`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | -sed -n '\#/fcntl.h#{s#.*"\(.*/fcntl.h\)".*#\1#;s#^/[^/]#//&#;p;q;}'` - fi + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + gl_cv_next_fcntl_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n '\#/fcntl.h#{ + s#.*"\(.*/fcntl.h\)".*#\1# + s#^/[^/]#//&# + p + q + }'`'"' + else + gl_cv_next_fcntl_h='<'fcntl.h'>' + fi fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_absolute_fcntl_h" >&5 -$as_echo "$gl_cv_absolute_fcntl_h" >&6; } -cat >>confdefs.h <<_ACEOF -#define ABSOLUTE_FCNTL_H "$gl_cv_absolute_fcntl_h" -_ACEOF +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_fcntl_h" >&5 +$as_echo "$gl_cv_next_fcntl_h" >&6; } + fi + NEXT_FCNTL_H=$gl_cv_next_fcntl_h - ABSOLUTE_FCNTL_H=\"$gl_cv_absolute_fcntl_h\" FCNTL_H='fcntl.h' + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS open-safer.$ac_objext" + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS creat-safer.$ac_objext" -cat >>confdefs.h <<\_ACEOF -#define GNULIB_FCNTL_SAFER 1 + +$as_echo "#define GNULIB_FCNTL_SAFER 1" >>confdefs.h + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fflush works on input streams" >&5 +$as_echo_n "checking whether fflush works on input streams... " >&6; } +if test "${gl_cv_func_fflush_stdin+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + echo hello world > conftest.txt + if test "$cross_compiling" = yes; then : + gl_cv_func_fflush_stdin=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include + +int +main () +{ +FILE *f = fopen ("conftest.txt", "r"); + char buffer[10]; + int fd; + int c; + if (f == NULL) + return 1; + fd = fileno (f); + if (fd < 0 || fread (buffer, 1, 5, f) != 5) + return 2; + /* For deterministic results, ensure f read a bigger buffer. */ + if (lseek (fd, 0, SEEK_CUR) == 5) + return 3; + /* POSIX requires fflush-fseek to set file offset of fd. This fails + on BSD systems and on mingw. */ + if (fflush (f) != 0 || fseek (f, 0, SEEK_CUR) != 0) + return 4; + if (lseek (fd, 0, SEEK_CUR) != 5) + return 5; + /* Verify behaviour of fflush after ungetc. See + */ + /* Verify behaviour of fflush after a backup ungetc. This fails on + mingw. */ + c = fgetc (f); + ungetc (c, f); + fflush (f); + if (fgetc (f) != c) + return 6; + /* Verify behaviour of fflush after a non-backup ungetc. This fails + on glibc 2.8 and on BSD systems. */ + c = fgetc (f); + ungetc ('@', f); + fflush (f); + if (fgetc (f) != c) + return 7; + return 0; + + ; + return 0; +} _ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_fflush_stdin=yes +else + gl_cv_func_fflush_stdin=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi + + rm conftest.txt + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fflush_stdin" >&5 +$as_echo "$gl_cv_func_fflush_stdin" >&6; } + if test $gl_cv_func_fflush_stdin = no; then + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS fflush.$ac_objext" + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS fseeko.$ac_objext" + + + REPLACE_FFLUSH=1 + REPLACE_FSEEKO=1 + + + : + + + fi + + + + GNULIB_FFLUSH=1 + + + + + + + gl_LIBOBJS="$gl_LIBOBJS file-type.$ac_objext" - { $as_echo "$as_me:$LINENO: checking for struct stat.st_blocks" >&5 -$as_echo_n "checking for struct stat.st_blocks... " >&6; } -if test "${ac_cv_member_struct_stat_st_blocks+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static struct stat ac_aggr; -if (ac_aggr.st_blocks) -return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_member_struct_stat_st_blocks=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static struct stat ac_aggr; -if (sizeof ac_aggr.st_blocks) -return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_member_struct_stat_st_blocks=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_member_struct_stat_st_blocks=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_blocks" >&5 -$as_echo "$ac_cv_member_struct_stat_st_blocks" >&6; } -if test $ac_cv_member_struct_stat_st_blocks = yes; then + ac_fn_c_check_member "$LINENO" "struct stat" "st_blocks" "ac_cv_member_struct_stat_st_blocks" "$ac_includes_default" +if test "x$ac_cv_member_struct_stat_st_blocks" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_STAT_ST_BLOCKS 1 _ACEOF -cat >>confdefs.h <<\_ACEOF -#define HAVE_ST_BLOCKS 1 -_ACEOF +$as_echo "#define HAVE_ST_BLOCKS 1" >>confdefs.h else + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS fileblocks.$ac_objext" + fi if test $ac_cv_member_struct_stat_st_blocks = no; then - - - - - : fi + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS filemode.$ac_objext" @@ -19700,26 +17274,24 @@ fi + + + + + + gl_LIBOBJS="$gl_LIBOBJS filenamecat.$ac_objext" - - - - - { $as_echo "$as_me:$LINENO: checking for flexible array member" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for flexible array member" >&5 $as_echo_n "checking for flexible array member... " >&6; } -if test "${ac_cv_c_flexmember+set}" = set; then +if test "${ac_cv_c_flexmember+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include @@ -19737,503 +17309,298 @@ int m = getchar (); return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_flexmember=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_c_flexmember=no + ac_cv_c_flexmember=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_flexmember" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_flexmember" >&5 $as_echo "$ac_cv_c_flexmember" >&6; } if test $ac_cv_c_flexmember = yes; then -cat >>confdefs.h <<\_ACEOF -#define FLEXIBLE_ARRAY_MEMBER -_ACEOF +$as_echo "#define FLEXIBLE_ARRAY_MEMBER /**/" >>confdefs.h else - cat >>confdefs.h <<\_ACEOF -#define FLEXIBLE_ARRAY_MEMBER 1 -_ACEOF + $as_echo "#define FLEXIBLE_ARRAY_MEMBER 1" >>confdefs.h fi - # No macro. You should also use one of fnmatch-posix or fnmatch-gnu. + + + + FLOAT_H= + case "$host_os" in + beos* | openbsd*) + FLOAT_H=float.h + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_float_h='<'float.h'>' + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +$as_echo_n "checking absolute name of ... " >&6; } +if test "${gl_cv_next_float_h+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + if test $ac_cv_header_float_h = yes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + gl_cv_next_float_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n '\#/float.h#{ + s#.*"\(.*/float.h\)".*#\1# + s#^/[^/]#//&# + p + q + }'`'"' + else + gl_cv_next_float_h='<'float.h'>' + fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_float_h" >&5 +$as_echo "$gl_cv_next_float_h" >&6; } + fi + NEXT_FLOAT_H=$gl_cv_next_float_h + + + + ;; + esac + + + + FNMATCH_H= - { $as_echo "$as_me:$LINENO: checking for working GNU fnmatch" >&5 -$as_echo_n "checking for working GNU fnmatch... " >&6; } -if test "${ac_cv_func_fnmatch_gnu+set}" = set; then + gl_fnmatch_required_lowercase=`echo $gl_fnmatch_required | tr 'A-Z' 'a-z'` + gl_fnmatch_cache_var="gl_cv_func_fnmatch_${gl_fnmatch_required_lowercase}" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working $gl_fnmatch_required fnmatch" >&5 +$as_echo_n "checking for working $gl_fnmatch_required fnmatch... " >&6; } +if { as_var=$gl_fnmatch_cache_var; eval "test \"\${$as_var+set}\" = set"; }; then : $as_echo_n "(cached) " >&6 else - if test "$cross_compiling" = yes; then - ac_cv_func_fnmatch_gnu=cross + if test $gl_fnmatch_required = GNU; then + gl_fnmatch_gnu_start= + gl_fnmatch_gnu_end= + else + gl_fnmatch_gnu_start='#if 0' + gl_fnmatch_gnu_end='#endif' + fi + if test "$cross_compiling" = yes; then : + eval "$gl_fnmatch_cache_var=\"guessing no\"" else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include - static int - y (char const *pattern, char const *string, int flags) - { - return fnmatch (pattern, string, flags) == 0; - } - static int - n (char const *pattern, char const *string, int flags) - { - return fnmatch (pattern, string, flags) == FNM_NOMATCH; - } + static int + y (char const *pattern, char const *string, int flags) + { + return fnmatch (pattern, string, flags) == 0; + } + static int + n (char const *pattern, char const *string, int flags) + { + return fnmatch (pattern, string, flags) == FNM_NOMATCH; + } int main () { char const *Apat = 'A' < '\\\\' ? "[A-\\\\\\\\]" : "[\\\\\\\\-A]"; - char const *apat = 'a' < '\\\\' ? "[a-\\\\\\\\]" : "[\\\\\\\\-a]"; - static char const A_1[] = { 'A' - 1, 0 }; - static char const A01[] = { 'A' + 1, 0 }; - static char const a_1[] = { 'a' - 1, 0 }; - static char const a01[] = { 'a' + 1, 0 }; - static char const bs_1[] = { '\\\\' - 1, 0 }; - static char const bs01[] = { '\\\\' + 1, 0 }; - return - !(n ("a*", "", 0) - && y ("a*", "abc", 0) - && n ("d*/*1", "d/s/1", FNM_PATHNAME) - && y ("a\\\\bc", "abc", 0) - && n ("a\\\\bc", "abc", FNM_NOESCAPE) - && y ("*x", ".x", 0) - && n ("*x", ".x", FNM_PERIOD) - && y (Apat, "\\\\", 0) && y (Apat, "A", 0) - && y (apat, "\\\\", 0) && y (apat, "a", 0) - && n (Apat, A_1, 0) == ('A' < '\\\\') - && n (apat, a_1, 0) == ('a' < '\\\\') - && y (Apat, A01, 0) == ('A' < '\\\\') - && y (apat, a01, 0) == ('a' < '\\\\') - && y (Apat, bs_1, 0) == ('A' < '\\\\') - && y (apat, bs_1, 0) == ('a' < '\\\\') - && n (Apat, bs01, 0) == ('A' < '\\\\') - && n (apat, bs01, 0) == ('a' < '\\\\') - && y ("xxXX", "xXxX", FNM_CASEFOLD) - && y ("a++(x|yy)b", "a+xyyyyxb", FNM_EXTMATCH) - && n ("d*/*1", "d/s/1", FNM_FILE_NAME) - && y ("*", "x", FNM_FILE_NAME | FNM_LEADING_DIR) - && y ("x*", "x/y/z", FNM_FILE_NAME | FNM_LEADING_DIR) - && y ("*c*", "c/x", FNM_FILE_NAME | FNM_LEADING_DIR)); - ; - return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_fnmatch_gnu=yes -else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_func_fnmatch_gnu=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi - - -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_fnmatch_gnu" >&5 -$as_echo "$ac_cv_func_fnmatch_gnu" >&6; } -if test $ac_cv_func_fnmatch_gnu = yes; then - rm -f lib/fnmatch.h -else - { $as_echo "$as_me:$LINENO: checking whether isblank is declared" >&5 -$as_echo_n "checking whether isblank is declared... " >&6; } -if test "${ac_cv_have_decl_isblank+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -int -main () -{ -#ifndef isblank - (void) isblank; -#endif + char const *apat = 'a' < '\\\\' ? "[a-\\\\\\\\]" : "[\\\\\\\\-a]"; + static char const A_1[] = { 'A' - 1, 0 }; + static char const A01[] = { 'A' + 1, 0 }; + static char const a_1[] = { 'a' - 1, 0 }; + static char const a01[] = { 'a' + 1, 0 }; + static char const bs_1[] = { '\\\\' - 1, 0 }; + static char const bs01[] = { '\\\\' + 1, 0 }; + return + !(n ("a*", "", 0) + && y ("a*", "abc", 0) + && n ("d*/*1", "d/s/1", FNM_PATHNAME) + && y ("a\\\\bc", "abc", 0) + && n ("a\\\\bc", "abc", FNM_NOESCAPE) + && y ("*x", ".x", 0) + && n ("*x", ".x", FNM_PERIOD) + && y (Apat, "\\\\", 0) && y (Apat, "A", 0) + && y (apat, "\\\\", 0) && y (apat, "a", 0) + && n (Apat, A_1, 0) == ('A' < '\\\\') + && n (apat, a_1, 0) == ('a' < '\\\\') + && y (Apat, A01, 0) == ('A' < '\\\\') + && y (apat, a01, 0) == ('a' < '\\\\') + && y (Apat, bs_1, 0) == ('A' < '\\\\') + && y (apat, bs_1, 0) == ('a' < '\\\\') + && n (Apat, bs01, 0) == ('A' < '\\\\') + && n (apat, bs01, 0) == ('a' < '\\\\') + $gl_fnmatch_gnu_start + && y ("xxXX", "xXxX", FNM_CASEFOLD) + && y ("a++(x|yy)b", "a+xyyyyxb", FNM_EXTMATCH) + && n ("d*/*1", "d/s/1", FNM_FILE_NAME) + && y ("*", "x", FNM_FILE_NAME | FNM_LEADING_DIR) + && y ("x*", "x/y/z", FNM_FILE_NAME | FNM_LEADING_DIR) + && y ("*c*", "c/x", FNM_FILE_NAME | FNM_LEADING_DIR) + $gl_fnmatch_gnu_end + ); ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_isblank=yes +if ac_fn_c_try_run "$LINENO"; then : + eval "$gl_fnmatch_cache_var=yes" else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_isblank=no + eval "$gl_fnmatch_cache_var=no" +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_isblank" >&5 -$as_echo "$ac_cv_have_decl_isblank" >&6; } -if test $ac_cv_have_decl_isblank = yes; then +eval ac_res=\$$gl_fnmatch_cache_var + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval "gl_fnmatch_result=\"\$$gl_fnmatch_cache_var\"" + if test "$gl_fnmatch_result" = yes; then + rm -f "$gl_source_base/fnmatch.h" + else + FNMATCH_H=fnmatch.h + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS fnmatch.$ac_objext" + cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_ISBLANK 1 +#define fnmatch ${gl_fnmatch_required_lowercase}_fnmatch _ACEOF + ac_fn_c_check_decl "$LINENO" "isblank" "ac_cv_have_decl_isblank" "#include +" +if test "x$ac_cv_have_decl_isblank" = x""yes; then : + ac_have_decl=1 else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_ISBLANK 0 + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_ISBLANK $ac_have_decl _ACEOF -fi - - - - - - - - - - - - - - - - - - - - - - - - - - -gl_LIBOBJS="$gl_LIBOBJS fnmatch.$ac_objext" -FNMATCH_H=fnmatch.h - -fi - - - if test $ac_cv_func_fnmatch_gnu != yes; then - -cat >>confdefs.h <<\_ACEOF -#define fnmatch gnu_fnmatch -_ACEOF fi + + + + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS fopen-safer.$ac_objext" -cat >>confdefs.h <<\_ACEOF -#define GNULIB_FOPEN_SAFER 1 -_ACEOF + +$as_echo "#define GNULIB_FOPEN_SAFER 1" >>confdefs.h - - - - - -for ac_func in __fpending -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if test `eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -else - gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" -fi -done - fp_headers=' # include # if HAVE_STDIO_EXT_H # include # endif ' - { $as_echo "$as_me:$LINENO: checking whether __fpending is declared" >&5 -$as_echo_n "checking whether __fpending is declared... " >&6; } -if test "${ac_cv_have_decl___fpending+set}" = set; then - $as_echo_n "(cached) " >&6 + ac_fn_c_check_decl "$LINENO" "__fpending" "ac_cv_have_decl___fpending" "$fp_headers +" +if test "x$ac_cv_have_decl___fpending" = x""yes; then : + ac_have_decl=1 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$fp_headers - -int -main () -{ -#ifndef __fpending - (void) __fpending; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl___fpending=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl___fpending=no + ac_have_decl=0 fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl___fpending" >&5 -$as_echo "$ac_cv_have_decl___fpending" >&6; } -if test $ac_cv_have_decl___fpending = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL___FPENDING 1 +#define HAVE_DECL___FPENDING $ac_have_decl _ACEOF - -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL___FPENDING 0 -_ACEOF - - -fi - - if test $ac_cv_func___fpending = no; then - { $as_echo "$as_me:$LINENO: checking how to determine the number of pending output bytes on a stream" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to determine the number of pending output bytes on a stream" >&5 $as_echo_n "checking how to determine the number of pending output bytes on a stream... " >&6; } -if test "${ac_cv_sys_pending_output_n_bytes+set}" = set; then +if test "${ac_cv_sys_pending_output_n_bytes+set}" = set; then : $as_echo_n "(cached) " >&6 else - for ac_expr in \ - \ - '# glibc2' \ - 'fp->_IO_write_ptr - fp->_IO_write_base' \ - \ - '# traditional Unix' \ - 'fp->_ptr - fp->_base' \ - \ - '# BSD' \ - 'fp->_p - fp->_bf._base' \ - \ - '# SCO, Unixware' \ - '(fp->__ptr ? fp->__ptr - fp->__base : 0)' \ - \ - '# old glibc?' \ - 'fp->__bufp - fp->__buffer' \ - \ - '# old glibc iostream?' \ - 'fp->_pptr - fp->_pbase' \ - \ - '# VMS' \ - '(*fp)->_ptr - (*fp)->_base' \ - \ - '# e.g., DGUX R4.11; the info is not available' \ - 1 \ + for ac_expr in \ + \ + '# glibc2' \ + 'fp->_IO_write_ptr - fp->_IO_write_base' \ + \ + '# traditional Unix' \ + 'fp->_ptr - fp->_base' \ + \ + '# BSD' \ + 'fp->_p - fp->_bf._base' \ + \ + '# SCO, Unixware' \ + '(fp->__ptr ? fp->__ptr - fp->__base : 0)' \ + \ + '# QNX' \ + '(fp->_Mode & 0x2000 /*_MWRITE*/ ? fp->_Next - fp->_Buf : 0)' \ + \ + '# old glibc?' \ + 'fp->__bufp - fp->__buffer' \ + \ + '# old glibc iostream?' \ + 'fp->_pptr - fp->_pbase' \ + \ + '# emx+gcc' \ + 'fp->_ptr - fp->_buffer' \ + \ + '# VMS' \ + '(*fp)->_ptr - (*fp)->_base' \ + \ + '# e.g., DGUX R4.11; the info is not available' \ + 1 \ ; do # Skip each embedded comment. case "$ac_expr" in '#'*) continue;; esac - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -20245,33 +17612,10 @@ FILE *fp = stdin; (void) ($ac_expr); return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : fp_done=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext test "$fp_done" = yes && break done @@ -20280,156 +17624,450 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_sys_pending_output_n_bytes" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_pending_output_n_bytes" >&5 $as_echo "$ac_cv_sys_pending_output_n_bytes" >&6; } cat >>confdefs.h <<_ACEOF #define PENDING_OUTPUT_N_BYTES $ac_cv_sys_pending_output_n_bytes _ACEOF + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS fpending.$ac_objext" + fi + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS fprintftime.$ac_objext" - { $as_echo "$as_me:$LINENO: checking whether free (NULL) is known to work" >&5 -$as_echo_n "checking whether free (NULL) is known to work... " >&6; } -if test "${gl_cv_func_free+set}" = set; then + + + + ac_fn_c_check_decl "$LINENO" "fpurge" "ac_cv_have_decl_fpurge" "#include +" +if test "x$ac_cv_have_decl_fpurge" = x""yes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FPURGE $ac_have_decl +_ACEOF + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexp() can be used without linking with libm" >&5 +$as_echo_n "checking whether frexp() can be used without linking with libm... " >&6; } +if test "${gl_cv_func_frexp_no_libm+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include +#include + double x; int main () { -#if _POSIX_VERSION < 199009L && \ - (defined unix || defined _unix || defined _unix_ \ - || defined __unix || defined __unix__) - #error "'free (NULL)' is not known to work" - #endif +int e; return frexp (x, &e) > 0; ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - gl_cv_func_free=yes +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_func_frexp_no_libm=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - gl_cv_func_free=no + gl_cv_func_frexp_no_libm=no fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_free" >&5 -$as_echo "$gl_cv_func_free" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexp_no_libm" >&5 +$as_echo "$gl_cv_func_frexp_no_libm" >&6; } + if test $gl_cv_func_frexp_no_libm = yes; then - if test $gl_cv_func_free = no; then - gl_LIBOBJS="$gl_LIBOBJS free.$ac_objext" -cat >>confdefs.h <<\_ACEOF -#define free rpl_free + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexp works" >&5 +$as_echo_n "checking whether frexp works... " >&6; } +if test "${gl_cv_func_frexp_works+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + case "$host_os" in + netbsd* | irix* | mingw*) gl_cv_func_frexp_works="guessing no";; + *) gl_cv_func_frexp_works="guessing yes";; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +int main() +{ + int i; + volatile double x; +/* HP cc on HP-UX 10.20 has a bug with the constant expression -0.0. + So we use -zero instead. */ + double zero = 0.0; + /* Test on denormalized numbers. */ + for (i = 1, x = 1.0; i >= DBL_MIN_EXP; i--, x *= 0.5) + ; + if (x > 0.0) + { + int exp; + double y = frexp (x, &exp); + /* On machines with IEEE754 arithmetic: x = 1.11254e-308, exp = -1022. + On NetBSD: y = 0.75. Correct: y = 0.5. */ + if (y != 0.5) + return 1; + } + /* Test on infinite numbers. */ + x = 1.0 / 0.0; + { + int exp; + double y = frexp (x, &exp); + if (y != x) + return 1; + } + /* Test on negative zero. */ + x = -zero; + { + int exp; + double y = frexp (x, &exp); + if (memcmp (&y, &x, sizeof x)) + return 1; + } + return 0; +} _ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_frexp_works=yes +else + gl_cv_func_frexp_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexp_works" >&5 +$as_echo "$gl_cv_func_frexp_works" >&6; } + + case "$gl_cv_func_frexp_works" in + *yes) gl_func_frexp_no_libm=yes ;; + *) gl_func_frexp_no_libm=no; REPLACE_FREXP=1 ;; + esac + else + gl_func_frexp_no_libm=no + REPLACE_FREXP=1 + fi + if test $gl_func_frexp_no_libm = yes; then + +$as_echo "#define HAVE_FREXP_IN_LIBC 1" >>confdefs.h + + else + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS frexp.$ac_objext" fi + GNULIB_FREXP=1 - - - - - - - - - - - -for ac_header in sys/mount.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexpl() can be used without linking with libm" >&5 +$as_echo_n "checking whether frexpl() can be used without linking with libm... " >&6; } +if test "${gl_cv_func_frexpl_no_libm+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -$ac_includes_default +#include + long double x; +int +main () +{ +int e; return frexpl (x, &e) > 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_func_frexpl_no_libm=yes +else + gl_cv_func_frexpl_no_libm=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexpl_no_libm" >&5 +$as_echo "$gl_cv_func_frexpl_no_libm" >&6; } + if test $gl_cv_func_frexpl_no_libm = yes; then + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexpl works" >&5 +$as_echo_n "checking whether frexpl works... " >&6; } +if test "${gl_cv_func_frexpl_works+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + case "$host_os" in + aix* | beos* | darwin* | irix* | mingw* | pw*) + gl_cv_func_frexpl_works="guessing no";; + *) gl_cv_func_frexpl_works="guessing yes";; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +/* Override the values of , like done in float.in.h. */ +#if defined __i386__ && (defined __BEOS__ || defined __OpenBSD__) +# undef LDBL_MIN_EXP +# define LDBL_MIN_EXP (-16381) +#endif +extern long double frexpl (long double, int *); +int main() +{ + volatile long double x; + /* Test on finite numbers that fails on AIX 5.1. */ + x = 16.0L; + { + int exp = -9999; + frexpl (x, &exp); + if (exp != 5) + return 1; + } + /* Test on finite numbers that fails on MacOS X 10.4, because its frexpl + function returns an invalid (incorrectly normalized) value: it returns + y = { 0x3fe028f5, 0xc28f5c28, 0x3c9eb851, 0xeb851eb8 } + but the correct result is + 0.505L = { 0x3fe028f5, 0xc28f5c29, 0xbc547ae1, 0x47ae1480 } */ + x = 1.01L; + { + int exp = -9999; + long double y = frexpl (x, &exp); + if (!(exp == 1 && y == 0.505L)) + return 1; + } + /* Test on large finite numbers. This fails on BeOS at i = 16322, while + LDBL_MAX_EXP = 16384. + In the loop end test, we test x against Infinity, rather than comparing + i with LDBL_MAX_EXP, because BeOS has a wrong LDBL_MAX_EXP. */ + { + int i; + for (i = 1, x = 1.0L; x != x + x; i++, x *= 2.0L) + { + int exp = -9999; + frexpl (x, &exp); + if (exp != i) + return 1; + } + } + /* Test on denormalized numbers. */ + { + int i; + for (i = 1, x = 1.0L; i >= LDBL_MIN_EXP; i--, x *= 0.5L) + ; + if (x > 0.0L) + { + int exp; + long double y = frexpl (x, &exp); + /* On machines with IEEE854 arithmetic: x = 1.68105e-4932, + exp = -16382, y = 0.5. On MacOS X 10.5: exp = -16384, y = 0.5. */ + if (exp != LDBL_MIN_EXP - 1) + return 1; + } + } + /* Test on infinite numbers. */ + x = 1.0L / 0.0L; + { + int exp; + long double y = frexpl (x, &exp); + if (y != x) + return 1; + } + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_frexpl_works=yes +else + gl_cv_func_frexpl_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexpl_works" >&5 +$as_echo "$gl_cv_func_frexpl_works" >&6; } + + case "$gl_cv_func_frexpl_works" in + *yes) gl_func_frexpl_no_libm=yes ;; + *) gl_func_frexpl_no_libm=no; REPLACE_FREXPL=1 ;; + esac + else + gl_func_frexpl_no_libm=no + REPLACE_FREXPL=1 + fi + if test $gl_func_frexpl_no_libm = yes; then + +$as_echo "#define HAVE_FREXPL_IN_LIBC 1" >>confdefs.h + + ac_fn_c_check_decl "$LINENO" "frexpl" "ac_cv_have_decl_frexpl" "#include +" +if test "x$ac_cv_have_decl_frexpl" = x""yes; then : + +else + HAVE_DECL_FREXPL=0 +fi + + else + HAVE_DECL_FREXPL=0 + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS frexpl.$ac_objext" + + fi + + + + GNULIB_FREXPL=1 + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fseeko" >&5 +$as_echo_n "checking for fseeko... " >&6; } +if test "${gl_cv_func_fseeko+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +fseeko (stdin, 0, 0); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_func_fseeko=yes +else + gl_cv_func_fseeko=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fseeko" >&5 +$as_echo "$gl_cv_func_fseeko" >&6; } + if test $gl_cv_func_fseeko = no; then + HAVE_FSEEKO=0 + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS fseeko.$ac_objext" + + + REPLACE_FSEEKO=1 + + elif test $gl_cv_var_stdin_large_offset = no; then + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS fseeko.$ac_objext" + + + REPLACE_FSEEKO=1 + + fi + + + + GNULIB_FSEEKO=1 + + + + + for ac_header in sys/mount.h +do : + ac_fn_c_check_header_compile "$LINENO" "sys/mount.h" "ac_cv_header_sys_mount_h" "$ac_includes_default #if HAVE_SYS_PARAM_H #include #endif - -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - eval "$as_ac_Header=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_Header=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if test `eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` = yes; then +" +if test "x$ac_cv_header_sys_mount_h" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define HAVE_SYS_MOUNT_H 1 _ACEOF fi @@ -20438,37 +18076,38 @@ done -{ $as_echo "$as_me:$LINENO: checking how to get file system space usage" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to get file system space usage" >&5 $as_echo "$as_me: checking how to get file system space usage" >&6;} ac_fsusage_space=no # Perform only the link test since it seems there are no variants of the -# statvfs function. This check is more than just AC_CHECK_FUNCS(statvfs) +# statvfs function. This check is more than just AC_CHECK_FUNCS([statvfs]) # because that got a false positive on SCO OSR5. Adding the declaration # of a `struct statvfs' causes this test to fail (as it should) on such # systems. That system is reported to work fine with STAT_STATFS4 which # is what it gets when this test fails. if test $ac_fsusage_space = no; then # SVR4 - { $as_echo "$as_me:$LINENO: checking for statvfs function (SVR4)" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for statvfs function (SVR4)" >&5 $as_echo_n "checking for statvfs function (SVR4)... " >&6; } -if test "${fu_cv_sys_stat_statvfs+set}" = set; then +if test "${fu_cv_sys_stat_statvfs+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include -#if defined __GLIBC__ && !(defined(__BEOS__) || defined(__HAIKU__)) -Do not use statvfs on systems with GNU libc, because that function stats -all preceding entries in /proc/mounts, and that makes df hang if even +#if defined __GLIBC__ && defined __linux__ && !(defined(__BEOS__) || defined(__HAIKU__)) +Do not use statvfs on systems with GNU libc on Linux, because that function +stats all preceding entries in /proc/mounts, and that makes df hang if even one of the corresponding file systems is hard-mounted, but not available. -statvfs in GNU libc on BeOS operates differently: it only makes a system -call. +statvfs in GNU libc on Hurd, BeOS, Haiku operates differently: it only makes +a system call. #endif + +#ifdef __osf__ +"Do not use Tru64's statvfs implementation" +#endif + #include int main () @@ -20478,63 +18117,35 @@ struct statvfs fsd; statvfs (0, &fsd); return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then +if ac_fn_c_try_link "$LINENO"; then : fu_cv_sys_stat_statvfs=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - fu_cv_sys_stat_statvfs=no + fu_cv_sys_stat_statvfs=no fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $fu_cv_sys_stat_statvfs" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $fu_cv_sys_stat_statvfs" >&5 $as_echo "$fu_cv_sys_stat_statvfs" >&6; } if test $fu_cv_sys_stat_statvfs = yes; then ac_fsusage_space=yes -cat >>confdefs.h <<\_ACEOF -#define STAT_STATVFS 1 -_ACEOF +$as_echo "#define STAT_STATVFS 1" >>confdefs.h fi fi if test $ac_fsusage_space = no; then # DEC Alpha running OSF/1 - { $as_echo "$as_me:$LINENO: checking for 3-argument statfs function (DEC OSF/1)" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 3-argument statfs function (DEC OSF/1)" >&5 $as_echo_n "checking for 3-argument statfs function (DEC OSF/1)... " >&6; } - if test "${fu_cv_sys_stat_statfs3_osf1+set}" = set; then + if test "${fu_cv_sys_stat_statfs3_osf1+set}" = set; then : $as_echo_n "(cached) " >&6 else - if test "$cross_compiling" = yes; then + if test "$cross_compiling" = yes; then : fu_cv_sys_stat_statfs3_osf1=no else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -20548,70 +18159,38 @@ cat >>conftest.$ac_ext <<_ACEOF return statfs (".", &fsd, sizeof (struct statfs)) != 0; } _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_run "$LINENO"; then : fu_cv_sys_stat_statfs3_osf1=yes else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -fu_cv_sys_stat_statfs3_osf1=no + fu_cv_sys_stat_statfs3_osf1=no fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi - fi - { $as_echo "$as_me:$LINENO: result: $fu_cv_sys_stat_statfs3_osf1" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fu_cv_sys_stat_statfs3_osf1" >&5 $as_echo "$fu_cv_sys_stat_statfs3_osf1" >&6; } if test $fu_cv_sys_stat_statfs3_osf1 = yes; then ac_fsusage_space=yes -cat >>confdefs.h <<\_ACEOF -#define STAT_STATFS3_OSF1 1 -_ACEOF +$as_echo "#define STAT_STATFS3_OSF1 1" >>confdefs.h fi fi if test $ac_fsusage_space = no; then # AIX - { $as_echo "$as_me:$LINENO: checking for two-argument statfs with statfs.bsize member (AIX, 4.3BSD)" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for two-argument statfs with statfs.bsize member (AIX, 4.3BSD)" >&5 $as_echo_n "checking for two-argument statfs with statfs.bsize member (AIX, 4.3BSD)... " >&6; } - if test "${fu_cv_sys_stat_statfs2_bsize+set}" = set; then + if test "${fu_cv_sys_stat_statfs2_bsize+set}" = set; then : $as_echo_n "(cached) " >&6 else - if test "$cross_compiling" = yes; then + if test "$cross_compiling" = yes; then : fu_cv_sys_stat_statfs2_bsize=no else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef HAVE_SYS_PARAM_H @@ -20631,70 +18210,38 @@ cat >>conftest.$ac_ext <<_ACEOF return statfs (".", &fsd) != 0; } _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_run "$LINENO"; then : fu_cv_sys_stat_statfs2_bsize=yes else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -fu_cv_sys_stat_statfs2_bsize=no + fu_cv_sys_stat_statfs2_bsize=no fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi - fi - { $as_echo "$as_me:$LINENO: result: $fu_cv_sys_stat_statfs2_bsize" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fu_cv_sys_stat_statfs2_bsize" >&5 $as_echo "$fu_cv_sys_stat_statfs2_bsize" >&6; } if test $fu_cv_sys_stat_statfs2_bsize = yes; then ac_fsusage_space=yes -cat >>confdefs.h <<\_ACEOF -#define STAT_STATFS2_BSIZE 1 -_ACEOF +$as_echo "#define STAT_STATFS2_BSIZE 1" >>confdefs.h fi fi if test $ac_fsusage_space = no; then # SVR3 - { $as_echo "$as_me:$LINENO: checking for four-argument statfs (AIX-3.2.5, SVR3)" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for four-argument statfs (AIX-3.2.5, SVR3)" >&5 $as_echo_n "checking for four-argument statfs (AIX-3.2.5, SVR3)... " >&6; } - if test "${fu_cv_sys_stat_statfs4+set}" = set; then + if test "${fu_cv_sys_stat_statfs4+set}" = set; then : $as_echo_n "(cached) " >&6 else - if test "$cross_compiling" = yes; then + if test "$cross_compiling" = yes; then : fu_cv_sys_stat_statfs4=no else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include @@ -20705,70 +18252,38 @@ cat >>conftest.$ac_ext <<_ACEOF return statfs (".", &fsd, sizeof fsd, 0) != 0; } _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_run "$LINENO"; then : fu_cv_sys_stat_statfs4=yes else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -fu_cv_sys_stat_statfs4=no + fu_cv_sys_stat_statfs4=no fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi - fi - { $as_echo "$as_me:$LINENO: result: $fu_cv_sys_stat_statfs4" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fu_cv_sys_stat_statfs4" >&5 $as_echo "$fu_cv_sys_stat_statfs4" >&6; } if test $fu_cv_sys_stat_statfs4 = yes; then ac_fsusage_space=yes -cat >>confdefs.h <<\_ACEOF -#define STAT_STATFS4 1 -_ACEOF +$as_echo "#define STAT_STATFS4 1" >>confdefs.h fi fi if test $ac_fsusage_space = no; then # 4.4BSD and NetBSD - { $as_echo "$as_me:$LINENO: checking for two-argument statfs with statfs.fsize member (4.4BSD and NetBSD)" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for two-argument statfs with statfs.fsize member (4.4BSD and NetBSD)" >&5 $as_echo_n "checking for two-argument statfs with statfs.fsize member (4.4BSD and NetBSD)... " >&6; } - if test "${fu_cv_sys_stat_statfs2_fsize+set}" = set; then + if test "${fu_cv_sys_stat_statfs2_fsize+set}" = set; then : $as_echo_n "(cached) " >&6 else - if test "$cross_compiling" = yes; then + if test "$cross_compiling" = yes; then : fu_cv_sys_stat_statfs2_fsize=no else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #ifdef HAVE_SYS_PARAM_H @@ -20785,70 +18300,38 @@ cat >>conftest.$ac_ext <<_ACEOF return statfs (".", &fsd) != 0; } _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_run "$LINENO"; then : fu_cv_sys_stat_statfs2_fsize=yes else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -fu_cv_sys_stat_statfs2_fsize=no + fu_cv_sys_stat_statfs2_fsize=no fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi - fi - { $as_echo "$as_me:$LINENO: result: $fu_cv_sys_stat_statfs2_fsize" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fu_cv_sys_stat_statfs2_fsize" >&5 $as_echo "$fu_cv_sys_stat_statfs2_fsize" >&6; } if test $fu_cv_sys_stat_statfs2_fsize = yes; then ac_fsusage_space=yes -cat >>confdefs.h <<\_ACEOF -#define STAT_STATFS2_FSIZE 1 -_ACEOF +$as_echo "#define STAT_STATFS2_FSIZE 1" >>confdefs.h fi fi if test $ac_fsusage_space = no; then # Ultrix - { $as_echo "$as_me:$LINENO: checking for two-argument statfs with struct fs_data (Ultrix)" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for two-argument statfs with struct fs_data (Ultrix)" >&5 $as_echo_n "checking for two-argument statfs with struct fs_data (Ultrix)... " >&6; } - if test "${fu_cv_sys_stat_fs_data+set}" = set; then + if test "${fu_cv_sys_stat_fs_data+set}" = set; then : $as_echo_n "(cached) " >&6 else - if test "$cross_compiling" = yes; then + if test "$cross_compiling" = yes; then : fu_cv_sys_stat_fs_data=no else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #ifdef HAVE_SYS_PARAM_H @@ -20869,255 +18352,68 @@ cat >>conftest.$ac_ext <<_ACEOF return statfs (".", &fsd) != 1; } _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_run "$LINENO"; then : fu_cv_sys_stat_fs_data=yes else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -fu_cv_sys_stat_fs_data=no + fu_cv_sys_stat_fs_data=no fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi - fi - { $as_echo "$as_me:$LINENO: result: $fu_cv_sys_stat_fs_data" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fu_cv_sys_stat_fs_data" >&5 $as_echo "$fu_cv_sys_stat_fs_data" >&6; } if test $fu_cv_sys_stat_fs_data = yes; then ac_fsusage_space=yes -cat >>confdefs.h <<\_ACEOF -#define STAT_STATFS2_FS_DATA 1 -_ACEOF +$as_echo "#define STAT_STATFS2_FS_DATA 1" >>confdefs.h fi fi if test $ac_fsusage_space = no; then # SVR2 - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then +if ac_fn_c_try_cpp "$LINENO"; then : -cat >>confdefs.h <<\_ACEOF -#define STAT_READ_FILSYS 1 -_ACEOF +$as_echo "#define STAT_READ_FILSYS 1" >>confdefs.h ac_fsusage_space=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - fi - rm -f conftest.err conftest.$ac_ext fi -if test $ac_fsusage_space = yes; then +if test $ac_fsusage_space = yes; then : gl_cv_fs_space=yes else gl_cv_fs_space=no fi - if test $gl_cv_fs_space = yes; then - gl_LIBOBJS="$gl_LIBOBJS fsusage.$ac_objext" -for ac_header in dustat.h sys/fs/s5param.h sys/filsys.h sys/statfs.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_compiler=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + gl_LIBOBJS="$gl_LIBOBJS fsusage.$ac_objext" - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-coreutils@gnu.org ## -## ------------------------------------ ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - -fi -if test `eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` = yes; then + for ac_header in dustat.h sys/fs/s5param.h sys/filsys.h sys/statfs.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +eval as_val=\$$as_ac_Header + if test "x$as_val" = x""yes; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF @@ -21127,16 +18423,12 @@ fi done - { $as_echo "$as_me:$LINENO: checking for statfs that truncates block counts" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for statfs that truncates block counts" >&5 $as_echo_n "checking for statfs that truncates block counts... " >&6; } - if test "${fu_cv_sys_truncating_statfs+set}" = set; then + if test "${fu_cv_sys_truncating_statfs+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if !defined(sun) && !defined(__sun) @@ -21153,43 +18445,20 @@ struct statfs t; long c = *(t.f_spare); return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : fu_cv_sys_truncating_statfs=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - fu_cv_sys_truncating_statfs=no + fu_cv_sys_truncating_statfs=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test $fu_cv_sys_truncating_statfs = yes; then -cat >>confdefs.h <<\_ACEOF -#define STATFS_TRUNCATES_BLOCK_COUNTS 1 -_ACEOF +$as_echo "#define STATFS_TRUNCATES_BLOCK_COUNTS 1" >>confdefs.h fi - { $as_echo "$as_me:$LINENO: result: $fu_cv_sys_truncating_statfs" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fu_cv_sys_truncating_statfs" >&5 $as_echo "$fu_cv_sys_truncating_statfs" >&6; } @@ -21202,104 +18471,94 @@ $as_echo "$fu_cv_sys_truncating_statfs" >&6; } - - - if test $ac_cv_func_ftruncate = no; then - HAVE_FTRUNCATE=0 - gl_LIBOBJS="$gl_LIBOBJS ftruncate.$ac_objext" - - -for ac_func in chsize -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ftello" >&5 +$as_echo_n "checking for ftello... " >&6; } +if test "${gl_cv_func_ftello+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - +#include int main () { -return $ac_func (); +ftello (stdin); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_func_ftello=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" + gl_cv_func_ftello=no fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if test `eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_ftello" >&5 +$as_echo "$gl_cv_func_ftello" >&6; } + if test $gl_cv_func_ftello = no; then + HAVE_FTELLO=0 + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS ftello.$ac_objext" + + + REPLACE_FTELLO=1 + + elif test $gl_cv_var_stdin_large_offset = no; then + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS ftello.$ac_objext" + + + REPLACE_FTELLO=1 + + fi + + + + GNULIB_FTELLO=1 + + + + + + if test $ac_cv_func_ftruncate = no; then + HAVE_FTRUNCATE=0 + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS ftruncate.$ac_objext" + + + for ac_func in chsize +do : + ac_fn_c_check_func "$LINENO" "chsize" "ac_cv_func_chsize" +if test "x$ac_cv_func_chsize" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define HAVE_CHSIZE 1 _ACEOF fi @@ -21314,19 +18573,14 @@ done # If someone lacks ftruncate, make configure fail, and request # a bug report to inform us about it. if test x"$SKIP_FTRUNCATE_CHECK" != xyes; then - { { $as_echo "$as_me:$LINENO: error: Your system lacks the ftruncate function. + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error "Your system lacks the ftruncate function. Please report this, along with the output of \"uname -a\", to the bug-coreutils@gnu.org mailing list. To continue past this point, rerun configure with SKIP_FTRUNCATE_CHECK=yes. E.g., ./configure SKIP_FTRUNCATE_CHECK=yes -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: Your system lacks the ftruncate function. - Please report this, along with the output of \"uname -a\", to the - bug-coreutils@gnu.org mailing list. To continue past this point, - rerun configure with SKIP_FTRUNCATE_CHECK=yes. - E.g., ./configure SKIP_FTRUNCATE_CHECK=yes -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } +See \`config.log' for more details." "$LINENO" 5; } fi esac fi @@ -21337,10 +18591,26 @@ See \`config.log' for more details." >&2;} - gl_LIBOBJS="$gl_LIBOBJS fts.$ac_objext" - gl_LIBOBJS="$gl_LIBOBJS openat-die.$ac_objext" + + + + + + + gl_LIBOBJS="$gl_LIBOBJS fts.$ac_objext" + + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS openat-proc.$ac_objext" @@ -21358,112 +18628,50 @@ See \`config.log' for more details." >&2;} -for ac_func in fchmodat mkdirat openat -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ -#ifdef __STDC__ -# include -#else -# include -#endif -#undef $ac_func -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - eval "$as_ac_var=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if test `eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` = yes; then + + + + for ac_func in fchmodat mkdirat openat +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +eval as_val=\$$as_ac_var + if test "x$as_val" = x""yes; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else - gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" + + gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" + fi done + + case $ac_cv_func_openat+$ac_cv_func_lstat_dereferences_slashed_symlink in yes+yes) ;; - yes+*) gl_LIBOBJS="$gl_LIBOBJS fstatat.$ac_objext";; + yes+*) + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS fstatat.$ac_objext" +;; *) -cat >>confdefs.h <<\_ACEOF -#define __OPENAT_PREFIX rpl_ -_ACEOF +$as_echo "#define __OPENAT_PREFIX rpl_" >>confdefs.h : @@ -21474,89 +18682,8 @@ _ACEOF # The only case in which we won't is when we have fchownat, and it works. use_replacement_fchownat=yes - { $as_echo "$as_me:$LINENO: checking for fchownat" >&5 -$as_echo_n "checking for fchownat... " >&6; } -if test "${ac_cv_func_fchownat+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define fchownat to an innocuous variant, in case declares fchownat. - For example, HP-UX 11i declares gettimeofday. */ -#define fchownat innocuous_fchownat - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char fchownat (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef fchownat - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char fchownat (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_fchownat || defined __stub___fchownat -choke me -#endif - -int -main () -{ -return fchownat (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_func_fchownat=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_func_fchownat=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_fchownat" >&5 -$as_echo "$ac_cv_func_fchownat" >&6; } -if test $ac_cv_func_fchownat = yes; then + ac_fn_c_check_func "$LINENO" "fchownat" "ac_cv_func_fchownat" +if test "x$ac_cv_func_fchownat" = x""yes; then : have_fchownat=yes else have_fchownat=no @@ -21564,9 +18691,9 @@ fi if test $have_fchownat = yes; then - { $as_echo "$as_me:$LINENO: checking whether fchownat works with AT_SYMLINK_NOFOLLOW" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fchownat works with AT_SYMLINK_NOFOLLOW" >&5 $as_echo_n "checking whether fchownat works with AT_SYMLINK_NOFOLLOW... " >&6; } -if test "${gl_cv_func_fchownat_nofollow_works+set}" = set; then +if test "${gl_cv_func_fchownat_nofollow_works+set}" = set; then : $as_echo_n "(cached) " >&6 else @@ -21575,14 +18702,11 @@ else rm -f $gl_dangle # Arrange for deletion of the temporary file this test creates. ac_clean_files="$ac_clean_files $gl_dangle" - if test "$cross_compiling" = yes; then + ln -s conftest.no-such $gl_dangle + if test "$cross_compiling" = yes; then : gl_cv_func_fchownat_nofollow_works=no else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -21599,96 +18723,78 @@ main () } _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_run "$LINENO"; then : gl_cv_func_fchownat_nofollow_works=yes else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -gl_cv_func_fchownat_nofollow_works=no + gl_cv_func_fchownat_nofollow_works=no fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi - fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_fchownat_nofollow_works" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fchownat_nofollow_works" >&5 $as_echo "$gl_cv_func_fchownat_nofollow_works" >&6; } - if test $gl_cv_func_fchownat_nofollow_works = no; then - have_fchownat_bug=yes + if test $gl_cv_func_fchownat_nofollow_works = no; then : + +else + use_replacement_fchownat=no fi - - if test $have_fchownat_bug = no; then - use_replacement_fchownat=no - fi fi if test $use_replacement_fchownat = yes; then - gl_LIBOBJS="$gl_LIBOBJS fchownat.$ac_objext" -cat >>confdefs.h <<\_ACEOF -#define fchownat rpl_fchownat -_ACEOF + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS fchownat.$ac_objext" + + +$as_echo "#define fchownat rpl_fchownat" >>confdefs.h fi - # Checks for header files. + ac_fn_c_check_member "$LINENO" "struct statfs" "f_type" "ac_cv_member_struct_statfs_f_type" "$ac_includes_default + #include +" +if test "x$ac_cv_member_struct_statfs_f_type" = x""yes; then : - - - - - - - -cat >>confdefs.h <<\_ACEOF -#define GNULIB_FTS 1 +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_STATFS_F_TYPE 1 _ACEOF +fi - { $as_echo "$as_me:$LINENO: checking how to do getaddrinfo, freeaddrinfo and getnameinfo" >&5 + + + + +$as_echo "#define GNULIB_FTS 1" >>confdefs.h + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to do getaddrinfo, freeaddrinfo and getnameinfo" >&5 $as_echo "$as_me: checking how to do getaddrinfo, freeaddrinfo and getnameinfo" >&6;} + GETADDRINFO_LIB= + gai_saved_LIBS="$LIBS" - { $as_echo "$as_me:$LINENO: checking for library containing getaddrinfo" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing getaddrinfo" >&5 $as_echo_n "checking for library containing getaddrinfo... " >&6; } -if test "${ac_cv_search_getaddrinfo+set}" = set; then +if test "${ac_cv_search_getaddrinfo+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. @@ -21706,686 +18812,211 @@ return getaddrinfo (); return 0; } _ACEOF -for ac_lib in '' nsl socket; do +for ac_lib in '' socket network net; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi - rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_getaddrinfo=$ac_res -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext - if test "${ac_cv_search_getaddrinfo+set}" = set; then +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if test "${ac_cv_search_getaddrinfo+set}" = set; then : break fi done -if test "${ac_cv_search_getaddrinfo+set}" = set; then - : +if test "${ac_cv_search_getaddrinfo+set}" = set; then : + else ac_cv_search_getaddrinfo=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_getaddrinfo" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_getaddrinfo" >&5 $as_echo "$ac_cv_search_getaddrinfo" >&6; } ac_res=$ac_cv_search_getaddrinfo -if test "$ac_res" != no; then +if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - + if test "$ac_cv_search_getaddrinfo" != "none required"; then + GETADDRINFO_LIB="$ac_cv_search_getaddrinfo" + fi fi + LIBS="$gai_saved_LIBS $GETADDRINFO_LIB" -for ac_func in getaddrinfo -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getaddrinfo" >&5 +$as_echo_n "checking for getaddrinfo... " >&6; } +if test "${gl_cv_func_getaddrinfo+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include +#include +#ifdef HAVE_SYS_SOCKET_H +#include #endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me +#ifdef HAVE_NETDB_H +#include #endif +#include int main () { -return $ac_func (); +getaddrinfo("", "", NULL, NULL); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_func_getaddrinfo=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" + gl_cv_func_getaddrinfo=no fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if test `eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -else - - { $as_echo "$as_me:$LINENO: checking for getaddrinfo in ws2tcpip.h and -lws2_32" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getaddrinfo" >&5 +$as_echo "$gl_cv_func_getaddrinfo" >&6; } + if test $gl_cv_func_getaddrinfo = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getaddrinfo in ws2tcpip.h and -lws2_32" >&5 $as_echo_n "checking for getaddrinfo in ws2tcpip.h and -lws2_32... " >&6; } -if test "${gl_cv_w32_getaddrinfo+set}" = set; then +if test "${gl_cv_w32_getaddrinfo+set}" = set; then : $as_echo_n "(cached) " >&6 else gl_cv_w32_getaddrinfo=no am_save_LIBS="$LIBS" LIBS="$LIBS -lws2_32" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef HAVE_WS2TCPIP_H #include #endif +#include int main () { -getaddrinfo(0, 0, 0, 0); +getaddrinfo(NULL, NULL, NULL, NULL); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then +if ac_fn_c_try_link "$LINENO"; then : gl_cv_w32_getaddrinfo=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$am_save_LIBS" fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext - LIBS="$am_save_LIBS" -fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_w32_getaddrinfo" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_w32_getaddrinfo" >&5 $as_echo "$gl_cv_w32_getaddrinfo" >&6; } if test "$gl_cv_w32_getaddrinfo" = "yes"; then - LIBS="$LIBS -lws2_32" + GETADDRINFO_LIB="-lws2_32" + LIBS="$gai_saved_LIBS $GETADDRINFO_LIB" else - gl_LIBOBJS="$gl_LIBOBJS getaddrinfo.$ac_objext" + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS getaddrinfo.$ac_objext" + fi - -fi -done - - - -for ac_func in gai_strerror -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if test `eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -else - gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" -fi -done - - - { $as_echo "$as_me:$LINENO: checking for library containing gethostbyname" >&5 -$as_echo_n "checking for library containing gethostbyname... " >&6; } -if test "${ac_cv_search_gethostbyname+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_func_search_save_LIBS=$LIBS -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char gethostbyname (); -int -main () -{ -return gethostbyname (); - ; - return 0; -} -_ACEOF -for ac_lib in '' inet nsl; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi - rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_search_gethostbyname=$ac_res -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext - if test "${ac_cv_search_gethostbyname+set}" = set; then - break -fi -done -if test "${ac_cv_search_gethostbyname+set}" = set; then - : -else - ac_cv_search_gethostbyname=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_gethostbyname" >&5 -$as_echo "$ac_cv_search_gethostbyname" >&6; } -ac_res=$ac_cv_search_gethostbyname -if test "$ac_res" != no; then - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -fi - - { $as_echo "$as_me:$LINENO: checking for library containing getservbyname" >&5 -$as_echo_n "checking for library containing getservbyname... " >&6; } -if test "${ac_cv_search_getservbyname+set}" = set; then + # We can't use AC_REPLACE_FUNCS here because gai_strerror may be an + # inline function declared in ws2tcpip.h, so we need to get that + # header included somehow. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gai_strerror (possibly via ws2tcpip.h)" >&5 +$as_echo_n "checking for gai_strerror (possibly via ws2tcpip.h)... " >&6; } +if test "${gl_cv_func_gai_strerror+set}" = set; then : $as_echo_n "(cached) " >&6 else - ac_func_search_save_LIBS=$LIBS -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" +#include +#ifdef HAVE_SYS_SOCKET_H +#include #endif -char getservbyname (); +#ifdef HAVE_NETDB_H +#include +#endif +#ifdef HAVE_WS2TCPIP_H +#include +#endif +#include + int main () { -return getservbyname (); +gai_strerror (NULL); ; return 0; } _ACEOF -for ac_lib in '' inet nsl socket xnet; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_func_gai_strerror=yes +else + gl_cv_func_gai_strerror=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_gai_strerror" >&5 +$as_echo "$gl_cv_func_gai_strerror" >&6; } + if test $gl_cv_func_gai_strerror = no; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS gai_strerror.$ac_objext" + fi - rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_search_getservbyname=$ac_res -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + + LIBS="$gai_saved_LIBS" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext - if test "${ac_cv_search_getservbyname+set}" = set; then - break -fi -done -if test "${ac_cv_search_getservbyname+set}" = set; then - : -else - ac_cv_search_getservbyname=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_getservbyname" >&5 -$as_echo "$ac_cv_search_getservbyname" >&6; } -ac_res=$ac_cv_search_getservbyname -if test "$ac_res" != no; then - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -fi -for ac_func in gethostbyname -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ -#ifdef __STDC__ -# include -#else -# include -#endif -#undef $ac_func -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + ac_fn_c_check_member "$LINENO" "struct sockaddr" "sa_len" "ac_cv_member_struct_sockaddr_sa_len" "#include +" +if test "x$ac_cv_member_struct_sockaddr_sa_len" = x""yes; then : - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if test `eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_SOCKADDR_SA_LEN 1 _ACEOF -else - - { $as_echo "$as_me:$LINENO: checking for gethostbyname in winsock2.h and -lws2_32" >&5 -$as_echo_n "checking for gethostbyname in winsock2.h and -lws2_32... " >&6; } -if test "${gl_cv_w32_gethostbyname+set}" = set; then - $as_echo_n "(cached) " >&6 -else - - gl_cv_w32_gethostbyname=no - am_save_LIBS="$LIBS" - LIBS="$LIBS -lws2_32" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -#ifdef HAVE_WINSOCK2_H -#include -#endif - -int -main () -{ -gethostbyname(0); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - gl_cv_w32_gethostbyname=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - fi -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext - LIBS="$am_save_LIBS" -fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_w32_gethostbyname" >&5 -$as_echo "$gl_cv_w32_gethostbyname" >&6; } - if test "$gl_cv_w32_gethostbyname" = "yes"; then - LIBS="$LIBS -lws2_32" - fi - -fi -done - - - - - - - - - - - - { $as_echo "$as_me:$LINENO: checking whether getaddrinfo is declared" >&5 -$as_echo_n "checking whether getaddrinfo is declared... " >&6; } -if test "${ac_cv_have_decl_getaddrinfo+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - + ac_fn_c_check_decl "$LINENO" "getaddrinfo" "ac_cv_have_decl_getaddrinfo" " /* sys/types.h is not needed according to POSIX, but the sys/socket.h in i386-unknown-freebsd4.10 and powerpc-apple-darwin5.5 required it. */ @@ -22400,74 +19031,17 @@ cat >>conftest.$ac_ext <<_ACEOF #include #endif - -int -main () -{ -#ifndef getaddrinfo - (void) getaddrinfo; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_getaddrinfo=yes +" +if test "x$ac_cv_have_decl_getaddrinfo" = x""yes; then : + ac_have_decl=1 else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_getaddrinfo=no + ac_have_decl=0 fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_getaddrinfo" >&5 -$as_echo "$ac_cv_have_decl_getaddrinfo" >&6; } -if test $ac_cv_have_decl_getaddrinfo = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_GETADDRINFO 1 +#define HAVE_DECL_GETADDRINFO $ac_have_decl _ACEOF - - -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_GETADDRINFO 0 -_ACEOF - - -fi -{ $as_echo "$as_me:$LINENO: checking whether freeaddrinfo is declared" >&5 -$as_echo_n "checking whether freeaddrinfo is declared... " >&6; } -if test "${ac_cv_have_decl_freeaddrinfo+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - +ac_fn_c_check_decl "$LINENO" "freeaddrinfo" "ac_cv_have_decl_freeaddrinfo" " /* sys/types.h is not needed according to POSIX, but the sys/socket.h in i386-unknown-freebsd4.10 and powerpc-apple-darwin5.5 required it. */ @@ -22482,74 +19056,17 @@ cat >>conftest.$ac_ext <<_ACEOF #include #endif - -int -main () -{ -#ifndef freeaddrinfo - (void) freeaddrinfo; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_freeaddrinfo=yes +" +if test "x$ac_cv_have_decl_freeaddrinfo" = x""yes; then : + ac_have_decl=1 else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_freeaddrinfo=no + ac_have_decl=0 fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_freeaddrinfo" >&5 -$as_echo "$ac_cv_have_decl_freeaddrinfo" >&6; } -if test $ac_cv_have_decl_freeaddrinfo = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FREEADDRINFO 1 +#define HAVE_DECL_FREEADDRINFO $ac_have_decl _ACEOF - - -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FREEADDRINFO 0 -_ACEOF - - -fi -{ $as_echo "$as_me:$LINENO: checking whether gai_strerror is declared" >&5 -$as_echo_n "checking whether gai_strerror is declared... " >&6; } -if test "${ac_cv_have_decl_gai_strerror+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - +ac_fn_c_check_decl "$LINENO" "gai_strerror" "ac_cv_have_decl_gai_strerror" " /* sys/types.h is not needed according to POSIX, but the sys/socket.h in i386-unknown-freebsd4.10 and powerpc-apple-darwin5.5 required it. */ @@ -22564,74 +19081,17 @@ cat >>conftest.$ac_ext <<_ACEOF #include #endif - -int -main () -{ -#ifndef gai_strerror - (void) gai_strerror; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_gai_strerror=yes +" +if test "x$ac_cv_have_decl_gai_strerror" = x""yes; then : + ac_have_decl=1 else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_gai_strerror=no + ac_have_decl=0 fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_gai_strerror" >&5 -$as_echo "$ac_cv_have_decl_gai_strerror" >&6; } -if test $ac_cv_have_decl_gai_strerror = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_GAI_STRERROR 1 +#define HAVE_DECL_GAI_STRERROR $ac_have_decl _ACEOF - - -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_GAI_STRERROR 0 -_ACEOF - - -fi -{ $as_echo "$as_me:$LINENO: checking whether getnameinfo is declared" >&5 -$as_echo_n "checking whether getnameinfo is declared... " >&6; } -if test "${ac_cv_have_decl_getnameinfo+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - +ac_fn_c_check_decl "$LINENO" "getnameinfo" "ac_cv_have_decl_getnameinfo" " /* sys/types.h is not needed according to POSIX, but the sys/socket.h in i386-unknown-freebsd4.10 and powerpc-apple-darwin5.5 required it. */ @@ -22646,76 +19106,31 @@ cat >>conftest.$ac_ext <<_ACEOF #include #endif - -int -main () -{ -#ifndef getnameinfo - (void) getnameinfo; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_getnameinfo=yes +" +if test "x$ac_cv_have_decl_getnameinfo" = x""yes; then : + ac_have_decl=1 else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_getnameinfo=no + ac_have_decl=0 fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_getnameinfo" >&5 -$as_echo "$ac_cv_have_decl_getnameinfo" >&6; } -if test $ac_cv_have_decl_getnameinfo = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_GETNAMEINFO 1 +#define HAVE_DECL_GETNAMEINFO $ac_have_decl _ACEOF + if test $ac_cv_have_decl_getaddrinfo = no; then + HAVE_DECL_GETADDRINFO=0 + fi + if test $ac_cv_have_decl_freeaddrinfo = no; then + HAVE_DECL_FREEADDRINFO=0 + fi + if test $ac_cv_have_decl_gai_strerror = no; then + HAVE_DECL_GAI_STRERROR=0 + fi + if test $ac_cv_have_decl_getnameinfo = no; then + HAVE_DECL_GETNAMEINFO=0 + fi -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_GETNAMEINFO 0 -_ACEOF - - -fi - - - { $as_echo "$as_me:$LINENO: checking for struct addrinfo" >&5 -$as_echo_n "checking for struct addrinfo... " >&6; } -if test "${ac_cv_type_struct_addrinfo+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - + ac_fn_c_check_type "$LINENO" "struct addrinfo" "ac_cv_type_struct_addrinfo" " #include #ifdef HAVE_SYS_SOCKET_H #include @@ -22727,50 +19142,8 @@ cat >>conftest.$ac_ext <<_ACEOF #include #endif - -typedef struct addrinfo ac__type_new_; -int -main () -{ -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type_struct_addrinfo=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_struct_addrinfo=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_struct_addrinfo" >&5 -$as_echo "$ac_cv_type_struct_addrinfo" >&6; } -if test $ac_cv_type_struct_addrinfo = yes; then +" +if test "x$ac_cv_type_struct_addrinfo" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_ADDRINFO 1 @@ -22779,7 +19152,26 @@ _ACEOF fi + if test $ac_cv_type_struct_addrinfo = no; then + HAVE_STRUCT_ADDRINFO=0 + fi + case " $GETADDRINFO_LIB " in + *" $HOSTENT_LIB "*) ;; + *) GETADDRINFO_LIB="$GETADDRINFO_LIB $HOSTENT_LIB" ;; + esac + + case " $GETADDRINFO_LIB " in + *" $SERVENT_LIB "*) ;; + *) GETADDRINFO_LIB="$GETADDRINFO_LIB $SERVENT_LIB" ;; + esac + + + + + + + GNULIB_GETADDRINFO=1 @@ -22791,24 +19183,17 @@ fi - - - - { $as_echo "$as_me:$LINENO: checking whether getcwd handles long file names properly" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getcwd handles long file names properly" >&5 $as_echo_n "checking whether getcwd handles long file names properly... " >&6; } -if test "${gl_cv_func_getcwd_path_max+set}" = set; then +if test "${gl_cv_func_getcwd_path_max+set}" = set; then : $as_echo_n "(cached) " >&6 else # Arrange for deletion of the temporary directory this test creates. ac_clean_files="$ac_clean_files confdir3" - if test "$cross_compiling" = yes; then + if test "$cross_compiling" = yes; then : gl_cv_func_getcwd_path_max=no else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -22950,7 +19335,8 @@ main () { if (chdir ("..") < 0) break; - rmdir (DIR_NAME); + if (rmdir (DIR_NAME) != 0) + break; } } @@ -22959,176 +19345,55 @@ main () } _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_run "$LINENO"; then : gl_cv_func_getcwd_path_max=yes else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -case $? in + case $? in 1) gl_cv_func_getcwd_path_max='no, but it is partly working';; *) gl_cv_func_getcwd_path_max=no;; esac fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi - fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_getcwd_path_max" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getcwd_path_max" >&5 $as_echo "$gl_cv_func_getcwd_path_max" >&6; } case $gl_cv_func_getcwd_path_max in no,*) -cat >>confdefs.h <<\_ACEOF -#define HAVE_PARTLY_WORKING_GETCWD 1 -_ACEOF +$as_echo "#define HAVE_PARTLY_WORKING_GETCWD 1" >>confdefs.h ;; esac - - - - -for ac_func in getpagesize -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if test `eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` = yes; then + for ac_func in getpagesize +do : + ac_fn_c_check_func "$LINENO" "getpagesize" "ac_cv_func_getpagesize" +if test "x$ac_cv_func_getpagesize" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define HAVE_GETPAGESIZE 1 _ACEOF fi done - { $as_echo "$as_me:$LINENO: checking whether getcwd aborts when 4k < cwd_length < 16k" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getcwd aborts when 4k < cwd_length < 16k" >&5 $as_echo_n "checking whether getcwd aborts when 4k < cwd_length < 16k... " >&6; } -if test "${gl_cv_func_getcwd_abort_bug+set}" = set; then +if test "${gl_cv_func_getcwd_abort_bug+set}" = set; then : $as_echo_n "(cached) " >&6 else # Remove any remnants of a previous test. rm -rf confdir-14B--- # Arrange for deletion of the temporary directory this test creates. ac_clean_files="$ac_clean_files confdir-14B---" - if test "$cross_compiling" = yes; then + if test "$cross_compiling" = yes; then : gl_cv_func_getcwd_abort_bug=yes else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -23206,49 +19471,22 @@ main () } _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_run "$LINENO"; then : gl_cv_func_getcwd_abort_bug=no else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -gl_cv_func_getcwd_abort_bug=yes + gl_cv_func_getcwd_abort_bug=yes fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi - fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_getcwd_abort_bug" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getcwd_abort_bug" >&5 $as_echo "$gl_cv_func_getcwd_abort_bug" >&6; } - if test $gl_cv_func_getcwd_abort_bug = yes; then + if test $gl_cv_func_getcwd_abort_bug = yes; then : gl_abort_bug=yes fi - ;; esac @@ -23256,7 +19494,16 @@ fi yes,yes,no) ;; *) REPLACE_GETCWD=1 - gl_LIBOBJS="$gl_LIBOBJS getcwd.$ac_objext" + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS getcwd.$ac_objext" + @@ -23274,108 +19521,11 @@ fi - { $as_echo "$as_me:$LINENO: checking for struct tm.tm_zone" >&5 -$as_echo_n "checking for struct tm.tm_zone... " >&6; } -if test "${ac_cv_member_struct_tm_tm_zone+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include + ac_fn_c_check_member "$LINENO" "struct tm" "tm_zone" "ac_cv_member_struct_tm_tm_zone" "#include #include <$ac_cv_struct_tm> - -int -main () -{ -static struct tm ac_aggr; -if (ac_aggr.tm_zone) -return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_member_struct_tm_tm_zone=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include <$ac_cv_struct_tm> - - -int -main () -{ -static struct tm ac_aggr; -if (sizeof ac_aggr.tm_zone) -return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_member_struct_tm_tm_zone=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_member_struct_tm_tm_zone=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_tm_tm_zone" >&5 -$as_echo "$ac_cv_member_struct_tm_tm_zone" >&6; } -if test $ac_cv_member_struct_tm_tm_zone = yes; then +" +if test "x$ac_cv_member_struct_tm_tm_zone" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_TM_TM_ZONE 1 @@ -23386,91 +19536,27 @@ fi if test "$ac_cv_member_struct_tm_tm_zone" = yes; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_TM_ZONE 1 -_ACEOF +$as_echo "#define HAVE_TM_ZONE 1" >>confdefs.h else - { $as_echo "$as_me:$LINENO: checking whether tzname is declared" >&5 -$as_echo_n "checking whether tzname is declared... " >&6; } -if test "${ac_cv_have_decl_tzname+set}" = set; then - $as_echo_n "(cached) " >&6 + ac_fn_c_check_decl "$LINENO" "tzname" "ac_cv_have_decl_tzname" "#include +" +if test "x$ac_cv_have_decl_tzname" = x""yes; then : + ac_have_decl=1 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -int -main () -{ -#ifndef tzname - (void) tzname; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_tzname=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_tzname=no + ac_have_decl=0 fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_tzname" >&5 -$as_echo "$ac_cv_have_decl_tzname" >&6; } -if test $ac_cv_have_decl_tzname = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_TZNAME 1 +#define HAVE_DECL_TZNAME $ac_have_decl _ACEOF - -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_TZNAME 0 -_ACEOF - - -fi - - - { $as_echo "$as_me:$LINENO: checking for tzname" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tzname" >&5 $as_echo_n "checking for tzname... " >&6; } -if test "${ac_cv_var_tzname+set}" = set; then +if test "${ac_cv_var_tzname+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #if !HAVE_DECL_TZNAME @@ -23485,43 +19571,19 @@ return tzname[0][0]; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then +if ac_fn_c_try_link "$LINENO"; then : ac_cv_var_tzname=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_var_tzname=no + ac_cv_var_tzname=no fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_var_tzname" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_var_tzname" >&5 $as_echo "$ac_cv_var_tzname" >&6; } if test $ac_cv_var_tzname = yes; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_TZNAME 1 -_ACEOF +$as_echo "#define HAVE_TZNAME 1" >>confdefs.h fi fi @@ -23534,202 +19596,40 @@ fi -for ac_func in getdelim -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ -#ifdef __STDC__ -# include -#else -# include -#endif -#undef $ac_func -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - eval "$as_ac_var=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if test `eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` = yes; then + + for ac_func in getdelim +do : + ac_fn_c_check_func "$LINENO" "getdelim" "ac_cv_func_getdelim" +if test "x$ac_cv_func_getdelim" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define HAVE_GETDELIM 1 _ACEOF else - gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" + + gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" + fi done - - if test $ac_cv_func_getdelim = no; then - - -for ac_func in flockfile funlockfile -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if test `eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` = yes; then + for ac_func in flockfile funlockfile +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +eval as_val=\$$as_ac_var + if test "x$as_val" = x""yes; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF @@ -23737,17 +19637,43 @@ _ACEOF fi done + ac_fn_c_check_decl "$LINENO" "getc_unlocked" "ac_cv_have_decl_getc_unlocked" "$ac_includes_default" +if test "x$ac_cv_have_decl_getc_unlocked" = x""yes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_GETC_UNLOCKED $ac_have_decl +_ACEOF + + + fi + + if test $ac_cv_have_decl_getdelim = no; then + HAVE_DECL_GETDELIM=0 fi - if test $ac_cv_func_getgroups_works = no; then - gl_LIBOBJS="$gl_LIBOBJS getgroups.$ac_objext" + GNULIB_GETDELIM=1 -cat >>confdefs.h <<\_ACEOF -#define getgroups rpl_getgroups -_ACEOF + + + if test "$ac_cv_func_getgroups_works" != yes; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS getgroups.$ac_objext" + + +$as_echo "#define getgroups rpl_getgroups" >>confdefs.h @@ -23757,198 +19683,66 @@ _ACEOF -for ac_func in gethostname -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ -#ifdef __STDC__ -# include -#else -# include -#endif -#undef $ac_func -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if test `eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` = yes; then + if test $ac_cv_header_sys_socket_h != yes; then + for ac_header in winsock2.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default" +if test "x$ac_cv_header_winsock2_h" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define HAVE_WINSOCK2_H 1 +_ACEOF + +fi + +done + + fi + if test "$ac_cv_header_winsock2_h" = yes; then + HAVE_WINSOCK2_H=1 + UNISTD_H_HAVE_WINSOCK2_H=1 + SYS_IOCTL_H_HAVE_WINSOCK2_H=1 + else + HAVE_WINSOCK2_H=0 + fi + + + + + + + + + + + for ac_func in gethostname +do : + ac_fn_c_check_func "$LINENO" "gethostname" "ac_cv_func_gethostname" +if test "x$ac_cv_func_gethostname" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_GETHOSTNAME 1 _ACEOF else - gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" + + gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" + fi done + if test $ac_cv_func_gethostname = no; then + HAVE_GETHOSTNAME=0 - -for ac_func in uname -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if test `eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` = yes; then + for ac_func in uname +do : + ac_fn_c_check_func "$LINENO" "uname" "ac_cv_func_uname" +if test "x$ac_cv_func_uname" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define HAVE_UNAME 1 _ACEOF fi @@ -23959,82 +19753,27 @@ done + GNULIB_GETHOSTNAME=1 - { $as_echo "$as_me:$LINENO: checking whether gethrtime is declared" >&5 -$as_echo_n "checking whether gethrtime is declared... " >&6; } -if test "${ac_cv_have_decl_gethrtime+set}" = set; then - $as_echo_n "(cached) " >&6 + + + + ac_fn_c_check_decl "$LINENO" "gethrtime" "ac_cv_have_decl_gethrtime" "#include +" +if test "x$ac_cv_have_decl_gethrtime" = x""yes; then : + ac_have_decl=1 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -int -main () -{ -#ifndef gethrtime - (void) gethrtime; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_gethrtime=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_gethrtime=no + ac_have_decl=0 fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_gethrtime" >&5 -$as_echo "$ac_cv_have_decl_gethrtime" >&6; } -if test $ac_cv_have_decl_gethrtime = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_GETHRTIME 1 +#define HAVE_DECL_GETHRTIME $ac_have_decl _ACEOF - -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_GETHRTIME 0 -_ACEOF - - -fi - - case $ac_cv_have_decl_gethrtime,$gl_cv_arithmetic_hrtime_t in yes,yes) ;; *) - gl_LIBOBJS="$gl_LIBOBJS gethrxtime.$ac_objext" @@ -24043,22 +19782,21 @@ fi + gl_LIBOBJS="$gl_LIBOBJS gethrxtime.$ac_objext" + + if test $ac_cv_func_nanouptime != yes; then LIB_GETHRXTIME= - { $as_echo "$as_me:$LINENO: checking whether CLOCK_MONOTONIC or CLOCK_REALTIME is defined" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether CLOCK_MONOTONIC or CLOCK_REALTIME is defined" >&5 $as_echo_n "checking whether CLOCK_MONOTONIC or CLOCK_REALTIME is defined... " >&6; } -if test "${gl_cv_have_clock_gettime_macro+set}" = set; then +if test "${gl_cv_have_clock_gettime_macro+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ # include @@ -24068,7 +19806,7 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "have_clock_gettime_macro" >/dev/null 2>&1; then + $EGREP "have_clock_gettime_macro" >/dev/null 2>&1; then : gl_cv_have_clock_gettime_macro=yes else gl_cv_have_clock_gettime_macro=no @@ -24076,7 +19814,7 @@ fi rm -f conftest* fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_have_clock_gettime_macro" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_clock_gettime_macro" >&5 $as_echo "$gl_cv_have_clock_gettime_macro" >&6; } if test $gl_cv_have_clock_gettime_macro = yes; then LIB_GETHRXTIME=$LIB_CLOCK_GETTIME @@ -24089,178 +19827,27 @@ $as_echo "$gl_cv_have_clock_gettime_macro" >&6; } - { $as_echo "$as_me:$LINENO: checking whether getline is declared" >&5 -$as_echo_n "checking whether getline is declared... " >&6; } -if test "${ac_cv_have_decl_getline+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef getline - (void) getline; -#endif - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_getline=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_getline=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_getline" >&5 -$as_echo "$ac_cv_have_decl_getline" >&6; } -if test $ac_cv_have_decl_getline = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_GETLINE 1 -_ACEOF - - -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_GETLINE 0 -_ACEOF - - -fi gl_getline_needs_run_time_check=no - { $as_echo "$as_me:$LINENO: checking for getline" >&5 -$as_echo_n "checking for getline... " >&6; } -if test "${ac_cv_func_getline+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define getline to an innocuous variant, in case declares getline. - For example, HP-UX 11i declares gettimeofday. */ -#define getline innocuous_getline - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char getline (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef getline - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char getline (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_getline || defined __stub___getline -choke me -#endif - -int -main () -{ -return getline (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_func_getline=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_func_getline=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_getline" >&5 -$as_echo "$ac_cv_func_getline" >&6; } -if test $ac_cv_func_getline = yes; then + ac_fn_c_check_func "$LINENO" "getline" "ac_cv_func_getline" +if test "x$ac_cv_func_getline" = x""yes; then : gl_getline_needs_run_time_check=yes else am_cv_func_working_getline=no fi if test $gl_getline_needs_run_time_check = yes; then - { $as_echo "$as_me:$LINENO: checking for working getline function" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working getline function" >&5 $as_echo_n "checking for working getline function... " >&6; } -if test "${am_cv_func_working_getline+set}" = set; then +if test "${am_cv_func_working_getline+set}" = set; then : $as_echo_n "(cached) " >&6 else echo fooN |tr -d '\012'|tr N '\012' > conftest.data - if test "$cross_compiling" = yes; then - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + if test "$cross_compiling" = yes; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -24272,7 +19859,7 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "Lucky GNU user" >/dev/null 2>&1; then + $EGREP "Lucky GNU user" >/dev/null 2>&1; then : am_cv_func_working_getline=yes else am_cv_func_working_getline=no @@ -24281,11 +19868,7 @@ rm -f conftest* else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ # include @@ -24304,53 +19887,26 @@ cat >>conftest.$ac_ext <<_ACEOF } _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_run "$LINENO"; then : am_cv_func_working_getline=yes else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -am_cv_func_working_getline=no + am_cv_func_working_getline=no fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi - fi -{ $as_echo "$as_me:$LINENO: result: $am_cv_func_working_getline" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_working_getline" >&5 $as_echo "$am_cv_func_working_getline" >&6; } fi + if test $ac_cv_have_decl_getline = no; then + HAVE_DECL_GETLINE=0 + fi + if test $am_cv_func_working_getline = no; then - -cat >>confdefs.h <<\_ACEOF -#define getline gnu_getline -_ACEOF - - gl_LIBOBJS="$gl_LIBOBJS getline.$ac_objext" + REPLACE_GETLINE=1 @@ -24358,202 +19914,50 @@ _ACEOF -for ac_func in getdelim -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ + gl_LIBOBJS="$gl_LIBOBJS getline.$ac_objext" -#ifdef __STDC__ -# include -#else -# include -#endif -#undef $ac_func -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - eval "$as_ac_var=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if test `eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` = yes; then + + + + + + + + + + + for ac_func in getdelim +do : + ac_fn_c_check_func "$LINENO" "getdelim" "ac_cv_func_getdelim" +if test "x$ac_cv_func_getdelim" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define HAVE_GETDELIM 1 _ACEOF else - gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" + + gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" + fi done - - if test $ac_cv_func_getdelim = no; then - - -for ac_func in flockfile funlockfile -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if test `eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` = yes; then + for ac_func in flockfile funlockfile +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +eval as_val=\$$as_ac_var + if test "x$as_val" = x""yes; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF @@ -24561,106 +19965,47 @@ _ACEOF fi done + ac_fn_c_check_decl "$LINENO" "getc_unlocked" "ac_cv_have_decl_getc_unlocked" "$ac_includes_default" +if test "x$ac_cv_have_decl_getc_unlocked" = x""yes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_GETC_UNLOCKED $ac_have_decl +_ACEOF + + + fi + + if test $ac_cv_have_decl_getdelim = no; then + HAVE_DECL_GETDELIM=0 fi fi - gl_have_func=no # yes means we've found a way to get the load average. + + + GNULIB_GETLINE=1 + + + +# Persuade glibc to declare getloadavg(). + + +gl_have_func=no # yes means we've found a way to get the load average. # Make sure getloadavg.c is where it belongs, at configure-time. test -f "$srcdir/lib/getloadavg.c" || - { { $as_echo "$as_me:$LINENO: error: $srcdir/lib/getloadavg.c is missing" >&5 -$as_echo "$as_me: error: $srcdir/lib/getloadavg.c is missing" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "$srcdir/lib/getloadavg.c is missing" "$LINENO" 5 gl_save_LIBS=$LIBS # Check for getloadavg, but be sure not to touch the cache variable. -({ $as_echo "$as_me:$LINENO: checking for getloadavg" >&5 -$as_echo_n "checking for getloadavg... " >&6; } -if test "${ac_cv_func_getloadavg+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define getloadavg to an innocuous variant, in case declares getloadavg. - For example, HP-UX 11i declares gettimeofday. */ -#define getloadavg innocuous_getloadavg - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char getloadavg (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef getloadavg - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char getloadavg (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_getloadavg || defined __stub___getloadavg -choke me -#endif - -int -main () -{ -return getloadavg (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_func_getloadavg=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_func_getloadavg=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_getloadavg" >&5 -$as_echo "$ac_cv_func_getloadavg" >&6; } -if test $ac_cv_func_getloadavg = yes; then +(ac_fn_c_check_func "$LINENO" "getloadavg" "ac_cv_func_getloadavg" +if test "x$ac_cv_func_getloadavg" = x""yes; then : exit 0 else exit 1 @@ -24668,98 +20013,12 @@ fi ) && gl_have_func=yes # On HPUX9, an unprivileged user can get load averages through this function. - for ac_func in pstat_getdynamic -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if test `eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` = yes; then +do : + ac_fn_c_check_func "$LINENO" "pstat_getdynamic" "ac_cv_func_pstat_getdynamic" +if test "x$ac_cv_func_pstat_getdynamic" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define HAVE_PSTAT_GETDYNAMIC 1 _ACEOF fi @@ -24767,19 +20026,14 @@ done # Solaris has libkstat which does not require root. - -{ $as_echo "$as_me:$LINENO: checking for kstat_open in -lkstat" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for kstat_open in -lkstat" >&5 $as_echo_n "checking for kstat_open in -lkstat... " >&6; } -if test "${ac_cv_lib_kstat_kstat_open+set}" = set; then +if test "${ac_cv_lib_kstat_kstat_open+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lkstat $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. @@ -24797,40 +20051,18 @@ return kstat_open (); return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_kstat_kstat_open=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_kstat_kstat_open=no + ac_cv_lib_kstat_kstat_open=no fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_kstat_kstat_open" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_kstat_kstat_open" >&5 $as_echo "$ac_cv_lib_kstat_kstat_open" >&6; } -if test $ac_cv_lib_kstat_kstat_open = yes; then +if test "x$ac_cv_lib_kstat_kstat_open" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBKSTAT 1 _ACEOF @@ -24841,23 +20073,67 @@ fi test $ac_cv_lib_kstat_kstat_open = yes && gl_have_func=yes +# AIX has libperfstat which does not require root +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for perfstat_cpu_total in -lperfstat" >&5 +$as_echo_n "checking for perfstat_cpu_total in -lperfstat... " >&6; } +if test "${ac_cv_lib_perfstat_perfstat_cpu_total+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lperfstat $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char perfstat_cpu_total (); +int +main () +{ +return perfstat_cpu_total (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_perfstat_perfstat_cpu_total=yes +else + ac_cv_lib_perfstat_perfstat_cpu_total=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_perfstat_perfstat_cpu_total" >&5 +$as_echo "$ac_cv_lib_perfstat_perfstat_cpu_total" >&6; } +if test "x$ac_cv_lib_perfstat_perfstat_cpu_total" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBPERFSTAT 1 +_ACEOF + + LIBS="-lperfstat $LIBS" + +fi + +test $ac_cv_lib_perfstat_perfstat_cpu_total = yes && gl_have_func=yes + # Some systems with -lutil have (and need) -lkvm as well, some do not. # On Solaris, -lkvm requires nlist from -lelf, so check that first # to get the right answer into the cache. # For kstat on solaris, we need libelf to force the definition of SVR4 below. if test $gl_have_func = no; then - { $as_echo "$as_me:$LINENO: checking for elf_begin in -lelf" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for elf_begin in -lelf" >&5 $as_echo_n "checking for elf_begin in -lelf... " >&6; } -if test "${ac_cv_lib_elf_elf_begin+set}" = set; then +if test "${ac_cv_lib_elf_elf_begin+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lelf $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. @@ -24875,57 +20151,31 @@ return elf_begin (); return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_elf_elf_begin=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_elf_elf_begin=no + ac_cv_lib_elf_elf_begin=no fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_elf_elf_begin" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_elf_elf_begin" >&5 $as_echo "$ac_cv_lib_elf_elf_begin" >&6; } -if test $ac_cv_lib_elf_elf_begin = yes; then +if test "x$ac_cv_lib_elf_elf_begin" = x""yes; then : LIBS="-lelf $LIBS" fi fi if test $gl_have_func = no; then - { $as_echo "$as_me:$LINENO: checking for kvm_open in -lkvm" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for kvm_open in -lkvm" >&5 $as_echo_n "checking for kvm_open in -lkvm... " >&6; } -if test "${ac_cv_lib_kvm_kvm_open+set}" = set; then +if test "${ac_cv_lib_kvm_kvm_open+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lkvm $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. @@ -24943,56 +20193,30 @@ return kvm_open (); return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_kvm_kvm_open=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_kvm_kvm_open=no + ac_cv_lib_kvm_kvm_open=no fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_kvm_kvm_open" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_kvm_kvm_open" >&5 $as_echo "$ac_cv_lib_kvm_kvm_open" >&6; } -if test $ac_cv_lib_kvm_kvm_open = yes; then +if test "x$ac_cv_lib_kvm_kvm_open" = x""yes; then : LIBS="-lkvm $LIBS" fi # Check for the 4.4BSD definition of getloadavg. - { $as_echo "$as_me:$LINENO: checking for getloadavg in -lutil" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getloadavg in -lutil" >&5 $as_echo_n "checking for getloadavg in -lutil... " >&6; } -if test "${ac_cv_lib_util_getloadavg+set}" = set; then +if test "${ac_cv_lib_util_getloadavg+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lutil $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. @@ -25010,40 +20234,18 @@ return getloadavg (); return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_util_getloadavg=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_util_getloadavg=no + ac_cv_lib_util_getloadavg=no fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_util_getloadavg" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_util_getloadavg" >&5 $as_echo "$ac_cv_lib_util_getloadavg" >&6; } -if test $ac_cv_lib_util_getloadavg = yes; then +if test "x$ac_cv_lib_util_getloadavg" = x""yes; then : LIBS="-lutil $LIBS" gl_have_func=yes gl_cv_func_getloadavg_setgid=yes fi @@ -25054,18 +20256,14 @@ if test $gl_have_func = no; then # Since it is not a standard part of AIX, it might be installed locally. gl_getloadavg_LIBS=$LIBS LIBS="-L/usr/local/lib $LIBS" - { $as_echo "$as_me:$LINENO: checking for getloadavg in -lgetloadavg" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getloadavg in -lgetloadavg" >&5 $as_echo_n "checking for getloadavg in -lgetloadavg... " >&6; } -if test "${ac_cv_lib_getloadavg_getloadavg+set}" = set; then +if test "${ac_cv_lib_getloadavg_getloadavg+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lgetloadavg $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. @@ -25083,40 +20281,18 @@ return getloadavg (); return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_getloadavg_getloadavg=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_getloadavg_getloadavg=no + ac_cv_lib_getloadavg_getloadavg=no fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_getloadavg_getloadavg" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_getloadavg_getloadavg" >&5 $as_echo "$ac_cv_lib_getloadavg_getloadavg" >&6; } -if test $ac_cv_lib_getloadavg_getloadavg = yes; then +if test "x$ac_cv_lib_getloadavg_getloadavg" = x""yes; then : LIBS="-lgetloadavg $LIBS" else LIBS=$gl_getloadavg_LIBS @@ -25126,261 +20302,44 @@ fi # Make sure it is really in the library, if we think we found it, # otherwise set up the replacement function. - for ac_func in getloadavg -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if test `eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` = yes; then +do : + ac_fn_c_check_func "$LINENO" "getloadavg" "ac_cv_func_getloadavg" +if test "x$ac_cv_func_getloadavg" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define HAVE_GETLOADAVG 1 _ACEOF else + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS getloadavg.$ac_objext" -cat >>confdefs.h <<\_ACEOF -#define C_GETLOADAVG 1 -_ACEOF + +$as_echo "#define C_GETLOADAVG 1" >>confdefs.h # Figure out what our getloadavg.c needs. gl_have_func=no -if test "${ac_cv_header_sys_dg_sys_info_h+set}" = set; then - { $as_echo "$as_me:$LINENO: checking for sys/dg_sys_info.h" >&5 -$as_echo_n "checking for sys/dg_sys_info.h... " >&6; } -if test "${ac_cv_header_sys_dg_sys_info_h+set}" = set; then - $as_echo_n "(cached) " >&6 -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_sys_dg_sys_info_h" >&5 -$as_echo "$ac_cv_header_sys_dg_sys_info_h" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking sys/dg_sys_info.h usability" >&5 -$as_echo_n "checking sys/dg_sys_info.h usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking sys/dg_sys_info.h presence" >&5 -$as_echo_n "checking sys/dg_sys_info.h presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: sys/dg_sys_info.h: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: sys/dg_sys_info.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: sys/dg_sys_info.h: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: sys/dg_sys_info.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: sys/dg_sys_info.h: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: sys/dg_sys_info.h: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: sys/dg_sys_info.h: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: sys/dg_sys_info.h: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: sys/dg_sys_info.h: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: sys/dg_sys_info.h: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: sys/dg_sys_info.h: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: sys/dg_sys_info.h: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: sys/dg_sys_info.h: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: sys/dg_sys_info.h: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: sys/dg_sys_info.h: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: sys/dg_sys_info.h: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-coreutils@gnu.org ## -## ------------------------------------ ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for sys/dg_sys_info.h" >&5 -$as_echo_n "checking for sys/dg_sys_info.h... " >&6; } -if test "${ac_cv_header_sys_dg_sys_info_h+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_cv_header_sys_dg_sys_info_h=$ac_header_preproc -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_sys_dg_sys_info_h" >&5 -$as_echo "$ac_cv_header_sys_dg_sys_info_h" >&6; } - -fi -if test $ac_cv_header_sys_dg_sys_info_h = yes; then +ac_fn_c_check_header_mongrel "$LINENO" "sys/dg_sys_info.h" "ac_cv_header_sys_dg_sys_info_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_dg_sys_info_h" = x""yes; then : gl_have_func=yes -cat >>confdefs.h <<\_ACEOF -#define DGUX 1 -_ACEOF +$as_echo "#define DGUX 1" >>confdefs.h - -{ $as_echo "$as_me:$LINENO: checking for dg_sys_info in -ldgc" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dg_sys_info in -ldgc" >&5 $as_echo_n "checking for dg_sys_info in -ldgc... " >&6; } -if test "${ac_cv_lib_dgc_dg_sys_info+set}" = set; then +if test "${ac_cv_lib_dgc_dg_sys_info+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldgc $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. @@ -25398,40 +20357,18 @@ return dg_sys_info (); return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dgc_dg_sys_info=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_dgc_dg_sys_info=no + ac_cv_lib_dgc_dg_sys_info=no fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dgc_dg_sys_info" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dgc_dg_sys_info" >&5 $as_echo "$ac_cv_lib_dgc_dg_sys_info" >&6; } -if test $ac_cv_lib_dgc_dg_sys_info = yes; then +if test "x$ac_cv_lib_dgc_dg_sys_info" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBDGC 1 _ACEOF @@ -25450,156 +20387,19 @@ fi if test $gl_have_func = no && test "$ac_cv_lib_elf_elf_begin" = yes; then gl_have_func=yes -cat >>confdefs.h <<\_ACEOF -#define SVR4 1 -_ACEOF +$as_echo "#define SVR4 1" >>confdefs.h fi if test $gl_have_func = no; then - if test "${ac_cv_header_inq_stats_cpustats_h+set}" = set; then - { $as_echo "$as_me:$LINENO: checking for inq_stats/cpustats.h" >&5 -$as_echo_n "checking for inq_stats/cpustats.h... " >&6; } -if test "${ac_cv_header_inq_stats_cpustats_h+set}" = set; then - $as_echo_n "(cached) " >&6 -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_inq_stats_cpustats_h" >&5 -$as_echo "$ac_cv_header_inq_stats_cpustats_h" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking inq_stats/cpustats.h usability" >&5 -$as_echo_n "checking inq_stats/cpustats.h usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking inq_stats/cpustats.h presence" >&5 -$as_echo_n "checking inq_stats/cpustats.h presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: inq_stats/cpustats.h: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: inq_stats/cpustats.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: inq_stats/cpustats.h: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: inq_stats/cpustats.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: inq_stats/cpustats.h: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: inq_stats/cpustats.h: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: inq_stats/cpustats.h: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: inq_stats/cpustats.h: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: inq_stats/cpustats.h: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: inq_stats/cpustats.h: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: inq_stats/cpustats.h: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: inq_stats/cpustats.h: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: inq_stats/cpustats.h: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: inq_stats/cpustats.h: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: inq_stats/cpustats.h: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: inq_stats/cpustats.h: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-coreutils@gnu.org ## -## ------------------------------------ ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for inq_stats/cpustats.h" >&5 -$as_echo_n "checking for inq_stats/cpustats.h... " >&6; } -if test "${ac_cv_header_inq_stats_cpustats_h+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_cv_header_inq_stats_cpustats_h=$ac_header_preproc -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_inq_stats_cpustats_h" >&5 -$as_echo "$ac_cv_header_inq_stats_cpustats_h" >&6; } - -fi -if test $ac_cv_header_inq_stats_cpustats_h = yes; then + ac_fn_c_check_header_mongrel "$LINENO" "inq_stats/cpustats.h" "ac_cv_header_inq_stats_cpustats_h" "$ac_includes_default" +if test "x$ac_cv_header_inq_stats_cpustats_h" = x""yes; then : gl_have_func=yes -cat >>confdefs.h <<\_ACEOF -#define UMAX 1 -_ACEOF +$as_echo "#define UMAX 1" >>confdefs.h -cat >>confdefs.h <<\_ACEOF -#define UMAX4_3 1 -_ACEOF +$as_echo "#define UMAX4_3 1" >>confdefs.h fi @@ -25607,142 +20407,9 @@ fi fi if test $gl_have_func = no; then - if test "${ac_cv_header_sys_cpustats_h+set}" = set; then - { $as_echo "$as_me:$LINENO: checking for sys/cpustats.h" >&5 -$as_echo_n "checking for sys/cpustats.h... " >&6; } -if test "${ac_cv_header_sys_cpustats_h+set}" = set; then - $as_echo_n "(cached) " >&6 -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_sys_cpustats_h" >&5 -$as_echo "$ac_cv_header_sys_cpustats_h" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking sys/cpustats.h usability" >&5 -$as_echo_n "checking sys/cpustats.h usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking sys/cpustats.h presence" >&5 -$as_echo_n "checking sys/cpustats.h presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: sys/cpustats.h: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: sys/cpustats.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: sys/cpustats.h: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: sys/cpustats.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: sys/cpustats.h: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: sys/cpustats.h: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: sys/cpustats.h: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: sys/cpustats.h: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: sys/cpustats.h: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: sys/cpustats.h: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: sys/cpustats.h: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: sys/cpustats.h: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: sys/cpustats.h: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: sys/cpustats.h: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: sys/cpustats.h: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: sys/cpustats.h: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-coreutils@gnu.org ## -## ------------------------------------ ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for sys/cpustats.h" >&5 -$as_echo_n "checking for sys/cpustats.h... " >&6; } -if test "${ac_cv_header_sys_cpustats_h+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_cv_header_sys_cpustats_h=$ac_header_preproc -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_sys_cpustats_h" >&5 -$as_echo "$ac_cv_header_sys_cpustats_h" >&6; } - -fi -if test $ac_cv_header_sys_cpustats_h = yes; then - gl_have_func=yes; cat >>confdefs.h <<\_ACEOF -#define UMAX 1 -_ACEOF + ac_fn_c_check_header_mongrel "$LINENO" "sys/cpustats.h" "ac_cv_header_sys_cpustats_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_cpustats_h" = x""yes; then : + gl_have_func=yes; $as_echo "#define UMAX 1" >>confdefs.h fi @@ -25750,150 +20417,12 @@ fi fi if test $gl_have_func = no; then - -for ac_header in mach/mach.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-coreutils@gnu.org ## -## ------------------------------------ ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - -fi -if test `eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` = yes; then + for ac_header in mach/mach.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "mach/mach.h" "ac_cv_header_mach_mach_h" "$ac_includes_default" +if test "x$ac_cv_header_mach_mach_h" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define HAVE_MACH_MACH_H 1 _ACEOF fi @@ -25902,258 +20431,23 @@ done fi - for ac_header in nlist.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-coreutils@gnu.org ## -## ------------------------------------ ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - -fi -if test `eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` = yes; then +do : + ac_fn_c_check_header_mongrel "$LINENO" "nlist.h" "ac_cv_header_nlist_h" "$ac_includes_default" +if test "x$ac_cv_header_nlist_h" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define HAVE_NLIST_H 1 _ACEOF - { $as_echo "$as_me:$LINENO: checking for struct nlist.n_un.n_name" >&5 -$as_echo_n "checking for struct nlist.n_un.n_name... " >&6; } -if test "${ac_cv_member_struct_nlist_n_un_n_name+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -int -main () -{ -static struct nlist ac_aggr; -if (ac_aggr.n_un.n_name) -return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_member_struct_nlist_n_un_n_name=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -int -main () -{ -static struct nlist ac_aggr; -if (sizeof ac_aggr.n_un.n_name) -return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_member_struct_nlist_n_un_n_name=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_member_struct_nlist_n_un_n_name=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_nlist_n_un_n_name" >&5 -$as_echo "$ac_cv_member_struct_nlist_n_un_n_name" >&6; } -if test $ac_cv_member_struct_nlist_n_un_n_name = yes; then + ac_fn_c_check_member "$LINENO" "struct nlist" "n_un.n_name" "ac_cv_member_struct_nlist_n_un_n_name" "#include +" +if test "x$ac_cv_member_struct_nlist_n_un_n_name" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_NLIST_N_UN_N_NAME 1 _ACEOF -cat >>confdefs.h <<\_ACEOF -#define NLIST_NAME_UNION 1 -_ACEOF +$as_echo "#define NLIST_NAME_UNION 1" >>confdefs.h fi @@ -26167,16 +20461,12 @@ done # Some definitions of getloadavg require that the program be installed setgid. -{ $as_echo "$as_me:$LINENO: checking whether getloadavg requires setgid" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getloadavg requires setgid" >&5 $as_echo_n "checking whether getloadavg requires setgid... " >&6; } -if test "${gl_cv_func_getloadavg_setgid+set}" = set; then +if test "${gl_cv_func_getloadavg_setgid+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define CONFIGURING_GETLOADAVG #include "$srcdir/lib/getloadavg.c" @@ -26186,7 +20476,7 @@ Yowza Am I SETGID yet _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "Yowza Am I SETGID yet" >/dev/null 2>&1; then + $EGREP "Yowza Am I SETGID yet" >/dev/null 2>&1; then : gl_cv_func_getloadavg_setgid=yes else gl_cv_func_getloadavg_setgid=no @@ -26194,23 +20484,21 @@ fi rm -f conftest* fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_getloadavg_setgid" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getloadavg_setgid" >&5 $as_echo "$gl_cv_func_getloadavg_setgid" >&6; } if test $gl_cv_func_getloadavg_setgid = yes; then NEED_SETGID=true -cat >>confdefs.h <<\_ACEOF -#define GETLOADAVG_PRIVILEGED 1 -_ACEOF +$as_echo "#define GETLOADAVG_PRIVILEGED 1" >>confdefs.h else NEED_SETGID=false fi if test $gl_cv_func_getloadavg_setgid = yes; then - { $as_echo "$as_me:$LINENO: checking group of /dev/kmem" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking group of /dev/kmem" >&5 $as_echo_n "checking group of /dev/kmem... " >&6; } -if test "${gl_cv_group_kmem+set}" = set; then +if test "${gl_cv_group_kmem+set}" = set; then : $as_echo_n "(cached) " >&6 else # On Solaris, /dev/kmem is a symlink. Get info on the real file. @@ -26223,7 +20511,7 @@ else / /s/.* //;p'` fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_group_kmem" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_group_kmem" >&5 $as_echo "$gl_cv_group_kmem" >&6; } KMEM_GROUP=$gl_cv_group_kmem fi @@ -26235,6 +20523,49 @@ fi LIBS=$gl_save_LIBS +# Test whether the system declares getloadavg. Solaris has the function +# but declares it in , not . +for ac_header in sys/loadavg.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "sys/loadavg.h" "ac_cv_header_sys_loadavg_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_loadavg_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SYS_LOADAVG_H 1 +_ACEOF + +fi + +done + +if test $ac_cv_header_sys_loadavg_h = yes; then + HAVE_SYS_LOADAVG_H=1 +else + HAVE_SYS_LOADAVG_H=0 +fi +ac_fn_c_check_decl "$LINENO" "getloadavg" "ac_cv_have_decl_getloadavg" "#if HAVE_SYS_LOADAVG_H + # include + #endif + #include +" +if test "x$ac_cv_have_decl_getloadavg" = x""yes; then : + +else + HAVE_DECL_GETLOADAVG=0 +fi + + + + + GNULIB_GETLOADAVG=1 + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS getndelim2.$ac_objext" @@ -26243,19 +20574,35 @@ LIBS=$gl_save_LIBS - if test -n "$GETOPT_H"; then + + + + if test -n "$GETOPT_H"; then : + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS getopt.$ac_objext" + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS getopt1.$ac_objext" + GETOPT_H=getopt.h -cat >>confdefs.h <<\_ACEOF -#define __GETOPT_PREFIX rpl_ -_ACEOF - - - +$as_echo "#define __GETOPT_PREFIX rpl_" >>confdefs.h @@ -26268,265 +20615,69 @@ fi - - - - - - -for ac_header in OS.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-coreutils@gnu.org ## -## ------------------------------------ ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - -fi -if test `eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` = yes; then + for ac_func in getpagesize +do : + ac_fn_c_check_func "$LINENO" "getpagesize" "ac_cv_func_getpagesize" +if test "x$ac_cv_func_getpagesize" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define HAVE_GETPAGESIZE 1 +_ACEOF + +fi +done + + if test $ac_cv_func_getpagesize = no; then + HAVE_GETPAGESIZE=0 + for ac_header in OS.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "OS.h" "ac_cv_header_OS_h" "$ac_includes_default" +if test "x$ac_cv_header_OS_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_OS_H 1 _ACEOF fi done - -for ac_func in getpagesize -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if test `eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` = yes; then + if test $ac_cv_header_OS_h = yes; then + HAVE_OS_H=1 + fi + for ac_header in sys/param.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "sys/param.h" "ac_cv_header_sys_param_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_param_h" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define HAVE_SYS_PARAM_H 1 _ACEOF fi + done + if test $ac_cv_header_sys_param_h = yes; then + HAVE_SYS_PARAM_H=1 + fi + fi + case "$host_os" in + mingw*) + REPLACE_GETPAGESIZE=1 - gl_LIBOBJS="$gl_LIBOBJS getpass.$ac_objext" + + + gl_LIBOBJS="$gl_LIBOBJS getpagesize.$ac_objext" + + ;; + esac + + + + GNULIB_GETPAGESIZE=1 @@ -26538,103 +20689,27 @@ done + gl_LIBOBJS="$gl_LIBOBJS getpass.$ac_objext" - - - - - { $as_echo "$as_me:$LINENO: checking whether __fsetlocking is declared" >&5 -$as_echo_n "checking whether __fsetlocking is declared... " >&6; } -if test "${ac_cv_have_decl___fsetlocking+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include + ac_fn_c_check_decl "$LINENO" "__fsetlocking" "ac_cv_have_decl___fsetlocking" "#include #if HAVE_STDIO_EXT_H #include #endif - -int -main () -{ -#ifndef __fsetlocking - (void) __fsetlocking; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl___fsetlocking=yes +" +if test "x$ac_cv_have_decl___fsetlocking" = x""yes; then : + ac_have_decl=1 else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl___fsetlocking=no + ac_have_decl=0 fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl___fsetlocking" >&5 -$as_echo "$ac_cv_have_decl___fsetlocking" >&6; } -if test $ac_cv_have_decl___fsetlocking = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL___FSETLOCKING 1 +#define HAVE_DECL___FSETLOCKING $ac_have_decl _ACEOF -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL___FSETLOCKING 0 -_ACEOF - - -fi - - - - - - - - - - - - - - - - - - @@ -26642,9 +20717,17 @@ fi : -cat >>confdefs.h <<\_ACEOF -#define getpass gnu_getpass -_ACEOF +$as_echo "#define getpass gnu_getpass" >>confdefs.h + + + + + + + + + + @@ -26661,27 +20744,12 @@ _ACEOF - - - - - - - - - - - - { $as_echo "$as_me:$LINENO: checking for gettimeofday with POSIX signature" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gettimeofday with POSIX signature" >&5 $as_echo_n "checking for gettimeofday with POSIX signature... " >&6; } -if test "${gl_cv_func_gettimeofday_posix_signature+set}" = set; then +if test "${gl_cv_func_gettimeofday_posix_signature+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include struct timeval c; @@ -26698,53 +20766,28 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : gl_cv_func_gettimeofday_posix_signature=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - gl_cv_func_gettimeofday_posix_signature=no + gl_cv_func_gettimeofday_posix_signature=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_gettimeofday_posix_signature" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_gettimeofday_posix_signature" >&5 $as_echo "$gl_cv_func_gettimeofday_posix_signature" >&6; } - { $as_echo "$as_me:$LINENO: checking whether gettimeofday clobbers localtime buffer" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether gettimeofday clobbers localtime buffer" >&5 $as_echo_n "checking whether gettimeofday clobbers localtime buffer... " >&6; } -if test "${gl_cv_func_gettimeofday_clobber+set}" = set; then +if test "${gl_cv_func_gettimeofday_clobber+set}" = set; then : $as_echo_n "(cached) " >&6 else - if test "$cross_compiling" = yes; then + if test "$cross_compiling" = yes; then : gl_cv_func_gettimeofday_clobber=yes else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include @@ -26768,293 +20811,52 @@ main () return 0; } _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_run "$LINENO"; then : gl_cv_func_gettimeofday_clobber=no else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -gl_cv_func_gettimeofday_clobber=yes + gl_cv_func_gettimeofday_clobber=yes fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi - fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_gettimeofday_clobber" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_gettimeofday_clobber" >&5 $as_echo "$gl_cv_func_gettimeofday_clobber" >&6; } if test $gl_cv_func_gettimeofday_clobber = yes; then REPLACE_GETTIMEOFDAY=1 SYS_TIME_H=sys/time.h + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS gettimeofday.$ac_objext" -for ac_header in sys/timeb.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-coreutils@gnu.org ## -## ------------------------------------ ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - -fi -if test `eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` = yes; then + for ac_header in sys/timeb.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "sys/timeb.h" "ac_cv_header_sys_timeb_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_timeb_h" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define HAVE_SYS_TIMEB_H 1 _ACEOF fi done - -for ac_func in _ftime -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if test `eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` = yes; then + for ac_func in _ftime +do : + ac_fn_c_check_func "$LINENO" "_ftime" "ac_cv_func__ftime" +if test "x$ac_cv_func__ftime" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define HAVE__FTIME 1 _ACEOF fi @@ -27062,20 +20864,14 @@ done -cat >>confdefs.h <<\_ACEOF -#define gmtime rpl_gmtime -_ACEOF +$as_echo "#define gmtime rpl_gmtime" >>confdefs.h -cat >>confdefs.h <<\_ACEOF -#define localtime rpl_localtime -_ACEOF +$as_echo "#define localtime rpl_localtime" >>confdefs.h -cat >>confdefs.h <<\_ACEOF -#define GETTIMEOFDAY_CLOBBERS_LOCALTIME 1 -_ACEOF +$as_echo "#define GETTIMEOFDAY_CLOBBERS_LOCALTIME 1" >>confdefs.h fi @@ -27084,250 +20880,35 @@ _ACEOF REPLACE_GETTIMEOFDAY=1 SYS_TIME_H=sys/time.h if test $gl_cv_func_gettimeofday_clobber != yes; then - gl_LIBOBJS="$gl_LIBOBJS gettimeofday.$ac_objext" -for ac_header in sys/timeb.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_compiler=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-coreutils@gnu.org ## -## ------------------------------------ ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } + gl_LIBOBJS="$gl_LIBOBJS gettimeofday.$ac_objext" -fi -if test `eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` = yes; then + + for ac_header in sys/timeb.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "sys/timeb.h" "ac_cv_header_sys_timeb_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_timeb_h" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define HAVE_SYS_TIMEB_H 1 _ACEOF fi done - -for ac_func in _ftime -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if test `eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` = yes; then + for ac_func in _ftime +do : + ac_fn_c_check_func "$LINENO" "_ftime" "ac_cv_func__ftime" +if test "x$ac_cv_func__ftime" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define HAVE__FTIME 1 _ACEOF fi @@ -27338,21 +20919,26 @@ done fi + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS getugroups.$ac_objext" - { $as_echo "$as_me:$LINENO: checking type of array argument to getgroups" >&5 + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking type of array argument to getgroups" >&5 $as_echo_n "checking type of array argument to getgroups... " >&6; } -if test "${ac_cv_type_getgroups+set}" = set; then +if test "${ac_cv_type_getgroups+set}" = set; then : $as_echo_n "(cached) " >&6 else - if test "$cross_compiling" = yes; then + if test "$cross_compiling" = yes; then : ac_cv_type_getgroups=cross else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Thanks to Mike Rendell for this test. */ $ac_includes_default @@ -27378,53 +20964,23 @@ main () return n > 0 && gidset[n] != val.gval; } _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_run "$LINENO"; then : ac_cv_type_getgroups=gid_t else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_type_getgroups=int + ac_cv_type_getgroups=int fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi - if test $ac_cv_type_getgroups = cross; then - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "getgroups.*int.*gid_t" >/dev/null 2>&1; then + $EGREP "getgroups.*int.*gid_t" >/dev/null 2>&1; then : ac_cv_type_getgroups=gid_t else ac_cv_type_getgroups=int @@ -27433,7 +20989,7 @@ rm -f conftest* fi fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_getgroups" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_getgroups" >&5 $as_echo "$ac_cv_type_getgroups" >&6; } cat >>confdefs.h <<_ACEOF @@ -27444,195 +21000,77 @@ _ACEOF -for ac_func in getusershell -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ -#ifdef __STDC__ -# include -#else -# include -#endif -#undef $ac_func -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - eval "$as_ac_var=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if test `eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` = yes; then + + + + + for ac_func in getusershell +do : + ac_fn_c_check_func "$LINENO" "getusershell" "ac_cv_func_getusershell" +if test "x$ac_cv_func_getusershell" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define HAVE_GETUSERSHELL 1 _ACEOF else - gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" + + gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" + fi done + if test $ac_cv_func_getusershell = no; then + HAVE_GETUSERSHELL=0 + fi - { $as_echo "$as_me:$LINENO: checking for group_member" >&5 -$as_echo_n "checking for group_member... " >&6; } -if test "${ac_cv_func_group_member+set}" = set; then - $as_echo_n "(cached) " >&6 + GNULIB_GETUSERSHELL=1 + + + if ${MAKE-make} --version /cannot/make/this >/dev/null 2>&1; then + GNU_MAKE_TRUE= + GNU_MAKE_FALSE='#' else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define group_member to an innocuous variant, in case declares group_member. - For example, HP-UX 11i declares gettimeofday. */ -#define group_member innocuous_group_member - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char group_member (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef group_member - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char group_member (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_group_member || defined __stub___group_member -choke me -#endif - -int -main () -{ -return group_member (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_func_group_member=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_func_group_member=no + GNU_MAKE_TRUE='#' + GNU_MAKE_FALSE= fi -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_group_member" >&5 -$as_echo "$ac_cv_func_group_member" >&6; } -if test $ac_cv_func_group_member = yes; then - : + + # Autoconf 2.61a.99 and earlier don't support linking a file only + # in VPATH builds. But since GNUmakefile is for maintainer use + # only, it does not matter if we skip the link with older autoconf. + # Automake 1.10.1 and earlier try to remove GNUmakefile in non-VPATH + # builds, so use a shell variable to bypass this. + GNUmakefile=GNUmakefile + ac_config_links="$ac_config_links $GNUmakefile:$GNUmakefile" + + + + + ac_fn_c_check_func "$LINENO" "group_member" "ac_cv_func_group_member" +if test "x$ac_cv_func_group_member" = x""yes; then : + else - gl_LIBOBJS="$gl_LIBOBJS group-member.$ac_objext" + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS group-member.$ac_objext" + @@ -27641,17 +21079,35 @@ fi + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS hard-locale.$ac_objext" + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS hash.$ac_objext" - { $as_echo "$as_me:$LINENO: checking host operating system" >&5 + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking host operating system" >&5 $as_echo_n "checking host operating system... " >&6; } -if test "${gl_cv_host_operating_system+set}" = set; then +if test "${gl_cv_host_operating_system+set}" = set; then : $as_echo_n "(cached) " >&6 else case $host_os in @@ -27715,7 +21171,7 @@ else esac gl_cv_host_operating_system=$os fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_host_operating_system" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_host_operating_system" >&5 $as_echo "$gl_cv_host_operating_system" >&6; } cat >>confdefs.h <<_ACEOF @@ -27724,11 +21180,145 @@ _ACEOF + HOSTENT_LIB= + gl_saved_libs="$LIBS" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing gethostbyname" >&5 +$as_echo_n "checking for library containing gethostbyname... " >&6; } +if test "${ac_cv_search_gethostbyname+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char gethostbyname (); +int +main () +{ +return gethostbyname (); + ; + return 0; +} +_ACEOF +for ac_lib in '' nsl network net; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_gethostbyname=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if test "${ac_cv_search_gethostbyname+set}" = set; then : + break +fi +done +if test "${ac_cv_search_gethostbyname+set}" = set; then : + +else + ac_cv_search_gethostbyname=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_gethostbyname" >&5 +$as_echo "$ac_cv_search_gethostbyname" >&6; } +ac_res=$ac_cv_search_gethostbyname +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + if test "$ac_cv_search_gethostbyname" != "none required"; then + HOSTENT_LIB="$ac_cv_search_gethostbyname" + fi +fi + + LIBS="$gl_saved_libs" + if test -z "$HOSTENT_LIB"; then + for ac_func in gethostbyname +do : + ac_fn_c_check_func "$LINENO" "gethostbyname" "ac_cv_func_gethostbyname" +if test "x$ac_cv_func_gethostbyname" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_GETHOSTBYNAME 1 +_ACEOF + +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in winsock2.h and -lws2_32" >&5 +$as_echo_n "checking for gethostbyname in winsock2.h and -lws2_32... " >&6; } +if test "${gl_cv_w32_gethostbyname+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + gl_cv_w32_gethostbyname=no + gl_save_LIBS="$LIBS" + LIBS="$LIBS -lws2_32" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifdef HAVE_WINSOCK2_H +#include +#endif +#include + +int +main () +{ +gethostbyname(NULL); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_w32_gethostbyname=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$gl_save_LIBS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_w32_gethostbyname" >&5 +$as_echo "$gl_cv_w32_gethostbyname" >&6; } + if test "$gl_cv_w32_gethostbyname" = "yes"; then + HOSTENT_LIB="-lws2_32" + fi + +fi +done + + fi + + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS human.$ac_objext" + : + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS i-ring.$ac_objext" @@ -27736,6 +21326,7 @@ _ACEOF + am_save_CPPFLAGS="$CPPFLAGS" for element in $INCICONV; do @@ -27761,19 +21352,15 @@ _ACEOF done - { $as_echo "$as_me:$LINENO: checking for iconv" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv" >&5 $as_echo_n "checking for iconv... " >&6; } -if test "${am_cv_func_iconv+set}" = set; then +if test "${am_cv_func_iconv+set}" = set; then : $as_echo_n "(cached) " >&6 else am_cv_func_iconv="no, consider installing GNU libiconv" am_cv_lib_iconv=no - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include @@ -27787,43 +21374,15 @@ iconv_t cd = iconv_open("",""); return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then +if ac_fn_c_try_link "$LINENO"; then : am_cv_func_iconv=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext if test "$am_cv_func_iconv" != yes; then am_save_LIBS="$LIBS" LIBS="$LIBS $LIBICONV" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include @@ -27837,53 +21396,125 @@ iconv_t cd = iconv_open("",""); return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then +if ac_fn_c_try_link "$LINENO"; then : am_cv_lib_iconv=yes am_cv_func_iconv=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS="$am_save_LIBS" fi fi -{ $as_echo "$as_me:$LINENO: result: $am_cv_func_iconv" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv" >&5 $as_echo "$am_cv_func_iconv" >&6; } if test "$am_cv_func_iconv" = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working iconv" >&5 +$as_echo_n "checking for working iconv... " >&6; } +if test "${am_cv_func_iconv_works+set}" = set; then : + $as_echo_n "(cached) " >&6 +else -cat >>confdefs.h <<\_ACEOF -#define HAVE_ICONV 1 + am_save_LIBS="$LIBS" + if test $am_cv_lib_iconv = yes; then + LIBS="$LIBS $LIBICONV" + fi + if test "$cross_compiling" = yes; then : + case "$host_os" in + aix* | hpux*) am_cv_func_iconv_works="guessing no" ;; + *) am_cv_func_iconv_works="guessing yes" ;; + esac +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +int main () +{ + /* Test against AIX 5.1 bug: Failures are not distinguishable from successful + returns. */ + { + iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8"); + if (cd_utf8_to_88591 != (iconv_t)(-1)) + { + static const char input[] = "\342\202\254"; /* EURO SIGN */ + char buf[10]; + const char *inptr = input; + size_t inbytesleft = strlen (input); + char *outptr = buf; + size_t outbytesleft = sizeof (buf); + size_t res = iconv (cd_utf8_to_88591, + (char **) &inptr, &inbytesleft, + &outptr, &outbytesleft); + if (res == 0) + return 1; + } + } +#if 0 /* This bug could be worked around by the caller. */ + /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */ + { + iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591"); + if (cd_88591_to_utf8 != (iconv_t)(-1)) + { + static const char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337"; + char buf[50]; + const char *inptr = input; + size_t inbytesleft = strlen (input); + char *outptr = buf; + size_t outbytesleft = sizeof (buf); + size_t res = iconv (cd_88591_to_utf8, + (char **) &inptr, &inbytesleft, + &outptr, &outbytesleft); + if ((int)res > 0) + return 1; + } + } +#endif + /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is + provided. */ + if (/* Try standardized names. */ + iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1) + /* Try IRIX, OSF/1 names. */ + && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1) + /* Try AIX names. */ + && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1) + /* Try HP-UX names. */ + && iconv_open ("utf8", "eucJP") == (iconv_t)(-1)) + return 1; + return 0; +} _ACEOF +if ac_fn_c_try_run "$LINENO"; then : + am_cv_func_iconv_works=yes +else + am_cv_func_iconv_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi + + LIBS="$am_save_LIBS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv_works" >&5 +$as_echo "$am_cv_func_iconv_works" >&6; } + case "$am_cv_func_iconv_works" in + *no) am_func_iconv=no am_cv_lib_iconv=no ;; + *) am_func_iconv=yes ;; + esac + else + am_func_iconv=no am_cv_lib_iconv=no + fi + if test "$am_func_iconv" = yes; then + +$as_echo "#define HAVE_ICONV 1" >>confdefs.h fi if test "$am_cv_lib_iconv" = yes; then - { $as_echo "$as_me:$LINENO: checking how to link with libiconv" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link with libiconv" >&5 $as_echo_n "checking how to link with libiconv... " >&6; } - { $as_echo "$as_me:$LINENO: result: $LIBICONV" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBICONV" >&5 $as_echo "$LIBICONV" >&6; } else CPPFLAGS="$am_save_CPPFLAGS" @@ -27894,17 +21525,13 @@ $as_echo "$LIBICONV" >&6; } if test "$am_cv_func_iconv" = yes; then - { $as_echo "$as_me:$LINENO: checking for iconv declaration" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv declaration" >&5 $as_echo_n "checking for iconv declaration... " >&6; } - if test "${am_cv_proto_iconv+set}" = set; then + if test "${am_cv_proto_iconv+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -27927,38 +21554,17 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : am_cv_proto_iconv_arg1="" else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - am_cv_proto_iconv_arg1="const" + am_cv_proto_iconv_arg1="const" fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);" fi am_cv_proto_iconv=`echo "$am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` - { $as_echo "$as_me:$LINENO: result: ${ac_t:- + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${ac_t:- }$am_cv_proto_iconv" >&5 $as_echo "${ac_t:- }$am_cv_proto_iconv" >&6; } @@ -27970,40 +21576,139 @@ _ACEOF fi + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_iconv_h='<'iconv.h'>' + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +$as_echo_n "checking absolute name of ... " >&6; } +if test "${gl_cv_next_iconv_h+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + if test $ac_cv_header_iconv_h = yes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + gl_cv_next_iconv_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n '\#/iconv.h#{ + s#.*"\(.*/iconv.h\)".*#\1# + s#^/[^/]#//&# + p + q + }'`'"' + else + gl_cv_next_iconv_h='<'iconv.h'>' + fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_iconv_h" >&5 +$as_echo "$gl_cv_next_iconv_h" >&6; } + fi + NEXT_ICONV_H=$gl_cv_next_iconv_h + + + + + + + + + if test "$am_cv_func_iconv" = yes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #if defined _LIBICONV_VERSION || defined __GLIBC__ + gnu_iconv + #endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "gnu_iconv" >/dev/null 2>&1; then : + gl_func_iconv_gnu=yes +else + gl_func_iconv_gnu=no +fi +rm -f conftest* + + if test $gl_func_iconv_gnu = no; then + iconv_flavor= + case "$host_os" in + aix*) iconv_flavor=ICONV_FLAVOR_AIX ;; + irix*) iconv_flavor=ICONV_FLAVOR_IRIX ;; + hpux*) iconv_flavor=ICONV_FLAVOR_HPUX ;; + osf*) iconv_flavor=ICONV_FLAVOR_OSF ;; + esac + if test -n "$iconv_flavor"; then + +cat >>confdefs.h <<_ACEOF +#define ICONV_FLAVOR $iconv_flavor +_ACEOF + + + + + ICONV_H='iconv.h' + + REPLACE_ICONV_OPEN=1 + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS iconv_open.$ac_objext" + + + fi + fi + fi + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS idcache.$ac_objext" -for ac_func in inet_ntop -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + + + + + + ARPA_INET_H='arpa/inet.h' + + + gl_save_LIBS=$LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing inet_ntop" >&5 +$as_echo_n "checking for library containing inet_ntop... " >&6; } +if test "${ac_cv_search_inet_ntop+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC @@ -28011,165 +21716,109 @@ cat >>conftest.$ac_ext <<_ACEOF #ifdef __cplusplus extern "C" #endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - +char inet_ntop (); int main () { -return $ac_func (); +return inet_ntop (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" +for ac_lib in '' nsl; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_inet_ntop=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if test "${ac_cv_search_inet_ntop+set}" = set; then : + break +fi +done +if test "${ac_cv_search_inet_ntop+set}" = set; then : + else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" + ac_cv_search_inet_ntop=no fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if test `eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_inet_ntop" >&5 +$as_echo "$ac_cv_search_inet_ntop" >&6; } +ac_res=$ac_cv_search_inet_ntop +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +else + + + + + + + + + for ac_func in inet_ntop +do : + ac_fn_c_check_func "$LINENO" "inet_ntop" "ac_cv_func_inet_ntop" +if test "x$ac_cv_func_inet_ntop" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define HAVE_INET_NTOP 1 _ACEOF else - gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" + + gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" + fi done - - - - - - - - - { $as_echo "$as_me:$LINENO: checking whether inet_ntop is declared" >&5 -$as_echo_n "checking whether inet_ntop is declared... " >&6; } -if test "${ac_cv_have_decl_inet_ntop+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -int -main () -{ -#ifndef inet_ntop - (void) inet_ntop; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_inet_ntop=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_inet_ntop=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + LIBS=$gl_save_LIBS + + + ac_fn_c_check_decl "$LINENO" "inet_ntop" "ac_cv_have_decl_inet_ntop" "#include +" +if test "x$ac_cv_have_decl_inet_ntop" = x""yes; then : + ac_have_decl=1 +else + ac_have_decl=0 fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_inet_ntop" >&5 -$as_echo "$ac_cv_have_decl_inet_ntop" >&6; } -if test $ac_cv_have_decl_inet_ntop = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_INET_NTOP 1 +#define HAVE_DECL_INET_NTOP $ac_have_decl _ACEOF - -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_INET_NTOP 0 -_ACEOF - - -fi + if test $ac_cv_have_decl_inet_ntop = no; then + HAVE_DECL_INET_NTOP=0 + fi + GNULIB_INET_NTOP=1 - { $as_echo "$as_me:$LINENO: checking whether the compiler generally respects inline" >&5 + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler generally respects inline" >&5 $as_echo_n "checking whether the compiler generally respects inline... " >&6; } -if test "${gl_cv_c_inline_effective+set}" = set; then +if test "${gl_cv_c_inline_effective+set}" = set; then : $as_echo_n "(cached) " >&6 else if test $ac_cv_c_inline = no; then gl_cv_c_inline_effective=no else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -28182,54 +21831,67 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : gl_cv_c_inline_effective=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - gl_cv_c_inline_effective=no + gl_cv_c_inline_effective=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_c_inline_effective" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_c_inline_effective" >&5 $as_echo "$gl_cv_c_inline_effective" >&6; } if test $gl_cv_c_inline_effective = yes; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_INLINE 1 -_ACEOF +$as_echo "#define HAVE_INLINE 1" >>confdefs.h fi + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS imaxtostr.$ac_objext" + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS offtostr.$ac_objext" + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS umaxtostr.$ac_objext" + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS uinttostr.$ac_objext" + : : @@ -28245,21 +21907,9 @@ _ACEOF - - - - - - - - - - - - - { $as_echo "$as_me:$LINENO: checking whether inttypes.h conforms to C99" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether inttypes.h conforms to C99" >&5 $as_echo_n "checking whether inttypes.h conforms to C99... " >&6; } -if test "${gl_cv_header_working_inttypes_h+set}" = set; then +if test "${gl_cv_header_working_inttypes_h+set}" = set; then : $as_echo_n "(cached) " >&6 else gl_cv_header_working_inttypes_h=no @@ -28269,19 +21919,16 @@ else && test "$ac_cv_have_decl_imaxdiv" = yes \ && test "$ac_cv_have_decl_strtoimax" = yes \ && test "$ac_cv_have_decl_strtoumax" = yes; then - cat >conftest.$ac_ext <<_ACEOF - - /* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ + #include #define __STDC_LIMIT_MACROS 1 /* to make it work also in C++ mode */ #define __STDC_CONSTANT_MACROS 1 /* to make it work also in C++ mode */ #define __STDC_FORMAT_MACROS 1 /* to make it work also in C++ mode */ -#include ABSOLUTE_INTTYPES_H +#define _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H /* work if build isn't clean */ +#include /* No need to duplicate the tests of stdint.m4; they are subsumed by $gl_cv_header_working_stdint_h = yes. */ @@ -28383,36 +22030,13 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : gl_cv_header_working_inttypes_h=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_header_working_inttypes_h" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_working_inttypes_h" >&5 $as_echo "$gl_cv_header_working_inttypes_h" >&6; } if false && test $gl_cv_header_working_inttypes_h = yes; then @@ -28420,42 +22044,56 @@ $as_echo "$gl_cv_header_working_inttypes_h" >&6; } else - if test $ac_cv_header_inttypes_h = yes; then - { $as_echo "$as_me:$LINENO: checking absolute name of " >&5 + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_inttypes_h='<'inttypes.h'>' + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 $as_echo_n "checking absolute name of ... " >&6; } -if test "${gl_cv_absolute_inttypes_h+set}" = set; then +if test "${gl_cv_next_inttypes_h+set}" = set; then : $as_echo_n "(cached) " >&6 else - - - - - if test $ac_cv_header_inttypes_h = yes; then - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + if test $ac_cv_header_inttypes_h = yes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include + _ACEOF - gl_cv_absolute_inttypes_h=`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | -sed -n '\#/inttypes.h#{s#.*"\(.*/inttypes.h\)".*#\1#;s#^/[^/]#//&#;p;q;}'` - fi + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + gl_cv_next_inttypes_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n '\#/inttypes.h#{ + s#.*"\(.*/inttypes.h\)".*#\1# + s#^/[^/]#//&# + p + q + }'`'"' + else + gl_cv_next_inttypes_h='<'inttypes.h'>' + fi fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_absolute_inttypes_h" >&5 -$as_echo "$gl_cv_absolute_inttypes_h" >&6; } -cat >>confdefs.h <<_ACEOF -#define ABSOLUTE_INTTYPES_H "$gl_cv_absolute_inttypes_h" -_ACEOF +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_inttypes_h" >&5 +$as_echo "$gl_cv_next_inttypes_h" >&6; } + fi + NEXT_INTTYPES_H=$gl_cv_next_inttypes_h - ABSOLUTE_INTTYPES_H=\"$gl_cv_absolute_inttypes_h\" - else - ABSOLUTE_INTTYPES_H=\"no/such/file/inttypes.h\" - fi + + + + + +$as_echo "#define GL_TRIGGER_STDC_LIMIT_MACROS 1" >>confdefs.h + PRIPTR_PREFIX= @@ -28469,11 +22107,7 @@ _ACEOF ll) gltype1='long long int';; I64) gltype1='__int64';; esac - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include extern intptr_t foo; @@ -28486,32 +22120,9 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : PRIPTR_PREFIX='"'$glpfx'"' -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext test -n "$PRIPTR_PREFIX" && break done @@ -28542,6 +22153,219 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext HAVE_DECL_STRTOUMAX=0 fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether INT32_MAX < INTMAX_MAX" >&5 +$as_echo_n "checking whether INT32_MAX < INTMAX_MAX... " >&6; } +if test "${gl_cv_test_INT32_MAX_LT_INTMAX_MAX+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Work also in C++ mode. */ + #define __STDC_LIMIT_MACROS 1 + + /* Work if build is not clean. */ + #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H + + #include + #if HAVE_STDINT_H + #include + #endif + + #if defined INT32_MAX && defined INTMAX_MAX + #define CONDITION (INT32_MAX < INTMAX_MAX) + #elif HAVE_LONG_LONG_INT + #define CONDITION (sizeof (int) < sizeof (long long int)) + #else + #define CONDITION 0 + #endif + int test[CONDITION ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_test_INT32_MAX_LT_INTMAX_MAX=yes +else + gl_cv_test_INT32_MAX_LT_INTMAX_MAX=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_INT32_MAX_LT_INTMAX_MAX" >&5 +$as_echo "$gl_cv_test_INT32_MAX_LT_INTMAX_MAX" >&6; } + if test $gl_cv_test_INT32_MAX_LT_INTMAX_MAX = yes; then + INT32_MAX_LT_INTMAX_MAX=1; + else + INT32_MAX_LT_INTMAX_MAX=0; + fi + + + if test $APPLE_UNIVERSAL_BUILD = 0; then + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether INT64_MAX == LONG_MAX" >&5 +$as_echo_n "checking whether INT64_MAX == LONG_MAX... " >&6; } +if test "${gl_cv_test_INT64_MAX_EQ_LONG_MAX+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Work also in C++ mode. */ + #define __STDC_LIMIT_MACROS 1 + + /* Work if build is not clean. */ + #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H + + #include + #if HAVE_STDINT_H + #include + #endif + + #if defined INT64_MAX + #define CONDITION (INT64_MAX == LONG_MAX) + #elif HAVE_LONG_LONG_INT + #define CONDITION (sizeof (long long int) == sizeof (long int)) + #else + #define CONDITION 0 + #endif + int test[CONDITION ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_test_INT64_MAX_EQ_LONG_MAX=yes +else + gl_cv_test_INT64_MAX_EQ_LONG_MAX=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_INT64_MAX_EQ_LONG_MAX" >&5 +$as_echo "$gl_cv_test_INT64_MAX_EQ_LONG_MAX" >&6; } + if test $gl_cv_test_INT64_MAX_EQ_LONG_MAX = yes; then + INT64_MAX_EQ_LONG_MAX=1; + else + INT64_MAX_EQ_LONG_MAX=0; + fi + + + else + INT64_MAX_EQ_LONG_MAX=-1 + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether UINT32_MAX < UINTMAX_MAX" >&5 +$as_echo_n "checking whether UINT32_MAX < UINTMAX_MAX... " >&6; } +if test "${gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Work also in C++ mode. */ + #define __STDC_LIMIT_MACROS 1 + + /* Work if build is not clean. */ + #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H + + #include + #if HAVE_STDINT_H + #include + #endif + + #if defined UINT32_MAX && defined UINTMAX_MAX + #define CONDITION (UINT32_MAX < UINTMAX_MAX) + #elif HAVE_LONG_LONG_INT + #define CONDITION (sizeof (unsigned int) < sizeof (unsigned long long int)) + #else + #define CONDITION 0 + #endif + int test[CONDITION ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX=yes +else + gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX" >&5 +$as_echo "$gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX" >&6; } + if test $gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX = yes; then + UINT32_MAX_LT_UINTMAX_MAX=1; + else + UINT32_MAX_LT_UINTMAX_MAX=0; + fi + + + if test $APPLE_UNIVERSAL_BUILD = 0; then + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether UINT64_MAX == ULONG_MAX" >&5 +$as_echo_n "checking whether UINT64_MAX == ULONG_MAX... " >&6; } +if test "${gl_cv_test_UINT64_MAX_EQ_ULONG_MAX+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Work also in C++ mode. */ + #define __STDC_LIMIT_MACROS 1 + + /* Work if build is not clean. */ + #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H + + #include + #if HAVE_STDINT_H + #include + #endif + + #if defined UINT64_MAX + #define CONDITION (UINT64_MAX == ULONG_MAX) + #elif HAVE_LONG_LONG_INT + #define CONDITION (sizeof (unsigned long long int) == sizeof (unsigned long int)) + #else + #define CONDITION 0 + #endif + int test[CONDITION ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_test_UINT64_MAX_EQ_ULONG_MAX=yes +else + gl_cv_test_UINT64_MAX_EQ_ULONG_MAX=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_UINT64_MAX_EQ_ULONG_MAX" >&5 +$as_echo "$gl_cv_test_UINT64_MAX_EQ_ULONG_MAX" >&6; } + if test $gl_cv_test_UINT64_MAX_EQ_ULONG_MAX = yes; then + UINT64_MAX_EQ_ULONG_MAX=1; + else + UINT64_MAX_EQ_ULONG_MAX=0; + fi + + + else + UINT64_MAX_EQ_ULONG_MAX=-1 + fi + INTTYPES_H='inttypes.h' fi @@ -28549,119 +22373,40 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # OpenVMS has isapipe already, so check for it. -for ac_func in isapipe -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ -#ifdef __STDC__ -# include -#else -# include -#endif -#undef $ac_func -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - eval "$as_ac_var=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if test `eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` = yes; then + for ac_func in isapipe +do : + ac_fn_c_check_func "$LINENO" "isapipe" "ac_cv_func_isapipe" +if test "x$ac_cv_func_isapipe" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define HAVE_ISAPIPE 1 _ACEOF else - gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" + + gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" + fi done + if test $ac_cv_func_isapipe = no; then - { $as_echo "$as_me:$LINENO: checking whether pipes are FIFOs (and for their link count)" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pipes are FIFOs (and for their link count)" >&5 $as_echo_n "checking whether pipes are FIFOs (and for their link count)... " >&6; } -if test "${gl_cv_pipes_are_fifos+set}" = set; then +if test "${gl_cv_pipes_are_fifos+set}" = set; then : $as_echo_n "(cached) " >&6 else - if test "$cross_compiling" = yes; then + if test "$cross_compiling" = yes; then : gl_cv_pipes_are_fifos=cross-compiling else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include @@ -28706,57 +22451,27 @@ cat >>conftest.$ac_ext <<_ACEOF return 0; } _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_run "$LINENO"; then : gl_cv_pipes_are_fifos=`./conftest$ac_exeext -` test -z "$gl_cv_pipes_are_fifos" && gl_cv_pipes_are_fifos=no else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -gl_cv_pipes_are_fifos=unknown + gl_cv_pipes_are_fifos=unknown fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi - fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_pipes_are_fifos" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_pipes_are_fifos" >&5 $as_echo "$gl_cv_pipes_are_fifos" >&6; } case $gl_cv_pipes_are_fifos in #( 'yes ('*')') -cat >>confdefs.h <<\_ACEOF -#define HAVE_FIFO_PIPES 1 -_ACEOF +$as_echo "#define HAVE_FIFO_PIPES 1" >>confdefs.h ;; #( 'no ('*')') - cat >>confdefs.h <<\_ACEOF -#define HAVE_FIFO_PIPES 0 -_ACEOF + $as_echo "#define HAVE_FIFO_PIPES 0" >>confdefs.h ;; esac @@ -28773,123 +22488,1047 @@ _ACEOF - - - - - - - - - - - - - - -for ac_func in lchown -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether isnan(double) can be used without linking with libm" >&5 +$as_echo_n "checking whether isnan(double) can be used without linking with libm... " >&6; } +if test "${gl_cv_func_isnand_no_libm+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - +#include + #if __GNUC__ >= 4 + # undef isnand + # define isnand(x) __builtin_isnan ((double)(x)) + #else + # undef isnand + # define isnand(x) isnan ((double)(x)) + #endif + double x; int main () { -return $ac_func (); +return isnand (x); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_func_isnand_no_libm=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + gl_cv_func_isnand_no_libm=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext - eval "$as_ac_var=no" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_isnand_no_libm" >&5 +$as_echo "$gl_cv_func_isnand_no_libm" >&6; } + + if test $gl_cv_func_isnand_no_libm = yes; then + +$as_echo "#define HAVE_ISNAND_IN_LIBC 1" >>confdefs.h + + else + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS isnand.$ac_objext" + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the exponent in a 'double'" >&5 +$as_echo_n "checking where to find the exponent in a 'double'... " >&6; } +if test "${gl_cv_cc_double_expbit0+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#if defined arm || defined __arm || defined __arm__ + mixed_endianness +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "mixed_endianness" >/dev/null 2>&1; then : + gl_cv_cc_double_expbit0="unknown" +else + + : +if test "${ac_cv_c_bigendian+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_c_bigendian=unknown + # See if we're dealing with a universal compiler. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __APPLE_CC__ + not a universal capable compiler + #endif + typedef int dummy; + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + # Check for potential -arch flags. It is not universal unless + # there are at least two -arch flags with different values. + ac_arch= + ac_prev= + for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do + if test -n "$ac_prev"; then + case $ac_word in + i?86 | x86_64 | ppc | ppc64) + if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then + ac_arch=$ac_word + else + ac_cv_c_bigendian=universal + break + fi + ;; + esac + ac_prev= + elif test "x$ac_word" = "x-arch"; then + ac_prev=arch + fi + done +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if test $ac_cv_c_bigendian = unknown; then + # See if sys/param.h defines the BYTE_ORDER macro. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + +int +main () +{ +#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ + && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ + && LITTLE_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + # It does; now see whether it defined to BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + +int +main () +{ +#if BYTE_ORDER != BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_bigendian=yes +else + ac_cv_c_bigendian=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main () +{ +#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + # It does; now see whether it defined to _BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main () +{ +#ifndef _BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_bigendian=yes +else + ac_cv_c_bigendian=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # Compile a test program. + if test "$cross_compiling" = yes; then : + # Try to guess by grepping values from an object file. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +short int ascii_mm[] = + { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; + short int ascii_ii[] = + { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; + int use_ascii (int i) { + return ascii_mm[i] + ascii_ii[i]; + } + short int ebcdic_ii[] = + { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; + short int ebcdic_mm[] = + { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; + int use_ebcdic (int i) { + return ebcdic_mm[i] + ebcdic_ii[i]; + } + extern int foo; + +int +main () +{ +return use_ascii (foo) == use_ebcdic (foo); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then + ac_cv_c_bigendian=yes + fi + if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then + if test "$ac_cv_c_bigendian" = unknown; then + ac_cv_c_bigendian=no + else + # finding both strings is unlikely to happen, but who knows? + ac_cv_c_bigendian=unknown + fi + fi +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ + + /* Are we little or big endian? From Harbison&Steele. */ + union + { + long int l; + char c[sizeof (long int)]; + } u; + u.l = 1; + return u.c[sizeof (long int) - 1] == 1; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_c_bigendian=no +else + ac_cv_c_bigendian=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext + fi fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if test `eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` = yes; then +: + case $ac_cv_c_bigendian in #( + yes) + gl_cv_cc_double_expbit0="word 0 bit 20";; #( + no) + gl_cv_cc_double_expbit0="word 1 bit 20" ;; #( + universal) + +$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h + + ;; #( + *) + gl_cv_cc_double_expbit0="unknown" ;; + esac + + +fi +rm -f conftest* + + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +#include +#define NWORDS \ + ((sizeof (double) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) +typedef union { double value; unsigned int word[NWORDS]; } memory_double; +static unsigned int ored_words[NWORDS]; +static unsigned int anded_words[NWORDS]; +static void add_to_ored_words (double x) +{ + memory_double m; + size_t i; + /* Clear it first, in case sizeof (double) < sizeof (memory_double). */ + memset (&m, 0, sizeof (memory_double)); + m.value = x; + for (i = 0; i < NWORDS; i++) + { + ored_words[i] |= m.word[i]; + anded_words[i] &= m.word[i]; + } +} +int main () +{ + size_t j; + FILE *fp = fopen ("conftest.out", "w"); + if (fp == NULL) + return 1; + for (j = 0; j < NWORDS; j++) + anded_words[j] = ~ (unsigned int) 0; + add_to_ored_words (0.25); + add_to_ored_words (0.5); + add_to_ored_words (1.0); + add_to_ored_words (2.0); + add_to_ored_words (4.0); + /* Remove bits that are common (e.g. if representation of the first mantissa + bit is explicit). */ + for (j = 0; j < NWORDS; j++) + ored_words[j] &= ~anded_words[j]; + /* Now find the nonzero word. */ + for (j = 0; j < NWORDS; j++) + if (ored_words[j] != 0) + break; + if (j < NWORDS) + { + size_t i; + for (i = j + 1; i < NWORDS; i++) + if (ored_words[i] != 0) + { + fprintf (fp, "unknown"); + return (fclose (fp) != 0); + } + for (i = 0; ; i++) + if ((ored_words[j] >> i) & 1) + { + fprintf (fp, "word %d bit %d", (int) j, (int) i); + return (fclose (fp) != 0); + } + } + fprintf (fp, "unknown"); + return (fclose (fp) != 0); +} + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_cc_double_expbit0=`cat conftest.out` +else + gl_cv_cc_double_expbit0="unknown" +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi + + rm -f conftest.out + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_double_expbit0" >&5 +$as_echo "$gl_cv_cc_double_expbit0" >&6; } + case "$gl_cv_cc_double_expbit0" in + word*bit*) + word=`echo "$gl_cv_cc_double_expbit0" | sed -e 's/word //' -e 's/ bit.*//'` + bit=`echo "$gl_cv_cc_double_expbit0" | sed -e 's/word.*bit //'` + +cat >>confdefs.h <<_ACEOF +#define DBL_EXPBIT0_WORD $word +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define DBL_EXPBIT0_BIT $bit +_ACEOF + + ;; + esac + + + fi + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether isnan(float) can be used without linking with libm" >&5 +$as_echo_n "checking whether isnan(float) can be used without linking with libm... " >&6; } +if test "${gl_cv_func_isnanf_no_libm+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #if __GNUC__ >= 4 + # undef isnanf + # define isnanf(x) __builtin_isnanf ((float)(x)) + #elif defined isnan + # undef isnanf + # define isnanf(x) isnan ((float)(x)) + #endif + float x; +int +main () +{ +return isnanf (x); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_func_isnanf_no_libm=yes +else + gl_cv_func_isnanf_no_libm=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_isnanf_no_libm" >&5 +$as_echo "$gl_cv_func_isnanf_no_libm" >&6; } + + if test $gl_cv_func_isnanf_no_libm = yes; then + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether isnan(float) works" >&5 +$as_echo_n "checking whether isnan(float) works... " >&6; } +if test "${gl_cv_func_isnanf_works+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + case "$host_os" in + irix* | solaris*) gl_cv_func_isnanf_works="guessing no";; + *) gl_cv_func_isnanf_works="guessing yes";; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#if __GNUC__ >= 4 +# undef isnanf +# define isnanf(x) __builtin_isnanf ((float)(x)) +#elif defined isnan +# undef isnanf +# define isnanf(x) isnan ((float)(x)) +#endif +/* The Compaq (ex-DEC) C 6.4 compiler chokes on the expression 0.0 / 0.0. */ +#ifdef __DECC +static float +NaN () +{ + static float zero = 0.0f; + return zero / zero; +} +#else +# define NaN() (0.0f / 0.0f) +#endif +#define NWORDS \ + ((sizeof (float) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) +typedef union { unsigned int word[NWORDS]; float value; } memory_float; +int main() +{ + memory_float m; + + if (isnanf (1.0f / 0.0f)) + return 1; + + if (!isnanf (NaN ())) + return 1; + +#if defined FLT_EXPBIT0_WORD && defined FLT_EXPBIT0_BIT + /* The isnanf function should be immune against changes in the sign bit and + in the mantissa bits. The xor operation twiddles a bit that can only be + a sign bit or a mantissa bit. */ + if (FLT_EXPBIT0_WORD == 0 && FLT_EXPBIT0_BIT > 0) + { + m.value = NaN (); + /* Set the bits below the exponent to 01111...111. */ + m.word[0] &= -1U << FLT_EXPBIT0_BIT; + m.word[0] |= 1U << (FLT_EXPBIT0_BIT - 1) - 1; + if (!isnanf (m.value)) + return 1; + } +#endif + + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_isnanf_works=yes +else + gl_cv_func_isnanf_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_isnanf_works" >&5 +$as_echo "$gl_cv_func_isnanf_works" >&6; } + + fi + if test $gl_cv_func_isnanf_no_libm = yes \ + && { case "$gl_cv_func_isnanf_works" in + *yes) true;; + *) false;; + esac + }; then + +$as_echo "#define HAVE_ISNANF_IN_LIBC 1" >>confdefs.h + + else + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS isnanf.$ac_objext" + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the exponent in a 'float'" >&5 +$as_echo_n "checking where to find the exponent in a 'float'... " >&6; } +if test "${gl_cv_cc_float_expbit0+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + gl_cv_cc_float_expbit0="word 0 bit 23" +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +#include +#define NWORDS \ + ((sizeof (float) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) +typedef union { float value; unsigned int word[NWORDS]; } memory_float; +static unsigned int ored_words[NWORDS]; +static unsigned int anded_words[NWORDS]; +static void add_to_ored_words (float x) +{ + memory_float m; + size_t i; + /* Clear it first, in case + sizeof (float) < sizeof (memory_float). */ + memset (&m, 0, sizeof (memory_float)); + m.value = x; + for (i = 0; i < NWORDS; i++) + { + ored_words[i] |= m.word[i]; + anded_words[i] &= m.word[i]; + } +} +int main () +{ + size_t j; + FILE *fp = fopen ("conftest.out", "w"); + if (fp == NULL) + return 1; + for (j = 0; j < NWORDS; j++) + anded_words[j] = ~ (unsigned int) 0; + add_to_ored_words (0.25f); + add_to_ored_words (0.5f); + add_to_ored_words (1.0f); + add_to_ored_words (2.0f); + add_to_ored_words (4.0f); + /* Remove bits that are common (e.g. if representation of the first mantissa + bit is explicit). */ + for (j = 0; j < NWORDS; j++) + ored_words[j] &= ~anded_words[j]; + /* Now find the nonzero word. */ + for (j = 0; j < NWORDS; j++) + if (ored_words[j] != 0) + break; + if (j < NWORDS) + { + size_t i; + for (i = j + 1; i < NWORDS; i++) + if (ored_words[i] != 0) + { + fprintf (fp, "unknown"); + return (fclose (fp) != 0); + } + for (i = 0; ; i++) + if ((ored_words[j] >> i) & 1) + { + fprintf (fp, "word %d bit %d", (int) j, (int) i); + return (fclose (fp) != 0); + } + } + fprintf (fp, "unknown"); + return (fclose (fp) != 0); +} + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_cc_float_expbit0=`cat conftest.out` +else + gl_cv_cc_float_expbit0="unknown" +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi + + rm -f conftest.out + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_float_expbit0" >&5 +$as_echo "$gl_cv_cc_float_expbit0" >&6; } + case "$gl_cv_cc_float_expbit0" in + word*bit*) + word=`echo "$gl_cv_cc_float_expbit0" | sed -e 's/word //' -e 's/ bit.*//'` + bit=`echo "$gl_cv_cc_float_expbit0" | sed -e 's/word.*bit //'` + +cat >>confdefs.h <<_ACEOF +#define FLT_EXPBIT0_WORD $word +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define FLT_EXPBIT0_BIT $bit +_ACEOF + + ;; + esac + + + fi + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether isnan(long double) can be used without linking with libm" >&5 +$as_echo_n "checking whether isnan(long double) can be used without linking with libm... " >&6; } +if test "${gl_cv_func_isnanl_no_libm+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #if __GNUC__ >= 4 + # undef isnanl + # define isnanl(x) __builtin_isnanl ((long double)(x)) + #elif defined isnan + # undef isnanl + # define isnanl(x) isnan ((long double)(x)) + #endif + long double x; +int +main () +{ +return isnanl (x); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_func_isnanl_no_libm=yes +else + gl_cv_func_isnanl_no_libm=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_isnanl_no_libm" >&5 +$as_echo "$gl_cv_func_isnanl_no_libm" >&6; } + + gl_func_isnanl_no_libm=$gl_cv_func_isnanl_no_libm + if test $gl_func_isnanl_no_libm = yes; then + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether isnanl works" >&5 +$as_echo_n "checking whether isnanl works... " >&6; } +if test "${gl_cv_func_isnanl_works+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + case "$host_cpu" in + # Guess no on ia64, x86_64, i386. + ia64 | x86_64 | i*86) gl_cv_func_isnanl_works="guessing no";; + *) + case "$host_os" in + netbsd*) gl_cv_func_isnanl_works="guessing no";; + *) gl_cv_func_isnanl_works="guessing yes";; + esac + ;; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +#if __GNUC__ >= 4 +# undef isnanl +# define isnanl(x) __builtin_isnanl ((long double)(x)) +#elif defined isnan +# undef isnanl +# define isnanl(x) isnan ((long double)(x)) +#endif +#define NWORDS \ + ((sizeof (long double) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) +typedef union { unsigned int word[NWORDS]; long double value; } + memory_long_double; +/* On Irix 6.5, gcc 3.4.3 can't compute compile-time NaN, and needs the + runtime type conversion. */ +#ifdef __sgi +static long double NaNl () +{ + double zero = 0.0; + return zero / zero; +} +#else +# define NaNl() (0.0L / 0.0L) +#endif +int main () +{ + memory_long_double m; + unsigned int i; + + if (!isnanl (NaNl ())) + return 1; + + /* The isnanl function should be immune against changes in the sign bit and + in the mantissa bits. The xor operation twiddles a bit that can only be + a sign bit or a mantissa bit (since the exponent never extends to + bit 31). */ + m.value = NaNl (); + m.word[NWORDS / 2] ^= (unsigned int) 1 << (sizeof (unsigned int) * CHAR_BIT - 1); + for (i = 0; i < NWORDS; i++) + m.word[i] |= 1; + if (!isnanl (m.value)) + return 1; + +#if ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_)) +/* Representation of an 80-bit 'long double' as an initializer for a sequence + of 'unsigned int' words. */ +# ifdef WORDS_BIGENDIAN +# define LDBL80_WORDS(exponent,manthi,mantlo) \ + { ((unsigned int) (exponent) << 16) | ((unsigned int) (manthi) >> 16), \ + ((unsigned int) (manthi) << 16) | (unsigned int) (mantlo) >> 16), \ + (unsigned int) (mantlo) << 16 \ + } +# else +# define LDBL80_WORDS(exponent,manthi,mantlo) \ + { mantlo, manthi, exponent } +# endif + { /* Quiet NaN. */ + static memory_long_double x = + { LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) }; + if (!isnanl (x.value)) + return 1; + } + { + /* Signalling NaN. */ + static memory_long_double x = + { LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) }; + if (!isnanl (x.value)) + return 1; + } + /* The isnanl function should recognize Pseudo-NaNs, Pseudo-Infinities, + Pseudo-Zeroes, Unnormalized Numbers, and Pseudo-Denormals, as defined in + Intel IA-64 Architecture Software Developer's Manual, Volume 1: + Application Architecture. + Table 5-2 "Floating-Point Register Encodings" + Figure 5-6 "Memory to Floating-Point Register Data Translation" + */ + { /* Pseudo-NaN. */ + static memory_long_double x = + { LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) }; + if (!isnanl (x.value)) + return 1; + } + { /* Pseudo-Infinity. */ + static memory_long_double x = + { LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) }; + if (!isnanl (x.value)) + return 1; + } + { /* Pseudo-Zero. */ + static memory_long_double x = + { LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) }; + if (!isnanl (x.value)) + return 1; + } + { /* Unnormalized number. */ + static memory_long_double x = + { LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) }; + if (!isnanl (x.value)) + return 1; + } + { /* Pseudo-Denormal. */ + static memory_long_double x = + { LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) }; + if (!isnanl (x.value)) + return 1; + } +#endif + + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_isnanl_works=yes +else + gl_cv_func_isnanl_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_isnanl_works" >&5 +$as_echo "$gl_cv_func_isnanl_works" >&6; } + + case "$gl_cv_func_isnanl_works" in + *yes) ;; + *) gl_func_isnanl_no_libm=no ;; + esac + fi + if test $gl_func_isnanl_no_libm = yes; then + +$as_echo "#define HAVE_ISNANL_IN_LIBC 1" >>confdefs.h + + else + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS isnanl.$ac_objext" + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the exponent in a 'long double'" >&5 +$as_echo_n "checking where to find the exponent in a 'long double'... " >&6; } +if test "${gl_cv_cc_long_double_expbit0+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + + gl_cv_cc_long_double_expbit0="unknown" + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +#include +#define NWORDS \ + ((sizeof (long double) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) +typedef union { long double value; unsigned int word[NWORDS]; } + memory_long_double; +static unsigned int ored_words[NWORDS]; +static unsigned int anded_words[NWORDS]; +static void add_to_ored_words (long double x) +{ + memory_long_double m; + size_t i; + /* Clear it first, in case + sizeof (long double) < sizeof (memory_long_double). */ + memset (&m, 0, sizeof (memory_long_double)); + m.value = x; + for (i = 0; i < NWORDS; i++) + { + ored_words[i] |= m.word[i]; + anded_words[i] &= m.word[i]; + } +} +int main () +{ + size_t j; + FILE *fp = fopen ("conftest.out", "w"); + if (fp == NULL) + return 1; + for (j = 0; j < NWORDS; j++) + anded_words[j] = ~ (unsigned int) 0; + add_to_ored_words (0.25L); + add_to_ored_words (0.5L); + add_to_ored_words (1.0L); + add_to_ored_words (2.0L); + add_to_ored_words (4.0L); + /* Remove bits that are common (e.g. if representation of the first mantissa + bit is explicit). */ + for (j = 0; j < NWORDS; j++) + ored_words[j] &= ~anded_words[j]; + /* Now find the nonzero word. */ + for (j = 0; j < NWORDS; j++) + if (ored_words[j] != 0) + break; + if (j < NWORDS) + { + size_t i; + for (i = j + 1; i < NWORDS; i++) + if (ored_words[i] != 0) + { + fprintf (fp, "unknown"); + return (fclose (fp) != 0); + } + for (i = 0; ; i++) + if ((ored_words[j] >> i) & 1) + { + fprintf (fp, "word %d bit %d", (int) j, (int) i); + return (fclose (fp) != 0); + } + } + fprintf (fp, "unknown"); + return (fclose (fp) != 0); +} + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_cc_long_double_expbit0=`cat conftest.out` +else + gl_cv_cc_long_double_expbit0="unknown" +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi + + rm -f conftest.out + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_long_double_expbit0" >&5 +$as_echo "$gl_cv_cc_long_double_expbit0" >&6; } + case "$gl_cv_cc_long_double_expbit0" in + word*bit*) + word=`echo "$gl_cv_cc_long_double_expbit0" | sed -e 's/word //' -e 's/ bit.*//'` + bit=`echo "$gl_cv_cc_long_double_expbit0" | sed -e 's/word.*bit //'` + +cat >>confdefs.h <<_ACEOF +#define LDBL_EXPBIT0_WORD $word +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define LDBL_EXPBIT0_BIT $bit +_ACEOF + + ;; + esac + + + fi + + + + + + + + if test $ac_cv_func_lchmod = no; then + HAVE_LCHMOD=0 + fi + + + + GNULIB_LCHMOD=1 + + + + + + + + + + + + + for ac_func in lchown +do : + ac_fn_c_check_func "$LINENO" "lchown" "ac_cv_func_lchown" +if test "x$ac_cv_func_lchown" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define HAVE_LCHOWN 1 _ACEOF else - gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" + + gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" + fi done + if test $ac_cv_func_lchown = no; then + REPLACE_LCHOWN=1 + fi - { $as_echo "$as_me:$LINENO: checking for flag to ignore unused libraries" >&5 + + + GNULIB_LCHOWN=1 + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for flag to ignore unused libraries" >&5 $as_echo_n "checking for flag to ignore unused libraries... " >&6; } -if test "${gl_cv_ignore_unused_libraries+set}" = set; then +if test "${gl_cv_ignore_unused_libraries+set}" = set; then : $as_echo_n "(cached) " >&6 else gl_cv_ignore_unused_libraries=none @@ -28912,11 +23551,7 @@ else '-z ignore' do LDFLAGS="$gl_flags $LDFLAGS" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -28927,62 +23562,34 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then +if ac_fn_c_try_link "$LINENO"; then : gl_cv_ignore_unused_libraries=$gl_flags -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LDFLAGS=$gl_saved_ldflags test "$gl_cv_ignore_unused_libraries" != none && break done LIBS=$gl_saved_libs fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_ignore_unused_libraries" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_ignore_unused_libraries" >&5 $as_echo "$gl_cv_ignore_unused_libraries" >&6; } test "$gl_cv_ignore_unused_libraries" != none && LDFLAGS="$LDFLAGS $gl_cv_ignore_unused_libraries" - { $as_echo "$as_me:$LINENO: checking whether link(2) dereferences a symlink specified with a trailing slash" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether link(2) dereferences a symlink specified with a trailing slash" >&5 $as_echo_n "checking whether link(2) dereferences a symlink specified with a trailing slash... " >&6; } -if test "${jm_ac_cv_func_link_follows_symlink+set}" = set; then +if test "${gl_ac_cv_func_link_follows_symlink+set}" = set; then : $as_echo_n "(cached) " >&6 else # Create a regular file. echo > conftest.file - if test "$cross_compiling" = yes; then - jm_ac_cv_func_link_follows_symlink=yes + if test "$cross_compiling" = yes; then : + gl_ac_cv_func_link_follows_symlink=yes else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ # include @@ -29021,50 +23628,22 @@ cat >>conftest.$ac_ext <<_ACEOF } _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - jm_ac_cv_func_link_follows_symlink=yes +if ac_fn_c_try_run "$LINENO"; then : + gl_ac_cv_func_link_follows_symlink=yes else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -jm_ac_cv_func_link_follows_symlink=no + gl_ac_cv_func_link_follows_symlink=no fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi - fi -{ $as_echo "$as_me:$LINENO: result: $jm_ac_cv_func_link_follows_symlink" >&5 -$as_echo "$jm_ac_cv_func_link_follows_symlink" >&6; } - if test $jm_ac_cv_func_link_follows_symlink = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_ac_cv_func_link_follows_symlink" >&5 +$as_echo "$gl_ac_cv_func_link_follows_symlink" >&6; } + if test $gl_ac_cv_func_link_follows_symlink = yes; then -cat >>confdefs.h <<\_ACEOF -#define LINK_FOLLOWS_SYMLINKS 1 -_ACEOF +$as_echo "#define LINK_FOLLOWS_SYMLINKS 1" >>confdefs.h fi @@ -29075,6 +23654,13 @@ _ACEOF + LOCALCHARSET_TESTS_ENVIRONMENT="CHARSETALIASDIR=\"\$(top_builddir)/$gl_source_base\"" + + + + + + @@ -29083,22 +23669,99 @@ _ACEOF - { $as_echo "$as_me:$LINENO: checking whether lstat dereferences a symlink specified with a trailing slash" >&5 + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether lseek detects pipes" >&5 +$as_echo_n "checking whether lseek detects pipes... " >&6; } +if test "${gl_cv_func_lseek_pipe+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test $cross_compiling = no; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include /* for off_t */ +#include /* for SEEK_CUR */ +#include +int main () +{ + /* Exit with success only if stdin is seekable. */ + return lseek (0, (off_t)0, SEEK_CUR) < 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + if test -s conftest$ac_exeext \ + && ./conftest$ac_exeext < conftest.$ac_ext \ + && { echo hi | ./conftest$ac_exeext; test $? = 1; }; then + gl_cv_func_lseek_pipe=yes + else + gl_cv_func_lseek_pipe=no + fi +else + gl_cv_func_lseek_pipe=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#if ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) || defined __BEOS__ +/* mingw and BeOS mistakenly return 0 when trying to seek on pipes. */ + Choke me. +#endif +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_func_lseek_pipe=yes +else + gl_cv_func_lseek_pipe=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_lseek_pipe" >&5 +$as_echo "$gl_cv_func_lseek_pipe" >&6; } + if test $gl_cv_func_lseek_pipe = no; then + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS lseek.$ac_objext" + + + REPLACE_LSEEK=1 + +$as_echo "#define LSEEK_PIPE_BROKEN 1" >>confdefs.h + + + fi + + + + GNULIB_LSEEK=1 + + + + + if test $ac_cv_func_lstat = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether lstat dereferences a symlink specified with a trailing slash" >&5 $as_echo_n "checking whether lstat dereferences a symlink specified with a trailing slash... " >&6; } -if test "${ac_cv_func_lstat_dereferences_slashed_symlink+set}" = set; then +if test "${ac_cv_func_lstat_dereferences_slashed_symlink+set}" = set; then : $as_echo_n "(cached) " >&6 else rm -f conftest.sym conftest.file echo >conftest.file if test "$as_ln_s" = "ln -s" && ln -s conftest.file conftest.sym; then - if test "$cross_compiling" = yes; then + if test "$cross_compiling" = yes; then : ac_cv_func_lstat_dereferences_slashed_symlink=no else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int @@ -29113,41 +23776,15 @@ struct stat sbuf; return 0; } _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_lstat_dereferences_slashed_symlink=yes else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_func_lstat_dereferences_slashed_symlink=no + ac_cv_func_lstat_dereferences_slashed_symlink=no fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi - else # If the `ln -s' command failed, then we probably don't even # have an lstat function. @@ -29156,7 +23793,7 @@ fi rm -f conftest.sym conftest.file fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_lstat_dereferences_slashed_symlink" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_lstat_dereferences_slashed_symlink" >&5 $as_echo "$ac_cv_func_lstat_dereferences_slashed_symlink" >&6; } test $ac_cv_func_lstat_dereferences_slashed_symlink = yes && @@ -29167,174 +23804,50 @@ _ACEOF if test $ac_cv_func_lstat_dereferences_slashed_symlink = no; then + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS lstat.$ac_objext" -fi - - : - - -for ac_header in stdlib.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-coreutils@gnu.org ## -## ------------------------------------ ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } fi -if test `eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` = yes; then + + if test $ac_cv_func_lstat_dereferences_slashed_symlink = no; then + REPLACE_LSTAT=1 + fi + # Prerequisites of lib/lstat.c. + + fi + + + + GNULIB_LSTAT=1 + + for ac_header in stdlib.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" +if test "x$ac_cv_header_stdlib_h" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define HAVE_STDLIB_H 1 _ACEOF fi done -{ $as_echo "$as_me:$LINENO: checking for GNU libc compatible malloc" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5 $as_echo_n "checking for GNU libc compatible malloc... " >&6; } -if test "${ac_cv_func_malloc_0_nonnull+set}" = set; then +if test "${ac_cv_func_malloc_0_nonnull+set}" = set; then : $as_echo_n "(cached) " >&6 else - if test "$cross_compiling" = yes; then + if test "$cross_compiling" = yes; then : ac_cv_func_malloc_0_nonnull=no else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if defined STDC_HEADERS || defined HAVE_STDLIB_H # include @@ -29350,65 +23863,186 @@ return ! malloc (0); return 0; } _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_malloc_0_nonnull=yes else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_func_malloc_0_nonnull=no + ac_cv_func_malloc_0_nonnull=no fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi - fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_malloc_0_nonnull" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_malloc_0_nonnull" >&5 $as_echo "$ac_cv_func_malloc_0_nonnull" >&6; } -if test $ac_cv_func_malloc_0_nonnull = yes; then +if test $ac_cv_func_malloc_0_nonnull = yes; then : -cat >>confdefs.h <<\_ACEOF -#define HAVE_MALLOC 1 -_ACEOF +$as_echo "#define HAVE_MALLOC 1" >>confdefs.h else - cat >>confdefs.h <<\_ACEOF -#define HAVE_MALLOC 0 -_ACEOF + $as_echo "#define HAVE_MALLOC 0" >>confdefs.h - gl_LIBOBJS="$gl_LIBOBJS malloc.$ac_objext" -cat >>confdefs.h <<\_ACEOF -#define malloc rpl_malloc -_ACEOF + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS malloc.$ac_objext" + + +$as_echo "#define malloc rpl_malloc" >>confdefs.h fi +$as_echo "#define GNULIB_MALLOC_GNU 1" >>confdefs.h + + + + if test $gl_cv_func_malloc_posix = yes; then + HAVE_MALLOC_POSIX=1 + +$as_echo "#define HAVE_MALLOC_POSIX 1" >>confdefs.h + + else + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS malloc.$ac_objext" + + HAVE_MALLOC_POSIX=0 + fi + + + + + GNULIB_MALLOC_POSIX=1 + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_math_h='<'math.h'>' + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +$as_echo_n "checking absolute name of ... " >&6; } +if test "${gl_cv_next_math_h+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + if test $ac_cv_header_math_h = yes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + gl_cv_next_math_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n '\#/math.h#{ + s#.*"\(.*/math.h\)".*#\1# + s#^/[^/]#//&# + p + q + }'`'"' + else + gl_cv_next_math_h='<'math.h'>' + fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_math_h" >&5 +$as_echo "$gl_cv_next_math_h" >&6; } + fi + NEXT_MATH_H=$gl_cv_next_math_h + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NAN macro works" >&5 +$as_echo_n "checking whether NAN macro works... " >&6; } +if test "${gl_cv_header_math_nan_works+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +/* Solaris 10 has a broken definition of NAN. Other platforms + fail to provide NAN, or provide it only in C99 mode; this + test only needs to fail when NAN is provided but wrong. */ + float f = 1.0f; +#ifdef NAN + f = NAN; +#endif + return f == 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_header_math_nan_works=yes +else + gl_cv_header_math_nan_works=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_math_nan_works" >&5 +$as_echo "$gl_cv_header_math_nan_works" >&6; } + if test $gl_cv_header_math_nan_works = no; then + REPLACE_NAN=1 + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether HUGE_VAL works" >&5 +$as_echo_n "checking whether HUGE_VAL works... " >&6; } +if test "${gl_cv_header_math_huge_val_works+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +/* Solaris 10 has a broken definition of HUGE_VAL. */ + double d = HUGE_VAL; + return d == 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_header_math_huge_val_works=yes +else + gl_cv_header_math_huge_val_works=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_math_huge_val_works" >&5 +$as_echo "$gl_cv_header_math_huge_val_works" >&6; } + if test $gl_cv_header_math_huge_val_works = no; then + REPLACE_HUGE_VAL=1 + fi + @@ -29420,6 +24054,433 @@ fi + + + + if test $ac_cv_func_mbrlen = no; then + HAVE_MBRLEN=0 + else + if test $REPLACE_MBRTOWC = 1; then + REPLACE_MBRLEN=1 + fi + fi + if test $HAVE_MBRLEN = 0 || test $REPLACE_MBRLEN = 1; then + + + WCHAR_H=wchar.h + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS mbrlen.$ac_objext" + + + : + + fi + + + + GNULIB_MBRLEN=1 + + + + + + + + + + + + if test $ac_cv_func_mbsinit = yes && test $ac_cv_func_mbrtowc = yes; then + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles incomplete characters" >&5 +$as_echo_n "checking whether mbrtowc handles incomplete characters... " >&6; } +if test "${gl_cv_func_mbrtowc_incomplete_state+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + case "$host_os" in + # Guess no on AIX and OSF/1. + osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;; + esac + if test $LOCALE_JA != none; then + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +int main () +{ + if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) + { + const char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) + if (mbsinit (&state)) + return 1; + } + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_mbrtowc_incomplete_state=yes +else + gl_cv_func_mbrtowc_incomplete_state=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi + + fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_incomplete_state" >&5 +$as_echo "$gl_cv_func_mbrtowc_incomplete_state" >&6; } + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works as well as mbtowc" >&5 +$as_echo_n "checking whether mbrtowc works as well as mbtowc... " >&6; } +if test "${gl_cv_func_mbrtowc_sanitycheck+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + case "$host_os" in + # Guess no on Solaris 8. + solaris2.8) gl_cv_func_mbrtowc_sanitycheck="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_sanitycheck="guessing yes" ;; + esac + if test $LOCALE_ZH_CN != none; then + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +int main () +{ + /* This fails on Solaris 8: + mbrtowc returns 2, and sets wc to 0x00F0. + mbtowc returns 4 (correct) and sets wc to 0x5EDC. */ + if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) + { + char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 3, 6, &state) != 4 + && mbtowc (&wc, input + 3, 6) == 4) + return 1; + } + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_mbrtowc_sanitycheck=yes +else + gl_cv_func_mbrtowc_sanitycheck=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi + + fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_sanitycheck" >&5 +$as_echo "$gl_cv_func_mbrtowc_sanitycheck" >&6; } + + REPLACE_MBSTATE_T=0 + case "$gl_cv_func_mbrtowc_incomplete_state" in + *yes) ;; + *) REPLACE_MBSTATE_T=1 ;; + esac + case "$gl_cv_func_mbrtowc_sanitycheck" in + *yes) ;; + *) REPLACE_MBSTATE_T=1 ;; + esac + else + REPLACE_MBSTATE_T=1 + fi + if test $REPLACE_MBSTATE_T = 1; then + + + WCHAR_H=wchar.h + + fi + + if test $REPLACE_MBSTATE_T = 1; then + REPLACE_MBRTOWC=1 + fi + + if test $ac_cv_func_mbrtowc = no; then + HAVE_MBRTOWC=0 + fi + if test $HAVE_MBRTOWC != 0 && test $REPLACE_MBRTOWC != 1; then + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles a NULL string argument" >&5 +$as_echo_n "checking whether mbrtowc handles a NULL string argument... " >&6; } +if test "${gl_cv_func_mbrtowc_null_arg+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + case "$host_os" in + # Guess no on OSF/1. + osf*) gl_cv_func_mbrtowc_null_arg="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_null_arg="guessing yes" ;; + esac + if test $LOCALE_FR_UTF8 != none; then + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +int main () +{ + if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) + { + mbstate_t state; + wchar_t wc; + int ret; + + memset (&state, '\0', sizeof (mbstate_t)); + wc = (wchar_t) 0xBADFACE; + mbrtowc (&wc, NULL, 5, &state); + /* Check that wc was not modified. */ + if (wc != (wchar_t) 0xBADFACE) + return 1; + } + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_mbrtowc_null_arg=yes +else + gl_cv_func_mbrtowc_null_arg=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi + + fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_null_arg" >&5 +$as_echo "$gl_cv_func_mbrtowc_null_arg" >&6; } + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc has a correct return value" >&5 +$as_echo_n "checking whether mbrtowc has a correct return value... " >&6; } +if test "${gl_cv_func_mbrtowc_retval+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + case "$host_os" in + # Guess no on HP-UX and Solaris. + hpux* | solaris*) gl_cv_func_mbrtowc_retval="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_retval="guessing yes" ;; + esac + if test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none; then + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +int main () +{ + /* This fails on Solaris. */ + if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) + { + char input[] = "B\303\274\303\237er"; /* "Büßer" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) + { + input[1] = '\0'; + if (mbrtowc (&wc, input + 2, 5, &state) != 1) + return 1; + } + } + /* This fails on HP-UX 11.11. */ + if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) + { + char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) + { + input[1] = '\0'; + if (mbrtowc (&wc, input + 2, 5, &state) != 2) + return 1; + } + } + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_mbrtowc_retval=yes +else + gl_cv_func_mbrtowc_retval=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi + + fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_retval" >&5 +$as_echo "$gl_cv_func_mbrtowc_retval" >&6; } + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc returns 0 when parsing a NUL character" >&5 +$as_echo_n "checking whether mbrtowc returns 0 when parsing a NUL character... " >&6; } +if test "${gl_cv_func_mbrtowc_nul_retval+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + case "$host_os" in + # Guess no on Solaris 8 and 9. + solaris2.[89]) gl_cv_func_mbrtowc_nul_retval="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_nul_retval="guessing yes" ;; + esac + if test $LOCALE_ZH_CN != none; then + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +int main () +{ + /* This fails on Solaris 8 and 9. */ + if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) + { + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, "", 1, &state) != 0) + return 1; + } + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_mbrtowc_nul_retval=yes +else + gl_cv_func_mbrtowc_nul_retval=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi + + fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_nul_retval" >&5 +$as_echo "$gl_cv_func_mbrtowc_nul_retval" >&6; } + + case "$gl_cv_func_mbrtowc_null_arg" in + *yes) ;; + *) +$as_echo "#define MBRTOWC_NULL_ARG_BUG 1" >>confdefs.h + + REPLACE_MBRTOWC=1 + ;; + esac + case "$gl_cv_func_mbrtowc_retval" in + *yes) ;; + *) +$as_echo "#define MBRTOWC_RETVAL_BUG 1" >>confdefs.h + + REPLACE_MBRTOWC=1 + ;; + esac + case "$gl_cv_func_mbrtowc_nul_retval" in + *yes) ;; + *) +$as_echo "#define MBRTOWC_NUL_RETVAL_BUG 1" >>confdefs.h + + REPLACE_MBRTOWC=1 + ;; + esac + fi + if test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1; then + + + WCHAR_H=wchar.h + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS mbrtowc.$ac_objext" + + + : + + fi + + + + GNULIB_MBRTOWC=1 + + + GNULIB_MBSCASECMP=1 @@ -29432,87 +24493,473 @@ fi + if test $ac_cv_func_mbsinit = yes && test $ac_cv_func_mbrtowc = yes; then - - - - { $as_echo "$as_me:$LINENO: checking whether mbrtowc and mbstate_t are properly declared" >&5 -$as_echo_n "checking whether mbrtowc and mbstate_t are properly declared... " >&6; } -if test "${gl_cv_func_mbrtowc+set}" = set; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles incomplete characters" >&5 +$as_echo_n "checking whether mbrtowc handles incomplete characters... " >&6; } +if test "${gl_cv_func_mbrtowc_incomplete_state+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + + case "$host_os" in + # Guess no on AIX and OSF/1. + osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;; + esac + if test $LOCALE_JA != none; then + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ + +#include +#include #include -int -main () +int main () { -wchar_t wc; - char const s[] = ""; - size_t n = 1; - mbstate_t state; - return ! (sizeof state && (mbrtowc) (&wc, s, n, &state)); - ; + if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) + { + const char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) + if (mbsinit (&state)) + return 1; + } return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - gl_cv_func_mbrtowc=yes +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_mbrtowc_incomplete_state=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - gl_cv_func_mbrtowc=no + gl_cv_func_mbrtowc_incomplete_state=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_mbrtowc" >&5 -$as_echo "$gl_cv_func_mbrtowc" >&6; } - if test $gl_cv_func_mbrtowc = yes; then + fi -cat >>confdefs.h <<\_ACEOF -#define HAVE_MBRTOWC 1 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_incomplete_state" >&5 +$as_echo "$gl_cv_func_mbrtowc_incomplete_state" >&6; } + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works as well as mbtowc" >&5 +$as_echo_n "checking whether mbrtowc works as well as mbtowc... " >&6; } +if test "${gl_cv_func_mbrtowc_sanitycheck+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + case "$host_os" in + # Guess no on Solaris 8. + solaris2.8) gl_cv_func_mbrtowc_sanitycheck="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_sanitycheck="guessing yes" ;; + esac + if test $LOCALE_ZH_CN != none; then + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +int main () +{ + /* This fails on Solaris 8: + mbrtowc returns 2, and sets wc to 0x00F0. + mbtowc returns 4 (correct) and sets wc to 0x5EDC. */ + if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) + { + char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 3, 6, &state) != 4 + && mbtowc (&wc, input + 3, 6) == 4) + return 1; + } + return 0; +} _ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_mbrtowc_sanitycheck=yes +else + gl_cv_func_mbrtowc_sanitycheck=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi + + fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_sanitycheck" >&5 +$as_echo "$gl_cv_func_mbrtowc_sanitycheck" >&6; } + + REPLACE_MBSTATE_T=0 + case "$gl_cv_func_mbrtowc_incomplete_state" in + *yes) ;; + *) REPLACE_MBSTATE_T=1 ;; + esac + case "$gl_cv_func_mbrtowc_sanitycheck" in + *yes) ;; + *) REPLACE_MBSTATE_T=1 ;; + esac + else + REPLACE_MBSTATE_T=1 + fi + if test $REPLACE_MBSTATE_T = 1; then + + + WCHAR_H=wchar.h + + fi + + if test $REPLACE_MBSTATE_T = 1; then + REPLACE_MBSINIT=1 + fi + + if test $ac_cv_func_mbsinit = no; then + HAVE_MBSINIT=0 + fi + if test $HAVE_MBSINIT = 0 || test $REPLACE_MBSINIT = 1; then + + + WCHAR_H=wchar.h + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS mbsinit.$ac_objext" + + + : fi - { $as_echo "$as_me:$LINENO: checking whether mbswidth is declared in " >&5 -$as_echo_n "checking whether mbswidth is declared in ... " >&6; } -if test "${ac_cv_have_decl_mbswidth+set}" = set; then + + GNULIB_MBSINIT=1 + + + + GNULIB_MBSLEN=1 + + + + + + + + + + + + if test $ac_cv_func_mbsinit = yes && test $ac_cv_func_mbrtowc = yes; then + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles incomplete characters" >&5 +$as_echo_n "checking whether mbrtowc handles incomplete characters... " >&6; } +if test "${gl_cv_func_mbrtowc_incomplete_state+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ + + case "$host_os" in + # Guess no on AIX and OSF/1. + osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;; + esac + if test $LOCALE_JA != none; then + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +int main () +{ + if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) + { + const char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) + if (mbsinit (&state)) + return 1; + } + return 0; +} _ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_mbrtowc_incomplete_state=yes +else + gl_cv_func_mbrtowc_incomplete_state=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi + + fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_incomplete_state" >&5 +$as_echo "$gl_cv_func_mbrtowc_incomplete_state" >&6; } + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works as well as mbtowc" >&5 +$as_echo_n "checking whether mbrtowc works as well as mbtowc... " >&6; } +if test "${gl_cv_func_mbrtowc_sanitycheck+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + case "$host_os" in + # Guess no on Solaris 8. + solaris2.8) gl_cv_func_mbrtowc_sanitycheck="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_sanitycheck="guessing yes" ;; + esac + if test $LOCALE_ZH_CN != none; then + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +int main () +{ + /* This fails on Solaris 8: + mbrtowc returns 2, and sets wc to 0x00F0. + mbtowc returns 4 (correct) and sets wc to 0x5EDC. */ + if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) + { + char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 3, 6, &state) != 4 + && mbtowc (&wc, input + 3, 6) == 4) + return 1; + } + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_mbrtowc_sanitycheck=yes +else + gl_cv_func_mbrtowc_sanitycheck=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi + + fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_sanitycheck" >&5 +$as_echo "$gl_cv_func_mbrtowc_sanitycheck" >&6; } + + REPLACE_MBSTATE_T=0 + case "$gl_cv_func_mbrtowc_incomplete_state" in + *yes) ;; + *) REPLACE_MBSTATE_T=1 ;; + esac + case "$gl_cv_func_mbrtowc_sanitycheck" in + *yes) ;; + *) REPLACE_MBSTATE_T=1 ;; + esac + else + REPLACE_MBSTATE_T=1 + fi + if test $REPLACE_MBSTATE_T = 1; then + + + WCHAR_H=wchar.h + + fi + + if test $REPLACE_MBSTATE_T = 1; then + REPLACE_MBSRTOWCS=1 + fi + + if test $ac_cv_func_mbsrtowcs = no; then + HAVE_MBSRTOWCS=0 + fi + if test $HAVE_MBSRTOWCS != 0 && test $REPLACE_MBSRTOWCS != 1; then + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbsrtowcs works" >&5 +$as_echo_n "checking whether mbsrtowcs works... " >&6; } +if test "${gl_cv_func_mbsrtowcs_works+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + case "$host_os" in + # Guess no on HP-UX and Solaris. + hpux* | solaris*) gl_cv_func_mbsrtowcs_works="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbsrtowcs_works="guessing yes" ;; + esac + if test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none || test $LOCALE_ZH_CN != none; then + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +int main () +{ + /* Test whether the function works when started with a conversion state + in non-initial state. This fails on HP-UX 11.11 and Solaris 10. */ + if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) + { + const char input[] = "B\303\274\303\237er"; + mbstate_t state; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (NULL, input + 1, 1, &state) == (size_t)(-2)) + if (!mbsinit (&state)) + { + const char *src = input + 2; + if (mbsrtowcs (NULL, &src, 10, &state) != 4) + return 1; + } + } + if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) + { + const char input[] = "<\306\374\313\334\270\354>"; + mbstate_t state; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (NULL, input + 3, 1, &state) == (size_t)(-2)) + if (!mbsinit (&state)) + { + const char *src = input + 4; + if (mbsrtowcs (NULL, &src, 10, &state) != 3) + return 1; + } + } + if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) + { + const char input[] = "B\250\271\201\060\211\070er"; + mbstate_t state; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (NULL, input + 1, 1, &state) == (size_t)(-2)) + if (!mbsinit (&state)) + { + const char *src = input + 2; + if (mbsrtowcs (NULL, &src, 10, &state) != 4) + return 1; + } + } + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_mbsrtowcs_works=yes +else + gl_cv_func_mbsrtowcs_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi + + fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbsrtowcs_works" >&5 +$as_echo "$gl_cv_func_mbsrtowcs_works" >&6; } + + case "$gl_cv_func_mbsrtowcs_works" in + *yes) ;; + *) REPLACE_MBSRTOWCS=1 ;; + esac + fi + if test $HAVE_MBSRTOWCS = 0 || test $REPLACE_MBSRTOWCS = 1; then + + + WCHAR_H=wchar.h + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS mbsrtowcs.$ac_objext" + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS mbsrtowcs-state.$ac_objext" + + + : + + fi + + + + GNULIB_MBSRTOWCS=1 + + + + GNULIB_MBSSTR=1 + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbswidth is declared in " >&5 +$as_echo_n "checking whether mbswidth is declared in ... " >&6; } +if test "${ac_cv_have_decl_mbswidth+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Tru64 with Desktop Toolkit C has a bug: must be included before @@ -29535,35 +24982,14 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_have_decl_mbswidth=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_mbswidth=no + ac_cv_have_decl_mbswidth=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_mbswidth" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_decl_mbswidth" >&5 $as_echo "$ac_cv_have_decl_mbswidth" >&6; } if test $ac_cv_have_decl_mbswidth = yes; then ac_val=1 @@ -29576,16 +25002,14 @@ cat >>confdefs.h <<_ACEOF _ACEOF - { $as_echo "$as_me:$LINENO: checking for mbstate_t" >&5 + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mbstate_t" >&5 $as_echo_n "checking for mbstate_t... " >&6; } -if test "${ac_cv_type_mbstate_t+set}" = set; then +if test "${ac_cv_type_mbstate_t+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default # include @@ -29597,310 +25021,76 @@ mbstate_t x; return sizeof x; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_type_mbstate_t=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_mbstate_t=no + ac_cv_type_mbstate_t=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_mbstate_t" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_mbstate_t" >&5 $as_echo "$ac_cv_type_mbstate_t" >&6; } if test $ac_cv_type_mbstate_t = yes; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_MBSTATE_T 1 -_ACEOF +$as_echo "#define HAVE_MBSTATE_T 1" >>confdefs.h else -cat >>confdefs.h <<\_ACEOF -#define mbstate_t int -_ACEOF +$as_echo "#define mbstate_t int" >>confdefs.h fi - : - - - gl_LIBOBJS="$gl_LIBOBJS md5.$ac_objext" - : + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS memcasecmp.$ac_objext" -for ac_func in memchr -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ -#ifdef __STDC__ -# include -#else -# include -#endif -#undef $ac_func -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - eval "$as_ac_var=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if test `eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` = yes; then + + for ac_func in memchr +do : + ac_fn_c_check_func "$LINENO" "memchr" "ac_cv_func_memchr" +if test "x$ac_cv_func_memchr" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define HAVE_MEMCHR 1 _ACEOF else - gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" + + gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" + fi done + if test $ac_cv_func_memchr = no; then - -for ac_header in bp-sym.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-coreutils@gnu.org ## -## ------------------------------------ ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - -fi -if test `eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` = yes; then + for ac_header in bp-sym.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "bp-sym.h" "ac_cv_header_bp_sym_h" "$ac_includes_default" +if test "x$ac_cv_header_bp_sym_h" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define HAVE_BP_SYM_H 1 _ACEOF fi @@ -29911,19 +25101,48 @@ done fi - { $as_echo "$as_me:$LINENO: checking for working memcmp" >&5 -$as_echo_n "checking for working memcmp... " >&6; } -if test "${ac_cv_func_memcmp_working+set}" = set; then + if test $cross_compiling != no; then + # AC_FUNC_MEMCMP as of 2.62 defaults to 'no' when cross compiling. + # We default to yes if memcmp appears to exist, which works + # better for MinGW. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cross-compiling target has memcmp" >&5 +$as_echo_n "checking whether cross-compiling target has memcmp... " >&6; } +if test "${ac_cv_func_memcmp_working+set}" = set; then : $as_echo_n "(cached) " >&6 else - if test "$cross_compiling" = yes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + +int +main () +{ +int ret = memcmp ("foo", "bar", 0); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_func_memcmp_working=yes +else + ac_cv_func_memcmp_working=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_memcmp_working" >&5 +$as_echo "$ac_cv_func_memcmp_working" >&6; } + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working memcmp" >&5 +$as_echo_n "checking for working memcmp... " >&6; } +if test "${ac_cv_func_memcmp_working+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : ac_cv_func_memcmp_working=no else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int @@ -29958,71 +25177,57 @@ main () return 0; } _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_memcmp_working=yes else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_func_memcmp_working=no + ac_cv_func_memcmp_working=no fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi - fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_memcmp_working" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_memcmp_working" >&5 $as_echo "$ac_cv_func_memcmp_working" >&6; } -test $ac_cv_func_memcmp_working = no && gl_LIBOBJS="$gl_LIBOBJS memcmp.$ac_objext" +test $ac_cv_func_memcmp_working = no && + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS memcmp.$ac_objext" + if test $ac_cv_func_memcmp_working = no; then -cat >>confdefs.h <<\_ACEOF -#define memcmp rpl_memcmp -_ACEOF +$as_echo "#define memcmp rpl_memcmp" >>confdefs.h : fi + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS memcoll.$ac_objext" - { $as_echo "$as_me:$LINENO: checking for working strcoll" >&5 + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working strcoll" >&5 $as_echo_n "checking for working strcoll... " >&6; } -if test "${ac_cv_func_strcoll_works+set}" = set; then +if test "${ac_cv_func_strcoll_works+set}" = set; then : $as_echo_n "(cached) " >&6 else - if test "$cross_compiling" = yes; then + if test "$cross_compiling" = yes; then : ac_cv_func_strcoll_works=no else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int @@ -30035,153 +25240,50 @@ return (strcoll ("abc", "def") >= 0 || return 0; } _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_strcoll_works=yes else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_func_strcoll_works=no + ac_cv_func_strcoll_works=no fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi - fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_strcoll_works" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strcoll_works" >&5 $as_echo "$ac_cv_func_strcoll_works" >&6; } if test $ac_cv_func_strcoll_works = yes; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_STRCOLL 1 -_ACEOF +$as_echo "#define HAVE_STRCOLL 1" >>confdefs.h fi -for ac_func in memcpy -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ -#ifdef __STDC__ -# include -#else -# include -#endif -#undef $ac_func -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - eval "$as_ac_var=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if test `eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` = yes; then + for ac_func in memcpy +do : + ac_fn_c_check_func "$LINENO" "memcpy" "ac_cv_func_memcpy" +if test "x$ac_cv_func_memcpy" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define HAVE_MEMCPY 1 _ACEOF else - gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" + + gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" + fi done + if test $ac_cv_func_memcpy = no; then : @@ -30190,104 +25292,29 @@ done -for ac_func in memmove -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ -#ifdef __STDC__ -# include -#else -# include -#endif -#undef $ac_func -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - eval "$as_ac_var=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if test `eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` = yes; then + for ac_func in memmove +do : + ac_fn_c_check_func "$LINENO" "memmove" "ac_cv_func_memmove" +if test "x$ac_cv_func_memmove" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define HAVE_MEMMOVE 1 _ACEOF else - gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" + + gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" + fi done + if test $ac_cv_func_memmove = no; then : @@ -30301,104 +25328,29 @@ done -for ac_func in mempcpy -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ -#ifdef __STDC__ -# include -#else -# include -#endif -#undef $ac_func -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - eval "$as_ac_var=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if test `eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` = yes; then + for ac_func in mempcpy +do : + ac_fn_c_check_func "$LINENO" "mempcpy" "ac_cv_func_mempcpy" +if test "x$ac_cv_func_mempcpy" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define HAVE_MEMPCPY 1 _ACEOF else - gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" + + gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" + fi done + if test $ac_cv_func_mempcpy = no; then HAVE_MEMPCPY=0 @@ -30415,112 +25367,34 @@ done - - - if test $ac_cv_have_decl_memrchr = no; then HAVE_DECL_MEMRCHR=0 fi -for ac_func in memrchr -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ -#ifdef __STDC__ -# include -#else -# include -#endif -#undef $ac_func -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - eval "$as_ac_var=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if test `eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` = yes; then + for ac_func in memrchr +do : + ac_fn_c_check_func "$LINENO" "memrchr" "ac_cv_func_memrchr" +if test "x$ac_cv_func_memrchr" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define HAVE_MEMRCHR 1 _ACEOF else - gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" + + gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" + fi done + if test $ac_cv_func_memrchr = no; then : fi @@ -30531,104 +25405,29 @@ done -for ac_func in memset -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ -#ifdef __STDC__ -# include -#else -# include -#endif -#undef $ac_func -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - eval "$as_ac_var=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if test `eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` = yes; then + for ac_func in memset +do : + ac_fn_c_check_func "$LINENO" "memset" "ac_cv_func_memset" +if test "x$ac_cv_func_memset" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define HAVE_MEMSET 1 _ACEOF else - gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" + + gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" + fi done + if test $ac_cv_func_memset = no; then : @@ -30636,31 +25435,55 @@ done fi + for ac_func in getgrouplist +do : + ac_fn_c_check_func "$LINENO" "getgrouplist" "ac_cv_func_getgrouplist" +if test "x$ac_cv_func_getgrouplist" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_GETGROUPLIST 1 +_ACEOF + +fi +done + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS mgetgroups.$ac_objext" + + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS mkancesdirs.$ac_objext" - - - - { $as_echo "$as_me:$LINENO: checking whether mkdir fails due to a trailing slash" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mkdir fails due to a trailing slash" >&5 $as_echo_n "checking whether mkdir fails due to a trailing slash... " >&6; } -if test "${gl_cv_func_mkdir_trailing_slash_bug+set}" = set; then +if test "${gl_cv_func_mkdir_trailing_slash_bug+set}" = set; then : $as_echo_n "(cached) " >&6 else # Arrange for deletion of the temporary directory this test might create. ac_clean_files="$ac_clean_files confdir-slash" - if test "$cross_compiling" = yes; then + if test "$cross_compiling" = yes; then : gl_cv_func_mkdir_trailing_slash_bug=yes else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ # include @@ -30676,59 +25499,55 @@ cat >>conftest.$ac_ext <<_ACEOF } _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_run "$LINENO"; then : gl_cv_func_mkdir_trailing_slash_bug=no else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -gl_cv_func_mkdir_trailing_slash_bug=yes + gl_cv_func_mkdir_trailing_slash_bug=yes fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi - fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_mkdir_trailing_slash_bug" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mkdir_trailing_slash_bug" >&5 $as_echo "$gl_cv_func_mkdir_trailing_slash_bug" >&6; } if test $gl_cv_func_mkdir_trailing_slash_bug = yes; then - gl_LIBOBJS="$gl_LIBOBJS mkdir.$ac_objext" + REPLACE_MKDIR=1 -cat >>confdefs.h <<\_ACEOF -#define mkdir rpl_mkdir -_ACEOF + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS mkdir.$ac_objext" : fi + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS dirchownmod.$ac_objext" + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS mkdir-p.$ac_objext" @@ -30740,25 +25559,17 @@ _ACEOF - - - - - { $as_echo "$as_me:$LINENO: checking for working mkstemp" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working mkstemp" >&5 $as_echo_n "checking for working mkstemp... " >&6; } -if test "${gl_cv_func_working_mkstemp+set}" = set; then +if test "${gl_cv_func_working_mkstemp+set}" = set; then : $as_echo_n "(cached) " >&6 else mkdir conftest.mkstemp - if test "$cross_compiling" = yes; then + if test "$cross_compiling" = yes; then : gl_cv_func_working_mkstemp=no else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int @@ -30782,50 +25593,33 @@ int i; return 0; } _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_run "$LINENO"; then : gl_cv_func_working_mkstemp=yes else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -gl_cv_func_working_mkstemp=no + gl_cv_func_working_mkstemp=no fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi - rm -rf conftest.mkstemp fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_working_mkstemp" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_working_mkstemp" >&5 $as_echo "$gl_cv_func_working_mkstemp" >&6; } if test $gl_cv_func_working_mkstemp != yes; then REPLACE_MKSTEMP=1 - gl_LIBOBJS="$gl_LIBOBJS mkstemp.$ac_objext" + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS mkstemp.$ac_objext" + fi @@ -30838,28 +25632,21 @@ $as_echo "$gl_cv_func_working_mkstemp" >&6; } - - - - - - - - - -{ $as_echo "$as_me:$LINENO: checking for working mktime" >&5 +if test $APPLE_UNIVERSAL_BUILD = 1; then + # A universal build on Apple MacOS X platforms. + # The test result would be 'yes' in 32-bit mode and 'no' in 64-bit mode. + # But we need a configuration result that is valid in both modes. + ac_cv_func_working_mktime=no +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working mktime" >&5 $as_echo_n "checking for working mktime... " >&6; } -if test "${ac_cv_func_working_mktime+set}" = set; then +if test "${ac_cv_func_working_mktime+set}" = set; then : $as_echo_n "(cached) " >&6 else - if test "$cross_compiling" = yes; then + if test "$cross_compiling" = yes; then : ac_cv_func_working_mktime=no else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Test program from Paul Eggert and Tony Leneis. */ #include @@ -30912,16 +25699,14 @@ spring_forward_gap () } static int -mktime_test1 (now) - time_t now; +mktime_test1 (time_t now) { struct tm *lt; return ! (lt = localtime (&now)) || mktime (lt) == now; } static int -mktime_test (now) - time_t now; +mktime_test (time_t now) { return (mktime_test1 (now) && mktime_test1 ((time_t) (time_t_max - now)) @@ -30945,8 +25730,7 @@ irix_6_4_bug () } static int -bigtime_test (j) - int j; +bigtime_test (int j) { struct tm tm; time_t now; @@ -31046,53 +25830,34 @@ main () return ! (irix_6_4_bug () && spring_forward_gap () && year_2050_test ()); } _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_working_mktime=yes else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_func_working_mktime=no + ac_cv_func_working_mktime=no fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi - fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_working_mktime" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_working_mktime" >&5 $as_echo "$ac_cv_func_working_mktime" >&6; } if test $ac_cv_func_working_mktime = no; then + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS mktime.$ac_objext" + fi if test $ac_cv_func_working_mktime = no; then -cat >>confdefs.h <<\_ACEOF -#define mktime rpl_mktime -_ACEOF +$as_echo "#define mktime rpl_mktime" >>confdefs.h @@ -31100,101 +25865,25 @@ _ACEOF fi + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS modechange.$ac_objext" - for ac_func in listmntent getmntinfo -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if test `eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` = yes; then +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +eval as_val=\$$as_ac_var + if test "x$as_val" = x""yes; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF @@ -31204,70 +25893,15 @@ done - - - - - - - # We must include grp.h before ucred.h on OSF V4.0, since ucred.h uses # NGROUPS (as the array dimension for a struct member) without a definition. - for ac_header in sys/ucred.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - eval "$as_ac_Header=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_Header=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if test `eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` = yes; then +do : + ac_fn_c_check_header_compile "$LINENO" "sys/ucred.h" "ac_cv_header_sys_ucred_h" "#include +" +if test "x$ac_cv_header_sys_ucred_h" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define HAVE_SYS_UCRED_H 1 _ACEOF fi @@ -31275,64 +25909,16 @@ fi done - for ac_header in sys/mount.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default +do : + ac_fn_c_check_header_compile "$LINENO" "sys/mount.h" "ac_cv_header_sys_mount_h" "$ac_includes_default #if HAVE_SYS_PARAM_H #include #endif - -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - eval "$as_ac_Header=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_Header=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if test `eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` = yes; then +" +if test "x$ac_cv_header_sys_mount_h" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define HAVE_SYS_MOUNT_H 1 _ACEOF fi @@ -31340,149 +25926,12 @@ fi done - - for ac_header in mntent.h sys/fs_types.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-coreutils@gnu.org ## -## ------------------------------------ ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - -fi -if test `eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` = yes; then +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +eval as_val=\$$as_ac_Header + if test "x$as_val" = x""yes; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF @@ -31507,104 +25956,9 @@ $ac_includes_default # include /* needed by powerpc-apple-darwin1.3.7 */ #endif " -{ $as_echo "$as_me:$LINENO: checking for struct fsstat.f_fstypename" >&5 -$as_echo_n "checking for struct fsstat.f_fstypename... " >&6; } -if test "${ac_cv_member_struct_fsstat_f_fstypename+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$getfsstat_includes - -int -main () -{ -static struct fsstat ac_aggr; -if (ac_aggr.f_fstypename) -return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_member_struct_fsstat_f_fstypename=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$getfsstat_includes - -int -main () -{ -static struct fsstat ac_aggr; -if (sizeof ac_aggr.f_fstypename) -return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_member_struct_fsstat_f_fstypename=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_member_struct_fsstat_f_fstypename=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_fsstat_f_fstypename" >&5 -$as_echo "$ac_cv_member_struct_fsstat_f_fstypename" >&6; } -if test $ac_cv_member_struct_fsstat_f_fstypename = yes; then +ac_fn_c_check_member "$LINENO" "struct fsstat" "f_fstypename" "ac_cv_member_struct_fsstat_f_fstypename" "$getfsstat_includes +" +if test "x$ac_cv_member_struct_fsstat_f_fstypename" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_FSSTAT_F_FSTYPENAME 1 @@ -31621,17 +25975,13 @@ ac_list_mounted_fs= # make sure LIBS contains the appropriate -l option. # getmntent is in the standard C library on UNICOS, in -lsun on Irix 4, # -lseq on Dynix/PTX, -lgen on Unixware. -{ $as_echo "$as_me:$LINENO: checking for library containing getmntent" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing getmntent" >&5 $as_echo_n "checking for library containing getmntent... " >&6; } -if test "${ac_cv_search_getmntent+set}" = set; then +if test "${ac_cv_search_getmntent+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. @@ -31656,147 +26006,37 @@ for ac_lib in '' sun seq gen; do ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi - rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_getmntent=$ac_res -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext - if test "${ac_cv_search_getmntent+set}" = set; then +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if test "${ac_cv_search_getmntent+set}" = set; then : break fi done -if test "${ac_cv_search_getmntent+set}" = set; then - : +if test "${ac_cv_search_getmntent+set}" = set; then : + else ac_cv_search_getmntent=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_getmntent" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_getmntent" >&5 $as_echo "$ac_cv_search_getmntent" >&6; } ac_res=$ac_cv_search_getmntent -if test "$ac_res" != no; then +if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi - for ac_func in getmntent -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if test `eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` = yes; then +do : + ac_fn_c_check_func "$LINENO" "getmntent" "ac_cv_func_getmntent" +if test "x$ac_cv_func_getmntent" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define HAVE_GETMNTENT 1 _ACEOF fi @@ -31815,17 +26055,13 @@ done if test -z "$ac_list_mounted_fs"; then # Cray UNICOS 9 - { $as_echo "$as_me:$LINENO: checking for listmntent of Cray/Unicos-9" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for listmntent of Cray/Unicos-9" >&5 $as_echo_n "checking for listmntent of Cray/Unicos-9... " >&6; } - if test "${fu_cv_sys_mounted_cray_listmntent+set}" = set; then + if test "${fu_cv_sys_mounted_cray_listmntent+set}" = set; then : $as_echo_n "(cached) " >&6 else fu_cv_sys_mounted_cray_listmntent=no - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef _CRAY yes @@ -31833,7 +26069,7 @@ yes _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes" >/dev/null 2>&1; then + $EGREP "yes" >/dev/null 2>&1; then : test $ac_cv_func_listmntent = yes \ && fu_cv_sys_mounted_cray_listmntent=yes @@ -31844,69 +26080,41 @@ rm -f conftest* fi - { $as_echo "$as_me:$LINENO: result: $fu_cv_sys_mounted_cray_listmntent" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fu_cv_sys_mounted_cray_listmntent" >&5 $as_echo "$fu_cv_sys_mounted_cray_listmntent" >&6; } if test $fu_cv_sys_mounted_cray_listmntent = yes; then ac_list_mounted_fs=found -cat >>confdefs.h <<\_ACEOF -#define MOUNTED_LISTMNTENT 1 -_ACEOF +$as_echo "#define MOUNTED_LISTMNTENT 1" >>confdefs.h fi fi if test -z "$ac_list_mounted_fs"; then # AIX. - { $as_echo "$as_me:$LINENO: checking for mntctl function and struct vmount" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mntctl function and struct vmount" >&5 $as_echo_n "checking for mntctl function and struct vmount... " >&6; } - if test "${fu_cv_sys_mounted_vmount+set}" = set; then + if test "${fu_cv_sys_mounted_vmount+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then +if ac_fn_c_try_cpp "$LINENO"; then : fu_cv_sys_mounted_vmount=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - fu_cv_sys_mounted_vmount=no fi - rm -f conftest.err conftest.$ac_ext fi - { $as_echo "$as_me:$LINENO: result: $fu_cv_sys_mounted_vmount" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fu_cv_sys_mounted_vmount" >&5 $as_echo "$fu_cv_sys_mounted_vmount" >&6; } if test $fu_cv_sys_mounted_vmount = yes; then ac_list_mounted_fs=found -cat >>confdefs.h <<\_ACEOF -#define MOUNTED_VMOUNT 1 -_ACEOF +$as_echo "#define MOUNTED_VMOUNT 1" >>confdefs.h fi fi @@ -31918,16 +26126,12 @@ if test $ac_cv_func_getmntent = yes; then if test -z "$ac_list_mounted_fs"; then # 4.3BSD, SunOS, HP-UX, Dynix, Irix - { $as_echo "$as_me:$LINENO: checking for one-argument getmntent function" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for one-argument getmntent function" >&5 $as_echo_n "checking for one-argument getmntent function... " >&6; } - if test "${fu_cv_sys_mounted_getmntent1+set}" = set; then + if test "${fu_cv_sys_mounted_getmntent1+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* SunOS 4.1.x /usr/include/mntent.h needs this for FILE */ @@ -31955,65 +26159,38 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : fu_cv_sys_mounted_getmntent1=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - fu_cv_sys_mounted_getmntent1=no + fu_cv_sys_mounted_getmntent1=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi - { $as_echo "$as_me:$LINENO: result: $fu_cv_sys_mounted_getmntent1" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fu_cv_sys_mounted_getmntent1" >&5 $as_echo "$fu_cv_sys_mounted_getmntent1" >&6; } if test $fu_cv_sys_mounted_getmntent1 = yes; then ac_list_mounted_fs=found -cat >>confdefs.h <<\_ACEOF -#define MOUNTED_GETMNTENT1 1 -_ACEOF +$as_echo "#define MOUNTED_GETMNTENT1 1" >>confdefs.h fi fi if test -z "$ac_list_mounted_fs"; then # SVR4 - { $as_echo "$as_me:$LINENO: checking for two-argument getmntent function" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for two-argument getmntent function" >&5 $as_echo_n "checking for two-argument getmntent function... " >&6; } - if test "${fu_cv_sys_mounted_getmntent2+set}" = set; then + if test "${fu_cv_sys_mounted_getmntent2+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "getmntent" >/dev/null 2>&1; then + $EGREP "getmntent" >/dev/null 2>&1; then : fu_cv_sys_mounted_getmntent2=yes else fu_cv_sys_mounted_getmntent2=no @@ -32022,107 +26199,19 @@ rm -f conftest* fi - { $as_echo "$as_me:$LINENO: result: $fu_cv_sys_mounted_getmntent2" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fu_cv_sys_mounted_getmntent2" >&5 $as_echo "$fu_cv_sys_mounted_getmntent2" >&6; } if test $fu_cv_sys_mounted_getmntent2 = yes; then ac_list_mounted_fs=found -cat >>confdefs.h <<\_ACEOF -#define MOUNTED_GETMNTENT2 1 -_ACEOF +$as_echo "#define MOUNTED_GETMNTENT2 1" >>confdefs.h - -for ac_func in hasmntopt -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if test `eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` = yes; then + for ac_func in hasmntopt +do : + ac_fn_c_check_func "$LINENO" "hasmntopt" "ac_cv_func_hasmntopt" +if test "x$ac_cv_func_hasmntopt" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define HAVE_HASMNTOPT 1 _ACEOF fi @@ -32137,16 +26226,12 @@ if test -z "$ac_list_mounted_fs"; then # DEC Alpha running OSF/1, and Apple Darwin 1.3. # powerpc-apple-darwin1.3.7 needs sys/param.h sys/ucred.h sys/fs_types.h - { $as_echo "$as_me:$LINENO: checking for getfsstat function" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getfsstat function" >&5 $as_echo_n "checking for getfsstat function... " >&6; } - if test "${fu_cv_sys_mounted_getfsstat+set}" = set; then + if test "${fu_cv_sys_mounted_getfsstat+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -32167,112 +26252,62 @@ struct statfs *stats; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then +if ac_fn_c_try_link "$LINENO"; then : fu_cv_sys_mounted_getfsstat=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - fu_cv_sys_mounted_getfsstat=no + fu_cv_sys_mounted_getfsstat=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi - - { $as_echo "$as_me:$LINENO: result: $fu_cv_sys_mounted_getfsstat" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fu_cv_sys_mounted_getfsstat" >&5 $as_echo "$fu_cv_sys_mounted_getfsstat" >&6; } if test $fu_cv_sys_mounted_getfsstat = yes; then ac_list_mounted_fs=found -cat >>confdefs.h <<\_ACEOF -#define MOUNTED_GETFSSTAT 1 -_ACEOF +$as_echo "#define MOUNTED_GETFSSTAT 1" >>confdefs.h fi fi if test -z "$ac_list_mounted_fs"; then # SVR3 - { $as_echo "$as_me:$LINENO: checking for FIXME existence of three headers" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for FIXME existence of three headers" >&5 $as_echo_n "checking for FIXME existence of three headers... " >&6; } - if test "${fu_cv_sys_mounted_fread_fstyp+set}" = set; then + if test "${fu_cv_sys_mounted_fread_fstyp+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include _ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then +if ac_fn_c_try_cpp "$LINENO"; then : fu_cv_sys_mounted_fread_fstyp=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - fu_cv_sys_mounted_fread_fstyp=no fi - rm -f conftest.err conftest.$ac_ext fi - { $as_echo "$as_me:$LINENO: result: $fu_cv_sys_mounted_fread_fstyp" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fu_cv_sys_mounted_fread_fstyp" >&5 $as_echo "$fu_cv_sys_mounted_fread_fstyp" >&6; } if test $fu_cv_sys_mounted_fread_fstyp = yes; then ac_list_mounted_fs=found -cat >>confdefs.h <<\_ACEOF -#define MOUNTED_FREAD_FSTYP 1 -_ACEOF +$as_echo "#define MOUNTED_FREAD_FSTYP 1" >>confdefs.h fi fi if test -z "$ac_list_mounted_fs"; then # 4.4BSD and DEC OSF/1. - { $as_echo "$as_me:$LINENO: checking for getmntinfo function" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getmntinfo function" >&5 $as_echo_n "checking for getmntinfo function... " >&6; } - if test "${fu_cv_sys_mounted_getmntinfo+set}" = set; then + if test "${fu_cv_sys_mounted_getmntinfo+set}" = set; then : $as_echo_n "(cached) " >&6 else @@ -32282,20 +26317,16 @@ else fi - { $as_echo "$as_me:$LINENO: result: $fu_cv_sys_mounted_getmntinfo" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fu_cv_sys_mounted_getmntinfo" >&5 $as_echo "$fu_cv_sys_mounted_getmntinfo" >&6; } if test $fu_cv_sys_mounted_getmntinfo = yes; then - { $as_echo "$as_me:$LINENO: checking whether getmntinfo returns statvfs structures" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getmntinfo returns statvfs structures" >&5 $as_echo_n "checking whether getmntinfo returns statvfs structures... " >&6; } - if test "${fu_cv_sys_mounted_getmntinfo2+set}" = set; then + if test "${fu_cv_sys_mounted_getmntinfo2+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if HAVE_SYS_PARAM_H @@ -32318,51 +26349,26 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : fu_cv_sys_mounted_getmntinfo2=no else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - fu_cv_sys_mounted_getmntinfo2=yes + fu_cv_sys_mounted_getmntinfo2=yes fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi - { $as_echo "$as_me:$LINENO: result: $fu_cv_sys_mounted_getmntinfo2" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fu_cv_sys_mounted_getmntinfo2" >&5 $as_echo "$fu_cv_sys_mounted_getmntinfo2" >&6; } if test $fu_cv_sys_mounted_getmntinfo2 = no; then ac_list_mounted_fs=found -cat >>confdefs.h <<\_ACEOF -#define MOUNTED_GETMNTINFO 1 -_ACEOF +$as_echo "#define MOUNTED_GETMNTINFO 1" >>confdefs.h else ac_list_mounted_fs=found -cat >>confdefs.h <<\_ACEOF -#define MOUNTED_GETMNTINFO2 1 -_ACEOF +$as_echo "#define MOUNTED_GETMNTINFO2 1" >>confdefs.h fi fi @@ -32370,154 +26376,43 @@ fi if test -z "$ac_list_mounted_fs"; then # Ultrix - { $as_echo "$as_me:$LINENO: checking for getmnt function" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getmnt function" >&5 $as_echo_n "checking for getmnt function... " >&6; } - if test "${fu_cv_sys_mounted_getmnt+set}" = set; then + if test "${fu_cv_sys_mounted_getmnt+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include _ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then +if ac_fn_c_try_cpp "$LINENO"; then : fu_cv_sys_mounted_getmnt=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - fu_cv_sys_mounted_getmnt=no fi - rm -f conftest.err conftest.$ac_ext fi - { $as_echo "$as_me:$LINENO: result: $fu_cv_sys_mounted_getmnt" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fu_cv_sys_mounted_getmnt" >&5 $as_echo "$fu_cv_sys_mounted_getmnt" >&6; } if test $fu_cv_sys_mounted_getmnt = yes; then ac_list_mounted_fs=found -cat >>confdefs.h <<\_ACEOF -#define MOUNTED_GETMNT 1 -_ACEOF +$as_echo "#define MOUNTED_GETMNT 1" >>confdefs.h fi fi if test -z "$ac_list_mounted_fs"; then # BeOS - - -for ac_func in next_dev fs_stat_dev -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if test `eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` = yes; then + for ac_func in next_dev fs_stat_dev +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +eval as_val=\$$as_ac_var + if test "x$as_val" = x""yes; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF @@ -32525,157 +26420,19 @@ _ACEOF fi done - -for ac_header in fs_info.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-coreutils@gnu.org ## -## ------------------------------------ ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - -fi -if test `eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` = yes; then + for ac_header in fs_info.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "fs_info.h" "ac_cv_header_fs_info_h" "$ac_includes_default" +if test "x$ac_cv_header_fs_info_h" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define HAVE_FS_INFO_H 1 _ACEOF fi done - { $as_echo "$as_me:$LINENO: checking for BEOS mounted file system support functions" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BEOS mounted file system support functions" >&5 $as_echo_n "checking for BEOS mounted file system support functions... " >&6; } if test $ac_cv_header_fs_info_h = yes \ && test $ac_cv_func_next_dev = yes \ @@ -32684,236 +26441,76 @@ $as_echo_n "checking for BEOS mounted file system support functions... " >&6; } else fu_result=no fi - { $as_echo "$as_me:$LINENO: result: $fu_result" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fu_result" >&5 $as_echo "$fu_result" >&6; } if test $fu_result = yes; then ac_list_mounted_fs=found -cat >>confdefs.h <<\_ACEOF -#define MOUNTED_FS_STAT_DEV 1 -_ACEOF +$as_echo "#define MOUNTED_FS_STAT_DEV 1" >>confdefs.h fi fi if test -z "$ac_list_mounted_fs"; then # SVR2 - { $as_echo "$as_me:$LINENO: checking whether it is possible to resort to fread on /etc/mnttab" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is possible to resort to fread on /etc/mnttab" >&5 $as_echo_n "checking whether it is possible to resort to fread on /etc/mnttab... " >&6; } - if test "${fu_cv_sys_mounted_fread+set}" = set; then + if test "${fu_cv_sys_mounted_fread+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then +if ac_fn_c_try_cpp "$LINENO"; then : fu_cv_sys_mounted_fread=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - fu_cv_sys_mounted_fread=no fi - rm -f conftest.err conftest.$ac_ext fi - { $as_echo "$as_me:$LINENO: result: $fu_cv_sys_mounted_fread" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fu_cv_sys_mounted_fread" >&5 $as_echo "$fu_cv_sys_mounted_fread" >&6; } if test $fu_cv_sys_mounted_fread = yes; then ac_list_mounted_fs=found -cat >>confdefs.h <<\_ACEOF -#define MOUNTED_FREAD 1 -_ACEOF +$as_echo "#define MOUNTED_FREAD 1" >>confdefs.h fi fi if test -z "$ac_list_mounted_fs"; then - { { $as_echo "$as_me:$LINENO: error: could not determine how to read list of mounted file systems" >&5 -$as_echo "$as_me: error: could not determine how to read list of mounted file systems" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "could not determine how to read list of mounted file systems" "$LINENO" 5 # FIXME -- no need to abort building the whole package # Can't build mountlist.c or anything that needs its functions fi -if test $ac_list_mounted_fs = found; then +if test $ac_list_mounted_fs = found; then : gl_cv_list_mounted_fs=yes else gl_cv_list_mounted_fs=no fi - if test $gl_cv_list_mounted_fs = yes; then - gl_LIBOBJS="$gl_LIBOBJS mountlist.$ac_objext" -for ac_header in sys/mntent.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_compiler=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-coreutils@gnu.org ## -## ------------------------------------ ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } + gl_LIBOBJS="$gl_LIBOBJS mountlist.$ac_objext" -fi -if test `eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` = yes; then + + for ac_header in sys/mntent.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "sys/mntent.h" "ac_cv_header_sys_mntent_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_mntent_h" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define HAVE_SYS_MNTENT_H 1 _ACEOF fi @@ -32921,112 +26518,13 @@ fi done - { $as_echo "$as_me:$LINENO: checking for struct statfs.f_fstypename" >&5 -$as_echo_n "checking for struct statfs.f_fstypename... " >&6; } -if test "${ac_cv_member_struct_statfs_f_fstypename+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - + ac_fn_c_check_member "$LINENO" "struct statfs" "f_fstypename" "ac_cv_member_struct_statfs_f_fstypename" " #include #include #include - -int -main () -{ -static struct statfs ac_aggr; -if (ac_aggr.f_fstypename) -return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_member_struct_statfs_f_fstypename=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - - #include - #include - #include - - -int -main () -{ -static struct statfs ac_aggr; -if (sizeof ac_aggr.f_fstypename) -return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_member_struct_statfs_f_fstypename=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_member_struct_statfs_f_fstypename=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_statfs_f_fstypename" >&5 -$as_echo "$ac_cv_member_struct_statfs_f_fstypename" >&6; } -if test $ac_cv_member_struct_statfs_f_fstypename = yes; then +" +if test "x$ac_cv_member_struct_statfs_f_fstypename" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_STATFS_F_FSTYPENAME 1 @@ -33041,6 +26539,14 @@ fi + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS mpsort.$ac_objext" @@ -33052,24 +26558,17 @@ fi - - - nanosleep_save_libs=$LIBS # Solaris 2.5.1 needs -lposix4 to get the nanosleep function. # Solaris 7 prefers the library name -lrt to the obsolescent name -lposix4. - { $as_echo "$as_me:$LINENO: checking for library containing nanosleep" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing nanosleep" >&5 $as_echo_n "checking for library containing nanosleep... " >&6; } -if test "${ac_cv_search_nanosleep+set}" = set; then +if test "${ac_cv_search_nanosleep+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. @@ -33094,71 +26593,52 @@ for ac_lib in '' rt posix4; do ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi - rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_nanosleep=$ac_res -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext - if test "${ac_cv_search_nanosleep+set}" = set; then +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if test "${ac_cv_search_nanosleep+set}" = set; then : break fi done -if test "${ac_cv_search_nanosleep+set}" = set; then - : +if test "${ac_cv_search_nanosleep+set}" = set; then : + else ac_cv_search_nanosleep=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_nanosleep" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_nanosleep" >&5 $as_echo "$ac_cv_search_nanosleep" >&6; } ac_res=$ac_cv_search_nanosleep -if test "$ac_res" != no; then +if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" test "$ac_cv_search_nanosleep" = "none required" || LIB_NANOSLEEP=$ac_cv_search_nanosleep fi - { $as_echo "$as_me:$LINENO: checking for working nanosleep" >&5 + + if test $APPLE_UNIVERSAL_BUILD = 1; then + # A universal build on Apple MacOS X platforms. + # The test result would be 'no (mishandles large arguments)' in 64-bit mode + # but 'yes' in 32-bit mode. But we need a configuration result that is + # valid in both modes. + gl_cv_func_nanosleep='no (mishandles large arguments)' + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working nanosleep" >&5 $as_echo_n "checking for working nanosleep... " >&6; } -if test "${gl_cv_func_nanosleep+set}" = set; then +if test "${gl_cv_func_nanosleep+set}" = set; then : $as_echo_n "(cached) " >&6 else - if test "$cross_compiling" = yes; then + if test "$cross_compiling" = yes; then : gl_cv_func_nanosleep=cross-compiling else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -33207,45 +26687,19 @@ cat >>conftest.$ac_ext <<_ACEOF return 119; } _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_run "$LINENO"; then : gl_cv_func_nanosleep=yes else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -case $? in 119) gl_cv_func_nanosleep='no (mishandles large arguments)';; *) gl_cv_func_nanosleep=no;; + case $? in 119) gl_cv_func_nanosleep='no (mishandles large arguments)';; *) gl_cv_func_nanosleep=no;; esac fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi - fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_nanosleep" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_nanosleep" >&5 $as_echo "$gl_cv_func_nanosleep" >&6; } if test "$gl_cv_func_nanosleep" = yes; then REPLACE_NANOSLEEP=0 @@ -33253,9 +26707,7 @@ $as_echo "$gl_cv_func_nanosleep" >&6; } REPLACE_NANOSLEEP=1 if test "$gl_cv_func_nanosleep" = 'no (mishandles large arguments)'; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_BUG_BIG_NANOSLEEP 1 -_ACEOF +$as_echo "#define HAVE_BUG_BIG_NANOSLEEP 1" >>confdefs.h for ac_lib in $LIB_CLOCK_GETTIME; do case " $LIB_NANOSLEEP " in @@ -33264,7 +26716,6 @@ _ACEOF esac done fi - gl_LIBOBJS="$gl_LIBOBJS nanosleep.$ac_objext" @@ -33273,6 +26724,8 @@ _ACEOF + gl_LIBOBJS="$gl_LIBOBJS nanosleep.$ac_objext" + @@ -33285,17 +26738,90 @@ _ACEOF LIBS=$nanosleep_save_libs - { $as_echo "$as_me:$LINENO: checking whether is self-contained" >&5 -$as_echo_n "checking whether is self-contained... " >&6; } -if test "${gl_cv_header_netinet_in_h_selfcontained+set}" = set; then + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_netdb_h='<'netdb.h'>' + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +$as_echo_n "checking absolute name of ... " >&6; } +if test "${gl_cv_next_netdb_h+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ + if test $ac_cv_header_netdb_h = yes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + _ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + gl_cv_next_netdb_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n '\#/netdb.h#{ + s#.*"\(.*/netdb.h\)".*#\1# + s#^/[^/]#//&# + p + q + }'`'"' + else + gl_cv_next_netdb_h='<'netdb.h'>' + fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_netdb_h" >&5 +$as_echo "$gl_cv_next_netdb_h" >&6; } + fi + NEXT_NETDB_H=$gl_cv_next_netdb_h + + + + if test $ac_cv_header_netdb_h = yes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + struct addrinfo a; + int b = EAI_OVERFLOW; + int c = AI_NUMERICSERV; + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + NETDB_H='' +else + NETDB_H='netdb.h' +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + HAVE_NETDB_H=1 + else + NETDB_H='netdb.h' + HAVE_NETDB_H=0 + fi + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether is self-contained" >&5 +$as_echo_n "checking whether is self-contained... " >&6; } +if test "${gl_cv_header_netinet_in_h_selfcontained+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int @@ -33306,223 +26832,75 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : gl_cv_header_netinet_in_h_selfcontained=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - gl_cv_header_netinet_in_h_selfcontained=no + gl_cv_header_netinet_in_h_selfcontained=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_header_netinet_in_h_selfcontained" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_netinet_in_h_selfcontained" >&5 $as_echo "$gl_cv_header_netinet_in_h_selfcontained" >&6; } if test $gl_cv_header_netinet_in_h_selfcontained = yes; then NETINET_IN_H='' else NETINET_IN_H='netinet/in.h' - -for ac_header in netinet/in.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-coreutils@gnu.org ## -## ------------------------------------ ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - -fi -if test `eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` = yes; then + for ac_header in netinet/in.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "netinet/in.h" "ac_cv_header_netinet_in_h" "$ac_includes_default" +if test "x$ac_cv_header_netinet_in_h" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define HAVE_NETINET_IN_H 1 _ACEOF fi done - { $as_echo "$as_me:$LINENO: checking absolute name of " >&5 + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_netinet_in_h='<'netinet/in.h'>' + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 $as_echo_n "checking absolute name of ... " >&6; } -if test "${gl_cv_absolute_netinet_in_h+set}" = set; then +if test "${gl_cv_next_netinet_in_h+set}" = set; then : $as_echo_n "(cached) " >&6 else - - - - - if test $ac_cv_header_netinet_in_h = yes; then - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + if test $ac_cv_header_netinet_in_h = yes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include + _ACEOF - gl_cv_absolute_netinet_in_h=`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | -sed -n '\#/netinet/in.h#{s#.*"\(.*/netinet/in.h\)".*#\1#;s#^/[^/]#//&#;p;q;}'` - fi + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + gl_cv_next_netinet_in_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n '\#/netinet/in.h#{ + s#.*"\(.*/netinet/in.h\)".*#\1# + s#^/[^/]#//&# + p + q + }'`'"' + else + gl_cv_next_netinet_in_h='<'netinet/in.h'>' + fi fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_absolute_netinet_in_h" >&5 -$as_echo "$gl_cv_absolute_netinet_in_h" >&6; } -cat >>confdefs.h <<_ACEOF -#define ABSOLUTE_NETINET_IN_H "$gl_cv_absolute_netinet_in_h" -_ACEOF +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_netinet_in_h" >&5 +$as_echo "$gl_cv_next_netinet_in_h" >&6; } + fi + NEXT_NETINET_IN_H=$gl_cv_next_netinet_in_h - ABSOLUTE_NETINET_IN_H=\"$gl_cv_absolute_netinet_in_h\" if test $ac_cv_header_netinet_in_h = yes; then HAVE_NETINET_IN_H=1 @@ -33533,58 +26911,25 @@ _ACEOF fi - { $as_echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5 -$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } -if test -z "$MKDIR_P"; then - if test "${ac_cv_path_mkdir+set}" = set; then - $as_echo_n "(cached) " >&6 -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in mkdir gmkdir; do - for ac_exec_ext in '' $ac_executable_extensions; do - { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue - case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( - 'mkdir (GNU coreutils) '* | \ - 'mkdir (coreutils) '* | \ - 'mkdir (fileutils) '4.1*) - ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext - break 3;; - esac - done - done -done -IFS=$as_save_IFS -fi - if test "${ac_cv_path_mkdir+set}" = set; then - MKDIR_P="$ac_cv_path_mkdir -p" - else - # As a last resort, use the slow shell script. Don't cache a - # value for MKDIR_P within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the value is a relative name. - test -d ./--version && rmdir ./--version - MKDIR_P="$ac_install_sh -d" - fi -fi -{ $as_echo "$as_me:$LINENO: result: $MKDIR_P" >&5 -$as_echo "$MKDIR_P" >&6; } - { $as_echo "$as_me:$LINENO: checking for obstacks" >&5 + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for obstacks" >&5 $as_echo_n "checking for obstacks... " >&6; } -if test "${ac_cv_func_obstack+set}" = set; then +if test "${ac_cv_func_obstack+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default #include "obstack.h" @@ -33600,50 +26945,148 @@ struct obstack mem; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then +if ac_fn_c_try_link "$LINENO"; then : ac_cv_func_obstack=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_func_obstack=no + ac_cv_func_obstack=no fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_obstack" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_obstack" >&5 $as_echo "$ac_cv_func_obstack" >&6; } if test $ac_cv_func_obstack = yes; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_OBSTACK 1 -_ACEOF +$as_echo "#define HAVE_OBSTACK 1" >>confdefs.h else + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS obstack.$ac_objext" + fi - gl_LIBOBJS="$gl_LIBOBJS openat-die.$ac_objext" + + case "$host_os" in + mingw* | pw*) + + + if test $REPLACE_OPEN != 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS open.$ac_objext" + + + + : + + fi + REPLACE_OPEN=1 + + ;; + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether open recognizes a trailing slash" >&5 +$as_echo_n "checking whether open recognizes a trailing slash... " >&6; } +if test "${gl_cv_func_open_slash+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + + case "$host_os" in + solaris2.[0-9]*) gl_cv_func_open_slash="guessing no" ;; + hpux*) gl_cv_func_open_slash="guessing no" ;; + *) gl_cv_func_open_slash="guessing yes" ;; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#if HAVE_UNISTD_H +# include +#endif +int main () +{ + return open ("conftest.sl/", O_CREAT, 0600) >= 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_open_slash=yes +else + gl_cv_func_open_slash=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi + + rm -f conftest.sl + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_open_slash" >&5 +$as_echo "$gl_cv_func_open_slash" >&6; } + case "$gl_cv_func_open_slash" in + *no) + +$as_echo "#define OPEN_TRAILING_SLASH_BUG 1" >>confdefs.h + + + + if test $REPLACE_OPEN != 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS open.$ac_objext" + + + + : + + fi + REPLACE_OPEN=1 + + ;; + esac + ;; + esac + + + +$as_echo "#define GNULIB_OPEN 1" >>confdefs.h + + + + + GNULIB_OPEN=1 + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS openat-proc.$ac_objext" @@ -33661,112 +27104,50 @@ fi -for ac_func in fchmodat mkdirat openat -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ -#ifdef __STDC__ -# include -#else -# include -#endif -#undef $ac_func -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - eval "$as_ac_var=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if test `eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` = yes; then + + + + for ac_func in fchmodat mkdirat openat +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +eval as_val=\$$as_ac_var + if test "x$as_val" = x""yes; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else - gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" + + gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" + fi done + + case $ac_cv_func_openat+$ac_cv_func_lstat_dereferences_slashed_symlink in yes+yes) ;; - yes+*) gl_LIBOBJS="$gl_LIBOBJS fstatat.$ac_objext";; + yes+*) + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS fstatat.$ac_objext" +;; *) -cat >>confdefs.h <<\_ACEOF -#define __OPENAT_PREFIX rpl_ -_ACEOF +$as_echo "#define __OPENAT_PREFIX rpl_" >>confdefs.h : @@ -33777,89 +27158,8 @@ _ACEOF # The only case in which we won't is when we have fchownat, and it works. use_replacement_fchownat=yes - { $as_echo "$as_me:$LINENO: checking for fchownat" >&5 -$as_echo_n "checking for fchownat... " >&6; } -if test "${ac_cv_func_fchownat+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define fchownat to an innocuous variant, in case declares fchownat. - For example, HP-UX 11i declares gettimeofday. */ -#define fchownat innocuous_fchownat - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char fchownat (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef fchownat - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char fchownat (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_fchownat || defined __stub___fchownat -choke me -#endif - -int -main () -{ -return fchownat (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_func_fchownat=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_func_fchownat=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_fchownat" >&5 -$as_echo "$ac_cv_func_fchownat" >&6; } -if test $ac_cv_func_fchownat = yes; then + ac_fn_c_check_func "$LINENO" "fchownat" "ac_cv_func_fchownat" +if test "x$ac_cv_func_fchownat" = x""yes; then : have_fchownat=yes else have_fchownat=no @@ -33867,9 +27167,9 @@ fi if test $have_fchownat = yes; then - { $as_echo "$as_me:$LINENO: checking whether fchownat works with AT_SYMLINK_NOFOLLOW" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fchownat works with AT_SYMLINK_NOFOLLOW" >&5 $as_echo_n "checking whether fchownat works with AT_SYMLINK_NOFOLLOW... " >&6; } -if test "${gl_cv_func_fchownat_nofollow_works+set}" = set; then +if test "${gl_cv_func_fchownat_nofollow_works+set}" = set; then : $as_echo_n "(cached) " >&6 else @@ -33878,14 +27178,11 @@ else rm -f $gl_dangle # Arrange for deletion of the temporary file this test creates. ac_clean_files="$ac_clean_files $gl_dangle" - if test "$cross_compiling" = yes; then + ln -s conftest.no-such $gl_dangle + if test "$cross_compiling" = yes; then : gl_cv_func_fchownat_nofollow_works=no else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -33902,61 +27199,40 @@ main () } _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_run "$LINENO"; then : gl_cv_func_fchownat_nofollow_works=yes else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -gl_cv_func_fchownat_nofollow_works=no + gl_cv_func_fchownat_nofollow_works=no fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi - fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_fchownat_nofollow_works" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fchownat_nofollow_works" >&5 $as_echo "$gl_cv_func_fchownat_nofollow_works" >&6; } - if test $gl_cv_func_fchownat_nofollow_works = no; then - have_fchownat_bug=yes + if test $gl_cv_func_fchownat_nofollow_works = no; then : + +else + use_replacement_fchownat=no fi - - if test $have_fchownat_bug = no; then - use_replacement_fchownat=no - fi fi if test $use_replacement_fchownat = yes; then - gl_LIBOBJS="$gl_LIBOBJS fchownat.$ac_objext" -cat >>confdefs.h <<\_ACEOF -#define fchownat rpl_fchownat -_ACEOF + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS fchownat.$ac_objext" + + +$as_echo "#define fchownat rpl_fchownat" >>confdefs.h fi @@ -33966,11 +27242,7 @@ _ACEOF - - - - - { $as_echo "$as_me:$LINENO: checking for perl5.005 or newer" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for perl5.005 or newer" >&5 $as_echo_n "checking for perl5.005 or newer... " >&6; } if test "${PERL+set}" = set; then # `PERL' is set in the user's environment. @@ -33994,9 +27266,9 @@ $as_echo_n "checking for perl5.005 or newer... " >&6; } fi done - { $as_echo "$as_me:$LINENO: result: $found" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $found" >&5 $as_echo "$found" >&6; } - test $found = no && { $as_echo "$as_me:$LINENO: WARNING: + test $found = no && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: WARNING: You don't seem to have perl5.005 or newer installed, or you lack a usable version of the Perl File::Compare module. As a result, you may be unable to run a few tests or to regenerate certain @@ -34010,71 +27282,27 @@ WARNING: You don't seem to have perl5.005 or newer installed, or you lack " >&2;} + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS physmem.$ac_objext" + # Prerequisites of lib/physmem.c. - - - - - - - - -for ac_header in sys/pstat.h sys/sysmp.h sys/sysinfo.h \ + for ac_header in sys/pstat.h sys/sysmp.h sys/sysinfo.h \ machine/hal_sysinfo.h sys/table.h sys/param.h sys/sysctl.h \ sys/systemcfg.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default - -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - eval "$as_ac_Header=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_Header=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if test `eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` = yes; then +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +eval as_val=\$$as_ac_Header + if test "x$as_val" = x""yes; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF @@ -34084,101 +27312,12 @@ fi done - - - - - - -for ac_func in pstat_getstatic pstat_getdynamic sysmp getsysinfo sysctl table -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if test `eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` = yes; then + for ac_func in pstat_getstatic pstat_getdynamic sysmp getsysinfo sysctl table +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +eval as_val=\$$as_ac_var + if test "x$as_val" = x""yes; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF @@ -34189,27 +27328,521 @@ done + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a shell that conforms to POSIX" >&5 +$as_echo_n "checking for a shell that conforms to POSIX... " >&6; } +if test "${gl_cv_posix_shell+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + gl_test_posix_shell_script=' + func_return () { + (exit $1) + } + func_success () { + func_return 0 + } + func_failure () { + func_return 1 + } + func_ret_success () { + return 0 + } + func_ret_failure () { + return 1 + } + subshell_umask_sanity () { + (umask 22; (umask 0); test $(umask) -eq 22) + } + test "$(echo foo)" = foo && + func_success && + ! func_failure && + func_ret_success && + ! func_ret_failure && + (set x && func_ret_success y && test x = "$1") && + subshell_umask_sanity + ' + for gl_cv_posix_shell in \ + "$CONFIG_SHELL" "$SHELL" /bin/sh /bin/bash /bin/ksh /bin/sh5 no; do + case $gl_cv_posix_shell in + /*) + "$gl_cv_posix_shell" -c "$gl_test_posix_shell_script" 2>/dev/null \ + && break;; + esac + done +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_posix_shell" >&5 +$as_echo "$gl_cv_posix_shell" >&6; } + + if test "$gl_cv_posix_shell" != no; then + POSIX_SHELL=$gl_cv_posix_shell + PREFERABLY_POSIX_SHELL=$POSIX_SHELL + else + POSIX_SHELL= + PREFERABLY_POSIX_SHELL=/bin/sh + fi + + + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS posixtm.$ac_objext" + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS posixver.$ac_objext" - { $as_echo "$as_me:$LINENO: checking for SVID conformant putenv" >&5 -$as_echo_n "checking for SVID conformant putenv... " >&6; } -if test "${jm_cv_func_svid_putenv+set}" = set; then + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexp can be used without linking with libm" >&5 +$as_echo_n "checking whether frexp can be used without linking with libm... " >&6; } +if test "${gl_cv_func_frexp_no_libm+set}" = set; then : $as_echo_n "(cached) " >&6 else - if test "$cross_compiling" = yes; then - jm_cv_func_svid_putenv=no -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + double x; + int y; +int +main () +{ +return frexp (x, &y) < 1; + ; + return 0; +} _ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_func_frexp_no_libm=yes +else + gl_cv_func_frexp_no_libm=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexp_no_libm" >&5 +$as_echo "$gl_cv_func_frexp_no_libm" >&6; } + if test $gl_cv_func_frexp_no_libm = yes; then + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexp works" >&5 +$as_echo_n "checking whether frexp works... " >&6; } +if test "${gl_cv_func_frexp_works+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + case "$host_os" in + netbsd* | irix* | mingw*) gl_cv_func_frexp_works="guessing no";; + *) gl_cv_func_frexp_works="guessing yes";; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +int main() +{ + int i; + volatile double x; +/* HP cc on HP-UX 10.20 has a bug with the constant expression -0.0. + So we use -zero instead. */ + double zero = 0.0; + /* Test on denormalized numbers. */ + for (i = 1, x = 1.0; i >= DBL_MIN_EXP; i--, x *= 0.5) + ; + if (x > 0.0) + { + int exp; + double y = frexp (x, &exp); + /* On machines with IEEE754 arithmetic: x = 1.11254e-308, exp = -1022. + On NetBSD: y = 0.75. Correct: y = 0.5. */ + if (y != 0.5) + return 1; + } + /* Test on infinite numbers. */ + x = 1.0 / 0.0; + { + int exp; + double y = frexp (x, &exp); + if (y != x) + return 1; + } + /* Test on negative zero. */ + x = -zero; + { + int exp; + double y = frexp (x, &exp); + if (memcmp (&y, &x, sizeof x)) + return 1; + } + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_frexp_works=yes +else + gl_cv_func_frexp_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexp_works" >&5 +$as_echo "$gl_cv_func_frexp_works" >&6; } + + case "$gl_cv_func_frexp_works" in + *yes) + +$as_echo "#define HAVE_FREXP_IN_LIBC 1" >>confdefs.h + + ;; + esac + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ldexp can be used without linking with libm" >&5 +$as_echo_n "checking whether ldexp can be used without linking with libm... " >&6; } +if test "${gl_cv_func_ldexp_no_libm+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + double x; + int y; +int +main () +{ +return ldexp (x, y) < 1; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_func_ldexp_no_libm=yes +else + gl_cv_func_ldexp_no_libm=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_ldexp_no_libm" >&5 +$as_echo "$gl_cv_func_ldexp_no_libm" >&6; } + if test $gl_cv_func_ldexp_no_libm = yes; then + +$as_echo "#define HAVE_LDEXP_IN_LIBC 1" >>confdefs.h + + fi + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexpl can be used without linking with libm" >&5 +$as_echo_n "checking whether frexpl can be used without linking with libm... " >&6; } +if test "${gl_cv_func_frexpl_no_libm+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + long double x; + int y; +int +main () +{ +return frexpl (x, &y) < 1; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_func_frexpl_no_libm=yes +else + gl_cv_func_frexpl_no_libm=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexpl_no_libm" >&5 +$as_echo "$gl_cv_func_frexpl_no_libm" >&6; } + if test $gl_cv_func_frexpl_no_libm = yes; then + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexpl works" >&5 +$as_echo_n "checking whether frexpl works... " >&6; } +if test "${gl_cv_func_frexpl_works+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + case "$host_os" in + aix* | beos* | darwin* | irix* | mingw* | pw*) + gl_cv_func_frexpl_works="guessing no";; + *) gl_cv_func_frexpl_works="guessing yes";; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +/* Override the values of , like done in float.in.h. */ +#if defined __i386__ && (defined __BEOS__ || defined __OpenBSD__) +# undef LDBL_MIN_EXP +# define LDBL_MIN_EXP (-16381) +#endif +extern long double frexpl (long double, int *); +int main() +{ + volatile long double x; + /* Test on finite numbers that fails on AIX 5.1. */ + x = 16.0L; + { + int exp = -9999; + frexpl (x, &exp); + if (exp != 5) + return 1; + } + /* Test on finite numbers that fails on MacOS X 10.4, because its frexpl + function returns an invalid (incorrectly normalized) value: it returns + y = { 0x3fe028f5, 0xc28f5c28, 0x3c9eb851, 0xeb851eb8 } + but the correct result is + 0.505L = { 0x3fe028f5, 0xc28f5c29, 0xbc547ae1, 0x47ae1480 } */ + x = 1.01L; + { + int exp = -9999; + long double y = frexpl (x, &exp); + if (!(exp == 1 && y == 0.505L)) + return 1; + } + /* Test on large finite numbers. This fails on BeOS at i = 16322, while + LDBL_MAX_EXP = 16384. + In the loop end test, we test x against Infinity, rather than comparing + i with LDBL_MAX_EXP, because BeOS has a wrong LDBL_MAX_EXP. */ + { + int i; + for (i = 1, x = 1.0L; x != x + x; i++, x *= 2.0L) + { + int exp = -9999; + frexpl (x, &exp); + if (exp != i) + return 1; + } + } + /* Test on denormalized numbers. */ + { + int i; + for (i = 1, x = 1.0L; i >= LDBL_MIN_EXP; i--, x *= 0.5L) + ; + if (x > 0.0L) + { + int exp; + long double y = frexpl (x, &exp); + /* On machines with IEEE854 arithmetic: x = 1.68105e-4932, + exp = -16382, y = 0.5. On MacOS X 10.5: exp = -16384, y = 0.5. */ + if (exp != LDBL_MIN_EXP - 1) + return 1; + } + } + /* Test on infinite numbers. */ + x = 1.0L / 0.0L; + { + int exp; + long double y = frexpl (x, &exp); + if (y != x) + return 1; + } + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_frexpl_works=yes +else + gl_cv_func_frexpl_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexpl_works" >&5 +$as_echo "$gl_cv_func_frexpl_works" >&6; } + + case "$gl_cv_func_frexpl_works" in + *yes) gl_func_frexpl_no_libm=yes ;; + *) gl_func_frexpl_no_libm=no; REPLACE_FREXPL=1 ;; + esac + else + gl_func_frexpl_no_libm=no + REPLACE_FREXPL=1 + fi + if test $gl_func_frexpl_no_libm = yes; then + +$as_echo "#define HAVE_FREXPL_IN_LIBC 1" >>confdefs.h + + ac_fn_c_check_decl "$LINENO" "frexpl" "ac_cv_have_decl_frexpl" "#include +" +if test "x$ac_cv_have_decl_frexpl" = x""yes; then : + +else + HAVE_DECL_FREXPL=0 +fi + + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ldexpl can be used without linking with libm" >&5 +$as_echo_n "checking whether ldexpl can be used without linking with libm... " >&6; } +if test "${gl_cv_func_ldexpl_no_libm+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + long double x; + int y; +int +main () +{ +return ldexpl (x, y) < 1; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_func_ldexpl_no_libm=yes +else + gl_cv_func_ldexpl_no_libm=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_ldexpl_no_libm" >&5 +$as_echo "$gl_cv_func_ldexpl_no_libm" >&6; } + if test $gl_cv_func_ldexpl_no_libm = yes; then + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ldexpl works" >&5 +$as_echo_n "checking whether ldexpl works... " >&6; } +if test "${gl_cv_func_ldexpl_works+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + case "$host_os" in + aix*) gl_cv_func_ldexpl_works="guessing no";; + *) gl_cv_func_ldexpl_works="guessing yes";; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +extern long double ldexpl (long double, int); +int main() +{ + volatile long double x1 = 1.0; + volatile long double y1 = ldexpl (x1, -1); + volatile long double x2 = 1.73205L; + volatile long double y2 = ldexpl (x2, 0); + return (y1 != 0.5L) || (y2 != x2); +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_ldexpl_works=yes +else + gl_cv_func_ldexpl_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_ldexpl_works" >&5 +$as_echo "$gl_cv_func_ldexpl_works" >&6; } + + case "$gl_cv_func_ldexpl_works" in + *yes) + +$as_echo "#define HAVE_LDEXPL_IN_LIBC 1" >>confdefs.h + + ac_fn_c_check_decl "$LINENO" "ldexpl" "ac_cv_have_decl_ldexpl" "#include +" +if test "x$ac_cv_have_decl_ldexpl" = x""yes; then : + +else + HAVE_DECL_LDEXPL=0 +fi + + ;; + esac + fi + + + + + for ac_func in getppriv +do : + ac_fn_c_check_func "$LINENO" "getppriv" "ac_cv_func_getppriv" +if test "x$ac_cv_func_getppriv" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_GETPPRIV 1 +_ACEOF + +fi +done + + + + + XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --keyword='proper_name:1,\"This is a proper name. See the gettext manual, section Names.\"'" + + + + XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --keyword='proper_name_utf8:1,\"This is a proper name. See the gettext manual, section Names.\"'" + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for putenv compatible with GNU and SVID" >&5 +$as_echo_n "checking for putenv compatible with GNU and SVID... " >&6; } +if test "${gl_cv_func_svid_putenv+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + gl_cv_func_svid_putenv=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int @@ -34234,59 +27867,59 @@ main () return 0; } _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - jm_cv_func_svid_putenv=yes +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_svid_putenv=yes else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -jm_cv_func_svid_putenv=no + gl_cv_func_svid_putenv=no fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi - fi -{ $as_echo "$as_me:$LINENO: result: $jm_cv_func_svid_putenv" >&5 -$as_echo "$jm_cv_func_svid_putenv" >&6; } - if test $jm_cv_func_svid_putenv = no; then - gl_LIBOBJS="$gl_LIBOBJS putenv.$ac_objext" +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_svid_putenv" >&5 +$as_echo "$gl_cv_func_svid_putenv" >&6; } + if test $gl_cv_func_svid_putenv = no; then + REPLACE_PUTENV=1 -cat >>confdefs.h <<\_ACEOF -#define putenv rpl_putenv -_ACEOF + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS putenv.$ac_objext" fi + + GNULIB_PUTENV=1 + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS quote.$ac_objext" + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS quotearg.$ac_objext" @@ -34295,232 +27928,21 @@ _ACEOF - { $as_echo "$as_me:$LINENO: checking for mbstate_t" >&5 -$as_echo_n "checking for mbstate_t... " >&6; } -if test "${ac_cv_type_mbstate_t+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -# include -int -main () -{ -mbstate_t x; return sizeof x; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type_mbstate_t=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_mbstate_t=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_mbstate_t" >&5 -$as_echo "$ac_cv_type_mbstate_t" >&6; } - if test $ac_cv_type_mbstate_t = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_MBSTATE_T 1 -_ACEOF - - else - -cat >>confdefs.h <<\_ACEOF -#define mbstate_t int -_ACEOF - - fi - - { $as_echo "$as_me:$LINENO: checking whether mbrtowc and mbstate_t are properly declared" >&5 -$as_echo_n "checking whether mbrtowc and mbstate_t are properly declared... " >&6; } -if test "${gl_cv_func_mbrtowc+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -int -main () -{ -wchar_t wc; - char const s[] = ""; - size_t n = 1; - mbstate_t state; - return ! (sizeof state && (mbrtowc) (&wc, s, n, &state)); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - gl_cv_func_mbrtowc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - gl_cv_func_mbrtowc=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_mbrtowc" >&5 -$as_echo "$gl_cv_func_mbrtowc" >&6; } - if test $gl_cv_func_mbrtowc = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_MBRTOWC 1 -_ACEOF - - fi -for ac_func in raise -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if test `eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` = yes; then + for ac_func in raise +do : + ac_fn_c_check_func "$LINENO" "raise" "ac_cv_func_raise" +if test "x$ac_cv_func_raise" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define HAVE_RAISE 1 _ACEOF else - gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" + + gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" + fi done @@ -34528,13 +27950,18 @@ done - - - - if test $ac_cv_func_readlink = no; then HAVE_READLINK=0 - gl_LIBOBJS="$gl_LIBOBJS readlink.$ac_objext" + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS readlink.$ac_objext" + : @@ -34545,23 +27972,24 @@ done GNULIB_READLINK=1 + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS readtokens.$ac_objext" + : - - - - - - - if test $ac_cv_header_utmp_h = yes || test $ac_cv_header_utmpx_h = yes; then - gl_LIBOBJS="$gl_LIBOBJS readutmp.$ac_objext" @@ -34570,83 +27998,27 @@ done + gl_LIBOBJS="$gl_LIBOBJS readutmp.$ac_objext" - { $as_echo "$as_me:$LINENO: checking whether getutent is declared" >&5 -$as_echo_n "checking whether getutent is declared... " >&6; } -if test "${ac_cv_have_decl_getutent+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ + ac_fn_c_check_decl "$LINENO" "getutent" "ac_cv_have_decl_getutent" " #ifdef HAVE_UTMP_H # include #endif - -int -main () -{ -#ifndef getutent - (void) getutent; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_getutent=yes +" +if test "x$ac_cv_have_decl_getutent" = x""yes; then : + ac_have_decl=1 else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_getutent=no + ac_have_decl=0 fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_getutent" >&5 -$as_echo "$ac_cv_have_decl_getutent" >&6; } -if test $ac_cv_have_decl_getutent = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_GETUTENT 1 +#define HAVE_DECL_GETUTENT $ac_have_decl _ACEOF - -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_GETUTENT 0 -_ACEOF - - -fi - - utmp_includes="\ $ac_includes_default #ifdef HAVE_UTMPX_H @@ -34661,104 +28033,9 @@ $ac_includes_default # include #endif " - { $as_echo "$as_me:$LINENO: checking for struct utmpx.ut_user" >&5 -$as_echo_n "checking for struct utmpx.ut_user... " >&6; } -if test "${ac_cv_member_struct_utmpx_ut_user+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$utmp_includes - -int -main () -{ -static struct utmpx ac_aggr; -if (ac_aggr.ut_user) -return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_member_struct_utmpx_ut_user=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$utmp_includes - -int -main () -{ -static struct utmpx ac_aggr; -if (sizeof ac_aggr.ut_user) -return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_member_struct_utmpx_ut_user=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_member_struct_utmpx_ut_user=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_utmpx_ut_user" >&5 -$as_echo "$ac_cv_member_struct_utmpx_ut_user" >&6; } -if test $ac_cv_member_struct_utmpx_ut_user = yes; then + ac_fn_c_check_member "$LINENO" "struct utmpx" "ut_user" "ac_cv_member_struct_utmpx_ut_user" "$utmp_includes +" +if test "x$ac_cv_member_struct_utmpx_ut_user" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_UTMPX_UT_USER 1 @@ -34767,104 +28044,9 @@ _ACEOF fi - { $as_echo "$as_me:$LINENO: checking for struct utmp.ut_user" >&5 -$as_echo_n "checking for struct utmp.ut_user... " >&6; } -if test "${ac_cv_member_struct_utmp_ut_user+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$utmp_includes - -int -main () -{ -static struct utmp ac_aggr; -if (ac_aggr.ut_user) -return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_member_struct_utmp_ut_user=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$utmp_includes - -int -main () -{ -static struct utmp ac_aggr; -if (sizeof ac_aggr.ut_user) -return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_member_struct_utmp_ut_user=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_member_struct_utmp_ut_user=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_utmp_ut_user" >&5 -$as_echo "$ac_cv_member_struct_utmp_ut_user" >&6; } -if test $ac_cv_member_struct_utmp_ut_user = yes; then + ac_fn_c_check_member "$LINENO" "struct utmp" "ut_user" "ac_cv_member_struct_utmp_ut_user" "$utmp_includes +" +if test "x$ac_cv_member_struct_utmp_ut_user" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_UTMP_UT_USER 1 @@ -34873,104 +28055,9 @@ _ACEOF fi - { $as_echo "$as_me:$LINENO: checking for struct utmpx.ut_name" >&5 -$as_echo_n "checking for struct utmpx.ut_name... " >&6; } -if test "${ac_cv_member_struct_utmpx_ut_name+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$utmp_includes - -int -main () -{ -static struct utmpx ac_aggr; -if (ac_aggr.ut_name) -return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_member_struct_utmpx_ut_name=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$utmp_includes - -int -main () -{ -static struct utmpx ac_aggr; -if (sizeof ac_aggr.ut_name) -return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_member_struct_utmpx_ut_name=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_member_struct_utmpx_ut_name=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_utmpx_ut_name" >&5 -$as_echo "$ac_cv_member_struct_utmpx_ut_name" >&6; } -if test $ac_cv_member_struct_utmpx_ut_name = yes; then + ac_fn_c_check_member "$LINENO" "struct utmpx" "ut_name" "ac_cv_member_struct_utmpx_ut_name" "$utmp_includes +" +if test "x$ac_cv_member_struct_utmpx_ut_name" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_UTMPX_UT_NAME 1 @@ -34979,104 +28066,9 @@ _ACEOF fi - { $as_echo "$as_me:$LINENO: checking for struct utmp.ut_name" >&5 -$as_echo_n "checking for struct utmp.ut_name... " >&6; } -if test "${ac_cv_member_struct_utmp_ut_name+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$utmp_includes - -int -main () -{ -static struct utmp ac_aggr; -if (ac_aggr.ut_name) -return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_member_struct_utmp_ut_name=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$utmp_includes - -int -main () -{ -static struct utmp ac_aggr; -if (sizeof ac_aggr.ut_name) -return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_member_struct_utmp_ut_name=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_member_struct_utmp_ut_name=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_utmp_ut_name" >&5 -$as_echo "$ac_cv_member_struct_utmp_ut_name" >&6; } -if test $ac_cv_member_struct_utmp_ut_name = yes; then + ac_fn_c_check_member "$LINENO" "struct utmp" "ut_name" "ac_cv_member_struct_utmp_ut_name" "$utmp_includes +" +if test "x$ac_cv_member_struct_utmp_ut_name" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_UTMP_UT_NAME 1 @@ -35085,104 +28077,9 @@ _ACEOF fi - { $as_echo "$as_me:$LINENO: checking for struct utmpx.ut_type" >&5 -$as_echo_n "checking for struct utmpx.ut_type... " >&6; } -if test "${ac_cv_member_struct_utmpx_ut_type+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$utmp_includes - -int -main () -{ -static struct utmpx ac_aggr; -if (ac_aggr.ut_type) -return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_member_struct_utmpx_ut_type=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$utmp_includes - -int -main () -{ -static struct utmpx ac_aggr; -if (sizeof ac_aggr.ut_type) -return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_member_struct_utmpx_ut_type=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_member_struct_utmpx_ut_type=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_utmpx_ut_type" >&5 -$as_echo "$ac_cv_member_struct_utmpx_ut_type" >&6; } -if test $ac_cv_member_struct_utmpx_ut_type = yes; then + ac_fn_c_check_member "$LINENO" "struct utmpx" "ut_type" "ac_cv_member_struct_utmpx_ut_type" "$utmp_includes +" +if test "x$ac_cv_member_struct_utmpx_ut_type" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_UTMPX_UT_TYPE 1 @@ -35191,104 +28088,9 @@ _ACEOF fi - { $as_echo "$as_me:$LINENO: checking for struct utmp.ut_type" >&5 -$as_echo_n "checking for struct utmp.ut_type... " >&6; } -if test "${ac_cv_member_struct_utmp_ut_type+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$utmp_includes - -int -main () -{ -static struct utmp ac_aggr; -if (ac_aggr.ut_type) -return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_member_struct_utmp_ut_type=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$utmp_includes - -int -main () -{ -static struct utmp ac_aggr; -if (sizeof ac_aggr.ut_type) -return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_member_struct_utmp_ut_type=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_member_struct_utmp_ut_type=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_utmp_ut_type" >&5 -$as_echo "$ac_cv_member_struct_utmp_ut_type" >&6; } -if test $ac_cv_member_struct_utmp_ut_type = yes; then + ac_fn_c_check_member "$LINENO" "struct utmp" "ut_type" "ac_cv_member_struct_utmp_ut_type" "$utmp_includes +" +if test "x$ac_cv_member_struct_utmp_ut_type" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_UTMP_UT_TYPE 1 @@ -35297,104 +28099,9 @@ _ACEOF fi - { $as_echo "$as_me:$LINENO: checking for struct utmpx.ut_pid" >&5 -$as_echo_n "checking for struct utmpx.ut_pid... " >&6; } -if test "${ac_cv_member_struct_utmpx_ut_pid+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$utmp_includes - -int -main () -{ -static struct utmpx ac_aggr; -if (ac_aggr.ut_pid) -return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_member_struct_utmpx_ut_pid=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$utmp_includes - -int -main () -{ -static struct utmpx ac_aggr; -if (sizeof ac_aggr.ut_pid) -return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_member_struct_utmpx_ut_pid=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_member_struct_utmpx_ut_pid=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_utmpx_ut_pid" >&5 -$as_echo "$ac_cv_member_struct_utmpx_ut_pid" >&6; } -if test $ac_cv_member_struct_utmpx_ut_pid = yes; then + ac_fn_c_check_member "$LINENO" "struct utmpx" "ut_pid" "ac_cv_member_struct_utmpx_ut_pid" "$utmp_includes +" +if test "x$ac_cv_member_struct_utmpx_ut_pid" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_UTMPX_UT_PID 1 @@ -35403,104 +28110,9 @@ _ACEOF fi - { $as_echo "$as_me:$LINENO: checking for struct utmp.ut_pid" >&5 -$as_echo_n "checking for struct utmp.ut_pid... " >&6; } -if test "${ac_cv_member_struct_utmp_ut_pid+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$utmp_includes - -int -main () -{ -static struct utmp ac_aggr; -if (ac_aggr.ut_pid) -return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_member_struct_utmp_ut_pid=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$utmp_includes - -int -main () -{ -static struct utmp ac_aggr; -if (sizeof ac_aggr.ut_pid) -return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_member_struct_utmp_ut_pid=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_member_struct_utmp_ut_pid=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_utmp_ut_pid" >&5 -$as_echo "$ac_cv_member_struct_utmp_ut_pid" >&6; } -if test $ac_cv_member_struct_utmp_ut_pid = yes; then + ac_fn_c_check_member "$LINENO" "struct utmp" "ut_pid" "ac_cv_member_struct_utmp_ut_pid" "$utmp_includes +" +if test "x$ac_cv_member_struct_utmp_ut_pid" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_UTMP_UT_PID 1 @@ -35509,104 +28121,9 @@ _ACEOF fi - { $as_echo "$as_me:$LINENO: checking for struct utmpx.ut_id" >&5 -$as_echo_n "checking for struct utmpx.ut_id... " >&6; } -if test "${ac_cv_member_struct_utmpx_ut_id+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$utmp_includes - -int -main () -{ -static struct utmpx ac_aggr; -if (ac_aggr.ut_id) -return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_member_struct_utmpx_ut_id=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$utmp_includes - -int -main () -{ -static struct utmpx ac_aggr; -if (sizeof ac_aggr.ut_id) -return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_member_struct_utmpx_ut_id=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_member_struct_utmpx_ut_id=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_utmpx_ut_id" >&5 -$as_echo "$ac_cv_member_struct_utmpx_ut_id" >&6; } -if test $ac_cv_member_struct_utmpx_ut_id = yes; then + ac_fn_c_check_member "$LINENO" "struct utmpx" "ut_id" "ac_cv_member_struct_utmpx_ut_id" "$utmp_includes +" +if test "x$ac_cv_member_struct_utmpx_ut_id" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_UTMPX_UT_ID 1 @@ -35615,104 +28132,9 @@ _ACEOF fi - { $as_echo "$as_me:$LINENO: checking for struct utmp.ut_id" >&5 -$as_echo_n "checking for struct utmp.ut_id... " >&6; } -if test "${ac_cv_member_struct_utmp_ut_id+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$utmp_includes - -int -main () -{ -static struct utmp ac_aggr; -if (ac_aggr.ut_id) -return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_member_struct_utmp_ut_id=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$utmp_includes - -int -main () -{ -static struct utmp ac_aggr; -if (sizeof ac_aggr.ut_id) -return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_member_struct_utmp_ut_id=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_member_struct_utmp_ut_id=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_utmp_ut_id" >&5 -$as_echo "$ac_cv_member_struct_utmp_ut_id" >&6; } -if test $ac_cv_member_struct_utmp_ut_id = yes; then + ac_fn_c_check_member "$LINENO" "struct utmp" "ut_id" "ac_cv_member_struct_utmp_ut_id" "$utmp_includes +" +if test "x$ac_cv_member_struct_utmp_ut_id" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_UTMP_UT_ID 1 @@ -35721,104 +28143,9 @@ _ACEOF fi - { $as_echo "$as_me:$LINENO: checking for struct utmpx.ut_exit" >&5 -$as_echo_n "checking for struct utmpx.ut_exit... " >&6; } -if test "${ac_cv_member_struct_utmpx_ut_exit+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$utmp_includes - -int -main () -{ -static struct utmpx ac_aggr; -if (ac_aggr.ut_exit) -return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_member_struct_utmpx_ut_exit=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$utmp_includes - -int -main () -{ -static struct utmpx ac_aggr; -if (sizeof ac_aggr.ut_exit) -return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_member_struct_utmpx_ut_exit=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_member_struct_utmpx_ut_exit=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_utmpx_ut_exit" >&5 -$as_echo "$ac_cv_member_struct_utmpx_ut_exit" >&6; } -if test $ac_cv_member_struct_utmpx_ut_exit = yes; then + ac_fn_c_check_member "$LINENO" "struct utmpx" "ut_exit" "ac_cv_member_struct_utmpx_ut_exit" "$utmp_includes +" +if test "x$ac_cv_member_struct_utmpx_ut_exit" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_UTMPX_UT_EXIT 1 @@ -35827,104 +28154,9 @@ _ACEOF fi - { $as_echo "$as_me:$LINENO: checking for struct utmp.ut_exit" >&5 -$as_echo_n "checking for struct utmp.ut_exit... " >&6; } -if test "${ac_cv_member_struct_utmp_ut_exit+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$utmp_includes - -int -main () -{ -static struct utmp ac_aggr; -if (ac_aggr.ut_exit) -return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_member_struct_utmp_ut_exit=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$utmp_includes - -int -main () -{ -static struct utmp ac_aggr; -if (sizeof ac_aggr.ut_exit) -return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_member_struct_utmp_ut_exit=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_member_struct_utmp_ut_exit=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_utmp_ut_exit" >&5 -$as_echo "$ac_cv_member_struct_utmp_ut_exit" >&6; } -if test $ac_cv_member_struct_utmp_ut_exit = yes; then + ac_fn_c_check_member "$LINENO" "struct utmp" "ut_exit" "ac_cv_member_struct_utmp_ut_exit" "$utmp_includes +" +if test "x$ac_cv_member_struct_utmp_ut_exit" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_UTMP_UT_EXIT 1 @@ -35934,104 +28166,9 @@ _ACEOF fi - { $as_echo "$as_me:$LINENO: checking for struct utmpx.ut_exit.ut_exit" >&5 -$as_echo_n "checking for struct utmpx.ut_exit.ut_exit... " >&6; } -if test "${ac_cv_member_struct_utmpx_ut_exit_ut_exit+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$utmp_includes - -int -main () -{ -static struct utmpx ac_aggr; -if (ac_aggr.ut_exit.ut_exit) -return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_member_struct_utmpx_ut_exit_ut_exit=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$utmp_includes - -int -main () -{ -static struct utmpx ac_aggr; -if (sizeof ac_aggr.ut_exit.ut_exit) -return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_member_struct_utmpx_ut_exit_ut_exit=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_member_struct_utmpx_ut_exit_ut_exit=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_utmpx_ut_exit_ut_exit" >&5 -$as_echo "$ac_cv_member_struct_utmpx_ut_exit_ut_exit" >&6; } -if test $ac_cv_member_struct_utmpx_ut_exit_ut_exit = yes; then + ac_fn_c_check_member "$LINENO" "struct utmpx" "ut_exit.ut_exit" "ac_cv_member_struct_utmpx_ut_exit_ut_exit" "$utmp_includes +" +if test "x$ac_cv_member_struct_utmpx_ut_exit_ut_exit" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_UTMPX_UT_EXIT_UT_EXIT 1 @@ -36040,104 +28177,9 @@ _ACEOF fi - { $as_echo "$as_me:$LINENO: checking for struct utmp.ut_exit.ut_exit" >&5 -$as_echo_n "checking for struct utmp.ut_exit.ut_exit... " >&6; } -if test "${ac_cv_member_struct_utmp_ut_exit_ut_exit+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$utmp_includes - -int -main () -{ -static struct utmp ac_aggr; -if (ac_aggr.ut_exit.ut_exit) -return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_member_struct_utmp_ut_exit_ut_exit=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$utmp_includes - -int -main () -{ -static struct utmp ac_aggr; -if (sizeof ac_aggr.ut_exit.ut_exit) -return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_member_struct_utmp_ut_exit_ut_exit=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_member_struct_utmp_ut_exit_ut_exit=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_utmp_ut_exit_ut_exit" >&5 -$as_echo "$ac_cv_member_struct_utmp_ut_exit_ut_exit" >&6; } -if test $ac_cv_member_struct_utmp_ut_exit_ut_exit = yes; then + ac_fn_c_check_member "$LINENO" "struct utmp" "ut_exit.ut_exit" "ac_cv_member_struct_utmp_ut_exit_ut_exit" "$utmp_includes +" +if test "x$ac_cv_member_struct_utmp_ut_exit_ut_exit" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_UTMP_UT_EXIT_UT_EXIT 1 @@ -36146,104 +28188,9 @@ _ACEOF fi - { $as_echo "$as_me:$LINENO: checking for struct utmpx.ut_exit.e_exit" >&5 -$as_echo_n "checking for struct utmpx.ut_exit.e_exit... " >&6; } -if test "${ac_cv_member_struct_utmpx_ut_exit_e_exit+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$utmp_includes - -int -main () -{ -static struct utmpx ac_aggr; -if (ac_aggr.ut_exit.e_exit) -return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_member_struct_utmpx_ut_exit_e_exit=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$utmp_includes - -int -main () -{ -static struct utmpx ac_aggr; -if (sizeof ac_aggr.ut_exit.e_exit) -return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_member_struct_utmpx_ut_exit_e_exit=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_member_struct_utmpx_ut_exit_e_exit=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_utmpx_ut_exit_e_exit" >&5 -$as_echo "$ac_cv_member_struct_utmpx_ut_exit_e_exit" >&6; } -if test $ac_cv_member_struct_utmpx_ut_exit_e_exit = yes; then + ac_fn_c_check_member "$LINENO" "struct utmpx" "ut_exit.e_exit" "ac_cv_member_struct_utmpx_ut_exit_e_exit" "$utmp_includes +" +if test "x$ac_cv_member_struct_utmpx_ut_exit_e_exit" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_UTMPX_UT_EXIT_E_EXIT 1 @@ -36252,104 +28199,9 @@ _ACEOF fi - { $as_echo "$as_me:$LINENO: checking for struct utmp.ut_exit.e_exit" >&5 -$as_echo_n "checking for struct utmp.ut_exit.e_exit... " >&6; } -if test "${ac_cv_member_struct_utmp_ut_exit_e_exit+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$utmp_includes - -int -main () -{ -static struct utmp ac_aggr; -if (ac_aggr.ut_exit.e_exit) -return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_member_struct_utmp_ut_exit_e_exit=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$utmp_includes - -int -main () -{ -static struct utmp ac_aggr; -if (sizeof ac_aggr.ut_exit.e_exit) -return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_member_struct_utmp_ut_exit_e_exit=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_member_struct_utmp_ut_exit_e_exit=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_utmp_ut_exit_e_exit" >&5 -$as_echo "$ac_cv_member_struct_utmp_ut_exit_e_exit" >&6; } -if test $ac_cv_member_struct_utmp_ut_exit_e_exit = yes; then + ac_fn_c_check_member "$LINENO" "struct utmp" "ut_exit.e_exit" "ac_cv_member_struct_utmp_ut_exit_e_exit" "$utmp_includes +" +if test "x$ac_cv_member_struct_utmp_ut_exit_e_exit" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_UTMP_UT_EXIT_E_EXIT 1 @@ -36359,104 +28211,9 @@ _ACEOF fi - { $as_echo "$as_me:$LINENO: checking for struct utmpx.ut_exit.ut_termination" >&5 -$as_echo_n "checking for struct utmpx.ut_exit.ut_termination... " >&6; } -if test "${ac_cv_member_struct_utmpx_ut_exit_ut_termination+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$utmp_includes - -int -main () -{ -static struct utmpx ac_aggr; -if (ac_aggr.ut_exit.ut_termination) -return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_member_struct_utmpx_ut_exit_ut_termination=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$utmp_includes - -int -main () -{ -static struct utmpx ac_aggr; -if (sizeof ac_aggr.ut_exit.ut_termination) -return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_member_struct_utmpx_ut_exit_ut_termination=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_member_struct_utmpx_ut_exit_ut_termination=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_utmpx_ut_exit_ut_termination" >&5 -$as_echo "$ac_cv_member_struct_utmpx_ut_exit_ut_termination" >&6; } -if test $ac_cv_member_struct_utmpx_ut_exit_ut_termination = yes; then + ac_fn_c_check_member "$LINENO" "struct utmpx" "ut_exit.ut_termination" "ac_cv_member_struct_utmpx_ut_exit_ut_termination" "$utmp_includes +" +if test "x$ac_cv_member_struct_utmpx_ut_exit_ut_termination" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_UTMPX_UT_EXIT_UT_TERMINATION 1 @@ -36465,104 +28222,9 @@ _ACEOF fi - { $as_echo "$as_me:$LINENO: checking for struct utmp.ut_exit.ut_termination" >&5 -$as_echo_n "checking for struct utmp.ut_exit.ut_termination... " >&6; } -if test "${ac_cv_member_struct_utmp_ut_exit_ut_termination+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$utmp_includes - -int -main () -{ -static struct utmp ac_aggr; -if (ac_aggr.ut_exit.ut_termination) -return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_member_struct_utmp_ut_exit_ut_termination=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$utmp_includes - -int -main () -{ -static struct utmp ac_aggr; -if (sizeof ac_aggr.ut_exit.ut_termination) -return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_member_struct_utmp_ut_exit_ut_termination=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_member_struct_utmp_ut_exit_ut_termination=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_utmp_ut_exit_ut_termination" >&5 -$as_echo "$ac_cv_member_struct_utmp_ut_exit_ut_termination" >&6; } -if test $ac_cv_member_struct_utmp_ut_exit_ut_termination = yes; then + ac_fn_c_check_member "$LINENO" "struct utmp" "ut_exit.ut_termination" "ac_cv_member_struct_utmp_ut_exit_ut_termination" "$utmp_includes +" +if test "x$ac_cv_member_struct_utmp_ut_exit_ut_termination" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_UTMP_UT_EXIT_UT_TERMINATION 1 @@ -36571,104 +28233,9 @@ _ACEOF fi - { $as_echo "$as_me:$LINENO: checking for struct utmpx.ut_exit.e_termination" >&5 -$as_echo_n "checking for struct utmpx.ut_exit.e_termination... " >&6; } -if test "${ac_cv_member_struct_utmpx_ut_exit_e_termination+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$utmp_includes - -int -main () -{ -static struct utmpx ac_aggr; -if (ac_aggr.ut_exit.e_termination) -return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_member_struct_utmpx_ut_exit_e_termination=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$utmp_includes - -int -main () -{ -static struct utmpx ac_aggr; -if (sizeof ac_aggr.ut_exit.e_termination) -return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_member_struct_utmpx_ut_exit_e_termination=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_member_struct_utmpx_ut_exit_e_termination=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_utmpx_ut_exit_e_termination" >&5 -$as_echo "$ac_cv_member_struct_utmpx_ut_exit_e_termination" >&6; } -if test $ac_cv_member_struct_utmpx_ut_exit_e_termination = yes; then + ac_fn_c_check_member "$LINENO" "struct utmpx" "ut_exit.e_termination" "ac_cv_member_struct_utmpx_ut_exit_e_termination" "$utmp_includes +" +if test "x$ac_cv_member_struct_utmpx_ut_exit_e_termination" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_UTMPX_UT_EXIT_E_TERMINATION 1 @@ -36677,104 +28244,9 @@ _ACEOF fi - { $as_echo "$as_me:$LINENO: checking for struct utmp.ut_exit.e_termination" >&5 -$as_echo_n "checking for struct utmp.ut_exit.e_termination... " >&6; } -if test "${ac_cv_member_struct_utmp_ut_exit_e_termination+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$utmp_includes - -int -main () -{ -static struct utmp ac_aggr; -if (ac_aggr.ut_exit.e_termination) -return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_member_struct_utmp_ut_exit_e_termination=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$utmp_includes - -int -main () -{ -static struct utmp ac_aggr; -if (sizeof ac_aggr.ut_exit.e_termination) -return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_member_struct_utmp_ut_exit_e_termination=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_member_struct_utmp_ut_exit_e_termination=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_utmp_ut_exit_e_termination" >&5 -$as_echo "$ac_cv_member_struct_utmp_ut_exit_e_termination" >&6; } -if test $ac_cv_member_struct_utmp_ut_exit_e_termination = yes; then + ac_fn_c_check_member "$LINENO" "struct utmp" "ut_exit.e_termination" "ac_cv_member_struct_utmp_ut_exit_e_termination" "$utmp_includes +" +if test "x$ac_cv_member_struct_utmp_ut_exit_e_termination" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_UTMP_UT_EXIT_E_TERMINATION 1 @@ -36785,169 +28257,27 @@ fi fi - -for ac_header in stdlib.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-coreutils@gnu.org ## -## ------------------------------------ ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - -fi -if test `eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` = yes; then + for ac_header in stdlib.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" +if test "x$ac_cv_header_stdlib_h" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define HAVE_STDLIB_H 1 _ACEOF fi done -{ $as_echo "$as_me:$LINENO: checking for GNU libc compatible realloc" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible realloc" >&5 $as_echo_n "checking for GNU libc compatible realloc... " >&6; } -if test "${ac_cv_func_realloc_0_nonnull+set}" = set; then +if test "${ac_cv_func_realloc_0_nonnull+set}" = set; then : $as_echo_n "(cached) " >&6 else - if test "$cross_compiling" = yes; then + if test "$cross_compiling" = yes; then : ac_cv_func_realloc_0_nonnull=no else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if defined STDC_HEADERS || defined HAVE_STDLIB_H # include @@ -36963,65 +28293,52 @@ return ! realloc (0, 0); return 0; } _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_realloc_0_nonnull=yes else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_func_realloc_0_nonnull=no + ac_cv_func_realloc_0_nonnull=no fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi - fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_realloc_0_nonnull" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_realloc_0_nonnull" >&5 $as_echo "$ac_cv_func_realloc_0_nonnull" >&6; } -if test $ac_cv_func_realloc_0_nonnull = yes; then +if test $ac_cv_func_realloc_0_nonnull = yes; then : -cat >>confdefs.h <<\_ACEOF -#define HAVE_REALLOC 1 -_ACEOF +$as_echo "#define HAVE_REALLOC 1" >>confdefs.h else - cat >>confdefs.h <<\_ACEOF -#define HAVE_REALLOC 0 -_ACEOF + $as_echo "#define HAVE_REALLOC 0" >>confdefs.h - gl_LIBOBJS="$gl_LIBOBJS realloc.$ac_objext" -cat >>confdefs.h <<\_ACEOF -#define realloc rpl_realloc -_ACEOF + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS realloc.$ac_objext" + + +$as_echo "#define realloc rpl_realloc" >>confdefs.h fi +$as_echo "#define GNULIB_REALLOC_GNU 1" >>confdefs.h + + + + if test $gl_cv_func_malloc_posix = yes; then + HAVE_REALLOC_POSIX=1 + +$as_echo "#define HAVE_REALLOC_POSIX 1" >>confdefs.h + + else @@ -37030,9 +28347,22 @@ fi + gl_LIBOBJS="$gl_LIBOBJS realloc.$ac_objext" + + HAVE_REALLOC_POSIX=0 + fi + + + + + GNULIB_REALLOC_POSIX=1 + + + + # Check whether --with-included-regex was given. -if test "${with_included_regex+set}" = set; then +if test "${with_included_regex+set}" = set; then : withval=$with_included_regex; fi @@ -37045,19 +28375,15 @@ fi # following run test, then default to *not* using the included regex.c. # If cross compiling, assume the test would fail and use the included # regex.c. - { $as_echo "$as_me:$LINENO: checking for working re_compile_pattern" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working re_compile_pattern" >&5 $as_echo_n "checking for working re_compile_pattern... " >&6; } -if test "${gl_cv_func_re_compile_pattern_working+set}" = set; then +if test "${gl_cv_func_re_compile_pattern_working+set}" = set; then : $as_echo_n "(cached) " >&6 else - if test "$cross_compiling" = yes; then + if test "$cross_compiling" = yes; then : gl_cv_func_re_compile_pattern_working=no else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default #if HAVE_LOCALE_H @@ -37162,6 +28488,17 @@ static struct re_pattern_buffer regex; if (re_search (®ex, "WXY", 3, 0, 3, ®s) < 0) return 1; + /* Catch a bug reported by Vin Shelton in + http://lists.gnu.org/archive/html/bug-coreutils/2007-06/msg00089.html + */ + re_set_syntax (RE_SYNTAX_POSIX_BASIC + & ~RE_CONTEXT_INVALID_DUP + & ~RE_NO_EMPTY_RANGES); + memset (®ex, 0, sizeof regex); + s = re_compile_pattern ("[[:alnum:]_-]\\\\+$", 16, ®ex); + if (s) + return 1; + /* REG_STARTEND was added to glibc on 2004-01-15. Reject older versions. */ if (! REG_STARTEND) @@ -37179,245 +28516,133 @@ static struct re_pattern_buffer regex; return 0; } _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_run "$LINENO"; then : gl_cv_func_re_compile_pattern_working=yes else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -gl_cv_func_re_compile_pattern_working=no + gl_cv_func_re_compile_pattern_working=no fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi - fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_re_compile_pattern_working" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_re_compile_pattern_working" >&5 $as_echo "$gl_cv_func_re_compile_pattern_working" >&6; } case $gl_cv_func_re_compile_pattern_working in #( yes) ac_use_included_regex=no;; #( no) ac_use_included_regex=yes;; esac ;; - *) { { $as_echo "$as_me:$LINENO: error: Invalid value for --with-included-regex: $with_included_regex" >&5 -$as_echo "$as_me: error: Invalid value for --with-included-regex: $with_included_regex" >&2;} - { (exit 1); exit 1; }; } + *) as_fn_error "Invalid value for --with-included-regex: $with_included_regex" "$LINENO" 5 ;; esac if test $ac_use_included_regex = yes; then -cat >>confdefs.h <<\_ACEOF -#define _REGEX_LARGE_OFFSETS 1 +$as_echo "#define _REGEX_LARGE_OFFSETS 1" >>confdefs.h + + +$as_echo "#define re_syntax_options rpl_re_syntax_options" >>confdefs.h + + +$as_echo "#define re_set_syntax rpl_re_set_syntax" >>confdefs.h + + +$as_echo "#define re_compile_pattern rpl_re_compile_pattern" >>confdefs.h + + +$as_echo "#define re_compile_fastmap rpl_re_compile_fastmap" >>confdefs.h + + +$as_echo "#define re_search rpl_re_search" >>confdefs.h + + +$as_echo "#define re_search_2 rpl_re_search_2" >>confdefs.h + + +$as_echo "#define re_match rpl_re_match" >>confdefs.h + + +$as_echo "#define re_match_2 rpl_re_match_2" >>confdefs.h + + +$as_echo "#define re_set_registers rpl_re_set_registers" >>confdefs.h + + +$as_echo "#define re_comp rpl_re_comp" >>confdefs.h + + +$as_echo "#define re_exec rpl_re_exec" >>confdefs.h + + +$as_echo "#define regcomp rpl_regcomp" >>confdefs.h + + +$as_echo "#define regexec rpl_regexec" >>confdefs.h + + +$as_echo "#define regerror rpl_regerror" >>confdefs.h + + +$as_echo "#define regfree rpl_regfree" >>confdefs.h + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS regex.$ac_objext" + + + + + + for ac_header in libintl.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "libintl.h" "ac_cv_header_libintl_h" "$ac_includes_default" +if test "x$ac_cv_header_libintl_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBINTL_H 1 _ACEOF - -cat >>confdefs.h <<\_ACEOF -#define re_syntax_options rpl_re_syntax_options -_ACEOF - - -cat >>confdefs.h <<\_ACEOF -#define re_set_syntax rpl_re_set_syntax -_ACEOF - - -cat >>confdefs.h <<\_ACEOF -#define re_compile_pattern rpl_re_compile_pattern -_ACEOF - - -cat >>confdefs.h <<\_ACEOF -#define re_compile_fastmap rpl_re_compile_fastmap -_ACEOF - - -cat >>confdefs.h <<\_ACEOF -#define re_search rpl_re_search -_ACEOF - - -cat >>confdefs.h <<\_ACEOF -#define re_search_2 rpl_re_search_2 -_ACEOF - - -cat >>confdefs.h <<\_ACEOF -#define re_match rpl_re_match -_ACEOF - - -cat >>confdefs.h <<\_ACEOF -#define re_match_2 rpl_re_match_2 -_ACEOF - - -cat >>confdefs.h <<\_ACEOF -#define re_set_registers rpl_re_set_registers -_ACEOF - - -cat >>confdefs.h <<\_ACEOF -#define re_comp rpl_re_comp -_ACEOF - - -cat >>confdefs.h <<\_ACEOF -#define re_exec rpl_re_exec -_ACEOF - - -cat >>confdefs.h <<\_ACEOF -#define regcomp rpl_regcomp -_ACEOF - - -cat >>confdefs.h <<\_ACEOF -#define regexec rpl_regexec -_ACEOF - - -cat >>confdefs.h <<\_ACEOF -#define regerror rpl_regerror -_ACEOF - - -cat >>confdefs.h <<\_ACEOF -#define regfree rpl_regfree -_ACEOF - - gl_LIBOBJS="$gl_LIBOBJS regex.$ac_objext" - - - - - - - - - - - - - - - - { $as_echo "$as_me:$LINENO: checking whether isblank is declared" >&5 -$as_echo_n "checking whether isblank is declared... " >&6; } -if test "${ac_cv_have_decl_isblank+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -int -main () -{ -#ifndef isblank - (void) isblank; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_isblank=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_isblank=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +done + + + ac_fn_c_check_decl "$LINENO" "isblank" "ac_cv_have_decl_isblank" "#include +" +if test "x$ac_cv_have_decl_isblank" = x""yes; then : + ac_have_decl=1 +else + ac_have_decl=0 fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_isblank" >&5 -$as_echo "$ac_cv_have_decl_isblank" >&6; } -if test $ac_cv_have_decl_isblank = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_ISBLANK 1 +#define HAVE_DECL_ISBLANK $ac_have_decl _ACEOF -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_ISBLANK 0 -_ACEOF - - -fi - - - fi - { $as_echo "$as_me:$LINENO: checking whether rename is broken" >&5 -$as_echo_n "checking whether rename is broken... " >&6; } -if test "${gl_cv_func_rename_trailing_slash_bug+set}" = set; then + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether rename is broken with a trailing slash" >&5 +$as_echo_n "checking whether rename is broken with a trailing slash... " >&6; } +if test "${gl_cv_func_rename_trailing_slash_bug+set}" = set; then : $as_echo_n "(cached) " >&6 else rm -rf conftest.d1 conftest.d2 mkdir conftest.d1 || - { { $as_echo "$as_me:$LINENO: error: cannot create temporary directory" >&5 -$as_echo "$as_me: error: cannot create temporary directory" >&2;} - { (exit 1); exit 1; }; } - if test "$cross_compiling" = yes; then + as_fn_error "cannot create temporary directory" "$LINENO" 5 + if test "$cross_compiling" = yes; then : gl_cv_func_rename_trailing_slash_bug=yes else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ # include @@ -37429,82 +28654,77 @@ cat >>conftest.$ac_ext <<_ACEOF } _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_run "$LINENO"; then : gl_cv_func_rename_trailing_slash_bug=no else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -gl_cv_func_rename_trailing_slash_bug=yes + gl_cv_func_rename_trailing_slash_bug=yes fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi - rm -rf conftest.d1 conftest.d2 fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_rename_trailing_slash_bug" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_rename_trailing_slash_bug" >&5 $as_echo "$gl_cv_func_rename_trailing_slash_bug" >&6; } - if test $gl_cv_func_rename_trailing_slash_bug = yes; then - gl_LIBOBJS="$gl_LIBOBJS rename.$ac_objext" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether rename is broken when the destination exists" >&5 +$as_echo_n "checking whether rename is broken when the destination exists... " >&6; } +if test "${gl_cv_func_rename_dest_exists_bug+set}" = set; then : + $as_echo_n "(cached) " >&6 +else -cat >>confdefs.h <<\_ACEOF -#define rename rpl_rename -_ACEOF + case "$host_os" in + mingw*) gl_cv_func_rename_dest_exists_bug=yes ;; + *) gl_cv_func_rename_dest_exists_bug=no ;; + esac + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_rename_dest_exists_bug" >&5 +$as_echo "$gl_cv_func_rename_dest_exists_bug" >&6; } + if test $gl_cv_func_rename_trailing_slash_bug = yes || + test $gl_cv_func_rename_dest_exists_bug = yes; then -cat >>confdefs.h <<\_ACEOF -#define RENAME_TRAILING_SLASH_BUG 1 -_ACEOF + + + + + + gl_LIBOBJS="$gl_LIBOBJS rename.$ac_objext" + + +$as_echo "#define rename rpl_rename" >>confdefs.h + + if test $gl_cv_func_rename_trailing_slash_bug; then + +$as_echo "#define RENAME_TRAILING_SLASH_BUG 1" >>confdefs.h + + fi + if test $gl_cv_func_rename_dest_exists_bug; then + +$as_echo "#define RENAME_DEST_EXISTS_BUG 1" >>confdefs.h + + fi : fi - { $as_echo "$as_me:$LINENO: checking whether rename is broken with respect to destination slashes" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether rename is broken with respect to destination slashes" >&5 $as_echo_n "checking whether rename is broken with respect to destination slashes... " >&6; } -if test "${gl_cv_func_rename_trailing_dest_slash_bug+set}" = set; then +if test "${gl_cv_func_rename_trailing_dest_slash_bug+set}" = set; then : $as_echo_n "(cached) " >&6 else rm -rf conftest.d1 conftest.d2 mkdir conftest.d1 || - { { $as_echo "$as_me:$LINENO: error: cannot create temporary directory" >&5 -$as_echo "$as_me: error: cannot create temporary directory" >&2;} - { (exit 1); exit 1; }; } - if test "$cross_compiling" = yes; then + as_fn_error "cannot create temporary directory" "$LINENO" 5 + if test "$cross_compiling" = yes; then : gl_cv_func_rename_trailing_dest_slash_bug=yes else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ # include @@ -37515,181 +28735,78 @@ cat >>conftest.$ac_ext <<_ACEOF } _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_run "$LINENO"; then : gl_cv_func_rename_trailing_dest_slash_bug=no else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -gl_cv_func_rename_trailing_dest_slash_bug=yes + gl_cv_func_rename_trailing_dest_slash_bug=yes fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi - rm -rf conftest.d1 conftest.d2 fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_rename_trailing_dest_slash_bug" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_rename_trailing_dest_slash_bug" >&5 $as_echo "$gl_cv_func_rename_trailing_dest_slash_bug" >&6; } if test $gl_cv_func_rename_trailing_dest_slash_bug = yes; then - gl_LIBOBJS="$gl_LIBOBJS rename-dest-slash.$ac_objext" -cat >>confdefs.h <<\_ACEOF -#define rename rpl_rename_dest_slash -_ACEOF + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS rename-dest-slash.$ac_objext" + + +$as_echo "#define rename rpl_rename_dest_slash" >>confdefs.h fi -for ac_func in rmdir -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ -#ifdef __STDC__ -# include -#else -# include -#endif -#undef $ac_func -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - eval "$as_ac_var=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if test `eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` = yes; then + for ac_func in rmdir +do : + ac_fn_c_check_func "$LINENO" "rmdir" "ac_cv_func_rmdir" +if test "x$ac_cv_func_rmdir" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define HAVE_RMDIR 1 _ACEOF else - gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" + + gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" + fi done - - - - - { $as_echo "$as_me:$LINENO: checking for rmdir-not-empty errno value" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for rmdir-not-empty errno value" >&5 $as_echo_n "checking for rmdir-not-empty errno value... " >&6; } -if test "${gl_cv_func_rmdir_errno_not_empty+set}" = set; then +if test "${gl_cv_func_rmdir_errno_not_empty+set}" = set; then : $as_echo_n "(cached) " >&6 else # Arrange for deletion of the temporary directory this test creates. ac_clean_files="$ac_clean_files confdir2" mkdir confdir2; : > confdir2/file - if test "$cross_compiling" = yes; then + if test "$cross_compiling" = yes; then : gl_cv_func_rmdir_errno_not_empty=ENOTEMPTY else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -37709,45 +28826,19 @@ cat >>conftest.$ac_ext <<_ACEOF } _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_run "$LINENO"; then : gl_cv_func_rmdir_errno_not_empty=`cat confdir2/errno` else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -gl_cv_func_rmdir_errno_not_empty='configure error in rmdir-errno.m4' + gl_cv_func_rmdir_errno_not_empty='configure error in rmdir-errno.m4' fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi - fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_rmdir_errno_not_empty" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_rmdir_errno_not_empty" >&5 $as_echo "$gl_cv_func_rmdir_errno_not_empty" >&6; } @@ -37757,115 +28848,98 @@ _ACEOF + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS root-dev-ino.$ac_objext" + : -for ac_func in rpmatch -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + + + + + + + + + + + for ac_func in rpmatch +do : + ac_fn_c_check_func "$LINENO" "rpmatch" "ac_cv_func_rpmatch" +if test "x$ac_cv_func_rpmatch" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_RPMATCH 1 +_ACEOF + +else + + gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" + +fi +done + + + if test $ac_cv_func_rpmatch = no; then + HAVE_RPMATCH=0 + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nl_langinfo and YESEXPR" >&5 +$as_echo_n "checking for nl_langinfo and YESEXPR... " >&6; } +if test "${gl_cv_langinfo_yesexpr+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - +#include int main () { -return $ac_func (); +char* cs = nl_langinfo(YESEXPR); return !cs; ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_langinfo_yesexpr=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" + gl_cv_langinfo_yesexpr=no fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if test `eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_langinfo_yesexpr" >&5 +$as_echo "$gl_cv_langinfo_yesexpr" >&6; } + if test $gl_cv_langinfo_yesexpr = yes; then -else - gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" -fi -done +$as_echo "#define HAVE_LANGINFO_YESEXPR 1" >>confdefs.h - if test $ac_cv_func_rpmatch = no; then - : fi + fi + + + + GNULIB_RPMATCH=1 + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS safe-read.$ac_objext" @@ -37874,6 +28948,15 @@ done + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS safe-write.$ac_objext" @@ -37883,6 +28966,15 @@ done + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS same.$ac_objext" @@ -37894,6 +28986,10 @@ done + + + + gl_LIBOBJS="$gl_LIBOBJS save-cwd.$ac_objext" @@ -37903,18 +28999,402 @@ done + + + + gl_LIBOBJS="$gl_LIBOBJS savedir.$ac_objext" + if test "$ac_cv_header_winsock2_h" = yes; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS select.$ac_objext" + + else + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether select supports a 0 argument" >&5 +$as_echo_n "checking whether select supports a 0 argument... " >&6; } +if test "${gl_cv_func_select_supports0+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + + case "$host_os" in + # Guess no on Interix. + interix*) gl_cv_func_select_supports0="guessing no";; + # Guess yes otherwise. + *) gl_cv_func_select_supports0="guessing yes";; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_SYS_SELECT_H +#include +#endif +int main () +{ + struct timeval timeout; + timeout.tv_sec = 0; + timeout.tv_usec = 5; + return select (0, (fd_set *)0, (fd_set *)0, (fd_set *)0, &timeout) < 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_select_supports0=yes +else + gl_cv_func_select_supports0=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_select_supports0" >&5 +$as_echo "$gl_cv_func_select_supports0" >&6; } + case "$gl_cv_func_select_supports0" in + *yes) ;; + *) + REPLACE_SELECT=1 + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS select.$ac_objext" + + ;; + esac + fi + + + + GNULIB_SELECT=1 + + # FIXME: put this in an .m4 file? + # For runcon. + for ac_header in selinux/flask.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "selinux/flask.h" "ac_cv_header_selinux_flask_h" "$ac_includes_default" +if test "x$ac_cv_header_selinux_flask_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SELINUX_FLASK_H 1 +_ACEOF + +fi + +done + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS selinux-at.$ac_objext" + + gl_save_LIBS=$LIBS + LIB_SELINUX= + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing setfilecon" >&5 +$as_echo_n "checking for library containing setfilecon... " >&6; } +if test "${ac_cv_search_setfilecon+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char setfilecon (); +int +main () +{ +return setfilecon (); + ; + return 0; +} +_ACEOF +for ac_lib in '' selinux; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_setfilecon=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if test "${ac_cv_search_setfilecon+set}" = set; then : + break +fi +done +if test "${ac_cv_search_setfilecon+set}" = set; then : + +else + ac_cv_search_setfilecon=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_setfilecon" >&5 +$as_echo "$ac_cv_search_setfilecon" >&6; } +ac_res=$ac_cv_search_setfilecon +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + test "$ac_cv_search_setfilecon" = "none required" || + LIB_SELINUX=$ac_cv_search_setfilecon +fi + + + LIBS=$gl_save_LIBS + + # Check for , + for ac_header in selinux/selinux.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "selinux/selinux.h" "ac_cv_header_selinux_selinux_h" "$ac_includes_default" +if test "x$ac_cv_header_selinux_selinux_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SELINUX_SELINUX_H 1 +_ACEOF + SELINUX_SELINUX_H= +else + SELINUX_SELINUX_H=selinux/selinux.h +fi + +done + + + + LIB_SELINUX= + gl_save_LIBS=$LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing setfilecon" >&5 +$as_echo_n "checking for library containing setfilecon... " >&6; } +if test "${ac_cv_search_setfilecon+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char setfilecon (); +int +main () +{ +return setfilecon (); + ; + return 0; +} +_ACEOF +for ac_lib in '' selinux; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_setfilecon=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if test "${ac_cv_search_setfilecon+set}" = set; then : + break +fi +done +if test "${ac_cv_search_setfilecon+set}" = set; then : + +else + ac_cv_search_setfilecon=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_setfilecon" >&5 +$as_echo "$ac_cv_search_setfilecon" >&6; } +ac_res=$ac_cv_search_setfilecon +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + test "$ac_cv_search_setfilecon" = "none required" || + LIB_SELINUX=$ac_cv_search_setfilecon +fi + + + LIBS=$gl_save_LIBS + + + # Check for , + for ac_header in selinux/context.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "selinux/context.h" "ac_cv_header_selinux_context_h" "$ac_includes_default" +if test "x$ac_cv_header_selinux_context_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SELINUX_CONTEXT_H 1 +_ACEOF + SELINUX_CONTEXT_H= +else + SELINUX_CONTEXT_H=selinux/context.h +fi + +done + + + + + + SERVENT_LIB= + gl_saved_libs="$LIBS" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing getservbyname" >&5 +$as_echo_n "checking for library containing getservbyname... " >&6; } +if test "${ac_cv_search_getservbyname+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char getservbyname (); +int +main () +{ +return getservbyname (); + ; + return 0; +} +_ACEOF +for ac_lib in '' socket network net; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_getservbyname=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if test "${ac_cv_search_getservbyname+set}" = set; then : + break +fi +done +if test "${ac_cv_search_getservbyname+set}" = set; then : + +else + ac_cv_search_getservbyname=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_getservbyname" >&5 +$as_echo "$ac_cv_search_getservbyname" >&6; } +ac_res=$ac_cv_search_getservbyname +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + if test "$ac_cv_search_getservbyname" != "none required"; then + SERVENT_LIB="$ac_cv_search_getservbyname" + fi +fi + + LIBS="$gl_saved_libs" + if test -z "$SERVENT_LIB"; then + for ac_func in getservbyname +do : + ac_fn_c_check_func "$LINENO" "getservbyname" "ac_cv_func_getservbyname" +if test "x$ac_cv_func_getservbyname" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_GETSERVBYNAME 1 +_ACEOF + +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getservbyname in winsock2.h and -lws2_32" >&5 +$as_echo_n "checking for getservbyname in winsock2.h and -lws2_32... " >&6; } +if test "${gl_cv_w32_getservbyname+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + gl_cv_w32_getservbyname=no + gl_save_LIBS="$LIBS" + LIBS="$LIBS -lws2_32" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifdef HAVE_WINSOCK2_H +#include +#endif +#include + +int +main () +{ +getservbyname(NULL,NULL); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_w32_getservbyname=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$gl_save_LIBS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_w32_getservbyname" >&5 +$as_echo "$gl_cv_w32_getservbyname" >&6; } + if test "$gl_cv_w32_getservbyname" = "yes"; then + SERVENT_LIB="-lws2_32" + fi + +fi +done + + fi + if test $ac_cv_func_setenv = no; then - gl_LIBOBJS="$gl_LIBOBJS setenv.$ac_objext" + HAVE_SETENV=0 @@ -37923,419 +29403,41 @@ done + gl_LIBOBJS="$gl_LIBOBJS setenv.$ac_objext" -for ac_header in search.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_compiler=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-coreutils@gnu.org ## -## ------------------------------------ ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - -fi -if test `eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` = yes; then + for ac_header in search.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "search.h" "ac_cv_header_search_h" "$ac_includes_default" +if test "x$ac_cv_header_search_h" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define HAVE_SEARCH_H 1 _ACEOF fi done - -for ac_func in tsearch -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if test `eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` = yes; then + for ac_func in tsearch +do : + ac_fn_c_check_func "$LINENO" "tsearch" "ac_cv_func_tsearch" +if test "x$ac_cv_func_tsearch" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define HAVE_TSEARCH 1 _ACEOF fi done - - { $as_echo "$as_me:$LINENO: checking if environ is properly declared" >&5 -$as_echo_n "checking if environ is properly declared... " >&6; } - if test "${gt_cv_var_environ_declaration+set}" = set; then - $as_echo_n "(cached) " >&6 -else - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - extern struct { int foo; } environ; -int -main () -{ -environ.foo = 1; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - gt_cv_var_environ_declaration=no -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - gt_cv_var_environ_declaration=yes -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - - { $as_echo "$as_me:$LINENO: result: $gt_cv_var_environ_declaration" >&5 -$as_echo "$gt_cv_var_environ_declaration" >&6; } - if test $gt_cv_var_environ_declaration = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_ENVIRON_DECL 1 -_ACEOF - - fi - - fi -for ac_func in unsetenv -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if test `eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - - if test $ac_cv_func_unsetenv = no; then - gl_LIBOBJS="$gl_LIBOBJS unsetenv.$ac_objext" + GNULIB_SETENV=1 @@ -38345,138 +29447,6 @@ done - { $as_echo "$as_me:$LINENO: checking if environ is properly declared" >&5 -$as_echo_n "checking if environ is properly declared... " >&6; } - if test "${gt_cv_var_environ_declaration+set}" = set; then - $as_echo_n "(cached) " >&6 -else - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - extern struct { int foo; } environ; -int -main () -{ -environ.foo = 1; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - gt_cv_var_environ_declaration=no -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - gt_cv_var_environ_declaration=yes -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - - { $as_echo "$as_me:$LINENO: result: $gt_cv_var_environ_declaration" >&5 -$as_echo "$gt_cv_var_environ_declaration" >&6; } - if test $gt_cv_var_environ_declaration = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_ENVIRON_DECL 1 -_ACEOF - - fi - - - else - { $as_echo "$as_me:$LINENO: checking for unsetenv() return type" >&5 -$as_echo_n "checking for unsetenv() return type... " >&6; } -if test "${gt_cv_func_unsetenv_ret+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -extern -#ifdef __cplusplus -"C" -#endif -#if defined(__STDC__) || defined(__cplusplus) -int unsetenv (const char *name); -#else -int unsetenv(); -#endif - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - gt_cv_func_unsetenv_ret='int' -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - gt_cv_func_unsetenv_ret='void' -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $gt_cv_func_unsetenv_ret" >&5 -$as_echo "$gt_cv_func_unsetenv_ret" >&6; } - if test $gt_cv_func_unsetenv_ret = 'void'; then - -cat >>confdefs.h <<\_ACEOF -#define VOID_UNSETENV 1 -_ACEOF - - fi - fi - gl_LIBOBJS="$gl_LIBOBJS settime.$ac_objext" @@ -38492,112 +29462,25 @@ _ACEOF - gl_LIBOBJS="$gl_LIBOBJS sha1.$ac_objext" - - - : - -for ac_func in sig2str -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if test `eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` = yes; then + for ac_func in sig2str +do : + ac_fn_c_check_func "$LINENO" "sig2str" "ac_cv_func_sig2str" +if test "x$ac_cv_func_sig2str" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define HAVE_SIG2STR 1 _ACEOF else - gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" + + gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" + fi done + if test $ac_cv_func_sig2str = no; then : @@ -38607,106 +29490,1058 @@ done -for ac_func in snprintf -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + if test $ac_cv_func_sigaction = yes; then + ac_fn_c_check_member "$LINENO" "struct sigaction" "sa_sigaction" "ac_cv_member_struct_sigaction_sa_sigaction" "#include +" +if test "x$ac_cv_member_struct_sigaction_sa_sigaction" = x""yes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_SIGACTION_SA_SIGACTION 1 +_ACEOF + + +fi + + if test $ac_cv_member_struct_sigaction_sa_sigaction = no; then + HAVE_STRUCT_SIGACTION_SA_SIGACTION=0 + fi + else + HAVE_SIGACTION=0 + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS sigaction.$ac_objext" + + + + + + + + ac_fn_c_check_type "$LINENO" "siginfo_t" "ac_cv_type_siginfo_t" " +#include + +" +if test "x$ac_cv_type_siginfo_t" = x""yes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_SIGINFO_T 1 +_ACEOF + + +fi + + if test $ac_cv_type_siginfo_t = no; then + HAVE_SIGINFO_T=0 + fi + + fi + + + + GNULIB_SIGACTION=1 + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_signal_h='<'signal.h'>' + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +$as_echo_n "checking absolute name of ... " >&6; } +if test "${gl_cv_next_signal_h+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + + if test $ac_cv_header_signal_h = yes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func +#include -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + gl_cv_next_signal_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n '\#/signal.h#{ + s#.*"\(.*/signal.h\)".*#\1# + s#^/[^/]#//&# + p + q + }'`'"' + else + gl_cv_next_signal_h='<'signal.h'>' + fi -#ifdef __STDC__ -# include +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_signal_h" >&5 +$as_echo "$gl_cv_next_signal_h" >&6; } + fi + NEXT_SIGNAL_H=$gl_cv_next_signal_h + + + +# AIX declares sig_atomic_t to already include volatile, and C89 compilers +# then choke on 'volatile sig_atomic_t'. C99 requires that it compile. + ac_fn_c_check_type "$LINENO" "volatile sig_atomic_t" "ac_cv_type_volatile_sig_atomic_t" " +#include + +" +if test "x$ac_cv_type_volatile_sig_atomic_t" = x""yes; then : + +else + HAVE_TYPE_VOLATILE_SIG_ATOMIC_T=0 +fi + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for signbit macro" >&5 +$as_echo_n "checking for signbit macro... " >&6; } +if test "${gl_cv_func_signbit+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + gl_cv_func_signbit="guessing no" +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +/* If signbit is defined as a function, don't use it, since calling it for + 'float' or 'long double' arguments would involve conversions. + If signbit is not declared at all but exists as a library function, don't + use it, since the prototype may not match. + If signbit is not declared at all but exists as a compiler built-in, don't + use it, since it's preferable to use __builtin_signbit* (no warnings, + no conversions). */ +#ifndef signbit +# error "signbit should be a macro" +#endif +#include + +/* Global variables. + Needed because GCC 4 constant-folds __builtin_signbitl (literal) + but cannot constant-fold __builtin_signbitl (variable). */ +float vf; +double vd; +long double vl; +int main () +{ +/* HP cc on HP-UX 10.20 has a bug with the constant expression -0.0. + So we use -p0f and -p0d instead. */ +float p0f = 0.0f; +float m0f = -p0f; +double p0d = 0.0; +double m0d = -p0d; +/* On HP-UX 10.20, negating 0.0L does not yield -0.0L. + So we use another constant expression instead. + But that expression does not work on other platforms, such as when + cross-compiling to PowerPC on MacOS X 10.5. */ +long double p0l = 0.0L; +#if defined __hpux || defined __sgi +long double m0l = -LDBL_MIN * LDBL_MIN; #else -# include +long double m0l = -p0l; #endif + if (signbit (vf)) + vf++; + { + float plus_inf = 1.0f / p0f; + float minus_inf = -1.0f / p0f; + if (!(!signbit (255.0f) + && signbit (-255.0f) + && !signbit (p0f) + && (memcmp (&m0f, &p0f, sizeof (float)) == 0 || signbit (m0f)) + && !signbit (plus_inf) + && signbit (minus_inf))) + return 1; + } + if (signbit (vd)) + vd++; + { + double plus_inf = 1.0 / p0d; + double minus_inf = -1.0 / p0d; + if (!(!signbit (255.0) + && signbit (-255.0) + && !signbit (p0d) + && (memcmp (&m0d, &p0d, sizeof (double)) == 0 || signbit (m0d)) + && !signbit (plus_inf) + && signbit (minus_inf))) + return 1; + } + if (signbit (vl)) + vl++; + { + long double plus_inf = 1.0L / p0l; + long double minus_inf = -1.0L / p0l; + if (!(!signbit (255.0L) + && signbit (-255.0L) + && !signbit (p0l) + && (memcmp (&m0l, &p0l, sizeof (long double)) == 0 || signbit (m0l)) + && !signbit (plus_inf) + && signbit (minus_inf))) + return 1; + } + return 0; +} -#undef $ac_func -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_signbit=yes +else + gl_cv_func_signbit=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_signbit" >&5 +$as_echo "$gl_cv_func_signbit" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for signbit compiler built-ins" >&5 +$as_echo_n "checking for signbit compiler built-ins... " >&6; } +if test "${gl_cv_func_signbit_gcc+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + gl_cv_func_signbit_gcc="guessing no" +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#if __GNUC__ >= 4 +# define signbit(x) \ + (sizeof (x) == sizeof (long double) ? __builtin_signbitl (x) : \ + sizeof (x) == sizeof (double) ? __builtin_signbit (x) : \ + __builtin_signbitf (x)) +#else +# error "signbit should be three compiler built-ins" #endif +#include +/* Global variables. + Needed because GCC 4 constant-folds __builtin_signbitl (literal) + but cannot constant-fold __builtin_signbitl (variable). */ +float vf; +double vd; +long double vl; +int main () +{ +/* HP cc on HP-UX 10.20 has a bug with the constant expression -0.0. + So we use -p0f and -p0d instead. */ +float p0f = 0.0f; +float m0f = -p0f; +double p0d = 0.0; +double m0d = -p0d; +/* On HP-UX 10.20, negating 0.0L does not yield -0.0L. + So we use another constant expression instead. + But that expression does not work on other platforms, such as when + cross-compiling to PowerPC on MacOS X 10.5. */ +long double p0l = 0.0L; +#if defined __hpux || defined __sgi +long double m0l = -LDBL_MIN * LDBL_MIN; +#else +long double m0l = -p0l; +#endif + if (signbit (vf)) + vf++; + { + float plus_inf = 1.0f / p0f; + float minus_inf = -1.0f / p0f; + if (!(!signbit (255.0f) + && signbit (-255.0f) + && !signbit (p0f) + && (memcmp (&m0f, &p0f, sizeof (float)) == 0 || signbit (m0f)) + && !signbit (plus_inf) + && signbit (minus_inf))) + return 1; + } + if (signbit (vd)) + vd++; + { + double plus_inf = 1.0 / p0d; + double minus_inf = -1.0 / p0d; + if (!(!signbit (255.0) + && signbit (-255.0) + && !signbit (p0d) + && (memcmp (&m0d, &p0d, sizeof (double)) == 0 || signbit (m0d)) + && !signbit (plus_inf) + && signbit (minus_inf))) + return 1; + } + if (signbit (vl)) + vl++; + { + long double plus_inf = 1.0L / p0l; + long double minus_inf = -1.0L / p0l; + if (!(!signbit (255.0L) + && signbit (-255.0L) + && !signbit (p0l) + && (memcmp (&m0l, &p0l, sizeof (long double)) == 0 || signbit (m0l)) + && !signbit (plus_inf) + && signbit (minus_inf))) + return 1; + } + return 0; +} + + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_signbit_gcc=yes +else + gl_cv_func_signbit_gcc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_signbit_gcc" >&5 +$as_echo "$gl_cv_func_signbit_gcc" >&6; } + if test "$gl_cv_func_signbit_gcc" = yes; then + REPLACE_SIGNBIT_USING_GCC=1 + else + if test "$gl_cv_func_signbit" != yes; then + REPLACE_SIGNBIT=1 + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS signbitf.$ac_objext" + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS signbitd.$ac_objext" + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS signbitl.$ac_objext" + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the sign bit in a 'float'" >&5 +$as_echo_n "checking where to find the sign bit in a 'float'... " >&6; } +if test "${gl_cv_cc_float_signbit+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + + gl_cv_cc_float_signbit="unknown" + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#define NWORDS \ + ((sizeof (float) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) +typedef union { float value; unsigned int word[NWORDS]; } + memory_float; +static memory_float plus = { 1.0f }; +static memory_float minus = { -1.0f }; +int main () +{ + size_t j, k, i; + unsigned int m; + FILE *fp = fopen ("conftest.out", "w"); + if (fp == NULL) + return 1; + /* Find the different bit. */ + k = 0; m = 0; + for (j = 0; j < NWORDS; j++) + { + unsigned int x = plus.word[j] ^ minus.word[j]; + if ((x & (x - 1)) || (x && m)) + { + /* More than one bit difference. */ + fprintf (fp, "unknown"); + return 1; + } + if (x) + { + k = j; + m = x; + } + } + if (m == 0) + { + /* No difference. */ + fprintf (fp, "unknown"); + return 1; + } + /* Now m = plus.word[k] ^ ~minus.word[k]. */ + if (plus.word[k] & ~minus.word[k]) + { + /* Oh? The sign bit is set in the positive and cleared in the negative + numbers? */ + fprintf (fp, "unknown"); + return 1; + } + for (i = 0; ; i++) + if ((m >> i) & 1) + break; + fprintf (fp, "word %d bit %d", (int) k, (int) i); + return (fclose (fp) != 0); +} + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_cc_float_signbit=`cat conftest.out` +else + gl_cv_cc_float_signbit="unknown" +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi + + rm -f conftest.out + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_float_signbit" >&5 +$as_echo "$gl_cv_cc_float_signbit" >&6; } + case "$gl_cv_cc_float_signbit" in + word*bit*) + word=`echo "$gl_cv_cc_float_signbit" | sed -e 's/word //' -e 's/ bit.*//'` + bit=`echo "$gl_cv_cc_float_signbit" | sed -e 's/word.*bit //'` + +cat >>confdefs.h <<_ACEOF +#define FLT_SIGNBIT_WORD $word +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define FLT_SIGNBIT_BIT $bit +_ACEOF + + ;; + esac + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the sign bit in a 'double'" >&5 +$as_echo_n "checking where to find the sign bit in a 'double'... " >&6; } +if test "${gl_cv_cc_double_signbit+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + + gl_cv_cc_double_signbit="unknown" + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#define NWORDS \ + ((sizeof (double) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) +typedef union { double value; unsigned int word[NWORDS]; } + memory_float; +static memory_float plus = { 1.0 }; +static memory_float minus = { -1.0 }; +int main () +{ + size_t j, k, i; + unsigned int m; + FILE *fp = fopen ("conftest.out", "w"); + if (fp == NULL) + return 1; + /* Find the different bit. */ + k = 0; m = 0; + for (j = 0; j < NWORDS; j++) + { + unsigned int x = plus.word[j] ^ minus.word[j]; + if ((x & (x - 1)) || (x && m)) + { + /* More than one bit difference. */ + fprintf (fp, "unknown"); + return 1; + } + if (x) + { + k = j; + m = x; + } + } + if (m == 0) + { + /* No difference. */ + fprintf (fp, "unknown"); + return 1; + } + /* Now m = plus.word[k] ^ ~minus.word[k]. */ + if (plus.word[k] & ~minus.word[k]) + { + /* Oh? The sign bit is set in the positive and cleared in the negative + numbers? */ + fprintf (fp, "unknown"); + return 1; + } + for (i = 0; ; i++) + if ((m >> i) & 1) + break; + fprintf (fp, "word %d bit %d", (int) k, (int) i); + return (fclose (fp) != 0); +} + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_cc_double_signbit=`cat conftest.out` +else + gl_cv_cc_double_signbit="unknown" +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi + + rm -f conftest.out + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_double_signbit" >&5 +$as_echo "$gl_cv_cc_double_signbit" >&6; } + case "$gl_cv_cc_double_signbit" in + word*bit*) + word=`echo "$gl_cv_cc_double_signbit" | sed -e 's/word //' -e 's/ bit.*//'` + bit=`echo "$gl_cv_cc_double_signbit" | sed -e 's/word.*bit //'` + +cat >>confdefs.h <<_ACEOF +#define DBL_SIGNBIT_WORD $word +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define DBL_SIGNBIT_BIT $bit +_ACEOF + + ;; + esac + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the sign bit in a 'long double'" >&5 +$as_echo_n "checking where to find the sign bit in a 'long double'... " >&6; } +if test "${gl_cv_cc_long_double_signbit+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + + gl_cv_cc_long_double_signbit="unknown" + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#define NWORDS \ + ((sizeof (long double) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) +typedef union { long double value; unsigned int word[NWORDS]; } + memory_float; +static memory_float plus = { 1.0L }; +static memory_float minus = { -1.0L }; +int main () +{ + size_t j, k, i; + unsigned int m; + FILE *fp = fopen ("conftest.out", "w"); + if (fp == NULL) + return 1; + /* Find the different bit. */ + k = 0; m = 0; + for (j = 0; j < NWORDS; j++) + { + unsigned int x = plus.word[j] ^ minus.word[j]; + if ((x & (x - 1)) || (x && m)) + { + /* More than one bit difference. */ + fprintf (fp, "unknown"); + return 1; + } + if (x) + { + k = j; + m = x; + } + } + if (m == 0) + { + /* No difference. */ + fprintf (fp, "unknown"); + return 1; + } + /* Now m = plus.word[k] ^ ~minus.word[k]. */ + if (plus.word[k] & ~minus.word[k]) + { + /* Oh? The sign bit is set in the positive and cleared in the negative + numbers? */ + fprintf (fp, "unknown"); + return 1; + } + for (i = 0; ; i++) + if ((m >> i) & 1) + break; + fprintf (fp, "word %d bit %d", (int) k, (int) i); + return (fclose (fp) != 0); +} + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_cc_long_double_signbit=`cat conftest.out` +else + gl_cv_cc_long_double_signbit="unknown" +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi + + rm -f conftest.out + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_long_double_signbit" >&5 +$as_echo "$gl_cv_cc_long_double_signbit" >&6; } + case "$gl_cv_cc_long_double_signbit" in + word*bit*) + word=`echo "$gl_cv_cc_long_double_signbit" | sed -e 's/word //' -e 's/ bit.*//'` + bit=`echo "$gl_cv_cc_long_double_signbit" | sed -e 's/word.*bit //'` + +cat >>confdefs.h <<_ACEOF +#define LDBL_SIGNBIT_WORD $word +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define LDBL_SIGNBIT_BIT $bit +_ACEOF + + ;; + esac + + + if test "$gl_cv_cc_float_signbit" = unknown; then + ac_fn_c_check_decl "$LINENO" "copysignf" "ac_cv_have_decl_copysignf" "#include +" +if test "x$ac_cv_have_decl_copysignf" = x""yes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_COPYSIGNF $ac_have_decl +_ACEOF + + if test "$ac_cv_have_decl_copysignf" = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether copysignf can be used without linking with libm" >&5 +$as_echo_n "checking whether copysignf can be used without linking with libm... " >&6; } +if test "${gl_cv_func_copysignf_no_libm+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + float x, y; int main () { -return $ac_func (); +return copysignf (x, y) < 0; ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_func_copysignf_no_libm=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + gl_cv_func_copysignf_no_libm=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext - eval "$as_ac_var=no" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_copysignf_no_libm" >&5 +$as_echo "$gl_cv_func_copysignf_no_libm" >&6; } + if test $gl_cv_func_copysignf_no_libm = yes; then + +$as_echo "#define HAVE_COPYSIGNF_IN_LIBC 1" >>confdefs.h + + fi + fi + fi + if test "$gl_cv_cc_double_signbit" = unknown; then + ac_fn_c_check_decl "$LINENO" "copysign" "ac_cv_have_decl_copysign" "#include +" +if test "x$ac_cv_have_decl_copysign" = x""yes; then : + ac_have_decl=1 +else + ac_have_decl=0 fi -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_COPYSIGN $ac_have_decl +_ACEOF + + if test "$ac_cv_have_decl_copysign" = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether copysign can be used without linking with libm" >&5 +$as_echo_n "checking whether copysign can be used without linking with libm... " >&6; } +if test "${gl_cv_func_copysign_no_libm+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + double x, y; +int +main () +{ +return copysign (x, y) < 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_func_copysign_no_libm=yes +else + gl_cv_func_copysign_no_libm=no fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if test `eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` = yes; then +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_copysign_no_libm" >&5 +$as_echo "$gl_cv_func_copysign_no_libm" >&6; } + if test $gl_cv_func_copysign_no_libm = yes; then + +$as_echo "#define HAVE_COPYSIGN_IN_LIBC 1" >>confdefs.h + + fi + fi + fi + if test "$gl_cv_cc_long_double_signbit" = unknown; then + ac_fn_c_check_decl "$LINENO" "copysignl" "ac_cv_have_decl_copysignl" "#include +" +if test "x$ac_cv_have_decl_copysignl" = x""yes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_COPYSIGNL $ac_have_decl +_ACEOF + + if test "$ac_cv_have_decl_copysignl" = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether copysignl can be used without linking with libm" >&5 +$as_echo_n "checking whether copysignl can be used without linking with libm... " >&6; } +if test "${gl_cv_func_copysignl_no_libm+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + long double x, y; +int +main () +{ +return copysignl (x, y) < 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_func_copysignl_no_libm=yes +else + gl_cv_func_copysignl_no_libm=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_copysignl_no_libm" >&5 +$as_echo "$gl_cv_func_copysignl_no_libm" >&6; } + if test $gl_cv_func_copysignl_no_libm = yes; then + +$as_echo "#define HAVE_COPYSIGNL_IN_LIBC 1" >>confdefs.h + + fi + fi + fi + fi + fi + + + + GNULIB_SIGNBIT=1 + + + + signals_not_posix= + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "sigset_t" >/dev/null 2>&1; then : + +else + signals_not_posix=1 +fi +rm -f conftest* + + if test -z "$signals_not_posix"; then + ac_fn_c_check_func "$LINENO" "sigprocmask" "ac_cv_func_sigprocmask" +if test "x$ac_cv_func_sigprocmask" = x""yes; then : + gl_cv_func_sigprocmask=1 +fi + + fi + if test -z "$gl_cv_func_sigprocmask"; then + HAVE_POSIX_SIGNALBLOCKING=0 + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS sigprocmask.$ac_objext" + + + + ac_fn_c_check_type "$LINENO" "sigset_t" "ac_cv_type_sigset_t" "#include +/* Mingw defines sigset_t not in , but in . */ +#include +" +if test "x$ac_cv_type_sigset_t" = x""yes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_SIGSET_T 1 +_ACEOF + +gl_cv_type_sigset_t=yes +else + gl_cv_type_sigset_t=no +fi + + if test $gl_cv_type_sigset_t != yes; then + HAVE_SIGSET_T=0 + fi + + + fi + + + + GNULIB_SIGPROCMASK=1 + + + for ac_header in stdint.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "stdint.h" "ac_cv_header_stdint_h" "$ac_includes_default" +if test "x$ac_cv_header_stdint_h" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define HAVE_STDINT_H 1 +_ACEOF + +fi + +done + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SIZE_MAX" >&5 +$as_echo_n "checking for SIZE_MAX... " >&6; } + if test "${gl_cv_size_max+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + gl_cv_size_max= + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#if HAVE_STDINT_H +#include +#endif +#ifdef SIZE_MAX +Found it +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "Found it" >/dev/null 2>&1; then : + gl_cv_size_max=yes +fi +rm -f conftest* + + if test -z "$gl_cv_size_max"; then + if ac_fn_c_compute_int "$LINENO" "sizeof (size_t) * CHAR_BIT - 1" "size_t_bits_minus_1" "#include +#include "; then : + +else + size_t_bits_minus_1= +fi + + if ac_fn_c_compute_int "$LINENO" "sizeof (size_t) <= sizeof (unsigned int)" "fits_in_uint" "#include "; then : + +else + fits_in_uint= +fi + + if test -n "$size_t_bits_minus_1" && test -n "$fits_in_uint"; then + if test $fits_in_uint = 1; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + extern size_t foo; + extern unsigned long foo; + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + fits_in_uint=0 +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $fits_in_uint = 1; then + gl_cv_size_max="(((1U << $size_t_bits_minus_1) - 1) * 2 + 1)" + else + gl_cv_size_max="(((1UL << $size_t_bits_minus_1) - 1) * 2 + 1)" + fi + else + gl_cv_size_max='((size_t)~(size_t)0)' + fi + fi + +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_size_max" >&5 +$as_echo "$gl_cv_size_max" >&6; } + if test "$gl_cv_size_max" != yes; then + +cat >>confdefs.h <<_ACEOF +#define SIZE_MAX $gl_cv_size_max +_ACEOF + + fi + + + + gl_cv_func_snprintf_usable=no + for ac_func in snprintf +do : + ac_fn_c_check_func "$LINENO" "snprintf" "ac_cv_func_snprintf" +if test "x$ac_cv_func_snprintf" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SNPRINTF 1 _ACEOF fi done - if test $ac_cv_func_snprintf = no; then + if test $ac_cv_func_snprintf = yes; then + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether snprintf respects a size of 1" >&5 +$as_echo_n "checking whether snprintf respects a size of 1... " >&6; } +if test "${gl_cv_func_snprintf_size1+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + gl_cv_func_snprintf_size1="guessing yes" +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +int main() +{ + static char buf[8] = { 'D', 'E', 'A', 'D', 'B', 'E', 'E', 'F' }; + snprintf (buf, 1, "%d", 12345); + return buf[1] != 'E'; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_snprintf_size1=yes +else + gl_cv_func_snprintf_size1=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_snprintf_size1" >&5 +$as_echo "$gl_cv_func_snprintf_size1" >&6; } + + case "$gl_cv_func_snprintf_size1" in + *yes) + gl_cv_func_snprintf_usable=yes + ;; + esac + fi + if test $gl_cv_func_snprintf_usable = no; then + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS snprintf.$ac_objext" + if test $ac_cv_func_snprintf = yes; then REPLACE_SNPRINTF=1 fi @@ -38714,9 +30549,6 @@ done fi - - - if test $ac_cv_have_decl_snprintf = no; then HAVE_DECL_SNPRINTF=0 fi @@ -38725,72 +30557,19 @@ done GNULIB_SNPRINTF=1 - { $as_echo "$as_me:$LINENO: checking for socklen_t" >&5 -$as_echo_n "checking for socklen_t... " >&6; } -if test "${ac_cv_type_socklen_t+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include + ac_fn_c_check_type "$LINENO" "socklen_t" "ac_cv_type_socklen_t" "#include #if HAVE_SYS_SOCKET_H # include #elif HAVE_WS2TCPIP_H # include #endif +" +if test "x$ac_cv_type_socklen_t" = x""yes; then : -typedef socklen_t ac__type_new_; -int -main () -{ -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type_socklen_t=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_socklen_t=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_socklen_t" >&5 -$as_echo "$ac_cv_type_socklen_t" >&6; } -if test $ac_cv_type_socklen_t = yes; then - : -else - { $as_echo "$as_me:$LINENO: checking for socklen_t equivalent" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for socklen_t equivalent" >&5 $as_echo_n "checking for socklen_t equivalent... " >&6; } - if test "${gl_cv_socklen_t_equiv+set}" = set; then + if test "${gl_cv_socklen_t_equiv+set}" = set; then : $as_echo_n "(cached) " >&6 else # Systems have either "struct sockaddr *" or @@ -38798,11 +30577,7 @@ else gl_cv_socklen_t_equiv= for arg2 in "struct sockaddr" void; do for t in int size_t "unsigned int" "long int" "unsigned long int"; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include @@ -38817,32 +30592,9 @@ $t len; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : gl_cv_socklen_t_equiv="$t" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext test "$gl_cv_socklen_t_equiv" != "" && break done @@ -38852,11 +30604,9 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "$gl_cv_socklen_t_equiv" = ""; then - { { $as_echo "$as_me:$LINENO: error: Cannot find a type to use in place of socklen_t" >&5 -$as_echo "$as_me: error: Cannot find a type to use in place of socklen_t" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "Cannot find a type to use in place of socklen_t" "$LINENO" 5 fi - { $as_echo "$as_me:$LINENO: result: $gl_cv_socklen_t_equiv" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_socklen_t_equiv" >&5 $as_echo "$gl_cv_socklen_t_equiv" >&6; } cat >>confdefs.h <<_ACEOF @@ -38866,16 +30616,12 @@ _ACEOF fi - { $as_echo "$as_me:$LINENO: checking for ssize_t" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ssize_t" >&5 $as_echo_n "checking for ssize_t... " >&6; } -if test "${gt_cv_ssize_t+set}" = set; then +if test "${gt_cv_ssize_t+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int @@ -38887,41 +30633,18 @@ int x = sizeof (ssize_t *) + sizeof (ssize_t); return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : gt_cv_ssize_t=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - gt_cv_ssize_t=no + gt_cv_ssize_t=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $gt_cv_ssize_t" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_ssize_t" >&5 $as_echo "$gt_cv_ssize_t" >&6; } if test $gt_cv_ssize_t = no; then -cat >>confdefs.h <<\_ACEOF -#define ssize_t int -_ACEOF +$as_echo "#define ssize_t int" >>confdefs.h fi @@ -38930,126 +30653,21 @@ _ACEOF - - - - - - { $as_echo "$as_me:$LINENO: checking for struct stat.st_atim.tv_nsec" >&5 -$as_echo_n "checking for struct stat.st_atim.tv_nsec... " >&6; } -if test "${ac_cv_member_struct_stat_st_atim_tv_nsec+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include + ac_fn_c_check_member "$LINENO" "struct stat" "st_atim.tv_nsec" "ac_cv_member_struct_stat_st_atim_tv_nsec" "#include #include - -int -main () -{ -static struct stat ac_aggr; -if (ac_aggr.st_atim.tv_nsec) -return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_member_struct_stat_st_atim_tv_nsec=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - #include - -int -main () -{ -static struct stat ac_aggr; -if (sizeof ac_aggr.st_atim.tv_nsec) -return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_member_struct_stat_st_atim_tv_nsec=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_member_struct_stat_st_atim_tv_nsec=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_atim_tv_nsec" >&5 -$as_echo "$ac_cv_member_struct_stat_st_atim_tv_nsec" >&6; } -if test $ac_cv_member_struct_stat_st_atim_tv_nsec = yes; then +" +if test "x$ac_cv_member_struct_stat_st_atim_tv_nsec" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC 1 _ACEOF -{ $as_echo "$as_me:$LINENO: checking whether struct stat.st_atim is of type struct timespec" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct stat.st_atim is of type struct timespec" >&5 $as_echo_n "checking whether struct stat.st_atim is of type struct timespec... " >&6; } -if test "${ac_cv_typeof_struct_stat_st_atim_is_struct_timespec+set}" = set; then +if test "${ac_cv_typeof_struct_stat_st_atim_is_struct_timespec+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -39071,144 +30689,25 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_typeof_struct_stat_st_atim_is_struct_timespec=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_typeof_struct_stat_st_atim_is_struct_timespec=no + ac_cv_typeof_struct_stat_st_atim_is_struct_timespec=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_typeof_struct_stat_st_atim_is_struct_timespec" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_typeof_struct_stat_st_atim_is_struct_timespec" >&5 $as_echo "$ac_cv_typeof_struct_stat_st_atim_is_struct_timespec" >&6; } if test $ac_cv_typeof_struct_stat_st_atim_is_struct_timespec = yes; then -cat >>confdefs.h <<\_ACEOF -#define TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC 1 -_ACEOF +$as_echo "#define TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC 1" >>confdefs.h fi else - { $as_echo "$as_me:$LINENO: checking for struct stat.st_atimespec.tv_nsec" >&5 -$as_echo_n "checking for struct stat.st_atimespec.tv_nsec... " >&6; } -if test "${ac_cv_member_struct_stat_st_atimespec_tv_nsec+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include + ac_fn_c_check_member "$LINENO" "struct stat" "st_atimespec.tv_nsec" "ac_cv_member_struct_stat_st_atimespec_tv_nsec" "#include #include - -int -main () -{ -static struct stat ac_aggr; -if (ac_aggr.st_atimespec.tv_nsec) -return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_member_struct_stat_st_atimespec_tv_nsec=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - #include - -int -main () -{ -static struct stat ac_aggr; -if (sizeof ac_aggr.st_atimespec.tv_nsec) -return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_member_struct_stat_st_atimespec_tv_nsec=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_member_struct_stat_st_atimespec_tv_nsec=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_atimespec_tv_nsec" >&5 -$as_echo "$ac_cv_member_struct_stat_st_atimespec_tv_nsec" >&6; } -if test $ac_cv_member_struct_stat_st_atimespec_tv_nsec = yes; then +" +if test "x$ac_cv_member_struct_stat_st_atimespec_tv_nsec" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_STAT_ST_ATIMESPEC_TV_NSEC 1 @@ -39216,106 +30715,10 @@ _ACEOF else - { $as_echo "$as_me:$LINENO: checking for struct stat.st_atimensec" >&5 -$as_echo_n "checking for struct stat.st_atimensec... " >&6; } -if test "${ac_cv_member_struct_stat_st_atimensec+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include + ac_fn_c_check_member "$LINENO" "struct stat" "st_atimensec" "ac_cv_member_struct_stat_st_atimensec" "#include #include - -int -main () -{ -static struct stat ac_aggr; -if (ac_aggr.st_atimensec) -return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_member_struct_stat_st_atimensec=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - #include - -int -main () -{ -static struct stat ac_aggr; -if (sizeof ac_aggr.st_atimensec) -return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_member_struct_stat_st_atimensec=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_member_struct_stat_st_atimensec=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_atimensec" >&5 -$as_echo "$ac_cv_member_struct_stat_st_atimensec" >&6; } -if test $ac_cv_member_struct_stat_st_atimensec = yes; then +" +if test "x$ac_cv_member_struct_stat_st_atimensec" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_STAT_ST_ATIMENSEC 1 @@ -39323,216 +30726,58 @@ _ACEOF else - { $as_echo "$as_me:$LINENO: checking for struct stat.st_atim.st__tim.tv_nsec" >&5 -$as_echo_n "checking for struct stat.st_atim.st__tim.tv_nsec... " >&6; } -if test "${ac_cv_member_struct_stat_st_atim_st__tim_tv_nsec+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include + ac_fn_c_check_member "$LINENO" "struct stat" "st_atim.st__tim.tv_nsec" "ac_cv_member_struct_stat_st_atim_st__tim_tv_nsec" "#include #include - -int -main () -{ -static struct stat ac_aggr; -if (ac_aggr.st_atim.st__tim.tv_nsec) -return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_member_struct_stat_st_atim_st__tim_tv_nsec=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - #include - -int -main () -{ -static struct stat ac_aggr; -if (sizeof ac_aggr.st_atim.st__tim.tv_nsec) -return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_member_struct_stat_st_atim_st__tim_tv_nsec=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_member_struct_stat_st_atim_st__tim_tv_nsec=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_atim_st__tim_tv_nsec" >&5 -$as_echo "$ac_cv_member_struct_stat_st_atim_st__tim_tv_nsec" >&6; } -if test $ac_cv_member_struct_stat_st_atim_st__tim_tv_nsec = yes; then +" +if test "x$ac_cv_member_struct_stat_st_atim_st__tim_tv_nsec" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_STAT_ST_ATIM_ST__TIM_TV_NSEC 1 _ACEOF -else - { $as_echo "$as_me:$LINENO: checking for struct stat.st_spare1" >&5 -$as_echo_n "checking for struct stat.st_spare1... " >&6; } -if test "${ac_cv_member_struct_stat_st_spare1+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - #include - -int -main () -{ -static struct stat ac_aggr; -if (ac_aggr.st_spare1) -return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_member_struct_stat_st_spare1=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - #include - -int -main () -{ -static struct stat ac_aggr; -if (sizeof ac_aggr.st_spare1) -return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_member_struct_stat_st_spare1=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_member_struct_stat_st_spare1=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_spare1" >&5 -$as_echo "$ac_cv_member_struct_stat_st_spare1" >&6; } -if test $ac_cv_member_struct_stat_st_spare1 = yes; then + +fi + + + + + + + ac_fn_c_check_member "$LINENO" "struct stat" "st_birthtimespec.tv_nsec" "ac_cv_member_struct_stat_st_birthtimespec_tv_nsec" "#include + #include +" +if test "x$ac_cv_member_struct_stat_st_birthtimespec_tv_nsec" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_STAT_ST_SPARE1 1 +#define HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC 1 +_ACEOF + + +else + ac_fn_c_check_member "$LINENO" "struct stat" "st_birthtimensec" "ac_cv_member_struct_stat_st_birthtimensec" "#include + #include +" +if test "x$ac_cv_member_struct_stat_st_birthtimensec" = x""yes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_STAT_ST_BIRTHTIMENSEC 1 +_ACEOF + + +else + ac_fn_c_check_member "$LINENO" "struct stat" "st_birthtim.tv_nsec" "ac_cv_member_struct_stat_st_birthtim_tv_nsec" "#include + #include +" +if test "x$ac_cv_member_struct_stat_st_birthtim_tv_nsec" = x""yes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_STAT_ST_BIRTHTIM_TV_NSEC 1 _ACEOF @@ -39542,23 +30787,17 @@ fi fi -fi - -fi - - { $as_echo "$as_me:$LINENO: checking for va_copy" >&5 + STDARG_H=''; + NEXT_STDARG_H=''; + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for va_copy" >&5 $as_echo_n "checking for va_copy... " >&6; } - if test "${gl_cv_func_va_copy+set}" = set; then + if test "${gl_cv_func_va_copy+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int @@ -39573,48 +30812,91 @@ void (*func) (va_list, va_list) = va_copy; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : gl_cv_func_va_copy=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - gl_cv_func_va_copy=no + gl_cv_func_va_copy=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi - { $as_echo "$as_me:$LINENO: result: $gl_cv_func_va_copy" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_va_copy" >&5 $as_echo "$gl_cv_func_va_copy" >&6; } if test $gl_cv_func_va_copy = no; then - # Provide a substitute, either __va_copy or as a simple assignment. - if test "${gl_cv_func___va_copy+set}" = set; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if defined _AIX && !defined __GNUC__ + AIX vaccine + #endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "vaccine" >/dev/null 2>&1; then : + gl_aixcc=yes +else + gl_aixcc=no +fi +rm -f conftest* + + if test $gl_aixcc = yes; then + STDARG_H=stdarg.h + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_stdarg_h='<'stdarg.h'>' + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +$as_echo_n "checking absolute name of ... " >&6; } +if test "${gl_cv_next_stdarg_h+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ + if test $ac_cv_header_stdarg_h = yes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + _ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + gl_cv_next_stdarg_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n '\#/stdarg.h#{ + s#.*"\(.*/stdarg.h\)".*#\1# + s#^/[^/]#//&# + p + q + }'`'"' + else + gl_cv_next_stdarg_h='<'stdarg.h'>' + fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdarg_h" >&5 +$as_echo "$gl_cv_next_stdarg_h" >&6; } + fi + NEXT_STDARG_H=$gl_cv_next_stdarg_h + + + + if test "$gl_cv_next_stdarg_h" = '""'; then + gl_cv_next_stdarg_h='"///usr/include/stdarg.h"' + NEXT_STDARG_H="$gl_cv_next_stdarg_h" + fi + else + + saved_as_echo_n="$as_echo_n" + as_echo_n=':' + if test "${gl_cv_func___va_copy+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int @@ -39629,49 +30911,26 @@ error, bail out return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : gl_cv_func___va_copy=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - gl_cv_func___va_copy=no + gl_cv_func___va_copy=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi - if test $gl_cv_func___va_copy = yes; then + as_echo_n="$saved_as_echo_n" -cat >>confdefs.h <<\_ACEOF -#define va_copy __va_copy -_ACEOF + if test $gl_cv_func___va_copy = yes; then - else +$as_echo "#define va_copy __va_copy" >>confdefs.h + + else +$as_echo "#define va_copy gl_va_copy" >>confdefs.h -cat >>confdefs.h <<\_ACEOF -#define va_copy gl_va_copy -_ACEOF - + fi fi fi @@ -39725,66 +30984,89 @@ _ACEOF fi - if test $ac_cv_header_stdint_h = yes; then - { $as_echo "$as_me:$LINENO: checking absolute name of " >&5 + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_stdint_h='<'stdint.h'>' + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 $as_echo_n "checking absolute name of ... " >&6; } -if test "${gl_cv_absolute_stdint_h+set}" = set; then +if test "${gl_cv_next_stdint_h+set}" = set; then : $as_echo_n "(cached) " >&6 else - - - - - if test $ac_cv_header_stdint_h = yes; then - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + if test $ac_cv_header_stdint_h = yes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include + _ACEOF - gl_cv_absolute_stdint_h=`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | -sed -n '\#/stdint.h#{s#.*"\(.*/stdint.h\)".*#\1#;s#^/[^/]#//&#;p;q;}'` - fi + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + gl_cv_next_stdint_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n '\#/stdint.h#{ + s#.*"\(.*/stdint.h\)".*#\1# + s#^/[^/]#//&# + p + q + }'`'"' + else + gl_cv_next_stdint_h='<'stdint.h'>' + fi fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_absolute_stdint_h" >&5 -$as_echo "$gl_cv_absolute_stdint_h" >&6; } -cat >>confdefs.h <<_ACEOF -#define ABSOLUTE_STDINT_H "$gl_cv_absolute_stdint_h" -_ACEOF +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdint_h" >&5 +$as_echo "$gl_cv_next_stdint_h" >&6; } + fi + NEXT_STDINT_H=$gl_cv_next_stdint_h - ABSOLUTE_STDINT_H=\"$gl_cv_absolute_stdint_h\" + + if test $ac_cv_header_stdint_h = yes; then HAVE_STDINT_H=1 else - ABSOLUTE_STDINT_H=\"no/such/file/stdint.h\" HAVE_STDINT_H=0 fi - - if test $ac_cv_header_stdint_h = yes; then - { $as_echo "$as_me:$LINENO: checking whether stdint.h conforms to C99" >&5 + if test $ac_cv_header_stdint_h = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stdint.h conforms to C99" >&5 $as_echo_n "checking whether stdint.h conforms to C99... " >&6; } -if test "${gl_cv_header_working_stdint_h+set}" = set; then +if test "${gl_cv_header_working_stdint_h+set}" = set; then : $as_echo_n "(cached) " >&6 else gl_cv_header_working_stdint_h=no - cat >conftest.$ac_ext <<_ACEOF - - /* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include + #define __STDC_LIMIT_MACROS 1 /* to make it work also in C++ mode */ #define __STDC_CONSTANT_MACROS 1 /* to make it work also in C++ mode */ -#include ABSOLUTE_STDINT_H +#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ +#include +/* Dragonfly defines WCHAR_MIN, WCHAR_MAX only in . */ +#if !(defined WCHAR_MIN && defined WCHAR_MAX) +#error "WCHAR_MIN, WCHAR_MAX not defined in " +#endif + + + /* BSD/OS 4.0.1 has a bug: , and must be + included before . */ + #include + #include + #if HAVE_WCHAR_H + # include + # include + # include + #endif + + #ifdef INT8_MAX int8_t a1 = INT8_MAX; int8_t a1min = INT8_MIN; @@ -39856,12 +31138,32 @@ uintptr_t h = UINTPTR_MAX; #endif intmax_t i = INTMAX_MAX; uintmax_t j = UINTMAX_MAX; + +#include /* for CHAR_BIT */ +#define TYPE_MINIMUM(t) \ + ((t) ((t) 0 < (t) -1 ? (t) 0 : ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1))) +#define TYPE_MAXIMUM(t) \ + ((t) ((t) 0 < (t) -1 ? (t) -1 : ~ (~ (t) 0 << (sizeof (t) * CHAR_BIT - 1)))) struct s { - int check_PTRDIFF: PTRDIFF_MIN < 0 && 0 < PTRDIFF_MAX ? 1 : -1; - int check_SIG_ATOMIC: SIG_ATOMIC_MIN <= 0 && 0 < SIG_ATOMIC_MAX ? 1 : -1; - int check_SIZE: 0 < SIZE_MAX ? 1 : -1; - int check_WCHAR: WCHAR_MIN <= 0 && 0 < WCHAR_MAX ? 1 : -1; - int check_WINT: WINT_MIN <= 0 && 0 < WINT_MAX ? 1 : -1; + int check_PTRDIFF: + PTRDIFF_MIN == TYPE_MINIMUM (ptrdiff_t) + && PTRDIFF_MAX == TYPE_MAXIMUM (ptrdiff_t) + ? 1 : -1; + /* Detect bug in FreeBSD 6.0 / ia64. */ + int check_SIG_ATOMIC: + SIG_ATOMIC_MIN == TYPE_MINIMUM (sig_atomic_t) + && SIG_ATOMIC_MAX == TYPE_MAXIMUM (sig_atomic_t) + ? 1 : -1; + int check_SIZE: SIZE_MAX == TYPE_MAXIMUM (size_t) ? 1 : -1; + int check_WCHAR: + WCHAR_MIN == TYPE_MINIMUM (wchar_t) + && WCHAR_MAX == TYPE_MAXIMUM (wchar_t) + ? 1 : -1; + /* Detect bug in mingw. */ + int check_WINT: + WINT_MIN == TYPE_MINIMUM (wint_t) + && WINT_MAX == TYPE_MAXIMUM (wint_t) + ? 1 : -1; /* Detect bugs in glibc 2.4 and Solaris 10 stdint.h, among others. */ int check_UINT8_C: @@ -39903,183 +31205,112 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - gl_cv_header_working_stdint_h=yes +if ac_fn_c_try_compile "$LINENO"; then : + if test "$cross_compiling" = yes; then : + gl_cv_header_working_stdint_h=yes + else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +#define __STDC_LIMIT_MACROS 1 /* to make it work also in C++ mode */ +#define __STDC_CONSTANT_MACROS 1 /* to make it work also in C++ mode */ +#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ +#include + + + /* BSD/OS 4.0.1 has a bug: , and must be + included before . */ + #include + #include + #if HAVE_WCHAR_H + # include + # include + # include + #endif + + +#include +#include +#define MVAL(macro) MVAL1(macro) +#define MVAL1(expression) #expression +static const char *macro_values[] = + { +#ifdef INT8_MAX + MVAL (INT8_MAX), +#endif +#ifdef INT16_MAX + MVAL (INT16_MAX), +#endif +#ifdef INT32_MAX + MVAL (INT32_MAX), +#endif +#ifdef INT64_MAX + MVAL (INT64_MAX), +#endif +#ifdef UINT8_MAX + MVAL (UINT8_MAX), +#endif +#ifdef UINT16_MAX + MVAL (UINT16_MAX), +#endif +#ifdef UINT32_MAX + MVAL (UINT32_MAX), +#endif +#ifdef UINT64_MAX + MVAL (UINT64_MAX), +#endif + NULL + }; + +int +main () +{ + + const char **mv; + for (mv = macro_values; *mv != NULL; mv++) + { + const char *value = *mv; + /* Test whether it looks like a cast expression. */ + if (strncmp (value, "((unsigned int)"/*)*/, 15) == 0 + || strncmp (value, "((unsigned short)"/*)*/, 17) == 0 + || strncmp (value, "((unsigned char)"/*)*/, 16) == 0 + || strncmp (value, "((int)"/*)*/, 6) == 0 + || strncmp (value, "((signed short)"/*)*/, 15) == 0 + || strncmp (value, "((signed char)"/*)*/, 14) == 0) + return 1; + } + return 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_header_working_stdint_h=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_header_working_stdint_h" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_working_stdint_h" >&5 $as_echo "$gl_cv_header_working_stdint_h" >&6; } fi if test "$gl_cv_header_working_stdint_h" = yes; then STDINT_H= else - - -for ac_header in sys/inttypes.h sys/bitypes.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-coreutils@gnu.org ## -## ------------------------------------ ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - -fi -if test `eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` = yes; then + for ac_header in sys/inttypes.h sys/bitypes.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +eval as_val=\$$as_ac_Header + if test "x$as_val" = x""yes; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF @@ -40105,394 +31336,82 @@ done + if test $APPLE_UNIVERSAL_BUILD = 0; then - - - for gltype in ptrdiff_t sig_atomic_t size_t wchar_t wint_t ; do - { $as_echo "$as_me:$LINENO: checking for bit size of $gltype" >&5 + for gltype in ptrdiff_t size_t ; do + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bit size of $gltype" >&5 $as_echo_n "checking for bit size of $gltype... " >&6; } -if { as_var=gl_cv_bitsizeof_${gltype}; eval "test \"\${$as_var+set}\" = set"; }; then +if { as_var=gl_cv_bitsizeof_${gltype}; eval "test \"\${$as_var+set}\" = set"; }; then : $as_echo_n "(cached) " >&6 else - if test "$cross_compiling" = yes; then - # Depending upon the size, compute the lo and hi bounds. -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - + if ac_fn_c_compute_int "$LINENO" "sizeof ($gltype) * CHAR_BIT" "result" " /* BSD/OS 4.0.1 has a bug: , and must be included before . */ #include #include - #include - #include - #include + #if HAVE_WCHAR_H + # include + # include + # include + #endif -#include -int -main () -{ -static int test_array [1 - 2 * !((sizeof ($gltype) * CHAR_BIT) >= 0)]; -test_array [0] = 0 +#include "; then : - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_lo=0 ac_mid=0 - while :; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - - /* BSD/OS 4.0.1 has a bug: , and must be - included before . */ - #include - #include - #include - #include - #include - -#include -int -main () -{ -static int test_array [1 - 2 * !((sizeof ($gltype) * CHAR_BIT) <= $ac_mid)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_hi=$ac_mid; break else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_lo=`expr $ac_mid + 1` - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid + 1` + result=unknown fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - - /* BSD/OS 4.0.1 has a bug: , and must be - included before . */ - #include - #include - #include - #include - #include - -#include -int -main () -{ -static int test_array [1 - 2 * !((sizeof ($gltype) * CHAR_BIT) < 0)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_hi=-1 ac_mid=-1 - while :; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - - /* BSD/OS 4.0.1 has a bug: , and must be - included before . */ - #include - #include - #include - #include - #include - -#include -int -main () -{ -static int test_array [1 - 2 * !((sizeof ($gltype) * CHAR_BIT) >= $ac_mid)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_lo=$ac_mid; break -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_hi=`expr '(' $ac_mid ')' - 1` - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid` -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_lo= ac_hi= -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -# Binary search between lo and hi bounds. -while test "x$ac_lo" != "x$ac_hi"; do - ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - - /* BSD/OS 4.0.1 has a bug: , and must be - included before . */ - #include - #include - #include - #include - #include - -#include -int -main () -{ -static int test_array [1 - 2 * !((sizeof ($gltype) * CHAR_BIT) <= $ac_mid)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_hi=$ac_mid -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_lo=`expr '(' $ac_mid ')' + 1` -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -done -case $ac_lo in -?*) result=$ac_lo;; -'') result=unknown ;; -esac -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - - /* BSD/OS 4.0.1 has a bug: , and must be - included before . */ - #include - #include - #include - #include - #include - -#include -static long int longval () { return sizeof ($gltype) * CHAR_BIT; } -static unsigned long int ulongval () { return sizeof ($gltype) * CHAR_BIT; } -#include -#include -int -main () -{ - - FILE *f = fopen ("conftest.val", "w"); - if (! f) - return 1; - if ((sizeof ($gltype) * CHAR_BIT) < 0) - { - long int i = longval (); - if (i != (sizeof ($gltype) * CHAR_BIT)) - return 1; - fprintf (f, "%ld", i); - } - else - { - unsigned long int i = ulongval (); - if (i != (sizeof ($gltype) * CHAR_BIT)) - return 1; - fprintf (f, "%lu", i); - } - /* Do not output a trailing newline, as this causes \r\n confusion - on some platforms. */ - return ferror (f) || fclose (f) != 0; - - ; - return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - result=`cat conftest.val` -else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -result=unknown -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -rm -f conftest.val eval gl_cv_bitsizeof_${gltype}=\$result fi -ac_res=`eval 'as_val=${'gl_cv_bitsizeof_${gltype}'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +eval ac_res=\$gl_cv_bitsizeof_${gltype} + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval result=\$gl_cv_bitsizeof_${gltype} + if test $result = unknown; then + result=0 + fi + GLTYPE=`echo "$gltype" | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` + cat >>confdefs.h <<_ACEOF +#define BITSIZEOF_${GLTYPE} $result +_ACEOF + + eval BITSIZEOF_${GLTYPE}=\$result + done + + + fi + + + for gltype in sig_atomic_t wchar_t wint_t ; do + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bit size of $gltype" >&5 +$as_echo_n "checking for bit size of $gltype... " >&6; } +if { as_var=gl_cv_bitsizeof_${gltype}; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "sizeof ($gltype) * CHAR_BIT" "result" " + /* BSD/OS 4.0.1 has a bug: , and must be + included before . */ + #include + #include + #if HAVE_WCHAR_H + # include + # include + # include + #endif + +#include "; then : + +else + result=unknown +fi + + eval gl_cv_bitsizeof_${gltype}=\$result + +fi +eval ac_res=\$gl_cv_bitsizeof_${gltype} + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval result=\$gl_cv_bitsizeof_${gltype} if test $result = unknown; then @@ -40509,29 +31428,24 @@ _ACEOF - - - for gltype in sig_atomic_t wchar_t wint_t ; do - { $as_echo "$as_me:$LINENO: checking whether $gltype is signed" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gltype is signed" >&5 $as_echo_n "checking whether $gltype is signed... " >&6; } -if { as_var=gl_cv_type_${gltype}_signed; eval "test \"\${$as_var+set}\" = set"; }; then +if { as_var=gl_cv_type_${gltype}_signed; eval "test \"\${$as_var+set}\" = set"; }; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* BSD/OS 4.0.1 has a bug: , and must be included before . */ #include #include - #include - #include - #include + #if HAVE_WCHAR_H + # include + # include + # include + #endif int verify[2 * (($gltype) -1 < ($gltype) 0) - 1]; int @@ -40542,39 +31456,17 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : result=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - result=no + result=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext eval gl_cv_type_${gltype}_signed=\$result fi -ac_res=`eval 'as_val=${'gl_cv_type_${gltype}_signed'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +eval ac_res=\$gl_cv_type_${gltype}_signed + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval result=\$gl_cv_type_${gltype}_signed GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` @@ -40592,17 +31484,13 @@ _ACEOF gl_cv_type_ptrdiff_t_signed=yes gl_cv_type_size_t_signed=no + if test $APPLE_UNIVERSAL_BUILD = 0; then - - - - - - for gltype in ptrdiff_t sig_atomic_t size_t wchar_t wint_t ; do - { $as_echo "$as_me:$LINENO: checking for $gltype integer literal suffix" >&5 + for gltype in ptrdiff_t size_t ; do + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $gltype integer literal suffix" >&5 $as_echo_n "checking for $gltype integer literal suffix... " >&6; } -if { as_var=gl_cv_type_${gltype}_suffix; eval "test \"\${$as_var+set}\" = set"; }; then +if { as_var=gl_cv_type_${gltype}_suffix; eval "test \"\${$as_var+set}\" = set"; }; then : $as_echo_n "(cached) " >&6 else eval gl_cv_type_${gltype}_suffix=no @@ -40623,20 +31511,18 @@ else ull) gltype1='unsigned long long int';; ui64)gltype1='unsigned __int64';; esac - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* BSD/OS 4.0.1 has a bug: , and must be included before . */ #include #include - #include - #include - #include + #if HAVE_WCHAR_H + # include + # include + # include + #endif extern $gltype foo; extern $gltype1 foo; @@ -40648,40 +31534,88 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : eval gl_cv_type_${gltype}_suffix=\$glsuf -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext eval result=\$gl_cv_type_${gltype}_suffix test "$result" != no && break done fi -ac_res=`eval 'as_val=${'gl_cv_type_${gltype}_suffix'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +eval ac_res=\$gl_cv_type_${gltype}_suffix + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` + eval result=\$gl_cv_type_${gltype}_suffix + test "$result" = no && result= + eval ${GLTYPE}_SUFFIX=\$result + cat >>confdefs.h <<_ACEOF +#define ${GLTYPE}_SUFFIX $result +_ACEOF + + done + + + fi + + + for gltype in sig_atomic_t wchar_t wint_t ; do + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $gltype integer literal suffix" >&5 +$as_echo_n "checking for $gltype integer literal suffix... " >&6; } +if { as_var=gl_cv_type_${gltype}_suffix; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 +else + eval gl_cv_type_${gltype}_suffix=no + eval result=\$gl_cv_type_${gltype}_signed + if test "$result" = yes; then + glsufu= + else + glsufu=u + fi + for glsuf in "$glsufu" ${glsufu}l ${glsufu}ll ${glsufu}i64; do + case $glsuf in + '') gltype1='int';; + l) gltype1='long int';; + ll) gltype1='long long int';; + i64) gltype1='__int64';; + u) gltype1='unsigned int';; + ul) gltype1='unsigned long int';; + ull) gltype1='unsigned long long int';; + ui64)gltype1='unsigned __int64';; + esac + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + /* BSD/OS 4.0.1 has a bug: , and must be + included before . */ + #include + #include + #if HAVE_WCHAR_H + # include + # include + # include + #endif + + extern $gltype foo; + extern $gltype1 foo; +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval gl_cv_type_${gltype}_suffix=\$glsuf +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + eval result=\$gl_cv_type_${gltype}_suffix + test "$result" != no && break + done +fi +eval ac_res=\$gl_cv_type_${gltype}_suffix + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` eval result=\$gl_cv_type_${gltype}_suffix @@ -40701,74 +31635,151 @@ _ACEOF - { $as_echo "$as_me:$LINENO: checking absolute name of " >&5 + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_stdio_h='<'stdio.h'>' + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 $as_echo_n "checking absolute name of ... " >&6; } -if test "${gl_cv_absolute_stdio_h+set}" = set; then +if test "${gl_cv_next_stdio_h+set}" = set; then : $as_echo_n "(cached) " >&6 else - - - - - if test $ac_cv_header_stdio_h = yes; then - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + if test $ac_cv_header_stdio_h = yes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include + _ACEOF - gl_cv_absolute_stdio_h=`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | -sed -n '\#/stdio.h#{s#.*"\(.*/stdio.h\)".*#\1#;s#^/[^/]#//&#;p;q;}'` - fi + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + gl_cv_next_stdio_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n '\#/stdio.h#{ + s#.*"\(.*/stdio.h\)".*#\1# + s#^/[^/]#//&# + p + q + }'`'"' + else + gl_cv_next_stdio_h='<'stdio.h'>' + fi fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_absolute_stdio_h" >&5 -$as_echo "$gl_cv_absolute_stdio_h" >&6; } -cat >>confdefs.h <<_ACEOF -#define ABSOLUTE_STDIO_H "$gl_cv_absolute_stdio_h" -_ACEOF +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdio_h" >&5 +$as_echo "$gl_cv_next_stdio_h" >&6; } + fi + NEXT_STDIO_H=$gl_cv_next_stdio_h - ABSOLUTE_STDIO_H=\"$gl_cv_absolute_stdio_h\" + + GNULIB_FPRINTF=1 + GNULIB_PRINTF=1 + GNULIB_VFPRINTF=1 + GNULIB_VPRINTF=1 + GNULIB_FPUTC=1 + GNULIB_PUTC=1 + GNULIB_PUTCHAR=1 + GNULIB_FPUTS=1 + GNULIB_PUTS=1 + GNULIB_FWRITE=1 - { $as_echo "$as_me:$LINENO: checking absolute name of " >&5 + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_stdlib_h='<'stdlib.h'>' + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 $as_echo_n "checking absolute name of ... " >&6; } -if test "${gl_cv_absolute_stdlib_h+set}" = set; then +if test "${gl_cv_next_stdlib_h+set}" = set; then : $as_echo_n "(cached) " >&6 else - - - - - if test $ac_cv_header_stdlib_h = yes; then - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + if test $ac_cv_header_stdlib_h = yes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include + _ACEOF - gl_cv_absolute_stdlib_h=`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | -sed -n '\#/stdlib.h#{s#.*"\(.*/stdlib.h\)".*#\1#;s#^/[^/]#//&#;p;q;}'` - fi + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + gl_cv_next_stdlib_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n '\#/stdlib.h#{ + s#.*"\(.*/stdlib.h\)".*#\1# + s#^/[^/]#//&# + p + q + }'`'"' + else + gl_cv_next_stdlib_h='<'stdlib.h'>' + fi fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_absolute_stdlib_h" >&5 -$as_echo "$gl_cv_absolute_stdlib_h" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdlib_h" >&5 +$as_echo "$gl_cv_next_stdlib_h" >&6; } + fi + NEXT_STDLIB_H=$gl_cv_next_stdlib_h + + + + for ac_header in random.h +do : + ac_fn_c_check_header_compile "$LINENO" "random.h" "ac_cv_header_random_h" "$ac_includes_default +" +if test "x$ac_cv_header_random_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_RANDOM_H 1 +_ACEOF + +fi + +done + + if test $ac_cv_header_random_h = yes; then + HAVE_RANDOM_H=1 + else + HAVE_RANDOM_H=0 + fi + + ac_fn_c_check_type "$LINENO" "struct random_data" "ac_cv_type_struct_random_data" "#include + #if HAVE_RANDOM_H + # include + #endif + +" +if test "x$ac_cv_type_struct_random_data" = x""yes; then : + cat >>confdefs.h <<_ACEOF -#define ABSOLUTE_STDLIB_H "$gl_cv_absolute_stdlib_h" +#define HAVE_STRUCT_RANDOM_DATA 1 _ACEOF - ABSOLUTE_STDLIB_H=\"$gl_cv_absolute_stdlib_h\" +else + HAVE_STRUCT_RANDOM_DATA=0 +fi + + + + + + + + @@ -40779,104 +31790,32 @@ _ACEOF -for ac_func in stpcpy -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ -#ifdef __STDC__ -# include -#else -# include -#endif -#undef $ac_func -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - eval "$as_ac_var=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if test `eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` = yes; then + + + + for ac_func in stpcpy +do : + ac_fn_c_check_func "$LINENO" "stpcpy" "ac_cv_func_stpcpy" +if test "x$ac_cv_func_stpcpy" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define HAVE_STPCPY 1 _ACEOF else - gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" + + gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" + fi done + if test $ac_cv_func_stpcpy = no; then HAVE_STPCPY=0 @@ -40890,104 +31829,123 @@ done -for ac_func in strcspn -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working stpncpy" >&5 +$as_echo_n "checking for working stpncpy... " >&6; } +if test "${gl_cv_func_stpncpy+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + + if test "$cross_compiling" = yes; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include +#include +#ifdef __GNU_LIBRARY__ + Thanks for using GNU #endif -#undef $ac_func +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "Thanks for using GNU" >/dev/null 2>&1; then : + gl_cv_func_stpncpy=yes +else + gl_cv_func_stpncpy=no +fi +rm -f conftest* -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -int -main () -{ -return $ac_func (); - ; - return 0; +#include +#include /* for strcpy */ +/* The stpncpy prototype is missing in on AIX 4. */ +extern char *stpncpy (char *dest, const char *src, size_t n); +int main () { + const char *src = "Hello"; + char dest[10]; + /* AIX 4.3.3 and AIX 5.1 stpncpy() returns dest+1 here. */ + strcpy (dest, "\377\377\377\377\377\377"); + if (stpncpy (dest, src, 2) != dest + 2) exit(1); + /* AIX 4.3.3 and AIX 5.1 stpncpy() returns dest+4 here. */ + strcpy (dest, "\377\377\377\377\377\377"); + if (stpncpy (dest, src, 5) != dest + 5) exit(1); + /* AIX 4.3.3 and AIX 5.1 stpncpy() returns dest+6 here. */ + strcpy (dest, "\377\377\377\377\377\377"); + if (stpncpy (dest, src, 7) != dest + 5) exit(1); + exit(0); } + _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_stpncpy=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" + gl_cv_func_stpncpy=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if test `eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_stpncpy" >&5 +$as_echo "$gl_cv_func_stpncpy" >&6; } + + if test $gl_cv_func_stpncpy = yes; then + +$as_echo "#define HAVE_STPNCPY 1" >>confdefs.h + + else + HAVE_STPNCPY=0 + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS stpncpy.$ac_objext" + + + : + + fi + + + + GNULIB_STPNCPY=1 + + + + + + + + + + + for ac_func in strcspn +do : + ac_fn_c_check_func "$LINENO" "strcspn" "ac_cv_func_strcspn" +if test "x$ac_cv_func_strcspn" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define HAVE_STRCSPN 1 _ACEOF else - gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" + + gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" + fi done + if test $ac_cv_func_strcspn = no; then : fi @@ -40995,108 +31953,30 @@ done -for ac_func in strdup -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ -#ifdef __STDC__ -# include -#else -# include -#endif -#undef $ac_func -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - eval "$as_ac_var=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if test `eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` = yes; then + for ac_func in strdup +do : + ac_fn_c_check_func "$LINENO" "strdup" "ac_cv_func_strdup" +if test "x$ac_cv_func_strdup" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define HAVE_STRDUP 1 _ACEOF else - gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" + + gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" + fi done - - if test $ac_cv_have_decl_strdup = no; then HAVE_DECL_STRDUP=0 fi @@ -41108,7 +31988,91 @@ done - gl_LIBOBJS="$gl_LIBOBJS strftime.$ac_objext" + + if test $gl_cv_func_malloc_posix != yes; then + REPLACE_STRDUP=1 + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS strdup.$ac_objext" + + else + + + + + + + + + for ac_func in strdup +do : + ac_fn_c_check_func "$LINENO" "strdup" "ac_cv_func_strdup" +if test "x$ac_cv_func_strdup" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_STRDUP 1 +_ACEOF + +else + + gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" + +fi +done + + + fi + + if test $ac_cv_have_decl_strdup = no; then + HAVE_DECL_STRDUP=0 + fi + : + + + + GNULIB_STRDUP=1 + + + + if test $REPLACE_STRERROR = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS strerror.$ac_objext" + + +cat >>confdefs.h <<_ACEOF +#define REPLACE_STRERROR $REPLACE_STRERROR +_ACEOF + + fi + + + + GNULIB_STRERROR=1 + + + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS strftime.$ac_objext" + # This defines (or not) HAVE_TZNAME and HAVE_TM_ZONE. @@ -41120,31 +32084,14 @@ done +$as_echo "#define my_strftime nstrftime" >>confdefs.h - - - - - - - - - - - - - -cat >>confdefs.h <<\_ACEOF -#define my_strftime nstrftime -_ACEOF - - - - - - + if test $gl_cond_libtool = false; then + gl_ltlibdeps="$gl_ltlibdeps $LTLIBICONV" + gl_libdeps="$gl_libdeps $LIBICONV" + fi @@ -41158,100 +32105,15 @@ _ACEOF fi # AIX 4.3.3, AIX 5.1 have a function that fails to add the terminating '\0'. - { $as_echo "$as_me:$LINENO: checking for working strndup" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working strndup" >&5 $as_echo_n "checking for working strndup... " >&6; } -if test "${gl_cv_func_strndup+set}" = set; then +if test "${gl_cv_func_strndup+set}" = set; then : $as_echo_n "(cached) " >&6 else - if test "$cross_compiling" = yes; then - { $as_echo "$as_me:$LINENO: checking for strndup" >&5 -$as_echo_n "checking for strndup... " >&6; } -if test "${ac_cv_func_strndup+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define strndup to an innocuous variant, in case declares strndup. - For example, HP-UX 11i declares gettimeofday. */ -#define strndup innocuous_strndup - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char strndup (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef strndup - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char strndup (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_strndup || defined __stub___strndup -choke me -#endif - -int -main () -{ -return strndup (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_func_strndup=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_func_strndup=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_strndup" >&5 -$as_echo "$ac_cv_func_strndup" >&6; } -if test $ac_cv_func_strndup = yes; then - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + if test "$cross_compiling" = yes; then : + ac_fn_c_check_func "$LINENO" "strndup" "ac_cv_func_strndup" +if test "x$ac_cv_func_strndup" = x""yes; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef _AIX @@ -41260,7 +32122,7 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "too risky" >/dev/null 2>&1; then + $EGREP "too risky" >/dev/null 2>&1; then : gl_cv_func_strndup=no else gl_cv_func_strndup=yes @@ -41272,15 +32134,11 @@ else fi else - cat >conftest.$ac_ext <<_ACEOF - - /* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include - #include + + #include + #include int main () { @@ -41297,53 +32155,34 @@ main () return 0; } _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_run "$LINENO"; then : gl_cv_func_strndup=yes else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -gl_cv_func_strndup=no + gl_cv_func_strndup=no fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi - fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_strndup" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strndup" >&5 $as_echo "$gl_cv_func_strndup" >&6; } if test $gl_cv_func_strndup = yes; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_STRNDUP 1 -_ACEOF +$as_echo "#define HAVE_STRNDUP 1" >>confdefs.h else HAVE_STRNDUP=0 - gl_LIBOBJS="$gl_LIBOBJS strndup.$ac_objext" + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS strndup.$ac_objext" + : fi @@ -41356,26 +32195,19 @@ _ACEOF - - - if test $ac_cv_have_decl_strnlen = no; then HAVE_DECL_STRNLEN=0 fi - { $as_echo "$as_me:$LINENO: checking for working strnlen" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working strnlen" >&5 $as_echo_n "checking for working strnlen... " >&6; } -if test "${ac_cv_func_strnlen_working+set}" = set; then +if test "${ac_cv_func_strnlen_working+set}" = set; then : $as_echo_n "(cached) " >&6 else - if test "$cross_compiling" = yes; then + if test "$cross_compiling" = yes; then : ac_cv_func_strnlen_working=no else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int @@ -41401,55 +32233,36 @@ main () return 0; } _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_strnlen_working=yes else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_func_strnlen_working=no + ac_cv_func_strnlen_working=no fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi - fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_strnlen_working" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strnlen_working" >&5 $as_echo "$ac_cv_func_strnlen_working" >&6; } -test $ac_cv_func_strnlen_working = no && gl_LIBOBJS="$gl_LIBOBJS strnlen.$ac_objext" +test $ac_cv_func_strnlen_working = no && + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS strnlen.$ac_objext" + if test $ac_cv_func_strnlen_working = no; then - # This is necessary because automake-1.6.1 doens't understand + # This is necessary because automake-1.6.1 doesn't understand # that the above use of AC_FUNC_STRNLEN means we may have to use # lib/strnlen.c. - #AC_LIBOBJ(strnlen) + #AC_LIBOBJ([strnlen]) -cat >>confdefs.h <<\_ACEOF -#define strnlen rpl_strnlen -_ACEOF +$as_echo "#define strnlen rpl_strnlen" >>confdefs.h : fi @@ -41461,104 +32274,29 @@ _ACEOF -for ac_func in strpbrk -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ -#ifdef __STDC__ -# include -#else -# include -#endif -#undef $ac_func -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - eval "$as_ac_var=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if test `eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` = yes; then + for ac_func in strpbrk +do : + ac_fn_c_check_func "$LINENO" "strpbrk" "ac_cv_func_strpbrk" +if test "x$ac_cv_func_strpbrk" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define HAVE_STRPBRK 1 _ACEOF else - gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" + + gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" + fi done + if test $ac_cv_func_strpbrk = no; then HAVE_STRPBRK=0 : @@ -41569,19 +32307,16 @@ done GNULIB_STRPBRK=1 - { $as_echo "$as_me:$LINENO: checking for working strtod" >&5 + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working strtod" >&5 $as_echo_n "checking for working strtod... " >&6; } -if test "${ac_cv_func_strtod+set}" = set; then +if test "${ac_cv_func_strtod+set}" = set; then : $as_echo_n "(cached) " >&6 else - if test "$cross_compiling" = yes; then + if test "$cross_compiling" = yes; then : ac_cv_func_strtod=no else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default @@ -41614,142 +32349,43 @@ main() } _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_strtod=yes else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_func_strtod=no + ac_cv_func_strtod=no fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi - fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_strtod" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strtod" >&5 $as_echo "$ac_cv_func_strtod" >&6; } if test $ac_cv_func_strtod = no; then + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS strtod.$ac_objext" -{ $as_echo "$as_me:$LINENO: checking for pow" >&5 -$as_echo_n "checking for pow... " >&6; } -if test "${ac_cv_func_pow+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define pow to an innocuous variant, in case declares pow. - For example, HP-UX 11i declares gettimeofday. */ -#define pow innocuous_pow -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char pow (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ +ac_fn_c_check_func "$LINENO" "pow" "ac_cv_func_pow" +if test "x$ac_cv_func_pow" = x""yes; then : -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef pow - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char pow (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_pow || defined __stub___pow -choke me -#endif - -int -main () -{ -return pow (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_func_pow=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_func_pow=no fi -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_pow" >&5 -$as_echo "$ac_cv_func_pow" >&6; } - if test $ac_cv_func_pow = no; then - { $as_echo "$as_me:$LINENO: checking for pow in -lm" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pow in -lm" >&5 $as_echo_n "checking for pow in -lm... " >&6; } -if test "${ac_cv_lib_m_pow+set}" = set; then +if test "${ac_cv_lib_m_pow+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. @@ -41767,43 +32403,21 @@ return pow (); return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_m_pow=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_m_pow=no + ac_cv_lib_m_pow=no fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_m_pow" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_pow" >&5 $as_echo "$ac_cv_lib_m_pow" >&6; } -if test $ac_cv_lib_m_pow = yes; then +if test "x$ac_cv_lib_m_pow" = x""yes; then : POW_LIB=-lm else - { $as_echo "$as_me:$LINENO: WARNING: cannot find library containing definition of pow" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot find library containing definition of pow" >&5 $as_echo "$as_me: WARNING: cannot find library containing definition of pow" >&2;} fi @@ -41812,78 +32426,118 @@ fi fi if test $ac_cv_func_strtod = no; then - -cat >>confdefs.h <<\_ACEOF -#define strtod rpl_strtod -_ACEOF - + HAVE_STRTOD=0 + REPLACE_STRTOD=1 : - fi - - - - - - { $as_echo "$as_me:$LINENO: checking whether defines strtoimax as a macro" >&5 -$as_echo_n "checking whether defines strtoimax as a macro... " >&6; } -if test "${jm_cv_func_strtoimax_macro+set}" = set; then + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strtod obeys C99" >&5 +$as_echo_n "checking whether strtod obeys C99... " >&6; } +if test "${gl_cv_func_strtod_works+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#ifdef strtoimax - inttypes_h_defines_strtoimax -#endif -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "inttypes_h_defines_strtoimax" >/dev/null 2>&1; then - jm_cv_func_strtoimax_macro=yes + if test "$cross_compiling" = yes; then : + gl_cv_func_strtod_works="guessing no" else - jm_cv_func_strtoimax_macro=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +/* Compare two numbers with ==. + This is a separate function because IRIX 6.5 "cc -O" miscompiles an + 'x == x' test. */ +static int +numeric_equal (double x, double y) +{ + return x == y; +} + +int +main () +{ + + { + /* Older glibc and Cygwin mis-parse "-0x". */ + const char *string = "-0x"; + char *term; + double value = strtod (string, &term); + double zero = 0.0; + if (1.0 / value != -1.0 / zero || term != (string + 2)) + return 1; + } + { + /* Many platforms do not parse hex floats. */ + const char *string = "0XaP+1"; + char *term; + double value = strtod (string, &term); + if (value != 20.0 || term != (string + 6)) + return 1; + } + { + /* Many platforms do not parse infinities. HP-UX 11.31 parses inf, + but mistakenly sets errno. */ + const char *string = "inf"; + char *term; + double value; + errno = 0; + value = strtod (string, &term); + if (value != HUGE_VAL || term != (string + 3) || errno) + return 1; + } + { + /* glibc 2.7 and cygwin 1.5.24 misparse "nan()". */ + const char *string = "nan()"; + char *term; + double value = strtod (string, &term); + if (numeric_equal (value, value) || term != (string + 5)) + return 1; + } + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_strtod_works=yes +else + gl_cv_func_strtod_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -rm -f conftest* fi -{ $as_echo "$as_me:$LINENO: result: $jm_cv_func_strtoimax_macro" >&5 -$as_echo "$jm_cv_func_strtoimax_macro" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strtod_works" >&5 +$as_echo "$gl_cv_func_strtod_works" >&6; } + if test "$gl_cv_func_strtod_works" != yes; then + REPLACE_STRTOD=1 + : - if test "$jm_cv_func_strtoimax_macro" != yes; then -for ac_func in strtoimax -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + + + + + + + gl_LIBOBJS="$gl_LIBOBJS strtod.$ac_objext" + +ac_fn_c_check_func "$LINENO" "pow" "ac_cv_func_pow" +if test "x$ac_cv_func_pow" = x""yes; then : + +fi + +if test $ac_cv_func_pow = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pow in -lm" >&5 +$as_echo_n "checking for pow in -lm... " >&6; } +if test "${ac_cv_lib_m_pow+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + ac_check_lib_save_LIBS=$LIBS +LIBS="-lm $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC @@ -41891,139 +32545,109 @@ cat >>conftest.$ac_ext <<_ACEOF #ifdef __cplusplus extern "C" #endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - +char pow (); int main () { -return $ac_func (); +return pow (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_m_pow=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" + ac_cv_lib_m_pow=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_pow" >&5 +$as_echo "$ac_cv_lib_m_pow" >&6; } +if test "x$ac_cv_lib_m_pow" = x""yes; then : + POW_LIB=-lm +else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot find library containing definition of pow" >&5 +$as_echo "$as_me: WARNING: cannot find library containing definition of pow" >&2;} fi -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if test `eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` = yes; then + + fi + fi + + + + GNULIB_STRTOD=1 + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether defines strtoimax as a macro" >&5 +$as_echo_n "checking whether defines strtoimax as a macro... " >&6; } +if test "${gl_cv_func_strtoimax_macro+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#ifdef strtoimax + inttypes_h_defines_strtoimax +#endif +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "inttypes_h_defines_strtoimax" >/dev/null 2>&1; then : + gl_cv_func_strtoimax_macro=yes +else + gl_cv_func_strtoimax_macro=no +fi +rm -f conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strtoimax_macro" >&5 +$as_echo "$gl_cv_func_strtoimax_macro" >&6; } + + if test "$gl_cv_func_strtoimax_macro" != yes; then + + + + + + + + + for ac_func in strtoimax +do : + ac_fn_c_check_func "$LINENO" "strtoimax" "ac_cv_func_strtoimax" +if test "x$ac_cv_func_strtoimax" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define HAVE_STRTOIMAX 1 _ACEOF else - gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" + + gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" + fi done + if test $ac_cv_func_strtoimax = no; then - { $as_echo "$as_me:$LINENO: checking whether strtoll is declared" >&5 -$as_echo_n "checking whether strtoll is declared... " >&6; } -if test "${ac_cv_have_decl_strtoll+set}" = set; then - $as_echo_n "(cached) " >&6 + ac_fn_c_check_decl "$LINENO" "strtoll" "ac_cv_have_decl_strtoll" "$ac_includes_default" +if test "x$ac_cv_have_decl_strtoll" = x""yes; then : + ac_have_decl=1 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef strtoll - (void) strtoll; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_strtoll=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_strtoll=no + ac_have_decl=0 fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_strtoll" >&5 -$as_echo "$ac_cv_have_decl_strtoll" >&6; } -if test $ac_cv_have_decl_strtoll = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_STRTOLL 1 +#define HAVE_DECL_STRTOLL $ac_have_decl _ACEOF -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_STRTOLL 0 -_ACEOF - - -fi - - - fi fi @@ -42034,208 +32658,60 @@ fi -for ac_func in strtol -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ -#ifdef __STDC__ -# include -#else -# include -#endif -#undef $ac_func -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - eval "$as_ac_var=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if test `eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` = yes; then + for ac_func in strtol +do : + ac_fn_c_check_func "$LINENO" "strtol" "ac_cv_func_strtol" +if test "x$ac_cv_func_strtol" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define HAVE_STRTOL 1 _ACEOF else - gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" + + gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" + fi done + + if test "$ac_cv_type_long_long_int" = yes; then -for ac_func in strtoll -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ -#ifdef __STDC__ -# include -#else -# include -#endif -#undef $ac_func -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - eval "$as_ac_var=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if test `eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` = yes; then + for ac_func in strtoll +do : + ac_fn_c_check_func "$LINENO" "strtoll" "ac_cv_func_strtoll" +if test "x$ac_cv_func_strtoll" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define HAVE_STRTOLL 1 _ACEOF else - gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" + + gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" + fi done + if test $ac_cv_func_strtoll = no; then + HAVE_STRTOLL=0 : @@ -42244,208 +32720,64 @@ done -for ac_func in strtoul -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func + GNULIB_STRTOLL=1 -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ -#ifdef __STDC__ -# include -#else -# include -#endif -#undef $ac_func -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - eval "$as_ac_var=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if test `eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` = yes; then + + + + for ac_func in strtoul +do : + ac_fn_c_check_func "$LINENO" "strtoul" "ac_cv_func_strtoul" +if test "x$ac_cv_func_strtoul" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define HAVE_STRTOUL 1 _ACEOF else - gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" + + gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" + fi done + + if test "$ac_cv_type_unsigned_long_long_int" = yes; then -for ac_func in strtoull -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ -#ifdef __STDC__ -# include -#else -# include -#endif -#undef $ac_func -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - eval "$as_ac_var=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if test `eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` = yes; then + for ac_func in strtoull +do : + ac_fn_c_check_func "$LINENO" "strtoull" "ac_cv_func_strtoull" +if test "x$ac_cv_func_strtoull" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define HAVE_STRTOULL 1 _ACEOF else - gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" + + gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" + fi done + if test $ac_cv_func_strtoull = no; then + HAVE_STRTOULL=0 : @@ -42454,18 +32786,18 @@ done + GNULIB_STRTOULL=1 - { $as_echo "$as_me:$LINENO: checking whether defines strtoumax as a macro" >&5 + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether defines strtoumax as a macro" >&5 $as_echo_n "checking whether defines strtoumax as a macro... " >&6; } -if test "${jm_cv_func_strtoumax_macro+set}" = set; then +if test "${gl_cv_func_strtoumax_macro+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #ifdef strtoumax @@ -42473,189 +32805,56 @@ cat >>conftest.$ac_ext <<_ACEOF #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "inttypes_h_defines_strtoumax" >/dev/null 2>&1; then - jm_cv_func_strtoumax_macro=yes + $EGREP "inttypes_h_defines_strtoumax" >/dev/null 2>&1; then : + gl_cv_func_strtoumax_macro=yes else - jm_cv_func_strtoumax_macro=no + gl_cv_func_strtoumax_macro=no fi rm -f conftest* fi -{ $as_echo "$as_me:$LINENO: result: $jm_cv_func_strtoumax_macro" >&5 -$as_echo "$jm_cv_func_strtoumax_macro" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strtoumax_macro" >&5 +$as_echo "$gl_cv_func_strtoumax_macro" >&6; } - if test "$jm_cv_func_strtoumax_macro" != yes; then + if test "$gl_cv_func_strtoumax_macro" != yes; then -for ac_func in strtoumax -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ -#ifdef __STDC__ -# include -#else -# include -#endif -#undef $ac_func -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - eval "$as_ac_var=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if test `eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` = yes; then + for ac_func in strtoumax +do : + ac_fn_c_check_func "$LINENO" "strtoumax" "ac_cv_func_strtoumax" +if test "x$ac_cv_func_strtoumax" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define HAVE_STRTOUMAX 1 _ACEOF else - gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" + + gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" + fi done + if test $ac_cv_func_strtoumax = no; then - { $as_echo "$as_me:$LINENO: checking whether strtoull is declared" >&5 -$as_echo_n "checking whether strtoull is declared... " >&6; } -if test "${ac_cv_have_decl_strtoull+set}" = set; then - $as_echo_n "(cached) " >&6 + ac_fn_c_check_decl "$LINENO" "strtoull" "ac_cv_have_decl_strtoull" "$ac_includes_default" +if test "x$ac_cv_have_decl_strtoull" = x""yes; then : + ac_have_decl=1 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef strtoull - (void) strtoull; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_strtoull=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_strtoull=no + ac_have_decl=0 fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_strtoull" >&5 -$as_echo "$ac_cv_have_decl_strtoull" >&6; } -if test $ac_cv_have_decl_strtoull = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_STRTOULL 1 +#define HAVE_DECL_STRTOULL $ac_have_decl _ACEOF -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_STRTOULL 0 -_ACEOF - - -fi - - - fi fi @@ -42668,122 +32867,167 @@ fi -for ac_func in strverscmp -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ -#ifdef __STDC__ -# include -#else -# include -#endif -#undef $ac_func -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - eval "$as_ac_var=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if test `eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` = yes; then + + for ac_func in strverscmp +do : + ac_fn_c_check_func "$LINENO" "strverscmp" "ac_cv_func_strverscmp" +if test "x$ac_cv_func_strverscmp" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define HAVE_STRVERSCMP 1 _ACEOF else - gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" + + gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" + fi done + if test $ac_cv_func_strverscmp = no; then : + HAVE_STRVERSCMP=0 fi - { $as_echo "$as_me:$LINENO: checking whether is self-contained" >&5 -$as_echo_n "checking whether is self-contained... " >&6; } -if test "${gl_cv_header_sys_socket_h_selfcontained+set}" = set; then + + GNULIB_STRVERSCMP=1 + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether is self-contained" >&5 +$as_echo_n "checking whether is self-contained... " >&6; } +if test "${gl_cv_header_sys_select_h_selfcontained+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +struct timeval b; + ; + return 0; +} _ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_header_sys_select_h_selfcontained=yes +else + gl_cv_header_sys_select_h_selfcontained=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_sys_select_h_selfcontained" >&5 +$as_echo "$gl_cv_header_sys_select_h_selfcontained" >&6; } + if test $gl_cv_header_sys_select_h_selfcontained = yes; then + SYS_SELECT_H='' + else + SYS_SELECT_H='sys/select.h' + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_sys_select_h='<'sys/select.h'>' + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +$as_echo_n "checking absolute name of ... " >&6; } +if test "${gl_cv_next_sys_select_h+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + if test $ac_cv_header_sys_select_h = yes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + gl_cv_next_sys_select_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n '\#/sys/select.h#{ + s#.*"\(.*/sys/select.h\)".*#\1# + s#^/[^/]#//&# + p + q + }'`'"' + else + gl_cv_next_sys_select_h='<'sys/select.h'>' + fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_select_h" >&5 +$as_echo "$gl_cv_next_sys_select_h" >&6; } + fi + NEXT_SYS_SELECT_H=$gl_cv_next_sys_select_h + + + + if test $ac_cv_header_sys_select_h = yes; then + HAVE_SYS_SELECT_H=1 + else + HAVE_SYS_SELECT_H=0 + fi + + + + + + if test $ac_cv_header_sys_socket_h != yes; then + for ac_header in winsock2.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default" +if test "x$ac_cv_header_winsock2_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_WINSOCK2_H 1 +_ACEOF + +fi + +done + + fi + if test "$ac_cv_header_winsock2_h" = yes; then + HAVE_WINSOCK2_H=1 + UNISTD_H_HAVE_WINSOCK2_H=1 + SYS_IOCTL_H_HAVE_WINSOCK2_H=1 + else + HAVE_WINSOCK2_H=0 + fi + + + fi + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether is self-contained" >&5 +$as_echo_n "checking whether is self-contained... " >&6; } +if test "${gl_cv_header_sys_socket_h_selfcontained+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int @@ -42794,387 +33038,126 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : gl_cv_header_sys_socket_h_selfcontained=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - gl_cv_header_sys_socket_h_selfcontained=no + gl_cv_header_sys_socket_h_selfcontained=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_header_sys_socket_h_selfcontained" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_sys_socket_h_selfcontained" >&5 $as_echo "$gl_cv_header_sys_socket_h_selfcontained" >&6; } if test $gl_cv_header_sys_socket_h_selfcontained = yes; then SYS_SOCKET_H='' - else - SYS_SOCKET_H='sys/socket.h' - - -for ac_header in sys/socket.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-coreutils@gnu.org ## -## ------------------------------------ ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - -fi -if test `eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` = yes; then + for ac_func in shutdown +do : + ac_fn_c_check_func "$LINENO" "shutdown" "ac_cv_func_shutdown" +if test "x$ac_cv_func_shutdown" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define HAVE_SHUTDOWN 1 _ACEOF fi - done - { $as_echo "$as_me:$LINENO: checking absolute name of " >&5 -$as_echo_n "checking absolute name of ... " >&6; } -if test "${gl_cv_absolute_sys_socket_h+set}" = set; then + if test $ac_cv_func_shutdown = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether defines the SHUT_* macros" >&5 +$as_echo_n "checking whether defines the SHUT_* macros... " >&6; } +if test "${gl_cv_header_sys_socket_h_shut+set}" = set; then : $as_echo_n "(cached) " >&6 else - - - - - if test $ac_cv_header_sys_socket_h = yes; then - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include +int +main () +{ +int a[] = { SHUT_RD, SHUT_WR, SHUT_RDWR }; + ; + return 0; +} _ACEOF - gl_cv_absolute_sys_socket_h=`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | -sed -n '\#/sys/socket.h#{s#.*"\(.*/sys/socket.h\)".*#\1#;s#^/[^/]#//&#;p;q;}'` - fi +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_header_sys_socket_h_shut=yes +else + gl_cv_header_sys_socket_h_shut=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_absolute_sys_socket_h" >&5 -$as_echo "$gl_cv_absolute_sys_socket_h" >&6; } -cat >>confdefs.h <<_ACEOF -#define ABSOLUTE_SYS_SOCKET_H "$gl_cv_absolute_sys_socket_h" +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_sys_socket_h_shut" >&5 +$as_echo "$gl_cv_header_sys_socket_h_shut" >&6; } + if test $gl_cv_header_sys_socket_h_shut = no; then + SYS_SOCKET_H='sys/socket.h' + fi + fi + else + SYS_SOCKET_H='sys/socket.h' + fi + if test -n "$SYS_SOCKET_H"; then + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_sys_socket_h='<'sys/socket.h'>' + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +$as_echo_n "checking absolute name of ... " >&6; } +if test "${gl_cv_next_sys_socket_h+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + if test $ac_cv_header_sys_socket_h = yes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + _ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + gl_cv_next_sys_socket_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n '\#/sys/socket.h#{ + s#.*"\(.*/sys/socket.h\)".*#\1# + s#^/[^/]#//&# + p + q + }'`'"' + else + gl_cv_next_sys_socket_h='<'sys/socket.h'>' + fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_socket_h" >&5 +$as_echo "$gl_cv_next_sys_socket_h" >&6; } + fi + NEXT_SYS_SOCKET_H=$gl_cv_next_sys_socket_h - ABSOLUTE_SYS_SOCKET_H=\"$gl_cv_absolute_sys_socket_h\" if test $ac_cv_header_sys_socket_h = yes; then HAVE_SYS_SOCKET_H=1 - HAVE_WINSOCK2_H=0 HAVE_WS2TCPIP_H=0 else HAVE_SYS_SOCKET_H=0 - - -for ac_header in winsock2.h ws2tcpip.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-coreutils@gnu.org ## -## ------------------------------------ ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - -fi -if test `eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` = yes; then + for ac_header in ws2tcpip.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "ws2tcpip.h" "ac_cv_header_ws2tcpip_h" "$ac_includes_default" +if test "x$ac_cv_header_ws2tcpip_h" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define HAVE_WS2TCPIP_H 1 _ACEOF fi done - if test $ac_cv_header_winsock2_h = yes; then - HAVE_WINSOCK2_H=1 - else - HAVE_WINSOCK2_H=0 - fi if test $ac_cv_header_ws2tcpip_h = yes; then HAVE_WS2TCPIP_H=1 else @@ -43184,50 +33167,45 @@ done - fi - - { $as_echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5 -$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } -if test -z "$MKDIR_P"; then - if test "${ac_cv_path_mkdir+set}" = set; then - $as_echo_n "(cached) " >&6 -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in mkdir gmkdir; do - for ac_exec_ext in '' $ac_executable_extensions; do - { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue - case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( - 'mkdir (GNU coreutils) '* | \ - 'mkdir (coreutils) '* | \ - 'mkdir (fileutils) '4.1*) - ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext - break 3;; - esac - done - done -done -IFS=$as_save_IFS + if test $ac_cv_header_sys_socket_h != yes; then + for ac_header in winsock2.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default" +if test "x$ac_cv_header_winsock2_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_WINSOCK2_H 1 +_ACEOF fi - if test "${ac_cv_path_mkdir+set}" = set; then - MKDIR_P="$ac_cv_path_mkdir -p" +done + + fi + if test "$ac_cv_header_winsock2_h" = yes; then + HAVE_WINSOCK2_H=1 + UNISTD_H_HAVE_WINSOCK2_H=1 + SYS_IOCTL_H_HAVE_WINSOCK2_H=1 else - # As a last resort, use the slow shell script. Don't cache a - # value for MKDIR_P within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the value is a relative name. - test -d ./--version && rmdir ./--version - MKDIR_P="$ac_install_sh -d" + HAVE_WINSOCK2_H=0 + fi + + + + + fi + + + + + + + + if test $ac_cv_func_lstat = yes; then + HAVE_LSTAT=1 + else + HAVE_LSTAT=0 fi -fi -{ $as_echo "$as_me:$LINENO: result: $MKDIR_P" >&5 -$as_echo "$MKDIR_P" >&6; } @@ -43237,357 +33215,82 @@ $as_echo "$MKDIR_P" >&6; } - { $as_echo "$as_me:$LINENO: checking whether mkdir is declared" >&5 -$as_echo_n "checking whether mkdir is declared... " >&6; } -if test "${ac_cv_have_decl_mkdir+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -int -main () -{ -#ifndef mkdir - (void) mkdir; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_mkdir=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_mkdir=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_mkdir" >&5 -$as_echo "$ac_cv_have_decl_mkdir" >&6; } -if test $ac_cv_have_decl_mkdir = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_MKDIR 1 -_ACEOF - - -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_MKDIR 0 -_ACEOF - - -for ac_header in io.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-coreutils@gnu.org ## -## ------------------------------------ ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - -fi -if test `eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - -fi - - - - { $as_echo "$as_me:$LINENO: checking absolute name of " >&5 + if test $gl_cv_have_include_next = yes; then + gl_cv_next_sys_stat_h='<'sys/stat.h'>' + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 $as_echo_n "checking absolute name of ... " >&6; } -if test "${gl_cv_absolute_sys_stat_h+set}" = set; then +if test "${gl_cv_next_sys_stat_h+set}" = set; then : $as_echo_n "(cached) " >&6 else - - - - - if test $ac_cv_header_sys_stat_h = yes; then - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + if test $ac_cv_header_sys_stat_h = yes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include + _ACEOF - gl_cv_absolute_sys_stat_h=`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | -sed -n '\#/sys/stat.h#{s#.*"\(.*/sys/stat.h\)".*#\1#;s#^/[^/]#//&#;p;q;}'` - fi + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + gl_cv_next_sys_stat_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n '\#/sys/stat.h#{ + s#.*"\(.*/sys/stat.h\)".*#\1# + s#^/[^/]#//&# + p + q + }'`'"' + else + gl_cv_next_sys_stat_h='<'sys/stat.h'>' + fi fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_absolute_sys_stat_h" >&5 -$as_echo "$gl_cv_absolute_sys_stat_h" >&6; } -cat >>confdefs.h <<_ACEOF -#define ABSOLUTE_SYS_STAT_H "$gl_cv_absolute_sys_stat_h" -_ACEOF +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_stat_h" >&5 +$as_echo "$gl_cv_next_sys_stat_h" >&6; } + fi + NEXT_SYS_STAT_H=$gl_cv_next_sys_stat_h - ABSOLUTE_SYS_STAT_H=\"$gl_cv_absolute_sys_stat_h\" SYS_STAT_H='sys/stat.h' - { $as_echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5 -$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } -if test -z "$MKDIR_P"; then - if test "${ac_cv_path_mkdir+set}" = set; then - $as_echo_n "(cached) " >&6 + ac_fn_c_check_type "$LINENO" "nlink_t" "ac_cv_type_nlink_t" "#include + #include +" +if test "x$ac_cv_type_nlink_t" = x""yes; then : + else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in mkdir gmkdir; do - for ac_exec_ext in '' $ac_executable_extensions; do - { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue - case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( - 'mkdir (GNU coreutils) '* | \ - 'mkdir (coreutils) '* | \ - 'mkdir (fileutils) '4.1*) - ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext - break 3;; - esac - done - done -done -IFS=$as_save_IFS + +$as_echo "#define nlink_t int" >>confdefs.h fi - if test "${ac_cv_path_mkdir+set}" = set; then - MKDIR_P="$ac_cv_path_mkdir -p" - else - # As a last resort, use the slow shell script. Don't cache a - # value for MKDIR_P within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the value is a relative name. - test -d ./--version && rmdir ./--version - MKDIR_P="$ac_install_sh -d" - fi -fi -{ $as_echo "$as_me:$LINENO: result: $MKDIR_P" >&5 -$as_echo "$MKDIR_P" >&6; } - { $as_echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5 -$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } -if test -z "$MKDIR_P"; then - if test "${ac_cv_path_mkdir+set}" = set; then - $as_echo_n "(cached) " >&6 -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in mkdir gmkdir; do - for ac_exec_ext in '' $ac_executable_extensions; do - { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue - case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( - 'mkdir (GNU coreutils) '* | \ - 'mkdir (coreutils) '* | \ - 'mkdir (fileutils) '4.1*) - ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext - break 3;; - esac - done - done -done -IFS=$as_save_IFS -fi - if test "${ac_cv_path_mkdir+set}" = set; then - MKDIR_P="$ac_cv_path_mkdir -p" - else - # As a last resort, use the slow shell script. Don't cache a - # value for MKDIR_P within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the value is a relative name. - test -d ./--version && rmdir ./--version - MKDIR_P="$ac_install_sh -d" - fi -fi -{ $as_echo "$as_me:$LINENO: result: $MKDIR_P" >&5 -$as_echo "$MKDIR_P" >&6; } + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS tempname.$ac_objext" + : @@ -43600,16 +33303,12 @@ $as_echo "$MKDIR_P" >&6; } - { $as_echo "$as_me:$LINENO: checking whether localtime_r is compatible with its POSIX signature" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether localtime_r is compatible with its POSIX signature" >&5 $as_echo_n "checking whether localtime_r is compatible with its POSIX signature... " >&6; } -if test "${gl_cv_time_r_posix+set}" = set; then +if test "${gl_cv_time_r_posix+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int @@ -43620,45 +33319,35 @@ main () since C99 says they can't affect type compatibility. */ struct tm * (*ptr) (time_t const *, struct tm *) = localtime_r; if (ptr) return 0; + /* Check the return type is a pointer. On HP-UX 10 it is 'int'. */ + *localtime_r (0, 0); ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : gl_cv_time_r_posix=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - gl_cv_time_r_posix=no + gl_cv_time_r_posix=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_time_r_posix" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_time_r_posix" >&5 $as_echo "$gl_cv_time_r_posix" >&6; } if test $gl_cv_time_r_posix = yes; then REPLACE_LOCALTIME_R=0 else REPLACE_LOCALTIME_R=1 - gl_LIBOBJS="$gl_LIBOBJS time_r.$ac_objext" + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS time_r.$ac_objext" + : @@ -43669,20 +33358,16 @@ $as_echo "$gl_cv_time_r_posix" >&6; } - { $as_echo "$as_me:$LINENO: checking whether tzset clobbers localtime buffer" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether tzset clobbers localtime buffer" >&5 $as_echo_n "checking whether tzset clobbers localtime buffer... " >&6; } -if test "${gl_cv_func_tzset_clobber+set}" = set; then +if test "${gl_cv_func_tzset_clobber+set}" = set; then : $as_echo_n "(cached) " >&6 else - if test "$cross_compiling" = yes; then + if test "$cross_compiling" = yes; then : gl_cv_func_tzset_clobber=yes else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -43707,297 +33392,54 @@ main () } _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_run "$LINENO"; then : gl_cv_func_tzset_clobber=no else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -gl_cv_func_tzset_clobber=yes + gl_cv_func_tzset_clobber=yes fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi - fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_tzset_clobber" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_tzset_clobber" >&5 $as_echo "$gl_cv_func_tzset_clobber" >&6; } -cat >>confdefs.h <<\_ACEOF -#define HAVE_RUN_TZSET_TEST 1 -_ACEOF +$as_echo "#define HAVE_RUN_TZSET_TEST 1" >>confdefs.h if test $gl_cv_func_tzset_clobber = yes; then + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS gettimeofday.$ac_objext" -for ac_header in sys/timeb.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-coreutils@gnu.org ## -## ------------------------------------ ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - -fi -if test `eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` = yes; then + for ac_header in sys/timeb.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "sys/timeb.h" "ac_cv_header_sys_timeb_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_timeb_h" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define HAVE_SYS_TIMEB_H 1 _ACEOF fi done - -for ac_func in _ftime -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if test `eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` = yes; then + for ac_func in _ftime +do : + ac_fn_c_check_func "$LINENO" "_ftime" "ac_cv_func__ftime" +if test "x$ac_cv_func__ftime" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define HAVE__FTIME 1 _ACEOF fi @@ -44005,26 +33447,18 @@ done -cat >>confdefs.h <<\_ACEOF -#define gmtime rpl_gmtime -_ACEOF +$as_echo "#define gmtime rpl_gmtime" >>confdefs.h -cat >>confdefs.h <<\_ACEOF -#define localtime rpl_localtime -_ACEOF +$as_echo "#define localtime rpl_localtime" >>confdefs.h -cat >>confdefs.h <<\_ACEOF -#define tzset rpl_tzset -_ACEOF +$as_echo "#define tzset rpl_tzset" >>confdefs.h -cat >>confdefs.h <<\_ACEOF -#define TZSET_CLOBBERS_LOCALTIME 1 -_ACEOF +$as_echo "#define TZSET_CLOBBERS_LOCALTIME 1" >>confdefs.h fi @@ -44040,40 +33474,48 @@ _ACEOF - if test $ac_cv_header_unistd_h = yes; then - HAVE_UNISTD_H=1 - { $as_echo "$as_me:$LINENO: checking absolute name of " >&5 + if test $gl_cv_have_include_next = yes; then + gl_cv_next_unistd_h='<'unistd.h'>' + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 $as_echo_n "checking absolute name of ... " >&6; } -if test "${gl_cv_absolute_unistd_h+set}" = set; then +if test "${gl_cv_next_unistd_h+set}" = set; then : $as_echo_n "(cached) " >&6 else - - - - - if test $ac_cv_header_unistd_h = yes; then - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + if test $ac_cv_header_unistd_h = yes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include + _ACEOF - gl_cv_absolute_unistd_h=`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | -sed -n '\#/unistd.h#{s#.*"\(.*/unistd.h\)".*#\1#;s#^/[^/]#//&#;p;q;}'` - fi + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + gl_cv_next_unistd_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n '\#/unistd.h#{ + s#.*"\(.*/unistd.h\)".*#\1# + s#^/[^/]#//&# + p + q + }'`'"' + else + gl_cv_next_unistd_h='<'unistd.h'>' + fi fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_absolute_unistd_h" >&5 -$as_echo "$gl_cv_absolute_unistd_h" >&6; } -cat >>confdefs.h <<_ACEOF -#define ABSOLUTE_UNISTD_H "$gl_cv_absolute_unistd_h" -_ACEOF +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_unistd_h" >&5 +$as_echo "$gl_cv_next_unistd_h" >&6; } + fi + NEXT_UNISTD_H=$gl_cv_next_unistd_h - ABSOLUTE_UNISTD_H=\"$gl_cv_absolute_unistd_h\" + + + + if test $ac_cv_header_unistd_h = yes; then + HAVE_UNISTD_H=1 else HAVE_UNISTD_H=0 fi @@ -44087,25 +33529,47 @@ _ACEOF + + gl_LIBOBJS="$gl_LIBOBJS dup-safer.$ac_objext" + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS fd-safer.$ac_objext" + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS pipe-safer.$ac_objext" - { $as_echo "$as_me:$LINENO: checking whether a running program can be unlinked" >&5 + + + +$as_echo "#define GNULIB_UNISTR_U8_UCTOMB 1" >>confdefs.h + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a running program can be unlinked" >&5 $as_echo_n "checking whether a running program can be unlinked... " >&6; } -if test "${jm_cv_func_unlink_busy_text+set}" = set; then +if test "${gl_cv_func_unlink_busy_text+set}" = set; then : $as_echo_n "(cached) " >&6 else - if test "$cross_compiling" = yes; then - jm_cv_func_unlink_busy_text=no + if test "$cross_compiling" = yes; then : + gl_cv_func_unlink_busy_text=no else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int @@ -44114,48 +33578,22 @@ $ac_includes_default return !argc || unlink (argv[0]) != 0; } _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - jm_cv_func_unlink_busy_text=yes +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_unlink_busy_text=yes else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -jm_cv_func_unlink_busy_text=no + gl_cv_func_unlink_busy_text=no fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi - fi -{ $as_echo "$as_me:$LINENO: result: $jm_cv_func_unlink_busy_text" >&5 -$as_echo "$jm_cv_func_unlink_busy_text" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_unlink_busy_text" >&5 +$as_echo "$gl_cv_func_unlink_busy_text" >&6; } - if test $jm_cv_func_unlink_busy_text = no; then + if test $gl_cv_func_unlink_busy_text = no; then INSTALL=$ac_install_sh fi @@ -44168,8 +33606,12 @@ $as_echo "$jm_cv_func_unlink_busy_text" >&6; } + + + gl_LIBOBJS="$gl_LIBOBJS unlinkdir.$ac_objext" + # The Hurd, the Linux kernel, the FreeBSD kernel version 2.2 and later, # and Cygwin never let anyone (even root) unlink directories. # If anyone knows of another system for which unlink can never @@ -44183,18 +33625,46 @@ $as_echo "$jm_cv_func_unlink_busy_text" >&6; } *-*-freebsd2.2* | *-*-freebsd[3-9]* | *-*-freebsd[1-9][0-9]* | \ *-cygwin) -cat >>confdefs.h <<\_ACEOF -#define UNLINK_CANNOT_UNLINK_DIR 1 -_ACEOF +$as_echo "#define UNLINK_CANNOT_UNLINK_DIR 1" >>confdefs.h ;; esac -cat >>confdefs.h <<\_ACEOF -#define USE_UNLOCKED_IO 1 +$as_echo "#define USE_UNLOCKED_IO 1" >>confdefs.h + + + + + + + + + + + + + + + + + + + + + for ac_func in unsetenv +do : + ac_fn_c_check_func "$LINENO" "unsetenv" "ac_cv_func_unsetenv" +if test "x$ac_cv_func_unsetenv" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_UNSETENV 1 _ACEOF +fi +done + + if test $ac_cv_func_unsetenv = no; then + HAVE_UNSETENV=0 @@ -44203,77 +33673,86 @@ _ACEOF + gl_LIBOBJS="$gl_LIBOBJS unsetenv.$ac_objext" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - { $as_echo "$as_me:$LINENO: checking for /proc/uptime" >&5 -$as_echo_n "checking for /proc/uptime... " >&6; } -if test "${jm_cv_have_proc_uptime+set}" = set; then + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for unsetenv() return type" >&5 +$as_echo_n "checking for unsetenv() return type... " >&6; } +if test "${gt_cv_func_unsetenv_ret+set}" = set; then : $as_echo_n "(cached) " >&6 else - jm_cv_have_proc_uptime=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +extern +#ifdef __cplusplus +"C" +#endif +#if defined(__STDC__) || defined(__cplusplus) +int unsetenv (const char *name); +#else +int unsetenv(); +#endif + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gt_cv_func_unsetenv_ret='int' +else + gt_cv_func_unsetenv_ret='void' +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_unsetenv_ret" >&5 +$as_echo "$gt_cv_func_unsetenv_ret" >&6; } + if test $gt_cv_func_unsetenv_ret = 'void'; then + VOID_UNSETENV=1 + fi + fi + + + + GNULIB_UNSETENV=1 + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /proc/uptime" >&5 +$as_echo_n "checking for /proc/uptime... " >&6; } +if test "${gl_cv_have_proc_uptime+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + gl_cv_have_proc_uptime=no test -f /proc/uptime \ && test "$cross_compiling" = no \ && cat < /proc/uptime >/dev/null 2>/dev/null \ - && jm_cv_have_proc_uptime=yes + && gl_cv_have_proc_uptime=yes fi -{ $as_echo "$as_me:$LINENO: result: $jm_cv_have_proc_uptime" >&5 -$as_echo "$jm_cv_have_proc_uptime" >&6; } - if test $jm_cv_have_proc_uptime = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_proc_uptime" >&5 +$as_echo "$gl_cv_have_proc_uptime" >&6; } + if test $gl_cv_have_proc_uptime = yes; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_PROC_UPTIME 1 -_ACEOF +$as_echo "#define HAVE_PROC_UPTIME 1" >>confdefs.h fi + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS userspec.$ac_objext" @@ -44285,111 +33764,24 @@ _ACEOF - if test $ac_cv_func_utime_null = no; then - gl_LIBOBJS="$gl_LIBOBJS utime.$ac_objext" -cat >>confdefs.h <<\_ACEOF -#define utime rpl_utime -_ACEOF - - - - - - - - - - { $as_echo "$as_me:$LINENO: checking whether utimes accepts a null argument" >&5 -$as_echo_n "checking whether utimes accepts a null argument... " >&6; } -if test "${ac_cv_func_utimes_null+set}" = set; then - $as_echo_n "(cached) " >&6 -else - rm -f conftest.data; > conftest.data -if test "$cross_compiling" = yes; then - ac_cv_func_utimes_null=no -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* In case stat has been defined to rpl_stat, undef it here. */ -#undef stat -#include -#include -#include -int -main () { -struct stat s, t; -return ! (stat ("conftest.data", &s) == 0 - && utimes ("conftest.data", 0) == 0 - && stat ("conftest.data", &t) == 0 - && t.st_mtime >= s.st_mtime - && t.st_mtime - s.st_mtime < 120)); -} -_ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_utimes_null=yes -else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_func_utimes_null=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi - - -rm -f core core.* *.core -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_utimes_null" >&5 -$as_echo "$ac_cv_func_utimes_null" >&6; } - - if test $ac_cv_func_utimes_null = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_UTIMES_NULL 1 -_ACEOF - - fi - - - - fi gl_LIBOBJS="$gl_LIBOBJS utimecmp.$ac_objext" + : + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS utimens.$ac_objext" @@ -44399,18 +33791,6 @@ _ACEOF - - - - - - - - - - - - if test $ac_cv_func_vasnprintf = no; then @@ -44420,15 +33800,44 @@ _ACEOF + + + gl_LIBOBJS="$gl_LIBOBJS vasnprintf.$ac_objext" + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS printf-args.$ac_objext" + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS printf-parse.$ac_objext" + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS asnprintf.$ac_objext" + if test $ac_cv_func_vasnprintf = yes; then -cat >>confdefs.h <<\_ACEOF -#define REPLACE_VASNPRINTF 1 -_ACEOF +$as_echo "#define REPLACE_VASNPRINTF 1" >>confdefs.h fi @@ -44441,67 +33850,12 @@ _ACEOF + ac_fn_c_check_type "$LINENO" "ptrdiff_t" "ac_cv_type_ptrdiff_t" "$ac_includes_default" +if test "x$ac_cv_type_ptrdiff_t" = x""yes; then : - - { $as_echo "$as_me:$LINENO: checking for ptrdiff_t" >&5 -$as_echo_n "checking for ptrdiff_t... " >&6; } -if test "${ac_cv_type_ptrdiff_t+set}" = set; then - $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -typedef ptrdiff_t ac__type_new_; -int -main () -{ -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type_ptrdiff_t=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_ptrdiff_t=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_ptrdiff_t" >&5 -$as_echo "$ac_cv_type_ptrdiff_t" >&6; } -if test $ac_cv_type_ptrdiff_t = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_PTRDIFF_T 1 -_ACEOF +$as_echo "#define ptrdiff_t long" >>confdefs.h fi @@ -44512,205 +33866,15 @@ fi - - - - -for ac_func in snprintf wcslen -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if test `eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - - - - - fi - -for ac_func in vasprintf -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if test `eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` = yes; then + for ac_func in vasprintf +do : + ac_fn_c_check_func "$LINENO" "vasprintf" "ac_cv_func_vasprintf" +if test "x$ac_cv_func_vasprintf" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define HAVE_VASPRINTF 1 _ACEOF fi @@ -44718,14 +33882,391 @@ done if test $ac_cv_func_vasprintf = no; then - gl_LIBOBJS="$gl_LIBOBJS vasprintf.$ac_objext" - gl_LIBOBJS="$gl_LIBOBJS asprintf.$ac_objext" - if test $ac_cv_func_vasprintf = yes; then -cat >>confdefs.h <<\_ACEOF -#define REPLACE_VASPRINTF 1 + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS vasprintf.$ac_objext" + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS asprintf.$ac_objext" + + + if test $ac_cv_func_vasprintf = yes; then + REPLACE_VASPRINTF=1 + else + HAVE_VASPRINTF=0 + fi + + + + + + + + + fi + + + + GNULIB_VASPRINTF=1 + + + + XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=asprintf:2:c-format" + + + + XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=vasprintf:2:c-format" + + + + + + + + + + + + + + + + + gl_cv_func_vasprintf_posix=no + for ac_func in vasprintf +do : + ac_fn_c_check_func "$LINENO" "vasprintf" "ac_cv_func_vasprintf" +if test "x$ac_cv_func_vasprintf" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_VASPRINTF 1 _ACEOF +fi +done + + case "$gl_cv_func_printf_sizes_c99" in + *yes) + case "$gl_cv_func_printf_long_double" in + *yes) + case "$gl_cv_func_printf_infinite" in + *yes) + case "$gl_cv_func_printf_infinite_long_double" in + *yes) + case "$gl_cv_func_printf_directive_a" in + *yes) + case "$gl_cv_func_printf_directive_f" in + *yes) + case "$gl_cv_func_printf_directive_n" in + *yes) + case "$gl_cv_func_printf_directive_ls" in + *yes) + case "$gl_cv_func_printf_positions" in + *yes) + case "$gl_cv_func_printf_flag_grouping" in + *yes) + case "$gl_cv_func_printf_flag_leftadjust" in + *yes) + case "$gl_cv_func_printf_flag_zero" in + *yes) + case "$gl_cv_func_printf_precision" in + *yes) + case "$gl_cv_func_printf_enomem" in + *yes) + if test $ac_cv_func_vasprintf = yes; then + # vasprintf exists and is + # already POSIX compliant. + gl_cv_func_vasprintf_posix=yes + fi + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + if test $gl_cv_func_vasprintf_posix = no; then + + + + case "$gl_cv_func_printf_infinite" in + *yes) + ;; + *) + +$as_echo "#define NEED_PRINTF_INFINITE_DOUBLE 1" >>confdefs.h + + ;; + esac + + + + + case "$gl_cv_func_printf_long_double" in + *yes) + case "$gl_cv_func_printf_infinite_long_double" in + *yes) + ;; + *) + +$as_echo "#define NEED_PRINTF_INFINITE_LONG_DOUBLE 1" >>confdefs.h + + ;; + esac + ;; + esac + + + + case "$gl_cv_func_printf_directive_a" in + *yes) + ;; + *) + +$as_echo "#define NEED_PRINTF_DIRECTIVE_A 1" >>confdefs.h + + for ac_func in nl_langinfo +do : + ac_fn_c_check_func "$LINENO" "nl_langinfo" "ac_cv_func_nl_langinfo" +if test "x$ac_cv_func_nl_langinfo" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_NL_LANGINFO 1 +_ACEOF + +fi +done + + ;; + esac + + + + case "$gl_cv_func_printf_directive_f" in + *yes) + ;; + *) + +$as_echo "#define NEED_PRINTF_DIRECTIVE_F 1" >>confdefs.h + + ;; + esac + + + + case "$gl_cv_func_printf_directive_ls" in + *yes) + ;; + *) + +$as_echo "#define NEED_PRINTF_DIRECTIVE_LS 1" >>confdefs.h + + ;; + esac + + + + case "$gl_cv_func_printf_flag_grouping" in + *yes) + ;; + *) + +$as_echo "#define NEED_PRINTF_FLAG_GROUPING 1" >>confdefs.h + + ;; + esac + + + + case "$gl_cv_func_printf_flag_leftadjust" in + *yes) + ;; + *) + +$as_echo "#define NEED_PRINTF_FLAG_LEFTADJUST 1" >>confdefs.h + + ;; + esac + + + + case "$gl_cv_func_printf_flag_zero" in + *yes) + ;; + *) + +$as_echo "#define NEED_PRINTF_FLAG_ZERO 1" >>confdefs.h + + ;; + esac + + + + case "$gl_cv_func_printf_precision" in + *yes) + ;; + *) + +$as_echo "#define NEED_PRINTF_UNBOUNDED_PRECISION 1" >>confdefs.h + + +$as_echo "#define NEED_PRINTF_DOUBLE 1" >>confdefs.h + + +$as_echo "#define NEED_PRINTF_LONG_DOUBLE 1" >>confdefs.h + + ;; + esac + + + + case "$gl_cv_func_printf_enomem" in + *yes) + ;; + *) + +$as_echo "#define NEED_PRINTF_ENOMEM 1" >>confdefs.h + + +$as_echo "#define NEED_PRINTF_DOUBLE 1" >>confdefs.h + + +$as_echo "#define NEED_PRINTF_LONG_DOUBLE 1" >>confdefs.h + + ;; + esac + + + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS vasnprintf.$ac_objext" + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS printf-args.$ac_objext" + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS printf-parse.$ac_objext" + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS asnprintf.$ac_objext" + + if test $ac_cv_func_vasnprintf = yes; then + +$as_echo "#define REPLACE_VASNPRINTF 1" >>confdefs.h + + fi + + + + + + + + + + + ac_fn_c_check_type "$LINENO" "ptrdiff_t" "ac_cv_type_ptrdiff_t" "$ac_includes_default" +if test "x$ac_cv_type_ptrdiff_t" = x""yes; then : + +else + +$as_echo "#define ptrdiff_t long" >>confdefs.h + + +fi + + + + + + + + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS vasprintf.$ac_objext" + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS asprintf.$ac_objext" + + + if test $ac_cv_func_vasprintf = yes; then + REPLACE_VASPRINTF=1 + else + HAVE_VASPRINTF=0 fi @@ -44738,84 +34279,445 @@ _ACEOF fi - { $as_echo "$as_me:$LINENO: checking whether is standalone" >&5 + + XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=verror:3:c-format" + + + + XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=verror_at_line:5:c-format" + + + + + + + + + + + + + + + + + gl_cv_func_vfprintf_posix=no + case "$gl_cv_func_printf_sizes_c99" in + *yes) + case "$gl_cv_func_printf_long_double" in + *yes) + case "$gl_cv_func_printf_infinite" in + *yes) + case "$gl_cv_func_printf_infinite_long_double" in + *yes) + case "$gl_cv_func_printf_directive_a" in + *yes) + case "$gl_cv_func_printf_directive_f" in + *yes) + case "$gl_cv_func_printf_directive_n" in + *yes) + case "$gl_cv_func_printf_directive_ls" in + *yes) + case "$gl_cv_func_printf_positions" in + *yes) + case "$gl_cv_func_printf_flag_grouping" in + *yes) + case "$gl_cv_func_printf_flag_leftadjust" in + *yes) + case "$gl_cv_func_printf_flag_zero" in + *yes) + case "$gl_cv_func_printf_precision" in + *yes) + case "$gl_cv_func_printf_enomem" in + *yes) + # vfprintf exists and is + # already POSIX compliant. + gl_cv_func_vfprintf_posix=yes + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + esac + if test $gl_cv_func_vfprintf_posix = no; then + + + + case "$gl_cv_func_printf_infinite" in + *yes) + ;; + *) + +$as_echo "#define NEED_PRINTF_INFINITE_DOUBLE 1" >>confdefs.h + + ;; + esac + + + + + case "$gl_cv_func_printf_long_double" in + *yes) + case "$gl_cv_func_printf_infinite_long_double" in + *yes) + ;; + *) + +$as_echo "#define NEED_PRINTF_INFINITE_LONG_DOUBLE 1" >>confdefs.h + + ;; + esac + ;; + esac + + + + case "$gl_cv_func_printf_directive_a" in + *yes) + ;; + *) + +$as_echo "#define NEED_PRINTF_DIRECTIVE_A 1" >>confdefs.h + + for ac_func in nl_langinfo +do : + ac_fn_c_check_func "$LINENO" "nl_langinfo" "ac_cv_func_nl_langinfo" +if test "x$ac_cv_func_nl_langinfo" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_NL_LANGINFO 1 +_ACEOF + +fi +done + + ;; + esac + + + + case "$gl_cv_func_printf_directive_f" in + *yes) + ;; + *) + +$as_echo "#define NEED_PRINTF_DIRECTIVE_F 1" >>confdefs.h + + ;; + esac + + + + case "$gl_cv_func_printf_directive_ls" in + *yes) + ;; + *) + +$as_echo "#define NEED_PRINTF_DIRECTIVE_LS 1" >>confdefs.h + + ;; + esac + + + + case "$gl_cv_func_printf_flag_grouping" in + *yes) + ;; + *) + +$as_echo "#define NEED_PRINTF_FLAG_GROUPING 1" >>confdefs.h + + ;; + esac + + + + case "$gl_cv_func_printf_flag_leftadjust" in + *yes) + ;; + *) + +$as_echo "#define NEED_PRINTF_FLAG_LEFTADJUST 1" >>confdefs.h + + ;; + esac + + + + case "$gl_cv_func_printf_flag_zero" in + *yes) + ;; + *) + +$as_echo "#define NEED_PRINTF_FLAG_ZERO 1" >>confdefs.h + + ;; + esac + + + + case "$gl_cv_func_printf_precision" in + *yes) + ;; + *) + +$as_echo "#define NEED_PRINTF_UNBOUNDED_PRECISION 1" >>confdefs.h + + +$as_echo "#define NEED_PRINTF_DOUBLE 1" >>confdefs.h + + +$as_echo "#define NEED_PRINTF_LONG_DOUBLE 1" >>confdefs.h + + ;; + esac + + + + case "$gl_cv_func_printf_enomem" in + *yes) + ;; + *) + +$as_echo "#define NEED_PRINTF_ENOMEM 1" >>confdefs.h + + +$as_echo "#define NEED_PRINTF_DOUBLE 1" >>confdefs.h + + +$as_echo "#define NEED_PRINTF_LONG_DOUBLE 1" >>confdefs.h + + ;; + esac + + + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS vasnprintf.$ac_objext" + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS printf-args.$ac_objext" + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS printf-parse.$ac_objext" + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS asnprintf.$ac_objext" + + if test $ac_cv_func_vasnprintf = yes; then + +$as_echo "#define REPLACE_VASNPRINTF 1" >>confdefs.h + + fi + + + + + + + + + + + ac_fn_c_check_type "$LINENO" "ptrdiff_t" "ac_cv_type_ptrdiff_t" "$ac_includes_default" +if test "x$ac_cv_type_ptrdiff_t" = x""yes; then : + +else + +$as_echo "#define ptrdiff_t long" >>confdefs.h + + +fi + + + + + + + + + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS vfprintf.$ac_objext" + + REPLACE_VFPRINTF=1 + +$as_echo "#define REPLACE_VFPRINTF_POSIX 1" >>confdefs.h + + : + + fi + + + + GNULIB_VFPRINTF_POSIX=1 + + + + if test $gl_cv_func_vfprintf_posix = no; then + + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS vprintf.$ac_objext" + + REPLACE_VPRINTF=1 + +$as_echo "#define REPLACE_VPRINTF_POSIX 1" >>confdefs.h + + : + + fi + + + + GNULIB_VPRINTF_POSIX=1 + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether is standalone" >&5 $as_echo_n "checking whether is standalone... " >&6; } -if test "${gl_cv_header_wchar_h_standalone+set}" = set; then +if test "${gl_cv_header_wchar_h_standalone+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ #include wchar_t w; _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : gl_cv_header_wchar_h_standalone=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - gl_cv_header_wchar_h_standalone=no + gl_cv_header_wchar_h_standalone=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_header_wchar_h_standalone" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_wchar_h_standalone" >&5 $as_echo "$gl_cv_header_wchar_h_standalone" >&6; } - if test $gl_cv_header_wchar_h_standalone = yes; then - WCHAR_H= + + + if test $gt_cv_c_wint_t = yes; then + HAVE_WINT_T=1 else - { $as_echo "$as_me:$LINENO: checking absolute name of " >&5 -$as_echo_n "checking absolute name of ... " >&6; } -if test "${gl_cv_absolute_wchar_h+set}" = set; then - $as_echo_n "(cached) " >&6 -else + HAVE_WINT_T=0 + fi - - - - if test $ac_cv_header_wchar_h = yes; then - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF - gl_cv_absolute_wchar_h=`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | -sed -n '\#/wchar.h#{s#.*"\(.*/wchar.h\)".*#\1#;s#^/[^/]#//&#;p;q;}'` - fi - -fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_absolute_wchar_h" >&5 -$as_echo "$gl_cv_absolute_wchar_h" >&6; } -cat >>confdefs.h <<_ACEOF -#define ABSOLUTE_WCHAR_H "$gl_cv_absolute_wchar_h" -_ACEOF - - - ABSOLUTE_WCHAR_H=\"$gl_cv_absolute_wchar_h\" + if test $gl_cv_header_wchar_h_standalone != yes || test $gt_cv_c_wint_t != yes; then WCHAR_H=wchar.h fi + if test $ac_cv_header_wchar_h = yes; then + HAVE_WCHAR_H=1 + else + HAVE_WCHAR_H=0 + fi + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_wchar_h='<'wchar.h'>' + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +$as_echo_n "checking absolute name of ... " >&6; } +if test "${gl_cv_next_wchar_h+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + if test $ac_cv_header_wchar_h = yes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + gl_cv_next_wchar_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n '\#/wchar.h#{ + s#.*"\(.*/wchar.h\)".*#\1# + s#^/[^/]#//&# + p + q + }'`'"' + else + gl_cv_next_wchar_h='<'wchar.h'>' + fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_wchar_h" >&5 +$as_echo "$gl_cv_next_wchar_h" >&6; } + fi + NEXT_WCHAR_H=$gl_cv_next_wchar_h @@ -44830,6 +34732,255 @@ _ACEOF + if test $ac_cv_func_mbsinit = yes && test $ac_cv_func_mbrtowc = yes; then + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles incomplete characters" >&5 +$as_echo_n "checking whether mbrtowc handles incomplete characters... " >&6; } +if test "${gl_cv_func_mbrtowc_incomplete_state+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + case "$host_os" in + # Guess no on AIX and OSF/1. + osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;; + esac + if test $LOCALE_JA != none; then + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +int main () +{ + if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) + { + const char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) + if (mbsinit (&state)) + return 1; + } + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_mbrtowc_incomplete_state=yes +else + gl_cv_func_mbrtowc_incomplete_state=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi + + fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_incomplete_state" >&5 +$as_echo "$gl_cv_func_mbrtowc_incomplete_state" >&6; } + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works as well as mbtowc" >&5 +$as_echo_n "checking whether mbrtowc works as well as mbtowc... " >&6; } +if test "${gl_cv_func_mbrtowc_sanitycheck+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + case "$host_os" in + # Guess no on Solaris 8. + solaris2.8) gl_cv_func_mbrtowc_sanitycheck="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_sanitycheck="guessing yes" ;; + esac + if test $LOCALE_ZH_CN != none; then + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +int main () +{ + /* This fails on Solaris 8: + mbrtowc returns 2, and sets wc to 0x00F0. + mbtowc returns 4 (correct) and sets wc to 0x5EDC. */ + if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) + { + char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 3, 6, &state) != 4 + && mbtowc (&wc, input + 3, 6) == 4) + return 1; + } + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_mbrtowc_sanitycheck=yes +else + gl_cv_func_mbrtowc_sanitycheck=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi + + fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_sanitycheck" >&5 +$as_echo "$gl_cv_func_mbrtowc_sanitycheck" >&6; } + + REPLACE_MBSTATE_T=0 + case "$gl_cv_func_mbrtowc_incomplete_state" in + *yes) ;; + *) REPLACE_MBSTATE_T=1 ;; + esac + case "$gl_cv_func_mbrtowc_sanitycheck" in + *yes) ;; + *) REPLACE_MBSTATE_T=1 ;; + esac + else + REPLACE_MBSTATE_T=1 + fi + if test $REPLACE_MBSTATE_T = 1; then + + + WCHAR_H=wchar.h + + fi + + if test $REPLACE_MBSTATE_T = 1; then + REPLACE_WCRTOMB=1 + fi + + if test $ac_cv_func_wcrtomb = no; then + HAVE_WCRTOMB=0 + fi + if test $HAVE_WCRTOMB != 0 && test $REPLACE_WCRTOMB != 1; then + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether wcrtomb return value is correct" >&5 +$as_echo_n "checking whether wcrtomb return value is correct... " >&6; } +if test "${gl_cv_func_wcrtomb_retval+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + case "$host_os" in + # Guess no on AIX 4, OSF/1 and Solaris. + aix4* | osf* | solaris*) gl_cv_func_wcrtomb_retval="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_wcrtomb_retval="guessing yes" ;; + esac + if test $LOCALE_FR != none || test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none || test $LOCALE_ZH_CN != none; then + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +#include +int main () +{ + if (setlocale (LC_ALL, "$LOCALE_FR") != NULL) + { + if (wcrtomb (NULL, 0, NULL) != 1) + return 1; + } + if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) + { + if (wcrtomb (NULL, 0, NULL) != 1) + return 1; + } + if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) + { + if (wcrtomb (NULL, 0, NULL) != 1) + return 1; + } + if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) + { + if (wcrtomb (NULL, 0, NULL) != 1) + return 1; + } + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_wcrtomb_retval=yes +else + gl_cv_func_wcrtomb_retval=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi + + fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_wcrtomb_retval" >&5 +$as_echo "$gl_cv_func_wcrtomb_retval" >&6; } + case "$gl_cv_func_wcrtomb_retval" in + *yes) ;; + *) REPLACE_WCRTOMB=1 ;; + esac + fi + if test $HAVE_WCRTOMB = 0 || test $REPLACE_WCRTOMB = 1; then + + + WCHAR_H=wchar.h + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS wcrtomb.$ac_objext" + + + : + + fi + + + + GNULIB_WCRTOMB=1 + + + + + if test $ac_cv_func_iswcntrl = yes; then + HAVE_ISWCNTRL=1 + else + HAVE_ISWCNTRL=0 + fi + + @@ -44842,49 +34993,121 @@ _ACEOF WCTYPE_H=wctype.h if test $ac_cv_header_wctype_h = yes; then - if test "$ac_cv_func_iswcntrl" = yes; then - WCTYPE_H= - fi - { $as_echo "$as_me:$LINENO: checking absolute name of " >&5 -$as_echo_n "checking absolute name of ... " >&6; } -if test "${gl_cv_absolute_wctype_h+set}" = set; then + if test $ac_cv_func_iswcntrl = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether iswcntrl works" >&5 +$as_echo_n "checking whether iswcntrl works... " >&6; } +if test "${gl_cv_func_iswcntrl_works+set}" = set; then : $as_echo_n "(cached) " >&6 else - - - - - if test $ac_cv_header_wctype_h = yes; then - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + if test "$cross_compiling" = yes; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include +#include + #if __GNU_LIBRARY__ == 1 + Linux libc5 i18n is broken. + #endif +int +main () +{ + + ; + return 0; +} _ACEOF - gl_cv_absolute_wctype_h=`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | -sed -n '\#/wctype.h#{s#.*"\(.*/wctype.h\)".*#\1#;s#^/[^/]#//&#;p;q;}'` - fi +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_func_iswcntrl_works=yes +else + gl_cv_func_iswcntrl_works=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + #include + #include + #include + int main () { return iswprint ('x') == 0; } +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_iswcntrl_works=yes +else + gl_cv_func_iswcntrl_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi + fi -{ $as_echo "$as_me:$LINENO: result: $gl_cv_absolute_wctype_h" >&5 -$as_echo "$gl_cv_absolute_wctype_h" >&6; } -cat >>confdefs.h <<_ACEOF -#define ABSOLUTE_WCTYPE_H "$gl_cv_absolute_wctype_h" +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_iswcntrl_works" >&5 +$as_echo "$gl_cv_func_iswcntrl_works" >&6; } + if test $gl_cv_func_iswcntrl_works = yes; then + WCTYPE_H= + fi + fi + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_wctype_h='<'wctype.h'>' + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +$as_echo_n "checking absolute name of ... " >&6; } +if test "${gl_cv_next_wctype_h+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + if test $ac_cv_header_wctype_h = yes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + _ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + gl_cv_next_wctype_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n '\#/wctype.h#{ + s#.*"\(.*/wctype.h\)".*#\1# + s#^/[^/]#//&# + p + q + }'`'"' + else + gl_cv_next_wctype_h='<'wctype.h'>' + fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_wctype_h" >&5 +$as_echo "$gl_cv_next_wctype_h" >&6; } + fi + NEXT_WCTYPE_H=$gl_cv_next_wctype_h + - ABSOLUTE_WCTYPE_H=\"$gl_cv_absolute_wctype_h\" HAVE_WCTYPE_H=1 else - ABSOLUTE_WCTYPE_H=\"no/such/file/wctype.h\" HAVE_WCTYPE_H=0 fi + if test "$gl_cv_func_iswcntrl_works" = no; then + REPLACE_ISWCNTRL=1 + else + REPLACE_ISWCNTRL=0 + fi + + + @@ -44895,29 +35118,7 @@ _ACEOF - - - - - - - - - - - - { $as_echo "$as_me:$LINENO: checking whether wcwidth is declared" >&5 -$as_echo_n "checking whether wcwidth is declared... " >&6; } -if test "${ac_cv_have_decl_wcwidth+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - + ac_fn_c_check_decl "$LINENO" "wcwidth" "ac_cv_have_decl_wcwidth" " /* AIX 3.2.5 declares wcwidth in . */ #include /* Tru64 with Desktop Toolkit C has a bug: must be included before @@ -44929,78 +35130,114 @@ cat >>conftest.$ac_ext <<_ACEOF #include #include +" +if test "x$ac_cv_have_decl_wcwidth" = x""yes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi -int -main () -{ -#ifndef wcwidth - (void) wcwidth; +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_WCWIDTH $ac_have_decl +_ACEOF + + if test $ac_cv_have_decl_wcwidth != yes; then + HAVE_DECL_WCWIDTH=0 + fi + + if test $ac_cv_func_wcwidth = no; then + REPLACE_WCWIDTH=1 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether wcwidth works reasonably in UTF-8 locales" >&5 +$as_echo_n "checking whether wcwidth works reasonably in UTF-8 locales... " >&6; } +if test "${gl_cv_func_wcwidth_works+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + gl_cv_func_wcwidth_works="guessing no" +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +/* AIX 3.2.5 declares wcwidth in . */ +#include +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be included + before . */ +#include +#include +#include +#include +#if !HAVE_DECL_WCWIDTH +extern +# ifdef __cplusplus +"C" +# endif +int wcwidth (int); #endif - - ; +int main () +{ + if (setlocale (LC_ALL, "fr_FR.UTF-8") != NULL) + if (wcwidth (0x0301) > 0 || wcwidth (0x200B) > 0) + return 1; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_wcwidth=yes +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_wcwidth_works=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_wcwidth=no + gl_cv_func_wcwidth_works=no fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_wcwidth" >&5 -$as_echo "$ac_cv_have_decl_wcwidth" >&6; } -if test $ac_cv_have_decl_wcwidth = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_WCWIDTH 1 -_ACEOF - - -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_WCWIDTH 0 -_ACEOF - - +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_wcwidth_works" >&5 +$as_echo "$gl_cv_func_wcwidth_works" >&6; } + case "$gl_cv_func_wcwidth_works" in + *yes) ;; + *no) REPLACE_WCWIDTH=1 ;; + esac + fi + if test $REPLACE_WCWIDTH = 1; then - { $as_echo "$as_me:$LINENO: checking whether use of TIOCGWINSZ requires sys/ioctl.h" >&5 + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS wcwidth.$ac_objext" + + fi + + if test $REPLACE_WCWIDTH = 1 || test $HAVE_DECL_WCWIDTH = 0; then + + + WCHAR_H=wchar.h + + fi + + + + GNULIB_WCWIDTH=1 + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether use of TIOCGWINSZ requires sys/ioctl.h" >&5 $as_echo_n "checking whether use of TIOCGWINSZ requires sys/ioctl.h... " >&6; } -if test "${jm_cv_sys_tiocgwinsz_needs_sys_ioctl_h+set}" = set; then +if test "${gl_cv_sys_tiocgwinsz_needs_sys_ioctl_h+set}" = set; then : $as_echo_n "(cached) " >&6 else - jm_cv_sys_tiocgwinsz_needs_sys_ioctl_h=no + gl_cv_sys_tiocgwinsz_needs_sys_ioctl_h=no - if test $jm_cv_sys_tiocgwinsz_needs_termios_h = no; then - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + if test $gl_cv_sys_tiocgwinsz_needs_termios_h = no; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include # include @@ -45010,38 +35247,32 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes" >/dev/null 2>&1; then - jm_cv_sys_tiocgwinsz_needs_sys_ioctl_h=yes + $EGREP "yes" >/dev/null 2>&1; then : + gl_cv_sys_tiocgwinsz_needs_sys_ioctl_h=yes fi rm -f conftest* fi fi -{ $as_echo "$as_me:$LINENO: result: $jm_cv_sys_tiocgwinsz_needs_sys_ioctl_h" >&5 -$as_echo "$jm_cv_sys_tiocgwinsz_needs_sys_ioctl_h" >&6; } - if test $jm_cv_sys_tiocgwinsz_needs_sys_ioctl_h = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_tiocgwinsz_needs_sys_ioctl_h" >&5 +$as_echo "$gl_cv_sys_tiocgwinsz_needs_sys_ioctl_h" >&6; } + if test $gl_cv_sys_tiocgwinsz_needs_sys_ioctl_h = yes; then -cat >>confdefs.h <<\_ACEOF -#define GWINSZ_IN_SYS_IOCTL 1 -_ACEOF +$as_echo "#define GWINSZ_IN_SYS_IOCTL 1" >>confdefs.h fi - { $as_echo "$as_me:$LINENO: checking whether use of TIOCGWINSZ requires termios.h" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether use of TIOCGWINSZ requires termios.h" >&5 $as_echo_n "checking whether use of TIOCGWINSZ requires termios.h... " >&6; } -if test "${jm_cv_sys_tiocgwinsz_needs_termios_h+set}" = set; then +if test "${gl_cv_sys_tiocgwinsz_needs_termios_h+set}" = set; then : $as_echo_n "(cached) " >&6 else - jm_cv_sys_tiocgwinsz_needs_termios_h=no + gl_cv_sys_tiocgwinsz_needs_termios_h=no if test $ac_cv_sys_posix_termios = yes; then - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include # include @@ -45051,30 +35282,26 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes" >/dev/null 2>&1; then - jm_cv_sys_tiocgwinsz_needs_termios_h=yes + $EGREP "yes" >/dev/null 2>&1; then : + gl_cv_sys_tiocgwinsz_needs_termios_h=yes fi rm -f conftest* fi fi -{ $as_echo "$as_me:$LINENO: result: $jm_cv_sys_tiocgwinsz_needs_termios_h" >&5 -$as_echo "$jm_cv_sys_tiocgwinsz_needs_termios_h" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_tiocgwinsz_needs_termios_h" >&5 +$as_echo "$gl_cv_sys_tiocgwinsz_needs_termios_h" >&6; } - { $as_echo "$as_me:$LINENO: checking whether use of struct winsize requires sys/ptem.h" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether use of struct winsize requires sys/ptem.h" >&5 $as_echo_n "checking whether use of struct winsize requires sys/ptem.h... " >&6; } -if test "${jm_cv_sys_struct_winsize_needs_sys_ptem_h+set}" = set; then +if test "${gl_cv_sys_struct_winsize_needs_sys_ptem_h+set}" = set; then : $as_echo_n "(cached) " >&6 else - jm_cv_sys_struct_winsize_needs_sys_ptem_h=yes + gl_cv_sys_struct_winsize_needs_sys_ptem_h=yes if test $ac_cv_sys_posix_termios = yes; then - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int @@ -45086,40 +35313,13 @@ struct winsize x; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - jm_cv_sys_struct_winsize_needs_sys_ptem_h=no -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_sys_struct_winsize_needs_sys_ptem_h=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi - if test $jm_cv_sys_struct_winsize_needs_sys_ptem_h = yes; then - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + if test $gl_cv_sys_struct_winsize_needs_sys_ptem_h = yes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int @@ -45131,49 +35331,56 @@ struct winsize x; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - : +if ac_fn_c_try_compile "$LINENO"; then : + else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - jm_cv_sys_struct_winsize_needs_sys_ptem_h=no + gl_cv_sys_struct_winsize_needs_sys_ptem_h=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi -{ $as_echo "$as_me:$LINENO: result: $jm_cv_sys_struct_winsize_needs_sys_ptem_h" >&5 -$as_echo "$jm_cv_sys_struct_winsize_needs_sys_ptem_h" >&6; } - if test $jm_cv_sys_struct_winsize_needs_sys_ptem_h = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_winsize_needs_sys_ptem_h" >&5 +$as_echo "$gl_cv_sys_struct_winsize_needs_sys_ptem_h" >&6; } + if test $gl_cv_sys_struct_winsize_needs_sys_ptem_h = yes; then -cat >>confdefs.h <<\_ACEOF -#define WINSIZE_IN_PTEM 1 -_ACEOF +$as_echo "#define WINSIZE_IN_PTEM 1" >>confdefs.h fi + + + + + + GNULIB_WRITE=1 + + + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS write-any-file.$ac_objext" + + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS xmalloc.$ac_objext" + : @@ -45181,53 +35388,3709 @@ _ACEOF + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS xgetcwd.$ac_objext" + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS xnanosleep.$ac_objext" + + XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=xprintf:1:c-format" + + + + XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=xvprintf:1:c-format" + + + + XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=xfprintf:2:c-format" + + + + XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=xvfprintf:2:c-format" + + + + + for ac_header in stdint.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "stdint.h" "ac_cv_header_stdint_h" "$ac_includes_default" +if test "x$ac_cv_header_stdint_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_STDINT_H 1 +_ACEOF + +fi + +done + + + + : + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS xstrtod.$ac_objext" + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS xstrtol.$ac_objext" + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS xstrtoul.$ac_objext" + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS xstrtol-error.$ac_objext" + + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS xstrtold.$ac_objext" + + + + + + XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=xasprintf:1:c-format" + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS yesno.$ac_objext" + : + + + + + + + + + + gltests_libdeps= + gltests_ltlibdeps= + + + + + + + + + + gl_source_base='gnulib-tests' + + if test "$ac_cv_header_winsock2_h" = yes; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS accept.$ac_objext" + + fi + + + GNULIB_ACCEPT=1 + + + if test "$ac_cv_header_winsock2_h" = yes; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS bind.$ac_objext" + + fi + + + GNULIB_BIND=1 + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5 +$as_echo_n "checking for a traditional french locale... " >&6; } +if test "${gt_cv_locale_fr+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () { + /* Check whether the given locale name is recognized by the system. */ + if (setlocale (LC_ALL, "") == NULL) return 1; + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only + one byte long. This excludes the UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1; + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO-8859-1 + else + # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name. + if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO8859-1 + else + # Test for the HP-UX locale name. + if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.iso88591 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr + else + # None found. + gt_cv_locale_fr=none + fi + fi + fi + fi + fi + fi + rm -fr conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5 +$as_echo "$gt_cv_locale_fr" >&6; } + LOCALE_FR=$gt_cv_locale_fr + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5 +$as_echo_n "checking for a french Unicode locale... " >&6; } +if test "${gt_cv_locale_fr_utf8+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () { + /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl + imitates locale dependent behaviour by looking at the environment + variables, and all locales use the UTF-8 encoding. */ +#if !(defined __BEOS__ || defined __HAIKU__) + /* Check whether the given locale name is recognized by the system. */ + if (setlocale (LC_ALL, "") == NULL) return 1; + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +# if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +# endif +# ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +# endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is + two bytes long, with UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 4 + || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v') + return 1; +#endif + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR.UTF-8 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr.UTF-8 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + fi + fi + fi + rm -fr conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5 +$as_echo "$gt_cv_locale_fr_utf8" >&6; } + LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8 + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5 +$as_echo_n "checking for a traditional french locale... " >&6; } +if test "${gt_cv_locale_fr+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () { + /* Check whether the given locale name is recognized by the system. */ + if (setlocale (LC_ALL, "") == NULL) return 1; + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only + one byte long. This excludes the UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1; + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO-8859-1 + else + # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name. + if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO8859-1 + else + # Test for the HP-UX locale name. + if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.iso88591 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr + else + # None found. + gt_cv_locale_fr=none + fi + fi + fi + fi + fi + fi + rm -fr conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5 +$as_echo "$gt_cv_locale_fr" >&6; } + LOCALE_FR=$gt_cv_locale_fr + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a turkish Unicode locale" >&5 +$as_echo_n "checking for a turkish Unicode locale... " >&6; } +if test "${gt_cv_locale_tr_utf8+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () { + /* On BeOS, locales are not implemented in libc. Rather, libintl + imitates locale dependent behaviour by looking at the environment + variables, and all locales use the UTF-8 encoding. But BeOS does not + implement the Turkish upper-/lowercase mappings. Therefore, let this + program return 1 on BeOS. */ + /* Check whether the given locale name is recognized by the system. */ + if (setlocale (LC_ALL, "") == NULL) return 1; + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On MacOS X 10.3.5 (Darwin 7.5) in the tr_TR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in the abbreviation of the eighth month, the second + character (should be U+011F: LATIN SMALL LETTER G WITH BREVE) is + two bytes long, with UTF-8 encoding. */ + t.tm_year = 1992 - 1900; t.tm_mon = 8 - 1; t.tm_mday = 19; + if (strftime (buf, sizeof (buf), "%b", &t) < 4 + || buf[1] != (char) 0xc4 || buf[2] != (char) 0x9f) + return 1; + /* Check whether the upper-/lowercase mappings are as expected for + Turkish. */ + if (towupper ('i') != 0x0130 || towlower (0x0130) != 'i' + || towupper(0x0131) != 'I' || towlower ('I') != 0x0131) + return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=tr_TR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_tr_utf8=tr_TR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=tr_TR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_tr_utf8=tr_TR.UTF-8 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=tr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_tr_utf8=tr.UTF-8 + else + # None found. + gt_cv_locale_tr_utf8=none + fi + fi + fi + else + gt_cv_locale_tr_utf8=none + fi + rm -fr conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_tr_utf8" >&5 +$as_echo "$gt_cv_locale_tr_utf8" >&6; } + LOCALE_TR_UTF8=$gt_cv_locale_tr_utf8 + + + + if test "$ac_cv_header_winsock2_h" = yes; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS connect.$ac_objext" + + fi + + + GNULIB_CONNECT=1 + + + + + + + + + ARPA_INET_H='arpa/inet.h' + + + + + + + + + + + for ac_func in inet_pton +do : + ac_fn_c_check_func "$LINENO" "inet_pton" "ac_cv_func_inet_pton" +if test "x$ac_cv_func_inet_pton" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_INET_PTON 1 +_ACEOF + +else + + gltests_LIBOBJS="$gltests_LIBOBJS $ac_func.$ac_objext" + +fi +done + + + + ac_fn_c_check_decl "$LINENO" "inet_pton" "ac_cv_have_decl_inet_pton" "#include +" +if test "x$ac_cv_have_decl_inet_pton" = x""yes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_INET_PTON $ac_have_decl +_ACEOF + + if test $ac_cv_have_decl_inet_pton = no; then + HAVE_DECL_INET_PTON=0 + fi + + + + + + + GNULIB_INET_PTON=1 + + + if test "$ac_cv_header_winsock2_h" = yes; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS ioctl.$ac_objext" + + + + SYS_IOCTL_H='sys/ioctl.h' + + fi + + + GNULIB_IOCTL=1 + + + +$as_echo "#define GNULIB_IOCTL 1" >>confdefs.h + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the exponent in a 'double'" >&5 +$as_echo_n "checking where to find the exponent in a 'double'... " >&6; } +if test "${gl_cv_cc_double_expbit0+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#if defined arm || defined __arm || defined __arm__ + mixed_endianness +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "mixed_endianness" >/dev/null 2>&1; then : + gl_cv_cc_double_expbit0="unknown" +else + + : +if test "${ac_cv_c_bigendian+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_c_bigendian=unknown + # See if we're dealing with a universal compiler. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __APPLE_CC__ + not a universal capable compiler + #endif + typedef int dummy; + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + # Check for potential -arch flags. It is not universal unless + # there are at least two -arch flags with different values. + ac_arch= + ac_prev= + for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do + if test -n "$ac_prev"; then + case $ac_word in + i?86 | x86_64 | ppc | ppc64) + if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then + ac_arch=$ac_word + else + ac_cv_c_bigendian=universal + break + fi + ;; + esac + ac_prev= + elif test "x$ac_word" = "x-arch"; then + ac_prev=arch + fi + done +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if test $ac_cv_c_bigendian = unknown; then + # See if sys/param.h defines the BYTE_ORDER macro. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + +int +main () +{ +#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ + && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ + && LITTLE_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + # It does; now see whether it defined to BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + +int +main () +{ +#if BYTE_ORDER != BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_bigendian=yes +else + ac_cv_c_bigendian=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main () +{ +#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + # It does; now see whether it defined to _BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main () +{ +#ifndef _BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_bigendian=yes +else + ac_cv_c_bigendian=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # Compile a test program. + if test "$cross_compiling" = yes; then : + # Try to guess by grepping values from an object file. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +short int ascii_mm[] = + { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; + short int ascii_ii[] = + { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; + int use_ascii (int i) { + return ascii_mm[i] + ascii_ii[i]; + } + short int ebcdic_ii[] = + { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; + short int ebcdic_mm[] = + { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; + int use_ebcdic (int i) { + return ebcdic_mm[i] + ebcdic_ii[i]; + } + extern int foo; + +int +main () +{ +return use_ascii (foo) == use_ebcdic (foo); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then + ac_cv_c_bigendian=yes + fi + if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then + if test "$ac_cv_c_bigendian" = unknown; then + ac_cv_c_bigendian=no + else + # finding both strings is unlikely to happen, but who knows? + ac_cv_c_bigendian=unknown + fi + fi +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ + + /* Are we little or big endian? From Harbison&Steele. */ + union + { + long int l; + char c[sizeof (long int)]; + } u; + u.l = 1; + return u.c[sizeof (long int) - 1] == 1; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_c_bigendian=no +else + ac_cv_c_bigendian=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi + + fi +fi +: + case $ac_cv_c_bigendian in #( + yes) + gl_cv_cc_double_expbit0="word 0 bit 20";; #( + no) + gl_cv_cc_double_expbit0="word 1 bit 20" ;; #( + universal) + +$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h + + ;; #( + *) + gl_cv_cc_double_expbit0="unknown" ;; + esac + + +fi +rm -f conftest* + + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +#include +#define NWORDS \ + ((sizeof (double) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) +typedef union { double value; unsigned int word[NWORDS]; } memory_double; +static unsigned int ored_words[NWORDS]; +static unsigned int anded_words[NWORDS]; +static void add_to_ored_words (double x) +{ + memory_double m; + size_t i; + /* Clear it first, in case sizeof (double) < sizeof (memory_double). */ + memset (&m, 0, sizeof (memory_double)); + m.value = x; + for (i = 0; i < NWORDS; i++) + { + ored_words[i] |= m.word[i]; + anded_words[i] &= m.word[i]; + } +} +int main () +{ + size_t j; + FILE *fp = fopen ("conftest.out", "w"); + if (fp == NULL) + return 1; + for (j = 0; j < NWORDS; j++) + anded_words[j] = ~ (unsigned int) 0; + add_to_ored_words (0.25); + add_to_ored_words (0.5); + add_to_ored_words (1.0); + add_to_ored_words (2.0); + add_to_ored_words (4.0); + /* Remove bits that are common (e.g. if representation of the first mantissa + bit is explicit). */ + for (j = 0; j < NWORDS; j++) + ored_words[j] &= ~anded_words[j]; + /* Now find the nonzero word. */ + for (j = 0; j < NWORDS; j++) + if (ored_words[j] != 0) + break; + if (j < NWORDS) + { + size_t i; + for (i = j + 1; i < NWORDS; i++) + if (ored_words[i] != 0) + { + fprintf (fp, "unknown"); + return (fclose (fp) != 0); + } + for (i = 0; ; i++) + if ((ored_words[j] >> i) & 1) + { + fprintf (fp, "word %d bit %d", (int) j, (int) i); + return (fclose (fp) != 0); + } + } + fprintf (fp, "unknown"); + return (fclose (fp) != 0); +} + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_cc_double_expbit0=`cat conftest.out` +else + gl_cv_cc_double_expbit0="unknown" +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi + + rm -f conftest.out + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_double_expbit0" >&5 +$as_echo "$gl_cv_cc_double_expbit0" >&6; } + case "$gl_cv_cc_double_expbit0" in + word*bit*) + word=`echo "$gl_cv_cc_double_expbit0" | sed -e 's/word //' -e 's/ bit.*//'` + bit=`echo "$gl_cv_cc_double_expbit0" | sed -e 's/word.*bit //'` + +cat >>confdefs.h <<_ACEOF +#define DBL_EXPBIT0_WORD $word +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define DBL_EXPBIT0_BIT $bit +_ACEOF + + ;; + esac + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the exponent in a 'float'" >&5 +$as_echo_n "checking where to find the exponent in a 'float'... " >&6; } +if test "${gl_cv_cc_float_expbit0+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + gl_cv_cc_float_expbit0="word 0 bit 23" +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +#include +#define NWORDS \ + ((sizeof (float) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) +typedef union { float value; unsigned int word[NWORDS]; } memory_float; +static unsigned int ored_words[NWORDS]; +static unsigned int anded_words[NWORDS]; +static void add_to_ored_words (float x) +{ + memory_float m; + size_t i; + /* Clear it first, in case + sizeof (float) < sizeof (memory_float). */ + memset (&m, 0, sizeof (memory_float)); + m.value = x; + for (i = 0; i < NWORDS; i++) + { + ored_words[i] |= m.word[i]; + anded_words[i] &= m.word[i]; + } +} +int main () +{ + size_t j; + FILE *fp = fopen ("conftest.out", "w"); + if (fp == NULL) + return 1; + for (j = 0; j < NWORDS; j++) + anded_words[j] = ~ (unsigned int) 0; + add_to_ored_words (0.25f); + add_to_ored_words (0.5f); + add_to_ored_words (1.0f); + add_to_ored_words (2.0f); + add_to_ored_words (4.0f); + /* Remove bits that are common (e.g. if representation of the first mantissa + bit is explicit). */ + for (j = 0; j < NWORDS; j++) + ored_words[j] &= ~anded_words[j]; + /* Now find the nonzero word. */ + for (j = 0; j < NWORDS; j++) + if (ored_words[j] != 0) + break; + if (j < NWORDS) + { + size_t i; + for (i = j + 1; i < NWORDS; i++) + if (ored_words[i] != 0) + { + fprintf (fp, "unknown"); + return (fclose (fp) != 0); + } + for (i = 0; ; i++) + if ((ored_words[j] >> i) & 1) + { + fprintf (fp, "word %d bit %d", (int) j, (int) i); + return (fclose (fp) != 0); + } + } + fprintf (fp, "unknown"); + return (fclose (fp) != 0); +} + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_cc_float_expbit0=`cat conftest.out` +else + gl_cv_cc_float_expbit0="unknown" +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi + + rm -f conftest.out + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_float_expbit0" >&5 +$as_echo "$gl_cv_cc_float_expbit0" >&6; } + case "$gl_cv_cc_float_expbit0" in + word*bit*) + word=`echo "$gl_cv_cc_float_expbit0" | sed -e 's/word //' -e 's/ bit.*//'` + bit=`echo "$gl_cv_cc_float_expbit0" | sed -e 's/word.*bit //'` + +cat >>confdefs.h <<_ACEOF +#define FLT_EXPBIT0_WORD $word +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define FLT_EXPBIT0_BIT $bit +_ACEOF + + ;; + esac + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the exponent in a 'long double'" >&5 +$as_echo_n "checking where to find the exponent in a 'long double'... " >&6; } +if test "${gl_cv_cc_long_double_expbit0+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + + gl_cv_cc_long_double_expbit0="unknown" + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +#include +#define NWORDS \ + ((sizeof (long double) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) +typedef union { long double value; unsigned int word[NWORDS]; } + memory_long_double; +static unsigned int ored_words[NWORDS]; +static unsigned int anded_words[NWORDS]; +static void add_to_ored_words (long double x) +{ + memory_long_double m; + size_t i; + /* Clear it first, in case + sizeof (long double) < sizeof (memory_long_double). */ + memset (&m, 0, sizeof (memory_long_double)); + m.value = x; + for (i = 0; i < NWORDS; i++) + { + ored_words[i] |= m.word[i]; + anded_words[i] &= m.word[i]; + } +} +int main () +{ + size_t j; + FILE *fp = fopen ("conftest.out", "w"); + if (fp == NULL) + return 1; + for (j = 0; j < NWORDS; j++) + anded_words[j] = ~ (unsigned int) 0; + add_to_ored_words (0.25L); + add_to_ored_words (0.5L); + add_to_ored_words (1.0L); + add_to_ored_words (2.0L); + add_to_ored_words (4.0L); + /* Remove bits that are common (e.g. if representation of the first mantissa + bit is explicit). */ + for (j = 0; j < NWORDS; j++) + ored_words[j] &= ~anded_words[j]; + /* Now find the nonzero word. */ + for (j = 0; j < NWORDS; j++) + if (ored_words[j] != 0) + break; + if (j < NWORDS) + { + size_t i; + for (i = j + 1; i < NWORDS; i++) + if (ored_words[i] != 0) + { + fprintf (fp, "unknown"); + return (fclose (fp) != 0); + } + for (i = 0; ; i++) + if ((ored_words[j] >> i) & 1) + { + fprintf (fp, "word %d bit %d", (int) j, (int) i); + return (fclose (fp) != 0); + } + } + fprintf (fp, "unknown"); + return (fclose (fp) != 0); +} + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_cc_long_double_expbit0=`cat conftest.out` +else + gl_cv_cc_long_double_expbit0="unknown" +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi + + rm -f conftest.out + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_long_double_expbit0" >&5 +$as_echo "$gl_cv_cc_long_double_expbit0" >&6; } + case "$gl_cv_cc_long_double_expbit0" in + word*bit*) + word=`echo "$gl_cv_cc_long_double_expbit0" | sed -e 's/word //' -e 's/ bit.*//'` + bit=`echo "$gl_cv_cc_long_double_expbit0" | sed -e 's/word.*bit //'` + +cat >>confdefs.h <<_ACEOF +#define LDBL_EXPBIT0_WORD $word +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define LDBL_EXPBIT0_BIT $bit +_ACEOF + + ;; + esac + + + if test "$ac_cv_header_winsock2_h" = yes; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS listen.$ac_objext" + + fi + + + GNULIB_LISTEN=1 + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5 +$as_echo_n "checking for a traditional french locale... " >&6; } +if test "${gt_cv_locale_fr+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () { + /* Check whether the given locale name is recognized by the system. */ + if (setlocale (LC_ALL, "") == NULL) return 1; + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only + one byte long. This excludes the UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1; + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO-8859-1 + else + # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name. + if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO8859-1 + else + # Test for the HP-UX locale name. + if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.iso88591 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr + else + # None found. + gt_cv_locale_fr=none + fi + fi + fi + fi + fi + fi + rm -fr conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5 +$as_echo "$gt_cv_locale_fr" >&6; } + LOCALE_FR=$gt_cv_locale_fr + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5 +$as_echo_n "checking for a french Unicode locale... " >&6; } +if test "${gt_cv_locale_fr_utf8+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () { + /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl + imitates locale dependent behaviour by looking at the environment + variables, and all locales use the UTF-8 encoding. */ +#if !(defined __BEOS__ || defined __HAIKU__) + /* Check whether the given locale name is recognized by the system. */ + if (setlocale (LC_ALL, "") == NULL) return 1; + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +# if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +# endif +# ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +# endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is + two bytes long, with UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 4 + || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v') + return 1; +#endif + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR.UTF-8 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr.UTF-8 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + fi + fi + fi + rm -fr conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5 +$as_echo "$gt_cv_locale_fr_utf8" >&6; } + LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8 + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a traditional japanese locale" >&5 +$as_echo_n "checking for a traditional japanese locale... " >&6; } +if test "${gt_cv_locale_ja+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () +{ + const char *p; + /* Check whether the given locale name is recognized by the system. */ + if (setlocale (LC_ALL, "") == NULL) return 1; + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether MB_CUR_MAX is > 1. This excludes the dysfunctional locales + on Cygwin 1.5.x. */ + if (MB_CUR_MAX == 1) + return 1; + /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. + This excludes the UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; + for (p = buf; *p != '\0'; p++) + if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) + return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the AIX locale name. + if (LC_ALL=ja_JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=ja_JP.EUC-JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.EUC-JP + else + # Test for the HP-UX, OSF/1, NetBSD locale name. + if (LC_ALL=ja_JP.eucJP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.eucJP + else + # Test for the IRIX, FreeBSD locale name. + if (LC_ALL=ja_JP.EUC LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.EUC + else + # Test for the Solaris 7 locale name. + if (LC_ALL=ja LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja + else + # Special test for NetBSD 1.6. + if test -f /usr/share/locale/ja_JP.eucJP/LC_CTYPE; then + gt_cv_locale_ja=ja_JP.eucJP + else + # None found. + gt_cv_locale_ja=none + fi + fi + fi + fi + fi + fi + fi + rm -fr conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_ja" >&5 +$as_echo "$gt_cv_locale_ja" >&6; } + LOCALE_JA=$gt_cv_locale_ja + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a transitional chinese locale" >&5 +$as_echo_n "checking for a transitional chinese locale... " >&6; } +if test "${gt_cv_locale_zh_CN+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () +{ + const char *p; + /* Check whether the given locale name is recognized by the system. */ + if (setlocale (LC_ALL, "") == NULL) return 1; + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. + This excludes the UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; + for (p = buf; *p != '\0'; p++) + if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) + return 1; + /* Check whether a typical GB18030 multibyte sequence is recognized as a + single wide character. This excludes the GB2312 and GBK encodings. */ + if (mblen ("\203\062\332\066", 5) != 4) + return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the locale name without encoding suffix. + if (LC_ALL=zh_CN LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=zh_CN + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=zh_CN.GB18030 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=zh_CN.GB18030 + else + # None found. + gt_cv_locale_zh_CN=none + fi + fi + else + # If there was a link error, due to mblen(), the system is so old that + # it certainly doesn't have a chinese locale. + gt_cv_locale_zh_CN=none + fi + rm -fr conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_zh_CN" >&5 +$as_echo "$gt_cv_locale_zh_CN" >&6; } + LOCALE_ZH_CN=$gt_cv_locale_zh_CN + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a turkish Unicode locale" >&5 +$as_echo_n "checking for a turkish Unicode locale... " >&6; } +if test "${gt_cv_locale_tr_utf8+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () { + /* On BeOS, locales are not implemented in libc. Rather, libintl + imitates locale dependent behaviour by looking at the environment + variables, and all locales use the UTF-8 encoding. But BeOS does not + implement the Turkish upper-/lowercase mappings. Therefore, let this + program return 1 on BeOS. */ + /* Check whether the given locale name is recognized by the system. */ + if (setlocale (LC_ALL, "") == NULL) return 1; + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On MacOS X 10.3.5 (Darwin 7.5) in the tr_TR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in the abbreviation of the eighth month, the second + character (should be U+011F: LATIN SMALL LETTER G WITH BREVE) is + two bytes long, with UTF-8 encoding. */ + t.tm_year = 1992 - 1900; t.tm_mon = 8 - 1; t.tm_mday = 19; + if (strftime (buf, sizeof (buf), "%b", &t) < 4 + || buf[1] != (char) 0xc4 || buf[2] != (char) 0x9f) + return 1; + /* Check whether the upper-/lowercase mappings are as expected for + Turkish. */ + if (towupper ('i') != 0x0130 || towlower (0x0130) != 'i' + || towupper(0x0131) != 'I' || towlower ('I') != 0x0131) + return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=tr_TR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_tr_utf8=tr_TR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=tr_TR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_tr_utf8=tr_TR.UTF-8 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=tr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_tr_utf8=tr.UTF-8 + else + # None found. + gt_cv_locale_tr_utf8=none + fi + fi + fi + else + gt_cv_locale_tr_utf8=none + fi + rm -fr conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_tr_utf8" >&5 +$as_echo "$gt_cv_locale_tr_utf8" >&6; } + LOCALE_TR_UTF8=$gt_cv_locale_tr_utf8 + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5 +$as_echo_n "checking for a french Unicode locale... " >&6; } +if test "${gt_cv_locale_fr_utf8+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () { + /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl + imitates locale dependent behaviour by looking at the environment + variables, and all locales use the UTF-8 encoding. */ +#if !(defined __BEOS__ || defined __HAIKU__) + /* Check whether the given locale name is recognized by the system. */ + if (setlocale (LC_ALL, "") == NULL) return 1; + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +# if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +# endif +# ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +# endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is + two bytes long, with UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 4 + || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v') + return 1; +#endif + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR.UTF-8 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr.UTF-8 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + fi + fi + fi + rm -fr conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5 +$as_echo "$gt_cv_locale_fr_utf8" >&6; } + LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8 + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5 +$as_echo_n "checking for a traditional french locale... " >&6; } +if test "${gt_cv_locale_fr+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () { + /* Check whether the given locale name is recognized by the system. */ + if (setlocale (LC_ALL, "") == NULL) return 1; + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only + one byte long. This excludes the UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1; + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO-8859-1 + else + # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name. + if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO8859-1 + else + # Test for the HP-UX locale name. + if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.iso88591 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr + else + # None found. + gt_cv_locale_fr=none + fi + fi + fi + fi + fi + fi + rm -fr conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5 +$as_echo "$gt_cv_locale_fr" >&6; } + LOCALE_FR=$gt_cv_locale_fr + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5 +$as_echo_n "checking for a french Unicode locale... " >&6; } +if test "${gt_cv_locale_fr_utf8+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () { + /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl + imitates locale dependent behaviour by looking at the environment + variables, and all locales use the UTF-8 encoding. */ +#if !(defined __BEOS__ || defined __HAIKU__) + /* Check whether the given locale name is recognized by the system. */ + if (setlocale (LC_ALL, "") == NULL) return 1; + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +# if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +# endif +# ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +# endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is + two bytes long, with UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 4 + || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v') + return 1; +#endif + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR.UTF-8 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr.UTF-8 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + fi + fi + fi + rm -fr conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5 +$as_echo "$gt_cv_locale_fr_utf8" >&6; } + LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8 + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a traditional japanese locale" >&5 +$as_echo_n "checking for a traditional japanese locale... " >&6; } +if test "${gt_cv_locale_ja+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () +{ + const char *p; + /* Check whether the given locale name is recognized by the system. */ + if (setlocale (LC_ALL, "") == NULL) return 1; + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether MB_CUR_MAX is > 1. This excludes the dysfunctional locales + on Cygwin 1.5.x. */ + if (MB_CUR_MAX == 1) + return 1; + /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. + This excludes the UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; + for (p = buf; *p != '\0'; p++) + if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) + return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the AIX locale name. + if (LC_ALL=ja_JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=ja_JP.EUC-JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.EUC-JP + else + # Test for the HP-UX, OSF/1, NetBSD locale name. + if (LC_ALL=ja_JP.eucJP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.eucJP + else + # Test for the IRIX, FreeBSD locale name. + if (LC_ALL=ja_JP.EUC LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.EUC + else + # Test for the Solaris 7 locale name. + if (LC_ALL=ja LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja + else + # Special test for NetBSD 1.6. + if test -f /usr/share/locale/ja_JP.eucJP/LC_CTYPE; then + gt_cv_locale_ja=ja_JP.eucJP + else + # None found. + gt_cv_locale_ja=none + fi + fi + fi + fi + fi + fi + fi + rm -fr conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_ja" >&5 +$as_echo "$gt_cv_locale_ja" >&6; } + LOCALE_JA=$gt_cv_locale_ja + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a transitional chinese locale" >&5 +$as_echo_n "checking for a transitional chinese locale... " >&6; } +if test "${gt_cv_locale_zh_CN+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () +{ + const char *p; + /* Check whether the given locale name is recognized by the system. */ + if (setlocale (LC_ALL, "") == NULL) return 1; + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. + This excludes the UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; + for (p = buf; *p != '\0'; p++) + if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) + return 1; + /* Check whether a typical GB18030 multibyte sequence is recognized as a + single wide character. This excludes the GB2312 and GBK encodings. */ + if (mblen ("\203\062\332\066", 5) != 4) + return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the locale name without encoding suffix. + if (LC_ALL=zh_CN LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=zh_CN + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=zh_CN.GB18030 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=zh_CN.GB18030 + else + # None found. + gt_cv_locale_zh_CN=none + fi + fi + else + # If there was a link error, due to mblen(), the system is so old that + # it certainly doesn't have a chinese locale. + gt_cv_locale_zh_CN=none + fi + rm -fr conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_zh_CN" >&5 +$as_echo "$gt_cv_locale_zh_CN" >&6; } + LOCALE_ZH_CN=$gt_cv_locale_zh_CN + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5 +$as_echo_n "checking for a french Unicode locale... " >&6; } +if test "${gt_cv_locale_fr_utf8+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () { + /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl + imitates locale dependent behaviour by looking at the environment + variables, and all locales use the UTF-8 encoding. */ +#if !(defined __BEOS__ || defined __HAIKU__) + /* Check whether the given locale name is recognized by the system. */ + if (setlocale (LC_ALL, "") == NULL) return 1; + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +# if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +# endif +# ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +# endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is + two bytes long, with UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 4 + || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v') + return 1; +#endif + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR.UTF-8 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr.UTF-8 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + fi + fi + fi + rm -fr conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5 +$as_echo "$gt_cv_locale_fr_utf8" >&6; } + LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8 + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a transitional chinese locale" >&5 +$as_echo_n "checking for a transitional chinese locale... " >&6; } +if test "${gt_cv_locale_zh_CN+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () +{ + const char *p; + /* Check whether the given locale name is recognized by the system. */ + if (setlocale (LC_ALL, "") == NULL) return 1; + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. + This excludes the UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; + for (p = buf; *p != '\0'; p++) + if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) + return 1; + /* Check whether a typical GB18030 multibyte sequence is recognized as a + single wide character. This excludes the GB2312 and GBK encodings. */ + if (mblen ("\203\062\332\066", 5) != 4) + return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the locale name without encoding suffix. + if (LC_ALL=zh_CN LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=zh_CN + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=zh_CN.GB18030 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=zh_CN.GB18030 + else + # None found. + gt_cv_locale_zh_CN=none + fi + fi + else + # If there was a link error, due to mblen(), the system is so old that + # it certainly doesn't have a chinese locale. + gt_cv_locale_zh_CN=none + fi + rm -fr conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_zh_CN" >&5 +$as_echo "$gt_cv_locale_zh_CN" >&6; } + LOCALE_ZH_CN=$gt_cv_locale_zh_CN + + + + + + if test -n "$ERRNO_H"; then + REPLACE_PERROR=1 + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS perror.$ac_objext" + + fi + + + + GNULIB_PERROR=1 + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5 +$as_echo_n "checking for a traditional french locale... " >&6; } +if test "${gt_cv_locale_fr+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () { + /* Check whether the given locale name is recognized by the system. */ + if (setlocale (LC_ALL, "") == NULL) return 1; + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only + one byte long. This excludes the UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1; + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO-8859-1 + else + # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name. + if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO8859-1 + else + # Test for the HP-UX locale name. + if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.iso88591 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr + else + # None found. + gt_cv_locale_fr=none + fi + fi + fi + fi + fi + fi + rm -fr conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5 +$as_echo "$gt_cv_locale_fr" >&6; } + LOCALE_FR=$gt_cv_locale_fr + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5 +$as_echo_n "checking for a french Unicode locale... " >&6; } +if test "${gt_cv_locale_fr_utf8+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () { + /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl + imitates locale dependent behaviour by looking at the environment + variables, and all locales use the UTF-8 encoding. */ +#if !(defined __BEOS__ || defined __HAIKU__) + /* Check whether the given locale name is recognized by the system. */ + if (setlocale (LC_ALL, "") == NULL) return 1; + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +# if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +# endif +# ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +# endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is + two bytes long, with UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 4 + || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v') + return 1; +#endif + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR.UTF-8 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr.UTF-8 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + fi + fi + fi + rm -fr conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5 +$as_echo "$gt_cv_locale_fr_utf8" >&6; } + LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8 + + + + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS read-file.$ac_objext" + + : + + + + if test "$ac_cv_header_winsock2_h" = yes; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS setsockopt.$ac_objext" + + fi + + + GNULIB_SETSOCKOPT=1 + + + + + + + ac_fn_c_check_decl "$LINENO" "sleep" "ac_cv_have_decl_sleep" "#include +" +if test "x$ac_cv_have_decl_sleep" = x""yes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_SLEEP $ac_have_decl +_ACEOF + + if test $ac_cv_have_decl_sleep != yes; then + HAVE_SLEEP=0 + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS sleep.$ac_objext" + + : + fi + + + + GNULIB_SLEEP=1 + + + if test "$ac_cv_header_winsock2_h" = yes; then + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS socket.$ac_objext" + + fi + + + GNULIB_SOCKET=1 + + + + + + + + + if test $ac_cv_header_sys_socket_h != yes; then + for ac_header in winsock2.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default" +if test "x$ac_cv_header_winsock2_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_WINSOCK2_H 1 +_ACEOF + +fi + +done + + fi + if test "$ac_cv_header_winsock2_h" = yes; then + HAVE_WINSOCK2_H=1 + UNISTD_H_HAVE_WINSOCK2_H=1 + SYS_IOCTL_H_HAVE_WINSOCK2_H=1 + else + HAVE_WINSOCK2_H=0 + fi + + LIBSOCKET= + if test $HAVE_WINSOCK2_H = 1; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we need to call WSAStartup in winsock2.h and -lws2_32" >&5 +$as_echo_n "checking if we need to call WSAStartup in winsock2.h and -lws2_32... " >&6; } +if test "${gl_cv_func_wsastartup+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + gl_save_LIBS="$LIBS" + LIBS="$LIBS -lws2_32" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifdef HAVE_WINSOCK2_H +# include +#endif +int +main () +{ + + WORD wVersionRequested = MAKEWORD(1, 1); + WSADATA wsaData; + int err = WSAStartup(wVersionRequested, &wsaData); + WSACleanup (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_func_wsastartup=yes +else + gl_cv_func_wsastartup=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$gl_save_LIBS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_wsastartup" >&5 +$as_echo "$gl_cv_func_wsastartup" >&6; } + if test "$gl_cv_func_wsastartup" = "yes"; then + +$as_echo "#define WINDOWS_SOCKETS 1" >>confdefs.h + + LIBSOCKET='-lws2_32' + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing setsockopt" >&5 +$as_echo_n "checking for library containing setsockopt... " >&6; } +if test "${gl_cv_lib_socket+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + gl_cv_lib_socket= + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +extern +#ifdef __cplusplus +"C" +#endif +char setsockopt(); +int +main () +{ +setsockopt(); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + +else + gl_save_LIBS="$LIBS" + LIBS="$gl_save_LIBS -lsocket" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +extern +#ifdef __cplusplus +"C" +#endif +char setsockopt(); +int +main () +{ +setsockopt(); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_lib_socket="-lsocket" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$gl_cv_lib_socket"; then + LIBS="$gl_save_LIBS -lnetwork" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +extern +#ifdef __cplusplus +"C" +#endif +char setsockopt(); +int +main () +{ +setsockopt(); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_lib_socket="-lnetwork" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$gl_cv_lib_socket"; then + LIBS="$gl_save_LIBS -lnet" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +extern +#ifdef __cplusplus +"C" +#endif +char setsockopt(); +int +main () +{ +setsockopt(); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_lib_socket="-lnet" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + fi + fi + LIBS="$gl_save_LIBS" + +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$gl_cv_lib_socket"; then + gl_cv_lib_socket="none needed" + fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_lib_socket" >&5 +$as_echo "$gl_cv_lib_socket" >&6; } + if test "$gl_cv_lib_socket" != "none needed"; then + LIBSOCKET="$gl_cv_lib_socket" + fi + fi + + + : + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wchar_t" >&5 +$as_echo_n "checking for wchar_t... " >&6; } +if test "${gt_cv_c_wchar_t+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + wchar_t foo = (wchar_t)'\0'; +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gt_cv_c_wchar_t=yes +else + gt_cv_c_wchar_t=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_c_wchar_t" >&5 +$as_echo "$gt_cv_c_wchar_t" >&6; } + if test $gt_cv_c_wchar_t = yes; then + +$as_echo "#define HAVE_WCHAR_T 1" >>confdefs.h + + fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wint_t" >&5 +$as_echo_n "checking for wint_t... " >&6; } +if test "${gt_cv_c_wint_t+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be included + before . */ +#include +#include +#include +#include + wint_t foo = (wchar_t)'\0'; +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gt_cv_c_wint_t=yes +else + gt_cv_c_wint_t=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_c_wint_t" >&5 +$as_echo "$gt_cv_c_wint_t" >&6; } + if test $gt_cv_c_wint_t = yes; then + +$as_echo "#define HAVE_WINT_T 1" >>confdefs.h + + fi + + + + + + if test $ac_cv_header_sys_ioctl_h = yes; then + HAVE_SYS_IOCTL_H=1 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether declares ioctl" >&5 +$as_echo_n "checking whether declares ioctl... " >&6; } +if test "${gl_cv_decl_ioctl_in_sys_ioctl_h+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main () +{ +(void) ioctl; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_decl_ioctl_in_sys_ioctl_h=yes +else + gl_cv_decl_ioctl_in_sys_ioctl_h=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_decl_ioctl_in_sys_ioctl_h" >&5 +$as_echo "$gl_cv_decl_ioctl_in_sys_ioctl_h" >&6; } + if test $gl_cv_decl_ioctl_in_sys_ioctl_h != yes; then + SYS_IOCTL_H='sys/ioctl.h' + fi + else + HAVE_SYS_IOCTL_H=0 + SYS_IOCTL_H='sys/ioctl.h' + fi + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_sys_ioctl_h='<'sys/ioctl.h'>' + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +$as_echo_n "checking absolute name of ... " >&6; } +if test "${gl_cv_next_sys_ioctl_h+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + if test $ac_cv_header_sys_ioctl_h = yes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + gl_cv_next_sys_ioctl_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n '\#/sys/ioctl.h#{ + s#.*"\(.*/sys/ioctl.h\)".*#\1# + s#^/[^/]#//&# + p + q + }'`'"' + else + gl_cv_next_sys_ioctl_h='<'sys/ioctl.h'>' + fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_ioctl_h" >&5 +$as_echo "$gl_cv_next_sys_ioctl_h" >&6; } + fi + NEXT_SYS_IOCTL_H=$gl_cv_next_sys_ioctl_h + + + + + + for ac_func in shutdown +do : + ac_fn_c_check_func "$LINENO" "shutdown" "ac_cv_func_shutdown" +if test "x$ac_cv_func_shutdown" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SHUTDOWN 1 +_ACEOF + +fi +done + + abs_aux_dir=`cd "$ac_aux_dir"; pwd` + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5 +$as_echo_n "checking for a traditional french locale... " >&6; } +if test "${gt_cv_locale_fr+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () { + /* Check whether the given locale name is recognized by the system. */ + if (setlocale (LC_ALL, "") == NULL) return 1; + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only + one byte long. This excludes the UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1; + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO-8859-1 + else + # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name. + if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO8859-1 + else + # Test for the HP-UX locale name. + if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.iso88591 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr + else + # None found. + gt_cv_locale_fr=none + fi + fi + fi + fi + fi + fi + rm -fr conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5 +$as_echo "$gt_cv_locale_fr" >&6; } + LOCALE_FR=$gt_cv_locale_fr + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5 +$as_echo_n "checking for a french Unicode locale... " >&6; } +if test "${gt_cv_locale_fr_utf8+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () { + /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl + imitates locale dependent behaviour by looking at the environment + variables, and all locales use the UTF-8 encoding. */ +#if !(defined __BEOS__ || defined __HAIKU__) + /* Check whether the given locale name is recognized by the system. */ + if (setlocale (LC_ALL, "") == NULL) return 1; + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +# if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +# endif +# ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +# endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is + two bytes long, with UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 4 + || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v') + return 1; +#endif + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR.UTF-8 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr.UTF-8 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + fi + fi + fi + rm -fr conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5 +$as_echo "$gt_cv_locale_fr_utf8" >&6; } + LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8 + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a traditional japanese locale" >&5 +$as_echo_n "checking for a traditional japanese locale... " >&6; } +if test "${gt_cv_locale_ja+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () +{ + const char *p; + /* Check whether the given locale name is recognized by the system. */ + if (setlocale (LC_ALL, "") == NULL) return 1; + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether MB_CUR_MAX is > 1. This excludes the dysfunctional locales + on Cygwin 1.5.x. */ + if (MB_CUR_MAX == 1) + return 1; + /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. + This excludes the UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; + for (p = buf; *p != '\0'; p++) + if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) + return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the AIX locale name. + if (LC_ALL=ja_JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=ja_JP.EUC-JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.EUC-JP + else + # Test for the HP-UX, OSF/1, NetBSD locale name. + if (LC_ALL=ja_JP.eucJP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.eucJP + else + # Test for the IRIX, FreeBSD locale name. + if (LC_ALL=ja_JP.EUC LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.EUC + else + # Test for the Solaris 7 locale name. + if (LC_ALL=ja LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja + else + # Special test for NetBSD 1.6. + if test -f /usr/share/locale/ja_JP.eucJP/LC_CTYPE; then + gt_cv_locale_ja=ja_JP.eucJP + else + # None found. + gt_cv_locale_ja=none + fi + fi + fi + fi + fi + fi + fi + rm -fr conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_ja" >&5 +$as_echo "$gt_cv_locale_ja" >&6; } + LOCALE_JA=$gt_cv_locale_ja + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a transitional chinese locale" >&5 +$as_echo_n "checking for a transitional chinese locale... " >&6; } +if test "${gt_cv_locale_zh_CN+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () +{ + const char *p; + /* Check whether the given locale name is recognized by the system. */ + if (setlocale (LC_ALL, "") == NULL) return 1; + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. + This excludes the UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; + for (p = buf; *p != '\0'; p++) + if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) + return 1; + /* Check whether a typical GB18030 multibyte sequence is recognized as a + single wide character. This excludes the GB2312 and GBK encodings. */ + if (mblen ("\203\062\332\066", 5) != 4) + return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the locale name without encoding suffix. + if (LC_ALL=zh_CN LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=zh_CN + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=zh_CN.GB18030 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=zh_CN.GB18030 + else + # None found. + gt_cv_locale_zh_CN=none + fi + fi + else + # If there was a link error, due to mblen(), the system is so old that + # it certainly doesn't have a chinese locale. + gt_cv_locale_zh_CN=none + fi + rm -fr conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_zh_CN" >&5 +$as_echo "$gt_cv_locale_zh_CN" >&6; } + LOCALE_ZH_CN=$gt_cv_locale_zh_CN + + + + + + + if test $ac_cv_func_wctob = no; then + HAVE_DECL_WCTOB=0 + + + WCHAR_H=wchar.h + + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS wctob.$ac_objext" + + + : + + else + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether wctob works" >&5 +$as_echo_n "checking whether wctob works... " >&6; } +if test "${gl_cv_func_wctob_works+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + case "$host_os" in + # Guess no on Solaris <= 9. + solaris2.[1-9] | solaris2.[1-9].*) + gl_cv_func_wctob_works="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_wctob_works="guessing yes" ;; + esac + if test $LOCALE_FR != none; then + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +int main () +{ + if (setlocale (LC_ALL, "$LOCALE_FR") != NULL) + { + wchar_t wc; + + if (mbtowc (&wc, "\374", 1) == 1) + if (wctob (wc) != (unsigned char) '\374') + return 1; + } + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_wctob_works=yes +else + gl_cv_func_wctob_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi + + fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_wctob_works" >&5 +$as_echo "$gl_cv_func_wctob_works" >&6; } + case "$gl_cv_func_wctob_works" in + *yes) ;; + *) REPLACE_WCTOB=1 ;; + esac + if test $REPLACE_WCTOB = 1; then + + + WCHAR_H=wchar.h + + + + + + + + + + gltests_LIBOBJS="$gltests_LIBOBJS wctob.$ac_objext" + + + : + + else + + ac_fn_c_check_decl "$LINENO" "wctob" "ac_cv_have_decl_wctob" " +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be included + before . */ +#include +#include +#include +#include + +" +if test "x$ac_cv_have_decl_wctob" = x""yes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_WCTOB $ac_have_decl +_ACEOF + + if test $ac_cv_have_decl_wctob != yes; then + HAVE_DECL_WCTOB=0 + + + WCHAR_H=wchar.h + + fi + fi + fi + + + + GNULIB_WCTOB=1 + + + + + + + + + + LIBCOREUTILS_LIBDEPS="$gl_libdeps" LIBCOREUTILS_LTLIBDEPS="$gl_ltlibdeps" + LIBTESTS_LIBDEPS="$gltests_libdeps" - - - -{ $as_echo "$as_me:$LINENO: checking for library containing strerror" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing strerror" >&5 $as_echo_n "checking for library containing strerror... " >&6; } -if test "${ac_cv_search_strerror+set}" = set; then +if test "${ac_cv_search_strerror+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. @@ -45252,72 +39115,44 @@ for ac_lib in '' cposix; do ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi - rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_strerror=$ac_res -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext - if test "${ac_cv_search_strerror+set}" = set; then +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if test "${ac_cv_search_strerror+set}" = set; then : break fi done -if test "${ac_cv_search_strerror+set}" = set; then - : +if test "${ac_cv_search_strerror+set}" = set; then : + else ac_cv_search_strerror=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_strerror" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_strerror" >&5 $as_echo "$ac_cv_search_strerror" >&6; } ac_res=$ac_cv_search_strerror -if test "$ac_res" != no; then +if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi -{ $as_echo "$as_me:$LINENO: checking for function prototypes" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for function prototypes" >&5 $as_echo_n "checking for function prototypes... " >&6; } if test "$ac_cv_prog_cc_c89" != no; then - { $as_echo "$as_me:$LINENO: result: yes" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } -cat >>confdefs.h <<\_ACEOF -#define PROTOTYPES 1 -_ACEOF +$as_echo "#define PROTOTYPES 1" >>confdefs.h -cat >>confdefs.h <<\_ACEOF -#define __PROTOTYPES 1 -_ACEOF +$as_echo "#define __PROTOTYPES 1" >>confdefs.h else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -45329,150 +39164,12 @@ else fi # Ensure some checks needed by ansi2knr itself. - for ac_header in string.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-coreutils@gnu.org ## -## ------------------------------------ ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - -fi -if test `eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` = yes; then +do : + ac_fn_c_check_header_mongrel "$LINENO" "string.h" "ac_cv_header_string_h" "$ac_includes_default" +if test "x$ac_cv_header_string_h" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define HAVE_STRING_H 1 _ACEOF fi @@ -45480,16 +39177,12 @@ fi done -{ $as_echo "$as_me:$LINENO: checking for working volatile" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working volatile" >&5 $as_echo_n "checking for working volatile... " >&6; } -if test "${ac_cv_c_volatile+set}" = set; then +if test "${ac_cv_c_volatile+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -45503,131 +39196,23 @@ return !x && !y; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_volatile=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_c_volatile=no + ac_cv_c_volatile=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_volatile" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_volatile" >&5 $as_echo "$ac_cv_c_volatile" >&6; } if test $ac_cv_c_volatile = no; then -cat >>confdefs.h <<\_ACEOF -#define volatile -_ACEOF +$as_echo "#define volatile /**/" >>confdefs.h fi - { $as_echo "$as_me:$LINENO: checking for long double with more range or precision than double" >&5 -$as_echo_n "checking for long double with more range or precision than double... " >&6; } -if test "${ac_cv_type_long_double_wider+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - long double const a[] = - { - 0.0L, DBL_MIN, DBL_MAX, DBL_EPSILON, - LDBL_MIN, LDBL_MAX, LDBL_EPSILON - }; - long double - f (long double x) - { - return ((x + (unsigned long int) 10) * (-1 / x) + a[0] - + (x ? f (x) : 'c')); - } - -int -main () -{ -static int test_array [1 - 2 * !((0 < ((DBL_MAX_EXP < LDBL_MAX_EXP) - + (DBL_MANT_DIG < LDBL_MANT_DIG) - - (LDBL_MAX_EXP < DBL_MAX_EXP) - - (LDBL_MANT_DIG < DBL_MANT_DIG))) - && (int) LDBL_EPSILON == 0 - )]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type_long_double_wider=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_long_double_wider=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_long_double_wider" >&5 -$as_echo "$ac_cv_type_long_double_wider" >&6; } - if test $ac_cv_type_long_double_wider = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_LONG_DOUBLE_WIDER 1 -_ACEOF - - fi - - ac_cv_c_long_double=$ac_cv_type_long_double_wider - if test $ac_cv_c_long_double = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_LONG_DOUBLE 1 -_ACEOF - - fi @@ -45640,98 +39225,16 @@ _ACEOF - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -for ac_header in sys/sysctl.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default + for ac_header in sys/sysctl.h +do : + ac_fn_c_check_header_compile "$LINENO" "sys/sysctl.h" "ac_cv_header_sys_sysctl_h" "$ac_includes_default #if HAVE_SYS_PARAM_H #include #endif - -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - eval "$as_ac_Header=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_Header=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if test `eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` = yes; then +" +if test "x$ac_cv_header_sys_sysctl_h" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define HAVE_SYS_SYSCTL_H 1 _ACEOF fi @@ -45739,62 +39242,9 @@ fi done -{ $as_echo "$as_me:$LINENO: checking for mode_t" >&5 -$as_echo_n "checking for mode_t... " >&6; } -if test "${ac_cv_type_mode_t+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -typedef mode_t ac__type_new_; -int -main () -{ -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type_mode_t=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +ac_fn_c_check_type "$LINENO" "mode_t" "ac_cv_type_mode_t" "$ac_includes_default" +if test "x$ac_cv_type_mode_t" = x""yes; then : - ac_cv_type_mode_t=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_mode_t" >&5 -$as_echo "$ac_cv_type_mode_t" >&6; } -if test $ac_cv_type_mode_t = yes; then - : else cat >>confdefs.h <<_ACEOF @@ -45803,62 +39253,9 @@ _ACEOF fi -{ $as_echo "$as_me:$LINENO: checking for pid_t" >&5 -$as_echo_n "checking for pid_t... " >&6; } -if test "${ac_cv_type_pid_t+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -typedef pid_t ac__type_new_; -int -main () -{ -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type_pid_t=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default" +if test "x$ac_cv_type_pid_t" = x""yes; then : - ac_cv_type_pid_t=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5 -$as_echo "$ac_cv_type_pid_t" >&6; } -if test $ac_cv_type_pid_t = yes; then - : else cat >>confdefs.h <<_ACEOF @@ -45867,16 +39264,12 @@ _ACEOF fi -{ $as_echo "$as_me:$LINENO: checking whether sys/types.h defines makedev" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether sys/types.h defines makedev" >&5 $as_echo_n "checking whether sys/types.h defines makedev... " >&6; } -if test "${ac_cv_header_sys_types_h_makedev+set}" = set; then +if test "${ac_cv_header_sys_types_h_makedev+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int @@ -45887,321 +39280,33 @@ return makedev(0, 0); return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then +if ac_fn_c_try_link "$LINENO"; then : ac_cv_header_sys_types_h_makedev=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_header_sys_types_h_makedev=no + ac_cv_header_sys_types_h_makedev=no fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_sys_types_h_makedev" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_sys_types_h_makedev" >&5 $as_echo "$ac_cv_header_sys_types_h_makedev" >&6; } if test $ac_cv_header_sys_types_h_makedev = no; then -if test "${ac_cv_header_sys_mkdev_h+set}" = set; then - { $as_echo "$as_me:$LINENO: checking for sys/mkdev.h" >&5 -$as_echo_n "checking for sys/mkdev.h... " >&6; } -if test "${ac_cv_header_sys_mkdev_h+set}" = set; then - $as_echo_n "(cached) " >&6 -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_sys_mkdev_h" >&5 -$as_echo "$ac_cv_header_sys_mkdev_h" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking sys/mkdev.h usability" >&5 -$as_echo_n "checking sys/mkdev.h usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +ac_fn_c_check_header_mongrel "$LINENO" "sys/mkdev.h" "ac_cv_header_sys_mkdev_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_mkdev_h" = x""yes; then : - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking sys/mkdev.h presence" >&5 -$as_echo_n "checking sys/mkdev.h presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: sys/mkdev.h: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: sys/mkdev.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: sys/mkdev.h: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: sys/mkdev.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: sys/mkdev.h: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: sys/mkdev.h: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: sys/mkdev.h: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: sys/mkdev.h: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: sys/mkdev.h: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: sys/mkdev.h: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: sys/mkdev.h: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: sys/mkdev.h: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: sys/mkdev.h: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: sys/mkdev.h: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: sys/mkdev.h: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: sys/mkdev.h: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-coreutils@gnu.org ## -## ------------------------------------ ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for sys/mkdev.h" >&5 -$as_echo_n "checking for sys/mkdev.h... " >&6; } -if test "${ac_cv_header_sys_mkdev_h+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_cv_header_sys_mkdev_h=$ac_header_preproc -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_sys_mkdev_h" >&5 -$as_echo "$ac_cv_header_sys_mkdev_h" >&6; } - -fi -if test $ac_cv_header_sys_mkdev_h = yes; then - -cat >>confdefs.h <<\_ACEOF -#define MAJOR_IN_MKDEV 1 -_ACEOF +$as_echo "#define MAJOR_IN_MKDEV 1" >>confdefs.h fi if test $ac_cv_header_sys_mkdev_h = no; then - if test "${ac_cv_header_sys_sysmacros_h+set}" = set; then - { $as_echo "$as_me:$LINENO: checking for sys/sysmacros.h" >&5 -$as_echo_n "checking for sys/sysmacros.h... " >&6; } -if test "${ac_cv_header_sys_sysmacros_h+set}" = set; then - $as_echo_n "(cached) " >&6 -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_sys_sysmacros_h" >&5 -$as_echo "$ac_cv_header_sys_sysmacros_h" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking sys/sysmacros.h usability" >&5 -$as_echo_n "checking sys/sysmacros.h usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + ac_fn_c_check_header_mongrel "$LINENO" "sys/sysmacros.h" "ac_cv_header_sys_sysmacros_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_sysmacros_h" = x""yes; then : - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking sys/sysmacros.h presence" >&5 -$as_echo_n "checking sys/sysmacros.h presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: sys/sysmacros.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: sys/sysmacros.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: sys/sysmacros.h: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: sys/sysmacros.h: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: sys/sysmacros.h: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: sys/sysmacros.h: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: sys/sysmacros.h: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: sys/sysmacros.h: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-coreutils@gnu.org ## -## ------------------------------------ ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for sys/sysmacros.h" >&5 -$as_echo_n "checking for sys/sysmacros.h... " >&6; } -if test "${ac_cv_header_sys_sysmacros_h+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_cv_header_sys_sysmacros_h=$ac_header_preproc -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_sys_sysmacros_h" >&5 -$as_echo "$ac_cv_header_sys_sysmacros_h" >&6; } - -fi -if test $ac_cv_header_sys_sysmacros_h = yes; then - -cat >>confdefs.h <<\_ACEOF -#define MAJOR_IN_SYSMACROS 1 -_ACEOF +$as_echo "#define MAJOR_IN_SYSMACROS 1" >>confdefs.h fi @@ -46209,16 +39314,12 @@ fi fi fi -{ $as_echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5 $as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } -if test "${ac_cv_header_time+set}" = set; then +if test "${ac_cv_header_time+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include @@ -46233,41 +39334,18 @@ return 0; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_time=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_header_time=no + ac_cv_header_time=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5 $as_echo "$ac_cv_header_time" >&6; } if test $ac_cv_header_time = yes; then -cat >>confdefs.h <<\_ACEOF -#define TIME_WITH_SYS_TIME 1 -_ACEOF +$as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h fi @@ -46275,566 +39353,95 @@ fi -{ $as_echo "$as_me:$LINENO: checking whether free is declared" >&5 -$as_echo_n "checking whether free is declared... " >&6; } -if test "${ac_cv_have_decl_free+set}" = set; then - $as_echo_n "(cached) " >&6 +ac_fn_c_check_decl "$LINENO" "free" "ac_cv_have_decl_free" "$ac_includes_default" +if test "x$ac_cv_have_decl_free" = x""yes; then : + ac_have_decl=1 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef free - (void) free; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_free=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_free=no + ac_have_decl=0 fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_free" >&5 -$as_echo "$ac_cv_have_decl_free" >&6; } -if test $ac_cv_have_decl_free = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FREE 1 +#define HAVE_DECL_FREE $ac_have_decl _ACEOF - +ac_fn_c_check_decl "$LINENO" "geteuid" "ac_cv_have_decl_geteuid" "$ac_includes_default" +if test "x$ac_cv_have_decl_geteuid" = x""yes; then : + ac_have_decl=1 else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FREE 0 -_ACEOF - - + ac_have_decl=0 fi - -{ $as_echo "$as_me:$LINENO: checking whether geteuid is declared" >&5 -$as_echo_n "checking whether geteuid is declared... " >&6; } -if test "${ac_cv_have_decl_geteuid+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef geteuid - (void) geteuid; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_geteuid=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_geteuid=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_geteuid" >&5 -$as_echo "$ac_cv_have_decl_geteuid" >&6; } -if test $ac_cv_have_decl_geteuid = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_GETEUID 1 +#define HAVE_DECL_GETEUID $ac_have_decl _ACEOF - +ac_fn_c_check_decl "$LINENO" "getlogin" "ac_cv_have_decl_getlogin" "$ac_includes_default" +if test "x$ac_cv_have_decl_getlogin" = x""yes; then : + ac_have_decl=1 else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_GETEUID 0 -_ACEOF - - + ac_have_decl=0 fi - -{ $as_echo "$as_me:$LINENO: checking whether getlogin is declared" >&5 -$as_echo_n "checking whether getlogin is declared... " >&6; } -if test "${ac_cv_have_decl_getlogin+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef getlogin - (void) getlogin; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_getlogin=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_getlogin=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_getlogin" >&5 -$as_echo "$ac_cv_have_decl_getlogin" >&6; } -if test $ac_cv_have_decl_getlogin = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_GETLOGIN 1 +#define HAVE_DECL_GETLOGIN $ac_have_decl _ACEOF - +ac_fn_c_check_decl "$LINENO" "getuid" "ac_cv_have_decl_getuid" "$ac_includes_default" +if test "x$ac_cv_have_decl_getuid" = x""yes; then : + ac_have_decl=1 else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_GETLOGIN 0 -_ACEOF - - + ac_have_decl=0 fi - -{ $as_echo "$as_me:$LINENO: checking whether getuid is declared" >&5 -$as_echo_n "checking whether getuid is declared... " >&6; } -if test "${ac_cv_have_decl_getuid+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef getuid - (void) getuid; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_getuid=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_getuid=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_getuid" >&5 -$as_echo "$ac_cv_have_decl_getuid" >&6; } -if test $ac_cv_have_decl_getuid = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_GETUID 1 +#define HAVE_DECL_GETUID $ac_have_decl _ACEOF - +ac_fn_c_check_decl "$LINENO" "lseek" "ac_cv_have_decl_lseek" "$ac_includes_default" +if test "x$ac_cv_have_decl_lseek" = x""yes; then : + ac_have_decl=1 else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_GETUID 0 -_ACEOF - - + ac_have_decl=0 fi - -{ $as_echo "$as_me:$LINENO: checking whether lseek is declared" >&5 -$as_echo_n "checking whether lseek is declared... " >&6; } -if test "${ac_cv_have_decl_lseek+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef lseek - (void) lseek; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_lseek=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_lseek=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_lseek" >&5 -$as_echo "$ac_cv_have_decl_lseek" >&6; } -if test $ac_cv_have_decl_lseek = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_LSEEK 1 +#define HAVE_DECL_LSEEK $ac_have_decl _ACEOF - +ac_fn_c_check_decl "$LINENO" "malloc" "ac_cv_have_decl_malloc" "$ac_includes_default" +if test "x$ac_cv_have_decl_malloc" = x""yes; then : + ac_have_decl=1 else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_LSEEK 0 -_ACEOF - - + ac_have_decl=0 fi - -{ $as_echo "$as_me:$LINENO: checking whether malloc is declared" >&5 -$as_echo_n "checking whether malloc is declared... " >&6; } -if test "${ac_cv_have_decl_malloc+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef malloc - (void) malloc; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_malloc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_malloc=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_malloc" >&5 -$as_echo "$ac_cv_have_decl_malloc" >&6; } -if test $ac_cv_have_decl_malloc = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_MALLOC 1 +#define HAVE_DECL_MALLOC $ac_have_decl _ACEOF - +ac_fn_c_check_decl "$LINENO" "memchr" "ac_cv_have_decl_memchr" "$ac_includes_default" +if test "x$ac_cv_have_decl_memchr" = x""yes; then : + ac_have_decl=1 else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_MALLOC 0 -_ACEOF - - + ac_have_decl=0 fi - -{ $as_echo "$as_me:$LINENO: checking whether memchr is declared" >&5 -$as_echo_n "checking whether memchr is declared... " >&6; } -if test "${ac_cv_have_decl_memchr+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef memchr - (void) memchr; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_memchr=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_memchr=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_memchr" >&5 -$as_echo "$ac_cv_have_decl_memchr" >&6; } -if test $ac_cv_have_decl_memchr = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_MEMCHR 1 +#define HAVE_DECL_MEMCHR $ac_have_decl _ACEOF - +ac_fn_c_check_decl "$LINENO" "realloc" "ac_cv_have_decl_realloc" "$ac_includes_default" +if test "x$ac_cv_have_decl_realloc" = x""yes; then : + ac_have_decl=1 else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_MEMCHR 0 -_ACEOF - - + ac_have_decl=0 fi - -{ $as_echo "$as_me:$LINENO: checking whether realloc is declared" >&5 -$as_echo_n "checking whether realloc is declared... " >&6; } -if test "${ac_cv_have_decl_realloc+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef realloc - (void) realloc; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_realloc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_realloc=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_realloc" >&5 -$as_echo "$ac_cv_have_decl_realloc" >&6; } -if test $ac_cv_have_decl_realloc = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_REALLOC 1 +#define HAVE_DECL_REALLOC $ac_have_decl _ACEOF -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_REALLOC 0 -_ACEOF - - -fi - - - - - - - - - - @@ -46851,281 +39458,54 @@ fi # include #endif ' - { $as_echo "$as_me:$LINENO: checking whether getgrgid is declared" >&5 -$as_echo_n "checking whether getgrgid is declared... " >&6; } -if test "${ac_cv_have_decl_getgrgid+set}" = set; then - $as_echo_n "(cached) " >&6 + ac_fn_c_check_decl "$LINENO" "getgrgid" "ac_cv_have_decl_getgrgid" "$headers +" +if test "x$ac_cv_have_decl_getgrgid" = x""yes; then : + ac_have_decl=1 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$headers - -int -main () -{ -#ifndef getgrgid - (void) getgrgid; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_getgrgid=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_getgrgid=no + ac_have_decl=0 fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_getgrgid" >&5 -$as_echo "$ac_cv_have_decl_getgrgid" >&6; } -if test $ac_cv_have_decl_getgrgid = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_GETGRGID 1 +#define HAVE_DECL_GETGRGID $ac_have_decl _ACEOF - - +ac_fn_c_check_decl "$LINENO" "getpwuid" "ac_cv_have_decl_getpwuid" "$headers +" +if test "x$ac_cv_have_decl_getpwuid" = x""yes; then : + ac_have_decl=1 else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_GETGRGID 0 -_ACEOF - - + ac_have_decl=0 fi -{ $as_echo "$as_me:$LINENO: checking whether getpwuid is declared" >&5 -$as_echo_n "checking whether getpwuid is declared... " >&6; } -if test "${ac_cv_have_decl_getpwuid+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$headers - -int -main () -{ -#ifndef getpwuid - (void) getpwuid; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_getpwuid=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_getpwuid=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_getpwuid" >&5 -$as_echo "$ac_cv_have_decl_getpwuid" >&6; } -if test $ac_cv_have_decl_getpwuid = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_GETPWUID 1 +#define HAVE_DECL_GETPWUID $ac_have_decl _ACEOF - - +ac_fn_c_check_decl "$LINENO" "ttyname" "ac_cv_have_decl_ttyname" "$headers +" +if test "x$ac_cv_have_decl_ttyname" = x""yes; then : + ac_have_decl=1 else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_GETPWUID 0 -_ACEOF - - + ac_have_decl=0 fi -{ $as_echo "$as_me:$LINENO: checking whether ttyname is declared" >&5 -$as_echo_n "checking whether ttyname is declared... " >&6; } -if test "${ac_cv_have_decl_ttyname+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$headers - -int -main () -{ -#ifndef ttyname - (void) ttyname; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_ttyname=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_ttyname=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_ttyname" >&5 -$as_echo "$ac_cv_have_decl_ttyname" >&6; } -if test $ac_cv_have_decl_ttyname = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_TTYNAME 1 +#define HAVE_DECL_TTYNAME $ac_have_decl _ACEOF + ac_fn_c_check_decl "$LINENO" "isblank" "ac_cv_have_decl_isblank" "#include +" +if test "x$ac_cv_have_decl_isblank" = x""yes; then : + ac_have_decl=1 else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_TTYNAME 0 -_ACEOF - - + ac_have_decl=0 fi - - - { $as_echo "$as_me:$LINENO: checking whether isblank is declared" >&5 -$as_echo_n "checking whether isblank is declared... " >&6; } -if test "${ac_cv_have_decl_isblank+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -int -main () -{ -#ifndef isblank - (void) isblank; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_isblank=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_isblank=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_isblank" >&5 -$as_echo "$ac_cv_have_decl_isblank" >&6; } -if test $ac_cv_have_decl_isblank = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_ISBLANK 1 +#define HAVE_DECL_ISBLANK $ac_have_decl _ACEOF -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_ISBLANK 0 -_ACEOF - - -fi @@ -47139,39 +39519,7 @@ fi - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -cat >>confdefs.h <<\_ACEOF -#define PREFER_NONREENTRANT_EUIDACCESS 1 -_ACEOF +$as_echo "#define PREFER_NONREENTRANT_EUIDACCESS 1" >>confdefs.h @@ -47193,6 +39541,114 @@ esac + # Check whether --enable-xattr was given. +if test "${enable_xattr+set}" = set; then : + enableval=$enable_xattr; use_xattr=$enableval +else + use_xattr=yes +fi + + + if test "$use_xattr" = "yes"; then + for ac_header in attr/error_context.h attr/libattr.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +eval as_val=\$$as_ac_Header + if test "x$as_val" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + if test $ac_cv_header_attr_libattr_h = yes \ + && test $ac_cv_header_attr_error_context_h = yes; then + use_xattr=1 + else + use_xattr=0 + fi + +cat >>confdefs.h <<_ACEOF +#define USE_XATTR $use_xattr +_ACEOF + + xattr_saved_LIBS=$LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing attr_copy_file" >&5 +$as_echo_n "checking for library containing attr_copy_file... " >&6; } +if test "${ac_cv_search_attr_copy_file+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char attr_copy_file (); +int +main () +{ +return attr_copy_file (); + ; + return 0; +} +_ACEOF +for ac_lib in '' attr; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_attr_copy_file=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if test "${ac_cv_search_attr_copy_file+set}" = set; then : + break +fi +done +if test "${ac_cv_search_attr_copy_file+set}" = set; then : + +else + ac_cv_search_attr_copy_file=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_attr_copy_file" >&5 +$as_echo "$ac_cv_search_attr_copy_file" >&6; } +ac_res=$ac_cv_search_attr_copy_file +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + test "$ac_cv_search_attr_copy_file" = "none required" || + LIB_XATTR=$ac_cv_search_attr_copy_file +fi + + for ac_func in attr_copy_file +do : + ac_fn_c_check_func "$LINENO" "attr_copy_file" "ac_cv_func_attr_copy_file" +if test "x$ac_cv_func_attr_copy_file" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_ATTR_COPY_FILE 1 +_ACEOF + +fi +done + + LIBS=$xattr_saved_LIBS + + fi + + case " $LIBOBJS " in *" xfts.$ac_objext "* ) ;; @@ -47218,82 +39674,14 @@ esac - - - - - - - - case " $LIBOBJS " in - *" randint.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS randint.$ac_objext" - ;; -esac - - - - - - - case " $LIBOBJS " in - *" randperm.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS randperm.$ac_objext" - ;; -esac - - - - - case " $LIBOBJS " in - *" randread.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS randread.$ac_objext" - ;; -esac - - case " $LIBOBJS " in - *" rand-isaac.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS rand-isaac.$ac_objext" - ;; -esac - - - - - case " $LIBOBJS " in - *" sha256.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS sha256.$ac_objext" - ;; -esac - - - - : - - - - case " $LIBOBJS " in - *" sha512.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS sha512.$ac_objext" - ;; -esac - - - - : - -{ $as_echo "$as_me:$LINENO: checking for inline" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 $as_echo_n "checking for inline... " >&6; } -if test "${ac_cv_c_inline+set}" = set; then +if test "${ac_cv_c_inline+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifndef __cplusplus typedef int foo_t; @@ -47302,41 +39690,17 @@ $ac_kw foo_t foo () {return 0; } #endif _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_inline=$ac_kw -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext test "$ac_cv_c_inline" != no && break done fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 $as_echo "$ac_cv_c_inline" >&6; } - case $ac_cv_c_inline in inline | yes) ;; *) @@ -47397,131 +39761,6 @@ esac -{ $as_echo "$as_me:$LINENO: checking for _LARGEFILE_SOURCE value needed for large files" >&5 -$as_echo_n "checking for _LARGEFILE_SOURCE value needed for large files... " >&6; } -if test "${ac_cv_sys_largefile_source+set}" = set; then - $as_echo_n "(cached) " >&6 -else - while :; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include /* for off_t */ - #include -int -main () -{ -int (*fp) (FILE *, off_t, int) = fseeko; - return fseeko (stdin, 0, 0) && fp (stdin, 0, 0); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_sys_largefile_source=no; break -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#define _LARGEFILE_SOURCE 1 -#include /* for off_t */ - #include -int -main () -{ -int (*fp) (FILE *, off_t, int) = fseeko; - return fseeko (stdin, 0, 0) && fp (stdin, 0, 0); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_sys_largefile_source=1; break -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext - ac_cv_sys_largefile_source=unknown - break -done -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_source" >&5 -$as_echo "$ac_cv_sys_largefile_source" >&6; } -case $ac_cv_sys_largefile_source in #( - no | unknown) ;; - *) -cat >>confdefs.h <<_ACEOF -#define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source -_ACEOF -;; -esac -rm -f conftest* - -# We used to try defining _XOPEN_SOURCE=500 too, to work around a bug -# in glibc 2.1.3, but that breaks too many other things. -# If you want fseeko and ftello with glibc, upgrade to a fixed glibc. -if test $ac_cv_sys_largefile_source != unknown; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_FSEEKO 1 -_ACEOF - -fi @@ -47545,16 +39784,6 @@ fi - - - - - - GNU_PACKAGE="GNU $PACKAGE" - -cat >>confdefs.h <<_ACEOF -#define GNU_PACKAGE "$GNU_PACKAGE" -_ACEOF @@ -47575,111 +39804,11 @@ HELP2MAN=${HELP2MAN-"${am_missing_run}help2man"} - - - - { $as_echo "$as_me:$LINENO: checking for struct stat.st_author" >&5 -$as_echo_n "checking for struct stat.st_author... " >&6; } -if test "${ac_cv_member_struct_stat_st_author+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default + ac_fn_c_check_member "$LINENO" "struct stat" "st_author" "ac_cv_member_struct_stat_st_author" "$ac_includes_default #include - -int -main () -{ -static struct stat ac_aggr; -if (ac_aggr.st_author) -return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_member_struct_stat_st_author=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include - - -int -main () -{ -static struct stat ac_aggr; -if (sizeof ac_aggr.st_author) -return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_member_struct_stat_st_author=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_member_struct_stat_st_author=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_author" >&5 -$as_echo "$ac_cv_member_struct_stat_st_author" >&6; } -if test $ac_cv_member_struct_stat_st_author = yes; then +" +if test "x$ac_cv_member_struct_stat_st_author" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_STAT_ST_AUTHOR 1 @@ -47697,62 +39826,9 @@ fi - { $as_echo "$as_me:$LINENO: checking for ino_t" >&5 -$as_echo_n "checking for ino_t... " >&6; } -if test "${ac_cv_type_ino_t+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -typedef ino_t ac__type_new_; -int -main () -{ -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type_ino_t=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + ac_fn_c_check_type "$LINENO" "ino_t" "ac_cv_type_ino_t" "$ac_includes_default" +if test "x$ac_cv_type_ino_t" = x""yes; then : - ac_cv_type_ino_t=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_ino_t" >&5 -$as_echo "$ac_cv_type_ino_t" >&6; } -if test $ac_cv_type_ino_t = yes; then - : else cat >>confdefs.h <<_ACEOF @@ -47762,62 +39838,9 @@ _ACEOF fi - { $as_echo "$as_me:$LINENO: checking for major_t" >&5 -$as_echo_n "checking for major_t... " >&6; } -if test "${ac_cv_type_major_t+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -typedef major_t ac__type_new_; -int -main () -{ -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type_major_t=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + ac_fn_c_check_type "$LINENO" "major_t" "ac_cv_type_major_t" "$ac_includes_default" +if test "x$ac_cv_type_major_t" = x""yes; then : - ac_cv_type_major_t=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_major_t" >&5 -$as_echo "$ac_cv_type_major_t" >&6; } -if test $ac_cv_type_major_t = yes; then - : else cat >>confdefs.h <<_ACEOF @@ -47826,62 +39849,9 @@ _ACEOF fi - { $as_echo "$as_me:$LINENO: checking for minor_t" >&5 -$as_echo_n "checking for minor_t... " >&6; } -if test "${ac_cv_type_minor_t+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -typedef minor_t ac__type_new_; -int -main () -{ -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type_minor_t=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + ac_fn_c_check_type "$LINENO" "minor_t" "ac_cv_type_minor_t" "$ac_includes_default" +if test "x$ac_cv_type_minor_t" = x""yes; then : - ac_cv_type_minor_t=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_minor_t" >&5 -$as_echo "$ac_cv_type_minor_t" >&6; } -if test $ac_cv_type_minor_t = yes; then - : else cat >>confdefs.h <<_ACEOF @@ -47902,14 +39872,10 @@ fi # By default, argmatch should fail calling usage (1). -cat >>confdefs.h <<\_ACEOF -#define ARGMATCH_DIE usage (1) -_ACEOF +$as_echo "#define ARGMATCH_DIE usage (1)" >>confdefs.h -cat >>confdefs.h <<\_ACEOF -#define ARGMATCH_DIE_DECL extern void usage () -_ACEOF +$as_echo "#define ARGMATCH_DIE_DECL void usage (int _e)" >>confdefs.h # used by ls @@ -47917,53 +39883,10 @@ _ACEOF # used by shred + # Used by install.c. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + # Used by sort.c. @@ -47975,295 +39898,19 @@ _ACEOF test $ac_cv_header_sys_param_h = yes && test $ac_cv_header_sys_mount_h = yes && - -for ac_header in nfs/vfs.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-coreutils@gnu.org ## -## ------------------------------------ ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - -fi -if test `eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` = yes; then + for ac_header in nfs/vfs.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "nfs/vfs.h" "ac_cv_header_nfs_vfs_h" "$ac_includes_default" +if test "x$ac_cv_header_nfs_vfs_h" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define HAVE_NFS_VFS_H 1 _ACEOF - -for ac_header in nfs/nfs_client.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-coreutils@gnu.org ## -## ------------------------------------ ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - -fi -if test `eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` = yes; then + for ac_header in nfs/nfs_client.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "nfs/nfs_client.h" "ac_cv_header_nfs_nfs_client_h" "$ac_includes_default" +if test "x$ac_cv_header_nfs_nfs_client_h" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define HAVE_NFS_NFS_CLIENT_H 1 _ACEOF fi @@ -48296,104 +39943,9 @@ $ac_includes_default #endif " if test "$fu_cv_sys_stat_statvfs" = yes && - { { $as_echo "$as_me:$LINENO: checking for struct statvfs.f_basetype" >&5 -$as_echo_n "checking for struct statvfs.f_basetype... " >&6; } -if test "${ac_cv_member_struct_statvfs_f_basetype+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$statvfs_includes - -int -main () -{ -static struct statvfs ac_aggr; -if (ac_aggr.f_basetype) -return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_member_struct_statvfs_f_basetype=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$statvfs_includes - -int -main () -{ -static struct statvfs ac_aggr; -if (sizeof ac_aggr.f_basetype) -return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_member_struct_statvfs_f_basetype=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_member_struct_statvfs_f_basetype=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_statvfs_f_basetype" >&5 -$as_echo "$ac_cv_member_struct_statvfs_f_basetype" >&6; } -if test $ac_cv_member_struct_statvfs_f_basetype = yes; then + { ac_fn_c_check_member "$LINENO" "struct statvfs" "f_basetype" "ac_cv_member_struct_statvfs_f_basetype" "$statvfs_includes +" +if test "x$ac_cv_member_struct_statvfs_f_basetype" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_STATVFS_F_BASETYPE 1 @@ -48403,104 +39955,9 @@ _ACEOF fi test $ac_cv_member_struct_statvfs_f_basetype = yes || - { { $as_echo "$as_me:$LINENO: checking for struct statvfs.f_fstypename" >&5 -$as_echo_n "checking for struct statvfs.f_fstypename... " >&6; } -if test "${ac_cv_member_struct_statvfs_f_fstypename+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$statvfs_includes - -int -main () -{ -static struct statvfs ac_aggr; -if (ac_aggr.f_fstypename) -return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_member_struct_statvfs_f_fstypename=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$statvfs_includes - -int -main () -{ -static struct statvfs ac_aggr; -if (sizeof ac_aggr.f_fstypename) -return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_member_struct_statvfs_f_fstypename=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_member_struct_statvfs_f_fstypename=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_statvfs_f_fstypename" >&5 -$as_echo "$ac_cv_member_struct_statvfs_f_fstypename" >&6; } -if test $ac_cv_member_struct_statvfs_f_fstypename = yes; then + { ac_fn_c_check_member "$LINENO" "struct statvfs" "f_fstypename" "ac_cv_member_struct_statvfs_f_fstypename" "$statvfs_includes +" +if test "x$ac_cv_member_struct_statvfs_f_fstypename" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_STATVFS_F_FSTYPENAME 1 @@ -48511,104 +39968,9 @@ fi test $ac_cv_member_struct_statvfs_f_fstypename = yes || { test $ac_cv_member_struct_statfs_f_fstypename != yes && - { { $as_echo "$as_me:$LINENO: checking for struct statvfs.f_type" >&5 -$as_echo_n "checking for struct statvfs.f_type... " >&6; } -if test "${ac_cv_member_struct_statvfs_f_type+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$statvfs_includes - -int -main () -{ -static struct statvfs ac_aggr; -if (ac_aggr.f_type) -return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_member_struct_statvfs_f_type=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$statvfs_includes - -int -main () -{ -static struct statvfs ac_aggr; -if (sizeof ac_aggr.f_type) -return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_member_struct_statvfs_f_type=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_member_struct_statvfs_f_type=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_statvfs_f_type" >&5 -$as_echo "$ac_cv_member_struct_statvfs_f_type" >&6; } -if test $ac_cv_member_struct_statvfs_f_type = yes; then + { ac_fn_c_check_member "$LINENO" "struct statvfs" "f_type" "ac_cv_member_struct_statvfs_f_type" "$statvfs_includes +" +if test "x$ac_cv_member_struct_statvfs_f_type" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_STATVFS_F_TYPE 1 @@ -48619,104 +39981,9 @@ fi test $ac_cv_member_struct_statvfs_f_type = yes; }; }; }; } then - { $as_echo "$as_me:$LINENO: checking for struct statvfs.f_namemax" >&5 -$as_echo_n "checking for struct statvfs.f_namemax... " >&6; } -if test "${ac_cv_member_struct_statvfs_f_namemax+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$statvfs_includes - -int -main () -{ -static struct statvfs ac_aggr; -if (ac_aggr.f_namemax) -return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_member_struct_statvfs_f_namemax=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$statvfs_includes - -int -main () -{ -static struct statvfs ac_aggr; -if (sizeof ac_aggr.f_namemax) -return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_member_struct_statvfs_f_namemax=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_member_struct_statvfs_f_namemax=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_statvfs_f_namemax" >&5 -$as_echo "$ac_cv_member_struct_statvfs_f_namemax" >&6; } -if test $ac_cv_member_struct_statvfs_f_namemax = yes; then + ac_fn_c_check_member "$LINENO" "struct statvfs" "f_namemax" "ac_cv_member_struct_statvfs_f_namemax" "$statvfs_includes +" +if test "x$ac_cv_member_struct_statvfs_f_namemax" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_STATVFS_F_NAMEMAX 1 @@ -48725,11 +39992,7 @@ _ACEOF fi - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $statvfs_includes int @@ -48741,136 +40004,16 @@ static statvfs s; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - -cat >>confdefs.h <<\_ACEOF -#define STRUCT_STATVFS_F_FSID_IS_INTEGER 1 -_ACEOF - -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +if ac_fn_c_try_compile "$LINENO"; then : +$as_echo "#define STRUCT_STATVFS_F_FSID_IS_INTEGER 1" >>confdefs.h fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else - { $as_echo "$as_me:$LINENO: checking for struct statfs.f_namelen" >&5 -$as_echo_n "checking for struct statfs.f_namelen... " >&6; } -if test "${ac_cv_member_struct_statfs_f_namelen+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$statfs_includes - -int -main () -{ -static struct statfs ac_aggr; -if (ac_aggr.f_namelen) -return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_member_struct_statfs_f_namelen=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$statfs_includes - -int -main () -{ -static struct statfs ac_aggr; -if (sizeof ac_aggr.f_namelen) -return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_member_struct_statfs_f_namelen=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_member_struct_statfs_f_namelen=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_statfs_f_namelen" >&5 -$as_echo "$ac_cv_member_struct_statfs_f_namelen" >&6; } -if test $ac_cv_member_struct_statfs_f_namelen = yes; then + ac_fn_c_check_member "$LINENO" "struct statfs" "f_namelen" "ac_cv_member_struct_statfs_f_namelen" "$statfs_includes +" +if test "x$ac_cv_member_struct_statfs_f_namelen" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_STATFS_F_NAMELEN 1 @@ -48878,104 +40021,9 @@ _ACEOF fi -{ $as_echo "$as_me:$LINENO: checking for struct statfs.f_type" >&5 -$as_echo_n "checking for struct statfs.f_type... " >&6; } -if test "${ac_cv_member_struct_statfs_f_type+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$statfs_includes - -int -main () -{ -static struct statfs ac_aggr; -if (ac_aggr.f_type) -return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_member_struct_statfs_f_type=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$statfs_includes - -int -main () -{ -static struct statfs ac_aggr; -if (sizeof ac_aggr.f_type) -return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_member_struct_statfs_f_type=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_member_struct_statfs_f_type=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_statfs_f_type" >&5 -$as_echo "$ac_cv_member_struct_statfs_f_type" >&6; } -if test $ac_cv_member_struct_statfs_f_type = yes; then +ac_fn_c_check_member "$LINENO" "struct statfs" "f_type" "ac_cv_member_struct_statfs_f_type" "$statfs_includes +" +if test "x$ac_cv_member_struct_statfs_f_type" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_STATFS_F_TYPE 1 @@ -48985,11 +40033,7 @@ _ACEOF fi if test $ac_cv_header_OS_h != yes; then - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $statfs_includes int @@ -49001,36 +40045,11 @@ static statfs s; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - -cat >>confdefs.h <<\_ACEOF -#define STRUCT_STATFS_F_FSID_IS_INTEGER 1 -_ACEOF - -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +if ac_fn_c_try_compile "$LINENO"; then : +$as_echo "#define STRUCT_STATFS_F_FSID_IS_INTEGER 1" >>confdefs.h fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi @@ -49038,17 +40057,13 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # for dd.c and shred.c coreutils_saved_libs=$LIBS - { $as_echo "$as_me:$LINENO: checking for library containing fdatasync" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing fdatasync" >&5 $as_echo_n "checking for library containing fdatasync... " >&6; } -if test "${ac_cv_search_fdatasync+set}" = set; then +if test "${ac_cv_search_fdatasync+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. @@ -49073,88 +40088,61 @@ for ac_lib in '' rt posix4; do ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi - rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_fdatasync=$ac_res -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext - if test "${ac_cv_search_fdatasync+set}" = set; then +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if test "${ac_cv_search_fdatasync+set}" = set; then : break fi done -if test "${ac_cv_search_fdatasync+set}" = set; then - : +if test "${ac_cv_search_fdatasync+set}" = set; then : + else ac_cv_search_fdatasync=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_fdatasync" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_fdatasync" >&5 $as_echo "$ac_cv_search_fdatasync" >&6; } ac_res=$ac_cv_search_fdatasync -if test "$ac_res" != no; then +if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" test "$ac_cv_search_fdatasync" = "none required" || LIB_FDATASYNC=$ac_cv_search_fdatasync fi + for ac_func in fdatasync +do : + ac_fn_c_check_func "$LINENO" "fdatasync" "ac_cv_func_fdatasync" +if test "x$ac_cv_func_fdatasync" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_FDATASYNC 1 +_ACEOF -for ac_func in fdatasync -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then +fi +done + + LIBS=$coreutils_saved_libs + + # Check whether libcap is usable -- for ls --color support + # Check whether --enable-libcap was given. +if test "${enable_libcap+set}" = set; then : + enableval=$enable_libcap; { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libcap support disabled by user" >&5 +$as_echo "$as_me: WARNING: libcap support disabled by user" >&2;} +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cap_get_file in -lcap" >&5 +$as_echo_n "checking for cap_get_file in -lcap... " >&6; } +if test "${ac_cv_lib_cap_cap_get_file+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcap $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC @@ -49162,66 +40150,49 @@ cat >>conftest.$ac_ext <<_ACEOF #ifdef __cplusplus extern "C" #endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - +char cap_get_file (); int main () { -return $ac_func (); +return cap_get_file (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_cap_cap_get_file=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_lib_cap_cap_get_file=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cap_cap_get_file" >&5 +$as_echo "$ac_cv_lib_cap_cap_get_file" >&6; } +if test "x$ac_cv_lib_cap_cap_get_file" = x""yes; then : + ac_fn_c_check_header_mongrel "$LINENO" "sys/capability.h" "ac_cv_header_sys_capability_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_capability_h" = x""yes; then : + LIB_CAP=-lcap + +$as_echo "#define HAVE_CAP 1" >>confdefs.h + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: header sys/capability.h was not found, support for libcap will not be built" >&5 +$as_echo "$as_me: WARNING: header sys/capability.h was not found, support for libcap will not be built" >&2;} - eval "$as_ac_var=no" fi -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libcap library was not found or not usable, support for libcap will not be built" >&5 +$as_echo "$as_me: WARNING: libcap library was not found or not usable, support for libcap will not be built" >&2;} fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if test `eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF + fi -done - LIBS=$coreutils_saved_libs + # See if linking `seq' requires -lm. # It does on nearly every system. The single exception (so far) is @@ -49234,11 +40205,7 @@ done x = floor (x); x = rint (x); x = modf (x, &y);' - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int @@ -49249,37 +40216,12 @@ $ac_seq_body return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - : -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +if ac_fn_c_try_link "$LINENO"; then : - ac_seq_save_LIBS="$LIBS" +else + ac_seq_save_LIBS="$LIBS" LIBS="$LIBS -lm" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int @@ -49290,291 +40232,422 @@ $ac_seq_body return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then +if ac_fn_c_try_link "$LINENO"; then : SEQ_LIBM=-lm -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS="$ac_seq_save_LIBS" fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext - # Build df only if there's a point to it. - if test $gl_cv_list_mounted_fs = yes && test $gl_cv_fs_space = yes; then - DF_PROG='df$(EXEEXT)' - fi + +# Check whether --enable-gcc-warnings was given. +if test "${enable_gcc_warnings+set}" = set; then : + enableval=$enable_gcc_warnings; case $enableval in + yes|no) ;; + *) as_fn_error "bad value $enableval for gcc-warnings option" "$LINENO" 5 ;; + esac + gl_gcc_warnings=$enableval +else + gl_gcc_warnings=no + +fi +if test "$gl_gcc_warnings" = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether compiler handles -Werror" >&5 +$as_echo_n "checking whether compiler handles -Werror... " >&6; } +if test "${gl_cv_warn__Werror+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="${CPPFLAGS} -Werror" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + gl_cv_warn__Werror=yes +else + gl_cv_warn__Werror=no +fi +rm -f conftest.err conftest.$ac_ext + CPPFLAGS="$save_CPPFLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn__Werror" >&5 +$as_echo "$gl_cv_warn__Werror" >&6; } +if test "x$gl_cv_warn__Werror" = x""yes; then : + as_fn_append WERROR_CFLAGS " -Werror" +fi + + + + # Add many warnings, except some... + nw="$nw -Wdeclaration-after-statement" # too useful to forbid + nw="$nw -Waggregate-return" # anachronistic + nw="$nw -Wc++-compat" # We don't care about C++ compilers + nw="$nw -Wundef" # Warns on '#if GNULIB_FOO' etc in gnulib + nw="$nw -Wtraditional" # Warns on #elif which we use often + nw="$nw -Wcast-qual" # Too many warnings for now + nw="$nw -Wconversion" # Too many warnings for now + nw="$nw -Wsystem-headers" # Don't let system headers trigger warnings + nw="$nw -Wsign-conversion" # Too many warnings for now + nw="$nw -Wtraditional-conversion" # Too many warnings for now + nw="$nw -Wunreachable-code" # Too many warnings for now + nw="$nw -Wpadded" # Our structs are not padded + nw="$nw -Wredundant-decls" # openat.h declares e.g., mkdirat + nw="$nw -Wlogical-op" # any use of fwrite provokes this + nw="$nw -Wformat-nonliteral" # who.c and pinky.c strftime uses + nw="$nw -Wvla" # warnings in gettext.h + nw="$nw -Wnested-externs" # use of XARGMATCH/verify_function__ + nw="$nw -Wswitch-enum" # Too many warnings for now + nw="$nw -Wswitch-default" # Too many warnings for now + # things I might fix soon: + nw="$nw -Wfloat-equal" # sort.c, seq.c + nw="$nw -Wmissing-format-attribute" # copy.c + nw="$nw -Wunsafe-loop-optimizations" # a few src/*.c + nw="$nw -Winline" # system.h's readdir_ignoring_dot_and_dotdot + nw="$nw -Wstrict-overflow" # expr.c, pr.c, tr.c, factor.c + # ?? -Wstrict-overflow + + + gl_manywarn_set= + for gl_manywarn_item in \ + -Wall \ + -W \ + -Wformat-y2k \ + -Wformat-nonliteral \ + -Wformat-security \ + -Winit-self \ + -Wmissing-include-dirs \ + -Wswitch-default \ + -Wswitch-enum \ + -Wunused \ + -Wunknown-pragmas \ + -Wstrict-aliasing \ + -Wstrict-overflow \ + -Wsystem-headers \ + -Wfloat-equal \ + -Wtraditional \ + -Wtraditional-conversion \ + -Wdeclaration-after-statement \ + -Wundef \ + -Wshadow \ + -Wunsafe-loop-optimizations \ + -Wpointer-arith \ + -Wbad-function-cast \ + -Wc++-compat \ + -Wcast-qual \ + -Wcast-align \ + -Wwrite-strings \ + -Wconversion \ + -Wsign-conversion \ + -Wlogical-op \ + -Waggregate-return \ + -Wstrict-prototypes \ + -Wold-style-definition \ + -Wmissing-prototypes \ + -Wmissing-declarations \ + -Wmissing-noreturn \ + -Wmissing-format-attribute \ + -Wpacked \ + -Wpadded \ + -Wredundant-decls \ + -Wnested-externs \ + -Wunreachable-code \ + -Winline \ + -Winvalid-pch \ + -Wlong-long \ + -Wvla \ + -Wvolatile-register-var \ + -Wdisabled-optimization \ + -Wstack-protector \ + -Woverlength-strings \ + ; do + gl_manywarn_set="$gl_manywarn_set $gl_manywarn_item" + done + # The following are not documented in the manual but are included in + # output from gcc --help=warnings. + for gl_manywarn_item in \ + -Wattributes \ + -Wcoverage-mismatch \ + -Wmultichar \ + -Wunused-macros \ + ; do + gl_manywarn_set="$gl_manywarn_set $gl_manywarn_item" + done + ws=$gl_manywarn_set + + + gl_warn_set= + set x $ws; shift + for gl_warn_item + do + case " $nw " in + *" $gl_warn_item "*) + ;; + *) + gl_warn_set="$gl_warn_set $gl_warn_item" + ;; + esac + done + ws=$gl_warn_set + + for w in $ws; do + as_gl_Warn=`$as_echo "gl_cv_warn_$w" | $as_tr_sh` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether compiler handles $w" >&5 +$as_echo_n "checking whether compiler handles $w... " >&6; } +if { as_var=$as_gl_Warn; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 +else + + save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="${CPPFLAGS} $w" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + eval "$as_gl_Warn=yes" +else + eval "$as_gl_Warn=no" +fi +rm -f conftest.err conftest.$ac_ext + CPPFLAGS="$save_CPPFLAGS" + +fi +eval ac_res=\$$as_gl_Warn + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +eval as_val=\$$as_gl_Warn + if test "x$as_val" = x""yes; then : + as_fn_append WARN_CFLAGS " $w" +fi + + done + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether compiler handles -Wno-missing-field-initializers" >&5 +$as_echo_n "checking whether compiler handles -Wno-missing-field-initializers... " >&6; } +if test "${gl_cv_warn__Wno_missing_field_initializers+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="${CPPFLAGS} -Wno-missing-field-initializers" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + gl_cv_warn__Wno_missing_field_initializers=yes +else + gl_cv_warn__Wno_missing_field_initializers=no +fi +rm -f conftest.err conftest.$ac_ext + CPPFLAGS="$save_CPPFLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn__Wno_missing_field_initializers" >&5 +$as_echo "$gl_cv_warn__Wno_missing_field_initializers" >&6; } +if test "x$gl_cv_warn__Wno_missing_field_initializers" = x""yes; then : + as_fn_append WARN_CFLAGS " -Wno-missing-field-initializers" +fi + # We need this one + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether compiler handles -Wno-sign-compare" >&5 +$as_echo_n "checking whether compiler handles -Wno-sign-compare... " >&6; } +if test "${gl_cv_warn__Wno_sign_compare+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="${CPPFLAGS} -Wno-sign-compare" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + gl_cv_warn__Wno_sign_compare=yes +else + gl_cv_warn__Wno_sign_compare=no +fi +rm -f conftest.err conftest.$ac_ext + CPPFLAGS="$save_CPPFLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn__Wno_sign_compare" >&5 +$as_echo "$gl_cv_warn__Wno_sign_compare" >&6; } +if test "x$gl_cv_warn__Wno_sign_compare" = x""yes; then : + as_fn_append WARN_CFLAGS " -Wno-sign-compare" +fi + # Too many warnings for now + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether compiler handles -Wno-pointer-sign" >&5 +$as_echo_n "checking whether compiler handles -Wno-pointer-sign... " >&6; } +if test "${gl_cv_warn__Wno_pointer_sign+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="${CPPFLAGS} -Wno-pointer-sign" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + gl_cv_warn__Wno_pointer_sign=yes +else + gl_cv_warn__Wno_pointer_sign=no +fi +rm -f conftest.err conftest.$ac_ext + CPPFLAGS="$save_CPPFLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn__Wno_pointer_sign" >&5 +$as_echo "$gl_cv_warn__Wno_pointer_sign" >&6; } +if test "x$gl_cv_warn__Wno_pointer_sign" = x""yes; then : + as_fn_append WARN_CFLAGS " -Wno-pointer-sign" +fi + # Too many warnings for now + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether compiler handles -Wno-unused-parameter" >&5 +$as_echo_n "checking whether compiler handles -Wno-unused-parameter... " >&6; } +if test "${gl_cv_warn__Wno_unused_parameter+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="${CPPFLAGS} -Wno-unused-parameter" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + gl_cv_warn__Wno_unused_parameter=yes +else + gl_cv_warn__Wno_unused_parameter=no +fi +rm -f conftest.err conftest.$ac_ext + CPPFLAGS="$save_CPPFLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn__Wno_unused_parameter" >&5 +$as_echo "$gl_cv_warn__Wno_unused_parameter" >&6; } +if test "x$gl_cv_warn__Wno_unused_parameter" = x""yes; then : + as_fn_append WARN_CFLAGS " -Wno-unused-parameter" +fi + # Too many warnings for now + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether compiler handles -fdiagnostics-show-option" >&5 +$as_echo_n "checking whether compiler handles -fdiagnostics-show-option... " >&6; } +if test "${gl_cv_warn__fdiagnostics_show_option+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="${CPPFLAGS} -fdiagnostics-show-option" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + gl_cv_warn__fdiagnostics_show_option=yes +else + gl_cv_warn__fdiagnostics_show_option=no +fi +rm -f conftest.err conftest.$ac_ext + CPPFLAGS="$save_CPPFLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn__fdiagnostics_show_option" >&5 +$as_echo "$gl_cv_warn__fdiagnostics_show_option" >&6; } +if test "x$gl_cv_warn__fdiagnostics_show_option" = x""yes; then : + as_fn_append WARN_CFLAGS " -fdiagnostics-show-option" +fi + + + + + +$as_echo "#define lint 1" >>confdefs.h + + +$as_echo "#define _FORTIFY_SOURCE 2" >>confdefs.h + + +$as_echo "#define GNULIB_PORTCHECK 1" >>confdefs.h + +fi for ac_header in vfork.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-coreutils@gnu.org ## -## ------------------------------------ ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - -fi -if test `eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` = yes; then +do : + ac_fn_c_check_header_mongrel "$LINENO" "vfork.h" "ac_cv_header_vfork_h" "$ac_includes_default" +if test "x$ac_cv_header_vfork_h" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define HAVE_VFORK_H 1 _ACEOF fi done - - for ac_func in fork vfork -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if test `eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` = yes; then +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +eval as_val=\$$as_ac_var + if test "x$as_val" = x""yes; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF @@ -49583,19 +40656,15 @@ fi done if test "x$ac_cv_func_fork" = xyes; then - { $as_echo "$as_me:$LINENO: checking for working fork" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working fork" >&5 $as_echo_n "checking for working fork... " >&6; } -if test "${ac_cv_func_fork_works+set}" = set; then +if test "${ac_cv_func_fork_works+set}" = set; then : $as_echo_n "(cached) " >&6 else - if test "$cross_compiling" = yes; then + if test "$cross_compiling" = yes; then : ac_cv_func_fork_works=cross else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int @@ -49609,43 +40678,17 @@ main () return 0; } _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_fork_works=yes else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_func_fork_works=no + ac_cv_func_fork_works=no fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi - fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_fork_works" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_fork_works" >&5 $as_echo "$ac_cv_func_fork_works" >&6; } else @@ -49661,24 +40704,20 @@ if test "x$ac_cv_func_fork_works" = xcross; then ac_cv_func_fork_works=yes ;; esac - { $as_echo "$as_me:$LINENO: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&5 $as_echo "$as_me: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&2;} fi ac_cv_func_vfork_works=$ac_cv_func_vfork if test "x$ac_cv_func_vfork" = xyes; then - { $as_echo "$as_me:$LINENO: checking for working vfork" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working vfork" >&5 $as_echo_n "checking for working vfork... " >&6; } -if test "${ac_cv_func_vfork_works+set}" = set; then +if test "${ac_cv_func_vfork_works+set}" = set; then : $as_echo_n "(cached) " >&6 else - if test "$cross_compiling" = yes; then + if test "$cross_compiling" = yes; then : ac_cv_func_vfork_works=cross else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Thanks to Paul Eggert for this test. */ $ac_includes_default @@ -49770,382 +40809,104 @@ main () } } _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_vfork_works=yes else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_func_vfork_works=no + ac_cv_func_vfork_works=no fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi - fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_vfork_works" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_vfork_works" >&5 $as_echo "$ac_cv_func_vfork_works" >&6; } fi; if test "x$ac_cv_func_fork_works" = xcross; then ac_cv_func_vfork_works=$ac_cv_func_vfork - { $as_echo "$as_me:$LINENO: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&5 $as_echo "$as_me: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&2;} fi if test "x$ac_cv_func_vfork_works" = xyes; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_WORKING_VFORK 1 -_ACEOF +$as_echo "#define HAVE_WORKING_VFORK 1" >>confdefs.h else -cat >>confdefs.h <<\_ACEOF -#define vfork fork -_ACEOF +$as_echo "#define vfork fork" >>confdefs.h fi if test "x$ac_cv_func_fork_works" = xyes; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_WORKING_FORK 1 -_ACEOF +$as_echo "#define HAVE_WORKING_FORK 1" >>confdefs.h fi - +optional_bin_progs= for ac_func in uname -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if test `eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` = yes; then +do : + ac_fn_c_check_func "$LINENO" "uname" "ac_cv_func_uname" +if test "x$ac_cv_func_uname" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define HAVE_UNAME 1 _ACEOF - OPTIONAL_BIN_PROGS="$OPTIONAL_BIN_PROGS uname\$(EXEEXT)" - MAN="$MAN uname.1" + { + if test -z "$optional_bin_progs"; then + optional_bin_progs=uname + else + optional_bin_progs="$optional_bin_progs uname" + fi +} fi done - for ac_func in chroot -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if test `eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` = yes; then +do : + ac_fn_c_check_func "$LINENO" "chroot" "ac_cv_func_chroot" +if test "x$ac_cv_func_chroot" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define HAVE_CHROOT 1 _ACEOF - OPTIONAL_BIN_PROGS="$OPTIONAL_BIN_PROGS chroot\$(EXEEXT)" - MAN="$MAN chroot.1" + { + if test -z "$optional_bin_progs"; then + optional_bin_progs=chroot + else + optional_bin_progs="$optional_bin_progs chroot" + fi +} fi done - for ac_func in gethostid -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if test `eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` = yes; then +do : + ac_fn_c_check_func "$LINENO" "gethostid" "ac_cv_func_gethostid" +if test "x$ac_cv_func_gethostid" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define HAVE_GETHOSTID 1 _ACEOF - OPTIONAL_BIN_PROGS="$OPTIONAL_BIN_PROGS hostid\$(EXEEXT)" - MAN="$MAN hostid.1" + { + if test -z "$optional_bin_progs"; then + optional_bin_progs=hostid + else + optional_bin_progs="$optional_bin_progs hostid" + fi +} fi done - { $as_echo "$as_me:$LINENO: checking whether use of struct winsize requires sys/ptem.h" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether use of struct winsize requires sys/ptem.h" >&5 $as_echo_n "checking whether use of struct winsize requires sys/ptem.h... " >&6; } -if test "${jm_cv_sys_struct_winsize_needs_sys_ptem_h+set}" = set; then +if test "${gl_cv_sys_struct_winsize_needs_sys_ptem_h+set}" = set; then : $as_echo_n "(cached) " >&6 else - jm_cv_sys_struct_winsize_needs_sys_ptem_h=yes + gl_cv_sys_struct_winsize_needs_sys_ptem_h=yes if test $ac_cv_sys_posix_termios = yes; then - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int @@ -50157,40 +40918,13 @@ struct winsize x; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - jm_cv_sys_struct_winsize_needs_sys_ptem_h=no -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_sys_struct_winsize_needs_sys_ptem_h=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi - if test $jm_cv_sys_struct_winsize_needs_sys_ptem_h = yes; then - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + if test $gl_cv_sys_struct_winsize_needs_sys_ptem_h = yes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int @@ -50202,60 +40936,33 @@ struct winsize x; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - : +if ac_fn_c_try_compile "$LINENO"; then : + else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - jm_cv_sys_struct_winsize_needs_sys_ptem_h=no + gl_cv_sys_struct_winsize_needs_sys_ptem_h=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi -{ $as_echo "$as_me:$LINENO: result: $jm_cv_sys_struct_winsize_needs_sys_ptem_h" >&5 -$as_echo "$jm_cv_sys_struct_winsize_needs_sys_ptem_h" >&6; } - if test $jm_cv_sys_struct_winsize_needs_sys_ptem_h = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_winsize_needs_sys_ptem_h" >&5 +$as_echo "$gl_cv_sys_struct_winsize_needs_sys_ptem_h" >&6; } + if test $gl_cv_sys_struct_winsize_needs_sys_ptem_h = yes; then -cat >>confdefs.h <<\_ACEOF -#define WINSIZE_IN_PTEM 1 -_ACEOF +$as_echo "#define WINSIZE_IN_PTEM 1" >>confdefs.h fi -{ $as_echo "$as_me:$LINENO: checking whether localtime caches TZ" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether localtime caches TZ" >&5 $as_echo_n "checking whether localtime caches TZ... " >&6; } -if test "${utils_cv_localtime_cache+set}" = set; then +if test "${utils_cv_localtime_cache+set}" = set; then : $as_echo_n "(cached) " >&6 else if test x$ac_cv_func_tzset = xyes; then -if test "$cross_compiling" = yes; then +if test "$cross_compiling" = yes; then : # If we have tzset, assume the worst when cross-compiling. utils_cv_localtime_cache=yes else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #if STDC_HEADERS @@ -50288,169 +40995,50 @@ int main() exit (0); } _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_run "$LINENO"; then : utils_cv_localtime_cache=no else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -utils_cv_localtime_cache=yes + utils_cv_localtime_cache=yes fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi - else # If we lack tzset, report that localtime does not cache TZ, # since we can't invalidate the cache if we don't have tzset. utils_cv_localtime_cache=no fi fi -{ $as_echo "$as_me:$LINENO: result: $utils_cv_localtime_cache" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $utils_cv_localtime_cache" >&5 $as_echo "$utils_cv_localtime_cache" >&6; } if test $utils_cv_localtime_cache = yes; then -cat >>confdefs.h <<\_ACEOF -#define LOCALTIME_CACHE 1 -_ACEOF +$as_echo "#define LOCALTIME_CACHE 1" >>confdefs.h fi # SCO-ODT-3.0 is reported to need -los to link programs using initgroups - for ac_func in initgroups -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if test `eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` = yes; then +do : + ac_fn_c_check_func "$LINENO" "initgroups" "ac_cv_func_initgroups" +if test "x$ac_cv_func_initgroups" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define HAVE_INITGROUPS 1 _ACEOF fi done if test $ac_cv_func_initgroups = no; then - -{ $as_echo "$as_me:$LINENO: checking for initgroups in -los" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for initgroups in -los" >&5 $as_echo_n "checking for initgroups in -los... " >&6; } -if test "${ac_cv_lib_os_initgroups+set}" = set; then +if test "${ac_cv_lib_os_initgroups+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-los $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. @@ -50468,40 +41056,18 @@ return initgroups (); return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_os_initgroups=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_os_initgroups=no + ac_cv_lib_os_initgroups=no fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_os_initgroups" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_os_initgroups" >&5 $as_echo "$ac_cv_lib_os_initgroups" >&6; } -if test $ac_cv_lib_os_initgroups = yes; then +if test "x$ac_cv_lib_os_initgroups" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBOS 1 _ACEOF @@ -50512,98 +41078,12 @@ fi fi - for ac_func in syslog -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if test `eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` = yes; then +do : + ac_fn_c_check_func "$LINENO" "syslog" "ac_cv_func_syslog" +if test "x$ac_cv_func_syslog" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define HAVE_SYSLOG 1 _ACEOF fi @@ -50613,18 +41093,14 @@ if test $ac_cv_func_syslog = no; then # syslog is not in the default libraries. See if it's in some other. for lib in bsd socket inet; do as_ac_Lib=`$as_echo "ac_cv_lib_$lib''_syslog" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for syslog in -l$lib" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for syslog in -l$lib" >&5 $as_echo_n "checking for syslog in -l$lib... " >&6; } -if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then +if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-l$lib $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. @@ -50642,47 +41118,22 @@ return syslog (); return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then +if ac_fn_c_try_link "$LINENO"; then : eval "$as_ac_Lib=yes" else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_Lib=no" + eval "$as_ac_Lib=no" fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -ac_res=`eval 'as_val=${'$as_ac_Lib'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +eval ac_res=\$$as_ac_Lib + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } -if test `eval 'as_val=${'$as_ac_Lib'} - $as_echo "$as_val"'` = yes; then +eval as_val=\$$as_ac_Lib + if test "x$as_val" = x""yes; then : -cat >>confdefs.h <<\_ACEOF -#define HAVE_SYSLOG 1 -_ACEOF +$as_echo "#define HAVE_SYSLOG 1" >>confdefs.h LIBS="$LIBS -l$lib"; break fi @@ -50690,16 +41141,12 @@ fi done fi -{ $as_echo "$as_me:$LINENO: checking for 3-argument setpriority function" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for 3-argument setpriority function" >&5 $as_echo_n "checking for 3-argument setpriority function... " >&6; } -if test "${utils_cv_func_setpriority+set}" = set; then +if test "${utils_cv_func_setpriority+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include @@ -50712,131 +41159,23 @@ setpriority (0, 0, 0); return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then +if ac_fn_c_try_link "$LINENO"; then : utils_cv_func_setpriority=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - utils_cv_func_setpriority=no + utils_cv_func_setpriority=no fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $utils_cv_func_setpriority" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $utils_cv_func_setpriority" >&5 $as_echo "$utils_cv_func_setpriority" >&6; } if test $utils_cv_func_setpriority = no; then - -for ac_func in nice -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if test `eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` = yes; then + for ac_func in nice +do : + ac_fn_c_check_func "$LINENO" "nice" "ac_cv_func_nice" +if test "x$ac_cv_func_nice" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define HAVE_NICE 1 _ACEOF fi @@ -50845,31 +41184,49 @@ done fi case $utils_cv_func_setpriority,$ac_cv_func_nice in *yes*) - OPTIONAL_BIN_PROGS="$OPTIONAL_BIN_PROGS nice\$(EXEEXT)" - MAN="$MAN nice.1";; + { + if test -z "$optional_bin_progs"; then + optional_bin_progs=nice + else + optional_bin_progs="$optional_bin_progs nice" + fi +} esac if test $ac_cv_header_utmp_h = yes || test $ac_cv_header_utmpx_h = yes; then - OPTIONAL_BIN_PROGS="$OPTIONAL_BIN_PROGS pinky\$(EXEEXT)" - OPTIONAL_BIN_PROGS="$OPTIONAL_BIN_PROGS users\$(EXEEXT)" - OPTIONAL_BIN_PROGS="$OPTIONAL_BIN_PROGS who\$(EXEEXT)" - MAN="$MAN pinky.1 users.1 who.1" + { + if test -z "$optional_bin_progs"; then + optional_bin_progs=who + else + optional_bin_progs="$optional_bin_progs who" + fi +} + { + if test -z "$optional_bin_progs"; then + optional_bin_progs=users + else + optional_bin_progs="$optional_bin_progs users" + fi +} + { + if test -z "$optional_bin_progs"; then + optional_bin_progs=pinky + else + optional_bin_progs="$optional_bin_progs pinky" + fi +} fi -{ $as_echo "$as_me:$LINENO: checking ut_host in struct utmp" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking ut_host in struct utmp" >&5 $as_echo_n "checking ut_host in struct utmp... " >&6; } -if test "${su_cv_func_ut_host_in_utmp+set}" = set; then +if test "${su_cv_func_ut_host_in_utmp+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include @@ -50881,59 +41238,31 @@ struct utmp ut; return !sizeof ut.ut_host; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then +if ac_fn_c_try_link "$LINENO"; then : su_cv_func_ut_host_in_utmp=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - su_cv_func_ut_host_in_utmp=no + su_cv_func_ut_host_in_utmp=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi - -{ $as_echo "$as_me:$LINENO: result: $su_cv_func_ut_host_in_utmp" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $su_cv_func_ut_host_in_utmp" >&5 $as_echo "$su_cv_func_ut_host_in_utmp" >&6; } if test $su_cv_func_ut_host_in_utmp = yes; then have_ut_host=1 -cat >>confdefs.h <<\_ACEOF -#define HAVE_UT_HOST 1 -_ACEOF +$as_echo "#define HAVE_UT_HOST 1" >>confdefs.h fi if test -z "$have_ut_host"; then - { $as_echo "$as_me:$LINENO: checking ut_host in struct utmpx" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking ut_host in struct utmpx" >&5 $as_echo_n "checking ut_host in struct utmpx... " >&6; } - if test "${su_cv_func_ut_host_in_utmpx+set}" = set; then + if test "${su_cv_func_ut_host_in_utmpx+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include @@ -50945,215 +41274,50 @@ struct utmpx ut; return !sizeof ut.ut_host; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then +if ac_fn_c_try_link "$LINENO"; then : su_cv_func_ut_host_in_utmpx=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - su_cv_func_ut_host_in_utmpx=no + su_cv_func_ut_host_in_utmpx=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi - - { $as_echo "$as_me:$LINENO: result: $su_cv_func_ut_host_in_utmpx" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $su_cv_func_ut_host_in_utmpx" >&5 $as_echo "$su_cv_func_ut_host_in_utmpx" >&6; } if test $su_cv_func_ut_host_in_utmpx = yes; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_UTMPX_H 1 -_ACEOF +$as_echo "#define HAVE_UTMPX_H 1" >>confdefs.h -cat >>confdefs.h <<\_ACEOF -#define HAVE_UT_HOST 1 -_ACEOF +$as_echo "#define HAVE_UT_HOST 1" >>confdefs.h fi fi - -for ac_func in sysctl -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if test `eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` = yes; then + for ac_func in sysctl +do : + ac_fn_c_check_func "$LINENO" "sysctl" "ac_cv_func_sysctl" +if test "x$ac_cv_func_sysctl" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define HAVE_SYSCTL 1 _ACEOF fi done - - - - - - -for ac_header in sys/sysctl.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default + for ac_header in sys/sysctl.h +do : + ac_fn_c_check_header_compile "$LINENO" "sys/sysctl.h" "ac_cv_header_sys_sysctl_h" "$ac_includes_default #if HAVE_SYS_PARAM_H #include #endif - -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - eval "$as_ac_Header=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_Header=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if test `eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` = yes; then +" +if test "x$ac_cv_header_sys_sysctl_h" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define HAVE_SYS_SYSCTL_H 1 _ACEOF fi @@ -51161,26 +41325,13 @@ fi done - - - - - - - - - - { $as_echo "$as_me:$LINENO: checking whether we can get the system boot time" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we can get the system boot time" >&5 $as_echo_n "checking whether we can get the system boot time... " >&6; } -if test "${gnulib_cv_have_boot_time+set}" = set; then +if test "${gnulib_cv_have_boot_time+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default #if HAVE_SYSCTL && HAVE_SYS_SYSCTL_H @@ -51212,54 +41363,33 @@ please_tell_us_how_to_determine_boot_time_on_your_system return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : gnulib_cv_have_boot_time=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - gnulib_cv_have_boot_time=no + gnulib_cv_have_boot_time=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $gnulib_cv_have_boot_time" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gnulib_cv_have_boot_time" >&5 $as_echo "$gnulib_cv_have_boot_time" >&6; } - if test $gnulib_cv_have_boot_time = yes; then - OPTIONAL_BIN_PROGS="$OPTIONAL_BIN_PROGS uptime\$(EXEEXT)" - MAN="$MAN uptime.1" + if test $gnulib_cv_have_boot_time = yes; then : + { + if test -z "$optional_bin_progs"; then + optional_bin_progs=uptime + else + optional_bin_progs="$optional_bin_progs uptime" + fi +} fi - -{ $as_echo "$as_me:$LINENO: checking POSIX termios" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking POSIX termios" >&5 $as_echo_n "checking POSIX termios... " >&6; } -if test "${ac_cv_sys_posix_termios+set}" = set; then +if test "${ac_cv_sys_posix_termios+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include @@ -51274,53 +41404,27 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then +if ac_fn_c_try_link "$LINENO"; then : ac_cv_sys_posix_termios=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_sys_posix_termios=no + ac_cv_sys_posix_termios=no fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_sys_posix_termios" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_posix_termios" >&5 $as_echo "$ac_cv_sys_posix_termios" >&6; } - { $as_echo "$as_me:$LINENO: checking whether use of TIOCGWINSZ requires sys/ioctl.h" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether use of TIOCGWINSZ requires sys/ioctl.h" >&5 $as_echo_n "checking whether use of TIOCGWINSZ requires sys/ioctl.h... " >&6; } -if test "${jm_cv_sys_tiocgwinsz_needs_sys_ioctl_h+set}" = set; then +if test "${gl_cv_sys_tiocgwinsz_needs_sys_ioctl_h+set}" = set; then : $as_echo_n "(cached) " >&6 else - jm_cv_sys_tiocgwinsz_needs_sys_ioctl_h=no + gl_cv_sys_tiocgwinsz_needs_sys_ioctl_h=no - if test $jm_cv_sys_tiocgwinsz_needs_termios_h = no; then - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + if test $gl_cv_sys_tiocgwinsz_needs_termios_h = no; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include # include @@ -51330,38 +41434,38 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes" >/dev/null 2>&1; then - jm_cv_sys_tiocgwinsz_needs_sys_ioctl_h=yes + $EGREP "yes" >/dev/null 2>&1; then : + gl_cv_sys_tiocgwinsz_needs_sys_ioctl_h=yes fi rm -f conftest* fi fi -{ $as_echo "$as_me:$LINENO: result: $jm_cv_sys_tiocgwinsz_needs_sys_ioctl_h" >&5 -$as_echo "$jm_cv_sys_tiocgwinsz_needs_sys_ioctl_h" >&6; } - if test $jm_cv_sys_tiocgwinsz_needs_sys_ioctl_h = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_tiocgwinsz_needs_sys_ioctl_h" >&5 +$as_echo "$gl_cv_sys_tiocgwinsz_needs_sys_ioctl_h" >&6; } + if test $gl_cv_sys_tiocgwinsz_needs_sys_ioctl_h = yes; then -cat >>confdefs.h <<\_ACEOF -#define GWINSZ_IN_SYS_IOCTL 1 -_ACEOF +$as_echo "#define GWINSZ_IN_SYS_IOCTL 1" >>confdefs.h fi if test $ac_cv_sys_posix_termios = yes; then - OPTIONAL_BIN_PROGS="$OPTIONAL_BIN_PROGS stty\$(EXEEXT)" MAN="$MAN stty.1" + { + if test -z "$optional_bin_progs"; then + optional_bin_progs=stty + else + optional_bin_progs="$optional_bin_progs stty" + fi +} - { $as_echo "$as_me:$LINENO: checking whether termios.h needs _XOPEN_SOURCE" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether termios.h needs _XOPEN_SOURCE" >&5 $as_echo_n "checking whether termios.h needs _XOPEN_SOURCE... " >&6; } - if test "${su_cv_sys_termios_needs_xopen_source+set}" = set; then + if test "${su_cv_sys_termios_needs_xopen_source+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #ifdef IUCLC @@ -51369,14 +41473,10 @@ yes #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes" >/dev/null 2>&1; then + $EGREP "yes" >/dev/null 2>&1; then : su_cv_sys_termios_needs_xopen_source=no else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _XOPEN_SOURCE #include @@ -51385,7 +41485,7 @@ yes #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes" >/dev/null 2>&1; then + $EGREP "yes" >/dev/null 2>&1; then : su_cv_sys_termios_needs_xopen_source=yes else su_cv_sys_termios_needs_xopen_source=no @@ -51397,25 +41497,19 @@ rm -f conftest* fi - { $as_echo "$as_me:$LINENO: result: $su_cv_sys_termios_needs_xopen_source" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $su_cv_sys_termios_needs_xopen_source" >&5 $as_echo "$su_cv_sys_termios_needs_xopen_source" >&6; } test $su_cv_sys_termios_needs_xopen_source = yes && -cat >>confdefs.h <<\_ACEOF -#define TERMIOS_NEEDS_XOPEN_SOURCE 1 -_ACEOF +$as_echo "#define TERMIOS_NEEDS_XOPEN_SOURCE 1" >>confdefs.h - { $as_echo "$as_me:$LINENO: checking c_line in struct termios" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking c_line in struct termios" >&5 $as_echo_n "checking c_line in struct termios... " >&6; } - if test "${su_cv_sys_c_line_in_termios+set}" = set; then + if test "${su_cv_sys_c_line_in_termios+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if TERMIOS_NEEDS_XOPEN_SOURCE #define _XOPEN_SOURCE @@ -51430,62 +41524,34 @@ struct termios t; return !sizeof t.c_line; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then +if ac_fn_c_try_link "$LINENO"; then : su_cv_sys_c_line_in_termios=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - su_cv_sys_c_line_in_termios=no + su_cv_sys_c_line_in_termios=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi - - { $as_echo "$as_me:$LINENO: result: $su_cv_sys_c_line_in_termios" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $su_cv_sys_c_line_in_termios" >&5 $as_echo "$su_cv_sys_c_line_in_termios" >&6; } test $su_cv_sys_c_line_in_termios = yes \ && -cat >>confdefs.h <<\_ACEOF -#define HAVE_C_LINE 1 -_ACEOF +$as_echo "#define HAVE_C_LINE 1" >>confdefs.h fi # FIXME: note that this macro appears above, too. # I'm leaving it here for now. This whole thing needs to be modernized... - { $as_echo "$as_me:$LINENO: checking whether use of struct winsize requires sys/ptem.h" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether use of struct winsize requires sys/ptem.h" >&5 $as_echo_n "checking whether use of struct winsize requires sys/ptem.h... " >&6; } -if test "${jm_cv_sys_struct_winsize_needs_sys_ptem_h+set}" = set; then +if test "${gl_cv_sys_struct_winsize_needs_sys_ptem_h+set}" = set; then : $as_echo_n "(cached) " >&6 else - jm_cv_sys_struct_winsize_needs_sys_ptem_h=yes + gl_cv_sys_struct_winsize_needs_sys_ptem_h=yes if test $ac_cv_sys_posix_termios = yes; then - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int @@ -51497,40 +41563,13 @@ struct winsize x; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - jm_cv_sys_struct_winsize_needs_sys_ptem_h=no -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_sys_struct_winsize_needs_sys_ptem_h=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi - if test $jm_cv_sys_struct_winsize_needs_sys_ptem_h = yes; then - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + if test $gl_cv_sys_struct_winsize_needs_sys_ptem_h = yes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int @@ -51542,59 +41581,32 @@ struct winsize x; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - : +if ac_fn_c_try_compile "$LINENO"; then : + else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - jm_cv_sys_struct_winsize_needs_sys_ptem_h=no + gl_cv_sys_struct_winsize_needs_sys_ptem_h=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi -{ $as_echo "$as_me:$LINENO: result: $jm_cv_sys_struct_winsize_needs_sys_ptem_h" >&5 -$as_echo "$jm_cv_sys_struct_winsize_needs_sys_ptem_h" >&6; } - if test $jm_cv_sys_struct_winsize_needs_sys_ptem_h = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_winsize_needs_sys_ptem_h" >&5 +$as_echo "$gl_cv_sys_struct_winsize_needs_sys_ptem_h" >&6; } + if test $gl_cv_sys_struct_winsize_needs_sys_ptem_h = yes; then -cat >>confdefs.h <<\_ACEOF -#define WINSIZE_IN_PTEM 1 -_ACEOF +$as_echo "#define WINSIZE_IN_PTEM 1" >>confdefs.h fi - { $as_echo "$as_me:$LINENO: checking whether use of TIOCGWINSZ requires termios.h" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether use of TIOCGWINSZ requires termios.h" >&5 $as_echo_n "checking whether use of TIOCGWINSZ requires termios.h... " >&6; } -if test "${jm_cv_sys_tiocgwinsz_needs_termios_h+set}" = set; then +if test "${gl_cv_sys_tiocgwinsz_needs_termios_h+set}" = set; then : $as_echo_n "(cached) " >&6 else - jm_cv_sys_tiocgwinsz_needs_termios_h=no + gl_cv_sys_tiocgwinsz_needs_termios_h=no if test $ac_cv_sys_posix_termios = yes; then - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include # include @@ -51604,30 +41616,26 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes" >/dev/null 2>&1; then - jm_cv_sys_tiocgwinsz_needs_termios_h=yes + $EGREP "yes" >/dev/null 2>&1; then : + gl_cv_sys_tiocgwinsz_needs_termios_h=yes fi rm -f conftest* fi fi -{ $as_echo "$as_me:$LINENO: result: $jm_cv_sys_tiocgwinsz_needs_termios_h" >&5 -$as_echo "$jm_cv_sys_tiocgwinsz_needs_termios_h" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_tiocgwinsz_needs_termios_h" >&5 +$as_echo "$gl_cv_sys_tiocgwinsz_needs_termios_h" >&6; } -if test $jm_cv_sys_tiocgwinsz_needs_termios_h = no && \ - test $jm_cv_sys_tiocgwinsz_needs_sys_ioctl_h = no; then - { $as_echo "$as_me:$LINENO: checking TIOCGWINSZ in sys/pty.h" >&5 +if test $gl_cv_sys_tiocgwinsz_needs_termios_h = no && \ + test $gl_cv_sys_tiocgwinsz_needs_sys_ioctl_h = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking TIOCGWINSZ in sys/pty.h" >&5 $as_echo_n "checking TIOCGWINSZ in sys/pty.h... " >&6; } - if test "${su_cv_sys_tiocgwinsz_in_sys_pty_h+set}" = set; then + if test "${su_cv_sys_tiocgwinsz_in_sys_pty_h+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #ifdef WINSIZE_IN_PTEM @@ -51645,482 +41653,86 @@ int x = TIOCGWINSZ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then +if ac_fn_c_try_link "$LINENO"; then : su_cv_sys_tiocgwinsz_in_sys_pty_h=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - su_cv_sys_tiocgwinsz_in_sys_pty_h=no + su_cv_sys_tiocgwinsz_in_sys_pty_h=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi - - { $as_echo "$as_me:$LINENO: result: $su_cv_sys_tiocgwinsz_in_sys_pty_h" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $su_cv_sys_tiocgwinsz_in_sys_pty_h" >&5 $as_echo "$su_cv_sys_tiocgwinsz_in_sys_pty_h" >&6; } test $su_cv_sys_tiocgwinsz_in_sys_pty_h = yes \ && -cat >>confdefs.h <<\_ACEOF -#define GWINSZ_IN_SYS_PTY 1 -_ACEOF +$as_echo "#define GWINSZ_IN_SYS_PTY 1" >>confdefs.h fi # For src/kill.c. -{ $as_echo "$as_me:$LINENO: checking whether strsignal is declared" >&5 -$as_echo_n "checking whether strsignal is declared... " >&6; } -if test "${ac_cv_have_decl_strsignal+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default +ac_fn_c_check_decl "$LINENO" "strsignal" "ac_cv_have_decl_strsignal" "$ac_includes_default #include - -int -main () -{ -#ifndef strsignal - (void) strsignal; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_strsignal=yes +" +if test "x$ac_cv_have_decl_strsignal" = x""yes; then : + ac_have_decl=1 else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_strsignal=no + ac_have_decl=0 fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_strsignal" >&5 -$as_echo "$ac_cv_have_decl_strsignal" >&6; } -if test $ac_cv_have_decl_strsignal = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_STRSIGNAL 1 +#define HAVE_DECL_STRSIGNAL $ac_have_decl _ACEOF - - -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_STRSIGNAL 0 -_ACEOF - - -fi -{ $as_echo "$as_me:$LINENO: checking whether sys_siglist is declared" >&5 -$as_echo_n "checking whether sys_siglist is declared... " >&6; } -if test "${ac_cv_have_decl_sys_siglist+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default +ac_fn_c_check_decl "$LINENO" "sys_siglist" "ac_cv_have_decl_sys_siglist" "$ac_includes_default #include - -int -main () -{ -#ifndef sys_siglist - (void) sys_siglist; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_sys_siglist=yes +" +if test "x$ac_cv_have_decl_sys_siglist" = x""yes; then : + ac_have_decl=1 else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_sys_siglist=no + ac_have_decl=0 fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_sys_siglist" >&5 -$as_echo "$ac_cv_have_decl_sys_siglist" >&6; } -if test $ac_cv_have_decl_sys_siglist = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_SYS_SIGLIST 1 +#define HAVE_DECL_SYS_SIGLIST $ac_have_decl _ACEOF - - -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_SYS_SIGLIST 0 -_ACEOF - - -fi -{ $as_echo "$as_me:$LINENO: checking whether _sys_siglist is declared" >&5 -$as_echo_n "checking whether _sys_siglist is declared... " >&6; } -if test "${ac_cv_have_decl__sys_siglist+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default +ac_fn_c_check_decl "$LINENO" "_sys_siglist" "ac_cv_have_decl__sys_siglist" "$ac_includes_default #include - -int -main () -{ -#ifndef _sys_siglist - (void) _sys_siglist; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl__sys_siglist=yes +" +if test "x$ac_cv_have_decl__sys_siglist" = x""yes; then : + ac_have_decl=1 else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl__sys_siglist=no + ac_have_decl=0 fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl__sys_siglist" >&5 -$as_echo "$ac_cv_have_decl__sys_siglist" >&6; } -if test $ac_cv_have_decl__sys_siglist = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL__SYS_SIGLIST 1 +#define HAVE_DECL__SYS_SIGLIST $ac_have_decl _ACEOF - - -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL__SYS_SIGLIST 0 -_ACEOF - - -fi -{ $as_echo "$as_me:$LINENO: checking whether __sys_siglist is declared" >&5 -$as_echo_n "checking whether __sys_siglist is declared... " >&6; } -if test "${ac_cv_have_decl___sys_siglist+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default +ac_fn_c_check_decl "$LINENO" "__sys_siglist" "ac_cv_have_decl___sys_siglist" "$ac_includes_default #include - -int -main () -{ -#ifndef __sys_siglist - (void) __sys_siglist; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl___sys_siglist=yes +" +if test "x$ac_cv_have_decl___sys_siglist" = x""yes; then : + ac_have_decl=1 else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl___sys_siglist=no + ac_have_decl=0 fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl___sys_siglist" >&5 -$as_echo "$ac_cv_have_decl___sys_siglist" >&6; } -if test $ac_cv_have_decl___sys_siglist = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL___SYS_SIGLIST 1 +#define HAVE_DECL___SYS_SIGLIST $ac_have_decl _ACEOF -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL___SYS_SIGLIST 0 -_ACEOF - - -fi - - - -# For src/kill.c and src/printf.c. -{ $as_echo "$as_me:$LINENO: checking whether strtoimax is declared" >&5 -$as_echo_n "checking whether strtoimax is declared... " >&6; } -if test "${ac_cv_have_decl_strtoimax+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef strtoimax - (void) strtoimax; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_strtoimax=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_strtoimax=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_strtoimax" >&5 -$as_echo "$ac_cv_have_decl_strtoimax" >&6; } -if test $ac_cv_have_decl_strtoimax = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_STRTOIMAX 1 -_ACEOF - - -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_STRTOIMAX 0 -_ACEOF - - -fi -{ $as_echo "$as_me:$LINENO: checking whether strtoumax is declared" >&5 -$as_echo_n "checking whether strtoumax is declared... " >&6; } -if test "${ac_cv_have_decl_strtoumax+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef strtoumax - (void) strtoumax; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_strtoumax=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_strtoumax=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_strtoumax" >&5 -$as_echo "$ac_cv_have_decl_strtoumax" >&6; } -if test $ac_cv_have_decl_strtoumax = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_STRTOUMAX 1 -_ACEOF - - -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_STRTOUMAX 0 -_ACEOF - - -fi - - - # Check for libypsec.a on Dolphin M88K machines. - -{ $as_echo "$as_me:$LINENO: checking for main in -lypsec" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lypsec" >&5 $as_echo_n "checking for main in -lypsec... " >&6; } -if test "${ac_cv_lib_ypsec_main+set}" = set; then +if test "${ac_cv_lib_ypsec_main+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lypsec $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -52132,40 +41744,18 @@ return main (); return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_ypsec_main=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_ypsec_main=no + ac_cv_lib_ypsec_main=no fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_ypsec_main" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ypsec_main" >&5 $as_echo "$ac_cv_lib_ypsec_main" >&6; } -if test $ac_cv_lib_ypsec_main = yes; then +if test "x$ac_cv_lib_ypsec_main" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBYPSEC 1 _ACEOF @@ -52176,19 +41766,14 @@ fi # m88k running dgux 5.4 needs this - -{ $as_echo "$as_me:$LINENO: checking for main in -lldgc" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lldgc" >&5 $as_echo_n "checking for main in -lldgc... " >&6; } -if test "${ac_cv_lib_ldgc_main+set}" = set; then +if test "${ac_cv_lib_ldgc_main+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lldgc $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -52200,40 +41785,18 @@ return main (); return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_ldgc_main=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_ldgc_main=no + ac_cv_lib_ldgc_main=no fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_ldgc_main" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ldgc_main" >&5 $as_echo "$ac_cv_lib_ldgc_main" >&6; } -if test $ac_cv_lib_ldgc_main = yes; then +if test "x$ac_cv_lib_ldgc_main" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBLDGC 1 _ACEOF @@ -52245,17 +41808,13 @@ fi # The -lsun library is required for YP support on Irix-4.0.5 systems. # m88k/svr3 DolphinOS systems using YP need -lypsec for id. - { $as_echo "$as_me:$LINENO: checking for library containing yp_match" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing yp_match" >&5 $as_echo_n "checking for library containing yp_match... " >&6; } -if test "${ac_cv_search_yp_match+set}" = set; then +if test "${ac_cv_search_yp_match+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. @@ -52280,51 +41839,27 @@ for ac_lib in '' sun ypsec; do ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi - rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_yp_match=$ac_res -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext - if test "${ac_cv_search_yp_match+set}" = set; then +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if test "${ac_cv_search_yp_match+set}" = set; then : break fi done -if test "${ac_cv_search_yp_match+set}" = set; then - : +if test "${ac_cv_search_yp_match+set}" = set; then : + else ac_cv_search_yp_match=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_yp_match" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_yp_match" >&5 $as_echo "$ac_cv_search_yp_match" >&6; } ac_res=$ac_cv_search_yp_match -if test "$ac_res" != no; then +if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi @@ -52332,17 +41867,13 @@ fi # SysV needs -lsec, older versions of Linux need -lshadow for # shadow passwords. UnixWare 7 needs -lgen. - { $as_echo "$as_me:$LINENO: checking for library containing getspnam" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing getspnam" >&5 $as_echo_n "checking for library containing getspnam... " >&6; } -if test "${ac_cv_search_getspnam+set}" = set; then +if test "${ac_cv_search_getspnam+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. @@ -52367,200 +41898,38 @@ for ac_lib in '' shadow sec gen; do ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi - rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_getspnam=$ac_res -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext - if test "${ac_cv_search_getspnam+set}" = set; then +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if test "${ac_cv_search_getspnam+set}" = set; then : break fi done -if test "${ac_cv_search_getspnam+set}" = set; then - : +if test "${ac_cv_search_getspnam+set}" = set; then : + else ac_cv_search_getspnam=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_getspnam" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_getspnam" >&5 $as_echo "$ac_cv_search_getspnam" >&6; } ac_res=$ac_cv_search_getspnam -if test "$ac_res" != no; then +if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi - -for ac_header in shadow.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-coreutils@gnu.org ## -## ------------------------------------ ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - -fi -if test `eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` = yes; then + for ac_header in shadow.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "shadow.h" "ac_cv_header_shadow_h" "$ac_includes_default" +if test "x$ac_cv_header_shadow_h" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define HAVE_SHADOW_H 1 _ACEOF fi @@ -52575,104 +41944,9 @@ $ac_includes_default # include #endif " - { $as_echo "$as_me:$LINENO: checking for struct spwd.sp_pwdp" >&5 -$as_echo_n "checking for struct spwd.sp_pwdp... " >&6; } -if test "${ac_cv_member_struct_spwd_sp_pwdp+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$shadow_includes - -int -main () -{ -static struct spwd ac_aggr; -if (ac_aggr.sp_pwdp) -return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_member_struct_spwd_sp_pwdp=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$shadow_includes - -int -main () -{ -static struct spwd ac_aggr; -if (sizeof ac_aggr.sp_pwdp) -return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_member_struct_spwd_sp_pwdp=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_member_struct_spwd_sp_pwdp=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_spwd_sp_pwdp" >&5 -$as_echo "$ac_cv_member_struct_spwd_sp_pwdp" >&6; } -if test $ac_cv_member_struct_spwd_sp_pwdp = yes; then + ac_fn_c_check_member "$LINENO" "struct spwd" "sp_pwdp" "ac_cv_member_struct_spwd_sp_pwdp" "$shadow_includes +" +if test "x$ac_cv_member_struct_spwd_sp_pwdp" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_SPWD_SP_PWDP 1 @@ -52681,98 +41955,12 @@ _ACEOF fi - -for ac_func in getspnam -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if test `eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` = yes; then + for ac_func in getspnam +do : + ac_fn_c_check_func "$LINENO" "getspnam" "ac_cv_func_getspnam" +if test "x$ac_cv_func_getspnam" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define HAVE_GETSPNAM 1 _ACEOF fi @@ -52782,17 +41970,13 @@ done # SCO-ODT-3.0 is reported to need -lufc for crypt. # NetBSD needs -lcrypt for crypt. cu_saved_libs="$LIBS" - { $as_echo "$as_me:$LINENO: checking for library containing crypt" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing crypt" >&5 $as_echo_n "checking for library containing crypt... " >&6; } -if test "${ac_cv_search_crypt+set}" = set; then +if test "${ac_cv_search_crypt+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. @@ -52817,51 +42001,27 @@ for ac_lib in '' ufc crypt; do ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi - rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_crypt=$ac_res -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext - if test "${ac_cv_search_crypt+set}" = set; then +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if test "${ac_cv_search_crypt+set}" = set; then : break fi done -if test "${ac_cv_search_crypt+set}" = set; then - : +if test "${ac_cv_search_crypt+set}" = set; then : + else ac_cv_search_crypt=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_crypt" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_crypt" >&5 $as_echo "$ac_cv_search_crypt" >&6; } ac_res=$ac_cv_search_crypt -if test "$ac_res" != no; then +if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" test "$ac_cv_search_crypt" = "none required" || LIB_CRYPT="$ac_cv_search_crypt" @@ -52871,22 +42031,285 @@ fi + LIB_GMP= - { $as_echo "$as_me:$LINENO: checking whether NLS is requested" >&5 + + +# Check whether --with-gmp was given. +if test "${with_gmp+set}" = set; then : + withval=$with_gmp; cu_use_gmp=$withval +else + cu_use_gmp=auto +fi + + + if test $cu_use_gmp != no; then + cu_saved_libs=$LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing __gmpz_init" >&5 +$as_echo_n "checking for library containing __gmpz_init... " >&6; } +if test "${ac_cv_search___gmpz_init+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char __gmpz_init (); +int +main () +{ +return __gmpz_init (); + ; + return 0; +} +_ACEOF +for ac_lib in '' gmp; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search___gmpz_init=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if test "${ac_cv_search___gmpz_init+set}" = set; then : + break +fi +done +if test "${ac_cv_search___gmpz_init+set}" = set; then : + +else + ac_cv_search___gmpz_init=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search___gmpz_init" >&5 +$as_echo "$ac_cv_search___gmpz_init" >&6; } +ac_res=$ac_cv_search___gmpz_init +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + test "$ac_cv_search___gmpz_init" = "none required" || + { + LIB_GMP=$ac_cv_search___gmpz_init + +$as_echo "#define HAVE_GMP 1" >>confdefs.h + + } +fi + + LIBS=$cu_saved_libs + fi + + +# Build df only if there's a point to it. +if test $gl_cv_list_mounted_fs = yes && test $gl_cv_fs_space = yes; then + { + if test -z "$optional_bin_progs"; then + optional_bin_progs=df + else + optional_bin_progs="$optional_bin_progs df" + fi +} +fi + +############################################################################ +mk="$srcdir/src/Makefile.am" +# Extract all literal names from the definition of $(EXTRA_PROGRAMS) +# in $mk but don't expand the variable references. +# Append each literal name to $optional_bin_progs. +v=EXTRA_PROGRAMS +for gl_i in `sed -n '/^'$v' =/,/[^\]$/p' $mk \ + | sed 's/^ *//;/^\$.*/d;/^'$v' =/d' \ + | tr -s '\\015\\012\\\\' ' '`; do + { + if test -z "$optional_bin_progs"; then + optional_bin_progs=$gl_i + else + optional_bin_progs="$optional_bin_progs $gl_i" + fi +} +done + +# As above, extract literal names from the definition of $(no_install__progs) +# in $mk but don't expand the variable references. +v=no_install__progs +t=`sed -n '/^'$v' =/,/[^\]$/p' $mk \ + | sed 's/^ *//;/^\$.*/d;/^'$v' =/d' \ + | tr -s '\\015\\012\\\\' ' '` +# Remove any trailing space. +no_install_progs_default=`echo "$t"|sed 's/ $//'` + +# Unfortunately, due to the way autoconf's AS_HELP_STRING works, the list +# of default-not-installed programs, "arch hostname su", must appear in two +# places: in this file below, and in $mk. Using "$no_install_progs_default" +# below cannot work. And we can't substitute the names into $mk because +# automake needs the literals, too. +# The compromise is to ensure that the space-separated list extracted +# above matches the literal 2nd argument below. +c="$srcdir/configure.ac" +re='^g''l_INCLUDE_EXCLUDE_PROG(.* \[\(.*\)\])' +t=`sed -n '/'"$re"'/{s/'"$re"'/\1/;s/,/ /gp +}' $c` +case $t in + $no_install_progs_default) ;; + *) { as_fn_set_status 1 +as_fn_error "internal error: g'l_INCLUDE_EXCLUDE_PROG's 2nd arg, $t, + does not match the list of default-not-installed programs + ($no_install_progs_default) also recorded in $mk" "$LINENO" 5; } ;; +esac + +# Given the name of a variable containing a space-separated list of +# install-by-default programs and the actual list do-not-install-by-default +# programs, modify the former variable to reflect any "do-install" and +# "don't-install" requests. +# I.e., add any program name specified via --enable-install-program=..., and +# remove any program name specified via --enable-no-install-program=... +# Note how the second argument below is a literal, with "," separators. +# That is required due to the way the macro works, and since the +# corresponding ./configure option argument is comma-separated on input. +{ + gl_no_install_progs_default=`echo 'arch,hostname,su'|sed 's/,/ /g'` + # Check whether --enable-install-program was given. +if test "${enable_install_program+set}" = set; then : + enableval=$enable_install_program; gl_do_install_prog=$enableval +else + gl_do_install_prog= + +fi + + + # If you want to refrain from installing programs A and B, + # use --enable-no-install-program=A,B + # Check whether --enable-no-install-program was given. +if test "${enable_no_install_program+set}" = set; then : + enableval=$enable_no_install_program; gl_no_install_prog=$enableval +else + gl_no_install_prog= + +fi + + + # Convert to space separated lists. + gl_do_install_prog=`echo "$gl_do_install_prog"|tr -s , ' '` + gl_no_install_prog=`echo "$gl_no_install_prog"|tr -s , ' '` + + # For each not-to-be-installed program name, ensure that it's a + # valid name, remove it from the list of programs to build/install, + # as well as from the list of man pages to install. + for gl_i in $gl_no_install_prog; do + + # Fail upon a request to install and not-install the same program. + case " $gl_do_install_prog " in + *" $gl_i "*) as_fn_error "'$gl_i' is both included and excluded" "$LINENO" 5 ;; + esac + + gl_msg= + # Warn about a request not to install a program that is not being + # built (which may be because the systems lacks a required interface). + case " $optional_bin_progs " in + *" $gl_i "*) { + optional_bin_progs=`for gl_rem_i in $optional_bin_progs; do + test "$gl_rem_i" = "$gl_i" || echo "$gl_rem_i" + done | tr '\012' ' ' | sed 's/ $//'; echo` +} ;; + *) gl_msg="'$gl_i' is already not being installed" ;; + esac + + if test "$gl_msg" = ''; then + # Warn about a request not to install a program that is + # already on the default-no-install list. + case " $gl_no_install_progs_default " in + *" $gl_i "*) gl_msg="by default, '$gl_i' is not installed" ;; + esac + fi + + test "$gl_msg" != '' && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $gl_msg" >&5 +$as_echo "$as_me: WARNING: $gl_msg" >&2;} + done + + for gl_i in $gl_do_install_prog; do + case " $gl_no_install_progs_default " in + *" $gl_i "*) { + if test -z "$optional_bin_progs"; then + optional_bin_progs=$gl_i + else + optional_bin_progs="$optional_bin_progs $gl_i" + fi +} ;; + *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$gl_i' is not an optionally-installable program" >&5 +$as_echo "$as_me: WARNING: '$gl_i' is not an optionally-installable program" >&2;} ;; + esac + done +} + +# Set INSTALL_SU if su installation has been requested via +# --enable-install-program=su. + +case " $optional_bin_progs " in + *' su '*) INSTALL_SU=yes ;; + *) INSTALL_SU=no ;; +esac + +MAN=`echo "$optional_bin_progs "|sed 's/ /.1 /g;s/ $//'|tr -d '\\015\\012'` + +# Change ginstall.1 to "install.h" in $MAN. +MAN=`for m in $MAN; do test $m = ginstall.1 && m=install.1; echo $m; done \ + | tr '\015\012' ' '; echo` + +# Remove [.1, since writing a portable rule for it in man/Makefile.am +# is not practical. The sed LHS below uses the autoconf quadrigraph +# representing '['. +MAN=`echo "$MAN"|sed 's/\[\.1//'` + +OPTIONAL_BIN_PROGS=`echo "$optional_bin_progs "|sed 's/ /\$(EXEEXT) /g;s/ $//'` + +NO_INSTALL_PROGS_DEFAULT=$no_install_progs_default + + + if test "$cross_compiling" = yes; then + CROSS_COMPILING_TRUE= + CROSS_COMPILING_FALSE='#' +else + CROSS_COMPILING_TRUE='#' + CROSS_COMPILING_FALSE= +fi + + +# Arrange to rerun configure whenever the file, src/Makefile.am, +# containing the list of program names changes. +CONFIG_STATUS_DEPENDENCIES='$(top_srcdir)/src/Makefile.am' + +############################################################################ + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NLS is requested" >&5 $as_echo_n "checking whether NLS is requested... " >&6; } # Check whether --enable-nls was given. -if test "${enable_nls+set}" = set; then +if test "${enable_nls+set}" = set; then : enableval=$enable_nls; USE_NLS=$enableval else USE_NLS=yes fi - { $as_echo "$as_me:$LINENO: result: $USE_NLS" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_NLS" >&5 $as_echo "$USE_NLS" >&6; } + GETTEXT_MACRO_VERSION=0.17 + + # Prepare PATH_SEPARATOR. @@ -52919,9 +42342,9 @@ rm -f conf$$.file # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_MSGFMT+set}" = set; then +if test "${ac_cv_path_MSGFMT+set}" = set; then : $as_echo_n "(cached) " >&6 else case "$MSGFMT" in @@ -52951,18 +42374,18 @@ esac fi MSGFMT="$ac_cv_path_MSGFMT" if test "$MSGFMT" != ":"; then - { $as_echo "$as_me:$LINENO: result: $MSGFMT" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGFMT" >&5 $as_echo "$MSGFMT" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_GMSGFMT+set}" = set; then +if test "${ac_cv_path_GMSGFMT+set}" = set; then : $as_echo_n "(cached) " >&6 else case $GMSGFMT in @@ -52975,14 +42398,14 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_GMSGFMT="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT" @@ -52991,10 +42414,10 @@ esac fi GMSGFMT=$ac_cv_path_GMSGFMT if test -n "$GMSGFMT"; then - { $as_echo "$as_me:$LINENO: result: $GMSGFMT" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GMSGFMT" >&5 $as_echo "$GMSGFMT" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -53042,9 +42465,9 @@ rm -f conf$$.file # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_XGETTEXT+set}" = set; then +if test "${ac_cv_path_XGETTEXT+set}" = set; then : $as_echo_n "(cached) " >&6 else case "$XGETTEXT" in @@ -53074,10 +42497,10 @@ esac fi XGETTEXT="$ac_cv_path_XGETTEXT" if test "$XGETTEXT" != ":"; then - { $as_echo "$as_me:$LINENO: result: $XGETTEXT" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XGETTEXT" >&5 $as_echo "$XGETTEXT" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -53120,9 +42543,9 @@ rm -f conf$$.file # Extract the first word of "msgmerge", so it can be a program name with args. set dummy msgmerge; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_MSGMERGE+set}" = set; then +if test "${ac_cv_path_MSGMERGE+set}" = set; then : $as_echo_n "(cached) " >&6 else case "$MSGMERGE" in @@ -53151,10 +42574,10 @@ esac fi MSGMERGE="$ac_cv_path_MSGMERGE" if test "$MSGMERGE" != ":"; then - { $as_echo "$as_me:$LINENO: result: $MSGMERGE" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGMERGE" >&5 $as_echo "$MSGMERGE" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -53162,6 +42585,9 @@ fi test -n "$localedir" || localedir='${datadir}/locale' + test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS= + + ac_config_commands="$ac_config_commands po-directories" @@ -53188,18 +42614,14 @@ fi - { $as_echo "$as_me:$LINENO: checking for CFPreferencesCopyAppValue" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CFPreferencesCopyAppValue" >&5 $as_echo_n "checking for CFPreferencesCopyAppValue... " >&6; } -if test "${gt_cv_func_CFPreferencesCopyAppValue+set}" = set; then +if test "${gt_cv_func_CFPreferencesCopyAppValue+set}" = set; then : $as_echo_n "(cached) " >&6 else gt_save_LIBS="$LIBS" LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int @@ -53210,58 +42632,30 @@ CFPreferencesCopyAppValue(NULL, NULL) return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then +if ac_fn_c_try_link "$LINENO"; then : gt_cv_func_CFPreferencesCopyAppValue=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - gt_cv_func_CFPreferencesCopyAppValue=no + gt_cv_func_CFPreferencesCopyAppValue=no fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS="$gt_save_LIBS" fi -{ $as_echo "$as_me:$LINENO: result: $gt_cv_func_CFPreferencesCopyAppValue" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_CFPreferencesCopyAppValue" >&5 $as_echo "$gt_cv_func_CFPreferencesCopyAppValue" >&6; } if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_CFPREFERENCESCOPYAPPVALUE 1 -_ACEOF +$as_echo "#define HAVE_CFPREFERENCESCOPYAPPVALUE 1" >>confdefs.h fi - { $as_echo "$as_me:$LINENO: checking for CFLocaleCopyCurrent" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CFLocaleCopyCurrent" >&5 $as_echo_n "checking for CFLocaleCopyCurrent... " >&6; } -if test "${gt_cv_func_CFLocaleCopyCurrent+set}" = set; then +if test "${gt_cv_func_CFLocaleCopyCurrent+set}" = set; then : $as_echo_n "(cached) " >&6 else gt_save_LIBS="$LIBS" LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int @@ -53272,44 +42666,20 @@ CFLocaleCopyCurrent(); return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then +if ac_fn_c_try_link "$LINENO"; then : gt_cv_func_CFLocaleCopyCurrent=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - gt_cv_func_CFLocaleCopyCurrent=no + gt_cv_func_CFLocaleCopyCurrent=no fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS="$gt_save_LIBS" fi -{ $as_echo "$as_me:$LINENO: result: $gt_cv_func_CFLocaleCopyCurrent" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_CFLocaleCopyCurrent" >&5 $as_echo "$gt_cv_func_CFLocaleCopyCurrent" >&6; } if test $gt_cv_func_CFLocaleCopyCurrent = yes; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_CFLOCALECOPYCURRENT 1 -_ACEOF +$as_echo "#define HAVE_CFLOCALECOPYCURRENT 1" >>confdefs.h fi INTL_MACOSX_LIBS= @@ -53354,16 +42724,12 @@ typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; gt_expression_test_code= fi - { $as_echo "$as_me:$LINENO: checking for GNU gettext in libc" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU gettext in libc" >&5 $as_echo_n "checking for GNU gettext in libc... " >&6; } -if { as_var=$gt_func_gnugettext_libc; eval "test \"\${$as_var+set}\" = set"; }; then +if { as_var=$gt_func_gnugettext_libc; eval "test \"\${$as_var+set}\" = set"; }; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include $gt_revision_test_code @@ -53378,39 +42744,16 @@ return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_b return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then +if ac_fn_c_try_link "$LINENO"; then : eval "$gt_func_gnugettext_libc=yes" else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$gt_func_gnugettext_libc=no" + eval "$gt_func_gnugettext_libc=no" fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval 'as_val=${'$gt_func_gnugettext_libc'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +eval ac_res=\$$gt_func_gnugettext_libc + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then @@ -53444,19 +42787,15 @@ $as_echo "$ac_res" >&6; } done - { $as_echo "$as_me:$LINENO: checking for iconv" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv" >&5 $as_echo_n "checking for iconv... " >&6; } -if test "${am_cv_func_iconv+set}" = set; then +if test "${am_cv_func_iconv+set}" = set; then : $as_echo_n "(cached) " >&6 else am_cv_func_iconv="no, consider installing GNU libiconv" am_cv_lib_iconv=no - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include @@ -53470,43 +42809,15 @@ iconv_t cd = iconv_open("",""); return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then +if ac_fn_c_try_link "$LINENO"; then : am_cv_func_iconv=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext if test "$am_cv_func_iconv" != yes; then am_save_LIBS="$LIBS" LIBS="$LIBS $LIBICONV" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include @@ -53520,53 +42831,125 @@ iconv_t cd = iconv_open("",""); return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then +if ac_fn_c_try_link "$LINENO"; then : am_cv_lib_iconv=yes am_cv_func_iconv=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS="$am_save_LIBS" fi fi -{ $as_echo "$as_me:$LINENO: result: $am_cv_func_iconv" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv" >&5 $as_echo "$am_cv_func_iconv" >&6; } if test "$am_cv_func_iconv" = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working iconv" >&5 +$as_echo_n "checking for working iconv... " >&6; } +if test "${am_cv_func_iconv_works+set}" = set; then : + $as_echo_n "(cached) " >&6 +else -cat >>confdefs.h <<\_ACEOF -#define HAVE_ICONV 1 + am_save_LIBS="$LIBS" + if test $am_cv_lib_iconv = yes; then + LIBS="$LIBS $LIBICONV" + fi + if test "$cross_compiling" = yes; then : + case "$host_os" in + aix* | hpux*) am_cv_func_iconv_works="guessing no" ;; + *) am_cv_func_iconv_works="guessing yes" ;; + esac +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +int main () +{ + /* Test against AIX 5.1 bug: Failures are not distinguishable from successful + returns. */ + { + iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8"); + if (cd_utf8_to_88591 != (iconv_t)(-1)) + { + static const char input[] = "\342\202\254"; /* EURO SIGN */ + char buf[10]; + const char *inptr = input; + size_t inbytesleft = strlen (input); + char *outptr = buf; + size_t outbytesleft = sizeof (buf); + size_t res = iconv (cd_utf8_to_88591, + (char **) &inptr, &inbytesleft, + &outptr, &outbytesleft); + if (res == 0) + return 1; + } + } +#if 0 /* This bug could be worked around by the caller. */ + /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */ + { + iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591"); + if (cd_88591_to_utf8 != (iconv_t)(-1)) + { + static const char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337"; + char buf[50]; + const char *inptr = input; + size_t inbytesleft = strlen (input); + char *outptr = buf; + size_t outbytesleft = sizeof (buf); + size_t res = iconv (cd_88591_to_utf8, + (char **) &inptr, &inbytesleft, + &outptr, &outbytesleft); + if ((int)res > 0) + return 1; + } + } +#endif + /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is + provided. */ + if (/* Try standardized names. */ + iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1) + /* Try IRIX, OSF/1 names. */ + && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1) + /* Try AIX names. */ + && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1) + /* Try HP-UX names. */ + && iconv_open ("utf8", "eucJP") == (iconv_t)(-1)) + return 1; + return 0; +} _ACEOF +if ac_fn_c_try_run "$LINENO"; then : + am_cv_func_iconv_works=yes +else + am_cv_func_iconv_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi + + LIBS="$am_save_LIBS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv_works" >&5 +$as_echo "$am_cv_func_iconv_works" >&6; } + case "$am_cv_func_iconv_works" in + *no) am_func_iconv=no am_cv_lib_iconv=no ;; + *) am_func_iconv=yes ;; + esac + else + am_func_iconv=no am_cv_lib_iconv=no + fi + if test "$am_func_iconv" = yes; then + +$as_echo "#define HAVE_ICONV 1" >>confdefs.h fi if test "$am_cv_lib_iconv" = yes; then - { $as_echo "$as_me:$LINENO: checking how to link with libiconv" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link with libiconv" >&5 $as_echo_n "checking how to link with libiconv... " >&6; } - { $as_echo "$as_me:$LINENO: result: $LIBICONV" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBICONV" >&5 $as_echo "$LIBICONV" >&6; } else CPPFLAGS="$am_save_CPPFLAGS" @@ -53581,6 +42964,9 @@ $as_echo "$LIBICONV" >&6; } + + + use_additional=yes acl_save_prefix="$prefix" @@ -53596,7 +42982,7 @@ $as_echo "$LIBICONV" >&6; } # Check whether --with-libintl-prefix was given. -if test "${with_libintl_prefix+set}" = set; then +if test "${with_libintl_prefix+set}" = set; then : withval=$with_libintl_prefix; if test "X$withval" = "Xno"; then use_additional=no @@ -53617,6 +43003,10 @@ if test "${with_libintl_prefix+set}" = set; then else additional_includedir="$withval/include" additional_libdir="$withval/$acl_libdirstem" + if test "$acl_libdirstem2" != "$acl_libdirstem" \ + && ! test -d "$withval/$acl_libdirstem"; then + additional_libdir="$withval/$acl_libdirstem2" + fi fi fi @@ -53768,7 +43158,9 @@ fi if test "X$found_dir" != "X"; then LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$found_dir -l$name" if test "X$found_so" != "X"; then - if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/$acl_libdirstem"; then + if test "$enable_rpath" = no \ + || test "X$found_dir" = "X/usr/$acl_libdirstem" \ + || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" else haveit= @@ -53835,7 +43227,16 @@ fi case "$found_dir" in */$acl_libdirstem | */$acl_libdirstem/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` - LIBINTL_PREFIX="$basedir" + if test "$name" = 'intl'; then + LIBINTL_PREFIX="$basedir" + fi + additional_includedir="$basedir/include" + ;; + */$acl_libdirstem2 | */$acl_libdirstem2/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'` + if test "$name" = 'intl'; then + LIBINTL_PREFIX="$basedir" + fi additional_includedir="$basedir/include" ;; esac @@ -53884,9 +43285,11 @@ fi case "$dep" in -L*) additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` - if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then + if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \ + && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then haveit= - if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then + if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \ + || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; @@ -54012,20 +43415,21 @@ fi done fi - { $as_echo "$as_me:$LINENO: checking for GNU gettext in libintl" >&5 + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU gettext in libintl" >&5 $as_echo_n "checking for GNU gettext in libintl... " >&6; } -if { as_var=$gt_func_gnugettext_libintl; eval "test \"\${$as_var+set}\" = set"; }; then +if { as_var=$gt_func_gnugettext_libintl; eval "test \"\${$as_var+set}\" = set"; }; then : $as_echo_n "(cached) " >&6 else gt_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $INCINTL" gt_save_LIBS="$LIBS" LIBS="$LIBS $LIBINTL" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include $gt_revision_test_code @@ -54044,42 +43448,16 @@ return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_a return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then +if ac_fn_c_try_link "$LINENO"; then : eval "$gt_func_gnugettext_libintl=yes" else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$gt_func_gnugettext_libintl=no" + eval "$gt_func_gnugettext_libintl=no" fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then LIBS="$LIBS $LIBICONV" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include $gt_revision_test_code @@ -54098,45 +43476,20 @@ return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_a return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then +if ac_fn_c_try_link "$LINENO"; then : LIBINTL="$LIBINTL $LIBICONV" LTLIBINTL="$LTLIBINTL $LTLIBICONV" eval "$gt_func_gnugettext_libintl=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi CPPFLAGS="$gt_save_CPPFLAGS" LIBS="$gt_save_LIBS" fi -ac_res=`eval 'as_val=${'$gt_func_gnugettext_libintl'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +eval ac_res=\$$gt_func_gnugettext_libintl + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi @@ -54164,21 +43517,19 @@ $as_echo "$ac_res" >&6; } if test "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then -cat >>confdefs.h <<\_ACEOF -#define ENABLE_NLS 1 -_ACEOF +$as_echo "#define ENABLE_NLS 1" >>confdefs.h else USE_NLS=no fi fi - { $as_echo "$as_me:$LINENO: checking whether to use NLS" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use NLS" >&5 $as_echo_n "checking whether to use NLS... " >&6; } - { $as_echo "$as_me:$LINENO: result: $USE_NLS" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_NLS" >&5 $as_echo "$USE_NLS" >&6; } if test "$USE_NLS" = "yes"; then - { $as_echo "$as_me:$LINENO: checking where the gettext function comes from" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking where the gettext function comes from" >&5 $as_echo_n "checking where the gettext function comes from... " >&6; } if test "$gt_use_preinstalled_gnugettext" = "yes"; then if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then @@ -54189,7 +43540,7 @@ $as_echo_n "checking where the gettext function comes from... " >&6; } else gt_source="included intl directory" fi - { $as_echo "$as_me:$LINENO: result: $gt_source" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_source" >&5 $as_echo "$gt_source" >&6; } fi @@ -54197,9 +43548,9 @@ $as_echo "$gt_source" >&6; } if test "$gt_use_preinstalled_gnugettext" = "yes"; then if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then - { $as_echo "$as_me:$LINENO: checking how to link with libintl" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link with libintl" >&5 $as_echo_n "checking how to link with libintl... " >&6; } - { $as_echo "$as_me:$LINENO: result: $LIBINTL" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBINTL" >&5 $as_echo "$LIBINTL" >&6; } for element in $INCINTL; do @@ -54227,14 +43578,10 @@ $as_echo "$LIBINTL" >&6; } fi -cat >>confdefs.h <<\_ACEOF -#define HAVE_GETTEXT 1 -_ACEOF +$as_echo "#define HAVE_GETTEXT 1" >>confdefs.h -cat >>confdefs.h <<\_ACEOF -#define HAVE_DCGETTEXT 1 -_ACEOF +$as_echo "#define HAVE_DCGETTEXT 1" >>confdefs.h fi @@ -54252,7 +43599,110 @@ _ACEOF -ac_config_files="$ac_config_files Makefile doc/Makefile lib/Makefile man/Makefile po/Makefile.in src/Makefile tests/Makefile tests/chgrp/Makefile tests/chmod/Makefile tests/chown/Makefile tests/cp/Makefile tests/cut/Makefile tests/dd/Makefile tests/dircolors/Makefile tests/du/Makefile tests/expr/Makefile tests/factor/Makefile tests/fmt/Makefile tests/head/Makefile tests/install/Makefile tests/join/Makefile tests/ln/Makefile tests/ls-2/Makefile tests/ls/Makefile tests/md5sum/Makefile tests/misc/Makefile tests/mkdir/Makefile tests/mv/Makefile tests/od/Makefile tests/pr/Makefile tests/readlink/Makefile tests/rm/Makefile tests/rmdir/Makefile tests/seq/Makefile tests/sha1sum/Makefile tests/shred/Makefile tests/sort/Makefile tests/stty/Makefile tests/sum/Makefile tests/tac/Makefile tests/tail-2/Makefile tests/tail/Makefile tests/tee/Makefile tests/test/Makefile tests/touch/Makefile tests/tr/Makefile tests/tsort/Makefile tests/unexpand/Makefile tests/uniq/Makefile tests/wc/Makefile" +# For a test of uniq: it uses the $LOCALE_FR envvar. + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5 +$as_echo_n "checking for a traditional french locale... " >&6; } +if test "${gt_cv_locale_fr+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () { + /* Check whether the given locale name is recognized by the system. */ + if (setlocale (LC_ALL, "") == NULL) return 1; + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only + one byte long. This excludes the UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1; + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO-8859-1 + else + # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name. + if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO8859-1 + else + # Test for the HP-UX locale name. + if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.iso88591 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr + else + # None found. + gt_cv_locale_fr=none + fi + fi + fi + fi + fi + fi + rm -fr conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5 +$as_echo "$gt_cv_locale_fr" >&6; } + LOCALE_FR=$gt_cv_locale_fr + + + +ac_config_files="$ac_config_files Makefile doc/Makefile lib/Makefile man/Makefile po/Makefile.in src/Makefile tests/Makefile gnulib-tests/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -54281,13 +43731,13 @@ _ACEOF case $ac_val in #( *${as_nl}*) case $ac_var in #( - *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 -$as_echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) $as_unset $ac_var ;; + *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done @@ -54295,8 +43745,8 @@ $as_echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) - # `set' does not quote correctly, so add quotes (double-quote - # substitution turns \\\\ into \\, and sed turns \\ into \). + # `set' does not quote correctly, so add quotes: double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" @@ -54319,11 +43769,11 @@ $as_echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && - { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else - { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi @@ -54343,37 +43793,42 @@ for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. - ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" - ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs + if test -n "$EXEEXT"; then + am__EXEEXT_TRUE= + am__EXEEXT_FALSE='#' +else + am__EXEEXT_TRUE='#' + am__EXEEXT_FALSE= +fi + if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then - { { $as_echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. -Usually this means the macro was only invoked conditionally." >&5 -$as_echo "$as_me: error: conditional \"AMDEP\" was never defined. -Usually this means the macro was only invoked conditionally." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then - { { $as_echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. -Usually this means the macro was only invoked conditionally." >&5 -$as_echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. -Usually this means the macro was only invoked conditionally." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${GL_COND_LIBTOOL_TRUE}" && test -z "${GL_COND_LIBTOOL_FALSE}"; then - { { $as_echo "$as_me:$LINENO: error: conditional \"GL_COND_LIBTOOL\" was never defined. -Usually this means the macro was only invoked conditionally." >&5 -$as_echo "$as_me: error: conditional \"GL_COND_LIBTOOL\" was never defined. -Usually this means the macro was only invoked conditionally." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "conditional \"GL_COND_LIBTOOL\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi test "X$DEFS" = X-DHAVE_CONFIG_H && DEFS= +if test -z "${GNU_MAKE_TRUE}" && test -z "${GNU_MAKE_FALSE}"; then + as_fn_error "conditional \"GNU_MAKE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + + gl_libobjs= gl_ltlibobjs= if test -n "$gl_LIBOBJS"; then @@ -54390,12 +43845,35 @@ test "X$DEFS" = X-DHAVE_CONFIG_H && DEFS= + + gltests_libobjs= + gltests_ltlibobjs= + if test -n "$gltests_LIBOBJS"; then + # Remove the extension. + sed_drop_objext='s/\.o$//;s/\.obj$//' + for i in `for i in $gltests_LIBOBJS; do echo "$i"; done | sed "$sed_drop_objext" | sort | uniq`; do + gltests_libobjs="$gltests_libobjs $i.$ac_objext" + gltests_ltlibobjs="$gltests_ltlibobjs $i.lo" + done + fi + gltests_LIBOBJS=$gltests_libobjs + + gltests_LTLIBOBJS=$gltests_ltlibobjs + + +if test -z "${CROSS_COMPILING_TRUE}" && test -z "${CROSS_COMPILING_FALSE}"; then + as_fn_error "conditional \"CROSS_COMPILING\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + : ${CONFIG_STATUS=./config.status} +ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ $as_echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} -cat >$CONFIG_STATUS <<_ACEOF +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. @@ -54405,41 +43883,34 @@ cat >$CONFIG_STATUS <<_ACEOF debug=false ac_cs_recheck=false ac_cs_silent=false -SHELL=\${CONFIG_SHELL-$SHELL} -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -## --------------------- ## -## M4sh Initialization. ## -## --------------------- ## +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; esac - fi - - -# PATH needs CR -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - as_nl=' ' export as_nl @@ -54447,7 +43918,13 @@ export as_nl as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else @@ -54458,7 +43935,7 @@ else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; - case $arg in + case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; @@ -54474,22 +43951,11 @@ fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh -fi - -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } fi @@ -54501,15 +43967,15 @@ fi IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. -case $0 in +case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done IFS=$as_save_IFS ;; @@ -54521,31 +43987,111 @@ if test "x$as_myself" = x; then fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - { (exit 1); exit 1; } + exit 1 fi -# Work around bugs in pre-3.0 UWIN ksh. -for as_var in ENV MAIL MAILPATH -do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - fi -done +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +# as_fn_error ERROR [LINENO LOG_FD] +# --------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with status $?, using 1 if that was 0. +as_fn_error () +{ + as_status=$?; test $as_status -eq 0 && as_status=1 + if test "$3"; then + as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3 + fi + $as_echo "$as_me: error: $1" >&2 + as_fn_exit $as_status +} # as_fn_error + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit [STATUS=$?] +# ---------------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + as_status=$? + set +e + as_fn_set_status ${1-$as_status} + exit ${1-$as_status} +} # as_fn_exit + +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + -# Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr @@ -54559,8 +44105,12 @@ else as_basename=false fi +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi -# Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ @@ -54580,62 +44130,15 @@ $as_echo X/"$0" | } s/.*/./; q'` -# CDPATH. -$as_unset CDPATH - - - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { - - # Create $as_me.lineno as a copy of $as_myself, but with $LINENO - # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line after each line using $LINENO; the second 'sed' - # does the real work. The second script uses 'N' to pair each - # line-number line with the line containing $LINENO, and appends - # trailing '-' during substitution so that $LINENO is not a special - # case at line end. - # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # scripts with optimization help from Paolo Bonzini. Blame Lee - # E. McMahon (1931-1989) for sed's syntax. :-) - sed -n ' - p - /[$]LINENO/= - ' <$as_myself | - sed ' - s/[$]LINENO.*/&-/ - t lineno - b - :lineno - N - :loop - s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ - t loop - s/-\n.*// - ' >$as_me.lineno && - chmod +x "$as_me.lineno" || - { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 - { (exit 1); exit 1; }; } - - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensitive to this). - . "./$as_me.lineno" - # Exit status is that of the last command. - exit -} - - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in +case `echo -n x` in #(((( -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. @@ -54644,39 +44147,84 @@ case `echo -n x` in *) ECHO_N='-n';; esac -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir - mkdir conf$$.dir + mkdir conf$$.dir 2>/dev/null fi -echo >conf$$.file -if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else as_ln_s='cp -p' -elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln + fi else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir" + + +} # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then - as_mkdir_p=: + as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false @@ -54693,12 +44241,12 @@ else as_test_x=' eval sh -c '\'' if test -d "$1"; then - test -d "$1/."; + test -d "$1/."; else - case $1 in - -*)set "./$1";; + case $1 in #( + -*)set "./$1";; esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( ???[sx]*):;;*)false;;esac;fi '\'' sh ' @@ -54713,13 +44261,19 @@ as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 -# Save the log message, to keep $[0] and so on meaningful, and to +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by GNU coreutils $as_me 6.9, which was -generated by GNU Autoconf 2.61a. Invocation command line was +This file was extended by GNU coreutils $as_me 7.4, which was +generated by GNU Autoconf 2.63b.42-b26d5. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -54732,30 +44286,42 @@ on `(hostname || uname -n) 2>/dev/null | sed 1q` _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + +case $ac_config_headers in *" +"*) set x $ac_config_headers; shift; ac_config_headers=$*;; +esac + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" +config_links="$ac_config_links" config_commands="$ac_config_commands" _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ -\`$as_me' instantiates files from templates according to the -current configuration. +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. -Usage: $0 [OPTIONS] [FILE]... +Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit - -q, --quiet do not print progress messages + -q, --quiet, --silent + do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions - --file=FILE[:TEMPLATE] - instantiate the configuration file FILE - --header=FILE[:TEMPLATE] - instantiate the configuration header FILE + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE Configuration files: $config_files @@ -54763,19 +44329,24 @@ $config_files Configuration headers: $config_headers +Configuration links: +$config_links + Configuration commands: $config_commands -Report bugs to ." +Report bugs to . +GNU coreutils home page: . +General help using GNU software: ." _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_version="\\ -GNU coreutils config.status 6.9 -configured by $0, generated by GNU Autoconf 2.61a, +GNU coreutils config.status 7.4 +configured by $0, generated by GNU Autoconf 2.63b.42-b26d5, with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" -Copyright (C) 2006 Free Software Foundation, Inc. +Copyright (C) 2009 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." @@ -54787,9 +44358,8 @@ AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -# If no file are specified by the user, then we need to provide default -# value. By we need to know if files were specified by the user. +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do @@ -54816,17 +44386,22 @@ do debug=: ;; --file | --fil | --fi | --f ) $ac_shift - CONFIG_FILES="$CONFIG_FILES $ac_optarg" + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift - CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header - { $as_echo "$as_me: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; };; + as_fn_error "ambiguous option: \`$1' +Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ @@ -54834,11 +44409,10 @@ Try \`$0 --help' for more information." >&2 ac_cs_silent=: ;; # This is an error. - -*) { $as_echo "$as_me: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; } ;; + -*) as_fn_error "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; - *) ac_config_targets="$ac_config_targets $1" + *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac @@ -54853,9 +44427,9 @@ if $ac_cs_silent; then fi _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then - set X '$SHELL' '$0'$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' @@ -54864,7 +44438,7 @@ if \$ac_cs_recheck; then fi _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo @@ -54875,11 +44449,12 @@ _ASBOX } >&5 _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" +GNUmakefile=$GNUmakefile # Capture the value of obsolete ALL_LINGUAS because we need it to compute # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it # from automake < 1.5. @@ -54890,7 +44465,7 @@ AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets @@ -54898,6 +44473,7 @@ do case $ac_config_target in "lib/config.h") CONFIG_HEADERS="$CONFIG_HEADERS lib/config.h:lib/config.hin" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "$GNUmakefile") CONFIG_LINKS="$CONFIG_LINKS $GNUmakefile:$GNUmakefile" ;; "po-directories") CONFIG_COMMANDS="$CONFIG_COMMANDS po-directories" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; @@ -54906,53 +44482,9 @@ do "po/Makefile.in") CONFIG_FILES="$CONFIG_FILES po/Makefile.in" ;; "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;; - "tests/chgrp/Makefile") CONFIG_FILES="$CONFIG_FILES tests/chgrp/Makefile" ;; - "tests/chmod/Makefile") CONFIG_FILES="$CONFIG_FILES tests/chmod/Makefile" ;; - "tests/chown/Makefile") CONFIG_FILES="$CONFIG_FILES tests/chown/Makefile" ;; - "tests/cp/Makefile") CONFIG_FILES="$CONFIG_FILES tests/cp/Makefile" ;; - "tests/cut/Makefile") CONFIG_FILES="$CONFIG_FILES tests/cut/Makefile" ;; - "tests/dd/Makefile") CONFIG_FILES="$CONFIG_FILES tests/dd/Makefile" ;; - "tests/dircolors/Makefile") CONFIG_FILES="$CONFIG_FILES tests/dircolors/Makefile" ;; - "tests/du/Makefile") CONFIG_FILES="$CONFIG_FILES tests/du/Makefile" ;; - "tests/expr/Makefile") CONFIG_FILES="$CONFIG_FILES tests/expr/Makefile" ;; - "tests/factor/Makefile") CONFIG_FILES="$CONFIG_FILES tests/factor/Makefile" ;; - "tests/fmt/Makefile") CONFIG_FILES="$CONFIG_FILES tests/fmt/Makefile" ;; - "tests/head/Makefile") CONFIG_FILES="$CONFIG_FILES tests/head/Makefile" ;; - "tests/install/Makefile") CONFIG_FILES="$CONFIG_FILES tests/install/Makefile" ;; - "tests/join/Makefile") CONFIG_FILES="$CONFIG_FILES tests/join/Makefile" ;; - "tests/ln/Makefile") CONFIG_FILES="$CONFIG_FILES tests/ln/Makefile" ;; - "tests/ls-2/Makefile") CONFIG_FILES="$CONFIG_FILES tests/ls-2/Makefile" ;; - "tests/ls/Makefile") CONFIG_FILES="$CONFIG_FILES tests/ls/Makefile" ;; - "tests/md5sum/Makefile") CONFIG_FILES="$CONFIG_FILES tests/md5sum/Makefile" ;; - "tests/misc/Makefile") CONFIG_FILES="$CONFIG_FILES tests/misc/Makefile" ;; - "tests/mkdir/Makefile") CONFIG_FILES="$CONFIG_FILES tests/mkdir/Makefile" ;; - "tests/mv/Makefile") CONFIG_FILES="$CONFIG_FILES tests/mv/Makefile" ;; - "tests/od/Makefile") CONFIG_FILES="$CONFIG_FILES tests/od/Makefile" ;; - "tests/pr/Makefile") CONFIG_FILES="$CONFIG_FILES tests/pr/Makefile" ;; - "tests/readlink/Makefile") CONFIG_FILES="$CONFIG_FILES tests/readlink/Makefile" ;; - "tests/rm/Makefile") CONFIG_FILES="$CONFIG_FILES tests/rm/Makefile" ;; - "tests/rmdir/Makefile") CONFIG_FILES="$CONFIG_FILES tests/rmdir/Makefile" ;; - "tests/seq/Makefile") CONFIG_FILES="$CONFIG_FILES tests/seq/Makefile" ;; - "tests/sha1sum/Makefile") CONFIG_FILES="$CONFIG_FILES tests/sha1sum/Makefile" ;; - "tests/shred/Makefile") CONFIG_FILES="$CONFIG_FILES tests/shred/Makefile" ;; - "tests/sort/Makefile") CONFIG_FILES="$CONFIG_FILES tests/sort/Makefile" ;; - "tests/stty/Makefile") CONFIG_FILES="$CONFIG_FILES tests/stty/Makefile" ;; - "tests/sum/Makefile") CONFIG_FILES="$CONFIG_FILES tests/sum/Makefile" ;; - "tests/tac/Makefile") CONFIG_FILES="$CONFIG_FILES tests/tac/Makefile" ;; - "tests/tail-2/Makefile") CONFIG_FILES="$CONFIG_FILES tests/tail-2/Makefile" ;; - "tests/tail/Makefile") CONFIG_FILES="$CONFIG_FILES tests/tail/Makefile" ;; - "tests/tee/Makefile") CONFIG_FILES="$CONFIG_FILES tests/tee/Makefile" ;; - "tests/test/Makefile") CONFIG_FILES="$CONFIG_FILES tests/test/Makefile" ;; - "tests/touch/Makefile") CONFIG_FILES="$CONFIG_FILES tests/touch/Makefile" ;; - "tests/tr/Makefile") CONFIG_FILES="$CONFIG_FILES tests/tr/Makefile" ;; - "tests/tsort/Makefile") CONFIG_FILES="$CONFIG_FILES tests/tsort/Makefile" ;; - "tests/unexpand/Makefile") CONFIG_FILES="$CONFIG_FILES tests/unexpand/Makefile" ;; - "tests/uniq/Makefile") CONFIG_FILES="$CONFIG_FILES tests/uniq/Makefile" ;; - "tests/wc/Makefile") CONFIG_FILES="$CONFIG_FILES tests/wc/Makefile" ;; + "gnulib-tests/Makefile") CONFIG_FILES="$CONFIG_FILES gnulib-tests/Makefile" ;; - *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 -$as_echo "$as_me: error: invalid argument: $ac_config_target" >&2;} - { (exit 1); exit 1; }; };; + *) as_fn_error "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done @@ -54964,6 +44496,7 @@ done if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test "${CONFIG_LINKS+set}" = set || CONFIG_LINKS=$config_links test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi @@ -54979,7 +44512,7 @@ $debug || trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 - trap '{ (exit 1); exit 1; }' 1 2 13 15 + trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. @@ -54990,11 +44523,7 @@ $debug || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") -} || -{ - $as_echo "$me: cannot create a temporary directory in ." >&2 - { (exit 1); exit 1; } -} +} || as_fn_error "cannot create a temporary directory in ." "$LINENO" 5 # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. @@ -55002,34 +44531,49 @@ $debug || if test -n "$CONFIG_FILES"; then -echo 'BEGIN {' >"$tmp/subs.awk" +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$tmp/subs1.awk" && _ACEOF { - echo "cat >conf$$subs.awk <<_ACEOF" - echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" -} >conf$$subs.sh +} >conf$$subs.sh || + as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do - . ./conf$$subs.sh + . ./conf$$subs.sh || + as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` = $ac_delim_num; then + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then - { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh -cat >>$CONFIG_STATUS <<_ACEOF -cat >>"\$tmp/subs.awk" <<\CEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h @@ -55069,15 +44613,15 @@ g s/.\{148\}// t delim ' >$CONFIG_STATUS +' >>$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk -cat >>$CONFIG_STATUS <<_ACEOF -CEOF -cat >>"\$tmp/subs.awk" <>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" @@ -55102,7 +44646,15 @@ cat >>"\$tmp/subs.awk" <>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ + || as_fn_error "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove $(srcdir), @@ -55120,20 +44672,128 @@ s/^[^=]*=[ ]*$// }' fi -cat >>$CONFIG_STATUS <<\_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" +# Set up the scripts for CONFIG_HEADERS section. +# No need to generate them if there are no CONFIG_HEADERS. +# This happens for instance with `./config.status Makefile'. +if test -n "$CONFIG_HEADERS"; then +cat >"$tmp/defines.awk" <<\_ACAWK || +BEGIN { +_ACEOF -for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS +# Transform confdefs.h into an awk script `defines.awk', embedded as +# here-document in config.status, that substitutes the proper values into +# config.h.in to produce config.h. + +# Create a delimiter string that does not exist in confdefs.h, to ease +# handling of long lines. +ac_delim='%!_!# ' +for ac_last_try in false false :; do + ac_t=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_t"; then + break + elif $ac_last_try; then + as_fn_error "could not make $CONFIG_HEADERS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +# For the awk script, D is an array of macro values keyed by name, +# likewise P contains macro parameters if any. Preserve backslash +# newline sequences. + +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +sed -n ' +s/.\{148\}/&'"$ac_delim"'/g +t rset +:rset +s/^[ ]*#[ ]*define[ ][ ]*/ / +t def +d +:def +s/\\$// +t bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3"/p +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p +d +:bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3\\\\\\n"\\/p +t cont +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p +t cont +d +:cont +n +s/.\{148\}/&'"$ac_delim"'/g +t clear +:clear +s/\\$// +t bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/"/p +d +:bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p +b cont +' >$CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + for (key in D) D_is_set[key] = 1 + FS = "" +} +/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { + line = \$ 0 + split(line, arg, " ") + if (arg[1] == "#") { + defundef = arg[2] + mac1 = arg[3] + } else { + defundef = substr(arg[1], 2) + mac1 = arg[2] + } + split(mac1, mac2, "(") #) + macro = mac2[1] + prefix = substr(line, 1, index(line, defundef) - 1) + if (D_is_set[macro]) { + # Preserve the white space surrounding the "#". + print prefix "define", macro P[macro] D[macro] + next + } else { + # Replace #undef with comments. This is necessary, for example, + # in the case of _POSIX_SOURCE, which is predefined and required + # on some systems where configure will not decide to define it. + if (defundef == "undef") { + print "/*", prefix defundef, macro, "*/" + next + } + } +} +{ print } +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + as_fn_error "could not setup config headers machinery" "$LINENO" 5 +fi # test -n "$CONFIG_HEADERS" + + +eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :L $CONFIG_LINKS :C $CONFIG_COMMANDS" +shift +for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; - :L* | :C*:*) { { $as_echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 -$as_echo "$as_me: error: Invalid tag $ac_tag." >&2;} - { (exit 1); exit 1; }; };; + :L* | :C*:*) as_fn_error "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac @@ -55161,11 +44821,10 @@ $as_echo "$as_me: error: Invalid tag $ac_tag." >&2;} [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || - { { $as_echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 -$as_echo "$as_me: error: cannot find input file: $ac_f" >&2;} - { (exit 1); exit 1; }; };; + as_fn_error "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac - ac_file_inputs="$ac_file_inputs $ac_f" + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't @@ -55176,12 +44835,20 @@ $as_echo "$as_me: error: cannot find input file: $ac_f" >&2;} `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" - { $as_echo "$as_me:$LINENO: creating $ac_file" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac case $ac_tag in - *:-:* | *:-) cat >"$tmp/stdin";; + *:-:* | *:-) cat >"$tmp/stdin" \ + || as_fn_error "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac @@ -55209,55 +44876,15 @@ $as_echo X"$ac_file" | q } s/.*/./; q'` - { as_dir="$ac_dir" - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 -$as_echo "$as_me: error: cannot create directory $as_dir" >&2;} - { (exit 1); exit 1; }; }; } + as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's,^\.[\\/],,'` + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; @@ -55302,12 +44929,12 @@ ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix esac _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= - -case `sed -n '/datarootdir/ { +ac_sed_dataroot=' +/datarootdir/ { p q } @@ -55315,36 +44942,37 @@ case `sed -n '/datarootdir/ { /@docdir@/p /@infodir@/p /@localedir@/p -/@mandir@/p -' $ac_file_inputs` in +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { $as_echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g - s&\\\${datarootdir}&$datarootdir&g' ;; + s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? -cat >>$CONFIG_STATUS <<_ACEOF - sed "$ac_vpsub +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub $extrasub _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s&@configure_input@&$configure_input&;t t +s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t @@ -55355,135 +44983,65 @@ s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack -" $ac_file_inputs | $AWK -f "$tmp/subs.awk" >$tmp/out +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ + || as_fn_error "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && - { $as_echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in - -) cat "$tmp/out"; rm -f "$tmp/out";; - *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; - esac + -) cat "$tmp/out" && rm -f "$tmp/out";; + *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; + esac \ + || as_fn_error "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # -_ACEOF - -# Transform confdefs.h into a sed script `conftest.defines', that -# substitutes the proper values into config.h.in to produce config.h. -rm -f conftest.defines conftest.tail -# First, append a space to every undef/define line, to ease matching. -echo 's/$/ /' >conftest.defines -# Then, protect against being on the right side of a sed subst, or in -# an unquoted here document, in config.status. If some macros were -# called several times there might be several #defines for the same -# symbol, which is useless. But do not sort them, since the last -# AC_DEFINE must be honored. -ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* -# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where -# NAME is the cpp macro being defined, VALUE is the value it is being given. -# PARAMS is the parameter list in the macro definition--in most cases, it's -# just an empty string. -ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*' -ac_dB='\\)[ (].*,\\1define\\2' -ac_dC=' ' -ac_dD=' ,' - -uniq confdefs.h | - sed -n ' - t rset - :rset - s/^[ ]*#[ ]*define[ ][ ]*// - t ok - d - :ok - s/[\\&,]/\\&/g - s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p - s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p - ' >>conftest.defines - -# Remove the space that was appended to ease matching. -# Then replace #undef with comments. This is necessary, for -# example, in the case of _POSIX_SOURCE, which is predefined and required -# on some systems where configure will not decide to define it. -# (The regexp can be short, since the line contains either #define or #undef.) -echo 's/ $// -s,^[ #]*u.*,/* & */,' >>conftest.defines - -# Break up conftest.defines: -ac_max_sed_lines=50 - -# First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1" -# Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2" -# Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1" -# et cetera. -ac_in='$ac_file_inputs' -ac_out='"$tmp/out1"' -ac_nxt='"$tmp/out2"' - -while : -do - # Write a here document: - cat >>$CONFIG_STATUS <<_ACEOF - # First, check the format of the line: - cat >"\$tmp/defines.sed" <<\\CEOF -/^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def -/^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def -b -:def -_ACEOF - sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS - echo 'CEOF - sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS - ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in - sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail - grep . conftest.tail >/dev/null || break - rm -f conftest.defines - mv conftest.tail conftest.defines -done -rm -f conftest.defines conftest.tail - -echo "ac_result=$ac_in" >>$CONFIG_STATUS -cat >>$CONFIG_STATUS <<\_ACEOF if test x"$ac_file" != x-; then - $as_echo "/* $configure_input */" >"$tmp/config.h" - cat "$ac_result" >>"$tmp/config.h" - if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then - { $as_echo "$as_me:$LINENO: $ac_file is unchanged" >&5 + { + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" + } >"$tmp/config.h" \ + || as_fn_error "could not create $ac_file" "$LINENO" 5 + if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then + { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else - rm -f $ac_file - mv "$tmp/config.h" $ac_file + rm -f "$ac_file" + mv "$tmp/config.h" "$ac_file" \ + || as_fn_error "could not create $ac_file" "$LINENO" 5 fi else - $as_echo "/* $configure_input */" - cat "$ac_result" + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ + || as_fn_error "could not create -" "$LINENO" 5 fi - rm -f "$tmp/out12" -# Compute $ac_file's index in $config_headers. +# Compute "$ac_file"'s index in $config_headers. +_am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in - $ac_file | $ac_file:* ) + $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done -echo "timestamp for $ac_file" >`$as_dirname -- $ac_file || -$as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X$ac_file : 'X\(//\)[^/]' \| \ - X$ac_file : 'X\(//\)$' \| \ - X$ac_file : 'X\(/\)' \| . 2>/dev/null || -$as_echo X$ac_file | +echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || +$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$_am_arg" : 'X\(//\)[^/]' \| \ + X"$_am_arg" : 'X\(//\)$' \| \ + X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -55502,26 +45060,67 @@ $as_echo X$ac_file | } s/.*/./; q'`/stamp-h$_am_stamp_count ;; + :L) + # + # CONFIG_LINK + # - :C) { $as_echo "$as_me:$LINENO: executing $ac_file commands" >&5 + if test "$ac_source" = "$ac_file" && test "$srcdir" = '.'; then + : + else + # Prefer the file from the source tree if names are identical. + if test "$ac_source" = "$ac_file" || test ! -r "$ac_source"; then + ac_source=$srcdir/$ac_source + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: linking $ac_source to $ac_file" >&5 +$as_echo "$as_me: linking $ac_source to $ac_file" >&6;} + + if test ! -r "$ac_source"; then + as_fn_error "$ac_source: file not found" "$LINENO" 5 + fi + rm -f "$ac_file" + + # Try a relative symlink, then a hard link, then a copy. + case $srcdir in + [\\/$]* | ?:[\\/]* ) ac_rel_source=$ac_source ;; + *) ac_rel_source=$ac_top_build_prefix$ac_source ;; + esac + ln -s "$ac_rel_source" "$ac_file" 2>/dev/null || + ln "$ac_source" "$ac_file" 2>/dev/null || + cp -p "$ac_source" "$ac_file" || + as_fn_error "cannot link or copy $ac_source to $ac_file" "$LINENO" 5 + fi + ;; + :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in - "depfiles":C) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do - # Strip MF so we end up with the name of the file. - mf=`echo "$mf" | sed -e 's/:.*$//'` - # Check whether this is an Automake generated Makefile or not. - # We used to match only the files named `Makefile.in', but - # some people rename them; so instead we look at the file content. - # Grep'ing the first line is not enough: some people post-process - # each Makefile.in and add a new line on top of each file to say so. - # Grep'ing the whole file is not good either: AIX grep has a line - # limit of 2048, but all sed's we know have understand at least 4000. - if sed 10q "$mf" | grep '^#.*generated by automake' > /dev/null 2>&1; then - dirpart=`$as_dirname -- "$mf" || + "depfiles":C) test x"$AMDEP_TRUE" != x"" || { + # Autoconf 2.62 quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ @@ -55544,28 +45143,28 @@ $as_echo X"$mf" | q } s/.*/./; q'` - else - continue - fi - # Extract the definition of DEPDIR, am__include, and am__quote - # from the Makefile without running `make'. - DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` - test -z "$DEPDIR" && continue - am__include=`sed -n 's/^am__include = //p' < "$mf"` - test -z "am__include" && continue - am__quote=`sed -n 's/^am__quote = //p' < "$mf"` - # When using ansi2knr, U may be empty or an underscore; expand it - U=`sed -n 's/^U = //p' < "$mf"` - # Find all dependency output files, they are included files with - # $(DEPDIR) in their names. We invoke sed twice because it is the - # simplest approach to changing $(DEPDIR) to its actual value in the - # expansion. - for file in `sed -n " - s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ - sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do - # Make sure the directory exists. - test -f "$dirpart/$file" && continue - fdir=`$as_dirname -- "$file" || + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ @@ -55588,51 +45187,12 @@ $as_echo X"$file" | q } s/.*/./; q'` - { as_dir=$dirpart/$fdir - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break + as_dir=$dirpart/$fdir; as_fn_mkdir_p + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 -$as_echo "$as_me: error: cannot create directory $as_dir" >&2;} - { (exit 1); exit 1; }; }; } - # echo "creating $dirpart/$file" - echo '# dummy' > "$dirpart/$file" done -done +} ;; "po-directories":C) for ac_file in $CONFIG_FILES; do @@ -55752,11 +45312,13 @@ done done # for ac_tag -{ (exit 0); exit 0; } +as_fn_exit 0 _ACEOF -chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save +test $ac_write_fail = 0 || + as_fn_error "write failure creating $CONFIG_STATUS" "$LINENO" 5 + # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. @@ -55776,6 +45338,10 @@ if test "$no_create" != yes; then exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. - $ac_cs_success || { (exit 1); exit 1; } + $ac_cs_success || as_fn_exit +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi diff --git a/src/bin/coreutils/configure.ac b/src/bin/coreutils/configure.ac index cab46a2ed8..8b05b115ed 100644 --- a/src/bin/coreutils/configure.ac +++ b/src/bin/coreutils/configure.ac @@ -1,12 +1,12 @@ # -*- autoconf -*- # Process this file with autoconf to produce a configure script. -# Copyright (C) 1991, 1993-2007 Free Software Foundation, Inc. +# Copyright (C) 1991, 1993-2009 Free Software Foundation, Inc. -# This program is free software; you can redistribute it and/or modify +# This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,20 +14,26 @@ # GNU General Public License for more details. # You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# along with this program. If not, see . dnl Written by Jim Meyering. -AC_PREREQ(2.61) -AC_INIT([GNU coreutils],[6.9],[bug-coreutils@gnu.org]) -AC_CONFIG_SRCDIR(src/ls.c) +AC_PREREQ([2.61]) -AC_CONFIG_AUX_DIR(build-aux) +# Make inter-release version strings look like, e.g., v6.9-219-g58ddd, which +# indicates that it is built from the 219th delta (in _some_ repository) +# following the v6.9 tag, and that 58ddd is a prefix of the commit SHA1. +AC_INIT([GNU coreutils], + m4_esyscmd([build-aux/git-version-gen .tarball-version]), + [bug-coreutils@gnu.org]) + +AC_CONFIG_SRCDIR([src/ls.c]) + +AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_HEADERS([lib/config.h:lib/config.hin]) -AB_INIT() -AM_INIT_AUTOMAKE([1.10 dist-bzip2]) +AM_INIT_AUTOMAKE([1.10b dist-xz color-tests parallel-tests]) +AM_SILENT_RULES([yes]) # make --enable-silent-rules the default. AC_PROG_CC_STDC AM_PROG_CC_C_O @@ -39,22 +45,82 @@ gl_EARLY gl_INIT coreutils_MACROS +AC_ARG_ENABLE([gcc-warnings], + [AS_HELP_STRING([--enable-gcc-warnings], + [turn on lots of GCC warnings (for developers)])], + [case $enableval in + yes|no) ;; + *) AC_MSG_ERROR([bad value $enableval for gcc-warnings option]) ;; + esac + gl_gcc_warnings=$enableval], + [gl_gcc_warnings=no] +) + +if test "$gl_gcc_warnings" = yes; then + gl_WARN_ADD([-Werror], [WERROR_CFLAGS]) + AC_SUBST([WERROR_CFLAGS]) + + # Add many warnings, except some... + nw="$nw -Wdeclaration-after-statement" # too useful to forbid + nw="$nw -Waggregate-return" # anachronistic + nw="$nw -Wc++-compat" # We don't care about C++ compilers + nw="$nw -Wundef" # Warns on '#if GNULIB_FOO' etc in gnulib + nw="$nw -Wtraditional" # Warns on #elif which we use often + nw="$nw -Wcast-qual" # Too many warnings for now + nw="$nw -Wconversion" # Too many warnings for now + nw="$nw -Wsystem-headers" # Don't let system headers trigger warnings + nw="$nw -Wsign-conversion" # Too many warnings for now + nw="$nw -Wtraditional-conversion" # Too many warnings for now + nw="$nw -Wunreachable-code" # Too many warnings for now + nw="$nw -Wpadded" # Our structs are not padded + nw="$nw -Wredundant-decls" # openat.h declares e.g., mkdirat + nw="$nw -Wlogical-op" # any use of fwrite provokes this + nw="$nw -Wformat-nonliteral" # who.c and pinky.c strftime uses + nw="$nw -Wvla" # warnings in gettext.h + nw="$nw -Wnested-externs" # use of XARGMATCH/verify_function__ + nw="$nw -Wswitch-enum" # Too many warnings for now + nw="$nw -Wswitch-default" # Too many warnings for now + # things I might fix soon: + nw="$nw -Wfloat-equal" # sort.c, seq.c + nw="$nw -Wmissing-format-attribute" # copy.c + nw="$nw -Wunsafe-loop-optimizations" # a few src/*.c + nw="$nw -Winline" # system.h's readdir_ignoring_dot_and_dotdot + nw="$nw -Wstrict-overflow" # expr.c, pr.c, tr.c, factor.c + # ?? -Wstrict-overflow + + gl_MANYWARN_ALL_GCC([ws]) + gl_MANYWARN_COMPLEMENT([ws], [$ws], [$nw]) + for w in $ws; do + gl_WARN_ADD([$w]) + done + gl_WARN_ADD([-Wno-missing-field-initializers]) # We need this one + gl_WARN_ADD([-Wno-sign-compare]) # Too many warnings for now + gl_WARN_ADD([-Wno-pointer-sign]) # Too many warnings for now + gl_WARN_ADD([-Wno-unused-parameter]) # Too many warnings for now + gl_WARN_ADD([-fdiagnostics-show-option]) + + AC_SUBST([WARN_CFLAGS]) + + AC_DEFINE([lint], [1], [Define to 1 if the compiler is checking for lint.]) + AC_DEFINE([_FORTIFY_SOURCE], [2], + [enable compile-time and run-time bounds-checking, and some warnings]) + AC_DEFINE([GNULIB_PORTCHECK], [1], [enable some gnulib portability checks]) +fi + AC_FUNC_FORK -AC_CHECK_FUNCS(uname, - OPTIONAL_BIN_PROGS="$OPTIONAL_BIN_PROGS uname\$(EXEEXT)" - MAN="$MAN uname.1") -AC_CHECK_FUNCS(chroot, - OPTIONAL_BIN_PROGS="$OPTIONAL_BIN_PROGS chroot\$(EXEEXT)" - MAN="$MAN chroot.1") -AC_CHECK_FUNCS(gethostid, - OPTIONAL_BIN_PROGS="$OPTIONAL_BIN_PROGS hostid\$(EXEEXT)" - MAN="$MAN hostid.1") +optional_bin_progs= +AC_CHECK_FUNCS([uname], + gl_ADD_PROG([optional_bin_progs], [uname])) +AC_CHECK_FUNCS([chroot], + gl_ADD_PROG([optional_bin_progs], [chroot])) +AC_CHECK_FUNCS([gethostid], + gl_ADD_PROG([optional_bin_progs], [hostid])) gl_WINSIZE_IN_PTEM -AC_MSG_CHECKING(whether localtime caches TZ) -AC_CACHE_VAL(utils_cv_localtime_cache, +AC_MSG_CHECKING([whether localtime caches TZ]) +AC_CACHE_VAL([utils_cv_localtime_cache], [if test x$ac_cv_func_tzset = xyes; then AC_RUN_IFELSE([AC_LANG_SOURCE([[#include #if STDC_HEADERS @@ -95,22 +161,22 @@ else # since we can't invalidate the cache if we don't have tzset. utils_cv_localtime_cache=no fi])dnl -AC_MSG_RESULT($utils_cv_localtime_cache) +AC_MSG_RESULT([$utils_cv_localtime_cache]) if test $utils_cv_localtime_cache = yes; then - AC_DEFINE(LOCALTIME_CACHE, 1, [FIXME]) + AC_DEFINE([LOCALTIME_CACHE], [1], [FIXME]) fi # SCO-ODT-3.0 is reported to need -los to link programs using initgroups -AC_CHECK_FUNCS(initgroups) +AC_CHECK_FUNCS([initgroups]) if test $ac_cv_func_initgroups = no; then - AC_CHECK_LIB(os, initgroups) + AC_CHECK_LIB([os], [initgroups]) fi -AC_CHECK_FUNCS(syslog) +AC_CHECK_FUNCS([syslog]) if test $ac_cv_func_syslog = no; then # syslog is not in the default libraries. See if it's in some other. for lib in bsd socket inet; do - AC_CHECK_LIB($lib, syslog, [AC_DEFINE(HAVE_SYSLOG, 1, [FIXME]) + AC_CHECK_LIB([$lib], [syslog], [AC_DEFINE([HAVE_SYSLOG], [1], [FIXME]) LIBS="$LIBS -l$lib"; break]) done fi @@ -130,76 +196,72 @@ if test $utils_cv_func_setpriority = no; then fi case $utils_cv_func_setpriority,$ac_cv_func_nice in *yes*) - OPTIONAL_BIN_PROGS="$OPTIONAL_BIN_PROGS nice\$(EXEEXT)" - MAN="$MAN nice.1";; + gl_ADD_PROG([optional_bin_progs], [nice]) esac AC_DEFUN([coreutils_DUMMY_1], [ AC_REQUIRE([gl_READUTMP]) if test $ac_cv_header_utmp_h = yes || test $ac_cv_header_utmpx_h = yes; then - OPTIONAL_BIN_PROGS="$OPTIONAL_BIN_PROGS pinky\$(EXEEXT)" - OPTIONAL_BIN_PROGS="$OPTIONAL_BIN_PROGS users\$(EXEEXT)" - OPTIONAL_BIN_PROGS="$OPTIONAL_BIN_PROGS who\$(EXEEXT)" - MAN="$MAN pinky.1 users.1 who.1" + gl_ADD_PROG([optional_bin_progs], [who]) + gl_ADD_PROG([optional_bin_progs], [users]) + gl_ADD_PROG([optional_bin_progs], [pinky]) fi ]) coreutils_DUMMY_1 -AC_MSG_CHECKING(ut_host in struct utmp) -AC_CACHE_VAL(su_cv_func_ut_host_in_utmp, +AC_MSG_CHECKING([ut_host in struct utmp]) +AC_CACHE_VAL([su_cv_func_ut_host_in_utmp], [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include #include ]], [[struct utmp ut; return !sizeof ut.ut_host;]])], [su_cv_func_ut_host_in_utmp=yes], [su_cv_func_ut_host_in_utmp=no])]) -AC_MSG_RESULT($su_cv_func_ut_host_in_utmp) +AC_MSG_RESULT([$su_cv_func_ut_host_in_utmp]) if test $su_cv_func_ut_host_in_utmp = yes; then have_ut_host=1 - AC_DEFINE(HAVE_UT_HOST, 1, [FIXME]) + AC_DEFINE([HAVE_UT_HOST], [1], [FIXME]) fi if test -z "$have_ut_host"; then - AC_MSG_CHECKING(ut_host in struct utmpx) - AC_CACHE_VAL(su_cv_func_ut_host_in_utmpx, + AC_MSG_CHECKING([ut_host in struct utmpx]) + AC_CACHE_VAL([su_cv_func_ut_host_in_utmpx], [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include #include ]], [[struct utmpx ut; return !sizeof ut.ut_host;]])], [su_cv_func_ut_host_in_utmpx=yes], [su_cv_func_ut_host_in_utmpx=no])]) - AC_MSG_RESULT($su_cv_func_ut_host_in_utmpx) + AC_MSG_RESULT([$su_cv_func_ut_host_in_utmpx]) if test $su_cv_func_ut_host_in_utmpx = yes; then - AC_DEFINE(HAVE_UTMPX_H, 1, [FIXME]) - AC_DEFINE(HAVE_UT_HOST, 1, [FIXME]) + AC_DEFINE([HAVE_UTMPX_H], [1], [FIXME]) + AC_DEFINE([HAVE_UT_HOST], [1], [FIXME]) fi fi -GNULIB_BOOT_TIME( - [OPTIONAL_BIN_PROGS="$OPTIONAL_BIN_PROGS uptime\$(EXEEXT)" - MAN="$MAN uptime.1"]) +GNULIB_BOOT_TIME([gl_ADD_PROG([optional_bin_progs], [uptime])]) AC_SYS_POSIX_TERMIOS() gl_HEADER_TIOCGWINSZ_NEEDS_SYS_IOCTL if test $ac_cv_sys_posix_termios = yes; then - OPTIONAL_BIN_PROGS="$OPTIONAL_BIN_PROGS stty\$(EXEEXT)" MAN="$MAN stty.1" + gl_ADD_PROG([optional_bin_progs], [stty]) - AC_MSG_CHECKING(whether termios.h needs _XOPEN_SOURCE) - AC_CACHE_VAL(su_cv_sys_termios_needs_xopen_source, - [AC_EGREP_CPP(yes, [#include + AC_MSG_CHECKING([whether termios.h needs _XOPEN_SOURCE]) + AC_CACHE_VAL([su_cv_sys_termios_needs_xopen_source], + [AC_EGREP_CPP([yes], [#include #ifdef IUCLC yes #endif], su_cv_sys_termios_needs_xopen_source=no, - AC_EGREP_CPP(yes, [#define _XOPEN_SOURCE + AC_EGREP_CPP([yes], [#define _XOPEN_SOURCE #include #ifdef IUCLC yes #endif], su_cv_sys_termios_needs_xopen_source=yes, su_cv_sys_termios_needs_xopen_source=no))]) - AC_MSG_RESULT($su_cv_sys_termios_needs_xopen_source) + AC_MSG_RESULT([$su_cv_sys_termios_needs_xopen_source]) test $su_cv_sys_termios_needs_xopen_source = yes && - AC_DEFINE(TERMIOS_NEEDS_XOPEN_SOURCE, 1, [FIXME]) + AC_DEFINE([TERMIOS_NEEDS_XOPEN_SOURCE], [1], [FIXME]) - AC_MSG_CHECKING(c_line in struct termios) - AC_CACHE_VAL(su_cv_sys_c_line_in_termios, + AC_MSG_CHECKING([c_line in struct termios]) + AC_CACHE_VAL([su_cv_sys_c_line_in_termios], [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#if TERMIOS_NEEDS_XOPEN_SOURCE #define _XOPEN_SOURCE #endif @@ -207,9 +269,9 @@ yes #include ]], [[struct termios t; return !sizeof t.c_line;]])], [su_cv_sys_c_line_in_termios=yes], [su_cv_sys_c_line_in_termios=no])]) - AC_MSG_RESULT($su_cv_sys_c_line_in_termios) + AC_MSG_RESULT([$su_cv_sys_c_line_in_termios]) test $su_cv_sys_c_line_in_termios = yes \ - && AC_DEFINE(HAVE_C_LINE, 1, [FIXME]) + && AC_DEFINE([HAVE_C_LINE], [1], [FIXME]) fi # FIXME: note that this macro appears above, too. @@ -218,10 +280,10 @@ gl_WINSIZE_IN_PTEM gl_HEADER_TIOCGWINSZ_IN_TERMIOS_H -if test $jm_cv_sys_tiocgwinsz_needs_termios_h = no && \ - test $jm_cv_sys_tiocgwinsz_needs_sys_ioctl_h = no; then - AC_MSG_CHECKING(TIOCGWINSZ in sys/pty.h) - AC_CACHE_VAL(su_cv_sys_tiocgwinsz_in_sys_pty_h, +if test $gl_cv_sys_tiocgwinsz_needs_termios_h = no && \ + test $gl_cv_sys_tiocgwinsz_needs_sys_ioctl_h = no; then + AC_MSG_CHECKING([TIOCGWINSZ in sys/pty.h]) + AC_CACHE_VAL([su_cv_sys_tiocgwinsz_in_sys_pty_h], [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include #ifdef WINSIZE_IN_PTEM # include @@ -232,10 +294,10 @@ if test $jm_cv_sys_tiocgwinsz_needs_termios_h = no && \ #include ]], [[int x = TIOCGWINSZ;]])], [su_cv_sys_tiocgwinsz_in_sys_pty_h=yes], [su_cv_sys_tiocgwinsz_in_sys_pty_h=no])]) - AC_MSG_RESULT($su_cv_sys_tiocgwinsz_in_sys_pty_h) + AC_MSG_RESULT([$su_cv_sys_tiocgwinsz_in_sys_pty_h]) test $su_cv_sys_tiocgwinsz_in_sys_pty_h = yes \ - && AC_DEFINE(GWINSZ_IN_SYS_PTY, 1, + && AC_DEFINE([GWINSZ_IN_SYS_PTY], [1], [Define if your system defines TIOCGWINSZ in sys/pty.h.]) fi @@ -244,14 +306,103 @@ AC_CHECK_DECLS([strsignal, sys_siglist, _sys_siglist, __sys_siglist], , , [AC_INCLUDES_DEFAULT #include ]) -# For src/kill.c and src/printf.c. -AC_CHECK_DECLS([strtoimax, strtoumax]) - cu_LIB_CHECK +cu_GMP + +# Build df only if there's a point to it. +if test $gl_cv_list_mounted_fs = yes && test $gl_cv_fs_space = yes; then + gl_ADD_PROG([optional_bin_progs], [df]) +fi + +############################################################################ +mk="$srcdir/src/Makefile.am" +# Extract all literal names from the definition of $(EXTRA_PROGRAMS) +# in $mk but don't expand the variable references. +# Append each literal name to $optional_bin_progs. +v=EXTRA_PROGRAMS +for gl_i in `sed -n '/^'$v' =/,/[[^\]]$/p' $mk \ + | sed 's/^ *//;/^\$.*/d;/^'$v' =/d' \ + | tr -s '\\015\\012\\\\' ' '`; do + gl_ADD_PROG([optional_bin_progs], $gl_i) +done + +# As above, extract literal names from the definition of $(no_install__progs) +# in $mk but don't expand the variable references. +v=no_install__progs +t=`sed -n '/^'$v' =/,/[[^\]]$/p' $mk \ + | sed 's/^ *//;/^\$.*/d;/^'$v' =/d' \ + | tr -s '\\015\\012\\\\' ' '` +# Remove any trailing space. +no_install_progs_default=`echo "$t"|sed 's/ $//'` + +# Unfortunately, due to the way autoconf's AS_HELP_STRING works, the list +# of default-not-installed programs, "arch hostname su", must appear in two +# places: in this file below, and in $mk. Using "$no_install_progs_default" +# below cannot work. And we can't substitute the names into $mk because +# automake needs the literals, too. +# The compromise is to ensure that the space-separated list extracted +# above matches the literal 2nd argument below. +c="$srcdir/configure.ac" +re='^g''l_INCLUDE_EXCLUDE_PROG(.* [\[\(.*\)\]])' +t=`sed -n '/'"$re"'/{s/'"$re"'/\1/;s/,/ /gp +}' $c` +case $t in + $no_install_progs_default) ;; + *) AC_MSG_ERROR([[internal error: g'l_INCLUDE_EXCLUDE_PROG's 2nd arg, $t, + does not match the list of default-not-installed programs + ($no_install_progs_default) also recorded in $mk]], + 1) ;; +esac + +# Given the name of a variable containing a space-separated list of +# install-by-default programs and the actual list do-not-install-by-default +# programs, modify the former variable to reflect any "do-install" and +# "don't-install" requests. +# I.e., add any program name specified via --enable-install-program=..., and +# remove any program name specified via --enable-no-install-program=... +# Note how the second argument below is a literal, with "," separators. +# That is required due to the way the macro works, and since the +# corresponding ./configure option argument is comma-separated on input. +gl_INCLUDE_EXCLUDE_PROG([optional_bin_progs], [arch,hostname,su]) + +# Set INSTALL_SU if su installation has been requested via +# --enable-install-program=su. +AC_SUBST([INSTALL_SU]) +case " $optional_bin_progs " in + *' su '*) INSTALL_SU=yes ;; + *) INSTALL_SU=no ;; +esac + +MAN=`echo "$optional_bin_progs "|sed 's/ /.1 /g;s/ $//'|tr -d '\\015\\012'` + +# Change ginstall.1 to "install.h" in $MAN. +MAN=`for m in $MAN; do test $m = ginstall.1 && m=install.1; echo $m; done \ + | tr '\015\012' ' '; echo` + +# Remove [.1, since writing a portable rule for it in man/Makefile.am +# is not practical. The sed LHS below uses the autoconf quadrigraph +# representing '['. +MAN=`echo "$MAN"|sed 's/\@<:@\.1//'` + +OPTIONAL_BIN_PROGS=`echo "$optional_bin_progs "|sed 's/ /\$(EXEEXT) /g;s/ $//'` +AC_SUBST([OPTIONAL_BIN_PROGS]) +NO_INSTALL_PROGS_DEFAULT=$no_install_progs_default +AC_SUBST([NO_INSTALL_PROGS_DEFAULT]) + +AM_CONDITIONAL([CROSS_COMPILING], [test "$cross_compiling" = yes]) + +# Arrange to rerun configure whenever the file, src/Makefile.am, +# containing the list of program names changes. +CONFIG_STATUS_DEPENDENCIES='$(top_srcdir)/src/Makefile.am' +AC_SUBST([CONFIG_STATUS_DEPENDENCIES]) +############################################################################ AM_GNU_GETTEXT([external], [need-formatstring-macros]) AM_GNU_GETTEXT_VERSION([0.15]) +# For a test of uniq: it uses the $LOCALE_FR envvar. +gt_LOCALE_FR + AC_CONFIG_FILES( Makefile doc/Makefile @@ -260,48 +411,6 @@ AC_CONFIG_FILES( po/Makefile.in src/Makefile tests/Makefile - tests/chgrp/Makefile - tests/chmod/Makefile - tests/chown/Makefile - tests/cp/Makefile - tests/cut/Makefile - tests/dd/Makefile - tests/dircolors/Makefile - tests/du/Makefile - tests/expr/Makefile - tests/factor/Makefile - tests/fmt/Makefile - tests/head/Makefile - tests/install/Makefile - tests/join/Makefile - tests/ln/Makefile - tests/ls-2/Makefile - tests/ls/Makefile - tests/md5sum/Makefile - tests/misc/Makefile - tests/mkdir/Makefile - tests/mv/Makefile - tests/od/Makefile - tests/pr/Makefile - tests/readlink/Makefile - tests/rm/Makefile - tests/rmdir/Makefile - tests/seq/Makefile - tests/sha1sum/Makefile - tests/shred/Makefile - tests/sort/Makefile - tests/stty/Makefile - tests/sum/Makefile - tests/tac/Makefile - tests/tail-2/Makefile - tests/tail/Makefile - tests/tee/Makefile - tests/test/Makefile - tests/touch/Makefile - tests/tr/Makefile - tests/tsort/Makefile - tests/unexpand/Makefile - tests/uniq/Makefile - tests/wc/Makefile + gnulib-tests/Makefile ) AC_OUTPUT diff --git a/src/bin/coreutils/doc/ChangeLog b/src/bin/coreutils/doc/ChangeLog-2007 similarity index 98% rename from src/bin/coreutils/doc/ChangeLog rename to src/bin/coreutils/doc/ChangeLog-2007 index 38b5f9dfdc..5043a8f278 100644 --- a/src/bin/coreutils/doc/ChangeLog +++ b/src/bin/coreutils/doc/ChangeLog-2007 @@ -1,3 +1,42 @@ +2007-10-05 Jim Meyering + + * coreutils.texi (chroot invocation): List two systems on which + chroot works when run by non-root. + +2007-09-19 Jim Meyering + + * coreutils.texi (expr invocation): Correct description of relative + operator precedence. Reported by hanpingtian@gmail.com. + +2007-08-25 Eric Blake + + Avoid case-insensitive clash in one-page-per-node html docs. + * coreutils.texi (Concept index): Rename from Index. + +2007-07-15 Jim Meyering + + * coreutils.texi: Revise node structure per new fdl.texi. + +2007-06-06 Jim Meyering + + * coreutils.texi (rmdir invocation): Fix a tiny typo. + +2007-06-03 Jim Meyering + + * constants.texi: Remove from version control. + This file has always been generated. + * .gitignore: Add constants.texi. + +2007-04-28 Paul Eggert + + * coreutils.texi (nohup invocation): Add advice about saving + output to a file. + +2007-04-16 Jim Meyering + + * coreutils.texi (cut invocation): Adjust synopsis to show that an + OPTION is required. Reported by Rudolf Kastl. + 2007-03-21 Eric Blake * coreutils.texi (md5sum invocation): Document escapes in output diff --git a/src/bin/coreutils/doc/Makefile.am b/src/bin/coreutils/doc/Makefile.am index e0e2ee5a3e..be610a276e 100644 --- a/src/bin/coreutils/doc/Makefile.am +++ b/src/bin/coreutils/doc/Makefile.am @@ -1,11 +1,10 @@ # Make coreutils documentation. -*-Makefile-*- -# Copyright (C) 1995, 1996, 1997, 1998, 2001, 2002, 2003, 2004, 2005, -# 2006 Free Software Foundation, Inc. +# Copyright (C) 1995-1998, 2001-2009 Free Software Foundation, Inc. -# This program is free software; you can redistribute it and/or modify +# This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or +# the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # This program is distributed in the hope that it will be useful, @@ -14,9 +13,7 @@ # GNU General Public License for more details. # You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -# 02110-1301, USA. +# along with this program. If not, see . info_TEXINFOS = coreutils.texi @@ -32,10 +29,13 @@ EXTRA_DIST = perm.texi getdate.texi constants.texi fdl.texi # old systems. AM_MAKEINFOFLAGS = --no-split -constants.texi: $(top_srcdir)/src/tail.c +constants.texi: $(top_srcdir)/src/tail.c $(top_srcdir)/src/shred.c LC_ALL=C \ sed -n -e 's/^#define \(DEFAULT_MAX[_A-Z]*\) \(.*\)/@set \1 \2/p' \ $(top_srcdir)/src/tail.c > t-$@ + LC_ALL=C \ + sed -n -e 's/.*\(DEFAULT_PASSES\)[ =]* \([0-9]*\).*/@set SHRED_\1 \2/p'\ + $(top_srcdir)/src/shred.c >> t-$@ mv t-$@ $@ MAINTAINERCLEANFILES = constants.texi @@ -47,28 +47,75 @@ $(INFO_DEPS): $(EXTRA_DIST) _W = (^|[^A-Za-z0-9_]) W_ = ([^A-Za-z0-9_]|$$) +syntax_checks = \ + sc-avoid-io \ + sc-avoid-non-zero \ + sc-avoid-timezone \ + sc-avoid-zeroes \ + sc-exponent-grouping \ + sc-lower-case-var \ + sc-use-small-caps-NUL + +.PHONY: $(syntax_checks) check-texinfo + # List words/regexps here that should not appear in the texinfo documentation. -# E.g., use @sc{nul}, not `NUL' -# Use `time zone', not `timezone'. -# Use `zeros', not `zeroes' (nothing wrong with `zeroes'. just be consistent). -check-texinfo: - fail=0; \ - grep timezone $(srcdir)/*.texi && fail=1; \ - $(EGREP) '$(_W)IO$(W_)' $(srcdir)/*.texi && fail=1; \ - grep non-zero $(srcdir)/*.texi && fail=1; \ - grep '@url{' $(srcdir)/*.texi && fail=1; \ - $(EGREP) '$(_W)NUL$(W_)' $(srcdir)/*.texi && fail=1; \ - grep '\$$@"' $(srcdir)/*.texi && fail=1; \ - grep -n '[^[:punct:]]@footnote' $(srcdir)/*.texi && fail=1; \ - grep -n filename $(srcdir)/*.texi|$(EGREP) -v 'setfilename|[{]filename[}]' \ - && fail=1; \ - $(PERL) -e 1 2> /dev/null && { $(PERL) -ne \ +check-texinfo: $(syntax_checks) + $(AM_V_GEN)fail=0; \ + grep '@url{' $(srcdir)/*.texi && fail=1; \ + grep '\$$@"' $(srcdir)/*.texi && fail=1; \ + grep -n '[^[:punct:]]@footnote' $(srcdir)/*.texi && fail=1; \ + grep -n filename $(srcdir)/*.texi \ + | $(EGREP) -v 'setfilename|[{]filename[}]' \ + && fail=1; \ + $(PERL) -e 1 2> /dev/null && { $(PERL) -ne \ '/\bPOSIX\b/ && !/\@acronym{POSIX}/ && !/^\* / || /{posix}/ and print,exit 1' \ - $(srcdir)/*.texi 2> /dev/null || fail=1; }; \ - $(EGREP) -i '$(_W)zeroes$(W_)' $(srcdir)/*.texi && fail=1; \ - $(EGREP) -i '$(_W)builtins?$(W_)' $(srcdir)/*.texi && fail=1; \ - $(EGREP) -i '$(_W)path(name)?s?$(W_)' $(srcdir)/*.texi \ - | $(EGREP) -v '@vindex PATH$$|@env[{]PATH[}]' && fail=1; \ + $(srcdir)/*.texi 2> /dev/null || fail=1; }; \ + $(EGREP) -i '$(_W)builtins?$(W_)' $(srcdir)/*.texi && fail=1; \ + $(EGREP) -i '$(_W)path(name)?s?$(W_)' $(srcdir)/*.texi \ + | $(EGREP) -v 'search path|@vindex PATH$$|@env[{]PATH[}]' && fail=1; \ exit $$fail +# Use `time zone', not `timezone'. +sc-avoid-timezone: + $(AM_V_GEN)$(EGREP) timezone $(srcdir)/*.texi && exit 1 || : + +# Check for insufficient exponent grouping, e.g., +# @math{2^64} should be @math{2^{64}}. +sc-exponent-grouping: + $(AM_V_GEN)$(EGREP) '\{.*\^[0-9][0-9]' $(srcdir)/*.texi && exit 1 || : + +# E.g., use @sc{nul}, not NUL. +sc-use-small-caps-NUL: + $(AM_V_GEN)$(EGREP) '$(_W)NUL$(W_)' $(srcdir)/*.texi && exit 1 || : + +# Say I/O, not IO. +sc-avoid-io: + $(AM_V_GEN)$(EGREP) '$(_W)IO$(W_)' $(srcdir)/*.texi && exit 1 || : + +# I prefer nonzero over non-zero. +sc-avoid-non-zero: + $(AM_V_GEN)$(EGREP) non-zero $(srcdir)/*.texi && exit 1 || : + +# Use `zeros', not `zeroes' (nothing wrong with `zeroes'. just be consistent). +sc-avoid-zeroes: + $(AM_V_GEN)$(EGREP) -i '$(_W)zeroes$(W_)' $(srcdir)/*.texi && exit 1 || : + +# ME = $(subdir)/$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)) +ME = doc/Makefile + +# The quantity inside @var{...} should not contain upper case letters. +# The leading backslash exemption is to permit in-macro uses like +# @var{\varName\} where the upper case letter is part of a parameter name. +find_upper_case_var = \ + '/\@var{/ or next; \ + while (/\@var{(.+?)}/g) \ + { \ + $$v = $$1; \ + $$v =~ /[A-Z]/ && $$v !~ /^\\/ and (print "$$ARGV:$$.:$$_"), $$m = 1 \ + } \ + END {$$m and (warn "$(ME): do not use upper case in \@var{...}\n"), exit 1}' +sc-lower-case-var: + $(AM_V_GEN)$(PERL) -e 1 \ + && $(PERL) -lne $(find_upper_case_var) $(srcdir)/*.texi + check: check-texinfo diff --git a/src/bin/coreutils/doc/Makefile.in b/src/bin/coreutils/doc/Makefile.in index ca84e9254e..8666d61267 100644 --- a/src/bin/coreutils/doc/Makefile.in +++ b/src/bin/coreutils/doc/Makefile.in @@ -1,8 +1,9 @@ -# Makefile.in generated by automake 1.10 from Makefile.am. +# Makefile.in generated by automake 1.10c from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -16,12 +17,11 @@ # Make coreutils documentation. -*-Makefile-*- -# Copyright (C) 1995, 1996, 1997, 1998, 2001, 2002, 2003, 2004, 2005, -# 2006 Free Software Foundation, Inc. +# Copyright (C) 1995-1998, 2001-2009 Free Software Foundation, Inc. -# This program is free software; you can redistribute it and/or modify +# This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or +# the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # This program is distributed in the hope that it will be useful, @@ -30,13 +30,12 @@ # GNU General Public License for more details. # You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -# 02110-1301, USA. +# along with this program. If not, see . VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c @@ -53,39 +52,47 @@ build_triplet = @build@ host_triplet = @host@ subdir = doc DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ - $(srcdir)/stamp-vti $(srcdir)/version.texi ChangeLog + $(srcdir)/stamp-vti $(srcdir)/version.texi ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/absolute-header.m4 \ +am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \ $(top_srcdir)/m4/acl.m4 $(top_srcdir)/m4/alloca.m4 \ - $(top_srcdir)/m4/allocsa.m4 $(top_srcdir)/m4/argmatch.m4 \ - $(top_srcdir)/m4/arpa_inet_h.m4 $(top_srcdir)/m4/assert.m4 \ - $(top_srcdir)/m4/atexit.m4 $(top_srcdir)/m4/autobuild.m4 \ - $(top_srcdir)/m4/backupfile.m4 $(top_srcdir)/m4/base64.m4 \ - $(top_srcdir)/m4/bison.m4 $(top_srcdir)/m4/boottime.m4 \ + $(top_srcdir)/m4/argmatch.m4 $(top_srcdir)/m4/arpa_inet_h.m4 \ + $(top_srcdir)/m4/assert.m4 $(top_srcdir)/m4/atexit.m4 \ + $(top_srcdir)/m4/autobuild.m4 $(top_srcdir)/m4/backupfile.m4 \ + $(top_srcdir)/m4/base64.m4 $(top_srcdir)/m4/bison.m4 \ + $(top_srcdir)/m4/boottime.m4 $(top_srcdir)/m4/btowc.m4 \ $(top_srcdir)/m4/c-strtod.m4 $(top_srcdir)/m4/calloc.m4 \ $(top_srcdir)/m4/canon-host.m4 \ $(top_srcdir)/m4/canonicalize.m4 \ $(top_srcdir)/m4/chdir-long.m4 $(top_srcdir)/m4/check-decl.m4 \ $(top_srcdir)/m4/chown.m4 $(top_srcdir)/m4/clock_time.m4 \ $(top_srcdir)/m4/cloexec.m4 $(top_srcdir)/m4/close-stream.m4 \ + $(top_srcdir)/m4/close.m4 $(top_srcdir)/m4/closein.m4 \ $(top_srcdir)/m4/closeout.m4 $(top_srcdir)/m4/codeset.m4 \ $(top_srcdir)/m4/config-h.m4 $(top_srcdir)/m4/cycle-check.m4 \ $(top_srcdir)/m4/d-ino.m4 $(top_srcdir)/m4/d-type.m4 \ - $(top_srcdir)/m4/dirfd.m4 $(top_srcdir)/m4/dirname.m4 \ - $(top_srcdir)/m4/dos.m4 $(top_srcdir)/m4/double-slash-root.m4 \ - $(top_srcdir)/m4/dup2.m4 $(top_srcdir)/m4/eealloc.m4 \ - $(top_srcdir)/m4/eoverflow.m4 $(top_srcdir)/m4/error.m4 \ + $(top_srcdir)/m4/dirent_h.m4 $(top_srcdir)/m4/dirfd.m4 \ + $(top_srcdir)/m4/dirname.m4 $(top_srcdir)/m4/dos.m4 \ + $(top_srcdir)/m4/double-slash-root.m4 $(top_srcdir)/m4/dup2.m4 \ + $(top_srcdir)/m4/eealloc.m4 $(top_srcdir)/m4/environ.m4 \ + $(top_srcdir)/m4/errno_h.m4 $(top_srcdir)/m4/error.m4 \ $(top_srcdir)/m4/euidaccess-stat.m4 \ $(top_srcdir)/m4/euidaccess.m4 $(top_srcdir)/m4/exclude.m4 \ - $(top_srcdir)/m4/exitfail.m4 $(top_srcdir)/m4/extensions.m4 \ - $(top_srcdir)/m4/fchdir.m4 $(top_srcdir)/m4/fcntl-safer.m4 \ + $(top_srcdir)/m4/exitfail.m4 $(top_srcdir)/m4/exponentd.m4 \ + $(top_srcdir)/m4/exponentf.m4 $(top_srcdir)/m4/exponentl.m4 \ + $(top_srcdir)/m4/extensions.m4 $(top_srcdir)/m4/fchdir.m4 \ + $(top_srcdir)/m4/fclose.m4 $(top_srcdir)/m4/fcntl-safer.m4 \ $(top_srcdir)/m4/fcntl_h.m4 $(top_srcdir)/m4/fd-reopen.m4 \ - $(top_srcdir)/m4/file-type.m4 $(top_srcdir)/m4/fileblocks.m4 \ - $(top_srcdir)/m4/filemode.m4 $(top_srcdir)/m4/filenamecat.m4 \ - $(top_srcdir)/m4/flexmember.m4 $(top_srcdir)/m4/fnmatch.m4 \ - $(top_srcdir)/m4/fpending.m4 $(top_srcdir)/m4/fprintftime.m4 \ - $(top_srcdir)/m4/free.m4 $(top_srcdir)/m4/fstypename.m4 \ - $(top_srcdir)/m4/fsusage.m4 $(top_srcdir)/m4/ftruncate.m4 \ + $(top_srcdir)/m4/fflush.m4 $(top_srcdir)/m4/file-type.m4 \ + $(top_srcdir)/m4/fileblocks.m4 $(top_srcdir)/m4/filemode.m4 \ + $(top_srcdir)/m4/filenamecat.m4 $(top_srcdir)/m4/flexmember.m4 \ + $(top_srcdir)/m4/float_h.m4 $(top_srcdir)/m4/fnmatch.m4 \ + $(top_srcdir)/m4/fpending.m4 $(top_srcdir)/m4/fpieee.m4 \ + $(top_srcdir)/m4/fprintftime.m4 $(top_srcdir)/m4/fpurge.m4 \ + $(top_srcdir)/m4/freading.m4 $(top_srcdir)/m4/frexp.m4 \ + $(top_srcdir)/m4/frexpl.m4 $(top_srcdir)/m4/fseeko.m4 \ + $(top_srcdir)/m4/fstypename.m4 $(top_srcdir)/m4/fsusage.m4 \ + $(top_srcdir)/m4/ftello.m4 $(top_srcdir)/m4/ftruncate.m4 \ $(top_srcdir)/m4/fts.m4 $(top_srcdir)/m4/getaddrinfo.m4 \ $(top_srcdir)/m4/getcwd-abort-bug.m4 \ $(top_srcdir)/m4/getcwd-path-max.m4 $(top_srcdir)/m4/getcwd.m4 \ @@ -98,49 +105,65 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/absolute-header.m4 \ $(top_srcdir)/m4/gettime.m4 $(top_srcdir)/m4/gettimeofday.m4 \ $(top_srcdir)/m4/getugroups.m4 \ $(top_srcdir)/m4/getusershell.m4 $(top_srcdir)/m4/glibc21.m4 \ + $(top_srcdir)/m4/gmp.m4 $(top_srcdir)/m4/gnu-make.m4 \ $(top_srcdir)/m4/gnulib-common.m4 \ $(top_srcdir)/m4/gnulib-comp.m4 \ $(top_srcdir)/m4/group-member.m4 \ $(top_srcdir)/m4/hard-locale.m4 $(top_srcdir)/m4/hash.m4 \ - $(top_srcdir)/m4/host-os.m4 $(top_srcdir)/m4/human.m4 \ - $(top_srcdir)/m4/i-ring.m4 $(top_srcdir)/m4/iconv.m4 \ - $(top_srcdir)/m4/idcache.m4 $(top_srcdir)/m4/inet_ntop.m4 \ - $(top_srcdir)/m4/inline.m4 $(top_srcdir)/m4/intmax_t.m4 \ + $(top_srcdir)/m4/host-os.m4 $(top_srcdir)/m4/hostent.m4 \ + $(top_srcdir)/m4/human.m4 $(top_srcdir)/m4/i-ring.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/iconv_h.m4 \ + $(top_srcdir)/m4/iconv_open.m4 $(top_srcdir)/m4/idcache.m4 \ + $(top_srcdir)/m4/include-exclude-prog.m4 \ + $(top_srcdir)/m4/include_next.m4 $(top_srcdir)/m4/inet_ntop.m4 \ + $(top_srcdir)/m4/inet_pton.m4 $(top_srcdir)/m4/inline.m4 \ + $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/intmax_t.m4 \ $(top_srcdir)/m4/inttostr.m4 $(top_srcdir)/m4/inttypes-pri.m4 \ $(top_srcdir)/m4/inttypes.m4 $(top_srcdir)/m4/inttypes_h.m4 \ - $(top_srcdir)/m4/isapipe.m4 $(top_srcdir)/m4/jm-macros.m4 \ - $(top_srcdir)/m4/jm-winsz1.m4 $(top_srcdir)/m4/jm-winsz2.m4 \ - $(top_srcdir)/m4/lchmod.m4 $(top_srcdir)/m4/lchown.m4 \ + $(top_srcdir)/m4/isapipe.m4 $(top_srcdir)/m4/isnand.m4 \ + $(top_srcdir)/m4/isnanf.m4 $(top_srcdir)/m4/isnanl.m4 \ + $(top_srcdir)/m4/jm-macros.m4 $(top_srcdir)/m4/jm-winsz1.m4 \ + $(top_srcdir)/m4/jm-winsz2.m4 $(top_srcdir)/m4/lchmod.m4 \ + $(top_srcdir)/m4/lchown.m4 $(top_srcdir)/m4/ldexpl.m4 \ $(top_srcdir)/m4/lib-check.m4 $(top_srcdir)/m4/lib-ignore.m4 \ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/link-follow.m4 \ - $(top_srcdir)/m4/localcharset.m4 \ - $(top_srcdir)/m4/long-options.m4 \ - $(top_srcdir)/m4/longdouble.m4 $(top_srcdir)/m4/longlong.m4 \ - $(top_srcdir)/m4/ls-mntd-fs.m4 $(top_srcdir)/m4/lstat.m4 \ + $(top_srcdir)/m4/localcharset.m4 $(top_srcdir)/m4/locale-fr.m4 \ + $(top_srcdir)/m4/locale-ja.m4 $(top_srcdir)/m4/locale-tr.m4 \ + $(top_srcdir)/m4/locale-zh.m4 $(top_srcdir)/m4/long-options.m4 \ + $(top_srcdir)/m4/longlong.m4 $(top_srcdir)/m4/ls-mntd-fs.m4 \ + $(top_srcdir)/m4/lseek.m4 $(top_srcdir)/m4/lstat.m4 \ + $(top_srcdir)/m4/malloc.m4 $(top_srcdir)/m4/malloca.m4 \ + $(top_srcdir)/m4/manywarnings.m4 $(top_srcdir)/m4/math_h.m4 \ $(top_srcdir)/m4/mbchar.m4 $(top_srcdir)/m4/mbiter.m4 \ - $(top_srcdir)/m4/mbrtowc.m4 $(top_srcdir)/m4/mbscasecmp.m4 \ + $(top_srcdir)/m4/mbrlen.m4 $(top_srcdir)/m4/mbrtowc.m4 \ + $(top_srcdir)/m4/mbsinit.m4 $(top_srcdir)/m4/mbsrtowcs.m4 \ $(top_srcdir)/m4/mbstate_t.m4 $(top_srcdir)/m4/mbswidth.m4 \ $(top_srcdir)/m4/md5.m4 $(top_srcdir)/m4/memcasecmp.m4 \ $(top_srcdir)/m4/memchr.m4 $(top_srcdir)/m4/memcmp.m4 \ $(top_srcdir)/m4/memcoll.m4 $(top_srcdir)/m4/memcpy.m4 \ $(top_srcdir)/m4/memmove.m4 $(top_srcdir)/m4/mempcpy.m4 \ $(top_srcdir)/m4/memrchr.m4 $(top_srcdir)/m4/memset.m4 \ - $(top_srcdir)/m4/memxfrm.m4 $(top_srcdir)/m4/mkancesdirs.m4 \ - $(top_srcdir)/m4/mkdir-p.m4 $(top_srcdir)/m4/mkdir-slash.m4 \ - $(top_srcdir)/m4/mkstemp.m4 $(top_srcdir)/m4/mktime.m4 \ - $(top_srcdir)/m4/modechange.m4 $(top_srcdir)/m4/mountlist.m4 \ - $(top_srcdir)/m4/mpsort.m4 $(top_srcdir)/m4/nanosleep.m4 \ - $(top_srcdir)/m4/netinet_in_h.m4 $(top_srcdir)/m4/nls.m4 \ - $(top_srcdir)/m4/openat.m4 $(top_srcdir)/m4/pathmax.m4 \ - $(top_srcdir)/m4/perl.m4 $(top_srcdir)/m4/physmem.m4 \ - $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/posixtm.m4 \ - $(top_srcdir)/m4/posixver.m4 $(top_srcdir)/m4/prereq.m4 \ - $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/putenv.m4 \ - $(top_srcdir)/m4/quote.m4 $(top_srcdir)/m4/quotearg.m4 \ - $(top_srcdir)/m4/randint.m4 $(top_srcdir)/m4/randperm.m4 \ - $(top_srcdir)/m4/randread.m4 $(top_srcdir)/m4/readlink.m4 \ - $(top_srcdir)/m4/readtokens.m4 $(top_srcdir)/m4/readutmp.m4 \ + $(top_srcdir)/m4/memxfrm.m4 $(top_srcdir)/m4/mgetgroups.m4 \ + $(top_srcdir)/m4/mkancesdirs.m4 $(top_srcdir)/m4/mkdir-p.m4 \ + $(top_srcdir)/m4/mkdir-slash.m4 $(top_srcdir)/m4/mkstemp.m4 \ + $(top_srcdir)/m4/mktime.m4 $(top_srcdir)/m4/modechange.m4 \ + $(top_srcdir)/m4/mountlist.m4 $(top_srcdir)/m4/mpsort.m4 \ + $(top_srcdir)/m4/multiarch.m4 $(top_srcdir)/m4/nanosleep.m4 \ + $(top_srcdir)/m4/netdb_h.m4 $(top_srcdir)/m4/netinet_in_h.m4 \ + $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/nocrash.m4 \ + $(top_srcdir)/m4/open.m4 $(top_srcdir)/m4/openat.m4 \ + $(top_srcdir)/m4/pathmax.m4 $(top_srcdir)/m4/perl.m4 \ + $(top_srcdir)/m4/perror.m4 $(top_srcdir)/m4/physmem.m4 \ + $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/posix-shell.m4 \ + $(top_srcdir)/m4/posixtm.m4 $(top_srcdir)/m4/posixver.m4 \ + $(top_srcdir)/m4/prereq.m4 $(top_srcdir)/m4/printf-frexp.m4 \ + $(top_srcdir)/m4/printf-frexpl.m4 $(top_srcdir)/m4/printf.m4 \ + $(top_srcdir)/m4/priv-set.m4 $(top_srcdir)/m4/progtest.m4 \ + $(top_srcdir)/m4/putenv.m4 $(top_srcdir)/m4/quote.m4 \ + $(top_srcdir)/m4/quotearg.m4 $(top_srcdir)/m4/read-file.m4 \ + $(top_srcdir)/m4/readlink.m4 $(top_srcdir)/m4/readtokens.m4 \ + $(top_srcdir)/m4/readutmp.m4 $(top_srcdir)/m4/realloc.m4 \ $(top_srcdir)/m4/regex.m4 \ $(top_srcdir)/m4/rename-dest-slash.m4 \ $(top_srcdir)/m4/rename.m4 $(top_srcdir)/m4/rmdir-errno.m4 \ @@ -148,10 +171,17 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/absolute-header.m4 \ $(top_srcdir)/m4/rpmatch.m4 $(top_srcdir)/m4/safe-read.m4 \ $(top_srcdir)/m4/safe-write.m4 $(top_srcdir)/m4/same.m4 \ $(top_srcdir)/m4/save-cwd.m4 $(top_srcdir)/m4/savedir.m4 \ - $(top_srcdir)/m4/savewd.m4 $(top_srcdir)/m4/setenv.m4 \ + $(top_srcdir)/m4/savewd.m4 $(top_srcdir)/m4/select.m4 \ + $(top_srcdir)/m4/selinux-context-h.m4 \ + $(top_srcdir)/m4/selinux-selinux-h.m4 \ + $(top_srcdir)/m4/servent.m4 $(top_srcdir)/m4/setenv.m4 \ $(top_srcdir)/m4/settime.m4 $(top_srcdir)/m4/sha1.m4 \ $(top_srcdir)/m4/sha256.m4 $(top_srcdir)/m4/sha512.m4 \ - $(top_srcdir)/m4/sig2str.m4 $(top_srcdir)/m4/snprintf.m4 \ + $(top_srcdir)/m4/sig2str.m4 $(top_srcdir)/m4/sigaction.m4 \ + $(top_srcdir)/m4/signal_h.m4 \ + $(top_srcdir)/m4/signalblocking.m4 $(top_srcdir)/m4/signbit.m4 \ + $(top_srcdir)/m4/size_max.m4 $(top_srcdir)/m4/sleep.m4 \ + $(top_srcdir)/m4/snprintf.m4 $(top_srcdir)/m4/sockets.m4 \ $(top_srcdir)/m4/socklen.m4 $(top_srcdir)/m4/sockpfaf.m4 \ $(top_srcdir)/m4/ssize_t.m4 $(top_srcdir)/m4/st_dm_mode.m4 \ $(top_srcdir)/m4/stat-prog.m4 $(top_srcdir)/m4/stat-time.m4 \ @@ -159,40 +189,56 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/absolute-header.m4 \ $(top_srcdir)/m4/stdint.m4 $(top_srcdir)/m4/stdint_h.m4 \ $(top_srcdir)/m4/stdio-safer.m4 $(top_srcdir)/m4/stdio_h.m4 \ $(top_srcdir)/m4/stdlib-safer.m4 $(top_srcdir)/m4/stdlib_h.m4 \ - $(top_srcdir)/m4/stpcpy.m4 $(top_srcdir)/m4/strcspn.m4 \ - $(top_srcdir)/m4/strdup.m4 $(top_srcdir)/m4/strftime.m4 \ + $(top_srcdir)/m4/stpcpy.m4 $(top_srcdir)/m4/stpncpy.m4 \ + $(top_srcdir)/m4/strcspn.m4 $(top_srcdir)/m4/strdup.m4 \ + $(top_srcdir)/m4/strerror.m4 $(top_srcdir)/m4/strftime.m4 \ $(top_srcdir)/m4/string_h.m4 $(top_srcdir)/m4/strndup.m4 \ $(top_srcdir)/m4/strnlen.m4 $(top_srcdir)/m4/strnumcmp.m4 \ $(top_srcdir)/m4/strpbrk.m4 $(top_srcdir)/m4/strtod.m4 \ $(top_srcdir)/m4/strtoimax.m4 $(top_srcdir)/m4/strtol.m4 \ $(top_srcdir)/m4/strtoll.m4 $(top_srcdir)/m4/strtoul.m4 \ $(top_srcdir)/m4/strtoull.m4 $(top_srcdir)/m4/strtoumax.m4 \ - $(top_srcdir)/m4/strverscmp.m4 \ + $(top_srcdir)/m4/strverscmp.m4 $(top_srcdir)/m4/sys_ioctl_h.m4 \ + $(top_srcdir)/m4/sys_select_h.m4 \ $(top_srcdir)/m4/sys_socket_h.m4 \ $(top_srcdir)/m4/sys_stat_h.m4 $(top_srcdir)/m4/sys_time_h.m4 \ $(top_srcdir)/m4/tempname.m4 $(top_srcdir)/m4/time_h.m4 \ $(top_srcdir)/m4/time_r.m4 $(top_srcdir)/m4/timespec.m4 \ $(top_srcdir)/m4/tm_gmtoff.m4 $(top_srcdir)/m4/tzset.m4 \ - $(top_srcdir)/m4/unicodeio.m4 $(top_srcdir)/m4/unistd-safer.m4 \ - $(top_srcdir)/m4/unistd_h.m4 $(top_srcdir)/m4/unlink-busy.m4 \ - $(top_srcdir)/m4/unlinkdir.m4 $(top_srcdir)/m4/unlocked-io.m4 \ - $(top_srcdir)/m4/uptime.m4 $(top_srcdir)/m4/userspec.m4 \ - $(top_srcdir)/m4/utimbuf.m4 $(top_srcdir)/m4/utime.m4 \ + $(top_srcdir)/m4/ungetc.m4 $(top_srcdir)/m4/unicodeio.m4 \ + $(top_srcdir)/m4/unistd-safer.m4 $(top_srcdir)/m4/unistd_h.m4 \ + $(top_srcdir)/m4/unlink-busy.m4 $(top_srcdir)/m4/unlinkdir.m4 \ + $(top_srcdir)/m4/unlocked-io.m4 $(top_srcdir)/m4/uptime.m4 \ + $(top_srcdir)/m4/userspec.m4 $(top_srcdir)/m4/utimbuf.m4 \ $(top_srcdir)/m4/utimecmp.m4 $(top_srcdir)/m4/utimens.m4 \ - $(top_srcdir)/m4/utimes-null.m4 $(top_srcdir)/m4/utimes.m4 \ - $(top_srcdir)/m4/vasnprintf.m4 $(top_srcdir)/m4/vasprintf.m4 \ + $(top_srcdir)/m4/utimes.m4 $(top_srcdir)/m4/vasnprintf.m4 \ + $(top_srcdir)/m4/vasprintf-posix.m4 \ + $(top_srcdir)/m4/vasprintf.m4 \ + $(top_srcdir)/m4/vfprintf-posix.m4 \ + $(top_srcdir)/m4/vprintf-posix.m4 $(top_srcdir)/m4/warnings.m4 \ $(top_srcdir)/m4/wchar.m4 $(top_srcdir)/m4/wchar_t.m4 \ + $(top_srcdir)/m4/wcrtomb.m4 $(top_srcdir)/m4/wctob.m4 \ $(top_srcdir)/m4/wctype.m4 $(top_srcdir)/m4/wcwidth.m4 \ - $(top_srcdir)/m4/wint_t.m4 $(top_srcdir)/m4/xalloc.m4 \ - $(top_srcdir)/m4/xfts.m4 $(top_srcdir)/m4/xgetcwd.m4 \ - $(top_srcdir)/m4/xnanosleep.m4 $(top_srcdir)/m4/xstrndup.m4 \ + $(top_srcdir)/m4/wint_t.m4 $(top_srcdir)/m4/write-any-file.m4 \ + $(top_srcdir)/m4/write.m4 $(top_srcdir)/m4/xalloc.m4 \ + $(top_srcdir)/m4/xattr.m4 $(top_srcdir)/m4/xfts.m4 \ + $(top_srcdir)/m4/xgetcwd.m4 $(top_srcdir)/m4/xnanosleep.m4 \ + $(top_srcdir)/m4/xsize.m4 $(top_srcdir)/m4/xstrndup.m4 \ $(top_srcdir)/m4/xstrtod.m4 $(top_srcdir)/m4/xstrtol.m4 \ - $(top_srcdir)/m4/yesno.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/xvasprintf.m4 $(top_srcdir)/m4/yesno.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/lib/config.h CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) +am__v_GEN_0 = @echo " GEN " $@; +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) +am__v_at_0 = @ SOURCES = DIST_SOURCES = INFO_DEPS = $(srcdir)/coreutils.info @@ -214,27 +260,29 @@ am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; -am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ABSOLUTE_DIRENT_H = @ABSOLUTE_DIRENT_H@ -ABSOLUTE_FCNTL_H = @ABSOLUTE_FCNTL_H@ -ABSOLUTE_INTTYPES_H = @ABSOLUTE_INTTYPES_H@ -ABSOLUTE_NETINET_IN_H = @ABSOLUTE_NETINET_IN_H@ -ABSOLUTE_STDINT_H = @ABSOLUTE_STDINT_H@ -ABSOLUTE_STDIO_H = @ABSOLUTE_STDIO_H@ -ABSOLUTE_STDLIB_H = @ABSOLUTE_STDLIB_H@ -ABSOLUTE_STRING_H = @ABSOLUTE_STRING_H@ -ABSOLUTE_SYS_SOCKET_H = @ABSOLUTE_SYS_SOCKET_H@ -ABSOLUTE_SYS_STAT_H = @ABSOLUTE_SYS_STAT_H@ -ABSOLUTE_SYS_TIME_H = @ABSOLUTE_SYS_TIME_H@ -ABSOLUTE_TIME_H = @ABSOLUTE_TIME_H@ -ABSOLUTE_UNISTD_H = @ABSOLUTE_UNISTD_H@ -ABSOLUTE_WCHAR_H = @ABSOLUTE_WCHAR_H@ -ABSOLUTE_WCTYPE_H = @ABSOLUTE_WCTYPE_H@ ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ ALLOCA_H = @ALLOCA_H@ AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@ ARPA_INET_H = @ARPA_INET_H@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -248,46 +296,122 @@ BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ +CONFIG_STATUS_DEPENDENCIES = @CONFIG_STATUS_DEPENDENCIES@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFAULT_POSIX2_VERSION = @DEFAULT_POSIX2_VERSION@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DF_PROG = @DF_PROG@ DIRENT_H = @DIRENT_H@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -EOVERFLOW = @EOVERFLOW@ +EMULTIHOP_HIDDEN = @EMULTIHOP_HIDDEN@ +EMULTIHOP_VALUE = @EMULTIHOP_VALUE@ +ENOLINK_HIDDEN = @ENOLINK_HIDDEN@ +ENOLINK_VALUE = @ENOLINK_VALUE@ +EOVERFLOW_HIDDEN = @EOVERFLOW_HIDDEN@ +EOVERFLOW_VALUE = @EOVERFLOW_VALUE@ +ERRNO_H = @ERRNO_H@ EXEEXT = @EXEEXT@ FCNTL_H = @FCNTL_H@ +FLOAT_H = @FLOAT_H@ FNMATCH_H = @FNMATCH_H@ +GETADDRINFO_LIB = @GETADDRINFO_LIB@ GETLOADAVG_LIBS = @GETLOADAVG_LIBS@ GETOPT_H = @GETOPT_H@ +GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GLIBC21 = @GLIBC21@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ +GNULIB_ACCEPT = @GNULIB_ACCEPT@ +GNULIB_ALPHASORT = @GNULIB_ALPHASORT@ +GNULIB_ATOLL = @GNULIB_ATOLL@ +GNULIB_BIND = @GNULIB_BIND@ +GNULIB_BTOWC = @GNULIB_BTOWC@ +GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@ +GNULIB_CEILF = @GNULIB_CEILF@ +GNULIB_CEILL = @GNULIB_CEILL@ GNULIB_CHOWN = @GNULIB_CHOWN@ +GNULIB_CLOSE = @GNULIB_CLOSE@ +GNULIB_CONNECT = @GNULIB_CONNECT@ +GNULIB_DIRFD = @GNULIB_DIRFD@ +GNULIB_DPRINTF = @GNULIB_DPRINTF@ GNULIB_DUP2 = @GNULIB_DUP2@ +GNULIB_ENVIRON = @GNULIB_ENVIRON@ +GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@ GNULIB_FCHDIR = @GNULIB_FCHDIR@ +GNULIB_FCLOSE = @GNULIB_FCLOSE@ +GNULIB_FFLUSH = @GNULIB_FFLUSH@ +GNULIB_FLOORF = @GNULIB_FLOORF@ +GNULIB_FLOORL = @GNULIB_FLOORL@ +GNULIB_FOPEN = @GNULIB_FOPEN@ +GNULIB_FPRINTF = @GNULIB_FPRINTF@ GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@ +GNULIB_FPUTC = @GNULIB_FPUTC@ +GNULIB_FPUTS = @GNULIB_FPUTS@ +GNULIB_FREOPEN = @GNULIB_FREOPEN@ +GNULIB_FREXP = @GNULIB_FREXP@ +GNULIB_FREXPL = @GNULIB_FREXPL@ +GNULIB_FSEEK = @GNULIB_FSEEK@ +GNULIB_FSEEKO = @GNULIB_FSEEKO@ +GNULIB_FSYNC = @GNULIB_FSYNC@ +GNULIB_FTELL = @GNULIB_FTELL@ +GNULIB_FTELLO = @GNULIB_FTELLO@ GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@ +GNULIB_FWRITE = @GNULIB_FWRITE@ +GNULIB_GETADDRINFO = @GNULIB_GETADDRINFO@ GNULIB_GETCWD = @GNULIB_GETCWD@ +GNULIB_GETDELIM = @GNULIB_GETDELIM@ +GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@ +GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@ +GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@ +GNULIB_GETLINE = @GNULIB_GETLINE@ +GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@ GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ +GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@ +GNULIB_GETPEERNAME = @GNULIB_GETPEERNAME@ +GNULIB_GETSOCKNAME = @GNULIB_GETSOCKNAME@ +GNULIB_GETSOCKOPT = @GNULIB_GETSOCKOPT@ GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ +GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@ GNULIB_IMAXABS = @GNULIB_IMAXABS@ GNULIB_IMAXDIV = @GNULIB_IMAXDIV@ +GNULIB_INET_NTOP = @GNULIB_INET_NTOP@ +GNULIB_INET_PTON = @GNULIB_INET_PTON@ +GNULIB_IOCTL = @GNULIB_IOCTL@ +GNULIB_ISFINITE = @GNULIB_ISFINITE@ +GNULIB_ISINF = @GNULIB_ISINF@ +GNULIB_ISNAN = @GNULIB_ISNAN@ +GNULIB_ISNAND = @GNULIB_ISNAND@ +GNULIB_ISNANF = @GNULIB_ISNANF@ +GNULIB_ISNANL = @GNULIB_ISNANL@ +GNULIB_LCHMOD = @GNULIB_LCHMOD@ +GNULIB_LCHOWN = @GNULIB_LCHOWN@ +GNULIB_LDEXPL = @GNULIB_LDEXPL@ +GNULIB_LINK = @GNULIB_LINK@ +GNULIB_LISTEN = @GNULIB_LISTEN@ +GNULIB_LSEEK = @GNULIB_LSEEK@ +GNULIB_LSTAT = @GNULIB_LSTAT@ +GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@ +GNULIB_MATHL = @GNULIB_MATHL@ +GNULIB_MBRLEN = @GNULIB_MBRLEN@ +GNULIB_MBRTOWC = @GNULIB_MBRTOWC@ GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@ GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@ GNULIB_MBSCHR = @GNULIB_MBSCHR@ GNULIB_MBSCSPN = @GNULIB_MBSCSPN@ +GNULIB_MBSINIT = @GNULIB_MBSINIT@ GNULIB_MBSLEN = @GNULIB_MBSLEN@ GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@ +GNULIB_MBSNLEN = @GNULIB_MBSNLEN@ +GNULIB_MBSNRTOWCS = @GNULIB_MBSNRTOWCS@ GNULIB_MBSPBRK = @GNULIB_MBSPBRK@ GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@ GNULIB_MBSRCHR = @GNULIB_MBSRCHR@ +GNULIB_MBSRTOWCS = @GNULIB_MBSRTOWCS@ GNULIB_MBSSEP = @GNULIB_MBSSEP@ GNULIB_MBSSPN = @GNULIB_MBSSPN@ GNULIB_MBSSTR = @GNULIB_MBSSTR@ @@ -297,82 +421,230 @@ GNULIB_MEMPCPY = @GNULIB_MEMPCPY@ GNULIB_MEMRCHR = @GNULIB_MEMRCHR@ GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ GNULIB_MKSTEMP = @GNULIB_MKSTEMP@ +GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@ +GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@ +GNULIB_OPEN = @GNULIB_OPEN@ +GNULIB_PERROR = @GNULIB_PERROR@ +GNULIB_PRINTF = @GNULIB_PRINTF@ GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@ +GNULIB_PUTC = @GNULIB_PUTC@ +GNULIB_PUTCHAR = @GNULIB_PUTCHAR@ +GNULIB_PUTENV = @GNULIB_PUTENV@ +GNULIB_PUTS = @GNULIB_PUTS@ +GNULIB_RANDOM_R = @GNULIB_RANDOM_R@ +GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@ GNULIB_READLINK = @GNULIB_READLINK@ +GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@ +GNULIB_RECV = @GNULIB_RECV@ +GNULIB_RECVFROM = @GNULIB_RECVFROM@ +GNULIB_ROUND = @GNULIB_ROUND@ +GNULIB_ROUNDF = @GNULIB_ROUNDF@ +GNULIB_ROUNDL = @GNULIB_ROUNDL@ +GNULIB_RPMATCH = @GNULIB_RPMATCH@ +GNULIB_SCANDIR = @GNULIB_SCANDIR@ +GNULIB_SELECT = @GNULIB_SELECT@ +GNULIB_SEND = @GNULIB_SEND@ +GNULIB_SENDTO = @GNULIB_SENDTO@ +GNULIB_SETENV = @GNULIB_SETENV@ +GNULIB_SETSOCKOPT = @GNULIB_SETSOCKOPT@ +GNULIB_SHUTDOWN = @GNULIB_SHUTDOWN@ +GNULIB_SIGACTION = @GNULIB_SIGACTION@ +GNULIB_SIGNAL_H_SIGPIPE = @GNULIB_SIGNAL_H_SIGPIPE@ +GNULIB_SIGNBIT = @GNULIB_SIGNBIT@ +GNULIB_SIGPROCMASK = @GNULIB_SIGPROCMASK@ +GNULIB_SLEEP = @GNULIB_SLEEP@ GNULIB_SNPRINTF = @GNULIB_SNPRINTF@ +GNULIB_SOCKET = @GNULIB_SOCKET@ GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@ +GNULIB_STDIO_H_SIGPIPE = @GNULIB_STDIO_H_SIGPIPE@ GNULIB_STPCPY = @GNULIB_STPCPY@ GNULIB_STPNCPY = @GNULIB_STPNCPY@ GNULIB_STRCASESTR = @GNULIB_STRCASESTR@ GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@ GNULIB_STRDUP = @GNULIB_STRDUP@ +GNULIB_STRERROR = @GNULIB_STRERROR@ GNULIB_STRNDUP = @GNULIB_STRNDUP@ GNULIB_STRNLEN = @GNULIB_STRNLEN@ GNULIB_STRPBRK = @GNULIB_STRPBRK@ GNULIB_STRSEP = @GNULIB_STRSEP@ +GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@ +GNULIB_STRSTR = @GNULIB_STRSTR@ +GNULIB_STRTOD = @GNULIB_STRTOD@ GNULIB_STRTOIMAX = @GNULIB_STRTOIMAX@ GNULIB_STRTOK_R = @GNULIB_STRTOK_R@ +GNULIB_STRTOLL = @GNULIB_STRTOLL@ +GNULIB_STRTOULL = @GNULIB_STRTOULL@ GNULIB_STRTOUMAX = @GNULIB_STRTOUMAX@ +GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@ +GNULIB_TRUNC = @GNULIB_TRUNC@ +GNULIB_TRUNCF = @GNULIB_TRUNCF@ +GNULIB_TRUNCL = @GNULIB_TRUNCL@ +GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@ +GNULIB_UNSETENV = @GNULIB_UNSETENV@ +GNULIB_VASPRINTF = @GNULIB_VASPRINTF@ +GNULIB_VDPRINTF = @GNULIB_VDPRINTF@ +GNULIB_VFPRINTF = @GNULIB_VFPRINTF@ GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@ +GNULIB_VPRINTF = @GNULIB_VPRINTF@ GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@ GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@ GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@ -GNU_PACKAGE = @GNU_PACKAGE@ +GNULIB_WCRTOMB = @GNULIB_WCRTOMB@ +GNULIB_WCSNRTOMBS = @GNULIB_WCSNRTOMBS@ +GNULIB_WCSRTOMBS = @GNULIB_WCSRTOMBS@ +GNULIB_WCTOB = @GNULIB_WCTOB@ +GNULIB_WCWIDTH = @GNULIB_WCWIDTH@ +GNULIB_WRITE = @GNULIB_WRITE@ GREP = @GREP@ +HAVE_ALPHASORT = @HAVE_ALPHASORT@ +HAVE_ARPA_INET_H = @HAVE_ARPA_INET_H@ +HAVE_ATOLL = @HAVE_ATOLL@ +HAVE_BTOWC = @HAVE_BTOWC@ +HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@ +HAVE_DECL_ACOSL = @HAVE_DECL_ACOSL@ +HAVE_DECL_ASINL = @HAVE_DECL_ASINL@ +HAVE_DECL_ATANL = @HAVE_DECL_ATANL@ +HAVE_DECL_COSL = @HAVE_DECL_COSL@ +HAVE_DECL_DIRFD = @HAVE_DECL_DIRFD@ +HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@ +HAVE_DECL_EXPL = @HAVE_DECL_EXPL@ +HAVE_DECL_FREEADDRINFO = @HAVE_DECL_FREEADDRINFO@ +HAVE_DECL_FREXPL = @HAVE_DECL_FREXPL@ +HAVE_DECL_GAI_STRERROR = @HAVE_DECL_GAI_STRERROR@ +HAVE_DECL_GETADDRINFO = @HAVE_DECL_GETADDRINFO@ +HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@ +HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@ +HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@ HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ +HAVE_DECL_GETNAMEINFO = @HAVE_DECL_GETNAMEINFO@ HAVE_DECL_IMAXABS = @HAVE_DECL_IMAXABS@ HAVE_DECL_IMAXDIV = @HAVE_DECL_IMAXDIV@ +HAVE_DECL_INET_NTOP = @HAVE_DECL_INET_NTOP@ +HAVE_DECL_INET_PTON = @HAVE_DECL_INET_PTON@ +HAVE_DECL_LDEXPL = @HAVE_DECL_LDEXPL@ +HAVE_DECL_LOGL = @HAVE_DECL_LOGL@ HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@ HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@ +HAVE_DECL_OBSTACK_PRINTF = @HAVE_DECL_OBSTACK_PRINTF@ +HAVE_DECL_SINL = @HAVE_DECL_SINL@ HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@ +HAVE_DECL_SQRTL = @HAVE_DECL_SQRTL@ HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@ -HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@ +HAVE_DECL_STRERROR = @HAVE_DECL_STRERROR@ HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@ HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@ +HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@ HAVE_DECL_STRTOIMAX = @HAVE_DECL_STRTOIMAX@ HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@ HAVE_DECL_STRTOUMAX = @HAVE_DECL_STRTOUMAX@ +HAVE_DECL_TANL = @HAVE_DECL_TANL@ +HAVE_DECL_TRUNC = @HAVE_DECL_TRUNC@ +HAVE_DECL_TRUNCF = @HAVE_DECL_TRUNCF@ HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@ +HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@ +HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@ +HAVE_DPRINTF = @HAVE_DPRINTF@ HAVE_DUP2 = @HAVE_DUP2@ +HAVE_EUIDACCESS = @HAVE_EUIDACCESS@ +HAVE_FSEEKO = @HAVE_FSEEKO@ +HAVE_FSYNC = @HAVE_FSYNC@ +HAVE_FTELLO = @HAVE_FTELLO@ HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ +HAVE_GETDOMAINNAME = @HAVE_GETDOMAINNAME@ +HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@ +HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@ +HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@ HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ +HAVE_GETUSERSHELL = @HAVE_GETUSERSHELL@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ +HAVE_ISNAND = @HAVE_ISNAND@ +HAVE_ISNANF = @HAVE_ISNANF@ +HAVE_ISNANL = @HAVE_ISNANL@ +HAVE_ISWCNTRL = @HAVE_ISWCNTRL@ +HAVE_LCHMOD = @HAVE_LCHMOD@ +HAVE_LINK = @HAVE_LINK@ HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ +HAVE_LSTAT = @HAVE_LSTAT@ +HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@ +HAVE_MBRLEN = @HAVE_MBRLEN@ +HAVE_MBRTOWC = @HAVE_MBRTOWC@ +HAVE_MBSINIT = @HAVE_MBSINIT@ +HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@ +HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@ HAVE_MEMPCPY = @HAVE_MEMPCPY@ HAVE_MKDTEMP = @HAVE_MKDTEMP@ +HAVE_NETDB_H = @HAVE_NETDB_H@ HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@ +HAVE_OS_H = @HAVE_OS_H@ +HAVE_POSIX_SIGNALBLOCKING = @HAVE_POSIX_SIGNALBLOCKING@ +HAVE_RANDOM_H = @HAVE_RANDOM_H@ +HAVE_RANDOM_R = @HAVE_RANDOM_R@ +HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@ HAVE_READLINK = @HAVE_READLINK@ +HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@ +HAVE_RPMATCH = @HAVE_RPMATCH@ +HAVE_SCANDIR = @HAVE_SCANDIR@ +HAVE_SETENV = @HAVE_SETENV@ +HAVE_SIGACTION = @HAVE_SIGACTION@ +HAVE_SIGINFO_T = @HAVE_SIGINFO_T@ HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@ HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@ HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@ +HAVE_SIGSET_T = @HAVE_SIGSET_T@ +HAVE_SLEEP = @HAVE_SLEEP@ HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE_STPCPY = @HAVE_STPCPY@ HAVE_STPNCPY = @HAVE_STPNCPY@ -HAVE_STRCASECMP = @HAVE_STRCASECMP@ HAVE_STRCASESTR = @HAVE_STRCASESTR@ HAVE_STRCHRNUL = @HAVE_STRCHRNUL@ HAVE_STRNDUP = @HAVE_STRNDUP@ HAVE_STRPBRK = @HAVE_STRPBRK@ HAVE_STRSEP = @HAVE_STRSEP@ +HAVE_STRTOD = @HAVE_STRTOD@ +HAVE_STRTOLL = @HAVE_STRTOLL@ +HAVE_STRTOULL = @HAVE_STRTOULL@ +HAVE_STRUCT_ADDRINFO = @HAVE_STRUCT_ADDRINFO@ +HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@ +HAVE_STRUCT_SIGACTION_SA_SIGACTION = @HAVE_STRUCT_SIGACTION_SA_SIGACTION@ HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@ +HAVE_STRVERSCMP = @HAVE_STRVERSCMP@ HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@ +HAVE_SYS_IOCTL_H = @HAVE_SYS_IOCTL_H@ +HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@ +HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@ +HAVE_SYS_SELECT_H = @HAVE_SYS_SELECT_H@ HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@ HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ +HAVE_TYPE_VOLATILE_SIG_ATOMIC_T = @HAVE_TYPE_VOLATILE_SIG_ATOMIC_T@ HAVE_UNISTD_H = @HAVE_UNISTD_H@ +HAVE_UNSETENV = @HAVE_UNSETENV@ HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ +HAVE_VASPRINTF = @HAVE_VASPRINTF@ +HAVE_VDPRINTF = @HAVE_VDPRINTF@ +HAVE_WCHAR_H = @HAVE_WCHAR_H@ +HAVE_WCRTOMB = @HAVE_WCRTOMB@ +HAVE_WCSNRTOMBS = @HAVE_WCSNRTOMBS@ +HAVE_WCSRTOMBS = @HAVE_WCSRTOMBS@ HAVE_WCTYPE_H = @HAVE_WCTYPE_H@ HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@ HAVE_WINT_T = @HAVE_WINT_T@ HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@ HAVE__BOOL = @HAVE__BOOL@ HELP2MAN = @HELP2MAN@ +HOSTENT_LIB = @HOSTENT_LIB@ +ICONV_H = @ICONV_H@ +INCLUDE_NEXT = @INCLUDE_NEXT@ +INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTALL_SU = @INSTALL_SU@ +INT32_MAX_LT_INTMAX_MAX = @INT32_MAX_LT_INTMAX_MAX@ +INT64_MAX_EQ_LONG_MAX = @INT64_MAX_EQ_LONG_MAX@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ INTTYPES_H = @INTTYPES_H@ @@ -384,15 +656,26 @@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ +LIBSOCKET = @LIBSOCKET@ +LIBTESTS_LIBDEPS = @LIBTESTS_LIBDEPS@ LIB_ACL = @LIB_ACL@ -LIB_ACL_TRIVIAL = @LIB_ACL_TRIVIAL@ +LIB_CAP = @LIB_CAP@ LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@ LIB_CRYPT = @LIB_CRYPT@ LIB_EACCESS = @LIB_EACCESS@ LIB_FDATASYNC = @LIB_FDATASYNC@ LIB_GETHRXTIME = @LIB_GETHRXTIME@ +LIB_GMP = @LIB_GMP@ LIB_NANOSLEEP = @LIB_NANOSLEEP@ +LIB_SELINUX = @LIB_SELINUX@ +LIB_XATTR = @LIB_XATTR@ LN_S = @LN_S@ +LOCALCHARSET_TESTS_ENVIRONMENT = @LOCALCHARSET_TESTS_ENVIRONMENT@ +LOCALE_FR = @LOCALE_FR@ +LOCALE_FR_UTF8 = @LOCALE_FR_UTF8@ +LOCALE_JA = @LOCALE_JA@ +LOCALE_TR_UTF8 = @LOCALE_TR_UTF8@ +LOCALE_ZH_CN = @LOCALE_ZH_CN@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ @@ -403,7 +686,34 @@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ NEED_SETGID = @NEED_SETGID@ +NETDB_H = @NETDB_H@ NETINET_IN_H = @NETINET_IN_H@ +NEXT_ARPA_INET_H = @NEXT_ARPA_INET_H@ +NEXT_DIRENT_H = @NEXT_DIRENT_H@ +NEXT_ERRNO_H = @NEXT_ERRNO_H@ +NEXT_FCNTL_H = @NEXT_FCNTL_H@ +NEXT_FLOAT_H = @NEXT_FLOAT_H@ +NEXT_ICONV_H = @NEXT_ICONV_H@ +NEXT_INTTYPES_H = @NEXT_INTTYPES_H@ +NEXT_MATH_H = @NEXT_MATH_H@ +NEXT_NETDB_H = @NEXT_NETDB_H@ +NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@ +NEXT_SIGNAL_H = @NEXT_SIGNAL_H@ +NEXT_STDARG_H = @NEXT_STDARG_H@ +NEXT_STDINT_H = @NEXT_STDINT_H@ +NEXT_STDIO_H = @NEXT_STDIO_H@ +NEXT_STDLIB_H = @NEXT_STDLIB_H@ +NEXT_STRING_H = @NEXT_STRING_H@ +NEXT_SYS_IOCTL_H = @NEXT_SYS_IOCTL_H@ +NEXT_SYS_SELECT_H = @NEXT_SYS_SELECT_H@ +NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_H@ +NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@ +NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@ +NEXT_TIME_H = @NEXT_TIME_H@ +NEXT_UNISTD_H = @NEXT_UNISTD_H@ +NEXT_WCHAR_H = @NEXT_WCHAR_H@ +NEXT_WCTYPE_H = @NEXT_WCTYPE_H@ +NO_INSTALL_PROGS_DEFAULT = @NO_INSTALL_PROGS_DEFAULT@ OBJEXT = @OBJEXT@ OPTIONAL_BIN_PROGS = @OPTIONAL_BIN_PROGS@ PACKAGE = @PACKAGE@ @@ -411,56 +721,142 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ +POSIX_SHELL = @POSIX_SHELL@ POSUB = @POSUB@ POW_LIB = @POW_LIB@ +PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@ +PREFERABLY_POSIX_SHELL = @PREFERABLY_POSIX_SHELL@ PRIPTR_PREFIX = @PRIPTR_PREFIX@ PRI_MACROS_BROKEN = @PRI_MACROS_BROKEN@ PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ RANLIB = @RANLIB@ +REPLACE_BTOWC = @REPLACE_BTOWC@ +REPLACE_CEILF = @REPLACE_CEILF@ +REPLACE_CEILL = @REPLACE_CEILL@ REPLACE_CHOWN = @REPLACE_CHOWN@ +REPLACE_CLOSE = @REPLACE_CLOSE@ +REPLACE_DPRINTF = @REPLACE_DPRINTF@ REPLACE_FCHDIR = @REPLACE_FCHDIR@ +REPLACE_FCLOSE = @REPLACE_FCLOSE@ +REPLACE_FFLUSH = @REPLACE_FFLUSH@ +REPLACE_FLOORF = @REPLACE_FLOORF@ +REPLACE_FLOORL = @REPLACE_FLOORL@ +REPLACE_FOPEN = @REPLACE_FOPEN@ REPLACE_FPRINTF = @REPLACE_FPRINTF@ +REPLACE_FREOPEN = @REPLACE_FREOPEN@ +REPLACE_FREXP = @REPLACE_FREXP@ +REPLACE_FREXPL = @REPLACE_FREXPL@ +REPLACE_FSEEK = @REPLACE_FSEEK@ +REPLACE_FSEEKO = @REPLACE_FSEEKO@ +REPLACE_FTELL = @REPLACE_FTELL@ +REPLACE_FTELLO = @REPLACE_FTELLO@ REPLACE_GETCWD = @REPLACE_GETCWD@ +REPLACE_GETLINE = @REPLACE_GETLINE@ +REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@ REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@ +REPLACE_HUGE_VAL = @REPLACE_HUGE_VAL@ +REPLACE_ICONV = @REPLACE_ICONV@ +REPLACE_ICONV_OPEN = @REPLACE_ICONV_OPEN@ +REPLACE_ICONV_UTF = @REPLACE_ICONV_UTF@ +REPLACE_ISFINITE = @REPLACE_ISFINITE@ +REPLACE_ISINF = @REPLACE_ISINF@ +REPLACE_ISNAN = @REPLACE_ISNAN@ +REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@ +REPLACE_LCHOWN = @REPLACE_LCHOWN@ +REPLACE_LDEXPL = @REPLACE_LDEXPL@ REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@ +REPLACE_LSEEK = @REPLACE_LSEEK@ +REPLACE_LSTAT = @REPLACE_LSTAT@ +REPLACE_MBRLEN = @REPLACE_MBRLEN@ +REPLACE_MBRTOWC = @REPLACE_MBRTOWC@ +REPLACE_MBSINIT = @REPLACE_MBSINIT@ +REPLACE_MBSNRTOWCS = @REPLACE_MBSNRTOWCS@ +REPLACE_MBSRTOWCS = @REPLACE_MBSRTOWCS@ +REPLACE_MBSTATE_T = @REPLACE_MBSTATE_T@ +REPLACE_MEMMEM = @REPLACE_MEMMEM@ +REPLACE_MKDIR = @REPLACE_MKDIR@ REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ +REPLACE_NAN = @REPLACE_NAN@ REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@ +REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@ +REPLACE_OPEN = @REPLACE_OPEN@ +REPLACE_PERROR = @REPLACE_PERROR@ REPLACE_PRINTF = @REPLACE_PRINTF@ +REPLACE_PUTENV = @REPLACE_PUTENV@ +REPLACE_ROUND = @REPLACE_ROUND@ +REPLACE_ROUNDF = @REPLACE_ROUNDF@ +REPLACE_ROUNDL = @REPLACE_ROUNDL@ +REPLACE_SELECT = @REPLACE_SELECT@ +REPLACE_SIGNBIT = @REPLACE_SIGNBIT@ +REPLACE_SIGNBIT_USING_GCC = @REPLACE_SIGNBIT_USING_GCC@ REPLACE_SNPRINTF = @REPLACE_SNPRINTF@ REPLACE_SPRINTF = @REPLACE_SPRINTF@ +REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@ +REPLACE_STRCASESTR = @REPLACE_STRCASESTR@ +REPLACE_STRDUP = @REPLACE_STRDUP@ +REPLACE_STRERROR = @REPLACE_STRERROR@ REPLACE_STRPTIME = @REPLACE_STRPTIME@ +REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@ +REPLACE_STRSTR = @REPLACE_STRSTR@ +REPLACE_STRTOD = @REPLACE_STRTOD@ REPLACE_TIMEGM = @REPLACE_TIMEGM@ +REPLACE_TRUNCL = @REPLACE_TRUNCL@ +REPLACE_VASPRINTF = @REPLACE_VASPRINTF@ +REPLACE_VDPRINTF = @REPLACE_VDPRINTF@ REPLACE_VFPRINTF = @REPLACE_VFPRINTF@ REPLACE_VPRINTF = @REPLACE_VPRINTF@ REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@ REPLACE_VSPRINTF = @REPLACE_VSPRINTF@ +REPLACE_WCRTOMB = @REPLACE_WCRTOMB@ +REPLACE_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@ +REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@ +REPLACE_WCTOB = @REPLACE_WCTOB@ +REPLACE_WCWIDTH = @REPLACE_WCWIDTH@ +REPLACE_WRITE = @REPLACE_WRITE@ +SELINUX_CONTEXT_H = @SELINUX_CONTEXT_H@ +SELINUX_SELINUX_H = @SELINUX_SELINUX_H@ SEQ_LIBM = @SEQ_LIBM@ +SERVENT_LIB = @SERVENT_LIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@ SIZE_T_SUFFIX = @SIZE_T_SUFFIX@ +STDARG_H = @STDARG_H@ STDBOOL_H = @STDBOOL_H@ STDINT_H = @STDINT_H@ STRIP = @STRIP@ +SYS_IOCTL_H = @SYS_IOCTL_H@ +SYS_IOCTL_H_HAVE_WINSOCK2_H = @SYS_IOCTL_H_HAVE_WINSOCK2_H@ +SYS_SELECT_H = @SYS_SELECT_H@ SYS_SOCKET_H = @SYS_SOCKET_H@ SYS_STAT_H = @SYS_STAT_H@ SYS_TIME_H = @SYS_TIME_H@ SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@ TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@ U = @U@ +UINT32_MAX_LT_UINTMAX_MAX = @UINT32_MAX_LT_UINTMAX_MAX@ +UINT64_MAX_EQ_ULONG_MAX = @UINT64_MAX_EQ_ULONG_MAX@ +UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@ +USE_ACL = @USE_ACL@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ +VOID_UNSETENV = @VOID_UNSETENV@ +WARN_CFLAGS = @WARN_CFLAGS@ WCHAR_H = @WCHAR_H@ WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ WCTYPE_H = @WCTYPE_H@ +WERROR_CFLAGS = @WERROR_CFLAGS@ WINT_T_SUFFIX = @WINT_T_SUFFIX@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ +XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ YACC = @YACC@ YFLAGS = @YFLAGS@ +abs_aux_dir = @abs_aux_dir@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ @@ -485,6 +881,8 @@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gl_LIBOBJS = @gl_LIBOBJS@ gl_LTLIBOBJS = @gl_LTLIBOBJS@ +gltests_LIBOBJS = @gltests_LIBOBJS@ +gltests_LTLIBOBJS = @gltests_LTLIBOBJS@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ @@ -510,6 +908,7 @@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ info_TEXINFOS = coreutils.texi @@ -529,6 +928,31 @@ MAINTAINERCLEANFILES = constants.texi # Extended regular expressions to match word starts and ends. _W = (^|[^A-Za-z0-9_]) W_ = ([^A-Za-z0-9_]|$$) +syntax_checks = \ + sc-avoid-io \ + sc-avoid-non-zero \ + sc-avoid-timezone \ + sc-avoid-zeroes \ + sc-exponent-grouping \ + sc-lower-case-var \ + sc-use-small-caps-NUL + + +# ME = $(subdir)/$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)) +ME = doc/Makefile + +# The quantity inside @var{...} should not contain upper case letters. +# The leading backslash exemption is to permit in-macro uses like +# @var{\varName\} where the upper case letter is part of a parameter name. +find_upper_case_var = \ + '/\@var{/ or next; \ + while (/\@var{(.+?)}/g) \ + { \ + $$v = $$1; \ + $$v =~ /[A-Z]/ && $$v !~ /^\\/ and (print "$$ARGV:$$.:$$_"), $$m = 1 \ + } \ + END {$$m and (warn "$(ME): do not use upper case in \@var{...}\n"), exit 1}' + all: all-am .SUFFIXES: @@ -537,14 +961,14 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu doc/Makefile + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu doc/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ @@ -562,10 +986,11 @@ $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): .texi.info: restore=: && backupdir="$(am__leading_dot)am$$$$" && \ - am__cwd=`pwd` && cd $(srcdir) && \ + am__cwd=`pwd` && $(am__cd) $(srcdir) && \ rm -rf $$backupdir && mkdir $$backupdir && \ if ($(MAKEINFO) --version) >/dev/null 2>&1; then \ for f in $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9]; do \ @@ -577,10 +1002,10 @@ $(ACLOCAL_M4): $(am__aclocal_m4_deps) -o $@ $<; \ then \ rc=0; \ - cd $(srcdir); \ + $(am__cd) $(srcdir); \ else \ rc=$$?; \ - cd $(srcdir) && \ + $(am__cd) $(srcdir) && \ $$restore $$backupdir/* `echo "./$@" | sed 's|[^/]*$$||'`; \ fi; \ rm -rf $$backupdir; exit $$rc @@ -637,16 +1062,18 @@ maintainer-clean-vti: uninstall-dvi-am: @$(NORMAL_UNINSTALL) - @list='$(DVIS)'; for p in $$list; do \ - f=$(am__strip_dir) \ + @list='$(DVIS)'; test -n "$(dvidir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(dvidir)/$$f'"; \ rm -f "$(DESTDIR)$(dvidir)/$$f"; \ done uninstall-html-am: @$(NORMAL_UNINSTALL) - @list='$(HTMLS)'; for p in $$list; do \ - f=$(am__strip_dir) \ + @list='$(HTMLS)'; test -n "$(htmldir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ echo " rm -rf '$(DESTDIR)$(htmldir)/$$f'"; \ rm -rf "$(DESTDIR)$(htmldir)/$$f"; \ done @@ -660,7 +1087,8 @@ uninstall-info-am: for file in $$list; do \ relfile=`echo "$$file" | sed 's|^.*/||'`; \ echo " install-info --info-dir='$(DESTDIR)$(infodir)' --remove '$(DESTDIR)$(infodir)/$$relfile'"; \ - install-info --info-dir="$(DESTDIR)$(infodir)" --remove "$(DESTDIR)$(infodir)/$$relfile"; \ + if install-info --info-dir="$(DESTDIR)$(infodir)" --remove "$(DESTDIR)$(infodir)/$$relfile"; \ + then :; else test ! -f "$(DESTDIR)$(infodir)/$$relfile" || exit 1; fi; \ done; \ else :; fi @$(NORMAL_UNINSTALL) @@ -676,16 +1104,18 @@ uninstall-info-am: uninstall-pdf-am: @$(NORMAL_UNINSTALL) - @list='$(PDFS)'; for p in $$list; do \ - f=$(am__strip_dir) \ + @list='$(PDFS)'; test -n "$(pdfdir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(pdfdir)/$$f'"; \ rm -f "$(DESTDIR)$(pdfdir)/$$f"; \ done uninstall-ps-am: @$(NORMAL_UNINSTALL) - @list='$(PSS)'; for p in $$list; do \ - f=$(am__strip_dir) \ + @list='$(PSS)'; test -n "$(psdir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(psdir)/$$f'"; \ rm -f "$(DESTDIR)$(psdir)/$$f"; \ done @@ -702,8 +1132,8 @@ dist-info: $(INFO_DEPS) for file in $$d/$$base $$d/$$base-[0-9] $$d/$$base-[0-9][0-9] $$d/$$base_i[0-9] $$d/$$base_i[0-9][0-9]; do \ if test -f $$file; then \ relfile=`expr "$$file" : "$$d/\(.*\)"`; \ - test -f $(distdir)/$$relfile || \ - cp -p $$file $(distdir)/$$relfile; \ + test -f "$(distdir)/$$relfile" || \ + cp -p $$file "$(distdir)/$$relfile"; \ else :; fi; \ done; \ done @@ -712,8 +1142,11 @@ mostlyclean-aminfo: -rm -rf coreutils.aux coreutils.cp coreutils.cps coreutils.fl coreutils.fn \ coreutils.ky coreutils.log coreutils.op coreutils.pg \ coreutils.tmp coreutils.toc coreutils.tp coreutils.tps \ - coreutils.vr coreutils.dvi coreutils.pdf coreutils.ps \ - coreutils.html + coreutils.vr + +clean-aminfo: + -test -z "coreutils.dvi coreutils.pdf coreutils.ps coreutils.html" \ + || rm -rf coreutils.dvi coreutils.pdf coreutils.ps coreutils.html maintainer-clean-aminfo: @list='$(INFO_DEPS)'; for i in $$list; do \ @@ -744,13 +1177,17 @@ distdir: $(DISTFILES) if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @@ -784,6 +1221,7 @@ clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @@ -791,7 +1229,7 @@ maintainer-clean-generic: -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am -clean-am: clean-generic mostlyclean-am +clean-am: clean-aminfo clean-generic mostlyclean-am distclean: distclean-am -rm -f Makefile @@ -816,11 +1254,14 @@ install-dvi: install-dvi-am install-dvi-am: $(DVIS) @$(NORMAL_INSTALL) test -z "$(dvidir)" || $(MKDIR_P) "$(DESTDIR)$(dvidir)" - @list='$(DVIS)'; for p in $$list; do \ + @list='$(DVIS)'; test -n "$(dvidir)" || list=; \ + for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - f=$(am__strip_dir) \ - echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(dvidir)/$$f'"; \ - $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(dvidir)/$$f"; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(dvidir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(dvidir)" || exit $$?; \ done install-exec-am: @@ -829,26 +1270,31 @@ install-html: install-html-am install-html-am: $(HTMLS) @$(NORMAL_INSTALL) test -z "$(htmldir)" || $(MKDIR_P) "$(DESTDIR)$(htmldir)" - @list='$(HTMLS)'; for p in $$list; do \ + @list='$(HTMLS)'; list2=; test -n "$(htmldir)" || list=; \ + for p in $$list; do \ if test -f "$$p" || test -d "$$p"; then d=; else d="$(srcdir)/"; fi; \ - f=$(am__strip_dir) \ + $(am__strip_dir) \ if test -d "$$d$$p"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(htmldir)/$$f'"; \ $(MKDIR_P) "$(DESTDIR)$(htmldir)/$$f" || exit 1; \ echo " $(INSTALL_DATA) '$$d$$p'/* '$(DESTDIR)$(htmldir)/$$f'"; \ - $(INSTALL_DATA) "$$d$$p"/* "$(DESTDIR)$(htmldir)/$$f"; \ + $(INSTALL_DATA) "$$d$$p"/* "$(DESTDIR)$(htmldir)/$$f" || exit $$?; \ else \ - echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(htmldir)/$$f'"; \ - $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(htmldir)/$$f"; \ + list2="$$list2 $$d$$p"; \ fi; \ - done + done; \ + test -z "$$list2" || { echo "$$list2" | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(htmldir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(htmldir)" || exit $$?; \ + done; } install-info: install-info-am install-info-am: $(INFO_DEPS) @$(NORMAL_INSTALL) test -z "$(infodir)" || $(MKDIR_P) "$(DESTDIR)$(infodir)" @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - list='$(INFO_DEPS)'; \ + list='$(INFO_DEPS)'; test -n "$(infodir)" || list=; \ for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ @@ -856,18 +1302,19 @@ install-info-am: $(INFO_DEPS) if test -f $$file; then d=.; else d=$(srcdir); fi; \ file_i=`echo "$$file" | sed 's|\.info$$||;s|$$|.i|'`; \ for ifile in $$d/$$file $$d/$$file-[0-9] $$d/$$file-[0-9][0-9] \ - $$d/$$file_i[0-9] $$d/$$file_i[0-9][0-9] ; do \ + $$d/$$file_i[0-9] $$d/$$file_i[0-9][0-9] ; do \ if test -f $$ifile; then \ - relfile=`echo "$$ifile" | sed 's|^.*/||'`; \ - echo " $(INSTALL_DATA) '$$ifile' '$(DESTDIR)$(infodir)/$$relfile'"; \ - $(INSTALL_DATA) "$$ifile" "$(DESTDIR)$(infodir)/$$relfile"; \ + echo "$$ifile"; \ else : ; fi; \ done; \ - done + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(infodir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(infodir)" || exit $$?; done @$(POST_INSTALL) @if (install-info --version && \ install-info --version 2>&1 | sed 1q | grep -i -v debian) >/dev/null 2>&1; then \ - list='$(INFO_DEPS)'; \ + list='$(INFO_DEPS)'; test -n "$(infodir)" || list=; \ for file in $$list; do \ relfile=`echo "$$file" | sed 's|^.*/||'`; \ echo " install-info --info-dir='$(DESTDIR)$(infodir)' '$(DESTDIR)$(infodir)/$$relfile'";\ @@ -881,23 +1328,27 @@ install-pdf: install-pdf-am install-pdf-am: $(PDFS) @$(NORMAL_INSTALL) test -z "$(pdfdir)" || $(MKDIR_P) "$(DESTDIR)$(pdfdir)" - @list='$(PDFS)'; for p in $$list; do \ + @list='$(PDFS)'; test -n "$(pdfdir)" || list=; \ + for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - f=$(am__strip_dir) \ - echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(pdfdir)/$$f'"; \ - $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(pdfdir)/$$f"; \ - done + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pdfdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(pdfdir)" || exit $$?; done install-ps: install-ps-am install-ps-am: $(PSS) @$(NORMAL_INSTALL) test -z "$(psdir)" || $(MKDIR_P) "$(DESTDIR)$(psdir)" - @list='$(PSS)'; for p in $$list; do \ + @list='$(PSS)'; test -n "$(psdir)" || list=; \ + for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - f=$(am__strip_dir) \ - echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(psdir)/$$f'"; \ - $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(psdir)/$$f"; \ - done + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(psdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(psdir)" || exit $$?; done installcheck-am: maintainer-clean: maintainer-clean-am @@ -922,55 +1373,82 @@ uninstall-am: uninstall-dvi-am uninstall-html-am uninstall-info-am \ .MAKE: install-am install-strip -.PHONY: all all-am check check-am clean clean-generic dist-info \ - distclean distclean-generic distdir dvi dvi-am html html-am \ - info info-am install install-am install-data install-data-am \ - install-dvi install-dvi-am install-exec install-exec-am \ - install-html install-html-am install-info install-info-am \ - install-man install-pdf install-pdf-am install-ps \ - install-ps-am install-strip installcheck installcheck-am \ - installdirs maintainer-clean maintainer-clean-aminfo \ - maintainer-clean-generic maintainer-clean-vti mostlyclean \ - mostlyclean-aminfo mostlyclean-generic mostlyclean-vti pdf \ - pdf-am ps ps-am uninstall uninstall-am uninstall-dvi-am \ - uninstall-html-am uninstall-info-am uninstall-pdf-am \ - uninstall-ps-am +.PHONY: all all-am check check-am clean clean-aminfo clean-generic \ + dist-info distclean distclean-generic distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-aminfo maintainer-clean-generic \ + maintainer-clean-vti mostlyclean mostlyclean-aminfo \ + mostlyclean-generic mostlyclean-vti pdf pdf-am ps ps-am \ + uninstall uninstall-am uninstall-dvi-am uninstall-html-am \ + uninstall-info-am uninstall-pdf-am uninstall-ps-am -constants.texi: $(top_srcdir)/src/tail.c +constants.texi: $(top_srcdir)/src/tail.c $(top_srcdir)/src/shred.c LC_ALL=C \ sed -n -e 's/^#define \(DEFAULT_MAX[_A-Z]*\) \(.*\)/@set \1 \2/p' \ $(top_srcdir)/src/tail.c > t-$@ + LC_ALL=C \ + sed -n -e 's/.*\(DEFAULT_PASSES\)[ =]* \([0-9]*\).*/@set SHRED_\1 \2/p'\ + $(top_srcdir)/src/shred.c >> t-$@ mv t-$@ $@ $(DVIS): $(EXTRA_DIST) $(INFO_DEPS): $(EXTRA_DIST) +.PHONY: $(syntax_checks) check-texinfo + # List words/regexps here that should not appear in the texinfo documentation. -# E.g., use @sc{nul}, not `NUL' -# Use `time zone', not `timezone'. -# Use `zeros', not `zeroes' (nothing wrong with `zeroes'. just be consistent). -check-texinfo: - fail=0; \ - grep timezone $(srcdir)/*.texi && fail=1; \ - $(EGREP) '$(_W)IO$(W_)' $(srcdir)/*.texi && fail=1; \ - grep non-zero $(srcdir)/*.texi && fail=1; \ - grep '@url{' $(srcdir)/*.texi && fail=1; \ - $(EGREP) '$(_W)NUL$(W_)' $(srcdir)/*.texi && fail=1; \ - grep '\$$@"' $(srcdir)/*.texi && fail=1; \ - grep -n '[^[:punct:]]@footnote' $(srcdir)/*.texi && fail=1; \ - grep -n filename $(srcdir)/*.texi|$(EGREP) -v 'setfilename|[{]filename[}]' \ - && fail=1; \ - $(PERL) -e 1 2> /dev/null && { $(PERL) -ne \ +check-texinfo: $(syntax_checks) + $(AM_V_GEN)fail=0; \ + grep '@url{' $(srcdir)/*.texi && fail=1; \ + grep '\$$@"' $(srcdir)/*.texi && fail=1; \ + grep -n '[^[:punct:]]@footnote' $(srcdir)/*.texi && fail=1; \ + grep -n filename $(srcdir)/*.texi \ + | $(EGREP) -v 'setfilename|[{]filename[}]' \ + && fail=1; \ + $(PERL) -e 1 2> /dev/null && { $(PERL) -ne \ '/\bPOSIX\b/ && !/\@acronym{POSIX}/ && !/^\* / || /{posix}/ and print,exit 1' \ - $(srcdir)/*.texi 2> /dev/null || fail=1; }; \ - $(EGREP) -i '$(_W)zeroes$(W_)' $(srcdir)/*.texi && fail=1; \ - $(EGREP) -i '$(_W)builtins?$(W_)' $(srcdir)/*.texi && fail=1; \ - $(EGREP) -i '$(_W)path(name)?s?$(W_)' $(srcdir)/*.texi \ - | $(EGREP) -v '@vindex PATH$$|@env[{]PATH[}]' && fail=1; \ + $(srcdir)/*.texi 2> /dev/null || fail=1; }; \ + $(EGREP) -i '$(_W)builtins?$(W_)' $(srcdir)/*.texi && fail=1; \ + $(EGREP) -i '$(_W)path(name)?s?$(W_)' $(srcdir)/*.texi \ + | $(EGREP) -v 'search path|@vindex PATH$$|@env[{]PATH[}]' && fail=1; \ exit $$fail +# Use `time zone', not `timezone'. +sc-avoid-timezone: + $(AM_V_GEN)$(EGREP) timezone $(srcdir)/*.texi && exit 1 || : + +# Check for insufficient exponent grouping, e.g., +# @math{2^64} should be @math{2^{64}}. +sc-exponent-grouping: + $(AM_V_GEN)$(EGREP) '\{.*\^[0-9][0-9]' $(srcdir)/*.texi && exit 1 || : + +# E.g., use @sc{nul}, not NUL. +sc-use-small-caps-NUL: + $(AM_V_GEN)$(EGREP) '$(_W)NUL$(W_)' $(srcdir)/*.texi && exit 1 || : + +# Say I/O, not IO. +sc-avoid-io: + $(AM_V_GEN)$(EGREP) '$(_W)IO$(W_)' $(srcdir)/*.texi && exit 1 || : + +# I prefer nonzero over non-zero. +sc-avoid-non-zero: + $(AM_V_GEN)$(EGREP) non-zero $(srcdir)/*.texi && exit 1 || : + +# Use `zeros', not `zeroes' (nothing wrong with `zeroes'. just be consistent). +sc-avoid-zeroes: + $(AM_V_GEN)$(EGREP) -i '$(_W)zeroes$(W_)' $(srcdir)/*.texi && exit 1 || : +sc-lower-case-var: + $(AM_V_GEN)$(PERL) -e 1 \ + && $(PERL) -lne $(find_upper_case_var) $(srcdir)/*.texi + check: check-texinfo + # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff --git a/src/bin/coreutils/doc/constants.texi b/src/bin/coreutils/doc/constants.texi index f6bffca852..afbc6a054e 100644 --- a/src/bin/coreutils/doc/constants.texi +++ b/src/bin/coreutils/doc/constants.texi @@ -1 +1,2 @@ @set DEFAULT_MAX_N_UNCHANGED_STATS_BETWEEN_OPENS 5 +@set SHRED_DEFAULT_PASSES 3 diff --git a/src/bin/coreutils/doc/coreutils.info b/src/bin/coreutils/doc/coreutils.info index 4589ca2c71..f6027104a0 100644 --- a/src/bin/coreutils/doc/coreutils.info +++ b/src/bin/coreutils/doc/coreutils.info @@ -1,4 +1,4 @@ -This is coreutils.info, produced by makeinfo version 4.8 from +This is coreutils.info, produced by makeinfo version 4.12 from coreutils.texi. INFO-DIR-SECTION Basics @@ -11,9 +11,11 @@ END-INFO-DIR-ENTRY INFO-DIR-SECTION Individual utilities START-INFO-DIR-ENTRY +* arch: (coreutils)arch invocation. Print machine hardware name. * base64: (coreutils)base64 invocation. Base64 encode/decode data. * basename: (coreutils)basename invocation. Strip directory and suffix. * cat: (coreutils)cat invocation. Concatenate and write files. +* chcon: (coreutils)chcon invocation. Change SELinux CTX of files. * chgrp: (coreutils)chgrp invocation. Change file groups. * chmod: (coreutils)chmod invocation. Change file permissions. * chown: (coreutils)chown invocation. Change file owners/groups. @@ -69,6 +71,7 @@ START-INFO-DIR-ENTRY * readlink: (coreutils)readlink invocation. Print referent of a symlink. * rm: (coreutils)rm invocation. Remove files. * rmdir: (coreutils)rmdir invocation. Remove empty directories. +* runcon: (coreutils)runcon invocation. Run in specified SELinux CTX. * seq: (coreutils)seq invocation. Print numeric sequences * sha1sum: (coreutils)sha1sum invocation. Print or check SHA-1 digests. * sha2: (coreutils)sha2 utilities. Print or check SHA-2 digests. @@ -86,15 +89,18 @@ START-INFO-DIR-ENTRY * tail: (coreutils)tail invocation. Output the last part of files. * tee: (coreutils)tee invocation. Redirect to multiple files. * test: (coreutils)test invocation. File/string tests. +* timeout: (coreutils)timeout invocation. Run with time limit. * touch: (coreutils)touch invocation. Change file timestamps. * tr: (coreutils)tr invocation. Translate characters. * true: (coreutils)true invocation. Do nothing, successfully. +* truncate: (coreutils)truncate invocation. Shrink/extend size of a file. * tsort: (coreutils)tsort invocation. Topological sort. * tty: (coreutils)tty invocation. Print terminal name. * uname: (coreutils)uname invocation. Print system information. * unexpand: (coreutils)unexpand invocation. Convert spaces to tabs. * uniq: (coreutils)uniq invocation. Uniquify files. * unlink: (coreutils)unlink invocation. Removal via unlink(2). +* uptime: (coreutils)uptime invocation. Print uptime and load. * users: (coreutils)users invocation. Print current user names. * vdir: (coreutils)vdir invocation. List directories verbosely. * wc: (coreutils)wc invocation. Line, word, and byte counts. @@ -103,15 +109,14 @@ START-INFO-DIR-ENTRY * yes: (coreutils)yes invocation. Print a string indefinitely. END-INFO-DIR-ENTRY - This manual documents version 6.9 of the GNU core utilities, + This manual documents version 7.4 of the GNU core utilities, including the standard programs for text and file manipulation. - Copyright (C) 1994, 1995, 1996, 2000, 2001, 2002, 2003, 2004, 2005, -2006 Free Software Foundation, Inc. + Copyright (C) 1994-1996, 2000-2009 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, - Version 1.2 or any later version published by the Free Software + Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License". @@ -122,15 +127,14 @@ File: coreutils.info, Node: Top, Next: Introduction, Up: (dir) GNU Coreutils ************* -This manual documents version 6.9 of the GNU core utilities, including +This manual documents version 7.4 of the GNU core utilities, including the standard programs for text and file manipulation. - Copyright (C) 1994, 1995, 1996, 2000, 2001, 2002, 2003, 2004, 2005, -2006 Free Software Foundation, Inc. + Copyright (C) 1994-1996, 2000-2009 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, - Version 1.2 or any later version published by the Free Software + Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License". @@ -150,23 +154,24 @@ the standard programs for text and file manipulation. * Basic operations:: cp dd install mv rm shred * Special file types:: ln mkdir rmdir mkfifo mknod * Changing file attributes:: chgrp chmod chown touch -* Disk usage:: df du stat sync +* Disk usage:: df du stat sync truncate * Printing text:: echo printf yes * Conditions:: false true test expr * Redirection:: tee * File name manipulation:: dirname basename pathchk * Working context:: pwd stty printenv tty * User information:: id logname whoami groups users who -* System context:: date uname hostname hostid -* Modified command invocation:: chroot env nice nohup su +* System context:: date uname hostname hostid uptime +* SELinux context:: chcon runcon +* Modified command invocation:: chroot env nice nohup su timeout * Process control:: kill * Delaying:: sleep * Numeric operations:: factor seq * File permissions:: Access modes. * Date input formats:: Specifying date strings. * Opening the software toolbox:: The software tools philosophy. -* Copying This Manual:: License for copying this manual. -* Index:: General index. +* GNU Free Documentation License:: Copying and sharing this manual. +* Concept index:: General index. --- The Detailed Node Listing --- @@ -175,6 +180,7 @@ Common Options * Exit status:: Indicating program success or failure. * Backup options:: Backup options * Block size:: Block size +* Signal specifications:: Specifying signals * Disambiguating names and IDs:: chgrp and chown owner and group syntax * Random sources:: Sources of random data * Target directory:: Target directory @@ -297,6 +303,7 @@ Disk usage * du invocation:: Estimate file space usage * stat invocation:: Report file or file system status * sync invocation:: Synchronize data on disk with memory +* truncate invocation:: Shrink or extend the size of a file Printing text @@ -328,13 +335,13 @@ Conditions Redirection -* tee invocation:: Redirect output to multiple files +* tee invocation:: Redirect output to multiple files or processes File name manipulation * basename invocation:: Strip directory and suffix from a file name * dirname invocation:: Strip non-directory suffix from a file name -* pathchk invocation:: Check file name portability +* pathchk invocation:: Check file name validity and portability Working context @@ -364,10 +371,12 @@ User information System context +* arch invocation:: Print machine hardware name * date invocation:: Print or set system date and time * uname invocation:: Print system information * hostname invocation:: Print or set system name -* hostid invocation:: Print numeric host identifier. +* hostid invocation:: Print numeric host identifier +* uptime invocation:: Print system uptime and load `date': Print or set system date and time @@ -377,8 +386,13 @@ System context * Padding and other flags:: Pad with zeros, spaces, etc. * Setting the time:: Changing the system clock. * Options for date:: Instead of the current time. +* Date input formats:: Specifying date strings. * Examples of date:: Examples. +SELinux context +* chcon invocation:: Change SELinux context of file +* runcon invocation:: Run a command in specified SELinux context + Modified command invocation * chroot invocation:: Run a command with a different root directory @@ -386,6 +400,7 @@ Modified command invocation * nice invocation:: Run a command with modified niceness * nohup invocation:: Run a command immune to hangups * su invocation:: Run a command with substitute user and group ID +* timeout invocation:: Run a command with a time limit Process control @@ -432,7 +447,7 @@ Opening the software toolbox Copying This Manual -* GNU Free Documentation License:: License for copying this manual. +* GNU Free Documentation License:: Copying and sharing this manual.  File: coreutils.info, Node: Introduction, Next: Common options, Prev: Top, Up: Top @@ -490,8 +505,16 @@ description. For example, the `env' command's options must appear before its operands, since in some cases the operands specify a command that itself contains options. + Most programs that accept long options recognize unambiguous +abbreviations of those options. For example, `rmdir +--ignore-fail-on-non-empty' can be invoked as `rmdir --ignore-fail' or +even `rmdir --i'. Ambiguous options, such as `ls --h', are identified +as such. + Some of these programs recognize the `--help' and `--version' -options only when one of them is the sole command line argument. +options only when one of them is the sole command line argument. For +these programs, abbreviations of the long options are not always +recognized. `--help' Print a usage message listing all available options, then exit @@ -518,6 +541,7 @@ can appear as any operand that requires a file name. * Exit status:: Indicating program success or failure. * Backup options:: -b -S, in some programs. * Block size:: BLOCK_SIZE and --block-size, in some programs. +* Signal specifications:: Specifying signals using the --signal option. * Disambiguating names and IDs:: chgrp and chown owner and group syntax * Random sources:: --random-source, in some programs. * Target directory:: Specifying a target directory, in some programs. @@ -542,7 +566,7 @@ unusual platforms as POSIX requires only that it be nonzero. However, some of the programs documented here do produce other exit status values and a few associate different meanings with the values `0' and `1'. Here are some of the exceptions: `chroot', `env', `expr', -`nice', `nohup', `printenv', `sort', `su', `test', `tty'. +`nice', `nohup', `printenv', `sort', `su', `test', `timeout', `tty'.  File: coreutils.info, Node: Backup options, Next: Block size, Prev: Exit status, Up: Common options @@ -601,7 +625,7 @@ mentioned in the descriptions of the particular programs.  -File: coreutils.info, Node: Block size, Next: Disambiguating names and IDs, Prev: Backup options, Up: Common options +File: coreutils.info, Node: Block size, Next: Signal specifications, Prev: Backup options, Up: Common options 2.3 Block size ============== @@ -746,9 +770,116 @@ equivalent to `--block-size=human-readable'. The `--si' option is equivalent to `--block-size=si'.  -File: coreutils.info, Node: Disambiguating names and IDs, Next: Random sources, Prev: Block size, Up: Common options +File: coreutils.info, Node: Signal specifications, Next: Disambiguating names and IDs, Prev: Block size, Up: Common options -2.4 chown and chgrp: Disambiguating user names and IDs +2.4 Signal specifications +========================= + +A SIGNAL may be a signal name like `HUP', or a signal number like `1', +or an exit status of a process terminated by the signal. A signal name +can be given in canonical form or prefixed by `SIG'. The case of the +letters is ignored. The following signal names and numbers are +supported on all POSIX compliant systems: + +`HUP' + 1. Hangup. + +`INT' + 2. Terminal interrupt. + +`QUIT' + 3. Terminal quit. + +`ABRT' + 6. Process abort. + +`KILL' + 9. Kill (cannot be caught or ignored). + +`ALRM' + 14. Alarm Clock. + +`TERM' + 15. Termination. + +Other supported signal names have system-dependent corresponding +numbers. All systems conforming to POSIX 1003.1-2001 also support the +following signals: + +`BUS' + Access to an undefined portion of a memory object. + +`CHLD' + Child process terminated, stopped, or continued. + +`CONT' + Continue executing, if stopped. + +`FPE' + Erroneous arithmetic operation. + +`ILL' + Illegal Instruction. + +`PIPE' + Write on a pipe with no one to read it. + +`SEGV' + Invalid memory reference. + +`STOP' + Stop executing (cannot be caught or ignored). + +`TSTP' + Terminal stop. + +`TTIN' + Background process attempting read. + +`TTOU' + Background process attempting write. + +`URG' + High bandwidth data is available at a socket. + +`USR1' + User-defined signal 1. + +`USR2' + User-defined signal 2. + +POSIX 1003.1-2001 systems that support the XSI extension also support +the following signals: + +`POLL' + Pollable event. + +`PROF' + Profiling timer expired. + +`SYS' + Bad system call. + +`TRAP' + Trace/breakpoint trap. + +`VTALRM' + Virtual timer expired. + +`XCPU' + CPU time limit exceeded. + +`XFSZ' + File size limit exceeded. + +POSIX 1003.1-2001 systems that support the XRT extension also support +at least eight real-time signals called `RTMIN', `RTMIN+1', ..., +`RTMAX-1', `RTMAX'. + + +File: coreutils.info, Node: Disambiguating names and IDs, Next: Random sources, Prev: Signal specifications, Up: Common options + +2.5 chown and chgrp: Disambiguating user names and IDs ====================================================== Since the OWNER and GROUP arguments to `chown' and `chgrp' may be @@ -784,43 +915,40 @@ systems, but not on Solaris 10.  File: coreutils.info, Node: Random sources, Next: Target directory, Prev: Disambiguating names and IDs, Up: Common options -2.5 Sources of random data +2.6 Sources of random data ========================== The `shuf', `shred', and `sort' commands sometimes need random data to do their work. For example, `sort -R' must choose a hash function at random, and it needs random data to make this selection. - Normally these commands use the device file `/dev/urandom' as the + By default these commands use an internal pseudorandom generator +initialized by a small amount of entropy, but can be directed to use an +external source with the `--random-source=FILE' option. An error is +reported if FILE does not contain enough bytes. + + For example, the device file `/dev/urandom' could be used as the source of random data. Typically, this device gathers environmental noise from device drivers and other sources into an entropy pool, and uses the pool to generate random bits. If the pool is short of data, the device reuses the internal pool to produce more bits, using a -cryptographically secure pseudorandom number generator. +cryptographically secure pseudorandom number generator. But be aware +that this device is not designed for bulk random data generation and is +relatively slow. `/dev/urandom' suffices for most practical uses, but applications requiring high-value or long-term protection of private data may require an alternate data source like `/dev/random' or `/dev/arandom'. The set of available sources depends on your operating system. - To use such a source, specify the `--random-source=FILE' option, -e.g., `shuf --random-source=/dev/random'. The contents of FILE should -be as random as possible. An error is reported if FILE does not -contain enough bytes to randomize the input adequately. - To reproduce the results of an earlier invocation of a command, you can save some random data into a file and then use that file as the random source in earlier and later invocations of the command. - Some old-fashioned or stripped-down operating systems lack support -for `/dev/urandom'. On these systems commands like `shuf' by default -fall back on an internal pseudorandom generator initialized by a small -amount of entropy. -  File: coreutils.info, Node: Target directory, Next: Trailing slashes, Prev: Random sources, Up: Common options -2.6 Target directory +2.7 Target directory ==================== The `cp', `install', `ln', and `mv' commands normally treat the last @@ -898,7 +1026,7 @@ options cannot be combined.  File: coreutils.info, Node: Trailing slashes, Next: Traversing symlinks, Prev: Target directory, Up: Common options -2.7 Trailing slashes +2.8 Trailing slashes ==================== Some GNU programs (at least `cp' and `mv') allow you to remove any @@ -919,7 +1047,7 @@ of that standard.  File: coreutils.info, Node: Traversing symlinks, Next: Treating / specially, Prev: Trailing slashes, Up: Common options -2.8 Traversing symlinks +2.9 Traversing symlinks ======================= The following options modify how `chown' and `chgrp' traverse a @@ -949,8 +1077,8 @@ its referent.  File: coreutils.info, Node: Treating / specially, Next: Special built-in utilities, Prev: Traversing symlinks, Up: Common options -2.9 Treating / specially -======================== +2.10 Treating `/' specially +=========================== Certain commands can operate destructively on entire hierarchies. For example, if a user with appropriate privileges mistakenly runs `rm -rf @@ -963,11 +1091,11 @@ the `--preserve-option', is safer for most purposes. The commands `chgrp', `chmod' and `chown' can also operate destructively on entire hierarchies, so they too support these options. -Although, unlike `rm', they don't actually unlink files, these -commands are arguably more dangerous when operating recursively on `/', -since they often work much more quickly, and hence damage more files -before an alert user can interrupt them. Tradition and POSIX require -these commands to operate recursively on `/', so they default to +Although, unlike `rm', they don't actually unlink files, these commands +are arguably more dangerous when operating recursively on `/', since +they often work much more quickly, and hence damage more files before +an alert user can interrupt them. Tradition and POSIX require these +commands to operate recursively on `/', so they default to `--no-preserve-root', but using the `--preserve-root' option makes them safer for most purposes. For convenience you can specify `--preserve-root' in an alias or in a shell function. @@ -979,7 +1107,7 @@ safer for most purposes. For convenience you can specify  File: coreutils.info, Node: Special built-in utilities, Next: Standards conformance, Prev: Treating / specially, Up: Common options -2.10 Special built-in utilities +2.11 Special built-in utilities =============================== Some programs like `nice' can invoke other programs; for example, the @@ -1007,7 +1135,7 @@ suspending.  File: coreutils.info, Node: Standards conformance, Prev: Special built-in utilities, Up: Common options -2.11 Standards conformance +2.12 Standards conformance ========================== In a few cases, the GNU utilities' default behavior is incompatible @@ -1062,7 +1190,7 @@ none are given, to standard output. Synopsis: cat [OPTION] [FILE]... - The program accepts the following options. Also see *Note Common + The program accepts the following options. Also see *note Common options::. `-A' @@ -1071,7 +1199,7 @@ options::. `-b' `--number-nonblank' - Number all nonblank output lines, starting with 1. + Number all nonempty output lines, starting with 1. `-e' Equivalent to `-vE'. @@ -1086,7 +1214,8 @@ options::. `-s' `--squeeze-blank' - Replace multiple adjacent blank lines with a single blank line. + Suppress repeated adjacent empty lines; output just one empty line + instead of several. `-t' Equivalent to `-vT'. @@ -1139,7 +1268,7 @@ default) in each separately. Synopsis: default). By default, this separator string is attached to the end of the record that it follows in the file. - The program accepts the following options. Also see *Note Common + The program accepts the following options. Also see *note Common options::. `-b' @@ -1204,7 +1333,7 @@ that comes before the first section delimiter string in the input file is considered to be part of a body section, so `nl' treats a file that contains no section delimiters as a single body section. - The program accepts the following options. Also see *Note Common + The program accepts the following options. Also see *note Common options::. `-b STYLE' @@ -1321,7 +1450,7 @@ is assumed if the last operand begins with `+' or (if there are two operands) a digit. For example, in `od foo 10' and `od +10' the `10' is an offset, whereas in `od 10' the `10' is a file name. - The program accepts the following options. Also see *Note Common + The program accepts the following options. Also see *note Common options::. `-A RADIX' @@ -1348,19 +1477,28 @@ options::. Skip BYTES input bytes before formatting and writing. If BYTES begins with `0x' or `0X', it is interpreted in hexadecimal; otherwise, if it begins with `0', in octal; otherwise, in decimal. - Appending `b' multiplies BYTES by 512, `k' by 1024, and `m' by - 1048576. + BYTES is a number which may have one of the following + multiplicative suffixes: + `b' => 512 ("blocks") + `KB' => 1000 (KiloBytes) + `K' => 1024 (KibiBytes) + `MB' => 1000*1000 (MegaBytes) + `M' => 1024*1024 (MebiBytes) + `GB' => 1000*1000*1000 (GigaBytes) + `G' => 1024*1024*1024 (GibiBytes) + and so on for `T', `P', `E', `Z', and `Y'. `-N BYTES' `--read-bytes=BYTES' Output at most BYTES bytes of the input. Prefixes and suffixes on `bytes' are interpreted as for the `-j' option. -`-S N' -`--strings[=N]' +`-S BYTES' +`--strings[=BYTES]' Instead of the normal output, output only "string constants": at - least N consecutive ASCII graphic characters, followed by a null - (zero) byte. + least BYTES consecutive ASCII graphic characters, followed by a + zero byte (ASCII NUL). Prefixes and suffixes on `bytes' are + interpreted as for the `-j' option. If N is omitted with `--strings', the default is 3. @@ -1399,9 +1537,9 @@ options::. hexadecimal The type `a' outputs things like `sp' for space, `nl' for newline, - and `nul' for a null (zero) byte. Only the least significant - seven bits of each byte is used; the high-order bit is ignored. - Type `c' outputs ` ', `\n', and `\0', respectively. + and `nul' for a zero byte. Only the least significant seven bits + of each byte is used; the high-order bit is ignored. Type `c' + outputs ` ', `\n', and `\0', respectively. Except for types `a' and `c', you can specify the number of bytes to use in interpreting each number in the given data type by @@ -1510,15 +1648,16 @@ File: coreutils.info, Node: base64 invocation, Prev: od invocation, Up: Outpu `base64' transforms data read from a file, or standard input, into (or from) base64 encoded form. The base64 encoded form uses printable -ASCII characters to represent binary data, see RFC 3548 -(ftp://ftp.rfc-editor.org/in-notes/rfc3548.txt). Synopses: +ASCII characters to represent binary data. Synopses: base64 [OPTION]... [FILE] base64 --decode [OPTION]... [FILE] The base64 encoding expands data to roughly 133% of the original. +The format conforms to RFC 4648 +(ftp://ftp.rfc-editor.org/in-notes/rfc4648.txt). - The program accepts the following options. Also see *Note Common + The program accepts the following options. Also see *note Common options::. `-w COLS' @@ -1587,9 +1726,16 @@ algorithm is a variant of that given by Donald E. Knuth and Michael F. Plass in "Breaking Paragraphs Into Lines", `Software--Practice & Experience' 11, 11 (November 1981), 1119-1184. - The program accepts the following options. Also see *Note Common + The program accepts the following options. Also see *note Common options::. +`-C' +`--compare' + Compare each pair of source and destination files, and if the + destination has identical content and any specified owner, group, + permissions, and possibly SELinux context, then do not modify the + destination at all. + `-c' `--crown-margin' "Crown margin" mode: preserve the indentation of the first two @@ -1648,13 +1794,11 @@ all in parallel, one per column. Synopsis: By default, a 5-line header is printed at each page: two blank lines; a line with the date, the file name, and the page count; and two more -blank lines. A footer of five blank lines is also printed. With the -`-F' option, a 3-line header is printed: the leading two blank lines are -omitted; no footer is used. The default PAGE_LENGTH in both cases is 66 -lines. The default number of text lines changes from 56 (without `-F') -to 63 (with `-F'). The text line of the header takes the form `DATE -STRING PAGE', with spaces inserted around STRING so that the line takes -up the full PAGE_WIDTH. Here, DATE is the date (see the `-D' or +blank lines. A footer of five blank lines is also printed. The +default PAGE_LENGTH is 66 lines. The default number of text lines is +therefore 56. The text line of the header takes the form `DATE STRING +PAGE', with spaces inserted around STRING so that the line takes up the +full PAGE_WIDTH. Here, DATE is the date (see the `-D' or `--date-format' option for details), STRING is the centered header string, and PAGE identifies the page number. The `LC_MESSAGES' locale category affects the spelling of PAGE; in the default C locale, it is @@ -1688,7 +1832,7 @@ versions of `pr': - Brian cannot be specified as separate arguments from the preceding option letter (already stated in the POSIX specification). - The program accepts the following options. Also see *Note Common + The program accepts the following options. Also see *note Common options::. `+FIRST_PAGE[:LAST_PAGE]' @@ -1740,11 +1884,11 @@ options::. arbitrary string in place of the header date, e.g., `--date-format="Monday morning"'. - Normally the date format defaults to `%Y-%m-%d %H:%M' (for - example, `2001-12-04 23:59'); but if the `POSIXLY_CORRECT' - environment variable is set and the `LC_TIME' locale category - specifies the POSIX locale, the default is `%b %e %H:%M %Y' (for - example, `Dec 4 23:59 2001'. + The default date format is `%Y-%m-%d %H:%M' (for example, + `2001-12-04 23:59'); but if the `POSIXLY_CORRECT' environment + variable is set and the `LC_TIME' locale category specifies the + POSIX locale, the default is `%b %e %H:%M %Y' (for example, `Dec + 4 23:59 2001'. Time stamps are listed according to the time zone rules specified by the `TZ' environment variable, or by the system default rules if @@ -1761,9 +1905,8 @@ options::. `-f' `-F' `--form-feed' - Use a form feed instead of newlines to separate output pages. The - default page length of 66 lines is not altered. But the number of - lines of text per page changes from default 56 to 63 lines. + Use a form feed instead of newlines to separate output pages. + This does not alter the default page length of 66 lines. `-h HEADER' `--header=HEADER' @@ -1791,9 +1934,8 @@ options::. `--length=PAGE_LENGTH' Set the page length to PAGE_LENGTH (default 66) lines, including the lines of the header [and the footer]. If PAGE_LENGTH is less - than or equal to 10 (or <= 3 with `-F'), the header and footer are - omitted, and all form feeds set in input files are eliminated, as - if the `-T' option had been given. + than or equal to 10, the header and footer are omitted, as if the + `-t' option had been given. `-m' `--merge' @@ -1820,10 +1962,10 @@ options::. NUMBER-SEPARATOR is the character appended to the line number to separate it from the text followed. The default separator is the TAB character. In a strict sense a TAB is always printed with - single column output only. The TAB-width varies with the - TAB-position, e.g., with the left MARGIN specified by `-o' option. + single column output only. The TAB width varies with the TAB + position, e.g., with the left MARGIN specified by `-o' option. With multicolumn output priority is given to `equal width of - output columns' (a POSIX specification). The TAB-width is fixed + output columns' (a POSIX specification). The TAB width is fixed to the value of the first column and does not change with different values of left MARGIN. That means a fixed number of spaces is always printed in the place of the NUMBER-SEPARATOR TAB. @@ -1929,7 +2071,7 @@ is split into as many lines as necessary. than one column, backspace decreases the column count, and carriage return sets the column to zero. - The program accepts the following options. Also see *Note Common + The program accepts the following options. Also see *note Common options::. `-b' @@ -1989,19 +2131,29 @@ consisting of: before the output for each FILE. - The program accepts the following options. Also see *Note Common + The program accepts the following options. Also see *note Common options::. `-c N' `--bytes=N' - Print the first N bytes, instead of initial lines. Appending `b' - multiplies N by 512, `k' by 1024, and `m' by 1048576. However, if - N starts with a `-', print all but the last N bytes of each file. + Print the first N bytes, instead of initial lines. However, if N + starts with a `-', print all but the last N bytes of each file. N + is a number which may have one of the following multiplicative + suffixes: + `b' => 512 ("blocks") + `KB' => 1000 (KiloBytes) + `K' => 1024 (KibiBytes) + `MB' => 1000*1000 (MegaBytes) + `M' => 1024*1024 (MebiBytes) + `GB' => 1000*1000*1000 (GigaBytes) + `G' => 1024*1024*1024 (GibiBytes) + and so on for `T', `P', `E', `Z', and `Y'. `-n N' `--lines=N' Output the first N lines. However, if N starts with a `-', print - all but the last N lines of each file. + all but the last N lines of each file. Size multiplier suffixes + are the same as with the `-c' option. `-q' `--quiet' @@ -2052,17 +2204,23 @@ that are at most as large as its buffer, which is typically 32 KiB. A more reliable and versatile way to reverse files is the GNU `tac' command. - If any option-argument is a number N starting with a `+', `tail' -begins printing with the Nth item from the start of each file, instead -of from the end. - - The program accepts the following options. Also see *Note Common + The program accepts the following options. Also see *note Common options::. -`-c BYTES' -`--bytes=BYTES' - Output the last BYTES bytes, instead of final lines. Appending - `b' multiplies BYTES by 512, `k' by 1024, and `m' by 1048576. +`-c N' +`--bytes=N' + Output the last N bytes, instead of final lines. However, if N + starts with a `+', start printing with the Nth byte from the start + of each file, instead of from the end. N is a number which may + have one of the following multiplicative suffixes: + `b' => 512 ("blocks") + `KB' => 1000 (KiloBytes) + `K' => 1024 (KibiBytes) + `MB' => 1000*1000 (MegaBytes) + `M' => 1024*1024 (MebiBytes) + `GB' => 1000*1000*1000 (GigaBytes) + `G' => 1024*1024*1024 (GibiBytes) + and so on for `T', `P', `E', `Z', and `Y'. `-f' `--follow[=HOW]' @@ -2155,7 +2313,10 @@ options::. `-n N' `--lines=N' - Output the last N lines. + Output the last N lines. However, if N starts with a `+', start + printing with the Nth line from the start of each file, instead of + from the end. Size multiplier suffixes are the same as with the + `-c' option. `-q' `--quiet' @@ -2220,13 +2381,9 @@ produces the original input file. If the output file names are exhausted, `split' reports an error without deleting the output files that it did create. - The program accepts the following options. Also see *Note Common + The program accepts the following options. Also see *note Common options::. -`-a LENGTH' -`--suffix-length=LENGTH' - Use suffixes of length LENGTH. The default LENGTH is 2. - `-l LINES' `--lines=LINES' Put LINES lines of INPUT into each output file. @@ -2234,27 +2391,36 @@ options::. For compatibility `split' also supports an obsolete option syntax `-LINES'. New scripts should use `-l LINES' instead. -`-b BYTES' -`--bytes=BYTES' - Put the first BYTES bytes of INPUT into each output file. - Appending `b' multiplies BYTES by 512, `k' by 1024, and `m' by - 1048576. +`-b SIZE' +`--bytes=SIZE' + Put SIZE bytes of INPUT into each output file. SIZE is a number + which may have one of the following multiplicative suffixes: + `b' => 512 ("blocks") + `KB' => 1000 (KiloBytes) + `K' => 1024 (KibiBytes) + `MB' => 1000*1000 (MegaBytes) + `M' => 1024*1024 (MebiBytes) + `GB' => 1000*1000*1000 (GigaBytes) + `G' => 1024*1024*1024 (GibiBytes) + and so on for `T', `P', `E', `Z', and `Y'. -`-C BYTES' -`--line-bytes=BYTES' +`-C SIZE' +`--line-bytes=SIZE' Put into each output file as many complete lines of INPUT as - possible without exceeding BYTES bytes. For lines longer than - BYTES bytes, put BYTES bytes into each output file until less than - BYTES bytes of the line are left, then continue normally. BYTES - has the same format as for the `--bytes' option. + possible without exceeding SIZE bytes. Individual lines longer + than SIZE bytes are broken into multiple files. SIZE has the same + format as for the `--bytes' option. + +`-a LENGTH' +`--suffix-length=LENGTH' + Use suffixes of length LENGTH. The default LENGTH is 2. `-d' `--numeric-suffixes' Use digits in suffixes rather than lower-case letters. `--verbose' - Write a diagnostic to standard error just before each output file - is opened. + Write a diagnostic just before each output file is opened. An exit status of zero indicates success, and a nonzero value @@ -2317,7 +2483,7 @@ original input file. interrupt, quit, or terminate signal, it removes any output files that it has created so far before it exits. - The program accepts the following options. Also see *Note Common + The program accepts the following options. Also see *note Common options::. `-f PREFIX' @@ -2366,6 +2532,47 @@ options::. An exit status of zero indicates success, and a nonzero value indicates failure. + Here is an example of its usage. First, create an empty directory +for the exercise, and cd into it: + + $ mkdir d && cd d + + Now, split the sequence of 1..14 on lines that end with 0 or 5: + + $ seq 14 | csplit - '/[05]$/' '{*}' + 8 + 10 + 15 + + Each number printed above is the size of an output file that csplit +has just created. List the names of those output files: + + $ ls + xx00 xx01 xx02 + + Use `head' to show their contents: + + $ head xx* + ==> xx00 <== + 1 + 2 + 3 + 4 + + ==> xx01 <== + 5 + 6 + 7 + 8 + 9 + + ==> xx02 <== + 10 + 11 + 12 + 13 + 14 +  File: coreutils.info, Node: Summarizing files, Next: Operating on sorted files, Prev: Output of parts of files, Up: Top @@ -2418,9 +2625,11 @@ prints both the byte counts and the word counts. With the `--max-line-length' option, `wc' prints the length of the longest line per file, and if there is more than one file it prints the -maximum (not the sum) of those lengths. +maximum (not the sum) of those lengths. The line lengths here are +measured in screen columns, according to the current locale and +assuming tab positions in every 8th column. - The program accepts the following options. Also see *Note Common + The program accepts the following options. Also see *note Common options::. `-c' @@ -2444,21 +2653,22 @@ options::. Print only the maximum line lengths. `--files0-from=FILE' - Rather than processing files named on the command line, process - those named in file FILE; each name is terminated by a null byte. - This is useful when the list of file names is so long that it may - exceed a command line length limitation. In such cases, running - `wc' via `xargs' is undesirable because it splits the list into - pieces and makes `wc' print a total for each sublist rather than - for the entire list. One way to produce a list of - null-byte-terminated file names is with GNU `find', using its - `-print0' predicate. For example, to find the length of the - longest line in any `.c' or `.h' file in the current hierarchy, do - this: + Disallow processing files named on the command line, and instead + process those named in file FILE; each name being terminated by a + zero byte (ASCII NUL). This is useful when the list of file names + is so long that it may exceed a command line length limitation. + In such cases, running `wc' via `xargs' is undesirable because it + splits the list into pieces and makes `wc' print a total for each + sublist rather than for the entire list. One way to produce a + list of ASCII NUL terminated file names is with GNU `find', using + its `-print0' predicate. If FILE is `-' then the ASCII NUL + terminated file names are read from standard input. - find . -name '*.[ch]' -print0 | wc -L --files0-from=- | tail -n1 + For example, to find the length of the longest line in any `.c' or + `.h' file in the current hierarchy, do this: - Do not specify any FILE on the command line when using this option. + find . -name '*.[ch]' -print0 | + wc -L --files0-from=- | tail -n1 An exit status of zero indicates success, and a nonzero value @@ -2485,7 +2695,7 @@ argument.) compatible with BSD `sum' and prints file sizes in units of 1024-byte blocks. - The program accepts the following options. Also see *Note Common + The program accepts the following options. Also see *note Common options::. `-r' @@ -2553,7 +2763,7 @@ fingerprint, or modifying a file so as to retain its MD5 are considered infeasible at the moment, it is known how to produce different files with identical MD5 (a "collision"), something which can be a security issue in certain contexts. For more secure hashes, consider using -SHA-1 or SHA-2. *Note sha1sum invocation::, and *Note sha2 utilities::. +SHA-1 or SHA-2. *Note sha1sum invocation::, and *note sha2 utilities::. If a FILE is specified as `-' or if no files are given `md5sum' computes the checksum for the standard input. `md5sum' can also @@ -2568,7 +2778,7 @@ problematic character in the file name is escaped with a backslash, making the output unambiguous even in the presence of arbitrary file names. If FILE is omitted or specified as `-', standard input is read. - The program accepts the following options. Also see *Note Common + The program accepts the following options. Also see *note Common options::. `-b' @@ -2603,6 +2813,14 @@ options::. associated file, or if no valid line is found, `md5sum' exits with nonzero status. Otherwise, it exits successfully. +`--quiet' + This option is useful only when verifying checksums. When + verifying checksums, don't generate an 'OK' message per + successfully checked file. Files that fail the verification are + reported in the default one-line-per-file format. If there is any + checksum mismatch, print a warning summarizing the failures to + standard error. + `--status' This option is useful only when verifying checksums. When verifying checksums, don't generate the default one-line-per-file @@ -2679,7 +2897,6 @@ These commands work with (or produce) sorted files. * comm invocation:: Compare two sorted files line by line. * ptx invocation:: Produce a permuted index of file contents. * tsort invocation:: Topological sort. -* tsort background:: Where tsort came from.  File: coreutils.info, Node: sort invocation, Next: shuf invocation, Up: Operating on sorted files @@ -2775,10 +2992,15 @@ scripts should specify global options first. `--ignore-case' Fold lowercase characters into the equivalent uppercase characters when comparing so that, for example, `b' and `B' sort as equal. - The `LC_CTYPE' locale determines character types. + The `LC_CTYPE' locale determines character types. When used with + `--unique' those lower case equivalent lines are thrown away. + (There is currently no way to throw away the upper case equivalent + instead. (Any `--reverse' given would only affect the final + result, after the throwing away.)) `-g' `--general-numeric-sort' +`--sort=general-numeric' Sort numerically, using the standard C function `strtod' to convert a prefix of each line to a double-precision floating point number. This allows floating point numbers to be specified in scientific @@ -2812,6 +3034,7 @@ scripts should specify global options first. `-M' `--month-sort' +`--sort=month' An initial string, consisting of any amount of blanks, followed by a month name abbreviation, is folded to UPPER case and compared in the order `JAN' < `FEB' < ... < `DEC'. Invalid names compare low @@ -2821,6 +3044,7 @@ scripts should specify global options first. `-n' `--numeric-sort' +`--sort=numeric' Sort numerically. The number begins each line and consists of optional blanks, an optional `-' sign, and zero or more digits possibly separated by thousands separators, optionally followed by @@ -2836,6 +3060,12 @@ scripts should specify global options first. compare such strings numerically, use the `--general-numeric-sort' (`-g') option. +`-V' +`--version-sort' + Sort per `strverscmp(3)'. This is a normal string comparison, + except that embedded decimal numbers are sorted by numeric value + (see `--numeric-sort' above). + `-r' `--reverse' Reverse the result of comparison, so that lines with greater key @@ -2843,6 +3073,7 @@ scripts should specify global options first. `-R' `--random-sort' +`--sort=random' Sort by hashing the input keys and then sorting the hash values. Choose the hash function at random, ensuring that it is free of collisions so that differing keys have differing hash values. @@ -2869,9 +3100,21 @@ scripts should specify global options first. Terminate with an error if PROG exits with nonzero status. - Whitespace and the backslash character should not appear in PROG; + White space and the backslash character should not appear in PROG; they are reserved for future use. +`--files0-from=FILE' + Disallow processing files named on the command line, and instead + process those named in file FILE; each name being terminated by a + zero byte (ASCII NUL). This is useful when the list of file names + is so long that it may exceed a command line length limitation. + In such cases, running `sort' via `xargs' is undesirable because + it splits the list into pieces and makes `sort' print sorted + output for each sublist rather than for the entire list. One way + to produce a list of ASCII NUL terminated file names is with GNU + `find', using its `-print0' predicate. If FILE is `-' then the + ASCII NUL terminated file names are read from standard input. + `-k POS1[,POS2]' `--key=POS1[,POS2]' Specify a sort field that consists of the part of the line between @@ -2892,6 +3135,31 @@ scripts should specify global options first. Example: To sort on the second field, use `--key=2,2' (`-k 2,2'). See below for more examples. +`--batch-size=NMERGE' + Merge at most NMERGE inputs at once. + + When `sort' has to merge more than NMERGE inputs, it merges them + in groups of NMERGE, saving the result in a temporary file, which + is then used as an input in a subsequent merge. + + A large value of NMERGE may improve merge performance and decrease + temporary storage utilization at the expense of increased memory + usage and I/0. Conversely a small value of NMERGE may reduce + memory requirements and I/0 at the expense of temporary storage + consumption and merge performance. + + The value of NMERGE must be at least 2. The default value is + currently 16, but this is implementation-dependent and may change + in the future. + + The value of NMERGE may be bounded by a resource limit for open + file descriptors. The commands `ulimit -n' or `getconf OPEN_MAX' + may display limits for your systems; these limits may be modified + further if your program already has some files open, or if the + operating system has other limits on the number of open files. If + the value of NMERGE exceeds the resource limit, `sort' silently + uses a smaller value. + `-o OUTPUT-FILE' `--output=OUTPUT-FILE' Write output to OUTPUT-FILE instead of standard output. Normally, @@ -2949,8 +3217,8 @@ scripts should specify global options first. `-k 2,3', retain the field separators present between the endpoints of the range. - To specify a null character (ASCII NUL) as the field separator, - use the two-character string `\0', e.g., `sort -t '\0''. + To specify ASCII NUL as the field separator, use the two-character + string `\0', e.g., `sort -t '\0''. `-T TEMPDIR' `--temporary-directory=TEMPDIR' @@ -2977,12 +3245,12 @@ scripts should specify global options first. `-z' `--zero-terminated' - Treat the input as a set of lines, each terminated by a null - character (ASCII NUL) instead of a line feed (ASCII LF). This - option can be useful in conjunction with `perl -0' or `find - -print0' and `xargs -0' which do the same in order to reliably - handle arbitrary file names (even those containing blanks or other - special characters). + Delimit items with a zero byte rather than a newline (ASCII LF). + I.E. treat input as items separated by ASCII NUL and terminate + output items with ASCII NUL. This option can be useful in + conjunction with `perl -0' or `find -print0' and `xargs -0' which + do the same in order to reliably handle arbitrary file names (even + those containing blanks or other special characters). Historical (BSD and System V) implementations of `sort' have @@ -3160,8 +3428,8 @@ following options change the operation mode: modes: `-n LINES' -`--head-lines=LINES' - Output at most LINES lines. By default, all input lines are +`--head-count=COUNT' + Output at most COUNT lines. By default, all input lines are output. `-o OUTPUT-FILE' @@ -3177,12 +3445,12 @@ modes: `-z' `--zero-terminated' - Treat the input and output as a set of lines, each terminated by a - zero byte (ASCII NUL (Null) character) instead of an ASCII LF - (Line Feed). This option can be useful in conjunction with `perl - -0' or `find -print0' and `xargs -0' which do the same in order to - reliably handle arbitrary file names (even those containing blanks - or other special characters). + Delimit items with a zero byte rather than a newline (ASCII LF). + I.E. treat input as items separated by ASCII NUL and terminate + output items with ASCII NUL. This option can be useful in + conjunction with `perl -0' or `find -print0' and `xargs -0' which + do the same in order to reliably handle arbitrary file names (even + those containing blanks or other special characters). For example: @@ -3248,12 +3516,12 @@ only if they are adjacent. If you want to discard non-adjacent duplicate lines, perhaps you want to use `sort -u'. *Note sort invocation::. - Comparisons use the character collating sequence specified by the -`LC_COLLATE' locale category. + Comparisons honor the rules specified by the `LC_COLLATE' locale +category. If no OUTPUT file is specified, `uniq' writes to standard output. - The program accepts the following options. Also see *Note Common + The program accepts the following options. Also see *note Common options::. `-f N' @@ -3308,13 +3576,16 @@ options::. to `--all-repeated' (`-D'). `prepend' - Output a newline before each group of repeated lines. + Output a newline before each group of repeated lines. With + `--zero-terminated' (`-z'), use a zero byte (ASCII NUL) + instead of a newline. `separate' Separate groups of repeated lines with a single newline. - This is the same as using `prepend', except that there is no - newline before the first group, and hence may be better - suited for output direct to users. + With `--zero-terminated' (`-z'), use a zero byte (ASCII NUL) + instead of a newline. This is the same as using `prepend', + except that no delimiter is inserted before the first group, + and hence may be better suited for output direct to users. Note that when groups are delimited and the input stream contains two or more consecutive blank lines, then the output is ambiguous. @@ -3334,6 +3605,15 @@ options::. specified fields and characters). By default the entire rest of the lines are compared. +`-z' +`--zero-terminated' + Delimit items with a zero byte rather than a newline (ASCII LF). + I.E. treat input as items separated by ASCII NUL and terminate + output items with ASCII NUL. This option can be useful in + conjunction with `perl -0' or `find -print0' and `xargs -0' which + do the same in order to reliably handle arbitrary file names (even + those containing blanks or other special characters). + An exit status of zero indicates success, and a nonzero value indicates failure. @@ -3362,163 +3642,45 @@ FILE2, and column three contains lines common to both files. Columns are separated by a single TAB character. The options `-1', `-2', and `-3' suppress printing of the -corresponding columns. Also see *Note Common options::. +corresponding columns. Also see *note Common options::. Unlike some other comparison utilities, `comm' has an exit status that does not depend on the result of the comparison. Upon normal completion `comm' produces an exit code of zero. If there is an error it exits with nonzero status. - -File: coreutils.info, Node: tsort invocation, Next: tsort background, Prev: ptx invocation, Up: Operating on sorted files + If the `--check-order' option is given, unsorted inputs will cause a +fatal error message. If the option `--nocheck-order' is given, +unsorted inputs will never cause an error message. If neither of these +options is given, wrongly sorted inputs are diagnosed only if an input +file is found to contain unpairable lines. If an input file is +diagnosed as being unsorted, the `comm' command will exit with a +nonzero status (and the output should not be used). -7.5 `tsort': Topological sort -============================= + Forcing `comm' to process wrongly sorted input files containing +unpairable lines by specifying `--nocheck-order' is not guaranteed to +produce any particular output. The output will probably not correspond +with whatever you hoped it would be. -`tsort' performs a topological sort on the given FILE, or standard -input if no input file is given or for a FILE of `-'. For more details -and some history, see *Note tsort background::. Synopsis: +`--check-order' + Fail with an error message if either input file is wrongly ordered. - tsort [OPTION] [FILE] +`--nocheck-order' + Do not check that both input files are in sorted order. - `tsort' reads its input as pairs of strings, separated by blanks, -indicating a partial ordering. The output is a total ordering that -corresponds to the given partial ordering. + Other options are: - For example +`--output-delimiter=STR' + Print STR between adjacent output columns, rather than the default + of a single TAB character. - tsort < 1000 (KiloBytes) + `K' => 1024 (KibiBytes) + `MB' => 1000*1000 (MegaBytes) + `M' => 1024*1024 (MebiBytes) + `GB' => 1000*1000*1000 (GigaBytes) + `G' => 1024*1024*1024 (GibiBytes) + and so on for `T', `P', `E', `Z', and `Y'. + + SIZE may also be prefixed by one of the following to adjust the + size of each FILE based on their current size: + `+' => extend by + `-' => reduce by + `<' => at most + `>' => at least + `/' => round down to multiple of + `%' => round up to multiple of + + + An exit status of zero indicates success, and a nonzero value +indicates failure. +  File: coreutils.info, Node: Printing text, Next: Conditions, Prev: Disk usage, Up: Top @@ -8124,7 +8681,12 @@ between each and a newline after the last one. Synopsis: echo [OPTION]... [STRING]... - The program accepts the following options. Also see *Note Common + Due to shell aliases and built-in `echo' command, using an unadorned +`echo' interactively or in a script may get you different functionality +than that described here. Invoke it via `env' (i.e., `env echo ...') +to avoid interference from the shell. + + The program accepts the following options. Also see *note Common options::. Options must precede operands, and the normally-special argument `--' has no special meaning and is treated like any other STRING. @@ -8143,13 +8705,13 @@ STRING. backspace `\c' - suppress trailing newline + produce no further output `\f' form feed `\n' - new line + newline `\r' carriage return @@ -8207,8 +8769,14 @@ File: coreutils.info, Node: printf invocation, Next: yes invocation, Prev: ec `printf' prints the FORMAT string, interpreting `%' directives and `\' escapes to format numeric and string arguments in a way that is -mostly similar to the C `printf' function. The differences are as -follows: +mostly similar to the C `printf' function. *Note `printf' format +directives: (libc)Output Conversion Syntax, for details. The +differences are listed below. + + Due to shell aliases and built-in `printf' command, using an +unadorned `printf' interactively or in a script may get you different +functionality than that described here. Invoke it via `env' (i.e., +`env printf ...') to avoid interference from the shell. * The FORMAT argument is reused as necessary to convert all the given ARGUMENTs. For example, the command `printf %s a b' outputs @@ -8261,7 +8829,10 @@ to print. `\u' for 16-bit Unicode (ISO/IEC 10646) characters, specified as four hexadecimal digits HHHH, and `\U' for 32-bit Unicode characters, specified as eight hexadecimal digits HHHHHHHH. `printf' outputs the -Unicode characters according to the `LC_CTYPE' locale. +Unicode characters according to the `LC_CTYPE' locale. Unicode +characters in the ranges U+0000...U+009F, U+D800...U+DFFF cannot be +specified by this syntax, except for U+0024 ($), U+0040 (@), and U+0060 +()`. The processing of `\u' and `\U' requires a full-featured `iconv' facility. It is activated on systems with glibc 2.2 (or newer), or @@ -8275,18 +8846,19 @@ options::. Options must precede operands. locale independent way. For example, a string containing the Euro currency symbol - $ /usr/local/bin/printf '\u20AC 14.95' + $ env printf '\u20AC 14.95' will be output correctly in all locales supporting the Euro symbol (ISO-8859-15, UTF-8, and others). Similarly, a Chinese string - $ /usr/local/bin/printf '\u4e2d\u6587' + $ env printf '\u4e2d\u6587' will be output correctly in all Chinese locales (GB2312, BIG5, UTF-8, etc). - Note that in these examples, the full name of `printf' has been -given, to distinguish it from the GNU `bash' built-in function `printf'. + Note that in these examples, the `printf' command has been invoked +via `env' to ensure that we run the program found via your shell's +search path, and not a shell alias or a built-in function. For larger strings, you don't need to look up the hexadecimal code values of each character one by one. ASCII characters mixed with \u @@ -8419,9 +8991,10 @@ form is discussed below. [ ] [ OPTION - Because most shells have a built-in `test' command, using an -unadorned `test' in a script or interactively may get you different -functionality than that described here. + Due to shell aliases and built-in `test' command, using an unadorned +`test' interactively or in a script may get you different functionality +than that described here. Invoke it via `env' (i.e., `env test ...') +to avoid interference from the shell. If EXPRESSION is omitted, `test' returns false. If EXPRESSION is a single argument, `test' returns false if the argument is null and true @@ -8578,9 +9151,9 @@ File: coreutils.info, Node: Numeric tests, Next: Connectives for test, Prev: 16.3.5 Numeric tests -------------------- -Numeric relationals. The arguments must be entirely numeric (possibly -negative), or the special expression `-l STRING', which evaluates to -the length of STRING. +Numeric relational operators. The arguments must be entirely numeric +(possibly negative), or the special expression `-l STRING', which +evaluates to the length of STRING. `ARG1 -eq ARG2' `ARG1 -ne ARG2' @@ -8656,6 +9229,10 @@ Parentheses may be used for grouping in the usual manner. You must quote parentheses and many operators to avoid the shell evaluating them, however. + When built with support for the GNU MP library, `expr' uses +arbitrary-precision arithmetic; otherwise, it uses native arithmetic +types and may fail due to arithmetic overflow. + The only options are `--help' and `--version'. *Note Common options::. Options must precede operands. @@ -8680,8 +9257,8 @@ File: coreutils.info, Node: String expressions, Next: Numeric expressions, Up ------------------------- `expr' supports pattern matching and other string operators. These -have lower precedence than both the numeric and relational operators (in -the next sections). +have higher precedence than both the numeric and relational operators +(in the next sections). `STRING : REGEX' Perform pattern matching. The arguments are converted to strings @@ -8706,7 +9283,7 @@ the next sections). alternatives. SunOS and other `expr''s treat these as regular characters. (POSIX allows either behavior.) *Note Regular Expression Library: (regex)Top, for details of regular expression - syntax. Some examples are in *Note Examples of expr::. + syntax. Some examples are in *note Examples of expr::. `match STRING REGEX' An alternative way to do pattern matching. This is the same as @@ -8744,8 +9321,9 @@ File: coreutils.info, Node: Numeric expressions, Next: Relations for expr, Pr -------------------------- `expr' supports the usual numeric operators, in order of increasing -precedence. The string operators (previous section) have lower -precedence, the connectives (next section) have higher. +precedence. These numeric operators have lower precedence than the +string operators described in the previous section, and higher +precedence than the connectives (next section). `+ -' Addition and subtraction. Both arguments are converted to @@ -8762,8 +9340,8 @@ File: coreutils.info, Node: Relations for expr, Next: Examples of expr, Prev: 16.4.3 Relations for `expr' --------------------------- -`expr' supports the usual logical connectives and relations. These are -higher precedence than either the string or numeric operators (previous +`expr' supports the usual logical connectives and relations. These +have lower precedence than the string and numeric operators (previous sections). Here is the list, lowest-precedence operator first. `|' @@ -8814,7 +9392,7 @@ which need not contain a `/': => 3 expr index index a error--> expr: syntax error - expr index quote index a + expr index + index a => 0  @@ -8830,13 +9408,13 @@ it's described here. * Menu: -* tee invocation:: Redirect output to multiple files. +* tee invocation:: Redirect output to multiple files or processes.  File: coreutils.info, Node: tee invocation, Up: Redirection -17.1 `tee': Redirect output to multiple files -============================================= +17.1 `tee': Redirect output to multiple files or processes +========================================================== The `tee' command copies standard input to standard output and also to any files given as arguments. This is useful when you want not only to @@ -8852,7 +9430,7 @@ contained is overwritten unless the `-a' option is used. output, but this is typically not that useful as the copies are interleaved. - The program accepts the following options. Also see *Note Common + The program accepts the following options. Also see *note Common options::. `-a' @@ -8865,6 +9443,93 @@ options::. Ignore interrupt signals. + The `tee' command is useful when you happen to be transferring a +large amount of data and also want to summarize that data without +reading it a second time. For example, when you are downloading a DVD +image, you often want to verify its signature or checksum right away. +The inefficient way to do it is simply: + + wget http://example.com/some.iso && sha1sum some.iso + + One problem with the above is that it makes you wait for the +download to complete before starting the time-consuming SHA1 +computation. Perhaps even more importantly, the above requires reading +the DVD image a second time (the first was from the network). + + The efficient way to do it is to interleave the download and SHA1 +computation. Then, you'll get the checksum for free, because the +entire process parallelizes so well: + + # slightly contrived, to demonstrate process substitution + wget -O - http://example.com/dvd.iso \ + | tee >(sha1sum > dvd.sha1) > dvd.iso + + That makes `tee' write not just to the expected output file, but +also to a pipe running `sha1sum' and saving the final checksum in a +file named `dvd.sha1'. + + Note, however, that this example relies on a feature of modern shells +called "process substitution" (the `>(command)' syntax, above; *Note +Process Substitution: (bashref)Process Substitution.), so it works with +`zsh', `bash', and `ksh', but not with `/bin/sh'. So if you write code +like this in a shell script, be sure to start the script with +`#!/bin/bash'. + + Since the above example writes to one file and one process, a more +conventional and portable use of `tee' is even better: + + wget -O - http://example.com/dvd.iso \ + | tee dvd.iso | sha1sum > dvd.sha1 + + You can extend this example to make `tee' write to two processes, +computing MD5 and SHA1 checksums in parallel. In this case, process +substitution is required: + + wget -O - http://example.com/dvd.iso \ + | tee >(sha1sum > dvd.sha1) \ + >(md5sum > dvd.md5) \ + > dvd.iso + + This technique is also useful when you want to make a _compressed_ +copy of the contents of a pipe. Consider a tool to graphically +summarize disk usage data from `du -ak'. For a large hierarchy, `du +-ak' can run for a long time, and can easily produce terabytes of data, +so you won't want to rerun the command unnecessarily. Nor will you +want to save the uncompressed output. + + Doing it the inefficient way, you can't even start the GUI until +after you've compressed all of the `du' output: + + du -ak | gzip -9 > /tmp/du.gz + gzip -d /tmp/du.gz | xdiskusage -a + + With `tee' and process substitution, you start the GUI right away +and eliminate the decompression completely: + + du -ak | tee >(gzip -9 > /tmp/du.gz) | xdiskusage -a + + Finally, if you regularly create more than one type of compressed +tarball at once, for example when `make dist' creates both +`gzip'-compressed and `bzip2'-compressed tarballs, there may be a +better way. Typical `automake'-generated `Makefile' rules create the +two compressed tar archives with commands in sequence, like this +(slightly simplified): + + tardir=your-pkg-M.N + tar chof - "$tardir" | gzip -9 -c > your-pkg-M.N.tar.gz + tar chof - "$tardir" | bzip2 -9 -c > your-pkg-M.N.tar.bz2 + + However, if the hierarchy you are archiving and compressing is larger +than a couple megabytes, and especially if you are using a +multi-processor system with plenty of memory, then you can do much +better by reading the directory contents only once and running the +compression programs in parallel: + + tardir=your-pkg-M.N + tar chof - "$tardir" \ + | tee >(gzip -9 -c > your-pkg-M.N.tar.gz) \ + | bzip2 -9 -c > your-pkg-M.N.tar.bz2 + An exit status of zero indicates success, and a nonzero value indicates failure. @@ -8880,7 +9545,7 @@ This section describes commands that manipulate file names. * basename invocation:: Strip directory and suffix from a file name. * dirname invocation:: Strip non-directory suffix from a file name. -* pathchk invocation:: Check file name portability. +* pathchk invocation:: Check file name validity and portability.  File: coreutils.info, Node: basename invocation, Next: dirname invocation, Up: File name manipulation @@ -8962,15 +9627,15 @@ indicates failure.  File: coreutils.info, Node: pathchk invocation, Prev: dirname invocation, Up: File name manipulation -18.3 `pathchk': Check file name portability -=========================================== +18.3 `pathchk': Check file name validity and portability +======================================================== -`pathchk' checks portability of file names. Synopsis: +`pathchk' checks validity and portability of file names. Synopsis: pathchk [OPTION]... NAME... - For each NAME, `pathchk' prints a message if any of these conditions -is true: + For each NAME, `pathchk' prints an error message if any of these +conditions is true: 1. One of the existing directories in NAME does not have search (execute) permission, @@ -8984,29 +9649,29 @@ is true: A nonexistent NAME is not an error, so long a file with that name could be created under the above conditions. - The program accepts the following options. Also see *Note Common + The program accepts the following options. Also see *note Common options::. Options must precede operands. `-p' Instead of performing checks based on the underlying file system, - print a message if any of these conditions is true: + print an error message if any of these conditions is true: 1. A file name is empty. - 2. The length of a file name or one of its components exceeds the + 2. A file name contains a character outside the POSIX portable + file name character set, namely, the ASCII letters and + digits, `.', `_', `-', and `/'. + + 3. The length of a file name or one of its components exceeds the POSIX minimum limits for portability. - 3. A file name contains a character outside the portable file - name character set, namely, the ASCII letters and digits, `-', - `.', `/', and `_'. - `-P' - Print a message if a file name is empty, or if it contains a - component that begins with `-'. + Print an error message if a file name is empty, or if it contains + a component that begins with `-'. `--portability' - Print a message if a file name is not portable to all POSIX hosts. - This option is equivalent to `-p -P'. + Print an error message if a file name is not portable to all POSIX + hosts. This option is equivalent to `-p -P'. Exit status: @@ -9037,17 +9702,35 @@ File: coreutils.info, Node: pwd invocation, Next: stty invocation, Up: Workin 19.1 `pwd': Print working directory =================================== -`pwd' prints the fully resolved name of the current directory. That -is, all components of the printed name will be actual directory -names--none will be symbolic links. +`pwd' prints the name of the current directory. Synopsis: - Because most shells have a built-in `pwd' command, using an -unadorned `pwd' in a script or interactively may get you different -functionality than that described here. + pwd [OPTION]... - The only options are a lone `--help' or `--version'. *Note Common + The program accepts the following options. Also see *note Common options::. +`-L' +`--logical' + If the contents of the environment variable `PWD' provide an + absolute name of the current directory with no `.' or `..' + components, but possibly with symbolic links, then output those + contents. Otherwise, fall back to default `-P' handling. + +`-P' +`--physical' + Print a fully resolved name for the current directory. That is, + all components of the printed name will be actual directory + names--none will be symbolic links. + + If `-L' and `-P' are both given, the last one takes precedence. If +neither option is given, then this implementation uses `-P' as the +default unless the `POSIXLY_CORRECT' environment variable is set. + + Due to shell aliases and built-in `pwd' command, using an unadorned +`pwd' interactively or in a script may get you different functionality +than that described here. Invoke it via `env' (i.e., `env pwd ...') to +avoid interference from the shell. + An exit status of zero indicates success, and a nonzero value indicates failure. @@ -9072,7 +9755,7 @@ input, although this can be modified by the `--file' option. `stty' accepts many non-option arguments that change aspects of the terminal line operation, as described below. - The program accepts the following options. Also see *Note Common + The program accepts the following options. Also see *note Common options::. `-a' @@ -9166,6 +9849,8 @@ File: coreutils.info, Node: Input, Next: Output, Prev: Control, Up: stty inv 19.2.2 Input settings --------------------- +These settings control operations on data received from the terminal. + `ignbrk' Ignore break characters. May be negated. @@ -9209,7 +9894,8 @@ File: coreutils.info, Node: Input, Next: Output, Prev: Control, Up: stty inv `iuclc' Translate uppercase characters to lowercase. Non-POSIX. May be - negated. + negated. Note ilcuc is not implemented, as one would not be able + to issue almost any (lowercase) Unix command, after invoking it. `ixany' Allow any character to restart output (only the start character if @@ -9225,14 +9911,14 @@ File: coreutils.info, Node: Output, Next: Local, Prev: Input, Up: stty invoc 19.2.3 Output settings ---------------------- -These arguments specify output-related operations. +These settings control operations on data sent to the terminal. `opost' Postprocess output. May be negated. `olcuc' Translate lowercase characters to uppercase. Non-POSIX. May be - negated. + negated. (Note ouclc is not currently implemented.) `ocrnl' Translate carriage return to newline. Non-POSIX. May be negated. @@ -9253,7 +9939,7 @@ These arguments specify output-related operations. Non-POSIX. May be negated. `ofdel' - Use delete characters for fill instead of null characters. + Use ASCII DEL characters for fill instead of ASCII NUL characters. Non-POSIX. May be negated. `nl1' @@ -9416,7 +10102,8 @@ Combination settings: `lcase' `LCASE' - Same as `xcase iuclc olcuc'. Non-POSIX. May be negated. + Same as `xcase iuclc olcuc'. Non-POSIX. May be negated. (Used + for terminals with uppercase characters only.) `crt' Same as `echoe echoctl echoke'. @@ -9535,7 +10222,11 @@ File: coreutils.info, Node: Special, Prev: Characters, Up: stty invocation Set the input and output speeds to N. N can be one of: 0 50 75 110 134 134.5 150 200 300 600 1200 1800 2400 4800 9600 19200 38400 `exta' `extb'. `exta' is the same as 19200; `extb' is the same as - 38400. 0 hangs up the line if `-clocal' is set. + 38400. Many systems, including GNU/Linux, support higher speeds. + The `stty' command includes support for speeds of 57600, 115200, + 230400, 460800, 500000, 576000, 921600, 1000000, 1152000, 1500000, + 2000000, 2500000, 3000000, 3500000, or 4000000 where the system + supports these. 0 hangs up the line if `-clocal' is set.  File: coreutils.info, Node: printenv invocation, Next: tty invocation, Prev: stty invocation, Up: Working context @@ -9572,7 +10263,7 @@ Synopsis: tty [OPTION]... - The program accepts the following option. Also see *Note Common + The program accepts the following option. Also see *note Common options::. `-s' @@ -9625,7 +10316,7 @@ different from the real group ID, and supplemental group IDs. followed by the corresponding user or group name in parentheses. The options cause `id' to print only part of the above information. -Also see *Note Common options::. +Also see *note Common options::. `-g' `--group' @@ -9649,10 +10340,22 @@ Also see *Note Common options::. `--user' Print only the user ID. +`-Z' +`--context' + Print only the security context of the current user. If SELinux + is disabled then print a warning and set the exit status to 1. + An exit status of zero indicates success, and a nonzero value indicates failure. + Primary and supplementary groups for a process are normally inherited +from its parent and are usually unchanged since login. This means that +if you change the group database after logging in, `id' will not +reflect your changes within your existing login session. Running `id' +with a user argument causes the user and group database to be consulted +afresh, and so will give a different result. +  File: coreutils.info, Node: logname invocation, Next: whoami invocation, Prev: id invocation, Up: User information @@ -9694,12 +10397,20 @@ File: coreutils.info, Node: groups invocation, Next: users invocation, Prev: `groups' prints the names of the primary and any supplementary groups for each given USERNAME, or the current process if no names are given. If more than one name is given, the name of each user is printed before -the list of that user's groups. Synopsis: +the list of that user's groups and the user name is separated from the +group list by a colon. Synopsis: groups [USERNAME]... The group lists are equivalent to the output of the command `id -Gn'. + Primary and supplementary groups for a process are normally inherited +from its parent and are usually unchanged since login. This means that +if you change the group database after logging in, `groups' will not +reflect your changes within your existing login session. Running +`groups' with a list of users causes the user and group database to be +consulted afresh, and so will give a different result. + The only options are `--help' and `--version'. *Note Common options::. @@ -9762,7 +10473,7 @@ the `TZ' environment variable, or by the system default rules if `TZ' is not set. *Note Specifying the Time Zone with `TZ': (libc)TZ Variable. - The program accepts the following options. Also see *Note Common + The program accepts the following options. Also see *note Common options::. `-a' @@ -9779,23 +10490,7 @@ options::. `-H' `--heading' - Print column headings. - -`-m' - Same as `who am i'. - -`-q' -`--count' - Print only the login names and the number of users logged on. - Overrides all other options. - -`-s' - Ignored; for compatibility with other versions of `who'. - -`-u' - After the login time, print the number of hours and minutes that - the user has been idle. `.' means the user was active in the last - minute. `old' means the user has been idle for more than 24 hours. + Print a line of column headings. `-l' `--login' @@ -9808,9 +10503,34 @@ options::. lookup. This is not the default because it can cause significant delays on systems with automatic dial-up internet access. -`-H' -`--heading' - Print a line of column headings. +`-m' + Same as `who am i'. + +`-p' +`--process' + List active processes spawned by init. + +`-q' +`--count' + Print only the login names and the number of users logged on. + Overrides all other options. + +`-r' +`--runlevel' + Print the current (and maybe previous) run-level of the init + process. + +`-s' + Ignored; for compatibility with other versions of `who'. + +`-t' +`--time' + Print last system clock change. + +`-u' + After the login time, print the number of hours and minutes that + the user has been idle. `.' means the user was active in the last + minute. `old' means the user has been idle for more than 24 hours. `-w' `-T' @@ -9829,7 +10549,7 @@ options::. indicates failure.  -File: coreutils.info, Node: System context, Next: Modified command invocation, Prev: User information, Up: Top +File: coreutils.info, Node: System context, Next: SELinux context, Prev: User information, Up: Top 21 System context ***************** @@ -9839,15 +10559,151 @@ information. * Menu: +* arch invocation:: Print machine hardware name. * date invocation:: Print or set system date and time. * uname invocation:: Print system information. * hostname invocation:: Print or set system name. * hostid invocation:: Print numeric host identifier. +* uptime invocation:: Print system uptime and load  -File: coreutils.info, Node: date invocation, Next: uname invocation, Up: System context +File: coreutils.info, Node: SELinux context, Next: Modified command invocation, Prev: System context, Up: Top -21.1 `date': Print or set system date and time +22 SELinux context +****************** + +This section describes commands for operations with SELinux contexts. + +* Menu: + +* chcon invocation:: Change SELinux context of file +* runcon invocation:: Run a command in specified SELinux context + + +File: coreutils.info, Node: chcon invocation, Next: runcon invocation, Up: SELinux context + +22.1 `chcon': Change SELinux context of file. +============================================= + +`chcon' changes the SELinux security context of the selected files. +Synopses: + + chcon [OPTION]... CONTEXT FILE... + chcon [OPTION]... [-u USER] [-r ROLE] [-l RANGE] [-t TYPE] FILE... + chcon [OPTION]... --reference=RFILE FILE... + + Change the SELinux security context of each FILE to CONTEXT. With +`--reference', change the security context of each FILE to that of +RFILE. + + The program accepts the following options. Also see *note Common +options::. + +`-h' +`--no-dereference' + Affect symbolic links instead of any referenced file. + +`--reference=RFILE' + Use RFILE's security context rather than specifying a CONTEXT + value. + +`-R' +`--recursive' + Operate on files and directories recursively. + +`-H' + If `--recursive' (`-R') is specified and a command line argument + is a symbolic link to a directory, traverse it. *Note Traversing + symlinks::. + +`-L' + In a recursive traversal, traverse every symbolic link to a + directory that is encountered. *Note Traversing symlinks::. + +`-P' + Do not traverse any symbolic links. This is the default if none + of `-H', `-L', or `-P' is specified. *Note Traversing symlinks::. + +`-v' +`--verbose' + Output a diagnostic for every file processed. + +`-u USER' +`--user=USER' + Set user USER in the target security context. + +`-r ROLE' +`--role=ROLE' + Set role ROLE in the target security context. + +`-t TYPE' +`--type=TYPE' + Set type TYPE in the target security context. + +`-l RANGE' +`--range=RANGE' + Set range RANGE in the target security context. + + + An exit status of zero indicates success, and a nonzero value +indicates failure. + + +File: coreutils.info, Node: runcon invocation, Prev: chcon invocation, Up: SELinux context + +22.2 `runcon': Run a command in specified SELinux context +========================================================= + +`runcon' runs file in specified SELinux security context. + + Synopses: + runcon CONTEXT COMMAND [ARGS] + runcon [ -c ] [-u USER] [-r ROLE] [-t TYPE] [-l RANGE] COMMAND [ARGS] + + Run COMMAND with completely-specified CONTEXT, or with current or +transitioned security context modified by one or more of LEVEL, ROLE, +TYPE and USER. + + If none of `-c', `-t', `-u', `-r', or `-l' is specified, the first +argument is used as the complete context. Any additional arguments +after COMMAND are interpreted as arguments to the command. + + With neither CONTEXT nor COMMAND, print the current security context. + + The program accepts the following options. Also see *note Common +options::. + +`-c' +`--compute' + Compute process transition context before modifying. + +`-u USER' +`--user=USER' + Set user USER in the target security context. + +`-r ROLE' +`--role=ROLE' + Set role ROLE in the target security context. + +`-t TYPE' +`--type=TYPE' + Set type TYPE in the target security context. + +`-l RANGE' +`--range=RANGE' + Set range RANGE in the target security context. + + + Exit status: + + 126 if COMMAND is found but cannot be invoked + 127 if `runcon' itself fails or if COMMAND cannot be found + the exit status of COMMAND otherwise + + +File: coreutils.info, Node: date invocation, Next: uname invocation, Prev: arch invocation, Up: System context + +22.3 `date': Print or set system date and time ============================================== Synopses: @@ -9882,12 +10738,13 @@ indicates failure. * Padding and other flags:: Pad with zeros, spaces, etc. * Setting the time:: Changing the system clock. * Options for date:: Instead of the current time. +* Date input formats:: Specifying date strings. * Examples of date:: Examples.  File: coreutils.info, Node: Time conversion specifiers, Next: Date conversion specifiers, Up: date invocation -21.1.1 Time conversion specifiers +22.3.1 Time conversion specifiers --------------------------------- `date' conversion specifiers related to times. @@ -9970,7 +10827,7 @@ File: coreutils.info, Node: Time conversion specifiers, Next: Date conversion  File: coreutils.info, Node: Date conversion specifiers, Next: Literal conversion specifiers, Prev: Time conversion specifiers, Up: date invocation -21.1.2 Date conversion specifiers +22.3.2 Date conversion specifiers --------------------------------- `date' conversion specifiers related to dates. @@ -10073,7 +10930,7 @@ File: coreutils.info, Node: Date conversion specifiers, Next: Literal conversi  File: coreutils.info, Node: Literal conversion specifiers, Next: Padding and other flags, Prev: Date conversion specifiers, Up: date invocation -21.1.3 Literal conversion specifiers +22.3.3 Literal conversion specifiers ------------------------------------ `date' conversion specifiers that produce literal strings. @@ -10090,7 +10947,7 @@ File: coreutils.info, Node: Literal conversion specifiers, Next: Padding and o  File: coreutils.info, Node: Padding and other flags, Next: Setting the time, Prev: Literal conversion specifiers, Up: date invocation -21.1.4 Padding and other flags +22.3.4 Padding and other flags ------------------------------ Unless otherwise specified, `date' normally pads numeric fields with @@ -10130,11 +10987,10 @@ Here are some examples of padding: => 1/ 2 As a GNU extension, you can specify the field width (after any flag, -if present) as a decimal number. If the natural size of the output is -of the field has less than the specified number of characters, the -result is written right adjusted and padded to the given size. For -example, `%9B' prints the right adjusted month name in a field of width -9. +if present) as a decimal number. If the natural size of the output of +the field has less than the specified number of characters, the result +is written right adjusted and padded to the given size. For example, +`%9B' prints the right adjusted month name in a field of width 9. An optional modifier can follow the optional flag and width specification. The modifiers are: @@ -10155,7 +11011,7 @@ is available, it is ignored.  File: coreutils.info, Node: Setting the time, Next: Options for date, Prev: Padding and other flags, Up: date invocation -21.1.5 Setting the time +22.3.5 Setting the time ----------------------- If given an argument that does not start with `+', `date' sets the @@ -10193,12 +11049,12 @@ following meaning: The `--set' option also sets the system clock; see the next section.  -File: coreutils.info, Node: Options for date, Next: Examples of date, Prev: Setting the time, Up: date invocation +File: coreutils.info, Node: Options for date, Prev: Setting the time, Up: date invocation -21.1.6 Options for `date' +22.3.6 Options for `date' ------------------------- -The program accepts the following options. Also see *Note Common +The program accepts the following options. Also see *note Common options::. `-d DATESTR' @@ -10209,8 +11065,12 @@ options::. `yesterday', etc. For example, `--date="2004-02-27 14:19:13.489392193 +0530"' specifies the instant of time that is 489,392,193 nanoseconds after February 27, 2004 at 2:19:13 PM in a - time zone that is 5 hours and 30 minutes east of UTC. *Note Date - input formats::. + time zone that is 5 hours and 30 minutes east of UTC. + Note: input currently must be in locale independent format. E.g., + the LC_TIME=C below is needed to print back the correct date in + many locales: + date -d "$(LC_TIME=C date)" + *Note Date input formats::. `-f DATEFILE' `--file=DATEFILE' @@ -10281,9 +11141,9 @@ options::. historical reasons.  -File: coreutils.info, Node: Examples of date, Prev: Options for date, Up: date invocation +File: coreutils.info, Node: Examples of date, Up: date invocation -21.1.7 Examples of `date' +22.3.7 Examples of `date' ------------------------- Here are a few examples. Also see the documentation for the `-d' @@ -10385,10 +11245,26 @@ option in the previous section. 2000-01-01 00:00:00 +0000 + +File: coreutils.info, Node: arch invocation, Next: date invocation, Up: System context + +22.4 `arch': Print machine hardware name +======================================== + +`arch' prints the machine hardware name, and is equivalent to `uname +-m'. Synopsis: + + arch [OPTION] + + The program accepts the *note Common options:: only. + + An exit status of zero indicates success, and a nonzero value +indicates failure. +  File: coreutils.info, Node: uname invocation, Next: hostname invocation, Prev: date invocation, Up: System context -21.2 `uname': Print system information +22.5 `uname': Print system information ====================================== `uname' prints information about the machine and operating system it is @@ -10410,7 +11286,7 @@ parsed reliably. In the following example, RELEASE is uname -a => Linux dum 2.2.18 #4 SMP Tue Jun 5 11:24:08 PDT 2001 i686 unknown unknown GNU/Linux - The program accepts the following options. Also see *Note Common + The program accepts the following options. Also see *note Common options::. `-a' @@ -10470,7 +11346,7 @@ indicates failure.  File: coreutils.info, Node: hostname invocation, Next: hostid invocation, Prev: uname invocation, Up: System context -21.3 `hostname': Print or set system name +22.6 `hostname': Print or set system name ========================================= With no arguments, `hostname' prints the name of the current host @@ -10487,9 +11363,9 @@ options::. indicates failure.  -File: coreutils.info, Node: hostid invocation, Prev: hostname invocation, Up: System context +File: coreutils.info, Node: hostid invocation, Next: uptime invocation, Prev: hostname invocation, Up: System context -21.4 `hostid': Print numeric host identifier. +22.7 `hostid': Print numeric host identifier. ============================================= `hostid' prints the numeric identifier of the current host in @@ -10508,9 +11384,37 @@ the system's Internet address, but that isn't always the case. indicates failure.  -File: coreutils.info, Node: Modified command invocation, Next: Process control, Prev: System context, Up: Top +File: coreutils.info, Node: uptime invocation, Prev: hostid invocation, Up: System context -22 Modified command invocation +22.8 `uptime': Print system uptime and load +=========================================== + +`uptime' prints the current time, the system's uptime, the number of +logged-in users and the current load average. + + If an argument is specified, it is used as the file to be read to +discover how many users are logged in. If no argument is specified, a +system default is used (`uptime --help' indicates the default setting). + + The only options are `--help' and `--version'. *Note Common +options::. + + For example, here's what it prints right now on one system I use: + + $ uptime + 14:07 up 3:35, 3 users, load average: 1.39, 1.15, 1.04 + + The precise method of calculation of load average varies somewhat +between systems. Some systems calculate it as the average number of +runnable processes over the last 1, 5 and 15 minutes, but some systems +also include processes in the uninterruptible sleep state (that is, +those processes which are waiting for disk I/O). The Linux kernel +includes uninterruptible processes. + + +File: coreutils.info, Node: Modified command invocation, Next: Process control, Prev: SELinux context, Up: Top + +23 Modified command invocation ****************************** This section describes commands that run other commands in some context @@ -10524,15 +11428,16 @@ user, etc. * nice invocation:: Modify niceness. * nohup invocation:: Immunize to hangups. * su invocation:: Modify user and group ID. +* timeout invocation:: Run with time limit.  File: coreutils.info, Node: chroot invocation, Next: env invocation, Up: Modified command invocation -22.1 `chroot': Run a command with a different root directory +23.1 `chroot': Run a command with a different root directory ============================================================ `chroot' runs a command with a specified root directory. On many -systems, only the super-user can do this. Synopses: +systems, only the super-user can do this.(1) Synopses: chroot NEWROOT [COMMAND [ARGS]...] chroot OPTION @@ -10579,10 +11484,18 @@ device files), copy them into place, too. 127 if COMMAND cannot be found the exit status of COMMAND otherwise + ---------- Footnotes ---------- + + (1) However, some systems (e.g., FreeBSD) can be configured to allow +certain regular users to use the `chroot' system call, and hence to run +this program. Also, on Cygwin, anyone can run the `chroot' command, +because the underlying function is non-privileged due to lack of +support in MS-Windows. +  File: coreutils.info, Node: env invocation, Next: nice invocation, Prev: chroot invocation, Up: Modified command invocation -22.2 `env': Run a command in a modified environment +23.2 `env': Run a command in a modified environment =================================================== `env' runs a command with a modified environment. Synopses: @@ -10597,11 +11510,10 @@ operands are evaluated left-to-right, so if two operands mention the same variable the earlier is ignored. Environment variable names can be empty, and can contain any -characters other than `=' and the null character (ASCII NUL). However, -it is wise to limit yourself to names that consist solely of -underscores, digits, and ASCII letters, and that begin with a -non-digit, as applications like the shell do not work well with other -names. +characters other than `=' and ASCII NUL. However, it is wise to limit +yourself to names that consist solely of underscores, digits, and ASCII +letters, and that begin with a non-digit, as applications like the +shell do not work well with other names. The first operand that does not contain the character `=' specifies the program to invoke; it is searched for according to the `PATH' @@ -10613,7 +11525,7 @@ to that program. The program should not be a special built-in utility specifications, the resulting environment is printed. This is like specifying the `printenv' program. - The program accepts the following options. Also see *Note Common + The program accepts the following options. Also see *note Common options::. Options must precede operands. `-u NAME' @@ -10639,7 +11551,7 @@ options::. Options must precede operands.  File: coreutils.info, Node: nice invocation, Next: nohup invocation, Prev: env invocation, Up: Modified command invocation -22.3 `nice': Run a command with modified niceness +23.3 `nice': Run a command with modified niceness ================================================= `nice' prints or modifies a process's "niceness", a parameter that @@ -10651,8 +11563,10 @@ affects whether the process is scheduled favorably. Synopsis: Otherwise, `nice' runs the given COMMAND with its niceness adjusted. By default, its niceness is incremented by 10. - Nicenesses range at least from -20 (resulting in the most favorable -scheduling) through 19 (the least favorable). Some systems may have a + Niceness values range at least from -20 (process has high priority +and gets more resources, thus slowing down other processes) through 19 +(process has lower priority and runs slowly itself, but has less impact +on the speed of other running processes). Some systems may have a wider range of nicenesses; conversely, other systems may enforce more restrictive limits. An attempt to set the niceness outside the supported range is treated as an attempt to use the minimum or maximum @@ -10671,11 +11585,12 @@ historical practice. COMMAND must not be a special built-in utility (*note Special built-in utilities::). - Because many shells have a built-in `nice' command, using an -unadorned `nice' in a script or interactively may get you different -functionality than that described here. + Due to shell aliases and built-in `nice' command, using an unadorned +`nice' interactively or in a script may get you different functionality +than that described here. Invoke it via `env' (i.e., `env nice ...') +to avoid interference from the shell. - The program accepts the following option. Also see *Note Common + The program accepts the following option. Also see *note Common options::. Options must precede operands. `-n ADJUSTMENT' @@ -10738,7 +11653,7 @@ specifying the maximum supported value:  File: coreutils.info, Node: nohup invocation, Next: su invocation, Prev: nice invocation, Up: Modified command invocation -22.4 `nohup': Run a command immune to hangups +23.4 `nohup': Run a command immune to hangups ============================================= `nohup' runs the given COMMAND with hangup signals ignored, so that the @@ -10766,6 +11681,11 @@ However, if standard output is closed, standard error terminal output is instead appended to the file `nohup.out' or `$HOME/nohup.out' as above. + To capture the command's output to a file other than `nohup.out' you +can redirect it. For example, to capture the output of `make': + + nohup make > make.log + `nohup' does not automatically put the command it runs in the background; you must do that explicitly, by ending the command line with an `&'. Also, `nohup' does not alter the niceness of COMMAND; use @@ -10784,9 +11704,9 @@ options::. Options must precede operands. the exit status of COMMAND otherwise  -File: coreutils.info, Node: su invocation, Prev: nohup invocation, Up: Modified command invocation +File: coreutils.info, Node: su invocation, Next: timeout invocation, Prev: nohup invocation, Up: Modified command invocation -22.5 `su': Run a command with substitute user and group ID +23.5 `su': Run a command with substitute user and group ID ========================================================== `su' allows one user to temporarily become another user. It runs a @@ -10817,7 +11737,7 @@ and optionally successful, `su' attempts. (If the system supports `syslog'.) However, GNU `su' does not check if the user is a member of the `wheel' group; see below. - The program accepts the following options. Also see *Note Common + The program accepts the following options. Also see *note Common options::. `-c COMMAND' @@ -10870,7 +11790,7 @@ options::. 127 if subshell cannot be found the exit status of the subshell otherwise -22.5.1 Why GNU `su' does not support the `wheel' group +23.5.1 Why GNU `su' does not support the `wheel' group ------------------------------------------------------ (This section is by Richard Stallman.) @@ -10892,10 +11812,57 @@ the rulers. used to supporting the bosses and sysadmins in whatever they do, you might find this idea strange at first. + +File: coreutils.info, Node: timeout invocation, Prev: su invocation, Up: Modified command invocation + +23.6 `timeout': Run a command with a time limit +=============================================== + +`timeout' runs the given COMMAND and kills it if it is still running +after the specified time interval. Synopsis: + + timeout [OPTION] NUMBER[smhd] COMMAND [ARG]... + + NUMBER is an integer followed by an optional unit; the default is +seconds. The units are: + +`s' + seconds + +`m' + minutes + +`h' + hours + +`d' + days + + COMMAND must not be a special built-in utility (*note Special +built-in utilities::). + + The program accepts the following option. Also see *note Common +options::. Options must precede operands. + +`-s SIGNAL' +`--signal=SIGNAL' + Send this SIGNAL to COMMAND on timeout, rather than the default + `TERM' signal. SIGNAL may be a name like `HUP' or a number. Also + see *Note Signal specifications::. + + + Exit status: + + 124 if COMMAND times out + 125 if `timeout' itself fails + 126 if COMMAND is found but cannot be invoked + 127 if COMMAND cannot be found + the exit status of COMMAND otherwise +  File: coreutils.info, Node: Process control, Next: Delaying, Prev: Modified command invocation, Up: Top -23 Process control +24 Process control ****************** * Menu: @@ -10905,7 +11872,7 @@ File: coreutils.info, Node: Process control, Next: Delaying, Prev: Modified c  File: coreutils.info, Node: kill invocation, Up: Process control -23.1 `kill': Send a signal to processes +24.1 `kill': Send a signal to processes ======================================= The `kill' command sends a signal to processes, causing them to @@ -10915,6 +11882,11 @@ Alternatively, it lists information about signals. Synopses: kill [-s SIGNAL | --signal SIGNAL | -SIGNAL] PID... kill [-l | --list | -t | --table] [SIGNAL]... + Due to shell aliases and built-in `kill' command, using an unadorned +`kill' interactively or in a script may get you different functionality +than that described here. Invoke it via `env' (i.e., `env kill ...') +to avoid interference from the shell. + The first form of the `kill' command sends a signal to all PID arguments. The default signal to send if none is specified is `TERM'. The special signal number `0' does not denote a valid signal, but can @@ -10961,109 +11933,14 @@ options. *Note Common options::. `1', or an exit status of a process terminated by the signal. A signal name can be given in canonical form or prefixed by `SIG'. The case of the letters is ignored, except for the `-SIGNAL' option which must use -upper case to avoid ambiguity with lower case option letters. The -following signal names and numbers are supported on all POSIX compliant -systems: - -`HUP' - 1. Hangup. - -`INT' - 2. Terminal interrupt. - -`QUIT' - 3. Terminal quit. - -`ABRT' - 6. Process abort. - -`KILL' - 9. Kill (cannot be caught or ignored). - -`ALRM' - 14. Alarm Clock. - -`TERM' - 15. Termination. - -Other supported signal names have system-dependent corresponding -numbers. All systems conforming to POSIX 1003.1-2001 also support the -following signals: - -`BUS' - Access to an undefined portion of a memory object. - -`CHLD' - Child process terminated, stopped, or continued. - -`CONT' - Continue executing, if stopped. - -`FPE' - Erroneous arithmetic operation. - -`ILL' - Illegal Instruction. - -`PIPE' - Write on a pipe with no one to read it. - -`SEGV' - Invalid memory reference. - -`STOP' - Stop executing (cannot be caught or ignored). - -`TSTP' - Terminal stop. - -`TTIN' - Background process attempting read. - -`TTOU' - Background process attempting write. - -`URG' - High bandwidth data is available at a socket. - -`USR1' - User-defined signal 1. - -`USR2' - User-defined signal 2. - -POSIX 1003.1-2001 systems that support the XSI extension also support -the following signals: - -`POLL' - Pollable event. - -`PROF' - Profiling timer expired. - -`SYS' - Bad system call. - -`TRAP' - Trace/breakpoint trap. - -`VTALRM' - Virtual timer expired. - -`XCPU' - CPU time limit exceeded. - -`XFSZ' - File size limit exceeded. - -POSIX 1003.1-2001 systems that support the XRT extension also support -at least eight real-time signals called `RTMIN', `RTMIN+1', ..., -`RTMAX-1', `RTMAX'. +upper case to avoid ambiguity with lower case option letters. For a +list of supported signal names and numbers see *Note Signal +specifications::.  File: coreutils.info, Node: Delaying, Next: Numeric operations, Prev: Process control, Up: Top -24 Delaying +25 Delaying *********** * Menu: @@ -11073,7 +11950,7 @@ File: coreutils.info, Node: Delaying, Next: Numeric operations, Prev: Process  File: coreutils.info, Node: sleep invocation, Up: Delaying -24.1 `sleep': Delay for a specified time +25.1 `sleep': Delay for a specified time ======================================== `sleep' pauses for an amount of time specified by the sum of the values @@ -11104,13 +11981,18 @@ period before any fractional digits). The only options are `--help' and `--version'. *Note Common options::. + Due to shell aliases and built-in `sleep' command, using an +unadorned `sleep' interactively or in a script may get you different +functionality than that described here. Invoke it via `env' (i.e., +`env sleep ...') to avoid interference from the shell. + An exit status of zero indicates success, and a nonzero value indicates failure.  File: coreutils.info, Node: Numeric operations, Next: File permissions, Prev: Delaying, Up: Top -25 Numeric operations +26 Numeric operations ********************* These programs do numerically-related operations. @@ -11123,7 +12005,7 @@ These programs do numerically-related operations.  File: coreutils.info, Node: factor invocation, Next: seq invocation, Up: Numeric operations -25.1 `factor': Print prime factors +26.1 `factor': Print prime factors ================================== `factor' prints prime factors. Synopses: @@ -11134,30 +12016,37 @@ File: coreutils.info, Node: factor invocation, Next: seq invocation, Up: Nume If no NUMBER is specified on the command line, `factor' reads numbers from standard input, delimited by newlines, tabs, or spaces. - The only options are `--help' and `--version'. *Note Common -options::. + The `factor' command supports only a small number of options: - The algorithm it uses is not very sophisticated, so for some inputs -`factor' runs for a long time. The hardest numbers to factor are the -products of large primes. Factoring the product of the two largest -32-bit prime numbers takes about 80 seconds of CPU time on a 1.6 GHz -Athlon. +`--help' + Print a short help on standard output, then exit without further + processing. - $ p=`echo '4294967279 * 4294967291'|bc` - $ factor $p - 18446743979220271189: 4294967279 4294967291 +`--version' + Print the program version on standard output, then exit without + further processing. - Similarly, it takes about 80 seconds for GNU factor (from -coreutils-5.1.2) to "factor" the largest 64-bit prime: + Factoring the product of the eighth and ninth Mersenne primes takes +about 30 milliseconds of CPU time on a 2.2 GHz Athlon. - $ factor 18446744073709551557 - 18446744073709551557: 18446744073709551557 + M8=`echo 2^31-1|bc` ; M9=`echo 2^61-1|bc` + /usr/bin/time -f '%U' factor $(echo "$M8 * $M9" | bc) + 4951760154835678088235319297: 2147483647 2305843009213693951 + 0.03 - In contrast, `factor' factors the largest 64-bit number in just over -a tenth of a second: + Similarly, factoring the eighth Fermat number 2^256+1 takes about 20 +seconds on the same machine. - $ factor `echo '2^64-1'|bc` - 18446744073709551615: 3 5 17 257 641 65537 6700417 + Factoring large prime numbers is, in general, hard. The Pollard Rho +algorithm used by `factor' is particularly effective for numbers with +relatively small factors. If you wish to factor large numbers which do +not have small factors (for example, numbers which are the product of +two large primes), other methods are far better. + + If `factor' is built without using GNU MP, only single-precision +arithmetic is available, and so large numbers (typically 2^64 and +above) will not be supported. The single-precision code uses an +algorithm which is designed for factoring smaller numbers. An exit status of zero indicates success, and a nonzero value indicates failure. @@ -11165,7 +12054,7 @@ indicates failure.  File: coreutils.info, Node: seq invocation, Prev: factor invocation, Up: Numeric operations -25.2 `seq': Print numeric sequences +26.2 `seq': Print numeric sequences =================================== `seq' prints a sequence of numbers to standard output. Synopses: @@ -11181,7 +12070,7 @@ FIRST also defaults to `1'. So `seq 1' prints `1', but `seq 0' and `seq 10 5' produce no output. Floating-point numbers may be specified (using a period before any fractional digits). - The program accepts the following options. Also see *Note Common + The program accepts the following options. Also see *note Common options::. Options must precede operands. `-f FORMAT' @@ -11240,9 +12129,9 @@ limitations on the length of an argument list: To generate octal output, use the printf `%o' format instead of `%x'. On most systems, seq can produce whole-number output for values up to -at least `2^53'. Larger integers are approximated. The details differ +at least 2^53. Larger integers are approximated. The details differ depending on your floating-point implementation, but a common case is -that `seq' works with integers through `2^64', and larger integers may +that `seq' works with integers through 2^64, and larger integers may not be numerically correct: $ seq 18446744073709551616 1 18446744073709551618 @@ -11250,29 +12139,14 @@ not be numerically correct: 18446744073709551616 18446744073709551618 - Be careful when using `seq' with a fractional INCREMENT; otherwise -you may see surprising results. Most people would expect to see -`0.000003' printed as the last number in this example: + Be careful when using `seq' with outlandish values: otherwise you +may see surprising results, as `seq' uses floating point internally. +For example, on the x86 platform, where the internal representation +uses a 64-bit fraction, the command: - $ seq -s ' ' 0 0.000001 0.000003 - 0.000000 0.000001 0.000002 + seq 1 0.0000000000000000001 1.0000000000000000009 - But that doesn't happen on many systems because `seq' is implemented -using binary floating point arithmetic (via the C `long double' -type)--which means decimal fractions like `0.000001' cannot be -represented exactly. That in turn means some nonintuitive conditions -like `0.000001 * 3 > 0.000003' will end up being true. - - To work around that in the above example, use a slightly larger -number as the LAST value: - - $ seq -s ' ' 0 0.000001 0.0000031 - 0.000000 0.000001 0.000002 0.000003 - - In general, when using an INCREMENT with a fractional part, where -(LAST - FIRST) / INCREMENT is (mathematically) a whole number, specify -a slightly larger (or smaller, if INCREMENT is negative) value for LAST -to ensure that LAST is the final value printed by seq. + outputs 1.0000000000000000007 twice and skips 1.0000000000000000008. An exit status of zero indicates success, and a nonzero value indicates failure. @@ -11280,7 +12154,7 @@ indicates failure.  File: coreutils.info, Node: File permissions, Next: Date input formats, Prev: Numeric operations, Up: Top -26 File permissions +27 File permissions ******************* Each file has a set of "file mode bits" that control the kinds of @@ -11297,7 +12171,7 @@ symbolic form or as an octal number.  File: coreutils.info, Node: Mode Structure, Next: Symbolic Modes, Up: File permissions -26.1 Structure of File Mode Bits +27.1 Structure of File Mode Bits ================================ The file mode bits have two parts: the "file permission bits", which @@ -11387,7 +12261,7 @@ a+w FILE'.  File: coreutils.info, Node: Symbolic Modes, Next: Numeric Modes, Prev: Mode Structure, Up: File permissions -26.2 Symbolic Modes +27.2 Symbolic Modes =================== "Symbolic modes" represent changes to files' mode bits as operations on @@ -11418,7 +12292,7 @@ symbolic modes.  File: coreutils.info, Node: Setting Permissions, Next: Copying Permissions, Up: Symbolic Modes -26.2.1 Setting Permissions +27.2.1 Setting Permissions -------------------------- The basic symbolic operations on a file's permissions are adding, @@ -11508,7 +12382,7 @@ Another way to specify the same thing is:  File: coreutils.info, Node: Copying Permissions, Next: Changing Special Mode Bits, Prev: Setting Permissions, Up: Symbolic Modes -26.2.2 Copying Existing Permissions +27.2.2 Copying Existing Permissions ----------------------------------- You can base a file's permissions on its existing permissions. To do @@ -11527,7 +12401,7 @@ to mode 666 (`rw-rw-rw-'). If the file had started out as mode 741  File: coreutils.info, Node: Changing Special Mode Bits, Next: Conditional Executability, Prev: Copying Permissions, Up: Symbolic Modes -26.2.3 Changing Special Mode Bits +27.2.3 Changing Special Mode Bits --------------------------------- In addition to changing a file's read, write, and execute/search @@ -11583,7 +12457,7 @@ set-user-ID and set-group-ID bits and directories.  File: coreutils.info, Node: Conditional Executability, Next: Multiple Changes, Prev: Changing Special Mode Bits, Up: Symbolic Modes -26.2.4 Conditional Executability +27.2.4 Conditional Executability -------------------------------- There is one more special type of symbolic permission: if you use `X' @@ -11600,7 +12474,7 @@ anyone could execute them before.  File: coreutils.info, Node: Multiple Changes, Next: Umask and Protection, Prev: Conditional Executability, Up: Symbolic Modes -26.2.5 Making Multiple Changes +27.2.5 Making Multiple Changes ------------------------------ The format of symbolic modes is actually more complex than described @@ -11651,7 +12525,7 @@ different ways; another is:  File: coreutils.info, Node: Umask and Protection, Prev: Multiple Changes, Up: Symbolic Modes -26.2.6 The Umask and Protection +27.2.6 The Umask and Protection ------------------------------- If the USERS part of a symbolic mode is omitted, it defaults to `a' @@ -11682,7 +12556,7 @@ users.  File: coreutils.info, Node: Numeric Modes, Next: Directory Setuid and Setgid, Prev: Symbolic Modes, Up: File permissions -26.3 Numeric Modes +27.3 Numeric Modes ================== As an alternative to giving a symbolic mode, you can give an octal @@ -11733,7 +12607,7 @@ the lowest valued bit:  File: coreutils.info, Node: Directory Setuid and Setgid, Prev: Numeric Modes, Up: File permissions -26.4 Directories and the Set-User-ID and Set-Group-ID Bits +27.4 Directories and the Set-User-ID and Set-Group-ID Bits ========================================================== On most systems, if a directory's set-group-ID bit is set, newly @@ -11790,7 +12664,7 @@ implementations to ignore these requests.  File: coreutils.info, Node: Date input formats, Next: Opening the software toolbox, Prev: File permissions, Up: Top -27 Date input formats +28 Date input formats ********************* First, a quote: @@ -11840,7 +12714,7 @@ function) is not described here.  File: coreutils.info, Node: General date syntax, Next: Calendar date items, Up: Date input formats -27.1 General date syntax +28.1 General date syntax ======================== A "date" is a string, possibly empty, containing many items separated @@ -11914,7 +12788,7 @@ second.  File: coreutils.info, Node: Calendar date items, Next: Time of day items, Prev: General date syntax, Up: Date input formats -27.2 Calendar date items +28.2 Calendar date items ======================== A "calendar date item" specifies a day of the year. It is specified @@ -11970,7 +12844,7 @@ any of the following:  File: coreutils.info, Node: Time of day items, Next: Time zone items, Prev: Calendar date items, Up: Date input formats -27.3 Time of day items +28.3 Time of day items ====================== A "time of day item" in date strings specifies the time on a given day. @@ -11999,15 +12873,16 @@ derived from Latin which uses `12m' for noon and `12pm' for midnight.) The time may alternatively be followed by a time zone correction, expressed as `SHHMM', where S is `+' or `-', HH is a number of zone -hours and MM is a number of zone minutes. You can also separate HH -from MM with a colon. When a time zone correction is given this way, it -forces interpretation of the time relative to Coordinated Universal -Time (UTC), overriding any previous specification for the time zone or -the local time zone. For example, `+0530' and `+05:30' both stand for -the time zone 5.5 hours ahead of UTC (e.g., India). The MINUTE part of -the time of day may not be elided when a time zone correction is used. -This is the best way to specify a time zone correction by fractional -parts of an hour. +hours and MM is a number of zone minutes. The zone minutes term, MM, +may be omitted, in which case the one- or two-digit correction is +interpreted as a number of hours. You can also separate HH from MM +with a colon. When a time zone correction is given this way, it forces +interpretation of the time relative to Coordinated Universal Time +(UTC), overriding any previous specification for the time zone or the +local time zone. For example, `+0530' and `+05:30' both stand for the +time zone 5.5 hours ahead of UTC (e.g., India). This is the best way to +specify a time zone correction by fractional parts of an hour. The +maximum zone correction is 24 hours. Either `am'/`pm' or a time zone correction may be specified, but not both. @@ -12015,7 +12890,7 @@ both.  File: coreutils.info, Node: Time zone items, Next: Day of week items, Prev: Time of day items, Up: Date input formats -27.4 Time zone items +28.4 Time zone items ==================== A "time zone item" specifies an international time zone, indicated by a @@ -12041,7 +12916,7 @@ time stamps are interpreted using the rules of the default time zone  File: coreutils.info, Node: Day of week items, Next: Relative items in date strings, Prev: Time zone items, Up: Date input formats -27.5 Day of week items +28.5 Day of week items ====================== The explicit mention of a day of the week will forward the date (only @@ -12064,7 +12939,7 @@ represent.  File: coreutils.info, Node: Relative items in date strings, Next: Pure numbers in date strings, Prev: Day of week items, Up: Date input formats -27.6 Relative items in date strings +28.6 Relative items in date strings =================================== "Relative items" adjust a date (or the current date if none) forward or @@ -12128,7 +13003,7 @@ before embarking on calendrical calculations.  File: coreutils.info, Node: Pure numbers in date strings, Next: Seconds since the Epoch, Prev: Relative items in date strings, Up: Date input formats -27.7 Pure numbers in date strings +28.7 Pure numbers in date strings ================================= The precise interpretation of a pure decimal number depends on the @@ -12151,7 +13026,7 @@ overrides the year.  File: coreutils.info, Node: Seconds since the Epoch, Next: Specifying time zone rules, Prev: Pure numbers in date strings, Up: Date input formats -27.8 Seconds since the Epoch +28.8 Seconds since the Epoch ============================ If you precede a number with `@', it represents an internal time stamp @@ -12183,7 +13058,7 @@ way to represent the intervening leap second 1998-12-31 23:59:60 UTC.  File: coreutils.info, Node: Specifying time zone rules, Next: Authors of get_date, Prev: Seconds since the Epoch, Up: Date input formats -27.9 Specifying time zone rules +28.9 Specifying time zone rules =============================== Normally, dates are interpreted using the rules of the current time @@ -12231,7 +13106,7 @@ Variable.  File: coreutils.info, Node: Authors of get_date, Prev: Specifying time zone rules, Up: Date input formats -27.10 Authors of `get_date' +28.10 Authors of `get_date' =========================== `get_date' was originally implemented by Steven M. Bellovin @@ -12247,9 +13122,9 @@ and others. edited by K. Berry ().  -File: coreutils.info, Node: Opening the software toolbox, Next: Copying This Manual, Prev: Date input formats, Up: Top +File: coreutils.info, Node: Opening the software toolbox, Next: GNU Free Documentation License, Prev: Date input formats, Up: Top -28 Opening the Software Toolbox +29 Opening the Software Toolbox ******************************* An earlier version of this chapter appeared in 2 (June 1994). It was @@ -12680,7 +13555,7 @@ spelling checker! To determine if you've spelled a word correctly, all you have to do is look it up in a dictionary. If it is not there, then chances are that your spelling is incorrect. So, we need a dictionary. The conventional location for a dictionary is `/usr/dict/words'. On my -GNU/Linux system,(1) this is a is a sorted, 45,402 word dictionary. +GNU/Linux system,(1) this is a sorted, 45,402 word dictionary. Now, how to compare our file with the dictionary? As before, we generate a sorted list of words, one per line: @@ -12785,25 +13660,15 @@ this column. (1) Redhat Linux 6.1, for the November 2000 revision of this article.  -File: coreutils.info, Node: Copying This Manual, Next: Index, Prev: Opening the software toolbox, Up: Top +File: coreutils.info, Node: GNU Free Documentation License, Next: Concept index, Prev: Opening the software toolbox, Up: Top -Appendix A Copying This Manual -****************************** +Appendix A GNU Free Documentation License +***************************************** -* Menu: + Version 1.3, 3 November 2008 -* GNU Free Documentation License:: License for copying this manual. - - -File: coreutils.info, Node: GNU Free Documentation License, Up: Copying This Manual - -A.1 GNU Free Documentation License -================================== - - Version 1.2, November 2002 - - Copyright (C) 2000,2001,2002 Free Software Foundation, Inc. - 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + Copyright (C) 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc. + `http://fsf.org/' Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. @@ -12905,6 +13770,9 @@ A.1 GNU Free Documentation License Page" means the text near the most prominent appearance of the work's title, preceding the beginning of the body of the text. + The "publisher" means any person or entity that distributes copies + of the Document to the public. + A section "Entitled XYZ" means a named subunit of the Document whose title either is precisely XYZ or contains XYZ in parentheses following text that translates XYZ in another language. (Here XYZ @@ -13170,12 +14038,29 @@ A.1 GNU Free Documentation License 9. TERMINATION You may not copy, modify, sublicense, or distribute the Document - except as expressly provided for under this License. Any other - attempt to copy, modify, sublicense or distribute the Document is - void, and will automatically terminate your rights under this - License. However, parties who have received copies, or rights, - from you under this License will not have their licenses - terminated so long as such parties remain in full compliance. + except as expressly provided under this License. Any attempt + otherwise to copy, modify, sublicense, or distribute it is void, + and will automatically terminate your rights under this License. + + However, if you cease all violation of this License, then your + license from a particular copyright holder is reinstated (a) + provisionally, unless and until the copyright holder explicitly + and finally terminates your license, and (b) permanently, if the + copyright holder fails to notify you of the violation by some + reasonable means prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is + reinstated permanently if the copyright holder notifies you of the + violation by some reasonable means, this is the first time you have + received notice of violation of this License (for any work) from + that copyright holder, and you cure the violation prior to 30 days + after your receipt of the notice. + + Termination of your rights under this section does not terminate + the licenses of parties who have received copies or rights from + you under this License. If your rights have been terminated and + not permanently reinstated, receipt of a copy of some or all of + the same material does not give you any rights to use it. 10. FUTURE REVISIONS OF THIS LICENSE @@ -13193,7 +14078,41 @@ A.1 GNU Free Documentation License published (not as a draft) by the Free Software Foundation. If the Document does not specify a version number of this License, you may choose any version ever published (not as a draft) by the - Free Software Foundation. + Free Software Foundation. If the Document specifies that a proxy + can decide which future versions of this License can be used, that + proxy's public statement of acceptance of a version permanently + authorizes you to choose that version for the Document. + + 11. RELICENSING + + "Massive Multiauthor Collaboration Site" (or "MMC Site") means any + World Wide Web server that publishes copyrightable works and also + provides prominent facilities for anybody to edit those works. A + public wiki that anybody can edit is an example of such a server. + A "Massive Multiauthor Collaboration" (or "MMC") contained in the + site means any set of copyrightable works thus published on the MMC + site. + + "CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0 + license published by Creative Commons Corporation, a not-for-profit + corporation with a principal place of business in San Francisco, + California, as well as future copyleft versions of that license + published by that same organization. + + "Incorporate" means to publish or republish a Document, in whole or + in part, as part of another Document. + + An MMC is "eligible for relicensing" if it is licensed under this + License, and if all works that were first published under this + License somewhere other than this MMC, and subsequently + incorporated in whole or in part into the MMC, (1) had no cover + texts or invariant sections, and (2) were thus incorporated prior + to November 1, 2008. + + The operator of an MMC Site may republish an MMC contained in the + site under CC-BY-SA on the same site at any time before August 1, + 2009, provided the MMC is eligible for relicensing. + ADDENDUM: How to use this License for your documents ==================================================== @@ -13204,7 +14123,7 @@ notices just after the title page: Copyright (C) YEAR YOUR NAME. Permission is granted to copy, distribute and/or modify this document - under the terms of the GNU Free Documentation License, Version 1.2 + under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled ``GNU @@ -13227,7 +14146,7 @@ free software license, such as the GNU General Public License, to permit their use in free software.  -File: coreutils.info, Node: Index, Prev: Copying This Manual, Up: Top +File: coreutils.info, Node: Concept index, Prev: GNU Free Documentation License, Up: Top Index ***** @@ -13238,26 +14157,26 @@ Index * !: Connectives for test. (line 9) * !=: String tests. (line 25) -* %: Numeric expressions. (line 15) -* %b: printf invocation. (line 32) +* %: Numeric expressions. (line 16) +* %b: printf invocation. (line 38) * &: Relations for expr. (line 17) -* *: Numeric expressions. (line 15) -* + <1>: Numeric expressions. (line 11) +* *: Numeric expressions. (line 16) +* + <1>: Numeric expressions. (line 12) * +: String expressions. (line 53) -* +PAGE_RANGE: pr invocation. (line 60) +* +PAGE_RANGE: pr invocation. (line 58) * - <1>: su invocation. (line 53) -* - <2>: env invocation. (line 45) -* -: Numeric expressions. (line 11) +* - <2>: env invocation. (line 44) +* -: Numeric expressions. (line 12) * - and Unix rm: rm invocation. (line 110) * -, removing files beginning with: rm invocation. (line 98) -* --: Common options. (line 36) -* --across: pr invocation. (line 84) +* --: Common options. (line 44) +* --across: pr invocation. (line 82) * --address-radix: od invocation. (line 36) -* --adjustment: nice invocation. (line 44) +* --adjustment: nice invocation. (line 47) * --all <1>: uname invocation. (line 30) * --all <2>: who invocation. (line 36) * --all <3>: stty invocation. (line 26) -* --all <4>: du invocation. (line 21) +* --all <4>: du invocation. (line 26) * --all <5>: df invocation. (line 32) * --all <6>: Which files are listed. (line 13) @@ -13265,36 +14184,37 @@ Index * --all-repeated: uniq invocation. (line 69) * --almost-all: Which files are listed. (line 17) -* --apparent-size: du invocation. (line 24) +* --apparent-size: du invocation. (line 29) * --append: tee invocation. (line 25) -* --archive: cp invocation. (line 54) +* --archive: cp invocation. (line 65) * --author: What information is listed. (line 10) -* --backup <1>: ln invocation. (line 55) -* --backup <2>: mv invocation. (line 50) -* --backup <3>: install invocation. (line 40) -* --backup <4>: cp invocation. (line 61) +* --backup <1>: ln invocation. (line 77) +* --backup <2>: mv invocation. (line 56) +* --backup <3>: install invocation. (line 42) +* --backup <4>: cp invocation. (line 75) * --backup: Backup options. (line 13) +* --batch-size: sort invocation. (line 238) * --before: tac invocation. (line 21) * --binary: md5sum invocation. (line 38) -* --block-size <1>: du invocation. (line 45) +* --block-size <1>: du invocation. (line 50) * --block-size <2>: df invocation. (line 38) * --block-size: Block size. (line 138) * --block-size=SIZE: Block size. (line 12) * --body-numbering: nl invocation. (line 47) * --boot: who invocation. (line 40) * --bourne-shell: dircolors invocation. - (line 27) -* --buffer-size: sort invocation. (line 237) -* --bytes <1>: du invocation. (line 41) + (line 34) +* --buffer-size: sort invocation. (line 288) +* --bytes <1>: du invocation. (line 46) * --bytes <2>: cut invocation. (line 26) -* --bytes <3>: wc invocation. (line 41) -* --bytes <4>: split invocation. (line 37) -* --bytes <5>: tail invocation. (line 36) +* --bytes <3>: wc invocation. (line 43) +* --bytes <4>: split invocation. (line 33) +* --bytes <5>: tail invocation. (line 32) * --bytes <6>: head invocation. (line 24) * --bytes: fold invocation. (line 23) * --c-shell: dircolors invocation. - (line 33) + (line 40) * --canonicalize: readlink invocation. (line 29) * --canonicalize-existing: readlink invocation. (line 35) * --canonicalize-missing: readlink invocation. (line 41) @@ -13302,175 +14222,191 @@ Index * --changes <2>: chgrp invocation. (line 20) * --changes: chown invocation. (line 70) * --characters: cut invocation. (line 34) -* --chars: wc invocation. (line 45) +* --chars: wc invocation. (line 47) * --check: sort invocation. (line 18) -* --check-chars: uniq invocation. (line 103) +* --check-chars: uniq invocation. (line 106) * --classify: General output formatting. (line 36) * --color: General output formatting. (line 21) -* --columns: pr invocation. (line 70) +* --columns: pr invocation. (line 68) * --command: su invocation. (line 39) +* --compare: fmt invocation. (line 34) * --complement: cut invocation. (line 71) -* --count <1>: who invocation. (line 55) +* --compute: runcon invocation. (line 27) +* --context <1>: id invocation. (line 45) +* --context <2>: mknod invocation. (line 54) +* --context <3>: mkfifo invocation. (line 28) +* --context <4>: mkdir invocation. (line 56) +* --context <5>: install invocation. (line 126) +* --context: What information is listed. + (line 268) +* --count <1>: who invocation. (line 70) * --count: uniq invocation. (line 55) -* --count-links: du invocation. (line 91) -* --crown-margin: fmt invocation. (line 34) +* --count-links: du invocation. (line 96) +* --crown-margin: fmt invocation. (line 41) * --csh: dircolors invocation. - (line 33) + (line 40) * --date <1>: Options for date. (line 11) * --date: touch invocation. (line 58) * --dead: who invocation. (line 44) -* --decode: base64 invocation. (line 29) +* --decode: base64 invocation. (line 30) * --delimiter: cut invocation. (line 51) * --delimiters: paste invocation. (line 43) -* --dereference <1>: stat invocation. (line 17) -* --dereference <2>: du invocation. (line 96) +* --dereference <1>: stat invocation. (line 22) +* --dereference <2>: du invocation. (line 101) * --dereference <3>: chgrp invocation. (line 30) * --dereference <4>: chown invocation. (line 103) -* --dereference <5>: cp invocation. (line 125) +* --dereference <5>: cp invocation. (line 143) * --dereference: Which files are listed. - (line 83) -* --dereference-args: du invocation. (line 56) + (line 84) +* --dereference-args: du invocation. (line 61) * --dereference-command-line: Which files are listed. (line 36) * --dereference-command-line-symlink-to-dir: Which files are listed. (line 41) * --dictionary-order: sort invocation. (line 85) * --digits: csplit invocation. (line 80) -* --directory <1>: ln invocation. (line 61) -* --directory <2>: install invocation. (line 48) +* --directory <1>: ln invocation. (line 83) +* --directory <2>: install invocation. (line 55) * --directory: Which files are listed. (line 28) * --dired: What information is listed. (line 16) -* --double-space: pr invocation. (line 96) +* --double-space: pr invocation. (line 94) * --echo: shuf invocation. (line 19) * --elide-empty-files: csplit invocation. (line 89) * --escape: Formatting the file names. (line 11) -* --exact: shred invocation. (line 133) -* --exclude-from=FILE: du invocation. (line 201) -* --exclude-type: df invocation. (line 138) -* --exclude=PATTERN: du invocation. (line 195) -* --expand-tabs: pr invocation. (line 120) +* --exact: shred invocation. (line 134) +* --exclude-from=FILE: du invocation. (line 211) +* --exclude-type: df invocation. (line 144) +* --exclude=PATTERN: du invocation. (line 205) +* --expand-tabs: pr invocation. (line 118) * --fast: su invocation. (line 44) -* --field-separator: sort invocation. (line 253) +* --field-separator: sort invocation. (line 304) * --fields: cut invocation. (line 44) -* --file <1>: Options for date. (line 22) +* --file <1>: Options for date. (line 26) * --file: stty invocation. (line 31) -* --file-system: stat invocation. (line 23) +* --file-system: stat invocation. (line 28) * --file-type: General output formatting. (line 47) -* --files0-from=FILE <1>: du invocation. (line 62) -* --files0-from=FILE: wc invocation. (line 60) -* --first-line-number: pr invocation. (line 198) -* --follow: tail invocation. (line 41) +* --files0-from=FILE <1>: du invocation. (line 67) +* --files0-from=FILE <2>: sort invocation. (line 206) +* --files0-from=FILE: wc invocation. (line 62) +* --first-line-number: pr invocation. (line 194) +* --follow: tail invocation. (line 47) * --footer-numbering: nl invocation. (line 75) -* --force <1>: ln invocation. (line 67) +* --force <1>: ln invocation. (line 89) * --force <2>: shred invocation. (line 101) * --force <3>: rm invocation. (line 35) -* --force <4>: mv invocation. (line 55) -* --force: cp invocation. (line 96) -* --form-feed: pr invocation. (line 128) +* --force <4>: mv invocation. (line 61) +* --force: cp invocation. (line 110) +* --form-feed: pr invocation. (line 126) * --format <1>: General output formatting. (line 10) * --format <2>: What information is listed. - (line 130) -* --format: od invocation. (line 76) + (line 131) +* --format: od invocation. (line 85) * --format=FORMAT <1>: seq invocation. (line 24) -* --format=FORMAT: stat invocation. (line 28) +* --format=FORMAT: stat invocation. (line 33) * --from: chown invocation. (line 80) * --full-time: What information is listed. (line 100) -* --general-numeric-sort: sort invocation. (line 98) +* --general-numeric-sort: sort invocation. (line 103) * --group <1>: id invocation. (line 23) -* --group: install invocation. (line 54) +* --group: install invocation. (line 61) * --group-directories-first: Which files are listed. (line 50) * --groups: id invocation. (line 27) * --hardware-platform: uname invocation. (line 35) -* --head-lines: shuf invocation. (line 32) -* --header: pr invocation. (line 134) +* --head-count: shuf invocation. (line 32) +* --header: pr invocation. (line 131) * --header-numbering: nl invocation. (line 79) * --heading: who invocation. (line 48) -* --help: Common options. (line 29) +* --help: Common options. (line 37) * --hide-control-chars: Formatting the file names. (line 23) * --hide=PATTERN: Which files are listed. - (line 56) -* --human-readable <1>: du invocation. (line 75) -* --human-readable <2>: df invocation. (line 43) + (line 57) +* --human-readable <1>: du invocation. (line 81) +* --human-readable <2>: df invocation. (line 48) * --human-readable <3>: What information is listed. (line 116) * --human-readable: Block size. (line 138) * --ignore-backups: Which files are listed. (line 23) -* --ignore-case <1>: join invocation. (line 69) +* --ignore-case <1>: join invocation. (line 89) * --ignore-case <2>: uniq invocation. (line 59) * --ignore-case: sort invocation. (line 92) -* --ignore-environment: env invocation. (line 45) +* --ignore-environment: env invocation. (line 44) * --ignore-fail-on-non-empty: rmdir invocation. (line 17) -* --ignore-garbage: base64 invocation. (line 35) +* --ignore-garbage: base64 invocation. (line 36) * --ignore-interrupts: tee invocation. (line 30) * --ignore-leading-blanks: sort invocation. (line 79) -* --ignore-nonprinting: sort invocation. (line 125) +* --ignore-nonprinting: sort invocation. (line 130) * --ignore=PATTERN: Which files are listed. - (line 69) -* --indent: pr invocation. (line 204) + (line 70) +* --indent: pr invocation. (line 200) * --indicator-style: General output formatting. (line 36) * --initial: expand invocation. (line 34) * --inode: What information is listed. - (line 122) -* --inodes: df invocation. (line 52) + (line 123) +* --inodes: df invocation. (line 58) * --input-range: shuf invocation. (line 23) -* --interactive <1>: ln invocation. (line 71) +* --interactive <1>: ln invocation. (line 93) * --interactive <2>: rm invocation. (line 50) -* --interactive <3>: mv invocation. (line 59) -* --interactive: cp invocation. (line 116) +* --interactive <3>: mv invocation. (line 67) +* --interactive: cp invocation. (line 133) +* --io-blocks: truncate invocation. (line 26) * --iterations=NUMBER: shred invocation. (line 106) * --join-blank-lines: nl invocation. (line 87) -* --join-lines: pr invocation. (line 147) +* --join-lines: pr invocation. (line 144) * --keep-files: csplit invocation. (line 85) * --kernel-name: uname invocation. (line 65) * --kernel-release: uname invocation. (line 61) * --kernel-version: uname invocation. (line 76) -* --key: sort invocation. (line 193) -* --length: pr invocation. (line 156) -* --line-bytes: split invocation. (line 43) -* --lines <1>: wc invocation. (line 53) -* --lines <2>: split invocation. (line 30) -* --lines <3>: tail invocation. (line 130) -* --lines: head invocation. (line 30) -* --link: cp invocation. (line 121) +* --key: sort invocation. (line 219) +* --length: pr invocation. (line 153) +* --line-bytes: split invocation. (line 46) +* --lines <1>: wc invocation. (line 55) +* --lines <2>: split invocation. (line 26) +* --lines <3>: tail invocation. (line 136) +* --lines: head invocation. (line 39) +* --link: cp invocation. (line 139) * --literal: Formatting the file names. (line 17) -* --local: df invocation. (line 63) +* --local: df invocation. (line 69) +* --logical: pwd invocation. (line 15) * --login <1>: su invocation. (line 53) -* --login: who invocation. (line 68) -* --lookup: who invocation. (line 73) +* --login: who invocation. (line 52) +* --lookup: who invocation. (line 57) * --machine: uname invocation. (line 41) -* --max-depth=DEPTH: du invocation. (line 111) -* --max-line-length: wc invocation. (line 57) -* --max-unchanged-stats: tail invocation. (line 118) +* --max-depth=DEPTH: du invocation. (line 116) +* --max-line-length: wc invocation. (line 59) +* --max-unchanged-stats: tail invocation. (line 124) * --merge <1>: sort invocation. (line 32) -* --merge: pr invocation. (line 164) -* --mesg: who invocation. (line 86) -* --message: who invocation. (line 86) -* --mode <1>: mknod invocation. (line 43) +* --merge: pr invocation. (line 160) +* --mesg: who invocation. (line 95) +* --message: who invocation. (line 95) +* --mode <1>: mknod invocation. (line 48) * --mode <2>: mkfifo invocation. (line 21) * --mode <3>: mkdir invocation. (line 19) -* --mode: install invocation. (line 60) -* --month-sort: sort invocation. (line 131) +* --mode: install invocation. (line 67) +* --month-sort: sort invocation. (line 137) * --name: id invocation. (line 31) +* --no-clobber <1>: mv invocation. (line 74) +* --no-clobber: cp invocation. (line 147) +* --no-create <1>: truncate invocation. (line 22) * --no-create: touch invocation. (line 54) -* --no-dereference <1>: du invocation. (line 107) -* --no-dereference <2>: chgrp invocation. (line 35) -* --no-dereference <3>: chown invocation. (line 108) -* --no-dereference <4>: ln invocation. (line 75) -* --no-dereference: cp invocation. (line 129) -* --no-file-warnings: pr invocation. (line 211) +* --no-dereference <1>: chcon invocation. (line 22) +* --no-dereference <2>: du invocation. (line 112) +* --no-dereference <3>: chgrp invocation. (line 35) +* --no-dereference <4>: chown invocation. (line 108) +* --no-dereference <5>: ln invocation. (line 97) +* --no-dereference: cp invocation. (line 153) +* --no-file-warnings: pr invocation. (line 207) * --no-group: What information is listed. (line 110) * --no-newline: readlink invocation. (line 46) @@ -13479,230 +14415,253 @@ Index * --no-preserve-root <3>: chown invocation. (line 121) * --no-preserve-root: rm invocation. (line 84) * --no-renumber: nl invocation. (line 108) -* --no-sync: df invocation. (line 67) -* --no-target-directory <1>: ln invocation. (line 109) -* --no-target-directory <2>: mv invocation. (line 103) -* --no-target-directory <3>: install invocation. (line 101) -* --no-target-directory <4>: cp invocation. (line 272) +* --no-sync: df invocation. (line 73) +* --no-target-directory <1>: ln invocation. (line 131) +* --no-target-directory <2>: mv invocation. (line 107) +* --no-target-directory <3>: install invocation. (line 117) +* --no-target-directory <4>: cp invocation. (line 303) * --no-target-directory: Target directory. (line 15) * --nodename: uname invocation. (line 46) -* --null: du invocation. (line 117) +* --null: du invocation. (line 122) * --number: cat invocation. (line 31) * --number-format: nl invocation. (line 95) -* --number-lines: pr invocation. (line 177) +* --number-lines: pr invocation. (line 173) * --number-nonblank: cat invocation. (line 20) * --number-separator: nl invocation. (line 112) * --number-width: nl invocation. (line 122) -* --numeric-sort: sort invocation. (line 140) -* --numeric-suffixes: split invocation. (line 51) +* --numeric-sort: sort invocation. (line 147) +* --numeric-suffixes: split invocation. (line 57) * --numeric-uid-gid: What information is listed. - (line 232) -* --omit-header: pr invocation. (line 235) -* --omit-pagination: pr invocation. (line 246) -* --one-file-system <1>: du invocation. (line 191) + (line 234) +* --omit-header: pr invocation. (line 231) +* --omit-pagination: pr invocation. (line 242) +* --one-file-system <1>: du invocation. (line 201) * --one-file-system <2>: rm invocation. (line 63) -* --one-file-system: cp invocation. (line 291) +* --one-file-system: cp invocation. (line 322) * --only-delimited: cut invocation. (line 59) * --operating-system: uname invocation. (line 57) * --output <1>: shuf invocation. (line 37) -* --output: sort invocation. (line 213) +* --output: sort invocation. (line 264) * --output-delimiter: cut invocation. (line 64) -* --output-duplicates: od invocation. (line 146) -* --output-tabs: pr invocation. (line 140) -* --owner: install invocation. (line 72) +* --output-duplicates: od invocation. (line 155) +* --output-tabs: pr invocation. (line 137) +* --owner: install invocation. (line 79) * --page-increment: nl invocation. (line 83) -* --page_width: pr invocation. (line 264) -* --pages=PAGE_RANGE: pr invocation. (line 60) +* --page_width: pr invocation. (line 260) +* --pages=PAGE_RANGE: pr invocation. (line 58) * --parents <1>: rmdir invocation. (line 22) * --parents <2>: mkdir invocation. (line 34) -* --parents: cp invocation. (line 177) -* --pid: tail invocation. (line 98) +* --parents: cp invocation. (line 217) +* --physical: pwd invocation. (line 22) +* --pid: tail invocation. (line 104) * --portability <1>: pathchk invocation. (line 46) -* --portability: df invocation. (line 74) +* --portability: df invocation. (line 80) * --prefix: csplit invocation. (line 62) -* --preserve: cp invocation. (line 134) +* --preserve: cp invocation. (line 160) +* --preserve-context: install invocation. (line 84) * --preserve-environment: su invocation. (line 64) * --preserve-root <1>: chmod invocation. (line 49) * --preserve-root <2>: chgrp invocation. (line 43) * --preserve-root <3>: chown invocation. (line 116) * --preserve-root: rm invocation. (line 79) -* --preserve-timestamps: install invocation. (line 78) +* --preserve-timestamps: install invocation. (line 91) * --print-database: dircolors invocation. - (line 38) -* --print-type: df invocation. (line 113) -* --printf=FORMAT: stat invocation. (line 37) + (line 45) +* --print-type: df invocation. (line 119) +* --printf=FORMAT: stat invocation. (line 42) +* --process: who invocation. (line 66) * --processor: uname invocation. (line 50) * --quiet <1>: tty invocation. (line 18) * --quiet <2>: chmod invocation. (line 45) * --quiet <3>: chgrp invocation. (line 26) * --quiet <4>: chown invocation. (line 76) * --quiet <5>: readlink invocation. (line 52) -* --quiet <6>: csplit invocation. (line 100) -* --quiet <7>: tail invocation. (line 135) -* --quiet: head invocation. (line 36) +* --quiet <6>: md5sum invocation. (line 69) +* --quiet <7>: csplit invocation. (line 100) +* --quiet <8>: tail invocation. (line 144) +* --quiet: head invocation. (line 46) * --quote-name: Formatting the file names. (line 30) * --quoting-style: Formatting the file names. (line 11) -* --random-sort: sort invocation. (line 162) +* --random-sort: sort invocation. (line 176) * --random-source <1>: shred invocation. (line 112) * --random-source <2>: shuf invocation. (line 43) -* --random-source: sort invocation. (line 226) -* --read-bytes: od invocation. (line 63) +* --random-source: sort invocation. (line 277) +* --range <1>: runcon invocation. (line 43) +* --range: chcon invocation. (line 63) +* --read-bytes: od invocation. (line 71) * --real: id invocation. (line 36) -* --recursive <1>: chmod invocation. (line 69) -* --recursive <2>: chgrp invocation. (line 66) -* --recursive <3>: chown invocation. (line 140) -* --recursive <4>: rm invocation. (line 91) -* --recursive <5>: cp invocation. (line 200) +* --recursive <1>: chcon invocation. (line 30) +* --recursive <2>: chmod invocation. (line 69) +* --recursive <3>: chgrp invocation. (line 66) +* --recursive <4>: chown invocation. (line 140) +* --recursive <5>: rm invocation. (line 91) +* --recursive <6>: cp invocation. (line 230) * --recursive: Which files are listed. - (line 90) -* --reference <1>: Options for date. (line 30) -* --reference <2>: touch invocation. (line 77) -* --reference <3>: chmod invocation. (line 62) -* --reference <4>: chgrp invocation. (line 52) + (line 91) +* --reference <1>: Options for date. (line 34) +* --reference <2>: chcon invocation. (line 25) +* --reference <3>: truncate invocation. (line 30) +* --reference <4>: touch invocation. (line 77) +* --reference <5>: chmod invocation. (line 62) +* --reference <6>: chgrp invocation. (line 52) * --reference: chown invocation. (line 125) * --regex: tac invocation. (line 26) * --remove: shred invocation. (line 123) -* --remove-destination: cp invocation. (line 212) +* --remove-destination: cp invocation. (line 243) * --repeated: uniq invocation. (line 63) -* --reply <1>: mv invocation. (line 64) -* --reply: cp invocation. (line 188) -* --retry: tail invocation. (line 84) +* --retry: tail invocation. (line 90) * --reverse <1>: Sorting the output. (line 27) -* --reverse: sort invocation. (line 157) -* --rfc-2822: Options for date. (line 36) -* --rfc-3339=TIMESPEC: Options for date. (line 48) -* --rfc-822: Options for date. (line 36) +* --reverse: sort invocation. (line 170) +* --rfc-2822: Options for date. (line 40) +* --rfc-3339=TIMESPEC: Options for date. (line 52) +* --rfc-822: Options for date. (line 40) +* --role <1>: runcon invocation. (line 35) +* --role: chcon invocation. (line 55) +* --runlevel: who invocation. (line 75) * --save: stty invocation. (line 41) * --section-delimiter: nl invocation. (line 68) -* --sep-string: pr invocation. (line 225) -* --separate-dirs: du invocation. (line 134) -* --separator <1>: pr invocation. (line 216) +* --sep-string: pr invocation. (line 221) +* --separate-dirs: du invocation. (line 140) +* --separator <1>: pr invocation. (line 212) * --separator: tac invocation. (line 33) * --serial: paste invocation. (line 34) -* --set: Options for date. (line 78) +* --set: Options for date. (line 82) * --sh: dircolors invocation. - (line 27) + (line 34) * --shell: su invocation. (line 75) * --show-all: cat invocation. (line 16) * --show-control-chars <1>: Formatting the file names. (line 78) -* --show-control-chars: pr invocation. (line 90) +* --show-control-chars: pr invocation. (line 88) * --show-ends: cat invocation. (line 27) -* --show-nonprinting <1>: pr invocation. (line 251) -* --show-nonprinting: cat invocation. (line 49) -* --show-tabs: cat invocation. (line 42) -* --si <1>: du invocation. (line 123) -* --si <2>: df invocation. (line 93) +* --show-nonprinting <1>: pr invocation. (line 247) +* --show-nonprinting: cat invocation. (line 50) +* --show-tabs: cat invocation. (line 43) +* --si <1>: du invocation. (line 128) +* --si <2>: df invocation. (line 99) * --si <3>: What information is listed. - (line 258) + (line 260) * --si: Block size. (line 138) +* --signal: timeout invocation. (line 34) * --silent <1>: tty invocation. (line 18) * --silent <2>: chmod invocation. (line 45) * --silent <3>: chgrp invocation. (line 26) * --silent <4>: chown invocation. (line 76) * --silent <5>: readlink invocation. (line 52) * --silent <6>: csplit invocation. (line 100) -* --silent <7>: tail invocation. (line 135) -* --silent: head invocation. (line 36) +* --silent <7>: tail invocation. (line 144) +* --silent: head invocation. (line 46) +* --size <1>: truncate invocation. (line 34) * --size: What information is listed. - (line 242) + (line 244) * --size=BYTES: shred invocation. (line 117) * --skip-bytes: od invocation. (line 55) * --skip-chars: uniq invocation. (line 41) * --skip-fields: uniq invocation. (line 31) -* --sleep-interval: tail invocation. (line 90) -* --sort: Sorting the output. (line 32) +* --sleep-interval: tail invocation. (line 96) +* --sort <1>: Sorting the output. (line 32) +* --sort: sort invocation. (line 103) * --spaces: fold invocation. (line 29) -* --sparse=WHEN: cp invocation. (line 216) -* --split-only: fmt invocation. (line 47) +* --sparse=WHEN: cp invocation. (line 247) +* --split-only: fmt invocation. (line 54) * --squeeze-blank: cat invocation. (line 35) -* --stable: sort invocation. (line 231) +* --stable: sort invocation. (line 282) * --starting-line-number: nl invocation. (line 117) -* --status: md5sum invocation. (line 69) -* --strings: od invocation. (line 68) -* --strip: install invocation. (line 88) -* --strip-trailing-slashes <1>: mv invocation. (line 89) -* --strip-trailing-slashes: cp invocation. (line 250) -* --suffix <1>: ln invocation. (line 100) -* --suffix <2>: mv invocation. (line 94) -* --suffix <3>: install invocation. (line 92) -* --suffix <4>: cp invocation. (line 263) +* --status: md5sum invocation. (line 77) +* --strings: od invocation. (line 76) +* --strip: install invocation. (line 101) +* --strip-program: install invocation. (line 104) +* --strip-trailing-slashes <1>: mv invocation. (line 93) +* --strip-trailing-slashes: cp invocation. (line 281) +* --suffix <1>: ln invocation. (line 122) +* --suffix <2>: mv invocation. (line 98) +* --suffix <3>: install invocation. (line 108) +* --suffix <4>: cp invocation. (line 294) * --suffix <5>: csplit invocation. (line 66) * --suffix: Backup options. (line 50) -* --suffix-length: split invocation. (line 26) -* --summarize: du invocation. (line 130) -* --symbolic: ln invocation. (line 94) -* --symbolic-link: cp invocation. (line 255) -* --sync: df invocation. (line 100) +* --suffix-length: split invocation. (line 53) +* --summarize: du invocation. (line 136) +* --symbolic: ln invocation. (line 116) +* --symbolic-link: cp invocation. (line 286) +* --sync: df invocation. (line 106) * --sysv: sum invocation. (line 31) * --tabs <1>: unexpand invocation. (line 24) * --tabs: expand invocation. (line 22) * --tabsize: General output formatting. (line 92) -* --tagged-paragraph: fmt invocation. (line 40) -* --target-directory <1>: ln invocation. (line 105) -* --target-directory <2>: mv invocation. (line 99) -* --target-directory <3>: install invocation. (line 97) -* --target-directory <4>: cp invocation. (line 268) +* --tagged-paragraph: fmt invocation. (line 47) +* --target-directory <1>: ln invocation. (line 127) +* --target-directory <2>: mv invocation. (line 103) +* --target-directory <3>: install invocation. (line 113) +* --target-directory <4>: cp invocation. (line 299) * --target-directory: Target directory. (line 31) -* --temporary-directory: sort invocation. (line 273) -* --terse: stat invocation. (line 48) -* --text: md5sum invocation. (line 79) -* --time <1>: du invocation. (line 138) -* --time <2>: touch invocation. (line 50) +* --temporary-directory: sort invocation. (line 324) +* --terse: stat invocation. (line 53) +* --text: md5sum invocation. (line 87) +* --time <1>: who invocation. (line 83) +* --time <2>: du invocation. (line 148) +* --time <3>: touch invocation. (line 50) * --time: Sorting the output. (line 13) -* --time-style <1>: du invocation. (line 153) +* --time-style <1>: du invocation. (line 163) * --time-style: Formatting file timestamps. (line 26) -* --total: du invocation. (line 50) -* --traditional: od invocation. (line 197) -* --type: df invocation. (line 107) -* --uniform-spacing: fmt invocation. (line 53) -* --unique <1>: uniq invocation. (line 98) -* --unique: sort invocation. (line 282) -* --universal: Options for date. (line 83) -* --unset: env invocation. (line 39) -* --update <1>: mv invocation. (line 76) -* --update: cp invocation. (line 277) +* --total <1>: du invocation. (line 55) +* --total: df invocation. (line 42) +* --traditional: od invocation. (line 206) +* --type <1>: runcon invocation. (line 39) +* --type <2>: chcon invocation. (line 59) +* --type: df invocation. (line 113) +* --uniform-spacing: fmt invocation. (line 60) +* --unique <1>: uniq invocation. (line 101) +* --unique: sort invocation. (line 333) +* --universal: Options for date. (line 87) +* --unset: env invocation. (line 38) +* --update <1>: mv invocation. (line 80) +* --update: cp invocation. (line 308) +* --user <1>: runcon invocation. (line 31) +* --user <2>: chcon invocation. (line 51) * --user: id invocation. (line 41) -* --utc: Options for date. (line 83) -* --verbose <1>: chmod invocation. (line 59) -* --verbose <2>: chgrp invocation. (line 58) -* --verbose <3>: chown invocation. (line 132) -* --verbose <4>: rmdir invocation. (line 31) -* --verbose <5>: readlink invocation. (line 56) -* --verbose <6>: mkdir invocation. (line 51) -* --verbose <7>: ln invocation. (line 114) -* --verbose <8>: shred invocation. (line 129) -* --verbose <9>: rm invocation. (line 95) -* --verbose <10>: mv invocation. (line 86) -* --verbose <11>: install invocation. (line 106) -* --verbose <12>: cp invocation. (line 287) -* --verbose <13>: split invocation. (line 54) -* --verbose <14>: tail invocation. (line 139) -* --verbose: head invocation. (line 40) -* --version: Common options. (line 33) -* --warn: md5sum invocation. (line 88) +* --utc: Options for date. (line 87) +* --verbose <1>: chcon invocation. (line 47) +* --verbose <2>: chmod invocation. (line 59) +* --verbose <3>: chgrp invocation. (line 58) +* --verbose <4>: chown invocation. (line 132) +* --verbose <5>: rmdir invocation. (line 31) +* --verbose <6>: readlink invocation. (line 56) +* --verbose <7>: mkdir invocation. (line 51) +* --verbose <8>: ln invocation. (line 136) +* --verbose <9>: shred invocation. (line 129) +* --verbose <10>: rm invocation. (line 95) +* --verbose <11>: mv invocation. (line 90) +* --verbose <12>: install invocation. (line 122) +* --verbose <13>: cp invocation. (line 318) +* --verbose <14>: split invocation. (line 60) +* --verbose <15>: tail invocation. (line 148) +* --verbose: head invocation. (line 50) +* --version: Common options. (line 41) +* --version-sort: sort invocation. (line 164) +* --warn: md5sum invocation. (line 96) * --width <1>: General output formatting. (line 104) * --width <2>: fold invocation. (line 35) -* --width <3>: pr invocation. (line 255) -* --width <4>: fmt invocation. (line 59) -* --width: od invocation. (line 153) -* --words: wc invocation. (line 49) -* --wrap: base64 invocation. (line 21) -* --writable: who invocation. (line 86) -* --zero: shred invocation. (line 143) -* --zero-terminated <1>: shuf invocation. (line 48) -* --zero-terminated: sort invocation. (line 296) -* -0: du invocation. (line 116) +* --width <3>: pr invocation. (line 251) +* --width <4>: fmt invocation. (line 66) +* --width: od invocation. (line 162) +* --words: wc invocation. (line 51) +* --wrap: base64 invocation. (line 22) +* --writable: who invocation. (line 95) +* --zero: shred invocation. (line 144) +* --zero-terminated <1>: uniq invocation. (line 112) +* --zero-terminated <2>: shuf invocation. (line 48) +* --zero-terminated: sort invocation. (line 347) +* -0: du invocation. (line 121) * -1 <1>: General output formatting. (line 10) -* -1 <2>: join invocation. (line 74) +* -1 <2>: join invocation. (line 94) * -1: comm invocation. (line 23) -* -2 <1>: join invocation. (line 77) +* -2 <1>: join invocation. (line 97) * -2: comm invocation. (line 23) * -3: comm invocation. (line 23) * -a <1>: uname invocation. (line 30) @@ -13711,32 +14670,32 @@ Index * -a <4>: tee invocation. (line 25) * -a <5>: Connectives for test. (line 12) -* -a <6>: du invocation. (line 21) +* -a <6>: du invocation. (line 26) * -a <7>: df invocation. (line 32) * -a <8>: touch invocation. (line 50) -* -a: cp invocation. (line 54) +* -a: cp invocation. (line 65) * -A: Which files are listed. (line 17) * -a <1>: Which files are listed. (line 13) * -a <2>: unexpand invocation. (line 37) -* -a <3>: join invocation. (line 60) -* -a <4>: split invocation. (line 26) -* -a <5>: pr invocation. (line 84) -* -a: od invocation. (line 166) +* -a <3>: join invocation. (line 73) +* -a <4>: split invocation. (line 53) +* -a <5>: pr invocation. (line 82) +* -a: od invocation. (line 175) * -A <1>: od invocation. (line 36) * -A: cat invocation. (line 16) * -b <1>: who invocation. (line 40) * -b: File type tests. (line 10) -* -B: du invocation. (line 45) -* -b: du invocation. (line 41) +* -B: du invocation. (line 50) +* -b: du invocation. (line 46) * -B: df invocation. (line 38) -* -b <1>: ln invocation. (line 55) -* -b <2>: mv invocation. (line 50) -* -b <3>: install invocation. (line 40) -* -b <4>: cp invocation. (line 61) +* -b <1>: ln invocation. (line 77) +* -b <2>: mv invocation. (line 56) +* -b <3>: install invocation. (line 42) +* -b <4>: cp invocation. (line 75) * -b <5>: dircolors invocation. - (line 27) + (line 34) * -b: Formatting the file names. (line 11) * -B: Which files are listed. @@ -13745,24 +14704,26 @@ Index * -b <2>: sort invocation. (line 79) * -b <3>: md5sum invocation. (line 38) * -b <4>: csplit invocation. (line 66) -* -b <5>: split invocation. (line 37) +* -b <5>: split invocation. (line 33) * -b <6>: fold invocation. (line 23) -* -b <7>: od invocation. (line 169) +* -b <7>: od invocation. (line 178) * -b <8>: nl invocation. (line 47) * -b <9>: tac invocation. (line 21) * -b <10>: cat invocation. (line 20) * -b: Backup options. (line 13) * -c <1>: su invocation. (line 39) -* -c <2>: File type tests. (line 13) -* -c <3>: stat invocation. (line 28) -* -c <4>: du invocation. (line 50) -* -c <5>: touch invocation. (line 54) -* -c <6>: chmod invocation. (line 39) -* -c <7>: chgrp invocation. (line 20) -* -c <8>: chown invocation. (line 70) -* -c <9>: install invocation. (line 44) +* -c <2>: runcon invocation. (line 27) +* -c <3>: File type tests. (line 13) +* -c <4>: truncate invocation. (line 22) +* -c <5>: stat invocation. (line 33) +* -c <6>: du invocation. (line 55) +* -c <7>: touch invocation. (line 54) +* -c <8>: chmod invocation. (line 39) +* -c <9>: chgrp invocation. (line 20) +* -c <10>: chown invocation. (line 70) +* -c <11>: install invocation. (line 46) * -c: dircolors invocation. - (line 33) + (line 40) * -C: General output formatting. (line 15) * -c <1>: Sorting the output. (line 13) @@ -13770,22 +14731,24 @@ Index * -c <3>: uniq invocation. (line 55) * -c <4>: shuf invocation. (line 19) * -c <5>: sort invocation. (line 18) -* -c: wc invocation. (line 41) -* -C: split invocation. (line 43) -* -c <1>: tail invocation. (line 36) +* -c: wc invocation. (line 43) +* -C: split invocation. (line 46) +* -c <1>: tail invocation. (line 32) * -c <2>: head invocation. (line 24) -* -c <3>: pr invocation. (line 90) -* -c <4>: fmt invocation. (line 34) -* -c: od invocation. (line 172) -* -COLUMN: pr invocation. (line 70) +* -c <3>: pr invocation. (line 88) +* -c: fmt invocation. (line 41) +* -C: fmt invocation. (line 34) +* -c: od invocation. (line 181) +* -COLUMN: pr invocation. (line 68) * -d <1>: Options for date. (line 11) * -d <2>: who invocation. (line 44) * -d: File type tests. (line 16) -* -D: du invocation. (line 56) +* -D: du invocation. (line 61) * -d <1>: touch invocation. (line 58) -* -d <2>: ln invocation. (line 61) -* -d <3>: install invocation. (line 48) -* -d: cp invocation. (line 89) +* -d <2>: ln invocation. (line 83) +* -d: install invocation. (line 55) +* -D: install invocation. (line 49) +* -d: cp invocation. (line 103) * -D: What information is listed. (line 16) * -d <1>: Which files are listed. @@ -13795,39 +14758,39 @@ Index * -D: uniq invocation. (line 69) * -d <1>: uniq invocation. (line 63) * -d <2>: sort invocation. (line 85) -* -d <3>: split invocation. (line 51) -* -d <4>: pr invocation. (line 96) -* -d <5>: base64 invocation. (line 29) -* -d <6>: od invocation. (line 176) +* -d <3>: split invocation. (line 57) +* -d <4>: pr invocation. (line 94) +* -d <5>: base64 invocation. (line 30) +* -d <6>: od invocation. (line 185) * -d: nl invocation. (line 68) * -e: File characteristic tests. (line 9) -* -E: echo invocation. (line 63) -* -e <1>: echo invocation. (line 20) +* -E: echo invocation. (line 68) +* -e <1>: echo invocation. (line 25) * -e <2>: readlink invocation. (line 35) -* -e <3>: join invocation. (line 64) -* -e: pr invocation. (line 120) +* -e <3>: join invocation. (line 84) +* -e: pr invocation. (line 118) * -E: cat invocation. (line 27) * -e: cat invocation. (line 23) * -ef: File characteristic tests. (line 23) * -eq: Numeric tests. (line 16) * -f <1>: su invocation. (line 44) -* -f: Options for date. (line 22) +* -f: Options for date. (line 26) * -F: stty invocation. (line 31) * -f <1>: File type tests. (line 19) -* -f <2>: stat invocation. (line 23) +* -f <2>: stat invocation. (line 28) * -f <3>: touch invocation. (line 68) * -f <4>: chmod invocation. (line 45) * -f <5>: chgrp invocation. (line 26) * -f <6>: chown invocation. (line 76) * -f <7>: readlink invocation. (line 29) -* -f: ln invocation. (line 67) -* -F: ln invocation. (line 61) +* -f: ln invocation. (line 89) +* -F: ln invocation. (line 83) * -f <1>: shred invocation. (line 101) * -f <2>: rm invocation. (line 35) -* -f <3>: mv invocation. (line 55) -* -f: cp invocation. (line 96) +* -f <3>: mv invocation. (line 61) +* -f: cp invocation. (line 110) * -F: General output formatting. (line 36) * -f <1>: Sorting the output. (line 20) @@ -13835,11 +14798,11 @@ Index * -f <3>: uniq invocation. (line 31) * -f <4>: sort invocation. (line 92) * -f: csplit invocation. (line 62) -* -F: tail invocation. (line 79) -* -f <1>: tail invocation. (line 41) -* -f: pr invocation. (line 128) -* -F: pr invocation. (line 128) -* -f <1>: od invocation. (line 179) +* -F: tail invocation. (line 85) +* -f <1>: tail invocation. (line 47) +* -f: pr invocation. (line 126) +* -F: pr invocation. (line 126) +* -f <1>: od invocation. (line 188) * -f: nl invocation. (line 75) * -f FORMAT: seq invocation. (line 24) * -G: id invocation. (line 27) @@ -13849,126 +14812,134 @@ Index (line 31) * -g <1>: Access permission tests. (line 9) -* -g: install invocation. (line 54) +* -g: install invocation. (line 61) * -G: What information is listed. (line 110) * -g <1>: What information is listed. (line 105) -* -g: sort invocation. (line 98) +* -g: sort invocation. (line 103) * -ge: Numeric tests. (line 16) * -gt: Numeric tests. (line 16) +* -H: chcon invocation. (line 33) +* -h: chcon invocation. (line 22) * -H: who invocation. (line 48) * -h: File type tests. (line 23) -* -H: du invocation. (line 80) -* -h: du invocation. (line 75) -* -H: df invocation. (line 48) -* -h: df invocation. (line 43) +* -H: du invocation. (line 87) +* -h: du invocation. (line 81) +* -H: df invocation. (line 54) +* -h: df invocation. (line 48) * -H: chgrp invocation. (line 70) * -h: chgrp invocation. (line 35) * -H: chown invocation. (line 143) * -h: chown invocation. (line 108) -* -H: cp invocation. (line 109) +* -H: cp invocation. (line 126) * -h: What information is listed. (line 116) * -H: Which files are listed. (line 36) -* -h <1>: pr invocation. (line 134) +* -h <1>: pr invocation. (line 131) * -h: nl invocation. (line 79) * -H: Traversing symlinks. (line 18) * -h: Block size. (line 138) -* -i <1>: env invocation. (line 45) +* -i <1>: env invocation. (line 44) * -i <2>: uname invocation. (line 35) * -i <3>: tee invocation. (line 30) -* -i <4>: df invocation. (line 52) -* -i: ln invocation. (line 71) +* -i <4>: df invocation. (line 58) +* -i: ln invocation. (line 93) * -I: rm invocation. (line 44) * -i <1>: rm invocation. (line 39) -* -i <2>: mv invocation. (line 59) -* -i <3>: cp invocation. (line 116) +* -i <2>: mv invocation. (line 67) +* -i <3>: cp invocation. (line 133) * -i: What information is listed. - (line 122) + (line 123) * -I: Which files are listed. - (line 69) + (line 70) * -i <1>: expand invocation. (line 34) -* -i <2>: join invocation. (line 69) +* -i <2>: join invocation. (line 89) * -i <3>: uniq invocation. (line 59) * -i <4>: shuf invocation. (line 23) -* -i <5>: sort invocation. (line 125) -* -i <6>: pr invocation. (line 140) -* -i <7>: base64 invocation. (line 35) -* -i <8>: od invocation. (line 182) +* -i <5>: sort invocation. (line 130) +* -i <6>: pr invocation. (line 137) +* -i <7>: base64 invocation. (line 36) +* -i <8>: od invocation. (line 191) * -i: nl invocation. (line 83) -* -J: pr invocation. (line 147) +* -J: pr invocation. (line 144) * -j: od invocation. (line 55) * -k <1>: Access permission tests. (line 12) -* -k <2>: du invocation. (line 85) -* -k <3>: df invocation. (line 57) +* -k <2>: du invocation. (line 90) +* -k <3>: df invocation. (line 63) * -k <4>: General output formatting. (line 72) -* -k <5>: sort invocation. (line 193) +* -k <5>: sort invocation. (line 219) * -k <6>: csplit invocation. (line 85) * -k: Block size. (line 138) * -l <1>: su invocation. (line 53) -* -l: who invocation. (line 68) -* -L <1>: File type tests. (line 23) -* -L <2>: stat invocation. (line 17) -* -L: du invocation. (line 96) -* -l <1>: du invocation. (line 91) -* -l: df invocation. (line 63) +* -l <2>: runcon invocation. (line 43) +* -l: chcon invocation. (line 63) +* -L: chcon invocation. (line 38) +* -l: who invocation. (line 52) +* -L <1>: pwd invocation. (line 15) +* -L <2>: File type tests. (line 23) +* -L <3>: stat invocation. (line 22) +* -L: du invocation. (line 101) +* -l <1>: du invocation. (line 96) +* -l: df invocation. (line 69) * -L <1>: chgrp invocation. (line 75) * -L <2>: chown invocation. (line 148) -* -L: cp invocation. (line 125) -* -l <1>: cp invocation. (line 121) +* -L: cp invocation. (line 143) +* -l <1>: cp invocation. (line 139) * -l: What information is listed. - (line 130) + (line 131) * -L <1>: Which files are listed. - (line 83) -* -L: wc invocation. (line 57) -* -l <1>: wc invocation. (line 53) -* -l <2>: split invocation. (line 30) -* -l <3>: pr invocation. (line 156) -* -l <4>: od invocation. (line 185) + (line 84) +* -L: wc invocation. (line 59) +* -l <1>: wc invocation. (line 55) +* -l <2>: split invocation. (line 26) +* -l <3>: pr invocation. (line 153) +* -l <4>: od invocation. (line 194) * -l: nl invocation. (line 87) * -L: Traversing symlinks. (line 22) * -le: Numeric tests. (line 16) * -lt: Numeric tests. (line 16) * -m <1>: su invocation. (line 64) * -m <2>: uname invocation. (line 41) -* -m <3>: who invocation. (line 51) -* -m <4>: du invocation. (line 101) +* -m <3>: who invocation. (line 62) +* -m <4>: du invocation. (line 106) * -m <5>: touch invocation. (line 73) * -m <6>: readlink invocation. (line 41) -* -m <7>: mknod invocation. (line 43) +* -m <7>: mknod invocation. (line 48) * -m <8>: mkfifo invocation. (line 21) * -m <9>: mkdir invocation. (line 19) -* -m <10>: install invocation. (line 60) +* -m <10>: install invocation. (line 67) * -m: General output formatting. (line 78) -* -M: sort invocation. (line 131) +* -M: sort invocation. (line 137) * -m <1>: sort invocation. (line 32) -* -m <2>: wc invocation. (line 45) -* -m: pr invocation. (line 164) -* -n <1>: nice invocation. (line 44) +* -m <2>: wc invocation. (line 47) +* -m: pr invocation. (line 160) +* -n <1>: nice invocation. (line 47) * -n <2>: uname invocation. (line 46) * -n <3>: id invocation. (line 31) * -n <4>: String tests. (line 19) -* -n <5>: echo invocation. (line 17) +* -n <5>: echo invocation. (line 22) * -n <6>: readlink invocation. (line 46) -* -n: ln invocation. (line 75) +* -n <7>: ln invocation. (line 97) +* -n <8>: mv invocation. (line 74) +* -n: cp invocation. (line 147) * -N: Formatting the file names. (line 17) * -n <1>: What information is listed. - (line 232) + (line 234) * -n <2>: cut invocation. (line 55) * -n <3>: shuf invocation. (line 32) -* -n <4>: sort invocation. (line 140) +* -n <4>: sort invocation. (line 147) * -n <5>: csplit invocation. (line 80) -* -n <6>: tail invocation. (line 130) -* -n: head invocation. (line 30) -* -N: pr invocation. (line 198) -* -n: pr invocation. (line 177) -* -N: od invocation. (line 63) +* -n <6>: tail invocation. (line 136) +* -n: head invocation. (line 39) +* -N: pr invocation. (line 194) +* -n: pr invocation. (line 173) +* -N: od invocation. (line 71) * -n <1>: nl invocation. (line 95) * -n: cat invocation. (line 31) * -n NUMBER: shred invocation. (line 106) @@ -13980,202 +14951,228 @@ Index (line 15) * -O: Access permission tests. (line 28) -* -o <1>: install invocation. (line 72) -* -o <2>: What information is listed. - (line 236) -* -o <3>: shuf invocation. (line 37) -* -o <4>: sort invocation. (line 213) -* -o <5>: pr invocation. (line 204) -* -o: od invocation. (line 188) +* -o <1>: truncate invocation. (line 26) +* -o <2>: install invocation. (line 79) +* -o <3>: What information is listed. + (line 238) +* -o <4>: shuf invocation. (line 37) +* -o <5>: sort invocation. (line 264) +* -o <6>: pr invocation. (line 200) +* -o: od invocation. (line 197) * -ot: File characteristic tests. (line 19) * -p <1>: su invocation. (line 64) * -p: uname invocation. (line 50) +* -P: chcon invocation. (line 42) +* -p: who invocation. (line 66) +* -P <1>: pwd invocation. (line 22) * -P: pathchk invocation. (line 42) * -p <1>: pathchk invocation. (line 29) * -p: File type tests. (line 28) -* -P <1>: du invocation. (line 107) -* -P <2>: df invocation. (line 74) +* -P <1>: du invocation. (line 112) +* -P <2>: df invocation. (line 80) * -P <3>: chgrp invocation. (line 79) * -P: chown invocation. (line 152) * -p <1>: rmdir invocation. (line 22) * -p <2>: mkdir invocation. (line 34) -* -p <3>: install invocation. (line 78) -* -p: cp invocation. (line 134) -* -P: cp invocation. (line 129) +* -p <3>: install invocation. (line 91) +* -p: cp invocation. (line 160) +* -P: cp invocation. (line 153) * -p <1>: dircolors invocation. - (line 38) + (line 45) * -p <2>: General output formatting. (line 83) * -p: nl invocation. (line 108) * -P: Traversing symlinks. (line 26) -* -q <1>: who invocation. (line 55) +* -q <1>: who invocation. (line 70) * -q: readlink invocation. (line 52) * -Q: Formatting the file names. (line 30) * -q <1>: Formatting the file names. (line 23) * -q <2>: csplit invocation. (line 100) -* -q <3>: tail invocation. (line 135) -* -q: head invocation. (line 36) +* -q <3>: tail invocation. (line 144) +* -q: head invocation. (line 46) * -r: uname invocation. (line 61) -* -R: Options for date. (line 36) -* -r <1>: Options for date. (line 30) +* -R: Options for date. (line 40) +* -r <1>: Options for date. (line 34) +* -r <2>: runcon invocation. (line 35) +* -r: chcon invocation. (line 55) +* -R: chcon invocation. (line 30) +* -r <1>: who invocation. (line 75) * -r <2>: id invocation. (line 36) * -r <3>: Access permission tests. (line 15) +* -r <4>: truncate invocation. (line 30) * -r: touch invocation. (line 77) * -R <1>: chmod invocation. (line 69) * -R <2>: chgrp invocation. (line 66) * -R <3>: chown invocation. (line 140) * -R: rm invocation. (line 91) * -r <1>: rm invocation. (line 91) -* -r: cp invocation. (line 200) -* -R: cp invocation. (line 200) +* -r: cp invocation. (line 230) +* -R: cp invocation. (line 230) * -r: Sorting the output. (line 27) * -R <1>: Which files are listed. - (line 90) -* -R: sort invocation. (line 162) -* -r <1>: sort invocation. (line 157) + (line 91) +* -R: sort invocation. (line 176) +* -r <1>: sort invocation. (line 170) * -r <2>: sum invocation. (line 25) -* -r <3>: pr invocation. (line 211) +* -r <3>: pr invocation. (line 207) * -r: tac invocation. (line 26) -* -s <1>: su invocation. (line 75) -* -s <2>: uname invocation. (line 65) -* -s <3>: Options for date. (line 78) -* -s <4>: who invocation. (line 59) -* -s <5>: tty invocation. (line 18) +* -s <1>: timeout invocation. (line 34) +* -s <2>: su invocation. (line 75) +* -s <3>: uname invocation. (line 65) +* -s <4>: Options for date. (line 82) +* -s <5>: who invocation. (line 79) +* -s <6>: tty invocation. (line 18) * -s: File characteristic tests. (line 12) -* -S <1>: File type tests. (line 31) -* -S: du invocation. (line 134) -* -s <1>: du invocation. (line 130) +* -S: File type tests. (line 31) +* -s: truncate invocation. (line 34) +* -S: du invocation. (line 140) +* -s <1>: du invocation. (line 136) * -s: readlink invocation. (line 52) -* -S: ln invocation. (line 100) -* -s: ln invocation. (line 94) -* -S <1>: mv invocation. (line 94) -* -S: install invocation. (line 92) -* -s: install invocation. (line 88) -* -S: cp invocation. (line 263) -* -s: cp invocation. (line 255) +* -S: ln invocation. (line 122) +* -s: ln invocation. (line 116) +* -S <1>: mv invocation. (line 98) +* -S: install invocation. (line 108) +* -s: install invocation. (line 101) +* -S: cp invocation. (line 294) +* -s: cp invocation. (line 286) * -S: Sorting the output. (line 32) * -s <1>: What information is listed. - (line 242) + (line 244) * -s <2>: paste invocation. (line 34) * -s <3>: cut invocation. (line 59) * -s: uniq invocation. (line 41) -* -S: sort invocation. (line 237) -* -s <1>: sort invocation. (line 231) +* -S: sort invocation. (line 288) +* -s <1>: sort invocation. (line 282) * -s <2>: sum invocation. (line 31) * -s <3>: csplit invocation. (line 100) * -s: fold invocation. (line 29) -* -S: pr invocation. (line 225) -* -s <1>: pr invocation. (line 216) -* -s <2>: fmt invocation. (line 47) -* -s: od invocation. (line 191) -* -S: od invocation. (line 68) +* -S: pr invocation. (line 221) +* -s <1>: pr invocation. (line 212) +* -s <2>: fmt invocation. (line 54) +* -s: od invocation. (line 200) +* -S: od invocation. (line 76) * -s <1>: nl invocation. (line 112) * -s <2>: tac invocation. (line 33) * -s: cat invocation. (line 35) * -S: Backup options. (line 50) * -s BYTES: shred invocation. (line 117) * -su: su invocation. (line 25) -* -T: who invocation. (line 86) -* -t <1>: File type tests. (line 34) -* -t: stat invocation. (line 48) -* -T: df invocation. (line 113) -* -t: df invocation. (line 107) -* -T: ln invocation. (line 109) -* -t: ln invocation. (line 105) -* -T: mv invocation. (line 103) -* -t: mv invocation. (line 99) -* -T: install invocation. (line 101) -* -t: install invocation. (line 97) -* -T: cp invocation. (line 272) -* -t: cp invocation. (line 268) +* -t <1>: runcon invocation. (line 39) +* -t: chcon invocation. (line 59) +* -T: who invocation. (line 95) +* -t <1>: who invocation. (line 83) +* -t <2>: File type tests. (line 34) +* -t: stat invocation. (line 53) +* -T: df invocation. (line 119) +* -t: df invocation. (line 113) +* -T: ln invocation. (line 131) +* -t: ln invocation. (line 127) +* -T: mv invocation. (line 107) +* -t: mv invocation. (line 103) +* -T: install invocation. (line 117) +* -t: install invocation. (line 113) +* -T: cp invocation. (line 303) +* -t: cp invocation. (line 299) * -T: General output formatting. (line 92) * -t <1>: Sorting the output. (line 36) * -t <2>: unexpand invocation. (line 24) * -t: expand invocation. (line 22) -* -T: sort invocation. (line 273) -* -t <1>: sort invocation. (line 253) -* -t: md5sum invocation. (line 79) -* -T: pr invocation. (line 246) -* -t <1>: pr invocation. (line 235) -* -t <2>: fmt invocation. (line 40) -* -t: od invocation. (line 76) -* -T: cat invocation. (line 42) -* -t: cat invocation. (line 38) -* -u <1>: env invocation. (line 39) -* -u <2>: Options for date. (line 83) -* -u <3>: who invocation. (line 62) -* -u <4>: id invocation. (line 41) -* -u <5>: Access permission tests. +* -T: sort invocation. (line 324) +* -t <1>: sort invocation. (line 304) +* -t: md5sum invocation. (line 87) +* -T: pr invocation. (line 242) +* -t <1>: pr invocation. (line 231) +* -t <2>: fmt invocation. (line 47) +* -t: od invocation. (line 85) +* -T: cat invocation. (line 43) +* -t: cat invocation. (line 39) +* -u <1>: env invocation. (line 38) +* -u <2>: Options for date. (line 87) +* -u <3>: runcon invocation. (line 31) +* -u <4>: chcon invocation. (line 51) +* -u <5>: who invocation. (line 86) +* -u <6>: id invocation. (line 41) +* -u <7>: Access permission tests. (line 18) -* -u <6>: shred invocation. (line 123) -* -u <7>: mv invocation. (line 76) -* -u: cp invocation. (line 277) +* -u <8>: shred invocation. (line 123) +* -u <9>: mv invocation. (line 80) +* -u: cp invocation. (line 308) * -U: Sorting the output. (line 49) * -u <1>: Sorting the output. (line 42) -* -u <2>: uniq invocation. (line 98) -* -u <3>: sort invocation. (line 282) -* -u <4>: fmt invocation. (line 53) -* -u: cat invocation. (line 45) +* -u <2>: uniq invocation. (line 101) +* -u <3>: sort invocation. (line 333) +* -u <4>: fmt invocation. (line 60) +* -u: cat invocation. (line 46) * -v <1>: uname invocation. (line 76) -* -v <2>: chmod invocation. (line 59) -* -v <3>: chgrp invocation. (line 58) -* -v <4>: chown invocation. (line 132) -* -v <5>: rmdir invocation. (line 31) -* -v <6>: readlink invocation. (line 56) -* -v <7>: mkdir invocation. (line 51) -* -v <8>: ln invocation. (line 114) -* -v <9>: shred invocation. (line 129) -* -v <10>: rm invocation. (line 95) -* -v <11>: mv invocation. (line 86) -* -v <12>: install invocation. (line 106) -* -v <13>: cp invocation. (line 287) -* -v <14>: Sorting the output. (line 56) -* -v <15>: tail invocation. (line 139) -* -v <16>: head invocation. (line 40) -* -v <17>: pr invocation. (line 251) -* -v <18>: od invocation. (line 146) -* -v <19>: nl invocation. (line 117) -* -v: cat invocation. (line 49) -* -w <1>: who invocation. (line 86) +* -v <2>: chcon invocation. (line 47) +* -v <3>: chmod invocation. (line 59) +* -v <4>: chgrp invocation. (line 58) +* -v <5>: chown invocation. (line 132) +* -v <6>: rmdir invocation. (line 31) +* -v <7>: readlink invocation. (line 56) +* -v <8>: mkdir invocation. (line 51) +* -v <9>: ln invocation. (line 136) +* -v <10>: shred invocation. (line 129) +* -v <11>: rm invocation. (line 95) +* -v <12>: mv invocation. (line 90) +* -v <13>: install invocation. (line 122) +* -v <14>: cp invocation. (line 318) +* -v: Sorting the output. (line 56) +* -V: sort invocation. (line 164) +* -v <1>: tail invocation. (line 148) +* -v <2>: head invocation. (line 50) +* -v <3>: pr invocation. (line 247) +* -v <4>: od invocation. (line 155) +* -v <5>: nl invocation. (line 117) +* -v: cat invocation. (line 50) +* -w <1>: who invocation. (line 95) * -w <2>: Access permission tests. (line 21) * -w <3>: General output formatting. (line 104) -* -w <4>: uniq invocation. (line 103) -* -w <5>: md5sum invocation. (line 88) -* -w <6>: wc invocation. (line 49) +* -w <4>: uniq invocation. (line 106) +* -w <5>: md5sum invocation. (line 96) +* -w <6>: wc invocation. (line 51) * -w: fold invocation. (line 35) -* -W: pr invocation. (line 264) -* -w <1>: pr invocation. (line 255) -* -w <2>: fmt invocation. (line 59) -* -w <3>: base64 invocation. (line 21) -* -w <4>: od invocation. (line 153) +* -W: pr invocation. (line 260) +* -w <1>: pr invocation. (line 251) +* -w <2>: fmt invocation. (line 66) +* -w <3>: base64 invocation. (line 22) +* -w <4>: od invocation. (line 162) * -w: nl invocation. (line 122) -* -WIDTH: fmt invocation. (line 59) +* -WIDTH: fmt invocation. (line 66) * -x <1>: Access permission tests. (line 24) -* -x <2>: du invocation. (line 191) -* -x <3>: df invocation. (line 138) -* -x <4>: shred invocation. (line 133) -* -x <5>: cp invocation. (line 291) +* -x <2>: du invocation. (line 201) +* -x <3>: df invocation. (line 144) +* -x <4>: shred invocation. (line 134) +* -x <5>: cp invocation. (line 322) * -x: General output formatting. (line 88) * -X: Sorting the output. (line 63) -* -x: od invocation. (line 194) -* -X FILE: du invocation. (line 201) -* -z <1>: String tests. (line 15) -* -z <2>: shred invocation. (line 143) -* -z <3>: shuf invocation. (line 48) -* -z <4>: sort invocation. (line 296) +* -x: od invocation. (line 203) +* -X FILE: du invocation. (line 211) +* -Z: id invocation. (line 45) +* -z: String tests. (line 15) +* -Z <1>: mknod invocation. (line 54) +* -Z <2>: mkfifo invocation. (line 28) +* -Z: mkdir invocation. (line 56) +* -z: shred invocation. (line 144) +* -Z <1>: install invocation. (line 126) +* -Z: What information is listed. + (line 268) +* -z <1>: uniq invocation. (line 112) +* -z <2>: shuf invocation. (line 48) +* -z <3>: sort invocation. (line 347) * -z: csplit invocation. (line 89) * .cshrc: su invocation. (line 44) -* /: Numeric expressions. (line 15) +* /: Numeric expressions. (line 16) * /bin/sh: su invocation. (line 12) * /etc/passwd: su invocation. (line 12) * /etc/shells: su invocation. (line 64) @@ -14185,7 +15182,7 @@ Index * 224-bit checksum: sha2 utilities. (line 6) * 256-bit checksum: sha2 utilities. (line 6) * 384-bit checksum: sha2 utilities. (line 6) -* 4.2 file system type: df invocation. (line 125) +* 4.2 file system type: df invocation. (line 131) * 512-bit checksum: sha2 utilities. (line 6) * <: Relations for expr. (line 22) * <=: Relations for expr. (line 22) @@ -14197,38 +15194,38 @@ Index * \( regexp operator: String expressions. (line 24) * \+ regexp operator: String expressions. (line 28) * \? regexp operator: String expressions. (line 28) -* \c: printf invocation. (line 23) -* \OOO: printf invocation. (line 57) -* \uhhhh: printf invocation. (line 62) -* \Uhhhhhhhh: printf invocation. (line 62) -* \xHH: printf invocation. (line 57) +* \c: printf invocation. (line 29) +* \OOO: printf invocation. (line 63) +* \uhhhh: printf invocation. (line 68) +* \Uhhhhhhhh: printf invocation. (line 68) +* \xHH: printf invocation. (line 63) * \| regexp operator: String expressions. (line 28) * _POSIX2_VERSION <1>: touch invocation. (line 93) * _POSIX2_VERSION <2>: uniq invocation. (line 46) -* _POSIX2_VERSION <3>: sort invocation. (line 328) -* _POSIX2_VERSION <4>: tail invocation. (line 150) +* _POSIX2_VERSION <3>: sort invocation. (line 379) +* _POSIX2_VERSION <4>: tail invocation. (line 159) * _POSIX2_VERSION: Standards conformance. (line 19) * abbreviations for months: Calendar date items. (line 38) * access permission tests: Access permission tests. (line 6) * access permissions, changing: chmod invocation. (line 6) -* access time: dd invocation. (line 171) +* access time: dd invocation. (line 183) * access time, changing: touch invocation. (line 50) * access time, printing or sorting files by: Sorting the output. (line 42) -* access time, show the most recent: du invocation. (line 149) -* across columns: pr invocation. (line 84) +* access time, show the most recent: du invocation. (line 159) +* across columns: pr invocation. (line 82) * across, listing files: General output formatting. (line 88) * adding permissions: Setting Permissions. (line 38) -* addition: Numeric expressions. (line 11) +* addition: Numeric expressions. (line 12) * ago in date strings: Relative items in date strings. (line 23) * all repeated lines, outputting: uniq invocation. (line 69) * alnum: Character sets. (line 91) * alpha: Character sets. (line 94) -* alternate ebcdic, converting to: dd invocation. (line 67) +* alternate ebcdic, converting to: dd invocation. (line 73) * always color option: General output formatting. (line 27) * always interactive option: rm invocation. (line 57) @@ -14237,29 +15234,30 @@ Index * and operator <1>: Relations for expr. (line 17) * and operator: Connectives for test. (line 12) -* append: dd invocation. (line 141) -* appending to the output file: dd invocation. (line 141) +* append: dd invocation. (line 147) +* appending to the output file: dd invocation. (line 147) * appropriate privileges <1>: nice invocation. (line 6) * appropriate privileges <2>: hostname invocation. (line 6) * appropriate privileges <3>: Setting the time. (line 6) -* appropriate privileges: install invocation. (line 72) +* appropriate privileges: install invocation. (line 79) * arbitrary date strings, parsing: Options for date. (line 11) * arbitrary text, displaying: echo invocation. (line 6) +* arch: arch invocation. (line 6) * arithmetic tests: Numeric tests. (line 6) * ASCII dump of files: od invocation. (line 6) -* ascii, converting to: dd invocation. (line 59) +* ascii, converting to: dd invocation. (line 65) * atime, changing: touch invocation. (line 50) * atime, printing or sorting files by: Sorting the output. (line 42) -* atime, show the most recent: du invocation. (line 149) +* atime, show the most recent: du invocation. (line 159) * attributes, file: Changing file attributes. (line 6) * authors of get_date: Authors of get_date. (line 6) * auto color option: General output formatting. (line 25) * automounter file systems: df invocation. (line 32) -* b for block special file: mknod invocation. (line 26) +* b for block special file: mknod invocation. (line 31) * background jobs, stopping at terminal write: Local. (line 41) -* backslash escapes <1>: echo invocation. (line 20) +* backslash escapes <1>: echo invocation. (line 25) * backslash escapes: Character sets. (line 14) * backslash sequences for file names: Formatting the file names. (line 11) @@ -14267,18 +15265,18 @@ Index (line 23) * backup options: Backup options. (line 6) * backup suffix: Backup options. (line 50) -* backups, making <1>: ln invocation. (line 55) -* backups, making <2>: mv invocation. (line 50) -* backups, making <3>: install invocation. (line 40) -* backups, making <4>: cp invocation. (line 61) +* backups, making <1>: ln invocation. (line 77) +* backups, making <2>: mv invocation. (line 56) +* backups, making <3>: install invocation. (line 42) +* backups, making <4>: cp invocation. (line 75) * backups, making: Backup options. (line 13) -* backups, making only: cp invocation. (line 42) +* backups, making only: cp invocation. (line 53) * base64: base64 invocation. (line 6) -* Base64 decoding: base64 invocation. (line 29) +* Base64 decoding: base64 invocation. (line 30) * base64 encoding: base64 invocation. (line 6) * basename: basename invocation. (line 6) * baud rate, setting: Special. (line 43) -* beeping at input buffer full: Input. (line 56) +* beeping at input buffer full: Input. (line 59) * beginning of time: Time conversion specifiers. (line 41) * beginning of time, for POSIX: Seconds since the Epoch. @@ -14287,16 +15285,16 @@ Index * Berets, Jim: Authors of get_date. (line 6) * Berry, K. <1>: Authors of get_date. (line 14) * Berry, K.: Introduction. (line 19) -* binary: dd invocation. (line 188) -* binary I/O: dd invocation. (line 188) +* binary: dd invocation. (line 200) +* binary I/O: dd invocation. (line 200) * binary input files: md5sum invocation. (line 38) * blank: Character sets. (line 97) * blank lines, numbering: nl invocation. (line 87) * blanks, ignoring leading: sort invocation. (line 79) -* block (space-padding): dd invocation. (line 76) +* block (space-padding): dd invocation. (line 82) * block size <1>: dd invocation. (line 33) * block size: Block size. (line 6) -* block size of conversion: dd invocation. (line 38) +* block size of conversion: dd invocation. (line 40) * block size of input: dd invocation. (line 25) * block size of output: dd invocation. (line 29) * block special check: File type tests. (line 10) @@ -14306,37 +15304,50 @@ Index * BLOCKSIZE: Block size. (line 12) * body, numbering: nl invocation. (line 17) * Bourne shell syntax for color setup: dircolors invocation. - (line 27) -* breaks, cause interrupts: Input. (line 10) -* breaks, ignoring: Input. (line 7) -* brkint: Input. (line 10) + (line 34) +* breaks, cause interrupts: Input. (line 12) +* breaks, ignoring: Input. (line 9) +* brkint: Input. (line 12) * bs: dd invocation. (line 33) * BSD sum: sum invocation. (line 25) * BSD tail: tail invocation. (line 19) * BSD touch compatibility: touch invocation. (line 68) * bsN: Output. (line 55) * bugs, reporting: Introduction. (line 12) -* built-in shell commands, conflicts with <1>: nice invocation. - (line 35) -* built-in shell commands, conflicts with <2>: pwd invocation. - (line 10) -* built-in shell commands, conflicts with: test invocation. (line 28) +* built-in shell commands, conflicts with <1>: sleep invocation. + (line 34) +* built-in shell commands, conflicts with <2>: kill invocation. + (line 13) +* built-in shell commands, conflicts with <3>: nice invocation. + (line 37) +* built-in shell commands, conflicts with <4>: pwd invocation. + (line 30) +* built-in shell commands, conflicts with <5>: test invocation. + (line 28) +* built-in shell commands, conflicts with <6>: printf invocation. + (line 16) +* built-in shell commands, conflicts with <7>: echo invocation. + (line 11) +* built-in shell commands, conflicts with <8>: stat invocation. + (line 15) +* built-in shell commands, conflicts with: mknod invocation. (line 20) * byte count: wc invocation. (line 6) -* byte-swapping: dd invocation. (line 95) -* c for character special file: mknod invocation. (line 29) +* byte-swapping: dd invocation. (line 101) +* c for character special file: mknod invocation. (line 34) * C shell syntax for color setup: dircolors invocation. - (line 33) -* C-s/C-q flow control: Input. (line 38) + (line 40) +* C-s/C-q flow control: Input. (line 40) * calendar date item: Calendar date items. (line 6) * case folding: sort invocation. (line 92) * case translation: Local. (line 36) * case, ignored in dates: General date syntax. (line 64) * cat: cat invocation. (line 6) * cbreak: Combination. (line 52) -* cbs: dd invocation. (line 38) -* CD-ROM file system type: df invocation. (line 129) -* cdfs file system type: df invocation. (line 129) +* cbs: dd invocation. (line 40) +* CD-ROM file system type: df invocation. (line 135) +* cdfs file system type: df invocation. (line 135) * change or print terminal settings: stty invocation. (line 6) +* change SELinux context: chcon invocation. (line 6) * changed files, verbosely describing: chgrp invocation. (line 20) * changed owners, verbosely describing: chown invocation. (line 70) * changing access permissions: chmod invocation. (line 6) @@ -14346,6 +15357,7 @@ Index * changing file timestamps: touch invocation. (line 6) * changing group ownership <1>: chgrp invocation. (line 6) * changing group ownership: chown invocation. (line 6) +* changing security context: chcon invocation. (line 6) * changing special mode bits: Changing Special Mode Bits. (line 6) * character classes: Character sets. (line 78) @@ -14355,6 +15367,7 @@ Index * character special files: mknod invocation. (line 11) * character special files, creating: mknod invocation. (line 6) * characters, special: Characters. (line 6) +* chcon: chcon invocation. (line 6) * check file types: test invocation. (line 6) * checking for sortedness: sort invocation. (line 18) * checksum, 128-bit: md5sum invocation. (line 6) @@ -14368,17 +15381,18 @@ Index * chmod: chmod invocation. (line 6) * chown: chown invocation. (line 6) * chroot: chroot invocation. (line 6) +* cio: dd invocation. (line 155) * cksum: cksum invocation. (line 6) * clocal: Control. (line 33) * cntrl: Character sets. (line 100) * color database, printing: dircolors invocation. - (line 38) + (line 45) * color setup: dircolors invocation. (line 6) * color, distinguishing file types with: General output formatting. (line 21) * cols: Special. (line 27) -* column to wrap data after: base64 invocation. (line 21) +* column to wrap data after: base64 invocation. (line 22) * COLUMNS: Special. (line 30) * columns: Special. (line 27) * COLUMNS: General output formatting. @@ -14397,6 +15411,7 @@ Index * commands for printing the working context: Working context. (line 6) * commands for printing user information: User information. (line 6) * commands for redirection: Redirection. (line 6) +* commands for SELinux context: SELinux context. (line 6) * commands for system context: System context. (line 6) * commas, outputting between files: General output formatting. (line 78) @@ -14408,12 +15423,19 @@ Index * comparing sorted files: comm invocation. (line 6) * comparison operators: Relations for expr. (line 22) * concatenate and write files: cat invocation. (line 6) +* concurrent I/O: dd invocation. (line 155) * conditional executability: Conditional Executability. (line 6) * conditions: Conditions. (line 6) -* conflicts with shell built-ins <1>: nice invocation. (line 35) -* conflicts with shell built-ins <2>: pwd invocation. (line 10) -* conflicts with shell built-ins: test invocation. (line 28) +* conflicts with shell built-ins <1>: sleep invocation. (line 34) +* conflicts with shell built-ins <2>: kill invocation. (line 13) +* conflicts with shell built-ins <3>: nice invocation. (line 37) +* conflicts with shell built-ins <4>: pwd invocation. (line 30) +* conflicts with shell built-ins <5>: test invocation. (line 28) +* conflicts with shell built-ins <6>: printf invocation. (line 16) +* conflicts with shell built-ins <7>: echo invocation. (line 11) +* conflicts with shell built-ins <8>: stat invocation. (line 15) +* conflicts with shell built-ins: mknod invocation. (line 20) * connectives, logical <1>: Relations for expr. (line 6) * connectives, logical: Connectives for test. (line 6) @@ -14421,9 +15443,9 @@ Index * context, system: System context. (line 6) * control characters, using ^C: Local. (line 51) * control settings: Control. (line 6) -* controlling terminal: dd invocation. (line 176) -* conv: dd invocation. (line 53) -* conversion block size: dd invocation. (line 38) +* controlling terminal: dd invocation. (line 188) +* conv: dd invocation. (line 59) +* conversion block size: dd invocation. (line 40) * conversion specifiers, date: Date conversion specifiers. (line 6) * conversion specifiers, literal: Literal conversion specifiers. @@ -14433,14 +15455,14 @@ Index * converting tabs to spaces: expand invocation. (line 6) * converting while copying a file: dd invocation. (line 6) * cooked: Combination. (line 37) -* Coordinated Universal Time: Options for date. (line 83) -* copying directories recursively: cp invocation. (line 76) +* Coordinated Universal Time: Options for date. (line 87) +* copying directories recursively: cp invocation. (line 90) * copying existing permissions: Copying Permissions. (line 6) * copying files: cat invocation. (line 6) * copying files and directories: cp invocation. (line 6) * copying files and setting attributes: install invocation. (line 6) -* core utilities: Top. (line 19) -* count: dd invocation. (line 49) +* core utilities: Top. (line 18) +* count: dd invocation. (line 51) * cp: cp invocation. (line 6) * crashes and corruption: sync invocation. (line 11) * CRC checksum: cksum invocation. (line 6) @@ -14449,28 +15471,28 @@ Index * creating FIFOs (named pipes): mkfifo invocation. (line 6) * creating links (hard only): link invocation. (line 6) * creating links (hard or soft): ln invocation. (line 6) -* creating output file, avoiding: dd invocation. (line 103) -* creating output file, requiring: dd invocation. (line 107) +* creating output file, avoiding: dd invocation. (line 109) +* creating output file, requiring: dd invocation. (line 113) * crN: Output. (line 45) -* crown margin: fmt invocation. (line 34) -* crt: Combination. (line 74) +* crown margin: fmt invocation. (line 41) +* crt: Combination. (line 75) * crterase: Local. (line 22) * crtkill: Local. (line 56) * crtscts: Control. (line 36) * csh syntax for color setup: dircolors invocation. - (line 33) + (line 40) * csN: Control. (line 19) * csplit: csplit invocation. (line 6) * cstopb: Control. (line 27) * ctime, printing or sorting by: Sorting the output. (line 13) -* ctime, show the most recent: du invocation. (line 144) +* ctime, show the most recent: du invocation. (line 154) * ctlecho: Local. (line 51) * current working directory, printing: pwd invocation. (line 6) * cut: cut invocation. (line 6) * cyclic redundancy check: cksum invocation. (line 6) * data, erasing: shred invocation. (line 6) * database for color setup, printing: dircolors invocation. - (line 38) + (line 45) * date: date invocation. (line 6) * date conversion specifiers: Date conversion specifiers. (line 6) @@ -14482,48 +15504,49 @@ Index (line 15) * day of week item: Day of week items. (line 6) * dd: dd invocation. (line 6) -* dec: Combination. (line 77) +* dec: Combination. (line 78) * decctlq: Combination. (line 63) -* Decode base64 data: base64 invocation. (line 29) +* Decode base64 data: base64 invocation. (line 30) * delay for a specified time: sleep invocation. (line 6) * delaying commands: Delaying. (line 6) * deleting characters: Squeezing. (line 6) * dereferencing symbolic links: ln invocation. (line 40) -* descriptor follow option: tail invocation. (line 41) -* destination directory <1>: ln invocation. (line 105) -* destination directory <2>: mv invocation. (line 99) -* destination directory <3>: install invocation. (line 97) -* destination directory <4>: cp invocation. (line 268) +* descriptor follow option: tail invocation. (line 47) +* destination directory <1>: ln invocation. (line 127) +* destination directory <2>: mv invocation. (line 103) +* destination directory <3>: install invocation. (line 113) +* destination directory <4>: cp invocation. (line 299) * destination directory: Target directory. (line 15) * destinations, multiple output: tee invocation. (line 6) * device file, disk: df invocation. (line 19) * df: df invocation. (line 6) * DF_BLOCK_SIZE: Block size. (line 12) +* diagnostic: chcon invocation. (line 47) * dictionary order: sort invocation. (line 85) * differing lines: comm invocation. (line 18) * digit: Character sets. (line 103) * dir: dir invocation. (line 6) * dircolors: dircolors invocation. (line 6) -* direct: dd invocation. (line 149) -* direct I/O: dd invocation. (line 149) +* direct: dd invocation. (line 161) +* direct I/O: dd invocation. (line 161) * directories, copying: cp invocation. (line 6) -* directories, copying recursively: cp invocation. (line 76) +* directories, copying recursively: cp invocation. (line 90) * directories, creating: mkdir invocation. (line 6) * directories, creating with given attributes: install invocation. - (line 48) + (line 55) * directories, removing (recursively): rm invocation. (line 91) * directories, removing empty: rmdir invocation. (line 6) -* directory: dd invocation. (line 152) +* directory: dd invocation. (line 164) * directory check: File type tests. (line 16) * directory components, printing: dirname invocation. (line 6) * directory deletion, ignoring failures: rmdir invocation. (line 17) * directory deletion, reporting: rmdir invocation. (line 31) -* directory I/O: dd invocation. (line 152) +* directory I/O: dd invocation. (line 164) * directory listing: ls invocation. (line 6) * directory listing, brief: dir invocation. (line 6) * directory listing, recursive: Which files are listed. - (line 90) + (line 91) * directory listing, verbose: vdir invocation. (line 6) * directory order, listing by: Sorting the output. (line 20) * directory, stripping from file names: basename invocation. (line 6) @@ -14534,27 +15557,27 @@ Index * disambiguating group names and IDs: Disambiguating names and IDs. (line 6) * disk allocation: What information is listed. - (line 242) + (line 244) * disk device file: df invocation. (line 19) * disk usage: Disk usage. (line 6) * disk usage by file system: df invocation. (line 6) * disk usage for files: du invocation. (line 6) -* diskette file system: df invocation. (line 133) +* diskette file system: df invocation. (line 139) * displacement of dates: Relative items in date strings. (line 6) * displaying text: echo invocation. (line 6) * displaying value of a symbolic link: readlink invocation. (line 6) -* division: Numeric expressions. (line 15) +* division: Numeric expressions. (line 16) * do nothing, successfully: true invocation. (line 6) * do nothing, unsuccessfully: false invocation. (line 6) -* DOS file system: df invocation. (line 133) -* double spacing: pr invocation. (line 96) -* down columns: pr invocation. (line 70) +* DOS file system: df invocation. (line 139) +* double spacing: pr invocation. (line 94) +* down columns: pr invocation. (line 68) * dsusp: Characters. (line 53) -* dsync: dd invocation. (line 157) +* dsync: dd invocation. (line 169) * du: du invocation. (line 6) * DU_BLOCK_SIZE: Block size. (line 12) -* ebcdic, converting to: dd invocation. (line 63) +* ebcdic, converting to: dd invocation. (line 69) * echo <1>: Local. (line 18) * echo: echo invocation. (line 6) * echoctl: Local. (line 51) @@ -14565,11 +15588,11 @@ Index * echoprt: Local. (line 46) * effective user and group IDs, printing: id invocation. (line 6) * effective user ID, printing: whoami invocation. (line 6) -* efs file system type: df invocation. (line 125) +* efs file system type: df invocation. (line 131) * Eggert, Paul: Authors of get_date. (line 6) * eight-bit characters <1>: Combination. (line 55) * eight-bit characters: Control. (line 19) -* eight-bit input: Input. (line 23) +* eight-bit input: Input. (line 25) * ek: Combination. (line 22) * empty files, creating: touch invocation. (line 11) * empty lines, numbering: nl invocation. (line 87) @@ -14578,7 +15601,7 @@ Index * env: env invocation. (line 6) * environment variables, printing: printenv invocation. (line 6) * environment, preserving: su invocation. (line 64) -* environment, printing: env invocation. (line 30) +* environment, printing: env invocation. (line 29) * environment, running a program in a modified: env invocation. (line 6) * eof: Characters. (line 32) @@ -14602,8 +15625,8 @@ Index * examples of date: Examples of date. (line 6) * examples of expr: Examples of expr. (line 6) * exbibyte, definition of: Block size. (line 120) -* excl: dd invocation. (line 107) -* excluding files from du: du invocation. (line 195) +* excl: dd invocation. (line 113) +* excluding files from du: du invocation. (line 205) * executable file check: Access permission tests. (line 24) * executables and file type, marking: General output formatting. @@ -14615,17 +15638,19 @@ Index * existing backup method: Backup options. (line 39) * exit status commands: Conditions. (line 6) * exit status of chroot: chroot invocation. (line 47) -* exit status of env: env invocation. (line 49) -* exit status of expr: expr invocation. (line 39) +* exit status of env: env invocation. (line 48) +* exit status of expr: expr invocation. (line 43) * exit status of false: false invocation. (line 6) * exit status of ls: ls invocation. (line 29) -* exit status of nice: nice invocation. (line 53) -* exit status of nohup: nohup invocation. (line 42) +* exit status of nice: nice invocation. (line 56) +* exit status of nohup: nohup invocation. (line 47) * exit status of pathchk: pathchk invocation. (line 50) * exit status of printenv: printenv invocation. (line 17) +* exit status of runcon: runcon invocation. (line 46) * exit status of sort: sort invocation. (line 58) * exit status of su: su invocation. (line 80) -* exit status of test: test invocation. (line 40) +* exit status of test: test invocation. (line 41) +* exit status of timeout: timeout invocation. (line 39) * exit status of true: true invocation. (line 6) * exit status of tty: tty invocation. (line 21) * expand: expand invocation. (line 6) @@ -14634,16 +15659,16 @@ Index * expression evaluation: test invocation. (line 6) * expressions, numeric: Numeric expressions. (line 6) * expressions, string: String expressions. (line 6) +* extended attributes, xattr <1>: mv invocation. (line 34) +* extended attributes, xattr: install invocation. (line 35) * extension, sorting files by: Sorting the output. (line 63) * factor: factor invocation. (line 6) * failure exit status: false invocation. (line 6) * false: false invocation. (line 6) * fascism: su invocation. (line 87) -* fdatasync: dd invocation. (line 121) -* FDL, GNU Free Documentation License: GNU Free Documentation License. - (line 6) +* fdatasync: dd invocation. (line 127) * ffN: Output. (line 63) -* field separator character: sort invocation. (line 253) +* field separator character: sort invocation. (line 304) * fields, padding numeric: Padding and other flags. (line 6) * FIFOs, creating: mkfifo invocation. (line 6) @@ -14652,7 +15677,9 @@ Index * file characteristic tests: File characteristic tests. (line 6) * file contents, dumping unambiguously: od invocation. (line 6) -* file information, preserving: cp invocation. (line 134) +* file information, preserving: cp invocation. (line 213) +* file information, preserving, extended attributes, xattr: cp invocation. + (line 160) * file mode bits, numeric: Numeric Modes. (line 6) * file name manipulation: File name manipulation. (line 6) @@ -14663,22 +15690,22 @@ Index (line 6) * file offset radix: od invocation. (line 36) * file ownership, changing: chown invocation. (line 6) -* file sizes: du invocation. (line 45) +* file sizes: du invocation. (line 50) * file space usage: du invocation. (line 6) * file status: stat invocation. (line 6) * file system disk usage: df invocation. (line 6) * file system sizes: df invocation. (line 38) * file system space, retrieving current data more slowly: df invocation. - (line 100) + (line 106) * file system space, retrieving old data more quickly: df invocation. - (line 67) + (line 73) * file system status: stat invocation. (line 6) * file system types, limiting output to certain: df invocation. - (line 63) -* file system types, printing: df invocation. (line 113) -* file systems: stat invocation. (line 23) + (line 69) +* file system types, printing: df invocation. (line 119) +* file systems: stat invocation. (line 28) * file systems and hard links: ln invocation. (line 6) -* file systems, omitting copying to different: cp invocation. (line 291) +* file systems, omitting copying to different: cp invocation. (line 322) * file timestamps, changing: touch invocation. (line 6) * file type and executables, marking: General output formatting. (line 36) @@ -14687,9 +15714,10 @@ Index (line 47) * file types: Special file types. (line 9) * file types, special: Special file types. (line 6) -* file utilities: Top. (line 19) +* file utilities: Top. (line 18) * files beginning with -, removing: rm invocation. (line 98) * files, copying: cp invocation. (line 6) +* files, creating: truncate invocation. (line 11) * fingerprint, 128-bit: md5sum invocation. (line 6) * fingerprint, 160-bit: sha1sum invocation. (line 6) * fingerprint, 224-bit: sha2 utilities. (line 6) @@ -14699,9 +15727,9 @@ Index * first in date strings: General date syntax. (line 26) * first part of files, outputting: head invocation. (line 6) * fixed-length records, converting to variable-length: dd invocation. - (line 38) + (line 40) * flow control, hardware: Control. (line 36) -* flow control, software: Input. (line 43) +* flow control, software: Input. (line 45) * flushing, disabling: Local. (line 32) * fmt: fmt invocation. (line 6) * fold: fold invocation. (line 6) @@ -14712,45 +15740,48 @@ Index (line 6) * formatting of numbers in seq: seq invocation. (line 24) * formatting times <1>: date invocation. (line 20) -* formatting times: pr invocation. (line 100) +* formatting times: pr invocation. (line 98) * fortnight in date strings: Relative items in date strings. (line 15) -* fsync: dd invocation. (line 125) +* fsync: dd invocation. (line 131) +* fullblock: dd invocation. (line 208) * general date syntax: General date syntax. (line 6) -* general numeric sort: sort invocation. (line 98) +* general numeric sort: sort invocation. (line 103) * get_date: Date input formats. (line 6) * gibibyte, definition of: Block size. (line 99) * gigabyte, definition of: Block size. (line 95) * giving away permissions: Umask and Protection. (line 12) * globbing, disabled: su invocation. (line 44) -* GMT: Options for date. (line 83) -* grand total of disk space: du invocation. (line 50) +* GMT: Options for date. (line 87) +* grand total of disk size, usage and available space: df invocation. + (line 42) +* grand total of disk space: du invocation. (line 55) * graph: Character sets. (line 106) -* Greenwich Mean Time: Options for date. (line 83) +* Greenwich Mean Time: Options for date. (line 87) * group IDs, disambiguating: Disambiguating names and IDs. (line 6) * group names, disambiguating: Disambiguating names and IDs. (line 6) * group owner, default: Mode Structure. (line 31) * group ownership of installed files, setting: install invocation. - (line 54) + (line 61) * group ownership, changing <1>: chgrp invocation. (line 6) * group ownership, changing: chown invocation. (line 6) * group wheel, not supported: su invocation. (line 87) * group, permissions for: Setting Permissions. (line 26) * groups: groups invocation. (line 6) -* growing files: tail invocation. (line 41) +* growing files: tail invocation. (line 47) * hangups, immunity to: nohup invocation. (line 6) * hard link check: File characteristic tests. (line 23) * hard link, defined: ln invocation. (line 32) -* hard links: dd invocation. (line 185) -* hard links to directories: ln invocation. (line 61) -* hard links, counting in du: du invocation. (line 91) +* hard links: dd invocation. (line 197) +* hard links to directories: ln invocation. (line 83) +* hard links, counting in du: du invocation. (line 96) * hard links, creating <1>: ln invocation. (line 6) * hard links, creating: link invocation. (line 6) -* hard links, preserving: cp invocation. (line 89) +* hard links, preserving: cp invocation. (line 103) * hardware class: uname invocation. (line 41) * hardware flow control: Control. (line 36) * hardware platform: uname invocation. (line 35) @@ -14759,10 +15790,11 @@ Index * head: head invocation. (line 6) * head of output: shuf invocation. (line 32) * headers, numbering: nl invocation. (line 17) -* help, online: Common options. (line 29) +* help, online: Common options. (line 37) * hex dump of files: od invocation. (line 6) -* High Sierra file system: df invocation. (line 129) -* holes, copying files with: cp invocation. (line 216) +* High Sierra file system: df invocation. (line 135) +* holes, copying files with: cp invocation. (line 247) +* holes, creating files with: truncate invocation. (line 13) * HOME: su invocation. (line 18) * horizontal, listing files: General output formatting. (line 88) @@ -14772,9 +15804,9 @@ Index * hostname: uname invocation. (line 46) * hour in date strings: Relative items in date strings. (line 15) -* hsfs file system type: df invocation. (line 129) -* human-readable output <1>: du invocation. (line 75) -* human-readable output <2>: df invocation. (line 43) +* hsfs file system type: df invocation. (line 135) +* human-readable output <1>: du invocation. (line 81) +* human-readable output <2>: df invocation. (line 48) * human-readable output <3>: What information is listed. (line 116) * human-readable output: Block size. (line 43) @@ -14783,65 +15815,61 @@ Index (line 10) * ibs: dd invocation. (line 25) * icanon: Local. (line 11) -* icrnl: Input. (line 32) +* icrnl: Input. (line 34) * id: id invocation. (line 6) -* idle time: who invocation. (line 62) +* idle time: who invocation. (line 86) * iexten: Local. (line 15) * if: dd invocation. (line 17) -* iflag: dd invocation. (line 130) -* ignbrk: Input. (line 7) -* igncr: Input. (line 29) +* iflag: dd invocation. (line 136) +* ignbrk: Input. (line 9) +* igncr: Input. (line 31) * ignore file systems: df invocation. (line 32) -* Ignore garbage in base64 stream: base64 invocation. (line 35) +* Ignore garbage in base64 stream: base64 invocation. (line 36) * ignoring case: sort invocation. (line 92) -* ignpar: Input. (line 13) -* imaxbel: Input. (line 56) +* ignpar: Input. (line 15) +* imaxbel: Input. (line 59) * immunity to hangups: nohup invocation. (line 6) * implementation, hardware: uname invocation. (line 35) -* including files from du <1>: du invocation. (line 62) -* including files from du: wc invocation. (line 60) -* indenting lines: pr invocation. (line 204) +* indenting lines: pr invocation. (line 200) * index: String expressions. (line 45) * information, about current users: who invocation. (line 6) * initial part of files, outputting: head invocation. (line 6) * initial tabs, converting: expand invocation. (line 34) -* inlcr: Input. (line 26) +* inlcr: Input. (line 28) * inode number, printing: What information is listed. - (line 122) -* inode usage: df invocation. (line 52) + (line 123) +* inode usage: df invocation. (line 58) * inode, and hard links: ln invocation. (line 32) * inodes, written buffered: sync invocation. (line 6) -* inpck: Input. (line 20) +* inpck: Input. (line 22) * input block size: dd invocation. (line 25) -* input encoding, UTF-8: Input. (line 35) +* input encoding, UTF-8: Input. (line 37) * input range to shuffle: shuf invocation. (line 23) * input settings: Input. (line 6) -* input tabs: pr invocation. (line 120) +* input tabs: pr invocation. (line 118) * install: install invocation. (line 6) -* interactivity <1>: mv invocation. (line 64) -* interactivity: cp invocation. (line 188) * intr: Characters. (line 20) * invocation of commands, modified: Modified command invocation. (line 6) * isig: Local. (line 7) * ISO 8601 date format: Calendar date items. (line 30) -* ISO/IEC 10646: printf invocation. (line 62) +* ISO/IEC 10646: printf invocation. (line 68) * ispeed: Special. (line 16) -* istrip: Input. (line 23) +* istrip: Input. (line 25) * items in date strings: General date syntax. (line 6) * iterations, selecting the number of: shred invocation. (line 106) -* iuclc: Input. (line 48) -* iutf8: Input. (line 35) -* ixany: Input. (line 52) -* ixoff: Input. (line 43) -* ixon: Input. (line 38) +* iuclc: Input. (line 50) +* iutf8: Input. (line 37) +* ixany: Input. (line 55) +* ixoff: Input. (line 45) +* ixon: Input. (line 40) * join: join invocation. (line 6) * kernel name: uname invocation. (line 65) * kernel release: uname invocation. (line 61) * kernel version: uname invocation. (line 76) * kibibyte, definition of: Block size. (line 83) -* kibibytes for file sizes: du invocation. (line 85) -* kibibytes for file system sizes: df invocation. (line 57) +* kibibytes for file sizes: du invocation. (line 90) +* kibibytes for file system sizes: df invocation. (line 63) * kill <1>: kill invocation. (line 6) * kill: Characters. (line 29) * kilobyte, definition of: Block size. (line 78) @@ -14850,7 +15878,7 @@ Index * last DAY <1>: Day of week items. (line 15) * last DAY: Options for date. (line 11) * last in date strings: General date syntax. (line 26) -* last modified dates, displaying in du: du invocation. (line 138) +* last modified dates, displaying in du: du invocation. (line 148) * last part of files, outputting: tail invocation. (line 6) * LC_ALL <1>: ls invocation. (line 17) * LC_ALL: sort invocation. (line 49) @@ -14859,29 +15887,29 @@ Index * LC_COLLATE <3>: comm invocation. (line 12) * LC_COLLATE <4>: uniq invocation. (line 21) * LC_COLLATE: sort invocation. (line 49) -* LC_CTYPE <1>: printf invocation. (line 62) +* LC_CTYPE <1>: printf invocation. (line 68) * LC_CTYPE: sort invocation. (line 79) * LC_MESSAGES: pr invocation. (line 13) -* LC_NUMERIC <1>: printf invocation. (line 51) -* LC_NUMERIC <2>: sort invocation. (line 98) +* LC_NUMERIC <1>: printf invocation. (line 57) +* LC_NUMERIC <2>: sort invocation. (line 103) * LC_NUMERIC: Block size. (line 57) * LC_TIME <1>: date invocation. (line 11) -* LC_TIME <2>: du invocation. (line 158) +* LC_TIME <2>: du invocation. (line 168) * LC_TIME <3>: Formatting file timestamps. (line 30) -* LC_TIME <4>: sort invocation. (line 131) -* LC_TIME: pr invocation. (line 107) +* LC_TIME <4>: sort invocation. (line 137) +* LC_TIME: pr invocation. (line 105) * LCASE: Combination. (line 71) * lcase: Combination. (line 71) -* lcase, converting to: dd invocation. (line 87) +* lcase, converting to: dd invocation. (line 93) * lchown <1>: chgrp invocation. (line 30) * lchown: chown invocation. (line 103) -* leading directories, creating missing: install invocation. (line 48) +* leading directories, creating missing: install invocation. (line 55) * leading directory components, stripping: basename invocation. (line 6) -* left margin: pr invocation. (line 204) +* left margin: pr invocation. (line 200) * length: String expressions. (line 50) -* limiting output of du: du invocation. (line 111) +* limiting output of du: du invocation. (line 116) * line: Special. (line 37) * line count: wc invocation. (line 6) * line numbering: nl invocation. (line 6) @@ -14892,14 +15920,14 @@ Index * link: link invocation. (line 6) * links, creating <1>: ln invocation. (line 6) * links, creating: link invocation. (line 6) -* Linux file system types: df invocation. (line 125) +* Linux file system types: df invocation. (line 131) * literal conversion specifiers: Literal conversion specifiers. (line 6) * litout: Combination. (line 59) * ln: ln invocation. (line 6) * ln format for nl: nl invocation. (line 98) * lnext: Characters. (line 62) -* local file system types: df invocation. (line 125) +* local file system types: df invocation. (line 131) * local settings: Local. (line 6) * logging out and continuing to run: nohup invocation. (line 6) * logical and operator <1>: Relations for expr. (line 17) @@ -14920,13 +15948,13 @@ Index * LOGNAME: su invocation. (line 18) * logname: logname invocation. (line 6) * long ls format: What information is listed. - (line 130) + (line 131) * lower: Character sets. (line 109) * lowercase, translating to output: Output. (line 12) * ls: ls invocation. (line 6) * LS_BLOCK_SIZE: Block size. (line 12) * LS_COLORS: dircolors invocation. - (line 16) + (line 23) * machine type: uname invocation. (line 41) * machine-readable stty output: stty invocation. (line 41) * MacKenzie, D.: Introduction. (line 19) @@ -14940,12 +15968,12 @@ Index * MD5: md5sum invocation. (line 6) * md5sum: md5sum invocation. (line 6) * mebibyte, definition of: Block size. (line 92) -* mebibytes for file sizes: du invocation. (line 101) +* mebibytes for file sizes: du invocation. (line 106) * megabyte, definition of: Block size. (line 88) * merging files: paste invocation. (line 6) * merging files in parallel: pr invocation. (line 6) * merging sorted files: sort invocation. (line 32) -* message status: who invocation. (line 86) +* message status: who invocation. (line 95) * message-digest, 128-bit: md5sum invocation. (line 6) * message-digest, 160-bit: sha1sum invocation. (line 6) * message-digest, 224-bit: sha2 utilities. (line 6) @@ -14977,69 +16005,71 @@ Index * month in date strings: Relative items in date strings. (line 15) * month names in date strings: Calendar date items. (line 38) -* months, sorting by: sort invocation. (line 131) +* months, sorting by: sort invocation. (line 137) * months, written-out: General date syntax. (line 36) -* MS-DOS file system: df invocation. (line 133) +* MS-DOS file system: df invocation. (line 139) * mtime, changing: touch invocation. (line 73) * multicolumn output, generating: pr invocation. (line 6) * multiple changes to permissions: Multiple Changes. (line 6) -* multiplication: Numeric expressions. (line 15) -* multipliers after numbers: dd invocation. (line 204) +* multiplication: Numeric expressions. (line 16) +* multipliers after numbers: dd invocation. (line 222) * mv: mv invocation. (line 6) -* name follow option: tail invocation. (line 41) +* name follow option: tail invocation. (line 47) * name of kernel: uname invocation. (line 65) * named pipe check: File type tests. (line 28) * named pipes, creating: mkfifo invocation. (line 6) * network node name: uname invocation. (line 46) * never interactive option: rm invocation. (line 52) -* newer files, copying only: cp invocation. (line 277) -* newer files, moving only: mv invocation. (line 76) +* newer files, copying only: cp invocation. (line 308) +* newer files, moving only: mv invocation. (line 80) * newer-than file check: File characteristic tests. (line 15) * newline echoing after kill: Local. (line 26) * newline, echoing: Local. (line 29) * newline, translating to crlf: Output. (line 19) -* newline, translating to return: Input. (line 26) +* newline, translating to return: Input. (line 28) * next DAY <1>: Day of week items. (line 15) * next DAY: Options for date. (line 11) * next in date strings: General date syntax. (line 26) -* NFS file system type: df invocation. (line 120) -* NFS mounts from BSD to HP-UX <1>: du invocation. (line 206) +* NFS file system type: df invocation. (line 126) +* NFS mounts from BSD to HP-UX <1>: du invocation. (line 216) * NFS mounts from BSD to HP-UX: What information is listed. - (line 250) + (line 252) * nice: nice invocation. (line 6) * niceness: nice invocation. (line 6) * nl <1>: Combination. (line 18) * nl: nl invocation. (line 6) * nlN: Output. (line 39) +* no dereference: chcon invocation. (line 22) * no-op: true invocation. (line 6) -* noatime: dd invocation. (line 171) -* nocreat: dd invocation. (line 103) -* noctty: dd invocation. (line 176) +* noatime: dd invocation. (line 183) +* nocreat: dd invocation. (line 109) +* noctty: dd invocation. (line 188) * node name: uname invocation. (line 46) -* noerror: dd invocation. (line 100) +* noerror: dd invocation. (line 106) * noflsh: Local. (line 32) -* nofollow: dd invocation. (line 182) +* nofollow: dd invocation. (line 194) * nohup: nohup invocation. (line 6) * nohup.out: nohup invocation. (line 6) -* nolinks: dd invocation. (line 185) -* non-directories, copying as special files: cp invocation. (line 76) +* nolinks: dd invocation. (line 197) +* non-directories, copying as special files: cp invocation. (line 90) * non-directory suffix, stripping: dirname invocation. (line 6) -* nonblock: dd invocation. (line 168) -* nonblocking I/O: dd invocation. (line 168) +* nonblock: dd invocation. (line 180) +* nonblocking I/O: dd invocation. (line 180) * none backup method: Backup options. (line 31) * none color option: General output formatting. (line 23) * none, sorting option for ls: Sorting the output. (line 49) * nonempty file check: File characteristic tests. (line 12) -* nonprinting characters, ignoring: sort invocation. (line 125) +* nonprinting characters, ignoring: sort invocation. (line 130) * nonzero-length string check: String tests. (line 19) * noon in date strings: Time of day items. (line 22) * not-equal string check: String tests. (line 25) -* notrunc: dd invocation. (line 113) +* notrunc: dd invocation. (line 119) * now in date strings: Relative items in date strings. (line 33) +* number of inputs to merge, nmerge: sort invocation. (line 238) * numbered backup method: Backup options. (line 35) * numbering lines: nl invocation. (line 6) * numbers, written-out: General date syntax. (line 26) @@ -15049,12 +16079,12 @@ Index * numeric modes: Numeric Modes. (line 6) * numeric operations: Numeric operations. (line 6) * numeric sequences: seq invocation. (line 6) -* numeric sort: sort invocation. (line 140) +* numeric sort: sort invocation. (line 147) * numeric tests: Numeric tests. (line 6) * numeric uid and gid: What information is listed. - (line 232) + (line 234) * numeric user and group IDs: What information is listed. - (line 232) + (line 234) * obs: dd invocation. (line 29) * ocrnl: Output. (line 16) * octal dump of files: od invocation. (line 6) @@ -15065,14 +16095,14 @@ Index * of: dd invocation. (line 20) * ofdel: Output. (line 34) * ofill: Output. (line 30) -* oflag: dd invocation. (line 134) +* oflag: dd invocation. (line 140) * olcuc: Output. (line 12) * older-than file check: File characteristic tests. (line 19) * once interactive option: rm invocation. (line 54) -* one file system, restricting du to: du invocation. (line 191) +* one file system, restricting du to: du invocation. (line 201) * one file system, restricting rm to: rm invocation. (line 63) -* one-line output format: df invocation. (line 74) +* one-line output format: df invocation. (line 80) * onlcr: Output. (line 19) * onlret: Output. (line 27) * onocr: Output. (line 23) @@ -15082,7 +16112,7 @@ Index (line 6) * operating system name: uname invocation. (line 57) * opost: Output. (line 9) -* option delimiter: Common options. (line 36) +* option delimiter: Common options. (line 44) * options for date: Options for date. (line 6) * or operator <1>: Relations for expr. (line 11) * or operator: Connectives for test. @@ -15094,40 +16124,40 @@ Index * output file name prefix <1>: csplit invocation. (line 62) * output file name prefix: split invocation. (line 14) * output file name suffix: csplit invocation. (line 66) -* output format: stat invocation. (line 28) -* output format, portable: df invocation. (line 74) -* output null-byte-terminated lines: du invocation. (line 117) +* output format: stat invocation. (line 33) +* output format, portable: df invocation. (line 80) +* output null-byte-terminated lines: du invocation. (line 122) * output of entire files: Output of entire files. (line 6) * output of parts of files: Output of parts of files. (line 6) * output settings: Output. (line 6) -* output tabs: pr invocation. (line 140) +* output tabs: pr invocation. (line 137) * overwriting of input, allowed <1>: shuf invocation. (line 37) -* overwriting of input, allowed: sort invocation. (line 213) +* overwriting of input, allowed: sort invocation. (line 264) * owned by effective group ID check: Access permission tests. (line 31) * owned by effective user ID check: Access permission tests. (line 28) * owner of file, permissions for: Setting Permissions. (line 23) * owner, default: Mode Structure. (line 31) -* ownership of installed files, setting: install invocation. (line 72) -* p for FIFO file: mknod invocation. (line 23) +* ownership of installed files, setting: install invocation. (line 79) +* p for FIFO file: mknod invocation. (line 28) * pad character: Output. (line 34) * pad instead of timing for delaying: Output. (line 30) * padding of numeric fields: Padding and other flags. (line 6) * paragraphs, reformatting: fmt invocation. (line 6) * parenb: Control. (line 9) -* parent directories and cp: cp invocation. (line 177) +* parent directories and cp: cp invocation. (line 217) * parent directories, creating: mkdir invocation. (line 34) -* parent directories, creating missing: install invocation. (line 48) +* parent directories, creating missing: install invocation. (line 55) * parent directories, removing: rmdir invocation. (line 22) * parentheses for grouping: expr invocation. (line 31) * parity: Combination. (line 10) -* parity errors, marking: Input. (line 16) -* parity, ignoring: Input. (line 13) -* parmrk: Input. (line 16) +* parity errors, marking: Input. (line 18) +* parity, ignoring: Input. (line 15) +* parmrk: Input. (line 18) * parodd: Control. (line 13) * parsing date strings: Options for date. (line 11) * parts of files, output of: Output of parts of files. @@ -15137,22 +16167,22 @@ Index * paste: paste invocation. (line 6) * Paterson, R.: Introduction. (line 19) * PATH <1>: su invocation. (line 53) -* PATH: env invocation. (line 24) +* PATH: env invocation. (line 23) * pathchk: pathchk invocation. (line 6) * pattern matching: String expressions. (line 11) -* PC file system: df invocation. (line 133) -* pcfs: df invocation. (line 133) +* PC file system: df invocation. (line 139) +* pcfs: df invocation. (line 139) * pebibyte, definition of: Block size. (line 113) * permission tests: Access permission tests. (line 6) * permissions of installed files, setting: install invocation. - (line 60) + (line 67) * permissions, changing access: chmod invocation. (line 6) * permissions, copying existing: Copying Permissions. (line 6) * permissions, for changing file timestamps: touch invocation. (line 16) * permissions, output by ls: What information is listed. - (line 190) + (line 191) * petabyte, definition of: Block size. (line 109) * phone directory order: sort invocation. (line 85) * pieces, splitting a file into: split invocation. (line 6) @@ -15163,15 +16193,15 @@ Index * platform, hardware: uname invocation. (line 35) * pm in date strings: Time of day items. (line 22) * portable file names, checking for: pathchk invocation. (line 6) -* portable output format: df invocation. (line 74) +* portable output format: df invocation. (line 80) * POSIX: Introduction. (line 11) -* POSIX output format: df invocation. (line 74) -* POSIXLY_CORRECT <1>: printf invocation. (line 42) -* POSIXLY_CORRECT <2>: echo invocation. (line 68) -* POSIXLY_CORRECT <3>: dd invocation. (line 237) -* POSIXLY_CORRECT <4>: sort invocation. (line 221) -* POSIXLY_CORRECT <5>: tail invocation. (line 75) -* POSIXLY_CORRECT <6>: pr invocation. (line 107) +* POSIX output format: df invocation. (line 80) +* POSIXLY_CORRECT <1>: printf invocation. (line 48) +* POSIXLY_CORRECT <2>: echo invocation. (line 73) +* POSIXLY_CORRECT <3>: dd invocation. (line 256) +* POSIXLY_CORRECT <4>: sort invocation. (line 272) +* POSIXLY_CORRECT <5>: tail invocation. (line 81) +* POSIXLY_CORRECT <6>: pr invocation. (line 105) * POSIXLY_CORRECT <7>: Standards conformance. (line 6) * POSIXLY_CORRECT: Common options. (line 11) @@ -15179,6 +16209,7 @@ Index * pr: pr invocation. (line 6) * prime factors: factor invocation. (line 6) * print: Character sets. (line 112) +* print machine hardware name: arch invocation. (line 6) * print name of current directory: pwd invocation. (line 6) * print system information: uname invocation. (line 6) * print terminal file name: tty invocation. (line 6) @@ -15187,7 +16218,7 @@ Index * printing all or some environment variables: printenv invocation. (line 6) * printing color database: dircolors invocation. - (line 38) + (line 45) * printing current user information: who invocation. (line 6) * printing current usernames: users invocation. (line 6) * printing groups a user is in: groups invocation. (line 6) @@ -15199,14 +16230,18 @@ Index * printing the effective user ID: whoami invocation. (line 6) * printing the host identifier: hostid invocation. (line 6) * printing the hostname: hostname invocation. (line 6) +* printing the system uptime and load: uptime invocation. (line 6) * printing user's login name: logname invocation. (line 6) * printing, preparing files for: pr invocation. (line 6) +* process zero-terminated items <1>: uniq invocation. (line 112) +* process zero-terminated items <2>: shuf invocation. (line 48) +* process zero-terminated items: sort invocation. (line 347) * processes, commands for controlling: Process control. (line 6) -* prompting, and ln: ln invocation. (line 71) -* prompting, and mv: mv invocation. (line 34) +* prompting, and ln: ln invocation. (line 93) +* prompting, and mv: mv invocation. (line 36) * prompting, and rm: rm invocation. (line 11) -* prompts, forcing: mv invocation. (line 59) -* prompts, omitting: mv invocation. (line 55) +* prompts, forcing: mv invocation. (line 67) +* prompts, omitting: mv invocation. (line 61) * prterase: Local. (line 46) * ptx: ptx invocation. (line 6) * punct: Character sets. (line 115) @@ -15217,30 +16252,31 @@ Index * quoting style: Formatting the file names. (line 34) * radix for file offsets: od invocation. (line 36) -* random sort: sort invocation. (line 162) +* random sort: sort invocation. (line 176) * random source for shredding: shred invocation. (line 112) * random source for shuffling: shuf invocation. (line 43) -* random source for sorting: sort invocation. (line 226) +* random source for sorting: sort invocation. (line 277) * random sources: Random sources. (line 6) * ranges: Character sets. (line 50) * raw: Combination. (line 43) -* read errors, ignoring: dd invocation. (line 100) +* read errors, ignoring: dd invocation. (line 106) * read from stdin and write to stdout and files: tee invocation. (line 6) * read permission: Mode Structure. (line 12) * read permission, symbolic: Setting Permissions. (line 57) -* read system call, and holes: cp invocation. (line 216) +* read system call, and holes: cp invocation. (line 247) * readable file check: Access permission tests. (line 15) * readlink: readlink invocation. (line 6) * real user and group IDs, printing: id invocation. (line 6) * recursive directory listing: Which files are listed. - (line 90) + (line 91) * recursively changing access permissions: chmod invocation. (line 69) * recursively changing file ownership: chown invocation. (line 140) * recursively changing group ownership: chgrp invocation. (line 66) -* recursively copying directories: cp invocation. (line 76) +* recursively copying directories: cp invocation. (line 90) * redirection: Redirection. (line 6) +* reference file: chcon invocation. (line 25) * reformatting paragraph text: fmt invocation. (line 6) * regular expression matching: String expressions. (line 11) * regular file check: File type tests. (line 19) @@ -15248,7 +16284,7 @@ Index * relative items in date strings: Relative items in date strings. (line 6) * release of kernel: uname invocation. (line 61) -* remainder: Numeric expressions. (line 15) +* remainder: Numeric expressions. (line 16) * remote hostname: who invocation. (line 11) * removing empty directories: rmdir invocation. (line 6) * removing files after shredding: shred invocation. (line 123) @@ -15261,16 +16297,16 @@ Index * repeated output of a string: yes invocation. (line 6) * restricted deletion flag: Mode Structure. (line 56) * restricted shell: su invocation. (line 64) -* return, ignoring: Input. (line 29) +* return, ignoring: Input. (line 31) * return, translating to newline <1>: Output. (line 16) -* return, translating to newline: Input. (line 32) +* return, translating to newline: Input. (line 34) * reverse sorting <1>: Sorting the output. (line 27) -* reverse sorting: sort invocation. (line 157) +* reverse sorting: sort invocation. (line 170) * reversing files: tac invocation. (line 6) * rm: rm invocation. (line 6) * rmdir: rmdir invocation. (line 6) * rn format for nl: nl invocation. (line 101) -* root as default owner: install invocation. (line 72) +* root as default owner: install invocation. (line 79) * root directory, allow recursive destruction: rm invocation. (line 84) * root directory, allow recursive modification <1>: chmod invocation. (line 54) @@ -15292,6 +16328,9 @@ Index * rows: Special. (line 22) * rprnt: Characters. (line 56) * RTS/CTS flow control: Control. (line 36) +* run commands with bounded time: timeout invocation. (line 6) +* run with security context: runcon invocation. (line 6) +* runcon: runcon invocation. (line 6) * running a program in a modified environment: env invocation. (line 6) * running a program in a specified root directory: chroot invocation. @@ -15306,8 +16345,24 @@ Index * seconds since the epoch: Time conversion specifiers. (line 41) * section delimiters of pages: nl invocation. (line 68) -* seek: dd invocation. (line 46) -* self-backups: cp invocation. (line 42) +* security context <1>: id invocation. (line 45) +* security context <2>: mknod invocation. (line 54) +* security context <3>: mkfifo invocation. (line 28) +* security context <4>: mkdir invocation. (line 56) +* security context <5>: install invocation. (line 84) +* security context: What information is listed. + (line 268) +* seek: dd invocation. (line 48) +* self-backups: cp invocation. (line 53) +* SELinux <1>: id invocation. (line 45) +* SELinux <2>: mknod invocation. (line 54) +* SELinux <3>: mkfifo invocation. (line 28) +* SELinux <4>: mkdir invocation. (line 56) +* SELinux <5>: install invocation. (line 84) +* SELinux: What information is listed. + (line 268) +* SELinux context: SELinux context. (line 6) +* SELinux, context: SELinux context. (line 6) * send a signal to processes: kill invocation. (line 6) * sentences and line-breaking: fmt invocation. (line 19) * separator for numbers in seq: seq invocation. (line 42) @@ -15327,7 +16382,7 @@ Index * setup for color: dircolors invocation. (line 6) * sh syntax for color setup: dircolors invocation. - (line 27) + (line 34) * SHA-1: sha1sum invocation. (line 6) * SHA-2: sha2 utilities. (line 6) * sha1sum: sha1sum invocation. (line 6) @@ -15337,42 +16392,43 @@ Index * sha512sum: sha2 utilities. (line 6) * SHELL: su invocation. (line 18) * SHELL environment variable, and color: dircolors invocation. - (line 16) -* shell utilities: Top. (line 19) + (line 23) +* shell utilities: Top. (line 18) * shred: shred invocation. (line 6) * shuf: shuf invocation. (line 6) * shuffling files: shuf invocation. (line 6) -* SI output <1>: du invocation. (line 123) -* SI output <2>: df invocation. (line 93) +* SI output <1>: du invocation. (line 128) +* SI output <2>: df invocation. (line 99) * SI output <3>: What information is listed. - (line 258) + (line 260) * SI output: Block size. (line 43) +* signals, specifying: Signal specifications. + (line 6) * simple backup method: Backup options. (line 44) * SIMPLE_BACKUP_SUFFIX: Backup options. (line 50) * single-column output of files: General output formatting. (line 10) * size: Special. (line 30) -* size for main memory sorting: sort invocation. (line 237) +* size for main memory sorting: sort invocation. (line 288) * size of file to shred: shred invocation. (line 117) * size of files, reporting: What information is listed. - (line 242) + (line 244) * size of files, sorting files by: Sorting the output. (line 32) -* skip: dd invocation. (line 43) +* skip: dd invocation. (line 45) * sleep: sleep invocation. (line 6) * socket check: File type tests. (line 31) -* software flow control: Input. (line 43) +* software flow control: Input. (line 45) * sort: sort invocation. (line 6) -* sort field: sort invocation. (line 193) +* sort field: sort invocation. (line 219) * sort stability: sort invocation. (line 38) -* sort zero-terminated lines <1>: shuf invocation. (line 48) -* sort zero-terminated lines: sort invocation. (line 296) * sort's last-resort comparison: sort invocation. (line 38) * sorted files, operations on: Operating on sorted files. (line 6) * sorting files: sort invocation. (line 6) * sorting ls output: Sorting the output. (line 6) * space: Character sets. (line 118) -* sparse files, copying: cp invocation. (line 216) +* sparse files, copying: cp invocation. (line 247) +* sparse files, creating: truncate invocation. (line 13) * special characters: Characters. (line 6) * special file types: Special file types. (line 6) * special files: mknod invocation. (line 11) @@ -15382,36 +16438,37 @@ Index * split: split invocation. (line 6) * splitting a file into pieces: split invocation. (line 6) * splitting a file into pieces by context: csplit invocation. (line 6) -* squeezing blank lines: cat invocation. (line 35) +* squeezing empty lines: cat invocation. (line 35) * squeezing repeat characters: Squeezing. (line 6) * Stallman, R.: Introduction. (line 19) -* standard input: Common options. (line 41) -* standard output: Common options. (line 41) +* standard input: Common options. (line 49) +* standard output: Common options. (line 49) * start: Characters. (line 44) * stat: stat invocation. (line 6) +* status: dd invocation. (line 55) * status time, printing or sorting by: Sorting the output. (line 13) -* status time, show the most recent: du invocation. (line 144) +* status time, show the most recent: du invocation. (line 154) * sticky: Mode Structure. (line 56) * sticky bit check: Access permission tests. (line 12) * stop: Characters. (line 47) * stop bits: Control. (line 27) * strftime and date: date invocation. (line 20) -* string constants, outputting: od invocation. (line 68) +* string constants, outputting: od invocation. (line 76) * string expressions: String expressions. (line 6) * string tests: String tests. (line 6) * strip directory and suffix from file names: basename invocation. (line 6) * stripping non-directory suffix: dirname invocation. (line 6) -* stripping symbol table information: install invocation. (line 88) -* stripping trailing slashes <1>: mv invocation. (line 89) -* stripping trailing slashes: cp invocation. (line 250) +* stripping symbol table information: install invocation. (line 101) +* stripping trailing slashes <1>: mv invocation. (line 93) +* stripping trailing slashes: cp invocation. (line 281) * stty: stty invocation. (line 6) * su: su invocation. (line 6) * substitute user and group IDs: su invocation. (line 6) * substr: String expressions. (line 40) * subtracting permissions: Setting Permissions. (line 42) -* subtraction: Numeric expressions. (line 11) +* subtraction: Numeric expressions. (line 12) * successful exit: true invocation. (line 6) * suffix, stripping from file names: basename invocation. (line 6) * sum: sum invocation. (line 6) @@ -15420,58 +16477,67 @@ Index * superblock, writing: sync invocation. (line 6) * supplementary groups, printing: groups invocation. (line 6) * susp: Characters. (line 50) -* swab (byte-swapping): dd invocation. (line 95) +* swab (byte-swapping): dd invocation. (line 101) * swap space, saving text image in: Mode Structure. (line 56) * swtch: Characters. (line 41) -* symbol table information, stripping: install invocation. (line 88) +* symbol table information, stripping: install invocation. (line 101) +* symbol table information, stripping, program: install invocation. + (line 104) * symbolic (soft) links, creating: ln invocation. (line 6) * symbolic link check: File type tests. (line 23) * symbolic link to directory, controlling traversal of: Traversing symlinks. (line 6) -* symbolic link to directory, never traverse <1>: chgrp invocation. +* symbolic link to directory, never traverse <1>: chcon invocation. + (line 42) +* symbolic link to directory, never traverse <2>: chgrp invocation. (line 79) -* symbolic link to directory, never traverse <2>: chown invocation. +* symbolic link to directory, never traverse <3>: chown invocation. (line 152) * symbolic link to directory, never traverse: Traversing symlinks. (line 26) -* symbolic link to directory, traverse each that is encountered <1>: chgrp invocation. +* symbolic link to directory, traverse each that is encountered <1>: chcon invocation. + (line 38) +* symbolic link to directory, traverse each that is encountered <2>: chgrp invocation. (line 75) -* symbolic link to directory, traverse each that is encountered <2>: chown invocation. +* symbolic link to directory, traverse each that is encountered <3>: chown invocation. (line 148) * symbolic link to directory, traverse each that is encountered: Traversing symlinks. (line 22) -* symbolic link to directory, traverse each that is specified on the command line <1>: chgrp invocation. +* symbolic link to directory, traverse each that is specified on the command line <1>: chcon invocation. + (line 33) +* symbolic link to directory, traverse each that is specified on the command line <2>: chgrp invocation. (line 70) -* symbolic link to directory, traverse each that is specified on the command line <2>: chown invocation. +* symbolic link to directory, traverse each that is specified on the command line <3>: chown invocation. (line 143) * symbolic link to directory, traverse each that is specified on the command line: Traversing symlinks. (line 18) * symbolic link, defined: ln invocation. (line 40) -* symbolic links and pwd: pwd invocation. (line 6) +* symbolic links and pwd: pwd invocation. (line 26) * symbolic links, changing group: chgrp invocation. (line 35) * symbolic links, changing owner <1>: chgrp invocation. (line 30) * symbolic links, changing owner: chown invocation. (line 80) -* symbolic links, copying: cp invocation. (line 89) -* symbolic links, copying with: cp invocation. (line 255) +* symbolic links, copying: cp invocation. (line 103) +* symbolic links, copying with: cp invocation. (line 286) * symbolic links, dereferencing: Which files are listed. (line 36) -* symbolic links, dereferencing in du: du invocation. (line 96) -* symbolic links, dereferencing in stat: stat invocation. (line 17) -* symbolic links, following: dd invocation. (line 182) +* symbolic links, dereferencing in du: du invocation. (line 101) +* symbolic links, dereferencing in stat: stat invocation. (line 22) +* symbolic links, following: dd invocation. (line 194) * symbolic links, permissions of: chmod invocation. (line 10) * symbolic modes: Symbolic Modes. (line 6) * sync <1>: sync invocation. (line 6) -* sync: dd invocation. (line 165) -* sync (padding with nulls): dd invocation. (line 116) +* sync: dd invocation. (line 177) +* sync (padding with ASCII NULs): dd invocation. (line 122) * synchronize disk and memory: sync invocation. (line 6) -* synchronized data and metadata I/O: dd invocation. (line 165) +* synchronized data and metadata I/O: dd invocation. (line 177) * synchronized data and metadata writes, before finishing: dd invocation. - (line 125) -* synchronized data reads: dd invocation. (line 157) -* synchronized data writes, before finishing: dd invocation. (line 121) + (line 131) +* synchronized data reads: dd invocation. (line 169) +* synchronized data writes, before finishing: dd invocation. (line 127) * syslog: su invocation. (line 29) * system context: System context. (line 6) -* system information, printing: uname invocation. (line 6) +* system information, printing <1>: uname invocation. (line 6) +* system information, printing: arch invocation. (line 6) * system name, printing: hostname invocation. (line 6) * System V sum: sum invocation. (line 31) * tab stops, setting: expand invocation. (line 22) @@ -15479,18 +16545,18 @@ Index * tabs: Combination. (line 66) * tabs to spaces, converting: expand invocation. (line 6) * tac: tac invocation. (line 6) -* tagged paragraphs: fmt invocation. (line 40) +* tagged paragraphs: fmt invocation. (line 47) * tail: tail invocation. (line 6) -* tandem: Input. (line 43) -* target directory <1>: ln invocation. (line 105) -* target directory <2>: mv invocation. (line 99) -* target directory <3>: install invocation. (line 97) -* target directory <4>: cp invocation. (line 268) +* tandem: Input. (line 45) +* target directory <1>: ln invocation. (line 127) +* target directory <2>: mv invocation. (line 103) +* target directory <3>: install invocation. (line 113) +* target directory <4>: cp invocation. (line 299) * target directory: Target directory. (line 6) * tebibyte, definition of: Block size. (line 106) * tee: tee invocation. (line 6) * telephone directory order: sort invocation. (line 85) -* temporary directory: sort invocation. (line 273) +* temporary directory: sort invocation. (line 324) * terabyte, definition of: Block size. (line 102) * TERM: su invocation. (line 53) * terminal check: File type tests. (line 34) @@ -15499,13 +16565,13 @@ Index * terminal settings: stty invocation. (line 6) * terminal, using color iff: General output formatting. (line 25) -* terse output: stat invocation. (line 48) +* terse output: stat invocation. (line 53) * test: test invocation. (line 6) -* text: dd invocation. (line 192) -* text I/O: dd invocation. (line 192) +* text: dd invocation. (line 204) +* text I/O: dd invocation. (line 204) * text image, saving in swap space: Mode Structure. (line 56) -* text input files: md5sum invocation. (line 79) -* text utilities: Top. (line 19) +* text input files: md5sum invocation. (line 87) +* text utilities: Top. (line 18) * text, displaying: echo invocation. (line 6) * text, reformatting: fmt invocation. (line 6) * this in date strings: Relative items in date strings. @@ -15515,22 +16581,25 @@ Index * time conversion specifiers: Time conversion specifiers. (line 6) * time formats <1>: date invocation. (line 20) -* time formats: pr invocation. (line 100) +* time formats: pr invocation. (line 98) +* time limit: timeout invocation. (line 6) * time of day item: Time of day items. (line 6) * time setting: Setting the time. (line 6) -* time style <1>: du invocation. (line 153) +* time style <1>: du invocation. (line 163) * time style: Formatting file timestamps. (line 26) -* time units: sleep invocation. (line 11) +* time units <1>: sleep invocation. (line 11) +* time units: timeout invocation. (line 11) * time zone correction: Time of day items. (line 30) * time zone item <1>: Time zone items. (line 6) * time zone item: General date syntax. (line 44) * time, printing or setting: date invocation. (line 6) -* TIME_STYLE <1>: du invocation. (line 181) +* TIME_STYLE <1>: du invocation. (line 191) * TIME_STYLE: Formatting file timestamps. (line 106) +* timeout: timeout invocation. (line 6) * timestamps of installed files, preserving: install invocation. - (line 78) + (line 91) * timestamps, changing file: touch invocation. (line 6) * TMPDIR: sort invocation. (line 64) * today in date strings: Relative items in date strings. @@ -15546,43 +16615,46 @@ Index * trailing slashes: Trailing slashes. (line 6) * translating characters: Translating. (line 6) * true: true invocation. (line 6) -* truncating output file, avoiding: dd invocation. (line 113) +* truncate: truncate invocation. (line 6) +* truncating output file, avoiding: dd invocation. (line 119) +* truncating, file sizes: truncate invocation. (line 6) * tsort: tsort invocation. (line 6) * tty: tty invocation. (line 6) * Twenex: su invocation. (line 92) * two-way parity: Control. (line 9) -* type size: od invocation. (line 113) +* type size: od invocation. (line 122) * TZ <1>: Specifying time zone rules. (line 6) -* TZ <2>: Options for date. (line 83) +* TZ <2>: Options for date. (line 87) * TZ <3>: date invocation. (line 16) * TZ <4>: who invocation. (line 26) -* TZ <5>: stat invocation. (line 131) +* TZ <5>: stat invocation. (line 139) * TZ <6>: touch invocation. (line 37) * TZ <7>: Formatting file timestamps. (line 18) -* TZ: pr invocation. (line 113) +* TZ: pr invocation. (line 111) * u, and disabling special characters: Characters. (line 13) -* ucase, converting to: dd invocation. (line 90) -* ufs file system type: df invocation. (line 125) +* ucase, converting to: dd invocation. (line 96) +* ufs file system type: df invocation. (line 131) * umask and modes: Umask and Protection. (line 6) * uname: uname invocation. (line 6) -* unblock: dd invocation. (line 81) +* unblock: dd invocation. (line 87) * unexpand: unexpand invocation. (line 6) -* Unicode: printf invocation. (line 62) +* Unicode: printf invocation. (line 68) * uniq: uniq invocation. (line 6) -* unique lines, outputting: uniq invocation. (line 98) +* unique lines, outputting: uniq invocation. (line 101) * uniquify files: uniq invocation. (line 6) -* uniquifying output: sort invocation. (line 282) +* uniquifying output: sort invocation. (line 333) * unlink: unlink invocation. (line 6) -* unprintable characters, ignoring: sort invocation. (line 125) +* unprintable characters, ignoring: sort invocation. (line 130) * unsorted directory listing: Sorting the output. (line 20) * upper: Character sets. (line 121) -* uppercase, translating to lowercase: Input. (line 48) +* uppercase, translating to lowercase: Input. (line 50) +* uptime: uptime invocation. (line 6) * use time, changing: touch invocation. (line 50) * use time, printing or sorting files by: Sorting the output. (line 13) -* use time, show the most recent: du invocation. (line 144) +* use time, show the most recent: du invocation. (line 154) * USER: su invocation. (line 18) * user ID, switching: su invocation. (line 6) * user IDs, disambiguating: Disambiguating names and IDs. @@ -15593,25 +16665,26 @@ Index (line 6) * usernames, printing current: users invocation. (line 6) * users: users invocation. (line 6) -* UTC: Options for date. (line 83) +* UTC: Options for date. (line 87) * utmp <1>: who invocation. (line 15) * utmp <2>: users invocation. (line 14) * utmp: logname invocation. (line 6) * valid file names, checking for: pathchk invocation. (line 6) * variable-length records, converting to fixed-length: dd invocation. - (line 38) + (line 40) * vdir: vdir invocation. (line 6) * verbose ls format: What information is listed. - (line 130) + (line 131) * verifying MD5 checksums: md5sum invocation. (line 69) -* version number, finding: Common options. (line 33) +* version number sort: sort invocation. (line 164) +* version number, finding: Common options. (line 41) * version of kernel: uname invocation. (line 76) * version, sorting option for ls: Sorting the output. (line 56) * version-control Emacs variable: Backup options. (line 24) -* VERSION_CONTROL <1>: ln invocation. (line 55) -* VERSION_CONTROL <2>: mv invocation. (line 50) -* VERSION_CONTROL <3>: install invocation. (line 40) -* VERSION_CONTROL <4>: cp invocation. (line 61) +* VERSION_CONTROL <1>: ln invocation. (line 77) +* VERSION_CONTROL <2>: mv invocation. (line 56) +* VERSION_CONTROL <3>: install invocation. (line 42) +* VERSION_CONTROL <4>: cp invocation. (line 75) * VERSION_CONTROL: Backup options. (line 13) * vertical sorted files in columns: General output formatting. (line 15) @@ -15627,18 +16700,18 @@ Index * word count: wc invocation. (line 6) * working context: Working context. (line 6) * working directory, printing: pwd invocation. (line 6) -* wrap data: base64 invocation. (line 21) +* wrap data: base64 invocation. (line 22) * wrapping long input lines: fold invocation. (line 6) * writable file check: Access permission tests. (line 21) * write permission: Mode Structure. (line 15) * write permission, symbolic: Setting Permissions. (line 60) -* write, allowed: who invocation. (line 86) +* write, allowed: who invocation. (line 95) * wtmp <1>: who invocation. (line 15) * wtmp: users invocation. (line 14) * xcase: Local. (line 36) * xdigit: Character sets. (line 124) -* XON/XOFF flow control: Input. (line 38) +* XON/XOFF flow control: Input. (line 40) * year in date strings: Relative items in date strings. (line 15) * yes: yes invocation. (line 6) @@ -15654,210 +16727,218 @@ Index  Tag Table: -Node: Top7718 -Node: Introduction20818 -Node: Common options22377 -Node: Exit status25162 -Node: Backup options25892 -Node: Block size27816 -Node: Disambiguating names and IDs32732 -Ref: Disambiguating names and IDs-Footnote-134290 -Node: Random sources34360 -Node: Target directory36109 -Node: Trailing slashes39594 -Node: Traversing symlinks40615 -Node: Treating / specially41686 -Node: Special built-in utilities43227 -Node: Standards conformance44362 -Node: Output of entire files45878 -Node: cat invocation46479 -Node: tac invocation48207 -Node: nl invocation49469 -Node: od invocation53348 -Node: base64 invocation59711 -Node: Formatting file contents61073 -Node: fmt invocation61524 -Node: pr invocation64337 -Node: fold invocation77122 -Node: Output of parts of files78582 -Node: head invocation79090 -Node: tail invocation80806 -Node: split invocation88629 -Node: csplit invocation90715 -Node: Summarizing files94827 -Node: wc invocation95475 -Node: sum invocation98360 -Node: cksum invocation99765 -Node: md5sum invocation100905 -Node: sha1sum invocation105599 -Node: sha2 utilities106379 -Node: Operating on sorted files107003 -Node: sort invocation107659 -Ref: sort invocation-Footnote-1127034 -Node: shuf invocation127586 -Node: uniq invocation130150 -Node: comm invocation134230 -Node: tsort invocation135558 -Node: tsort background138592 -Node: ptx invocation140355 -Node: General options in ptx143159 -Node: Charset selection in ptx143740 -Node: Input processing in ptx144642 -Node: Output formatting in ptx150063 -Node: Compatibility in ptx156629 -Node: Operating on fields within a line159858 -Node: cut invocation160262 -Node: paste invocation163581 -Node: join invocation164909 -Node: Operating on characters169133 -Node: tr invocation169569 -Node: Character sets171287 -Node: Translating175718 -Node: Squeezing177809 -Node: expand invocation180876 -Node: unexpand invocation182358 -Node: Directory listing184176 -Node: ls invocation184662 -Ref: ls invocation-Footnote-1186476 -Node: Which files are listed186698 -Node: What information is listed190358 -Node: Sorting the output199334 -Node: More details about version sort201654 -Node: General output formatting203152 -Node: Formatting file timestamps207060 -Node: Formatting the file names212401 -Node: dir invocation215317 -Node: vdir invocation215728 -Node: dircolors invocation216106 -Node: Basic operations217586 -Node: cp invocation218206 -Node: dd invocation230266 -Node: install invocation238684 -Node: mv invocation242911 -Node: rm invocation247201 -Node: shred invocation251515 -Node: Special file types259000 -Node: link invocation260496 -Node: ln invocation261502 -Node: mkdir invocation266564 -Node: mkfifo invocation268813 -Node: mknod invocation269818 -Node: readlink invocation271577 -Node: rmdir invocation273320 -Node: unlink invocation274593 -Node: Changing file attributes275552 -Node: chown invocation276366 -Node: chgrp invocation282552 -Node: chmod invocation285602 -Node: touch invocation288357 -Node: Disk usage292953 -Node: df invocation293545 -Node: du invocation299217 -Node: stat invocation307207 -Node: sync invocation311049 -Node: Printing text311976 -Node: echo invocation312350 -Node: printf invocation314527 -Node: yes invocation319234 -Node: Conditions319846 -Node: false invocation320437 -Node: true invocation321472 -Node: test invocation322751 -Node: File type tests324711 -Node: Access permission tests325593 -Node: File characteristic tests326478 -Node: String tests327243 -Node: Numeric tests327908 -Node: Connectives for test328705 -Node: expr invocation329058 -Node: String expressions331319 -Node: Numeric expressions333902 -Node: Relations for expr334540 -Node: Examples of expr335740 -Node: Redirection336468 -Node: tee invocation336913 -Node: File name manipulation337978 -Node: basename invocation338426 -Node: dirname invocation339873 -Node: pathchk invocation341079 -Node: Working context342743 -Node: pwd invocation343387 -Node: stty invocation344061 -Node: Control346821 -Node: Input347581 -Node: Output349057 -Node: Local350313 -Node: Combination351895 -Node: Characters354057 -Node: Special355611 -Node: printenv invocation356977 -Node: tty invocation357740 -Node: User information358446 -Node: id invocation359081 -Node: logname invocation360297 -Node: whoami invocation360924 -Node: groups invocation361411 -Node: users invocation362147 -Node: who invocation363094 -Node: System context365863 -Node: date invocation366353 -Node: Time conversion specifiers368011 -Node: Date conversion specifiers370411 -Node: Literal conversion specifiers373535 -Node: Padding and other flags373893 -Node: Setting the time376087 -Node: Options for date377093 -Node: Examples of date380398 -Ref: %s-examples381841 -Node: uname invocation384026 -Node: hostname invocation386599 -Node: hostid invocation387212 -Node: Modified command invocation387899 -Node: chroot invocation388525 -Node: env invocation390644 -Node: nice invocation392723 -Node: nohup invocation396219 -Node: su invocation398210 -Node: Process control402683 -Node: kill invocation402906 -Node: Delaying407272 -Node: sleep invocation407469 -Node: Numeric operations408333 -Node: factor invocation408665 -Node: seq invocation410003 -Node: File permissions414284 -Node: Mode Structure414902 -Node: Symbolic Modes418597 -Node: Setting Permissions419695 -Node: Copying Permissions422308 -Node: Changing Special Mode Bits423127 -Node: Conditional Executability424949 -Node: Multiple Changes425493 -Node: Umask and Protection427160 -Node: Numeric Modes428265 -Node: Directory Setuid and Setgid430165 -Node: Date input formats432427 -Node: General date syntax434780 -Node: Calendar date items437739 -Node: Time of day items439744 -Node: Time zone items441868 -Node: Day of week items443110 -Node: Relative items in date strings444107 -Node: Pure numbers in date strings446917 -Node: Seconds since the Epoch447906 -Node: Specifying time zone rules449535 -Node: Authors of get_date451907 -Node: Opening the software toolbox452667 -Node: Toolbox introduction453328 -Node: I/O redirection456051 -Node: The who command458885 -Node: The cut command459782 -Node: The sort command460845 -Node: The uniq command461549 -Node: Putting the tools together462239 -Ref: Putting the tools together-Footnote-1474196 -Node: Copying This Manual474270 -Node: GNU Free Documentation License474525 -Node: Index496926 +Node: Top8131 +Node: Introduction21819 +Node: Common options23378 +Node: Exit status26592 +Node: Backup options27333 +Node: Block size29257 +Node: Signal specifications34166 +Node: Disambiguating names and IDs36216 +Ref: Disambiguating names and IDs-Footnote-137785 +Node: Random sources37855 +Node: Target directory39472 +Node: Trailing slashes42957 +Node: Traversing symlinks43978 +Node: Treating / specially45049 +Node: Special built-in utilities46596 +Node: Standards conformance47731 +Node: Output of entire files49247 +Node: cat invocation49848 +Node: tac invocation51604 +Node: nl invocation52866 +Node: od invocation56745 +Node: base64 invocation63567 +Node: Formatting file contents64948 +Node: fmt invocation65399 +Node: pr invocation68464 +Node: fold invocation80921 +Node: Output of parts of files82381 +Node: head invocation82889 +Node: tail invocation85048 +Node: split invocation93398 +Node: csplit invocation95728 +Node: Summarizing files100479 +Node: wc invocation101127 +Node: sum invocation104201 +Node: cksum invocation105606 +Node: md5sum invocation106746 +Node: sha1sum invocation111807 +Node: sha2 utilities112587 +Node: Operating on sorted files113211 +Node: sort invocation113812 +Ref: sort invocation-Footnote-1135640 +Node: shuf invocation136192 +Node: uniq invocation138771 +Node: comm invocation143463 +Node: ptx invocation145867 +Node: General options in ptx148671 +Node: Charset selection in ptx149252 +Node: Input processing in ptx150154 +Node: Output formatting in ptx155575 +Node: Compatibility in ptx162141 +Node: tsort invocation165374 +Node: tsort background168533 +Node: Operating on fields within a line170181 +Node: cut invocation170585 +Node: paste invocation173902 +Node: join invocation175230 +Node: Operating on characters180365 +Node: tr invocation180801 +Node: Character sets182519 +Node: Translating186950 +Node: Squeezing189041 +Node: expand invocation192108 +Node: unexpand invocation193590 +Node: Directory listing195408 +Node: ls invocation195894 +Ref: ls invocation-Footnote-1197968 +Node: Which files are listed198190 +Node: What information is listed201930 +Node: Sorting the output211177 +Node: More details about version sort213497 +Node: General output formatting215224 +Node: Formatting file timestamps219132 +Node: Formatting the file names224473 +Node: dir invocation227389 +Node: vdir invocation227800 +Node: dircolors invocation228178 +Node: Basic operations229876 +Node: cp invocation230496 +Node: dd invocation244077 +Node: install invocation253468 +Node: mv invocation258491 +Node: rm invocation262927 +Node: shred invocation267231 +Node: Special file types274744 +Node: link invocation276240 +Node: ln invocation277246 +Node: mkdir invocation283613 +Node: mkfifo invocation285984 +Node: mknod invocation287104 +Node: readlink invocation289234 +Node: rmdir invocation290977 +Node: unlink invocation292251 +Node: Changing file attributes293210 +Node: chown invocation294024 +Node: chgrp invocation300210 +Node: chmod invocation303260 +Node: touch invocation306015 +Node: Disk usage310661 +Node: df invocation311322 +Node: du invocation317264 +Node: stat invocation325790 +Node: sync invocation329772 +Node: truncate invocation330727 +Node: Printing text332455 +Node: echo invocation332829 +Node: printf invocation335258 +Node: yes invocation340494 +Node: Conditions341106 +Node: false invocation341697 +Node: true invocation342732 +Node: test invocation344011 +Node: File type tests346051 +Node: Access permission tests346933 +Node: File characteristic tests347818 +Node: String tests348583 +Node: Numeric tests349248 +Node: Connectives for test350054 +Node: expr invocation350407 +Node: String expressions352848 +Node: Numeric expressions355432 +Node: Relations for expr356129 +Node: Examples of expr357323 +Node: Redirection358047 +Node: tee invocation358505 +Node: File name manipulation363295 +Node: basename invocation363756 +Node: dirname invocation365203 +Node: pathchk invocation366409 +Node: Working context368147 +Node: pwd invocation368791 +Node: stty invocation370135 +Node: Control372895 +Node: Input373655 +Node: Output375328 +Node: Local376648 +Node: Combination378230 +Node: Characters380451 +Node: Special382005 +Node: printenv invocation383662 +Node: tty invocation384425 +Node: User information385131 +Node: id invocation385766 +Node: logname invocation387537 +Node: whoami invocation388164 +Node: groups invocation388651 +Node: users invocation389856 +Node: who invocation390803 +Node: System context393739 +Node: SELinux context394339 +Node: chcon invocation394714 +Node: runcon invocation396538 +Node: date invocation398004 +Node: Time conversion specifiers399746 +Node: Date conversion specifiers402146 +Node: Literal conversion specifiers405270 +Node: Padding and other flags405628 +Node: Setting the time407819 +Node: Options for date408825 +Node: Examples of date412301 +Ref: %s-examples413719 +Node: arch invocation415904 +Node: uname invocation416328 +Node: hostname invocation418901 +Node: hostid invocation419514 +Node: uptime invocation420227 +Node: Modified command invocation421350 +Node: chroot invocation422030 +Ref: chroot invocation-Footnote-1424187 +Node: env invocation424489 +Node: nice invocation426547 +Node: nohup invocation430261 +Node: su invocation432417 +Node: timeout invocation436917 +Node: Process control438076 +Node: kill invocation438299 +Node: Delaying441370 +Node: sleep invocation441567 +Node: Numeric operations442687 +Node: factor invocation443019 +Node: seq invocation444770 +Node: File permissions448390 +Node: Mode Structure449008 +Node: Symbolic Modes452703 +Node: Setting Permissions453801 +Node: Copying Permissions456414 +Node: Changing Special Mode Bits457233 +Node: Conditional Executability459055 +Node: Multiple Changes459599 +Node: Umask and Protection461266 +Node: Numeric Modes462371 +Node: Directory Setuid and Setgid464271 +Node: Date input formats466533 +Node: General date syntax468886 +Node: Calendar date items471845 +Node: Time of day items473850 +Node: Time zone items476054 +Node: Day of week items477296 +Node: Relative items in date strings478293 +Node: Pure numbers in date strings481103 +Node: Seconds since the Epoch482092 +Node: Specifying time zone rules483721 +Node: Authors of get_date486093 +Node: Opening the software toolbox486853 +Node: Toolbox introduction487525 +Node: I/O redirection490248 +Node: The who command493082 +Node: The cut command493979 +Node: The sort command495042 +Node: The uniq command495746 +Node: Putting the tools together496436 +Ref: Putting the tools together-Footnote-1508388 +Node: GNU Free Documentation License508462 +Node: Concept index533655  End Tag Table diff --git a/src/bin/coreutils/doc/coreutils.texi b/src/bin/coreutils/doc/coreutils.texi index 588147f532..b96fdb2029 100644 --- a/src/bin/coreutils/doc/coreutils.texi +++ b/src/bin/coreutils/doc/coreutils.texi @@ -31,13 +31,15 @@ @c FIXME: the following need documentation @c * [: (coreutils)[ invocation. File/string tests. @c * pinky: (coreutils)pinky invocation. FIXME. -@c * uptime: (coreutils)uptime invocation. FIXME. +@c * mktemp: (coreutils)mktemp invocation. FIXME. @dircategory Individual utilities @direntry +* arch: (coreutils)arch invocation. Print machine hardware name. * base64: (coreutils)base64 invocation. Base64 encode/decode data. * basename: (coreutils)basename invocation. Strip directory and suffix. * cat: (coreutils)cat invocation. Concatenate and write files. +* chcon: (coreutils)chcon invocation. Change SELinux CTX of files. * chgrp: (coreutils)chgrp invocation. Change file groups. * chmod: (coreutils)chmod invocation. Change file permissions. * chown: (coreutils)chown invocation. Change file owners/groups. @@ -93,6 +95,7 @@ * readlink: (coreutils)readlink invocation. Print referent of a symlink. * rm: (coreutils)rm invocation. Remove files. * rmdir: (coreutils)rmdir invocation. Remove empty directories. +* runcon: (coreutils)runcon invocation. Run in specified SELinux CTX. * seq: (coreutils)seq invocation. Print numeric sequences * sha1sum: (coreutils)sha1sum invocation. Print or check SHA-1 digests. * sha2: (coreutils)sha2 utilities. Print or check SHA-2 digests. @@ -110,15 +113,18 @@ * tail: (coreutils)tail invocation. Output the last part of files. * tee: (coreutils)tee invocation. Redirect to multiple files. * test: (coreutils)test invocation. File/string tests. +* timeout: (coreutils)timeout invocation. Run with time limit. * touch: (coreutils)touch invocation. Change file timestamps. * tr: (coreutils)tr invocation. Translate characters. * true: (coreutils)true invocation. Do nothing, successfully. +* truncate: (coreutils)truncate invocation. Shrink/extend size of a file. * tsort: (coreutils)tsort invocation. Topological sort. * tty: (coreutils)tty invocation. Print terminal name. * uname: (coreutils)uname invocation. Print system information. * unexpand: (coreutils)unexpand invocation. Convert spaces to tabs. * uniq: (coreutils)uniq invocation. Uniquify files. * unlink: (coreutils)unlink invocation. Removal via unlink(2). +* uptime: (coreutils)uptime invocation. Print uptime and load. * users: (coreutils)users invocation. Print current user names. * vdir: (coreutils)vdir invocation. List directories verbosely. * wc: (coreutils)wc invocation. Line, word, and byte counts. @@ -131,12 +137,11 @@ This manual documents version @value{VERSION} of the @sc{gnu} core utilities, including the standard programs for text and file manipulation. -Copyright @copyright{} 1994, 1995, 1996, 2000, 2001, 2002, 2003, 2004, -2005, 2006 Free Software Foundation, Inc. +Copyright @copyright{} 1994-1996, 2000-2009 Free Software Foundation, Inc. @quotation Permission is granted to copy, distribute and/or modify this document -under the terms of the GNU Free Documentation License, Version 1.2 or +under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in the section entitled ``GNU @@ -154,7 +159,8 @@ Free Documentation License''. @vskip 0pt plus 1filll @insertcopying @end titlepage - +@shortcontents +@contents @ifnottex @node Top @@ -182,23 +188,24 @@ Free Documentation License''. * Basic operations:: cp dd install mv rm shred * Special file types:: ln mkdir rmdir mkfifo mknod * Changing file attributes:: chgrp chmod chown touch -* Disk usage:: df du stat sync +* Disk usage:: df du stat sync truncate * Printing text:: echo printf yes * Conditions:: false true test expr * Redirection:: tee * File name manipulation:: dirname basename pathchk * Working context:: pwd stty printenv tty * User information:: id logname whoami groups users who -* System context:: date uname hostname hostid -* Modified command invocation:: chroot env nice nohup su +* System context:: date uname hostname hostid uptime +* SELinux context:: chcon runcon +* Modified command invocation:: chroot env nice nohup su timeout * Process control:: kill * Delaying:: sleep * Numeric operations:: factor seq * File permissions:: Access modes. * Date input formats:: Specifying date strings. * Opening the software toolbox:: The software tools philosophy. -* Copying This Manual:: License for copying this manual. -* Index:: General index. +* GNU Free Documentation License:: Copying and sharing this manual. +* Concept index:: General index. @detailmenu --- The Detailed Node Listing --- @@ -208,6 +215,7 @@ Common Options * Exit status:: Indicating program success or failure. * Backup options:: Backup options * Block size:: Block size +* Signal specifications:: Specifying signals * Disambiguating names and IDs:: chgrp and chown owner and group syntax * Random sources:: Sources of random data * Target directory:: Target directory @@ -330,6 +338,7 @@ Disk usage * du invocation:: Estimate file space usage * stat invocation:: Report file or file system status * sync invocation:: Synchronize data on disk with memory +* truncate invocation:: Shrink or extend the size of a file Printing text @@ -361,13 +370,13 @@ Conditions Redirection -* tee invocation:: Redirect output to multiple files +* tee invocation:: Redirect output to multiple files or processes File name manipulation * basename invocation:: Strip directory and suffix from a file name * dirname invocation:: Strip non-directory suffix from a file name -* pathchk invocation:: Check file name portability +* pathchk invocation:: Check file name validity and portability Working context @@ -397,10 +406,12 @@ User information System context +* arch invocation:: Print machine hardware name * date invocation:: Print or set system date and time * uname invocation:: Print system information * hostname invocation:: Print or set system name -* hostid invocation:: Print numeric host identifier. +* hostid invocation:: Print numeric host identifier +* uptime invocation:: Print system uptime and load @command{date}: Print or set system date and time @@ -410,8 +421,13 @@ System context * Padding and other flags:: Pad with zeros, spaces, etc. * Setting the time:: Changing the system clock. * Options for date:: Instead of the current time. +* Date input formats:: Specifying date strings. * Examples of date:: Examples. +SELinux context +* chcon invocation:: Change SELinux context of file +* runcon invocation:: Run a command in specified SELinux context + Modified command invocation * chroot invocation:: Run a command with a different root directory @@ -419,6 +435,7 @@ Modified command invocation * nice invocation:: Run a command with modified niceness * nohup invocation:: Run a command immune to hangups * su invocation:: Run a command with substitute user and group ID +* timeout invocation:: Run a command with a time limit Process control @@ -465,7 +482,7 @@ Opening the software toolbox Copying This Manual -* GNU Free Documentation License:: License for copying this manual. +* GNU Free Documentation License:: Copying and sharing this manual. @end detailmenu @end menu @@ -574,6 +591,7 @@ you prefer powers of 1024. @cindex human-readable output Append a size letter to each size, such as @samp{M} for mebibytes. Powers of 1024 are used, not 1000; @samp{M} stands for 1,048,576 bytes. +This option is equivalent to @option{--block-size=human-readable}. Use the @option{--si} option if you prefer powers of 1000. @end macro @@ -585,6 +603,54 @@ Remove any trailing slashes from each @var{source} argument. @xref{Trailing slashes}. @end macro +@macro mayConflictWithShellBuiltIn{cmd} +@cindex conflicts with shell built-ins +@cindex built-in shell commands, conflicts with +Due to shell aliases and built-in @command{\cmd\} command, using an +unadorned @command{\cmd\} interactively or in a script may get you +different functionality than that described here. Invoke it via +@command{env} (i.e., @code{env \cmd\ @dots{}}) to avoid interference +from the shell. + +@end macro + +@macro multiplierSuffixes{varName} +@ignore +Appending @samp{b} multiplies @var{\varName\} by 512, +@samp{kB} by 1000, @samp{K} by 1024, +@samp{MB} by 1000*1000, @samp{M} by 1024*1024, +@samp{GB} by 1000*1000*1000, @samp{G} by 1024*1024*1024, +and so on for @samp{T}, @samp{P}, @samp{E}, @samp{Z}, and @samp{Y}. +@end ignore +@var{\varName\} is a number which may have one of the following +multiplicative suffixes: +@example +@samp{b} => 512 ("blocks") +@samp{KB} => 1000 (KiloBytes) +@samp{K} => 1024 (KibiBytes) +@samp{MB} => 1000*1000 (MegaBytes) +@samp{M} => 1024*1024 (MebiBytes) +@samp{GB} => 1000*1000*1000 (GigaBytes) +@samp{G} => 1024*1024*1024 (GibiBytes) +@end example +and so on for @samp{T}, @samp{P}, @samp{E}, @samp{Z}, and @samp{Y}. +@end macro + +@c FIXME: same as above, but no ``blocks'' line. +@macro multiplierSuffixesNoBlocks{varName} +@var{\varName\} is a number which may have one of the following +multiplicative suffixes: +@example +@samp{KB} => 1000 (KiloBytes) +@samp{K} => 1024 (KibiBytes) +@samp{MB} => 1000*1000 (MegaBytes) +@samp{M} => 1024*1024 (MebiBytes) +@samp{GB} => 1000*1000*1000 (GigaBytes) +@samp{G} => 1024*1024*1024 (GibiBytes) +@end example +and so on for @samp{T}, @samp{P}, @samp{E}, @samp{Z}, and @samp{Y}. +@end macro + @cindex common options Certain options are available in all of these programs. Rather than @@ -607,8 +673,15 @@ program description. For example, the @command{env} command's options must appear before its operands, since in some cases the operands specify a command that itself contains options. +Most programs that accept long options recognize unambiguous +abbreviations of those options. For example, @samp{rmdir +--ignore-fail-on-non-empty} can be invoked as @samp{rmdir +--ignore-fail} or even @samp{rmdir --i}. Ambiguous options, such as +@samp{ls --h}, are identified as such. + Some of these programs recognize the @option{--help} and @option{--version} -options only when one of them is the sole command line argument. +options only when one of them is the sole command line argument. For +these programs, abbreviations of the long options are not always recognized. @table @samp @@ -645,6 +718,7 @@ name. * Exit status:: Indicating program success or failure. * Backup options:: -b -S, in some programs. * Block size:: BLOCK_SIZE and --block-size, in some programs. +* Signal specifications:: Specifying signals using the --signal option. * Disambiguating names and IDs:: chgrp and chown owner and group syntax * Random sources:: --random-source, in some programs. * Target directory:: Specifying a target directory, in some programs. @@ -676,8 +750,8 @@ other exit status values and a few associate different meanings with the values @samp{0} and @samp{1}. Here are some of the exceptions: @command{chroot}, @command{env}, @command{expr}, -@command{nice}, @command{nohup}, @command{printenv}, -@command{sort}, @command{su}, @command{test}, @command{tty}. +@command{nice}, @command{nohup}, @command{printenv}, @command{sort}, +@command{su}, @command{test}, @command{timeout}, @command{tty}. @node Backup options @@ -858,7 +932,7 @@ kilobyte: @math{10^3 = 1000}. @itemx K @itemx KiB @cindex kibibyte, definition of -kibibyte: @math{2^10 = 1024}. @samp{K} is special: the SI prefix is +kibibyte: @math{2^{10} = 1024}. @samp{K} is special: the SI prefix is @samp{k} and the IEC 60027-2 prefix is @samp{Ki}, but tradition and @acronym{POSIX} use @samp{k} to mean @samp{KiB}. @item MB @@ -867,48 +941,48 @@ megabyte: @math{10^6 = 1,000,000}. @item M @itemx MiB @cindex mebibyte, definition of -mebibyte: @math{2^20 = 1,048,576}. +mebibyte: @math{2^{20} = 1,048,576}. @item GB @cindex gigabyte, definition of gigabyte: @math{10^9 = 1,000,000,000}. @item G @itemx GiB @cindex gibibyte, definition of -gibibyte: @math{2^30 = 1,073,741,824}. +gibibyte: @math{2^{30} = 1,073,741,824}. @item TB @cindex terabyte, definition of -terabyte: @math{10^12 = 1,000,000,000,000}. +terabyte: @math{10^{12} = 1,000,000,000,000}. @item T @itemx TiB @cindex tebibyte, definition of -tebibyte: @math{2^40 = 1,099,511,627,776}. +tebibyte: @math{2^{40} = 1,099,511,627,776}. @item PB @cindex petabyte, definition of -petabyte: @math{10^15 = 1,000,000,000,000,000}. +petabyte: @math{10^{15} = 1,000,000,000,000,000}. @item P @itemx PiB @cindex pebibyte, definition of -pebibyte: @math{2^50 = 1,125,899,906,842,624}. +pebibyte: @math{2^{50} = 1,125,899,906,842,624}. @item EB @cindex exabyte, definition of -exabyte: @math{10^18 = 1,000,000,000,000,000,000}. +exabyte: @math{10^{18} = 1,000,000,000,000,000,000}. @item E @itemx EiB @cindex exbibyte, definition of -exbibyte: @math{2^60 = 1,152,921,504,606,846,976}. +exbibyte: @math{2^{60} = 1,152,921,504,606,846,976}. @item ZB @cindex zettabyte, definition of -zettabyte: @math{10^21 = 1,000,000,000,000,000,000,000} +zettabyte: @math{10^{21} = 1,000,000,000,000,000,000,000} @item Z @itemx ZiB -@math{2^70 = 1,180,591,620,717,411,303,424}. +@math{2^{70} = 1,180,591,620,717,411,303,424}. (@samp{Zi} is a @acronym{GNU} extension to IEC 60027-2.) @item YB @cindex yottabyte, definition of -yottabyte: @math{10^24 = 1,000,000,000,000,000,000,000,000}. +yottabyte: @math{10^{24} = 1,000,000,000,000,000,000,000,000}. @item Y @itemx YiB -@math{2^80 = 1,208,925,819,614,629,174,706,176}. +@math{2^{80} = 1,208,925,819,614,629,174,706,176}. (@samp{Yi} is a @acronym{GNU} extension to IEC 60027-2.) @end table @@ -926,6 +1000,95 @@ set. The @option{-h} or @option{--human-readable} option is equivalent to @option{--block-size=human-readable}. The @option{--si} option is equivalent to @option{--block-size=si}. +@node Signal specifications +@section Signal specifications +@cindex signals, specifying + +A @var{signal} may be a signal name like @samp{HUP}, or a signal +number like @samp{1}, or an exit status of a process terminated by the +signal. A signal name can be given in canonical form or prefixed by +@samp{SIG}. The case of the letters is ignored. The following signal names +and numbers are supported on all @acronym{POSIX} compliant systems: + +@table @samp +@item HUP +1. Hangup. +@item INT +2. Terminal interrupt. +@item QUIT +3. Terminal quit. +@item ABRT +6. Process abort. +@item KILL +9. Kill (cannot be caught or ignored). +@item ALRM +14. Alarm Clock. +@item TERM +15. Termination. +@end table + +@noindent +Other supported signal names have system-dependent corresponding +numbers. All systems conforming to @acronym{POSIX} 1003.1-2001 also +support the following signals: + +@table @samp +@item BUS +Access to an undefined portion of a memory object. +@item CHLD +Child process terminated, stopped, or continued. +@item CONT +Continue executing, if stopped. +@item FPE +Erroneous arithmetic operation. +@item ILL +Illegal Instruction. +@item PIPE +Write on a pipe with no one to read it. +@item SEGV +Invalid memory reference. +@item STOP +Stop executing (cannot be caught or ignored). +@item TSTP +Terminal stop. +@item TTIN +Background process attempting read. +@item TTOU +Background process attempting write. +@item URG +High bandwidth data is available at a socket. +@item USR1 +User-defined signal 1. +@item USR2 +User-defined signal 2. +@end table + +@noindent +@acronym{POSIX} 1003.1-2001 systems that support the @acronym{XSI} extension +also support the following signals: + +@table @samp +@item POLL +Pollable event. +@item PROF +Profiling timer expired. +@item SYS +Bad system call. +@item TRAP +Trace/breakpoint trap. +@item VTALRM +Virtual timer expired. +@item XCPU +CPU time limit exceeded. +@item XFSZ +File size limit exceeded. +@end table + +@noindent +@acronym{POSIX} 1003.1-2001 systems that support the @acronym{XRT} extension +also support at least eight real-time signals called @samp{RTMIN}, +@samp{RTMIN+1}, @dots{}, @samp{RTMAX-1}, @samp{RTMAX}. + @node Disambiguating names and IDs @section chown and chgrp: Disambiguating user names and IDs @cindex user names, disambiguating @@ -976,12 +1139,19 @@ sometimes need random data to do their work. For example, @samp{sort -R} must choose a hash function at random, and it needs random data to make this selection. -Normally these commands use the device file @file{/dev/urandom} as the +By default these commands use an internal pseudorandom generator +initialized by a small amount of entropy, but can be directed to use +an external source with the @option{--random-source=@var{file}} option. +An error is reported if @var{file} does not contain enough bytes. + +For example, the device file @file{/dev/urandom} could be used as the source of random data. Typically, this device gathers environmental noise from device drivers and other sources into an entropy pool, and uses the pool to generate random bits. If the pool is short of data, the device reuses the internal pool to produce more bits, using a -cryptographically secure pseudorandom number generator. +cryptographically secure pseudorandom number generator. But be aware +that this device is not designed for bulk random data generation +and is relatively slow. @file{/dev/urandom} suffices for most practical uses, but applications requiring high-value or long-term protection of private data may @@ -989,21 +1159,10 @@ require an alternate data source like @file{/dev/random} or @file{/dev/arandom}. The set of available sources depends on your operating system. -To use such a source, specify the @option{--random-source=@var{file}} -option, e.g., @samp{shuf --random-source=/dev/random}. The contents -of @var{file} should be as random as possible. An error is reported -if @var{file} does not contain enough bytes to randomize the input -adequately. - To reproduce the results of an earlier invocation of a command, you can save some random data into a file and then use that file as the random source in earlier and later invocations of the command. -Some old-fashioned or stripped-down operating systems lack support for -@command{/dev/urandom}. On these systems commands like @command{shuf} -by default fall back on an internal pseudorandom generator initialized -by a small amount of entropy. - @node Target directory @section Target directory @@ -1175,7 +1334,7 @@ or @option{-P} is specified. @node Treating / specially -@section Treating / specially +@section Treating @file{/} specially Certain commands can operate destructively on entire hierarchies. For example, if a user with appropriate privileges mistakenly runs @@ -1308,7 +1467,7 @@ Equivalent to @option{-vET}. @itemx --number-nonblank @opindex -b @opindex --number-nonblank -Number all nonblank output lines, starting with 1. +Number all nonempty output lines, starting with 1. @item -e @opindex -e @@ -1330,8 +1489,9 @@ Number all output lines, starting with 1. @itemx --squeeze-blank @opindex -s @opindex --squeeze-blank -@cindex squeezing blank lines -Replace multiple adjacent blank lines with a single blank line. +@cindex squeezing empty lines +Suppress repeated adjacent empty lines; output just one empty line +instead of several. @item -t @opindex -t @@ -1661,8 +1821,8 @@ The default is octal. Skip @var{bytes} input bytes before formatting and writing. If @var{bytes} begins with @samp{0x} or @samp{0X}, it is interpreted in hexadecimal; otherwise, if it begins with @samp{0}, in octal; otherwise, -in decimal. Appending @samp{b} multiplies @var{bytes} by 512, @samp{k} -by 1024, and @samp{m} by 1048576. +in decimal. +@multiplierSuffixes{bytes} @item -N @var{bytes} @itemx --read-bytes=@var{bytes} @@ -1671,14 +1831,16 @@ by 1024, and @samp{m} by 1048576. Output at most @var{bytes} bytes of the input. Prefixes and suffixes on @code{bytes} are interpreted as for the @option{-j} option. -@item -S @var{n} -@itemx --strings[=@var{n}] +@item -S @var{bytes} +@itemx --strings[=@var{bytes}] @opindex -S @opindex --strings @cindex string constants, outputting Instead of the normal output, output only @dfn{string constants}: at -least @var{n} consecutive @acronym{ASCII} graphic characters, -followed by a null (zero) byte. +least @var{bytes} consecutive @acronym{ASCII} graphic characters, +followed by a zero byte (@acronym{ASCII} @sc{nul}). +Prefixes and suffixes on @code{bytes} are interpreted as for the +@option{-j} option. If @var{n} is omitted with @option{--strings}, the default is 3. @@ -1715,7 +1877,7 @@ hexadecimal @end table The type @code{a} outputs things like @samp{sp} for space, @samp{nl} for -newline, and @samp{nul} for a null (zero) byte. Only the least significant +newline, and @samp{nul} for a zero byte. Only the least significant seven bits of each byte is used; the high-order bit is ignored. Type @code{c} outputs @samp{ }, @samp{\n}, and @code{\0}, respectively. @@ -1849,8 +2011,7 @@ address. @command{base64} transforms data read from a file, or standard input, into (or from) base64 encoded form. The base64 encoded form uses -printable @acronym{ASCII} characters to represent binary data, see -@uref{ftp://ftp.rfc-editor.org/in-notes/rfc3548.txt, RFC 3548}. +printable @acronym{ASCII} characters to represent binary data. Synopses: @smallexample @@ -1859,18 +2020,20 @@ base64 --decode [@var{option}]@dots{} [@var{file}] @end smallexample The base64 encoding expands data to roughly 133% of the original. +The format conforms to +@uref{ftp://ftp.rfc-editor.org/in-notes/rfc4648.txt, RFC 4648}. The program accepts the following options. Also see @ref{Common options}. @table @samp -@item -w @var{COLS} -@itemx --wrap=@var{COLS} +@item -w @var{cols} +@itemx --wrap=@var{cols} @opindex -w @opindex --wrap @cindex wrap data @cindex column to wrap data after -During encoding, wrap lines after @var{COLS} characters. This must be +During encoding, wrap lines after @var{cols} characters. This must be a positive number. The default is to wrap after 76 characters. Use the value 0 to @@ -1956,6 +2119,14 @@ The program accepts the following options. Also see @ref{Common options}. @table @samp +@item -C +@itemx --compare +@opindex -C +@opindex --compare +Compare each pair of source and destination files, and if the destination has +identical content and any specified owner, group, permissions, and possibly +SELinux context, then do not modify the destination at all. + @item -c @itemx --crown-margin @opindex -c @@ -2034,11 +2205,9 @@ pr [@var{option}]@dots{} [@var{file}]@dots{} By default, a 5-line header is printed at each page: two blank lines; a line with the date, the file name, and the page count; and two more blank lines. A footer of five blank lines is also printed. -With the @option{-F} -option, a 3-line header is printed: the leading two blank lines are -omitted; no footer is used. The default @var{page_length} in both cases is 66 -lines. The default number of text lines changes from 56 (without @option{-F}) -to 63 (with @option{-F}). The text line of the header takes the form +The default @var{page_length} is 66 +lines. The default number of text lines is therefore 56. +The text line of the header takes the form @samp{@var{date} @var{string} @var{page}}, with spaces inserted around @var{string} so that the line takes up the full @var{page_width}. Here, @var{date} is the date (see the @option{-D} or @option{--date-format} @@ -2163,9 +2332,9 @@ e.g., @option{--date-format="Monday morning"}. @vindex POSIXLY_CORRECT @vindex LC_TIME -Normally the date -format defaults to @samp{%Y-%m-%d %H:%M} (for example, @samp{2001-12-04 -23:59}); but if the @env{POSIXLY_CORRECT} environment variable is set +The default date format is @samp{%Y-%m-%d %H:%M} (for example, +@samp{2001-12-04 23:59}); +but if the @env{POSIXLY_CORRECT} environment variable is set and the @env{LC_TIME} locale category specifies the @acronym{POSIX} locale, the default is @samp{%b %e %H:%M %Y} (for example, @samp{Dec@ @ 4 23:59 2001}. @@ -2174,7 +2343,7 @@ locale, the default is @samp{%b %e %H:%M %Y} (for example, Time stamps are listed according to the time zone rules specified by the @env{TZ} environment variable, or by the system default rules if @env{TZ} is not set. @xref{TZ Variable,, Specifying the Time Zone -with @env{TZ}, libc, The GNU C Library}. +with @env{TZ}, libc, The GNU C Library Reference Manual}. @item -e[@var{in-tabchar}[@var{in-tabwidth}]] @itemx --expand-tabs[=@var{in-tabchar}[@var{in-tabwidth}]] @@ -2192,12 +2361,11 @@ is 8). @opindex -F @opindex -f @opindex --form-feed -Use a form feed instead of newlines to separate output pages. The default -page length of 66 lines is not altered. But the number of lines of text -per page changes from default 56 to 63 lines. +Use a form feed instead of newlines to separate output pages. This does +not alter the default page length of 66 lines. -@item -h @var{HEADER} -@itemx --header=@var{HEADER} +@item -h @var{header} +@itemx --header=@var{header} @opindex -h @opindex --header Replace the file name in the header with the centered string @var{header}. @@ -2234,9 +2402,8 @@ to disentangle the old (@acronym{POSIX}-compliant) options @option{-w} and @opindex --length Set the page length to @var{page_length} (default 66) lines, including the lines of the header [and the footer]. If @var{page_length} is less -than or equal to 10 (or <= 3 with @option{-F}), the header and footer are -omitted, and all form feeds set in input files are eliminated, as if -the @option{-T} option had been given. +than or equal to 10, the header and footer are omitted, as if the +@option{-t} option had been given. @item -m @itemx --merge @@ -2268,14 +2435,14 @@ first line of the input file (not the first line printed, compare the Optional argument @var{number-separator} is the character appended to the line number to separate it from the text followed. The default separator is the TAB character. In a strict sense a TAB is always -printed with single column output only. The @var{TAB}-width varies -with the @var{TAB}-position, e.g., with the left @var{margin} specified +printed with single column output only. The TAB width varies +with the TAB position, e.g., with the left @var{margin} specified by @option{-o} option. With multicolumn output priority is given to @samp{equal width of output columns} (a @acronym{POSIX} specification). -The @var{TAB}-width is fixed to the value of the first column and does +The TAB width is fixed to the value of the first column and does not change with different values of left @var{margin}. That means a fixed number of spaces is always printed in the place of the -@var{number-separator tab}. The tabification depends upon the output +@var{number-separator} TAB. The tabification depends upon the output position. @item -N @var{line_number} @@ -2490,11 +2657,10 @@ The program accepts the following options. Also see @ref{Common options}. @itemx --bytes=@var{n} @opindex -c @opindex --bytes -Print the first @var{n} bytes, instead of initial lines. Appending -@samp{b} multiplies @var{n} by 512, @samp{k} by 1024, and @samp{m} -by 1048576. +Print the first @var{n} bytes, instead of initial lines. However, if @var{n} starts with a @samp{-}, print all but the last @var{n} bytes of each file. +@multiplierSuffixes{n} @itemx -n @var{n} @itemx --lines=@var{n} @@ -2503,6 +2669,7 @@ print all but the last @var{n} bytes of each file. Output the first @var{n} lines. However, if @var{n} starts with a @samp{-}, print all but the last @var{n} lines of each file. +Size multiplier suffixes are the same as with the @option{-c} option. @item -q @itemx --quiet @@ -2567,21 +2734,18 @@ only reverse files that are at most as large as its buffer, which is typically 32 KiB@. A more reliable and versatile way to reverse files is the @sc{gnu} @command{tac} command. -If any option-argument is a number @var{n} starting with a @samp{+}, -@command{tail} begins printing with the @var{n}th item from the start of -each file, instead of from the end. - The program accepts the following options. Also see @ref{Common options}. @table @samp -@item -c @var{bytes} -@itemx --bytes=@var{bytes} +@item -c @var{n} +@itemx --bytes=@var{n} @opindex -c @opindex --bytes -Output the last @var{bytes} bytes, instead of final lines. Appending -@samp{b} multiplies @var{bytes} by 512, @samp{k} by 1024, and @samp{m} -by 1048576. +Output the last @var{n} bytes, instead of final lines. +However, if @var{n} starts with a @samp{+}, start printing with the +@var{n}th byte from the start of each file, instead of from the end. +@multiplierSuffixes{n} @item -f @itemx --follow[=@var{how}] @@ -2691,6 +2855,9 @@ This option is meaningful only when following by name. @opindex -n @opindex --lines Output the last @var{n} lines. +However, if @var{n} starts with a @samp{+}, start printing with the +@var{n}th line from the start of each file, instead of from the end. +Size multiplier suffixes are the same as with the @option{-c} option. @item -q @itemx --quiet @@ -2776,12 +2943,6 @@ The program accepts the following options. Also see @ref{Common options}. @table @samp -@item -a @var{length} -@itemx --suffix-length=@var{length} -@opindex -a -@opindex --suffix-length -Use suffixes of length @var{length}. The default @var{length} is 2. - @item -l @var{lines} @itemx --lines=@var{lines} @opindex -l @@ -2792,24 +2953,27 @@ For compatibility @command{split} also supports an obsolete option syntax @option{-@var{lines}}. New scripts should use @option{-l @var{lines}} instead. -@item -b @var{bytes} -@itemx --bytes=@var{bytes} +@item -b @var{size} +@itemx --bytes=@var{size} @opindex -b @opindex --bytes -Put the first @var{bytes} bytes of @var{input} into each output file. -Appending @samp{b} multiplies @var{bytes} by 512, @samp{k} by 1024, and -@samp{m} by 1048576. +Put @var{size} bytes of @var{input} into each output file. +@multiplierSuffixes{size} -@item -C @var{bytes} -@itemx --line-bytes=@var{bytes} +@item -C @var{size} +@itemx --line-bytes=@var{size} @opindex -C @opindex --line-bytes Put into each output file as many complete lines of @var{input} as -possible without exceeding @var{bytes} bytes. For lines longer than -@var{bytes} bytes, put @var{bytes} bytes into each output file until -less than @var{bytes} bytes of the line are left, then continue -normally. @var{bytes} has the same format as for the @option{--bytes} -option. +possible without exceeding @var{size} bytes. Individual lines longer than +@var{size} bytes are broken into multiple files. +@var{size} has the same format as for the @option{--bytes} option. + +@item -a @var{length} +@itemx --suffix-length=@var{length} +@opindex -a +@opindex --suffix-length +Use suffixes of length @var{length}. The default @var{length} is 2. @item -d @itemx --numeric-suffixes @@ -2819,7 +2983,7 @@ Use digits in suffixes rather than lower-case letters. @itemx --verbose @opindex --verbose -Write a diagnostic to standard error just before each output file is opened. +Write a diagnostic just before each output file is opened. @end table @@ -2956,6 +3120,56 @@ Do not print counts of output file sizes. @exitstatus +Here is an example of its usage. +First, create an empty directory for the exercise, +and cd into it: + +@example +$ mkdir d && cd d +@end example + +Now, split the sequence of 1..14 on lines that end with 0 or 5: + +@example +$ seq 14 | csplit - '/[05]$/' '@{*@}' +8 +10 +15 +@end example + +Each number printed above is the size of an output +file that csplit has just created. +List the names of those output files: + +@example +$ ls +xx00 xx01 xx02 +@end example + +Use @command{head} to show their contents: + +@example +$ head xx* +==> xx00 <== +1 +2 +3 +4 + +==> xx01 <== +5 +6 +7 +8 +9 + +==> xx02 <== +10 +11 +12 +13 +14 +@end example @node Summarizing files @chapter Summarizing files @@ -3019,7 +3233,9 @@ prints both the byte counts and the word counts. With the @option{--max-line-length} option, @command{wc} prints the length of the longest line per file, and if there is more than one file it -prints the maximum (not the sum) of those lengths. +prints the maximum (not the sum) of those lengths. The line lengths here +are measured in screen columns, according to the current locale and +assuming tab positions in every 8th column. The program accepts the following options. Also see @ref{Common options}. @@ -3055,28 +3271,36 @@ Print only the newline counts. @opindex --max-line-length Print only the maximum line lengths. -@itemx --files0-from=@var{FILE} -@opindex --files0-from=@var{FILE} -@cindex including files from @command{du} -Rather than processing files named on the command line, process those -named in file @var{FILE}; each name is terminated by a null byte. -This is useful when -the list of file names is so long that it may exceed a command line +@macro filesZeroFromOption{cmd,withTotalOption,subListOutput} +@itemx --files0-from=@var{file} +@opindex --files0-from=@var{file} +@c This is commented out to avoid a texi2dvi failure. +@c texi2dvi (GNU Texinfo 4.11) 1.104 +@c @cindex including files from @command{\cmd\} +Disallow processing files named on the command line, and instead process +those named in file @var{file}; each name being terminated by a zero byte +(@acronym{ASCII} @sc{nul}). +This is useful \withTotalOption\ +when the list of file names is so long that it may exceed a command line length limitation. -In such cases, running @command{wc} via @command{xargs} is undesirable -because it splits the list into pieces and makes @command{wc} print a -total for each sublist rather than for the entire list. -One way to produce a list of null-byte-terminated file names is with @sc{gnu} -@command{find}, using its @option{-print0} predicate. For example, to find -the length of the longest line in any @file{.c} or @file{.h} file in the -current hierarchy, do this: +In such cases, running @command{\cmd\} via @command{xargs} is undesirable +because it splits the list into pieces and makes @command{\cmd\} print +\subListOutput\ for each sublist rather than for the entire list. +One way to produce a list of @acronym{ASCII} @sc{nul} terminated file names is with @sc{gnu} +@command{find}, using its @option{-print0} predicate. +If @var{file} is @samp{-} then the @acronym{ASCII} @sc{nul} terminated file names +are read from standard input. +@end macro +@filesZeroFromOption{wc,,a total} + +For example, to find the length of the longest line in any @file{.c} or +@file{.h} file in the current hierarchy, do this: @example -find . -name '*.[ch]' -print0 | wc -L --files0-from=- | tail -n1 +find . -name '*.[ch]' -print0 | + wc -L --files0-from=- | tail -n1 @end example -Do not specify any @var{FILE} on the command line when using this option. - @end table @exitstatus @@ -3250,6 +3474,15 @@ an MD5 checksum inconsistent with the associated file, or if no valid line is found, @command{md5sum} exits with nonzero status. Otherwise, it exits successfully. +@itemx --quiet +@opindex --quiet +@cindex verifying MD5 checksums +This option is useful only when verifying checksums. +When verifying checksums, don't generate an 'OK' message per successfully +checked file. Files that fail the verification are reported in the +default one-line-per-file format. If there is any checksum mismatch, +print a warning summarizing the failures to standard error. + @itemx --status @opindex --status @cindex verifying MD5 checksums @@ -3361,7 +3594,6 @@ These commands work with (or produce) sorted files. * comm invocation:: Compare two sorted files line by line. * ptx invocation:: Produce a permuted index of file contents. * tsort invocation:: Topological sort. -* tsort background:: Where tsort came from. @end menu @@ -3514,11 +3746,17 @@ is a space or a tab, but the @env{LC_CTYPE} locale can change this. Fold lowercase characters into the equivalent uppercase characters when comparing so that, for example, @samp{b} and @samp{B} sort as equal. The @env{LC_CTYPE} locale determines character types. +When used with @option{--unique} those lower case equivalent lines are +thrown away. (There is currently no way to throw away the upper case +equivalent instead. (Any @option{--reverse} given would only affect +the final result, after the throwing away.)) @item -g @itemx --general-numeric-sort +@itemx --sort=general-numeric @opindex -g @opindex --general-numeric-sort +@opindex --sort @cindex general numeric sort @vindex LC_NUMERIC Sort numerically, using the standard C function @code{strtod} to convert @@ -3561,8 +3799,10 @@ This option has no effect if the stronger @option{--dictionary-order} @item -M @itemx --month-sort +@itemx --sort=month @opindex -M @opindex --month-sort +@opindex --sort @cindex months, sorting by @vindex LC_TIME An initial string, consisting of any amount of blanks, followed @@ -3575,8 +3815,10 @@ can change this. @item -n @itemx --numeric-sort +@itemx --sort=numeric @opindex -n @opindex --numeric-sort +@opindex --sort @cindex numeric sort @vindex LC_NUMERIC Sort numerically. The number begins each line and consists @@ -3594,6 +3836,16 @@ Neither a leading @samp{+} nor exponential notation is recognized. To compare such strings numerically, use the @option{--general-numeric-sort} (@option{-g}) option. +@item -V +@itemx --version-sort +@opindex -V +@opindex --version-sort +@cindex version number sort +@vindex LC_NUMERIC +Sort per @code{strverscmp(3)}. This is a normal string comparison, except +that embedded decimal numbers are sorted by numeric value +(see @option{--numeric-sort} above). + @item -r @itemx --reverse @opindex -r @@ -3604,8 +3856,10 @@ appear earlier in the output instead of later. @item -R @itemx --random-sort +@itemx --sort=random @opindex -R @opindex --random-sort +@opindex --sort @cindex random sort Sort by hashing the input keys and then sorting the hash values. Choose the hash function at random, ensuring that it is free of @@ -3636,9 +3890,11 @@ standard input to standard output. Terminate with an error if @var{prog} exits with nonzero status. -Whitespace and the backslash character should not appear in +White space and the backslash character should not appear in @var{prog}; they are reserved for future use. +@filesZeroFromOption{sort,,sorted output} + @item -k @var{pos1}[,@var{pos2}] @itemx --key=@var{pos1}[,@var{pos2}] @opindex -k @@ -3662,6 +3918,33 @@ multiple fields. Example: To sort on the second field, use @option{--key=2,2} (@option{-k 2,2}). See below for more examples. +@item --batch-size=@var{nmerge} +@opindex --batch-size +@cindex number of inputs to merge, nmerge +Merge at most @var{nmerge} inputs at once. + +When @command{sort} has to merge more than @var{nmerge} inputs, +it merges them in groups of @var{nmerge}, saving the result in +a temporary file, which is then used as an input in a subsequent merge. + +A large value of @var{nmerge} may improve merge performance and decrease +temporary storage utilization at the expense of increased memory usage +and I/0. Conversely a small value of @var{nmerge} may reduce memory +requirements and I/0 at the expense of temporary storage consumption and +merge performance. + +The value of @var{nmerge} must be at least 2. The default value is +currently 16, but this is implementation-dependent and may change in +the future. + +The value of @var{nmerge} may be bounded by a resource limit for open +file descriptors. The commands @samp{ulimit -n} or @samp{getconf +OPEN_MAX} may display limits for your systems; these limits may be +modified further if your program already has some files open, or if +the operating system has other limits on the number of open files. If +the value of @var{nmerge} exceeds the resource limit, @command{sort} +silently uses a smaller value. + @item -o @var{output-file} @itemx --output=@var{output-file} @opindex -o @@ -3740,9 +4023,8 @@ However, fields that extend to the end of the line, as @option{-k 2}, or fields consisting of a range, as @option{-k 2,3}, retain the field separators present between the endpoints of the range. -To specify a null character (@acronym{ASCII} @sc{nul}) as -the field separator, use the two-character string @samp{\0}, e.g., -@samp{sort -t '\0'}. +To specify @acronym{ASCII} @sc{nul} as the field separator, +use the two-character string @samp{\0}, e.g., @samp{sort -t '\0'}. @item -T @var{tempdir} @itemx --temporary-directory=@var{tempdir} @@ -3775,18 +4057,21 @@ For example, @code{sort -n -u} inspects only the value of the initial numeric string when checking for uniqueness, whereas @code{sort -n | uniq} inspects the entire line. @xref{uniq invocation}. +@macro zeroTerminatedOption @item -z @itemx --zero-terminated @opindex -z @opindex --zero-terminated -@cindex sort zero-terminated lines -Treat the input as a set of lines, each terminated by a null character -(@acronym{ASCII} @sc{nul}) instead of a line feed -(@acronym{ASCII} @sc{lf}). +@cindex process zero-terminated items +Delimit items with a zero byte rather than a newline (@acronym{ASCII} @sc{lf}). +I.E. treat input as items separated by @acronym{ASCII} @sc{nul} +and terminate output items with @acronym{ASCII} @sc{nul}. This option can be useful in conjunction with @samp{perl -0} or @samp{find -print0} and @samp{xargs -0} which do the same in order to reliably handle arbitrary file names (even those containing blanks or other special characters). +@end macro +@zeroTerminatedOption @end table @@ -4011,11 +4296,11 @@ operation modes: @table @samp @item -n @var{lines} -@itemx --head-lines=@var{lines} +@itemx --head-count=@var{count} @opindex -n -@opindex --head-lines +@opindex --head-count @cindex head of output -Output at most @var{lines} lines. By default, all input lines are +Output at most @var{count} lines. By default, all input lines are output. @item -o @var{output-file} @@ -4034,18 +4319,7 @@ commands like @code{shuf -o F extend by +@samp{-} => reduce by +@samp{<} => at most +@samp{>} => at least +@samp{/} => round down to multiple of +@samp{%} => round up to multiple of +@end example + +@end table + +@exitstatus + + @node Printing text @chapter Printing text @@ -10049,6 +10622,8 @@ space between each and a newline after the last one. Synopsis: echo [@var{option}]@dots{} [@var{string}]@dots{} @end example +@mayConflictWithShellBuiltIn{echo} + The program accepts the following options. Also see @ref{Common options}. Options must precede operands, and the normally-special argument @samp{--} has no special meaning and is treated like any other @@ -10071,11 +10646,11 @@ alert (bell) @item \b backspace @item \c -suppress trailing newline +produce no further output @item \f form feed @item \n -new line +newline @item \r carriage return @item \t @@ -10133,8 +10708,12 @@ printf @var{format} [@var{argument}]@dots{} @command{printf} prints the @var{format} string, interpreting @samp{%} directives and @samp{\} escapes to format numeric and string arguments -in a way that is mostly similar to the C @samp{printf} function. The -differences are as follows: +in a way that is mostly similar to the C @samp{printf} function. +@xref{Output Conversion Syntax,, @command{printf} format directives, +libc, The GNU C Library Reference Manual}, for details. +The differences are listed below. + +@mayConflictWithShellBuiltIn{printf} @itemize @bullet @@ -10213,7 +10792,9 @@ characters, specified as four hexadecimal digits @var{hhhh}, and @samp{\U} for 32-bit Unicode characters, specified as eight hexadecimal digits @var{hhhhhhhh}. @command{printf} outputs the Unicode characters -according to the @env{LC_CTYPE} locale. +according to the @env{LC_CTYPE} locale. Unicode characters in the ranges +U+0000...U+009F, U+D800...U+DFFF cannot be specified by this syntax, except +for U+0024 ($), U+0040 (@@), and U+0060 (@`). The processing of @samp{\u} and @samp{\U} requires a full-featured @code{iconv} facility. It is activated on systems with glibc 2.2 (or newer), @@ -10228,7 +10809,7 @@ The Unicode character syntaxes are useful for writing strings in a locale independent way. For example, a string containing the Euro currency symbol @example -$ /usr/local/bin/printf '\u20AC 14.95' +$ env printf '\u20AC 14.95' @end example @noindent @@ -10236,15 +10817,15 @@ will be output correctly in all locales supporting the Euro symbol (@acronym{ISO}-8859-15, UTF-8, and others). Similarly, a Chinese string @example -$ /usr/local/bin/printf '\u4e2d\u6587' +$ env printf '\u4e2d\u6587' @end example @noindent will be output correctly in all Chinese locales (GB2312, BIG5, UTF-8, etc). -Note that in these examples, the full name of @command{printf} has been -given, to distinguish it from the GNU @code{bash} built-in function -@command{printf}. +Note that in these examples, the @command{printf} command has been +invoked via @command{env} to ensure that we run the program found via +your shell's search path, and not a shell alias or a built-in function. For larger strings, you don't need to look up the hexadecimal code values of each character one by one. @acronym{ASCII} characters mixed with \u @@ -10401,11 +10982,7 @@ test [ @var{option} @end example -@cindex conflicts with shell built-ins -@cindex built-in shell commands, conflicts with -Because most shells have a built-in @command{test} command, using an -unadorned @command{test} in a script or interactively may get you -different functionality than that described here. +@mayConflictWithShellBuiltIn{test} If @var{expression} is omitted, @command{test} returns false. If @var{expression} is a single argument, @@ -10634,9 +11211,9 @@ True if the strings are not equal. @cindex numeric tests @cindex arithmetic tests -Numeric relationals. The arguments must be entirely numeric (possibly -negative), or the special expression @w{@code{-l @var{string}}}, which -evaluates to the length of @var{string}. +Numeric relational operators. The arguments must be entirely numeric +(possibly negative), or the special expression @w{@code{-l @var{string}}}, +which evaluates to the length of @var{string}. @table @samp @@ -10739,6 +11316,10 @@ may be used for grouping in the usual manner. You must quote parentheses and many operators to avoid the shell evaluating them, however. +When built with support for the GNU MP library, @command{expr} uses +arbitrary-precision arithmetic; otherwise, it uses native arithmetic +types and may fail due to arithmetic overflow. + The only options are @option{--help} and @option{--version}. @xref{Common options}. Options must precede operands. @@ -10767,7 +11348,7 @@ Exit status: @cindex expressions, string @command{expr} supports pattern matching and other string operators. These -have lower precedence than both the numeric and relational operators (in +have higher precedence than both the numeric and relational operators (in the next sections). @table @samp @@ -10847,8 +11428,9 @@ To make @command{expr} interpret keywords as strings, you must use the @cindex expressions, numeric @command{expr} supports the usual numeric operators, in order of increasing -precedence. The string operators (previous section) have lower precedence, -the connectives (next section) have higher. +precedence. These numeric operators have lower precedence than the +string operators described in the previous section, and higher precedence +than the connectives (next section). @table @samp @@ -10881,7 +11463,7 @@ integers; an error occurs if this cannot be done. @cindex relations, numeric or string @command{expr} supports the usual logical connectives and relations. These -are higher precedence than either the string or numeric operators +have lower precedence than the string and numeric operators (previous sections). Here is the list, lowest-precedence operator first. @table @samp @@ -10954,7 +11536,7 @@ expr index abcdef cz @result{} 3 expr index index a @error{} expr: syntax error -expr index quote index a +expr index + index a @result{} 0 @end example @@ -10971,12 +11553,12 @@ useful redirection is performed by a separate command, not by the shell; it's described here. @menu -* tee invocation:: Redirect output to multiple files. +* tee invocation:: Redirect output to multiple files or processes. @end menu @node tee invocation -@section @command{tee}: Redirect output to multiple files +@section @command{tee}: Redirect output to multiple files or processes @pindex tee @cindex pipe fitting @@ -11017,6 +11599,112 @@ Ignore interrupt signals. @end table +The @command{tee} command is useful when you happen to be transferring a large +amount of data and also want to summarize that data without reading +it a second time. For example, when you are downloading a DVD image, +you often want to verify its signature or checksum right away. +The inefficient way to do it is simply: + +@example +wget http://example.com/some.iso && sha1sum some.iso +@end example + +One problem with the above is that it makes you wait for the +download to complete before starting the time-consuming SHA1 computation. +Perhaps even more importantly, the above requires reading +the DVD image a second time (the first was from the network). + +The efficient way to do it is to interleave the download +and SHA1 computation. Then, you'll get the checksum for +free, because the entire process parallelizes so well: + +@example +# slightly contrived, to demonstrate process substitution +wget -O - http://example.com/dvd.iso \ + | tee >(sha1sum > dvd.sha1) > dvd.iso +@end example + +That makes @command{tee} write not just to the expected output file, +but also to a pipe running @command{sha1sum} and saving the final +checksum in a file named @file{dvd.sha1}. + +Note, however, that this example relies on a feature of modern shells +called @dfn{process substitution} +(the @samp{>(command)} syntax, above; +@xref{Process Substitution,,Process Substitution, bashref, +The Bash Reference Manual}.), +so it works with @command{zsh}, @command{bash}, and @command{ksh}, +but not with @command{/bin/sh}. So if you write code like this +in a shell script, be sure to start the script with @samp{#!/bin/bash}. + +Since the above example writes to one file and one process, +a more conventional and portable use of @command{tee} is even better: + +@example +wget -O - http://example.com/dvd.iso \ + | tee dvd.iso | sha1sum > dvd.sha1 +@end example + +You can extend this example to make @command{tee} write to two processes, +computing MD5 and SHA1 checksums in parallel. In this case, +process substitution is required: + +@example +wget -O - http://example.com/dvd.iso \ + | tee >(sha1sum > dvd.sha1) \ + >(md5sum > dvd.md5) \ + > dvd.iso +@end example + +This technique is also useful when you want to make a @emph{compressed} +copy of the contents of a pipe. +Consider a tool to graphically summarize disk usage data from @samp{du -ak}. +For a large hierarchy, @samp{du -ak} can run for a long time, +and can easily produce terabytes of data, so you won't want to +rerun the command unnecessarily. Nor will you want to save +the uncompressed output. + +Doing it the inefficient way, you can't even start the GUI +until after you've compressed all of the @command{du} output: + +@example +du -ak | gzip -9 > /tmp/du.gz +gzip -d /tmp/du.gz | xdiskusage -a +@end example + +With @command{tee} and process substitution, you start the GUI +right away and eliminate the decompression completely: + +@example +du -ak | tee >(gzip -9 > /tmp/du.gz) | xdiskusage -a +@end example + +Finally, if you regularly create more than one type of +compressed tarball at once, for example when @code{make dist} creates +both @command{gzip}-compressed and @command{bzip2}-compressed tarballs, +there may be a better way. +Typical @command{automake}-generated @file{Makefile} rules create +the two compressed tar archives with commands in sequence, like this +(slightly simplified): + +@example +tardir=your-pkg-M.N +tar chof - "$tardir" | gzip -9 -c > your-pkg-M.N.tar.gz +tar chof - "$tardir" | bzip2 -9 -c > your-pkg-M.N.tar.bz2 +@end example + +However, if the hierarchy you are archiving and compressing is larger +than a couple megabytes, and especially if you are using a multi-processor +system with plenty of memory, then you can do much better by reading the +directory contents only once and running the compression programs in parallel: + +@example +tardir=your-pkg-M.N +tar chof - "$tardir" \ + | tee >(gzip -9 -c > your-pkg-M.N.tar.gz) \ + | bzip2 -9 -c > your-pkg-M.N.tar.bz2 +@end example + @exitstatus @@ -11032,7 +11720,7 @@ This section describes commands that manipulate file names. @menu * basename invocation:: Strip directory and suffix from a file name. * dirname invocation:: Strip non-directory suffix from a file name. -* pathchk invocation:: Check file name portability. +* pathchk invocation:: Check file name validity and portability. @end menu @@ -11132,20 +11820,20 @@ dirname stdio.h @node pathchk invocation -@section @command{pathchk}: Check file name portability +@section @command{pathchk}: Check file name validity and portability @pindex pathchk @cindex file names, checking validity and portability @cindex valid file names, checking for @cindex portable file names, checking for -@command{pathchk} checks portability of file names. Synopsis: +@command{pathchk} checks validity and portability of file names. Synopsis: @example pathchk [@var{option}]@dots{} @var{name}@dots{} @end example -For each @var{name}, @command{pathchk} prints a message if any of +For each @var{name}, @command{pathchk} prints an error message if any of these conditions is true: @enumerate @@ -11171,30 +11859,30 @@ Options must precede operands. @item -p @opindex -p Instead of performing checks based on the underlying file system, -print a message if any of these conditions is true: +print an error message if any of these conditions is true: @enumerate @item A file name is empty. @item -The length of a file name or one of its components exceeds the -@acronym{POSIX} minimum limits for portability. +A file name contains a character outside the @acronym{POSIX} portable file +name character set, namely, the ASCII letters and digits, @samp{.}, +@samp{_}, @samp{-}, and @samp{/}. @item -A file name contains a character outside the portable file name -character set, namely, the ASCII letters and digits, @samp{-}, -@samp{.}, @samp{/}, and @samp{_}. +The length of a file name or one of its components exceeds the +@acronym{POSIX} minimum limits for portability. @end enumerate @item -P @opindex -P -Print a message if a file name is empty, or if it contains a component +Print an error message if a file name is empty, or if it contains a component that begins with @samp{-}. @item --portability @opindex --portability -Print a message if a file name is not portable to all @acronym{POSIX} +Print an error message if a file name is not portable to all @acronym{POSIX} hosts. This option is equivalent to @samp{-p -P}. @end table @@ -11234,19 +11922,41 @@ so forth. See also the user-related commands in the next section. @cindex current working directory, printing @cindex working directory, printing + +@command{pwd} prints the name of the current directory. Synopsis: + +@example +pwd [@var{option}]@dots{} +@end example + +The program accepts the following options. Also see @ref{Common options}. + +@table @samp +@item -L +@itemx --logical +@opindex -L +@opindex --logical +If the contents of the environment variable @env{PWD} provide an +absolute name of the current directory with no @samp{.} or @samp{..} +components, but possibly with symbolic links, then output those +contents. Otherwise, fall back to default @option{-P} handling. + +@item -P +@itemx --physical +@opindex -P +@opindex --physical +Print a fully resolved name for the current directory. That is, all +components of the printed name will be actual directory names---none +will be symbolic links. +@end table + @cindex symbolic links and @command{pwd} -@command{pwd} prints the fully resolved name of the current directory. -That is, all components of the printed name will be actual directory -names---none will be symbolic links. +If @option{-L} and @option{-P} are both given, the last one takes +precedence. If neither option is given, then this implementation uses +@option{-P} as the default unless the @env{POSIXLY_CORRECT} +environment variable is set. -@cindex conflicts with shell built-ins -@cindex built-in shell commands, conflicts with -Because most shells have a built-in @command{pwd} command, using an -unadorned @command{pwd} in a script or interactively may get you -different functionality than that described here. - -The only options are a lone @option{--help} or -@option{--version}. @xref{Common options}. +@mayConflictWithShellBuiltIn{pwd} @exitstatus @@ -11395,6 +12105,7 @@ Enable RTS/CTS flow control. Non-@acronym{POSIX}. May be negated. @subsection Input settings @cindex input settings +These settings control operations on data received from the terminal. @table @samp @item ignbrk @@ -11467,7 +12178,8 @@ empty again. May be negated. @opindex iuclc @cindex uppercase, translating to lowercase Translate uppercase characters to lowercase. Non-@acronym{POSIX}. May be -negated. +negated. Note ilcuc is not implemented, as one would not be able to issue +almost any (lowercase) Unix command, after invoking it. @item ixany @opindex ixany @@ -11486,7 +12198,7 @@ when the input buffer is full. Non-@acronym{POSIX}. May be negated. @subsection Output settings @cindex output settings -These arguments specify output-related operations. +These settings control operations on data sent to the terminal. @table @samp @item opost @@ -11497,7 +12209,7 @@ Postprocess output. May be negated. @opindex olcuc @cindex lowercase, translating to output Translate lowercase characters to uppercase. Non-@acronym{POSIX}. May be -negated. +negated. (Note ouclc is not currently implemented.) @item ocrnl @opindex ocrnl @@ -11528,7 +12240,8 @@ May be negated. @item ofdel @opindex ofdel @cindex pad character -Use delete characters for fill instead of null characters. Non-@acronym{POSIX}. +Use @acronym{ASCII} @sc{del} characters for fill instead of +@acronym{ASCII} @sc{nul} characters. Non-@acronym{POSIX}. May be negated. @item nl1 @@ -11749,6 +12462,7 @@ as @code{tab3}. @opindex lcase @opindex LCASE Same as @code{xcase iuclc olcuc}. Non-@acronym{POSIX}. May be negated. +(Used for terminals with uppercase characters only.) @item crt @opindex crt @@ -11900,13 +12614,29 @@ Print the terminal speed. @item @var{n} @cindex baud rate, setting -@c FIXME: Is this still true that the baud rate can't be set -@c higher than 38400? -Set the input and output speeds to @var{n}. @var{n} can be one -of: 0 50 75 110 134 134.5 150 200 300 600 1200 1800 2400 4800 9600 -19200 38400 @code{exta} @code{extb}. @code{exta} is the same as -19200; @code{extb} is the same as 38400. 0 hangs up the line if -@option{-clocal} is set. +Set the input and output speeds to @var{n}. @var{n} can be one of: 0 +50 75 110 134 134.5 150 200 300 600 1200 1800 2400 4800 9600 19200 +38400 @code{exta} @code{extb}. @code{exta} is the same as 19200; +@code{extb} is the same as 38400. Many systems, including GNU/Linux, +support higher speeds. The @command{stty} command includes support +for speeds of +57600, +115200, +230400, +460800, +500000, +576000, +921600, +1000000, +1152000, +1500000, +2000000, +2500000, +3000000, +3500000, +or +4000000 where the system supports these. +0 hangs up the line if @option{-clocal} is set. @end table @@ -12057,10 +12787,29 @@ Print the real, instead of effective, user or group ID. Requires @opindex --user Print only the user ID. +@item -Z +@itemx --context +@opindex -Z +@opindex --context +@cindex SELinux +@cindex security context +Print only the security context of the current user. +If SELinux is disabled then print a warning and +set the exit status to 1. + @end table @exitstatus +@macro primaryAndSupplementaryGroups{cmd,arg} +Primary and supplementary groups for a process are normally inherited +from its parent and are usually unchanged since login. This means +that if you change the group database after logging in, @command{\cmd\} +will not reflect your changes within your existing login session. +Running @command{\cmd\} with a \arg\ causes the user and group +database to be consulted afresh, and so will give a different result. +@end macro +@primaryAndSupplementaryGroups{id,user argument} @node logname invocation @section @command{logname}: Print current login name @@ -12110,7 +12859,8 @@ options}. groups for each given @var{username}, or the current process if no names are given. If more than one name is given, the name of each user is printed before -the list of that user's groups. Synopsis: +the list of that user's groups and the user name is separated from the +group list by a colon. Synopsis: @example groups [@var{username}]@dots{} @@ -12118,6 +12868,8 @@ groups [@var{username}]@dots{} The group lists are equivalent to the output of the command @samp{id -Gn}. +@primaryAndSupplementaryGroups{groups,list of users} + The only options are @option{--help} and @option{--version}. @xref{Common options}. @@ -12195,7 +12947,7 @@ i}, as in @samp{who am i}. Time stamps are listed according to the time zone rules specified by the @env{TZ} environment variable, or by the system default rules if @env{TZ} is not set. @xref{TZ Variable,, Specifying the Time Zone -with @env{TZ}, libc, The GNU C Library}. +with @env{TZ}, libc, The GNU C Library Reference Manual}. The program accepts the following options. Also see @ref{Common options}. @@ -12223,29 +12975,7 @@ Print information corresponding to dead processes. @itemx --heading @opindex -H @opindex --heading -Print column headings. - -@item -m -@opindex -m -Same as @samp{who am i}. - -@item -q -@itemx --count -@opindex -q -@opindex --count -Print only the login names and the number of users logged on. -Overrides all other options. - -@item -s -@opindex -s -Ignored; for compatibility with other versions of @command{who}. - -@itemx -u -@opindex -u -@cindex idle time -After the login time, print the number of hours and minutes that the -user has been idle. @samp{.} means the user was active in the last minute. -@samp{old} means the user has been idle for more than 24 hours. +Print a line of column headings. @item -l @itemx --login @@ -12260,11 +12990,45 @@ Attempt to canonicalize hostnames found in utmp through a DNS lookup. This is not the default because it can cause significant delays on systems with automatic dial-up internet access. -@item -H -@itemx --heading -@opindex -H -@opindex --heading -Print a line of column headings. +@item -m +@opindex -m +Same as @samp{who am i}. + +@item -p +@itemx --process +@opindex -p +@opindex --process +List active processes spawned by init. + +@item -q +@itemx --count +@opindex -q +@opindex --count +Print only the login names and the number of users logged on. +Overrides all other options. + +@item -r +@itemx --runlevel +@opindex -r +@opindex --runlevel +Print the current (and maybe previous) run-level of the init process. + +@item -s +@opindex -s +Ignored; for compatibility with other versions of @command{who}. + +@item -t +@itemx --time +@opindex -t +@opindex --time +Print last system clock change. + +@itemx -u +@opindex -u +@cindex idle time +After the login time, print the number of hours and minutes that the +user has been idle. @samp{.} means the user was active in the last minute. +@samp{old} means the user has been idle for more than 24 hours. @item -w @itemx -T @@ -12302,12 +13066,185 @@ This section describes commands that print or change system-wide information. @menu +* arch invocation:: Print machine hardware name. * date invocation:: Print or set system date and time. * uname invocation:: Print system information. * hostname invocation:: Print or set system name. * hostid invocation:: Print numeric host identifier. +* uptime invocation:: Print system uptime and load @end menu +@node SELinux context +@chapter SELinux context + +@cindex SELinux context +@cindex SELinux, context +@cindex commands for SELinux context + +This section describes commands for operations with SELinux +contexts. + +@menu +* chcon invocation:: Change SELinux context of file +* runcon invocation:: Run a command in specified SELinux context +@end menu + +@node chcon invocation +@section @command{chcon}: Change SELinux context of file. + +@pindex chcon +@cindex changing security context +@cindex change SELinux context + +@command{chcon} changes the SELinux security context of the selected files. +Synopses: + +@smallexample +chcon [@var{option}]@dots{} @var{context} @var{file}@dots{} +chcon [@var{option}]@dots{} [-u @var{user}] [-r @var{role}] [-l @var{range}] [-t @var{type}] @var{file}@dots{} +chcon [@var{option}]@dots{} --reference=@var{rfile} @var{file}@dots{} +@end smallexample + +Change the SELinux security context of each @var{file} to @var{context}. +With @option{--reference}, change the security context of each @var{file} +to that of @var{rfile}. + +The program accepts the following options. Also see @ref{Common options}. + +@table @samp + +@item -h +@itemx --no-dereference +@opindex -h +@opindex --no-dereference +@cindex no dereference +Affect symbolic links instead of any referenced file. + +@item --reference=@var{rfile} +@opindex --reference +@cindex reference file +Use @var{rfile}'s security context rather than specifying a @var{context} value. + +@item -R +@itemx --recursive +@opindex -R +@opindex --recursive +Operate on files and directories recursively. + +@choptH +@xref{Traversing symlinks}. + +@choptL +@xref{Traversing symlinks}. + +@choptP +@xref{Traversing symlinks}. + +@item -v +@itemx --verbose +@opindex -v +@opindex --verbose +@cindex diagnostic +Output a diagnostic for every file processed. + +@item -u @var{user} +@itemx --user=@var{user} +@opindex -u +@opindex --user +Set user @var{user} in the target security context. + +@item -r @var{role} +@itemx --role=@var{role} +@opindex -r +@opindex --role +Set role @var{role} in the target security context. + +@item -t @var{type} +@itemx --type=@var{type} +@opindex -t +@opindex --type +Set type @var{type} in the target security context. + +@item -l @var{range} +@itemx --range=@var{range} +@opindex -l +@opindex --range +Set range @var{range} in the target security context. + +@end table + +@exitstatus + +@node runcon invocation +@section @command{runcon}: Run a command in specified SELinux context + +@pindex runcon +@cindex run with security context + + +@command{runcon} runs file in specified SELinux security context. + +Synopses: +@smallexample +runcon @var{context} @var{command} [@var{args}] +runcon [ -c ] [-u @var{user}] [-r @var{role}] [-t @var{type}] [-l @var{range}] @var{command} [@var{args}] +@end smallexample + +Run @var{command} with completely-specified @var{context}, or with +current or transitioned security context modified by one or more of @var{level}, +@var{role}, @var{type} and @var{user}. + +If none of @option{-c}, @option{-t}, @option{-u}, @option{-r}, or @option{-l} +is specified, the first argument is used as the complete context. +Any additional arguments after @var{command} +are interpreted as arguments to the command. + +With neither @var{context} nor @var{command}, print the current security context. + +The program accepts the following options. Also see @ref{Common options}. + +@table @samp + +@item -c +@itemx --compute +@opindex -c +@opindex --compute +Compute process transition context before modifying. + +@item -u @var{user} +@itemx --user=@var{user} +@opindex -u +@opindex --user +Set user @var{user} in the target security context. + +@item -r @var{role} +@itemx --role=@var{role} +@opindex -r +@opindex --role +Set role @var{role} in the target security context. + +@item -t @var{type} +@itemx --type=@var{type} +@opindex -t +@opindex --type +Set type @var{type} in the target security context. + +@item -l @var{range} +@itemx --range=@var{range} +@opindex -l +@opindex --range +Set range @var{range} in the target security context. + +@end table + +@cindex exit status of @command{runcon} +Exit status: + +@display +126 if @var{command} is found but cannot be invoked +127 if @command{runcon} itself fails or if @var{command} cannot be found +the exit status of @var{command} otherwise +@end display @node date invocation @section @command{date}: Print or set system date and time @@ -12334,7 +13271,7 @@ so the output looks like @samp{Thu Mar @ 3 13:47:51 PST 2005}. Normally, @command{date} uses the time zone rules indicated by the @env{TZ} environment variable, or the system default rules if @env{TZ} is not set. @xref{TZ Variable,, Specifying the Time Zone with -@env{TZ}, libc, The GNU C Library}. +@env{TZ}, libc, The GNU C Library Reference Manual}. @findex strftime @r{and @command{date}} @cindex time formats @@ -12356,6 +13293,9 @@ described below. * Padding and other flags:: Pad with zeros, spaces, etc. * Setting the time:: Changing the system clock. * Options for date:: Instead of the current time. +@detailmenu +* Date input formats:: Specifying date strings. +@end detailmenu * Examples of date:: Examples. @end menu @@ -12595,7 +13535,7 @@ date +%_d/%_m -d "Feb 1" As a @acronym{GNU} extension, you can specify the field width (after any flag, if present) as a decimal number. If the natural size of the -output is of the field has less than the specified number of characters, +output of the field has less than the specified number of characters, the result is written right adjusted and padded to the given size. For example, @samp{%9B} prints the right adjusted month name in a field of width 9. @@ -12686,7 +13626,12 @@ format. It can contain month names, time zones, @samp{am} and @samp{pm}, @samp{yesterday}, etc. For example, @option{--date="2004-02-27 14:19:13.489392193 +0530"} specifies the instant of time that is 489,392,193 nanoseconds after February 27, 2004 at 2:19:13 PM in a -time zone that is 5 hours and 30 minutes east of @acronym{UTC}. +time zone that is 5 hours and 30 minutes east of @acronym{UTC}.@* +Note: input currently must be in locale independent format. E.g., the +LC_TIME=C below is needed to print back the correct date in many locales: +@example +date -d "$(LC_TIME=C date)" +@end example @xref{Date input formats}. @item -f @var{datefile} @@ -12934,6 +13879,26 @@ date -u -d '1970-01-01 946684800 seconds' +"%Y-%m-%d %T %z" @end itemize +@node arch invocation +@section @command{arch}: Print machine hardware name + +@pindex arch +@cindex print machine hardware name +@cindex system information, printing + +@command{arch} prints the machine hardware name, +and is equivalent to @samp{uname -m}. +Synopsis: + +@example +arch [@var{option}] +@end example + +The program accepts the @ref{Common options} only. + +@exitstatus + + @node uname invocation @section @command{uname}: Print system information @@ -13111,6 +14076,36 @@ the case. @exitstatus +@node uptime invocation +@section @command{uptime}: Print system uptime and load + +@pindex uptime +@cindex printing the system uptime and load + +@command{uptime} prints the current time, the system's uptime, the +number of logged-in users and the current load average. + +If an argument is specified, it is used as the file to be read +to discover how many users are logged in. If no argument is +specified, a system default is used (@command{uptime --help} indicates +the default setting). + +The only options are @option{--help} and @option{--version}. +@xref{Common options}. + +For example, here's what it prints right now on one system I use: + +@example +$ uptime + 14:07 up 3:35, 3 users, load average: 1.39, 1.15, 1.04 +@end example + +The precise method of calculation of load average varies somewhat +between systems. Some systems calculate it as the average number of +runnable processes over the last 1, 5 and 15 minutes, but some systems +also include processes in the uninterruptible sleep state (that is, +those processes which are waiting for disk I/O). The Linux kernel +includes uninterruptible processes. @node Modified command invocation @chapter Modified command invocation @@ -13129,6 +14124,7 @@ user, etc. * nice invocation:: Modify niceness. * nohup invocation:: Immunize to hangups. * su invocation:: Modify user and group ID. +* timeout invocation:: Run with time limit. @end menu @@ -13140,7 +14136,11 @@ user, etc. @cindex root directory, running a program in a specified @command{chroot} runs a command with a specified root directory. -On many systems, only the super-user can do this. +On many systems, only the super-user can do this.@footnote{However, +some systems (e.g., FreeBSD) can be configured to allow certain regular +users to use the @code{chroot} system call, and hence to run this program. +Also, on Cygwin, anyone can run the @command{chroot} command, because the +underlying function is non-privileged due to lack of support in MS-Windows.} Synopses: @example @@ -13223,8 +14223,8 @@ These operands are evaluated left-to-right, so if two operands mention the same variable the earlier is ignored. Environment variable names can be empty, and can contain any -characters other than @samp{=} and the null character (@acronym{ASCII} -@sc{nul}). However, it is wise to limit yourself to names that +characters other than @samp{=} and @acronym{ASCII} @sc{nul}. +However, it is wise to limit yourself to names that consist solely of underscores, digits, and @acronym{ASCII} letters, and that begin with a non-digit, as applications like the shell do not work well with other names. @@ -13297,8 +14297,10 @@ If no arguments are given, @command{nice} prints the current niceness. Otherwise, @command{nice} runs the given @var{command} with its niceness adjusted. By default, its niceness is incremented by 10. -Nicenesses range at least from @minus{}20 (resulting in the most -favorable scheduling) through 19 (the least favorable). Some systems +Niceness values range at least from @minus{}20 (process has high priority +and gets more resources, thus slowing down other processes) through 19 +(process has lower priority and runs slowly itself, but has less impact +on the speed of other running processes). Some systems may have a wider range of nicenesses; conversely, other systems may enforce more restrictive limits. An attempt to set the niceness outside the supported range is treated as an attempt to use the @@ -13317,11 +14319,7 @@ term ``niceness'' for compatibility with historical practice. @var{command} must not be a special built-in utility (@pxref{Special built-in utilities}). -@cindex conflicts with shell built-ins -@cindex built-in shell commands, conflicts with -Because many shells have a built-in @command{nice} command, using an -unadorned @command{nice} in a script or interactively may get you -different functionality than that described here. +@mayConflictWithShellBuiltIn{nice} The program accepts the following option. Also see @ref{Common options}. Options must precede operands. @@ -13441,6 +14439,14 @@ However, if standard output is closed, standard error terminal output is instead appended to the file @file{nohup.out} or @file{$HOME/nohup.out} as above. +To capture the command's output to a file other than @file{nohup.out} +you can redirect it. For example, to capture the output of +@command{make}: + +@example +nohup make > make.log +@end example + @command{nohup} does not automatically put the command it runs in the background; you must do that explicitly, by ending the command line with an @samp{&}. Also, @command{nohup} does not alter the @@ -13620,6 +14626,64 @@ used to supporting the bosses and sysadmins in whatever they do, you might find this idea strange at first. +@node timeout invocation +@section @command{timeout}: Run a command with a time limit + +@pindex timeout +@cindex time limit +@cindex run commands with bounded time + +@command{timeout} runs the given @var{command} and kills it if it is +still running after the specified time interval. Synopsis: + +@example +timeout [@var{option}] @var{number}[smhd] @var{command} [@var{arg}]@dots{} +@end example + +@cindex time units +@var{number} is an integer followed by an optional unit; the default +is seconds. The units are: + +@table @samp +@item s +seconds +@item m +minutes +@item h +hours +@item d +days +@end table + +@var{command} must not be a special built-in utility (@pxref{Special +built-in utilities}). + +The program accepts the following option. Also see @ref{Common options}. +Options must precede operands. + +@table @samp +@item -s @var{signal} +@itemx --signal=@var{signal} +@opindex -s +@opindex --signal +Send this @var{signal} to @var{command} on timeout, rather than the +default @samp{TERM} signal. @var{signal} may be a name like @samp{HUP} +or a number. Also see @xref{Signal specifications}. + +@end table + +@cindex exit status of @command{timeout} +Exit status: + +@display +124 if @var{command} times out +125 if @command{timeout} itself fails +126 if @var{command} is found but cannot be invoked +127 if @var{command} cannot be found +the exit status of @var{command} otherwise +@end display + + @node Process control @chapter Process control @@ -13646,6 +14710,8 @@ kill [-s @var{signal} | --signal @var{signal} | -@var{signal}] @var{pid}@dots{} kill [-l | --list | -t | --table] [@var{signal}]@dots{} @end example +@mayConflictWithShellBuiltIn{kill} + The first form of the @command{kill} command sends a signal to all @var{pid} arguments. The default signal to send if none is specified is @samp{TERM}. The special signal number @samp{0} does not denote a @@ -13664,7 +14730,7 @@ If @var{pid} is not positive, a system-dependent set of system processes is excluded from the list of processes to which the signal is sent. -If a negative @var{PID} argument is desired as the first one, it +If a negative @var{pid} argument is desired as the first one, it should be preceded by @option{--}. However, as a common extension to @acronym{POSIX}, @option{--} is not required with @samp{kill -@var{signal} -@var{pid}}. The following commands are equivalent: @@ -13698,88 +14764,8 @@ number like @samp{1}, or an exit status of a process terminated by the signal. A signal name can be given in canonical form or prefixed by @samp{SIG}. The case of the letters is ignored, except for the @option{-@var{signal}} option which must use upper case to avoid -ambiguity with lower case option letters. The following signal names -and numbers are supported on all @acronym{POSIX} compliant systems: - -@table @samp -@item HUP -1. Hangup. -@item INT -2. Terminal interrupt. -@item QUIT -3. Terminal quit. -@item ABRT -6. Process abort. -@item KILL -9. Kill (cannot be caught or ignored). -@item ALRM -14. Alarm Clock. -@item TERM -15. Termination. -@end table - -@noindent -Other supported signal names have system-dependent corresponding -numbers. All systems conforming to @acronym{POSIX} 1003.1-2001 also -support the following signals: - -@table @samp -@item BUS -Access to an undefined portion of a memory object. -@item CHLD -Child process terminated, stopped, or continued. -@item CONT -Continue executing, if stopped. -@item FPE -Erroneous arithmetic operation. -@item ILL -Illegal Instruction. -@item PIPE -Write on a pipe with no one to read it. -@item SEGV -Invalid memory reference. -@item STOP -Stop executing (cannot be caught or ignored). -@item TSTP -Terminal stop. -@item TTIN -Background process attempting read. -@item TTOU -Background process attempting write. -@item URG -High bandwidth data is available at a socket. -@item USR1 -User-defined signal 1. -@item USR2 -User-defined signal 2. -@end table - -@noindent -@acronym{POSIX} 1003.1-2001 systems that support the @acronym{XSI} extension -also support the following signals: - -@table @samp -@item POLL -Pollable event. -@item PROF -Profiling timer expired. -@item SYS -Bad system call. -@item TRAP -Trace/breakpoint trap. -@item VTALRM -Virtual timer expired. -@item XCPU -CPU time limit exceeded. -@item XFSZ -File size limit exceeded. -@end table - -@noindent -@acronym{POSIX} 1003.1-2001 systems that support the @acronym{XRT} extension -also support at least eight real-time signals called @samp{RTMIN}, -@samp{RTMIN+1}, @dots{}, @samp{RTMAX-1}, @samp{RTMAX}. - +ambiguity with lower case option letters. For a list of supported +signal names and numbers see @xref{Signal specifications}. @node Delaying @chapter Delaying @@ -13832,6 +14818,9 @@ digits). The only options are @option{--help} and @option{--version}. @xref{Common options}. +@c sleep is a shell built-in at least with Solaris 11's /bin/sh +@mayConflictWithShellBuiltIn{sleep} + @exitstatus @@ -13863,35 +14852,42 @@ factor @var{option} If no @var{number} is specified on the command line, @command{factor} reads numbers from standard input, delimited by newlines, tabs, or spaces. -The only options are @option{--help} and @option{--version}. @xref{Common -options}. +The @command{factor} command supports only a small number of options: -The algorithm it uses is not very sophisticated, so for some inputs -@command{factor} runs for a long time. The hardest numbers to factor are -the products of large primes. Factoring the product of the two largest 32-bit -prime numbers takes about 80 seconds of CPU time on a 1.6 GHz Athlon. +@table @samp +@item --help +Print a short help on standard output, then exit without further +processing. + +@item --version +Print the program version on standard output, then exit without further +processing. +@end table + +Factoring the product of the eighth and ninth Mersenne primes +takes about 30 milliseconds of CPU time on a 2.2 GHz Athlon. @example -$ p=`echo '4294967279 * 4294967291'|bc` -$ factor $p -18446743979220271189: 4294967279 4294967291 +M8=`echo 2^31-1|bc` ; M9=`echo 2^61-1|bc` +/usr/bin/time -f '%U' factor $(echo "$M8 * $M9" | bc) +4951760154835678088235319297: 2147483647 2305843009213693951 +0.03 @end example -Similarly, it takes about 80 seconds for GNU factor (from coreutils-5.1.2) -to ``factor'' the largest 64-bit prime: +Similarly, factoring the eighth Fermat number @math{2^{256}+1} takes +about 20 seconds on the same machine. -@example -$ factor 18446744073709551557 - 18446744073709551557: 18446744073709551557 -@end example +Factoring large prime numbers is, in general, hard. The Pollard Rho +algorithm used by @command{factor} is particularly effective for +numbers with relatively small factors. If you wish to factor large +numbers which do not have small factors (for example, numbers which +are the product of two large primes), other methods are far better. -In contrast, @command{factor} factors the largest 64-bit number in just -over a tenth of a second: - -@example -$ factor `echo '2^64-1'|bc` -18446744073709551615: 3 5 17 257 641 65537 6700417 -@end example +If @command{factor} is built without using GNU MP, only +single-precision arithmetic is available, and so large numbers +(typically @math{2^{64}} and above) will not be supported. The single-precision +code uses an algorithm which is designed for factoring smaller +numbers. @exitstatus @@ -13994,9 +14990,9 @@ To generate octal output, use the printf @code{%o} format instead of @code{%x}. On most systems, seq can produce whole-number output for values up to -at least @code{2^53}. Larger integers are approximated. The details +at least @math{2^{53}}. Larger integers are approximated. The details differ depending on your floating-point implementation, but a common -case is that @command{seq} works with integers through @code{2^64}, +case is that @command{seq} works with integers through @math{2^{64}}, and larger integers may not be numerically correct: @example @@ -14006,34 +15002,16 @@ $ seq 18446744073709551616 1 18446744073709551618 18446744073709551618 @end example -Be careful when using @command{seq} with a fractional @var{increment}; -otherwise you may see surprising results. Most people would expect to -see @code{0.000003} printed as the last number in this example: +Be careful when using @command{seq} with outlandish values: otherwise +you may see surprising results, as @command{seq} uses floating point +internally. For example, on the x86 platform, where the internal +representation uses a 64-bit fraction, the command: @example -$ seq -s ' ' 0 0.000001 0.000003 -0.000000 0.000001 0.000002 +seq 1 0.0000000000000000001 1.0000000000000000009 @end example -But that doesn't happen on many systems because @command{seq} is -implemented using binary floating point arithmetic (via the C -@code{long double} type)---which means decimal fractions like @code{0.000001} -cannot be represented exactly. That in turn means some nonintuitive -conditions like @w{@code{0.000001 * 3 > 0.000003}} will end up being true. - -To work around that in the above example, use a slightly larger number as -the @var{last} value: - -@example -$ seq -s ' ' 0 0.000001 0.0000031 -0.000000 0.000001 0.000002 0.000003 -@end example - -In general, when using an @var{increment} with a fractional part, where -(@var{last} - @var{first}) / @var{increment} is (mathematically) a whole -number, specify a slightly larger (or smaller, if @var{increment} is negative) -value for @var{last} to ensure that @var{last} is the final value printed -by seq. +outputs 1.0000000000000000007 twice and skips 1.0000000000000000008. @exitstatus @@ -14503,7 +15481,7 @@ that your spelling is incorrect. So, we need a dictionary. The conventional location for a dictionary is @file{/usr/dict/words}. On my GNU/Linux system,@footnote{Redhat Linux 6.1, for the November 2000 revision of this article.} -this is a is a sorted, 45,402 word dictionary. +this is a sorted, 45,402 word dictionary. Now, how to compare our file with the dictionary? As before, we generate a sorted list of words, one per line: @@ -14615,22 +15593,16 @@ philosophy, these books are unparalleled, and I recommend them highly. Acknowledgment: I would like to express my gratitude to Brian Kernighan of Bell Labs, the original Software Toolsmith, for reviewing this column. -@node Copying This Manual -@appendix Copying This Manual - -@menu -* GNU Free Documentation License:: License for copying this manual. -@end menu +@node GNU Free Documentation License +@appendix GNU Free Documentation License @include fdl.texi -@node Index +@node Concept index @unnumbered Index @printindex cp -@shortcontents -@contents @bye @c Local variables: diff --git a/src/bin/coreutils/doc/fdl.texi b/src/bin/coreutils/doc/fdl.texi index 9c6d9afe3f..8805f1a47d 100644 --- a/src/bin/coreutils/doc/fdl.texi +++ b/src/bin/coreutils/doc/fdl.texi @@ -1,13 +1,12 @@ +@c The GNU Free Documentation License. +@center Version 1.3, 3 November 2008 -@node GNU Free Documentation License -@appendixsec GNU Free Documentation License - -@cindex FDL, GNU Free Documentation License -@center Version 1.2, November 2002 +@c This file is intended to be included within another document, +@c hence no sectioning command or @node. @display -Copyright @copyright{} 2000,2001,2002 Free Software Foundation, Inc. -51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA +Copyright @copyright{} 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc. +@uref{http://fsf.org/} Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. @@ -112,6 +111,9 @@ formats which do not have any title page as such, ``Title Page'' means the text near the most prominent appearance of the work's title, preceding the beginning of the body of the text. +The ``publisher'' means any person or entity that distributes copies +of the Document to the public. + A section ``Entitled XYZ'' means a named subunit of the Document whose title either is precisely XYZ or contains XYZ in parentheses following text that translates XYZ in another language. (Here XYZ stands for a @@ -380,13 +382,30 @@ title. @item TERMINATION -You may not copy, modify, sublicense, or distribute the Document except -as expressly provided for under this License. Any other attempt to -copy, modify, sublicense or distribute the Document is void, and will -automatically terminate your rights under this License. However, -parties who have received copies, or rights, from you under this -License will not have their licenses terminated so long as such -parties remain in full compliance. +You may not copy, modify, sublicense, or distribute the Document +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense, or distribute it is void, and +will automatically terminate your rights under this License. + +However, if you cease all violation of this License, then your license +from a particular copyright holder is reinstated (a) provisionally, +unless and until the copyright holder explicitly and finally +terminates your license, and (b) permanently, if the copyright holder +fails to notify you of the violation by some reasonable means prior to +60 days after the cessation. + +Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + +Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, receipt of a copy of some or all of the same material does +not give you any rights to use it. @item FUTURE REVISIONS OF THIS LICENSE @@ -404,7 +423,42 @@ following the terms and conditions either of that specified version or of any later version that has been published (not as a draft) by the Free Software Foundation. If the Document does not specify a version number of this License, you may choose any version ever published (not -as a draft) by the Free Software Foundation. +as a draft) by the Free Software Foundation. If the Document +specifies that a proxy can decide which future versions of this +License can be used, that proxy's public statement of acceptance of a +version permanently authorizes you to choose that version for the +Document. + +@item +RELICENSING + +``Massive Multiauthor Collaboration Site'' (or ``MMC Site'') means any +World Wide Web server that publishes copyrightable works and also +provides prominent facilities for anybody to edit those works. A +public wiki that anybody can edit is an example of such a server. A +``Massive Multiauthor Collaboration'' (or ``MMC'') contained in the +site means any set of copyrightable works thus published on the MMC +site. + +``CC-BY-SA'' means the Creative Commons Attribution-Share Alike 3.0 +license published by Creative Commons Corporation, a not-for-profit +corporation with a principal place of business in San Francisco, +California, as well as future copyleft versions of that license +published by that same organization. + +``Incorporate'' means to publish or republish a Document, in whole or +in part, as part of another Document. + +An MMC is ``eligible for relicensing'' if it is licensed under this +License, and if all works that were first published under this License +somewhere other than this MMC, and subsequently incorporated in whole +or in part into the MMC, (1) had no cover texts or invariant sections, +and (2) were thus incorporated prior to November 1, 2008. + +The operator of an MMC Site may republish an MMC contained in the site +under CC-BY-SA on the same site at any time before August 1, 2009, +provided the MMC is eligible for relicensing. + @end enumerate @page @@ -418,7 +472,7 @@ license notices just after the title page: @group Copyright (C) @var{year} @var{your name}. Permission is granted to copy, distribute and/or modify this document - under the terms of the GNU Free Documentation License, Version 1.2 + under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled ``GNU @@ -427,7 +481,7 @@ license notices just after the title page: @end smallexample If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts, -replace the ``with...Texts.'' line with this: +replace the ``with@dots{}Texts.'' line with this: @smallexample @group diff --git a/src/bin/coreutils/doc/getdate.texi b/src/bin/coreutils/doc/getdate.texi index eae4526b48..e7947800d3 100644 --- a/src/bin/coreutils/doc/getdate.texi +++ b/src/bin/coreutils/doc/getdate.texi @@ -4,7 +4,7 @@ @c 2003, 2004, 2005, 2006 Free Software Foundation, Inc. @c Permission is granted to copy, distribute and/or modify this document -@c under the terms of the GNU Free Documentation License, Version 1.2 or +@c under the terms of the GNU Free Documentation License, Version 1.3 or @c any later version published by the Free Software Foundation; with no @c Invariant Sections, with no Front-Cover Texts, and with no Back-Cover @c Texts. A copy of the license is included in the ``GNU Free @@ -265,16 +265,19 @@ which uses @samp{12m} for noon and @samp{12pm} for midnight.) The time may alternatively be followed by a time zone correction, expressed as @samp{@var{s}@var{hh}@var{mm}}, where @var{s} is @samp{+} or @samp{-}, @var{hh} is a number of zone hours and @var{mm} is a number -of zone minutes. You can also separate @var{hh} from @var{mm} with a colon. +of zone minutes. +The zone minutes term, @var{mm}, may be omitted, in which case +the one- or two-digit correction is interpreted as a number of hours. +You can also separate @var{hh} from @var{mm} with a colon. When a time zone correction is given this way, it forces interpretation of the time relative to Coordinated Universal Time (@sc{utc}), overriding any previous specification for the time zone or the local time zone. For example, @samp{+0530} and @samp{+05:30} both stand for the time zone 5.5 hours -ahead of @sc{utc} (e.g., India). The @var{minute} -part of the time of day may not be elided when a time zone correction -is used. This is the best way to specify a time zone correction by -fractional parts of an hour. +ahead of @sc{utc} (e.g., India). +This is the best way to +specify a time zone correction by fractional parts of an hour. +The maximum zone correction is 24 hours. Either @samp{am}/@samp{pm} or a time zone correction may be specified, but not both. diff --git a/src/bin/coreutils/doc/perm.texi b/src/bin/coreutils/doc/perm.texi index 78b5919cce..2a0d2be6dd 100644 --- a/src/bin/coreutils/doc/perm.texi +++ b/src/bin/coreutils/doc/perm.texi @@ -1,10 +1,10 @@ @c File mode bits -@c Copyright (C) 1994, 1996, 1999, 2000, 2001, 2003, 2004, 2005, 2006 +@c Copyright (C) 1994, 1996, 1999-2001, 2003-2006, 2008 @c Free Software Foundation, Inc. @c Permission is granted to copy, distribute and/or modify this document -@c under the terms of the GNU Free Documentation License, Version 1.2 or +@c under the terms of the GNU Free Documentation License, Version 1.3 or @c any later version published by the Free Software Foundation; with no @c Invariant Sections, with no Front-Cover Texts, and with no Back-Cover @c Texts. A copy of the license is included in the ``GNU Free diff --git a/src/bin/coreutils/doc/stamp-vti b/src/bin/coreutils/doc/stamp-vti index f556ae39dc..9327416af8 100644 --- a/src/bin/coreutils/doc/stamp-vti +++ b/src/bin/coreutils/doc/stamp-vti @@ -1,4 +1,4 @@ -@set UPDATED 22 March 2007 -@set UPDATED-MONTH March 2007 -@set EDITION 6.9 -@set VERSION 6.9 +@set UPDATED 5 May 2009 +@set UPDATED-MONTH May 2009 +@set EDITION 7.4 +@set VERSION 7.4 diff --git a/src/bin/coreutils/doc/version.texi b/src/bin/coreutils/doc/version.texi index f556ae39dc..9327416af8 100644 --- a/src/bin/coreutils/doc/version.texi +++ b/src/bin/coreutils/doc/version.texi @@ -1,4 +1,4 @@ -@set UPDATED 22 March 2007 -@set UPDATED-MONTH March 2007 -@set EDITION 6.9 -@set VERSION 6.9 +@set UPDATED 5 May 2009 +@set UPDATED-MONTH May 2009 +@set EDITION 7.4 +@set VERSION 7.4 diff --git a/src/bin/coreutils/lib/ChangeLog b/src/bin/coreutils/lib/ChangeLog-2007 similarity index 99% rename from src/bin/coreutils/lib/ChangeLog rename to src/bin/coreutils/lib/ChangeLog-2007 index e1b4c7aaca..99eba6641f 100644 --- a/src/bin/coreutils/lib/ChangeLog +++ b/src/bin/coreutils/lib/ChangeLog-2007 @@ -1,3 +1,8 @@ +2007-05-31 Jim Meyering + + * printf-parse.c, vasnprintf.c, unicodeio.c: Remove local + copies, so we now get these files from gnulib. + 2007-03-20 Jim Meyering Fix a typo in the handling of %x and %X. diff --git a/src/bin/coreutils/lib/Jamfile b/src/bin/coreutils/lib/Jamfile index 763c13140e..74499fca7b 100644 --- a/src/bin/coreutils/lib/Jamfile +++ b/src/bin/coreutils/lib/Jamfile @@ -10,11 +10,13 @@ SubDirSysHdrs $(SUBDIR) ; #SubDirSysHdrs $(SUBDIR) $(DOTDOT) ; StaticLibrary libfetish.a : - __fpending.c - acl.c +# __fpending.c +# acl.c # alloca.c - allocsa.c +# allocsa.c + areadlink-with-size.c argmatch.c + argv-iter.c asnprintf.c # atexit.c backupfile.c @@ -31,11 +33,12 @@ StaticLibrary libfetish.a : chown.c cloexec.c close-stream.c + closein.c closeout.c + copy-acl.c cycle-check.c diacrit.c dirchownmod.c -# dirfd.c dirname.c dup-safer.c # dup2.c @@ -50,13 +53,20 @@ StaticLibrary libfetish.a : # fchown-stub.c fd-reopen.c fd-safer.c + file-has-acl.c + file-set.c file-type.c # fileblocks.c filemode.c filenamecat.c + filevercmp.c fnmatch.c fopen-safer.c + fpending.c fprintftime.c + freadahead.c + freadptr.c + freadseek.c # fsusage.c # ftruncate.c fts.c @@ -67,7 +77,6 @@ StaticLibrary libfetish.a : # getgroups.c # gethostname.c gethrxtime.c -# getline.c getloadavg.c getndelim2.c # getopt.c @@ -81,32 +90,39 @@ StaticLibrary libfetish.a : hard-locale.c hash-pjw.c hash.c + hash-triple.c human.c i-ring.c idcache.c imaxtostr.c inet_ntop.c isapipe.c -# lchown.c linebuffer.c localcharset.c long-options.c # lstat-stub.c # lstat.c # malloc.c + malloca.c + mbchar.c mbscasecmp.c + mbslen.c + mbsstr.c mbswidth.c md5.c memcasecmp.c # memchr.c + memchr2.c # memcmp.c memcoll.c + memcmp2.c # memcpy.c # memmove.c mempcpy.c memrchr.c # memset.c memxfrm.c + mgetgroups.c mkancesdirs.c mkdir.c mkdir-p.c @@ -126,7 +142,9 @@ StaticLibrary libfetish.a : physmem.c posixtm.c posixver.c - putenv.c + progname.c + propername.c +# putenv.c quote.c quotearg.c # raise.c @@ -151,6 +169,7 @@ StaticLibrary libfetish.a : savedir.c savewd.c # setenv.c + set-mode-acl.c settime.c sha1.c sha256.c @@ -162,6 +181,7 @@ StaticLibrary libfetish.a : strftime.c strintcmp.c stripslash.c + strnlen1.c # strncasecmp.c strndup.c strnlen.c @@ -178,6 +198,10 @@ StaticLibrary libfetish.a : strverscmp.c # tempname.c time_r.c + trim.c + u8-uctomb.c + u8-uctomb-aux.c + uinttostr.c umaxtostr.c unicodeio.c unlinkdir.c @@ -186,8 +210,10 @@ StaticLibrary libfetish.a : # utime.c utimecmp.c utimens.c + version.c version-etc.c version-etc-fsf.c + write-any-file.c xalloc-die.c xfts.c xgetcwd.c @@ -196,15 +222,16 @@ StaticLibrary libfetish.a : xmemcoll.c xmemxfrm.c xnanosleep.c - xreadlink.c - xreadlink-with-size.c + xprintf.c xstrndup.c xstrtod.c xstrtoimax.c xstrtol.c + xstrtol-error.c xstrtold.c xstrtoul.c xstrtoumax.c yesno.c ; +SEARCH on [ FGristFiles u8-uctomb.c u8-uctomb-aux.c ] = [ FDirName $(SUBDIR) unistr ] ; diff --git a/src/bin/coreutils/lib/Makefile.am b/src/bin/coreutils/lib/Makefile.am index cfa22beb11..074cc9cfc7 100644 --- a/src/bin/coreutils/lib/Makefile.am +++ b/src/bin/coreutils/lib/Makefile.am @@ -1,28 +1,23 @@ ## Makefile for gnulib/lib -*-Makefile-*- -# Copyright (C) 1995-2006 Free Software Foundation, Inc. +# Copyright (C) 1995-2007, 2009 Free Software Foundation, Inc. -## This program is free software; you can redistribute it and/or modify +## This program is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2, or (at your option) -## any later version. - +## the Free Software Foundation, either version 3 of the License, or +## (at your option) any later version. +## ## This program is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. - +## ## You should have received a copy of the GNU General Public License -## along with this program; if not, write to the Free Software -## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -## 02110-1301, USA. +## along with this program. If not, see . include gnulib.mk -AM_CFLAGS = $(WARNING_CFLAGS) $(WERROR_CFLAGS) - -noinst_PROGRAMS = t-fpending -LDADD = $(noinst_LIBRARIES) +AM_CFLAGS += $(WARN_CFLAGS) # $(WERROR_CFLAGS) libcoreutils_a_SOURCES += \ buffer-lcm.c buffer-lcm.h \ @@ -30,9 +25,3 @@ libcoreutils_a_SOURCES += \ libcoreutils_a_LIBADD += $(LIBOBJS) libcoreutils_a_DEPENDENCIES += $(LIBOBJS) - -check: unit-test - -.PHONY: unit-test -unit-test: t-fpending - ./t-fpending > /dev/null diff --git a/src/bin/coreutils/lib/Makefile.in b/src/bin/coreutils/lib/Makefile.in index 772d8f38b7..e725cc7917 100644 --- a/src/bin/coreutils/lib/Makefile.in +++ b/src/bin/coreutils/lib/Makefile.in @@ -1,8 +1,9 @@ -# Makefile.in generated by automake 1.10 from Makefile.am. +# Makefile.in generated by automake 1.10c from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -14,9 +15,9 @@ @SET_MAKE@ -# Copyright (C) 1995-2006 Free Software Foundation, Inc. +# Copyright (C) 1995-2007, 2009 Free Software Foundation, Inc. -# Copyright (C) 2004-2007 Free Software Foundation, Inc. +# Copyright (C) 2002-2009 Free Software Foundation, Inc. # # This file is free software, distributed under the terms of the GNU # General Public License. As a special exception to the GNU General @@ -25,15 +26,15 @@ # the same distribution terms as the rest of that program. # # Generated by gnulib-tool. -# Reproduce by: gnulib-tool --import --dir=. --local-dir=gl --lib=libcoreutils --source-base=lib --m4-base=m4 --doc-base=doc --aux-dir=build-aux --avoid=lock --avoid=size_max --avoid=xsize --avoid=canonicalize-lgpl --no-libtool --macro-prefix=gl acl alloca announce-gen argmatch assert atexit backupfile base64 c-strcase c-strtod c-strtold calloc canon-host canonicalize chown cloexec closeout config-h configmake cycle-check d-ino d-type diacrit dirfd dirname dup2 error euidaccess exclude exitfail fchdir fcntl fcntl-safer fdl file-type fileblocks filemode filenamecat fnmatch-gnu fopen-safer fprintftime free fsusage ftruncate fts getdate getgroups gethrxtime getline getloadavg getndelim2 getopt getpagesize getpass-gnu gettext gettime gettimeofday getugroups getusershell gnupload group-member hard-locale hash hash-pjw host-os human idcache inttostr inttypes isapipe lchmod lchown lib-ignore linebuffer link-follow long-options lstat malloc mbswidth md5 memcasecmp memchr memcmp memcpy memmove mempcpy memrchr memset mkancesdirs mkdir mkdir-p mkstemp mktime modechange mountlist mpsort obstack pathmax perl physmem posixtm posixver putenv quote quotearg raise readlink readtokens readtokens0 readutmp realloc regex rename rename-dest-slash rmdir rmdir-errno root-dev-ino rpmatch safe-read same save-cwd savedir savewd settime sha1 sig2str ssize_t stat-macros stat-time stdbool stdlib-safer stpcpy strcspn strftime strpbrk strtod strtoimax strtol strtoumax strverscmp sys_stat timespec tzset unicodeio unistd-safer unlink-busy unlinkdir unlocked-io uptime userspec utime utimecmp utimens vasprintf verify version-etc-fsf wcwidth winsz-ioctl winsz-termios xalloc xgetcwd xgethostname xmemcoll xnanosleep xreadlink xreadlink-with-size xstrtod xstrtoimax xstrtol xstrtold xstrtoumax yesno - +# Reproduce by: gnulib-tool --import --dir=. --local-dir=gl --lib=libcoreutils --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=gnulib-tests --aux-dir=build-aux --with-tests --avoid=canonicalize-lgpl --avoid=dummy --avoid=lock --no-libtool --macro-prefix=gl acl alloca announce-gen areadlink-with-size argmatch argv-iter assert atexit autobuild backupfile base64 c-strcase c-strtod c-strtold calloc canon-host canonicalize chown cloexec closein closeout config-h configmake crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 cycle-check d-ino d-type diacrit dirfd dirname dup2 error euidaccess exclude exitfail fchdir fcntl fcntl-safer fdl file-type fileblocks filemode filenamecat filevercmp fnmatch-gnu fopen-safer fprintftime fseeko fsusage ftello ftruncate fts gendocs getdate getgroups gethrxtime getline getloadavg getndelim2 getopt getpagesize getpass-gnu gettext gettime gettimeofday getugroups getusershell git-version-gen gitlog-to-changelog gnu-make gnumakefile gnupload group-member hard-locale hash hash-pjw host-os human idcache ignore-value inttostr inttypes isapipe lchmod lchown lib-ignore linebuffer link-follow long-options lstat maintainer-makefile malloc manywarnings mbrtowc mbsalign mbswidth memcasecmp memchr memcmp memcmp2 memcpy memmove mempcpy memrchr memset mgetgroups mkancesdirs mkdir mkdir-p mkstemp mktime modechange mountlist mpsort obstack pathmax perl physmem posix-shell posixtm posixver priv-set progname propername putenv quote quotearg raise randint randperm readlink readtokens readtokens0 readutmp realloc regex rename rename-dest-slash rmdir rmdir-errno root-dev-ino rpmatch safe-read same save-cwd savedir savewd selinux-at settime sig2str sigaction ssize_t stat-macros stat-time stdbool stdlib-safer stpcpy stpncpy strcspn strdup strftime strpbrk strtod strtoimax strtol strtoumax strverscmp sys_stat timespec tzset unicodeio unistd-safer unlink-busy unlinkdir unlocked-io uptime useless-if-before-free userspec utimecmp utimens vasprintf-posix vc-list-files verify verror version-etc-fsf warnings wcwidth winsz-ioctl winsz-termios write-any-file xalloc xfreopen xgetcwd xgethostname xmemcoll xnanosleep xprintf xprintf-posix xstrtod xstrtoimax xstrtol xstrtold xstrtoumax yesno VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c @@ -50,46 +51,50 @@ build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/config.hin $(srcdir)/gnulib.mk \ - ChangeLog TODO alloca.c euidaccess-stat.c euidaccess-stat.h \ - fd-reopen.c fd-reopen.h getdate.c memxfrm.c memxfrm.h \ - rand-isaac.c rand-isaac.h randint.c randint.h randperm.c \ - randperm.h randread.c randread.h sha256.c sha256.h sha512.c \ - sha512.h strintcmp.c strnumcmp-in.h strnumcmp.c strnumcmp.h \ - u64.h xfts.c xfts.h -noinst_PROGRAMS = t-fpending$(EXEEXT) + TODO alloca.c euidaccess-stat.c euidaccess-stat.h fd-reopen.c \ + fd-reopen.h getdate.c memxfrm.c memxfrm.h strintcmp.c \ + strnumcmp-in.h strnumcmp.c strnumcmp.h xfts.c xfts.h subdir = lib ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/absolute-header.m4 \ +am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \ $(top_srcdir)/m4/acl.m4 $(top_srcdir)/m4/alloca.m4 \ - $(top_srcdir)/m4/allocsa.m4 $(top_srcdir)/m4/argmatch.m4 \ - $(top_srcdir)/m4/arpa_inet_h.m4 $(top_srcdir)/m4/assert.m4 \ - $(top_srcdir)/m4/atexit.m4 $(top_srcdir)/m4/autobuild.m4 \ - $(top_srcdir)/m4/backupfile.m4 $(top_srcdir)/m4/base64.m4 \ - $(top_srcdir)/m4/bison.m4 $(top_srcdir)/m4/boottime.m4 \ + $(top_srcdir)/m4/argmatch.m4 $(top_srcdir)/m4/arpa_inet_h.m4 \ + $(top_srcdir)/m4/assert.m4 $(top_srcdir)/m4/atexit.m4 \ + $(top_srcdir)/m4/autobuild.m4 $(top_srcdir)/m4/backupfile.m4 \ + $(top_srcdir)/m4/base64.m4 $(top_srcdir)/m4/bison.m4 \ + $(top_srcdir)/m4/boottime.m4 $(top_srcdir)/m4/btowc.m4 \ $(top_srcdir)/m4/c-strtod.m4 $(top_srcdir)/m4/calloc.m4 \ $(top_srcdir)/m4/canon-host.m4 \ $(top_srcdir)/m4/canonicalize.m4 \ $(top_srcdir)/m4/chdir-long.m4 $(top_srcdir)/m4/check-decl.m4 \ $(top_srcdir)/m4/chown.m4 $(top_srcdir)/m4/clock_time.m4 \ $(top_srcdir)/m4/cloexec.m4 $(top_srcdir)/m4/close-stream.m4 \ + $(top_srcdir)/m4/close.m4 $(top_srcdir)/m4/closein.m4 \ $(top_srcdir)/m4/closeout.m4 $(top_srcdir)/m4/codeset.m4 \ $(top_srcdir)/m4/config-h.m4 $(top_srcdir)/m4/cycle-check.m4 \ $(top_srcdir)/m4/d-ino.m4 $(top_srcdir)/m4/d-type.m4 \ - $(top_srcdir)/m4/dirfd.m4 $(top_srcdir)/m4/dirname.m4 \ - $(top_srcdir)/m4/dos.m4 $(top_srcdir)/m4/double-slash-root.m4 \ - $(top_srcdir)/m4/dup2.m4 $(top_srcdir)/m4/eealloc.m4 \ - $(top_srcdir)/m4/eoverflow.m4 $(top_srcdir)/m4/error.m4 \ + $(top_srcdir)/m4/dirent_h.m4 $(top_srcdir)/m4/dirfd.m4 \ + $(top_srcdir)/m4/dirname.m4 $(top_srcdir)/m4/dos.m4 \ + $(top_srcdir)/m4/double-slash-root.m4 $(top_srcdir)/m4/dup2.m4 \ + $(top_srcdir)/m4/eealloc.m4 $(top_srcdir)/m4/environ.m4 \ + $(top_srcdir)/m4/errno_h.m4 $(top_srcdir)/m4/error.m4 \ $(top_srcdir)/m4/euidaccess-stat.m4 \ $(top_srcdir)/m4/euidaccess.m4 $(top_srcdir)/m4/exclude.m4 \ - $(top_srcdir)/m4/exitfail.m4 $(top_srcdir)/m4/extensions.m4 \ - $(top_srcdir)/m4/fchdir.m4 $(top_srcdir)/m4/fcntl-safer.m4 \ + $(top_srcdir)/m4/exitfail.m4 $(top_srcdir)/m4/exponentd.m4 \ + $(top_srcdir)/m4/exponentf.m4 $(top_srcdir)/m4/exponentl.m4 \ + $(top_srcdir)/m4/extensions.m4 $(top_srcdir)/m4/fchdir.m4 \ + $(top_srcdir)/m4/fclose.m4 $(top_srcdir)/m4/fcntl-safer.m4 \ $(top_srcdir)/m4/fcntl_h.m4 $(top_srcdir)/m4/fd-reopen.m4 \ - $(top_srcdir)/m4/file-type.m4 $(top_srcdir)/m4/fileblocks.m4 \ - $(top_srcdir)/m4/filemode.m4 $(top_srcdir)/m4/filenamecat.m4 \ - $(top_srcdir)/m4/flexmember.m4 $(top_srcdir)/m4/fnmatch.m4 \ - $(top_srcdir)/m4/fpending.m4 $(top_srcdir)/m4/fprintftime.m4 \ - $(top_srcdir)/m4/free.m4 $(top_srcdir)/m4/fstypename.m4 \ - $(top_srcdir)/m4/fsusage.m4 $(top_srcdir)/m4/ftruncate.m4 \ + $(top_srcdir)/m4/fflush.m4 $(top_srcdir)/m4/file-type.m4 \ + $(top_srcdir)/m4/fileblocks.m4 $(top_srcdir)/m4/filemode.m4 \ + $(top_srcdir)/m4/filenamecat.m4 $(top_srcdir)/m4/flexmember.m4 \ + $(top_srcdir)/m4/float_h.m4 $(top_srcdir)/m4/fnmatch.m4 \ + $(top_srcdir)/m4/fpending.m4 $(top_srcdir)/m4/fpieee.m4 \ + $(top_srcdir)/m4/fprintftime.m4 $(top_srcdir)/m4/fpurge.m4 \ + $(top_srcdir)/m4/freading.m4 $(top_srcdir)/m4/frexp.m4 \ + $(top_srcdir)/m4/frexpl.m4 $(top_srcdir)/m4/fseeko.m4 \ + $(top_srcdir)/m4/fstypename.m4 $(top_srcdir)/m4/fsusage.m4 \ + $(top_srcdir)/m4/ftello.m4 $(top_srcdir)/m4/ftruncate.m4 \ $(top_srcdir)/m4/fts.m4 $(top_srcdir)/m4/getaddrinfo.m4 \ $(top_srcdir)/m4/getcwd-abort-bug.m4 \ $(top_srcdir)/m4/getcwd-path-max.m4 $(top_srcdir)/m4/getcwd.m4 \ @@ -102,49 +107,65 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/absolute-header.m4 \ $(top_srcdir)/m4/gettime.m4 $(top_srcdir)/m4/gettimeofday.m4 \ $(top_srcdir)/m4/getugroups.m4 \ $(top_srcdir)/m4/getusershell.m4 $(top_srcdir)/m4/glibc21.m4 \ + $(top_srcdir)/m4/gmp.m4 $(top_srcdir)/m4/gnu-make.m4 \ $(top_srcdir)/m4/gnulib-common.m4 \ $(top_srcdir)/m4/gnulib-comp.m4 \ $(top_srcdir)/m4/group-member.m4 \ $(top_srcdir)/m4/hard-locale.m4 $(top_srcdir)/m4/hash.m4 \ - $(top_srcdir)/m4/host-os.m4 $(top_srcdir)/m4/human.m4 \ - $(top_srcdir)/m4/i-ring.m4 $(top_srcdir)/m4/iconv.m4 \ - $(top_srcdir)/m4/idcache.m4 $(top_srcdir)/m4/inet_ntop.m4 \ - $(top_srcdir)/m4/inline.m4 $(top_srcdir)/m4/intmax_t.m4 \ + $(top_srcdir)/m4/host-os.m4 $(top_srcdir)/m4/hostent.m4 \ + $(top_srcdir)/m4/human.m4 $(top_srcdir)/m4/i-ring.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/iconv_h.m4 \ + $(top_srcdir)/m4/iconv_open.m4 $(top_srcdir)/m4/idcache.m4 \ + $(top_srcdir)/m4/include-exclude-prog.m4 \ + $(top_srcdir)/m4/include_next.m4 $(top_srcdir)/m4/inet_ntop.m4 \ + $(top_srcdir)/m4/inet_pton.m4 $(top_srcdir)/m4/inline.m4 \ + $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/intmax_t.m4 \ $(top_srcdir)/m4/inttostr.m4 $(top_srcdir)/m4/inttypes-pri.m4 \ $(top_srcdir)/m4/inttypes.m4 $(top_srcdir)/m4/inttypes_h.m4 \ - $(top_srcdir)/m4/isapipe.m4 $(top_srcdir)/m4/jm-macros.m4 \ - $(top_srcdir)/m4/jm-winsz1.m4 $(top_srcdir)/m4/jm-winsz2.m4 \ - $(top_srcdir)/m4/lchmod.m4 $(top_srcdir)/m4/lchown.m4 \ + $(top_srcdir)/m4/isapipe.m4 $(top_srcdir)/m4/isnand.m4 \ + $(top_srcdir)/m4/isnanf.m4 $(top_srcdir)/m4/isnanl.m4 \ + $(top_srcdir)/m4/jm-macros.m4 $(top_srcdir)/m4/jm-winsz1.m4 \ + $(top_srcdir)/m4/jm-winsz2.m4 $(top_srcdir)/m4/lchmod.m4 \ + $(top_srcdir)/m4/lchown.m4 $(top_srcdir)/m4/ldexpl.m4 \ $(top_srcdir)/m4/lib-check.m4 $(top_srcdir)/m4/lib-ignore.m4 \ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/link-follow.m4 \ - $(top_srcdir)/m4/localcharset.m4 \ - $(top_srcdir)/m4/long-options.m4 \ - $(top_srcdir)/m4/longdouble.m4 $(top_srcdir)/m4/longlong.m4 \ - $(top_srcdir)/m4/ls-mntd-fs.m4 $(top_srcdir)/m4/lstat.m4 \ + $(top_srcdir)/m4/localcharset.m4 $(top_srcdir)/m4/locale-fr.m4 \ + $(top_srcdir)/m4/locale-ja.m4 $(top_srcdir)/m4/locale-tr.m4 \ + $(top_srcdir)/m4/locale-zh.m4 $(top_srcdir)/m4/long-options.m4 \ + $(top_srcdir)/m4/longlong.m4 $(top_srcdir)/m4/ls-mntd-fs.m4 \ + $(top_srcdir)/m4/lseek.m4 $(top_srcdir)/m4/lstat.m4 \ + $(top_srcdir)/m4/malloc.m4 $(top_srcdir)/m4/malloca.m4 \ + $(top_srcdir)/m4/manywarnings.m4 $(top_srcdir)/m4/math_h.m4 \ $(top_srcdir)/m4/mbchar.m4 $(top_srcdir)/m4/mbiter.m4 \ - $(top_srcdir)/m4/mbrtowc.m4 $(top_srcdir)/m4/mbscasecmp.m4 \ + $(top_srcdir)/m4/mbrlen.m4 $(top_srcdir)/m4/mbrtowc.m4 \ + $(top_srcdir)/m4/mbsinit.m4 $(top_srcdir)/m4/mbsrtowcs.m4 \ $(top_srcdir)/m4/mbstate_t.m4 $(top_srcdir)/m4/mbswidth.m4 \ $(top_srcdir)/m4/md5.m4 $(top_srcdir)/m4/memcasecmp.m4 \ $(top_srcdir)/m4/memchr.m4 $(top_srcdir)/m4/memcmp.m4 \ $(top_srcdir)/m4/memcoll.m4 $(top_srcdir)/m4/memcpy.m4 \ $(top_srcdir)/m4/memmove.m4 $(top_srcdir)/m4/mempcpy.m4 \ $(top_srcdir)/m4/memrchr.m4 $(top_srcdir)/m4/memset.m4 \ - $(top_srcdir)/m4/memxfrm.m4 $(top_srcdir)/m4/mkancesdirs.m4 \ - $(top_srcdir)/m4/mkdir-p.m4 $(top_srcdir)/m4/mkdir-slash.m4 \ - $(top_srcdir)/m4/mkstemp.m4 $(top_srcdir)/m4/mktime.m4 \ - $(top_srcdir)/m4/modechange.m4 $(top_srcdir)/m4/mountlist.m4 \ - $(top_srcdir)/m4/mpsort.m4 $(top_srcdir)/m4/nanosleep.m4 \ - $(top_srcdir)/m4/netinet_in_h.m4 $(top_srcdir)/m4/nls.m4 \ - $(top_srcdir)/m4/openat.m4 $(top_srcdir)/m4/pathmax.m4 \ - $(top_srcdir)/m4/perl.m4 $(top_srcdir)/m4/physmem.m4 \ - $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/posixtm.m4 \ - $(top_srcdir)/m4/posixver.m4 $(top_srcdir)/m4/prereq.m4 \ - $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/putenv.m4 \ - $(top_srcdir)/m4/quote.m4 $(top_srcdir)/m4/quotearg.m4 \ - $(top_srcdir)/m4/randint.m4 $(top_srcdir)/m4/randperm.m4 \ - $(top_srcdir)/m4/randread.m4 $(top_srcdir)/m4/readlink.m4 \ - $(top_srcdir)/m4/readtokens.m4 $(top_srcdir)/m4/readutmp.m4 \ + $(top_srcdir)/m4/memxfrm.m4 $(top_srcdir)/m4/mgetgroups.m4 \ + $(top_srcdir)/m4/mkancesdirs.m4 $(top_srcdir)/m4/mkdir-p.m4 \ + $(top_srcdir)/m4/mkdir-slash.m4 $(top_srcdir)/m4/mkstemp.m4 \ + $(top_srcdir)/m4/mktime.m4 $(top_srcdir)/m4/modechange.m4 \ + $(top_srcdir)/m4/mountlist.m4 $(top_srcdir)/m4/mpsort.m4 \ + $(top_srcdir)/m4/multiarch.m4 $(top_srcdir)/m4/nanosleep.m4 \ + $(top_srcdir)/m4/netdb_h.m4 $(top_srcdir)/m4/netinet_in_h.m4 \ + $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/nocrash.m4 \ + $(top_srcdir)/m4/open.m4 $(top_srcdir)/m4/openat.m4 \ + $(top_srcdir)/m4/pathmax.m4 $(top_srcdir)/m4/perl.m4 \ + $(top_srcdir)/m4/perror.m4 $(top_srcdir)/m4/physmem.m4 \ + $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/posix-shell.m4 \ + $(top_srcdir)/m4/posixtm.m4 $(top_srcdir)/m4/posixver.m4 \ + $(top_srcdir)/m4/prereq.m4 $(top_srcdir)/m4/printf-frexp.m4 \ + $(top_srcdir)/m4/printf-frexpl.m4 $(top_srcdir)/m4/printf.m4 \ + $(top_srcdir)/m4/priv-set.m4 $(top_srcdir)/m4/progtest.m4 \ + $(top_srcdir)/m4/putenv.m4 $(top_srcdir)/m4/quote.m4 \ + $(top_srcdir)/m4/quotearg.m4 $(top_srcdir)/m4/read-file.m4 \ + $(top_srcdir)/m4/readlink.m4 $(top_srcdir)/m4/readtokens.m4 \ + $(top_srcdir)/m4/readutmp.m4 $(top_srcdir)/m4/realloc.m4 \ $(top_srcdir)/m4/regex.m4 \ $(top_srcdir)/m4/rename-dest-slash.m4 \ $(top_srcdir)/m4/rename.m4 $(top_srcdir)/m4/rmdir-errno.m4 \ @@ -152,10 +173,17 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/absolute-header.m4 \ $(top_srcdir)/m4/rpmatch.m4 $(top_srcdir)/m4/safe-read.m4 \ $(top_srcdir)/m4/safe-write.m4 $(top_srcdir)/m4/same.m4 \ $(top_srcdir)/m4/save-cwd.m4 $(top_srcdir)/m4/savedir.m4 \ - $(top_srcdir)/m4/savewd.m4 $(top_srcdir)/m4/setenv.m4 \ + $(top_srcdir)/m4/savewd.m4 $(top_srcdir)/m4/select.m4 \ + $(top_srcdir)/m4/selinux-context-h.m4 \ + $(top_srcdir)/m4/selinux-selinux-h.m4 \ + $(top_srcdir)/m4/servent.m4 $(top_srcdir)/m4/setenv.m4 \ $(top_srcdir)/m4/settime.m4 $(top_srcdir)/m4/sha1.m4 \ $(top_srcdir)/m4/sha256.m4 $(top_srcdir)/m4/sha512.m4 \ - $(top_srcdir)/m4/sig2str.m4 $(top_srcdir)/m4/snprintf.m4 \ + $(top_srcdir)/m4/sig2str.m4 $(top_srcdir)/m4/sigaction.m4 \ + $(top_srcdir)/m4/signal_h.m4 \ + $(top_srcdir)/m4/signalblocking.m4 $(top_srcdir)/m4/signbit.m4 \ + $(top_srcdir)/m4/size_max.m4 $(top_srcdir)/m4/sleep.m4 \ + $(top_srcdir)/m4/snprintf.m4 $(top_srcdir)/m4/sockets.m4 \ $(top_srcdir)/m4/socklen.m4 $(top_srcdir)/m4/sockpfaf.m4 \ $(top_srcdir)/m4/ssize_t.m4 $(top_srcdir)/m4/st_dm_mode.m4 \ $(top_srcdir)/m4/stat-prog.m4 $(top_srcdir)/m4/stat-time.m4 \ @@ -163,100 +191,163 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/absolute-header.m4 \ $(top_srcdir)/m4/stdint.m4 $(top_srcdir)/m4/stdint_h.m4 \ $(top_srcdir)/m4/stdio-safer.m4 $(top_srcdir)/m4/stdio_h.m4 \ $(top_srcdir)/m4/stdlib-safer.m4 $(top_srcdir)/m4/stdlib_h.m4 \ - $(top_srcdir)/m4/stpcpy.m4 $(top_srcdir)/m4/strcspn.m4 \ - $(top_srcdir)/m4/strdup.m4 $(top_srcdir)/m4/strftime.m4 \ + $(top_srcdir)/m4/stpcpy.m4 $(top_srcdir)/m4/stpncpy.m4 \ + $(top_srcdir)/m4/strcspn.m4 $(top_srcdir)/m4/strdup.m4 \ + $(top_srcdir)/m4/strerror.m4 $(top_srcdir)/m4/strftime.m4 \ $(top_srcdir)/m4/string_h.m4 $(top_srcdir)/m4/strndup.m4 \ $(top_srcdir)/m4/strnlen.m4 $(top_srcdir)/m4/strnumcmp.m4 \ $(top_srcdir)/m4/strpbrk.m4 $(top_srcdir)/m4/strtod.m4 \ $(top_srcdir)/m4/strtoimax.m4 $(top_srcdir)/m4/strtol.m4 \ $(top_srcdir)/m4/strtoll.m4 $(top_srcdir)/m4/strtoul.m4 \ $(top_srcdir)/m4/strtoull.m4 $(top_srcdir)/m4/strtoumax.m4 \ - $(top_srcdir)/m4/strverscmp.m4 \ + $(top_srcdir)/m4/strverscmp.m4 $(top_srcdir)/m4/sys_ioctl_h.m4 \ + $(top_srcdir)/m4/sys_select_h.m4 \ $(top_srcdir)/m4/sys_socket_h.m4 \ $(top_srcdir)/m4/sys_stat_h.m4 $(top_srcdir)/m4/sys_time_h.m4 \ $(top_srcdir)/m4/tempname.m4 $(top_srcdir)/m4/time_h.m4 \ $(top_srcdir)/m4/time_r.m4 $(top_srcdir)/m4/timespec.m4 \ $(top_srcdir)/m4/tm_gmtoff.m4 $(top_srcdir)/m4/tzset.m4 \ - $(top_srcdir)/m4/unicodeio.m4 $(top_srcdir)/m4/unistd-safer.m4 \ - $(top_srcdir)/m4/unistd_h.m4 $(top_srcdir)/m4/unlink-busy.m4 \ - $(top_srcdir)/m4/unlinkdir.m4 $(top_srcdir)/m4/unlocked-io.m4 \ - $(top_srcdir)/m4/uptime.m4 $(top_srcdir)/m4/userspec.m4 \ - $(top_srcdir)/m4/utimbuf.m4 $(top_srcdir)/m4/utime.m4 \ + $(top_srcdir)/m4/ungetc.m4 $(top_srcdir)/m4/unicodeio.m4 \ + $(top_srcdir)/m4/unistd-safer.m4 $(top_srcdir)/m4/unistd_h.m4 \ + $(top_srcdir)/m4/unlink-busy.m4 $(top_srcdir)/m4/unlinkdir.m4 \ + $(top_srcdir)/m4/unlocked-io.m4 $(top_srcdir)/m4/uptime.m4 \ + $(top_srcdir)/m4/userspec.m4 $(top_srcdir)/m4/utimbuf.m4 \ $(top_srcdir)/m4/utimecmp.m4 $(top_srcdir)/m4/utimens.m4 \ - $(top_srcdir)/m4/utimes-null.m4 $(top_srcdir)/m4/utimes.m4 \ - $(top_srcdir)/m4/vasnprintf.m4 $(top_srcdir)/m4/vasprintf.m4 \ + $(top_srcdir)/m4/utimes.m4 $(top_srcdir)/m4/vasnprintf.m4 \ + $(top_srcdir)/m4/vasprintf-posix.m4 \ + $(top_srcdir)/m4/vasprintf.m4 \ + $(top_srcdir)/m4/vfprintf-posix.m4 \ + $(top_srcdir)/m4/vprintf-posix.m4 $(top_srcdir)/m4/warnings.m4 \ $(top_srcdir)/m4/wchar.m4 $(top_srcdir)/m4/wchar_t.m4 \ + $(top_srcdir)/m4/wcrtomb.m4 $(top_srcdir)/m4/wctob.m4 \ $(top_srcdir)/m4/wctype.m4 $(top_srcdir)/m4/wcwidth.m4 \ - $(top_srcdir)/m4/wint_t.m4 $(top_srcdir)/m4/xalloc.m4 \ - $(top_srcdir)/m4/xfts.m4 $(top_srcdir)/m4/xgetcwd.m4 \ - $(top_srcdir)/m4/xnanosleep.m4 $(top_srcdir)/m4/xstrndup.m4 \ + $(top_srcdir)/m4/wint_t.m4 $(top_srcdir)/m4/write-any-file.m4 \ + $(top_srcdir)/m4/write.m4 $(top_srcdir)/m4/xalloc.m4 \ + $(top_srcdir)/m4/xattr.m4 $(top_srcdir)/m4/xfts.m4 \ + $(top_srcdir)/m4/xgetcwd.m4 $(top_srcdir)/m4/xnanosleep.m4 \ + $(top_srcdir)/m4/xsize.m4 $(top_srcdir)/m4/xstrndup.m4 \ $(top_srcdir)/m4/xstrtod.m4 $(top_srcdir)/m4/xstrtol.m4 \ - $(top_srcdir)/m4/yesno.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/xvasprintf.m4 $(top_srcdir)/m4/yesno.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = LIBRARIES = $(noinst_LIBRARIES) AR = ar ARFLAGS = cru +AM_V_AR = $(am__v_AR_$(V)) +am__v_AR_ = $(am__v_AR_$(AM_DEFAULT_VERBOSITY)) +am__v_AR_0 = @echo " AR " $@; +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) +am__v_at_0 = @ libcoreutils_a_AR = $(AR) $(ARFLAGS) am__DEPENDENCIES_1 = -am_libcoreutils_a_OBJECTS = allocsa.$(OBJEXT) base64.$(OBJEXT) \ - c-ctype.$(OBJEXT) c-strcasecmp.$(OBJEXT) \ - c-strncasecmp.$(OBJEXT) diacrit.$(OBJEXT) full-read.$(OBJEXT) \ - full-write.$(OBJEXT) getdate.$(OBJEXT) hash-pjw.$(OBJEXT) \ - linebuffer.$(OBJEXT) localcharset.$(OBJEXT) mbchar.$(OBJEXT) \ - mbscasecmp.$(OBJEXT) mbswidth.$(OBJEXT) readtokens0.$(OBJEXT) \ - savewd.$(OBJEXT) strnlen1.$(OBJEXT) unicodeio.$(OBJEXT) \ - version-etc.$(OBJEXT) version-etc-fsf.$(OBJEXT) \ - xalloc-die.$(OBJEXT) xgethostname.$(OBJEXT) xmemcoll.$(OBJEXT) \ - xreadlink.$(OBJEXT) xreadlink-with-size.$(OBJEXT) \ - xstrndup.$(OBJEXT) xstrtoimax.$(OBJEXT) xstrtoumax.$(OBJEXT) \ - buffer-lcm.$(OBJEXT) xmemxfrm.$(OBJEXT) +am__dirstamp = $(am__leading_dot)dirstamp +am_libcoreutils_a_OBJECTS = set-mode-acl.$(OBJEXT) copy-acl.$(OBJEXT) \ + file-has-acl.$(OBJEXT) areadlink-with-size.$(OBJEXT) \ + argv-iter.$(OBJEXT) base64.$(OBJEXT) c-ctype.$(OBJEXT) \ + c-strcasecmp.$(OBJEXT) c-strncasecmp.$(OBJEXT) \ + close-hook.$(OBJEXT) diacrit.$(OBJEXT) file-set.$(OBJEXT) \ + filevercmp.$(OBJEXT) fpurge.$(OBJEXT) freadahead.$(OBJEXT) \ + freading.$(OBJEXT) freadptr.$(OBJEXT) freadseek.$(OBJEXT) \ + fseterr.$(OBJEXT) full-read.$(OBJEXT) full-write.$(OBJEXT) \ + getdate.$(OBJEXT) hash-pjw.$(OBJEXT) hash-triple.$(OBJEXT) \ + linebuffer.$(OBJEXT) localcharset.$(OBJEXT) malloca.$(OBJEXT) \ + mbchar.$(OBJEXT) mbsalign.$(OBJEXT) mbscasecmp.$(OBJEXT) \ + mbslen.$(OBJEXT) mbsstr.$(OBJEXT) mbswidth.$(OBJEXT) \ + memchr2.$(OBJEXT) memcmp2.$(OBJEXT) openat-die.$(OBJEXT) \ + printf-frexp.$(OBJEXT) printf-frexpl.$(OBJEXT) \ + priv-set.$(OBJEXT) progname.$(OBJEXT) propername.$(OBJEXT) \ + randint.$(OBJEXT) randperm.$(OBJEXT) randread.$(OBJEXT) \ + rand-isaac.$(OBJEXT) readtokens0.$(OBJEXT) savewd.$(OBJEXT) \ + striconv.$(OBJEXT) strnlen1.$(OBJEXT) trim.$(OBJEXT) \ + unicodeio.$(OBJEXT) unistr/u8-uctomb.$(OBJEXT) \ + unistr/u8-uctomb-aux.$(OBJEXT) uniwidth/width.$(OBJEXT) \ + verror.$(OBJEXT) version-etc.$(OBJEXT) \ + version-etc-fsf.$(OBJEXT) xalloc-die.$(OBJEXT) \ + xfreopen.$(OBJEXT) xgethostname.$(OBJEXT) xmemcoll.$(OBJEXT) \ + xprintf.$(OBJEXT) xstriconv.$(OBJEXT) xstrndup.$(OBJEXT) \ + xstrtoimax.$(OBJEXT) xstrtoumax.$(OBJEXT) xvasprintf.$(OBJEXT) \ + xasprintf.$(OBJEXT) buffer-lcm.$(OBJEXT) xmemxfrm.$(OBJEXT) libcoreutils_a_OBJECTS = $(am_libcoreutils_a_OBJECTS) LTLIBRARIES = $(noinst_LTLIBRARIES) -PROGRAMS = $(noinst_PROGRAMS) -t_fpending_SOURCES = t-fpending.c -t_fpending_OBJECTS = t-fpending.$(OBJEXT) -t_fpending_LDADD = $(LDADD) -t_fpending_DEPENDENCIES = $(noinst_LIBRARIES) DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp am__depfiles_maybe = depfiles +am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_$(V)) +am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) +am__v_CC_0 = @echo " CC " $@; CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_$(V)) +am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) +am__v_CCLD_0 = @echo " CCLD " $@; YACCCOMPILE = $(YACC) $(YFLAGS) $(AM_YFLAGS) +AM_V_YACC = $(am__v_YACC_$(V)) +am__v_YACC_ = $(am__v_YACC_$(AM_DEFAULT_VERBOSITY)) +am__v_YACC_0 = @echo " YACC " $@; YLWRAP = $(top_srcdir)/build-aux/ylwrap -SOURCES = $(libcoreutils_a_SOURCES) $(EXTRA_libcoreutils_a_SOURCES) \ - t-fpending.c +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) +am__v_GEN_0 = @echo " GEN " $@; +SOURCES = $(libcoreutils_a_SOURCES) $(EXTRA_libcoreutils_a_SOURCES) DIST_SOURCES = $(libcoreutils_a_SOURCES) \ - $(EXTRA_libcoreutils_a_SOURCES) t-fpending.c + $(EXTRA_libcoreutils_a_SOURCES) +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-dvi-recursive install-exec-recursive \ + install-html-recursive install-info-recursive \ + install-pdf-recursive install-ps-recursive install-recursive \ + installcheck-recursive installdirs-recursive pdf-recursive \ + ps-recursive uninstall-recursive HEADERS = $(noinst_HEADERS) +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ + $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ + distdir ETAGS = etags CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ABSOLUTE_DIRENT_H = @ABSOLUTE_DIRENT_H@ -ABSOLUTE_FCNTL_H = @ABSOLUTE_FCNTL_H@ -ABSOLUTE_INTTYPES_H = @ABSOLUTE_INTTYPES_H@ -ABSOLUTE_NETINET_IN_H = @ABSOLUTE_NETINET_IN_H@ -ABSOLUTE_STDINT_H = @ABSOLUTE_STDINT_H@ -ABSOLUTE_STDIO_H = @ABSOLUTE_STDIO_H@ -ABSOLUTE_STDLIB_H = @ABSOLUTE_STDLIB_H@ -ABSOLUTE_STRING_H = @ABSOLUTE_STRING_H@ -ABSOLUTE_SYS_SOCKET_H = @ABSOLUTE_SYS_SOCKET_H@ -ABSOLUTE_SYS_STAT_H = @ABSOLUTE_SYS_STAT_H@ -ABSOLUTE_SYS_TIME_H = @ABSOLUTE_SYS_TIME_H@ -ABSOLUTE_TIME_H = @ABSOLUTE_TIME_H@ -ABSOLUTE_UNISTD_H = @ABSOLUTE_UNISTD_H@ -ABSOLUTE_WCHAR_H = @ABSOLUTE_WCHAR_H@ -ABSOLUTE_WCTYPE_H = @ABSOLUTE_WCTYPE_H@ +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ ALLOCA_H = @ALLOCA_H@ AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@ ARPA_INET_H = @ARPA_INET_H@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -270,46 +361,122 @@ BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ +CONFIG_STATUS_DEPENDENCIES = @CONFIG_STATUS_DEPENDENCIES@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFAULT_POSIX2_VERSION = @DEFAULT_POSIX2_VERSION@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DF_PROG = @DF_PROG@ DIRENT_H = @DIRENT_H@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -EOVERFLOW = @EOVERFLOW@ +EMULTIHOP_HIDDEN = @EMULTIHOP_HIDDEN@ +EMULTIHOP_VALUE = @EMULTIHOP_VALUE@ +ENOLINK_HIDDEN = @ENOLINK_HIDDEN@ +ENOLINK_VALUE = @ENOLINK_VALUE@ +EOVERFLOW_HIDDEN = @EOVERFLOW_HIDDEN@ +EOVERFLOW_VALUE = @EOVERFLOW_VALUE@ +ERRNO_H = @ERRNO_H@ EXEEXT = @EXEEXT@ FCNTL_H = @FCNTL_H@ +FLOAT_H = @FLOAT_H@ FNMATCH_H = @FNMATCH_H@ +GETADDRINFO_LIB = @GETADDRINFO_LIB@ GETLOADAVG_LIBS = @GETLOADAVG_LIBS@ GETOPT_H = @GETOPT_H@ +GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GLIBC21 = @GLIBC21@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ +GNULIB_ACCEPT = @GNULIB_ACCEPT@ +GNULIB_ALPHASORT = @GNULIB_ALPHASORT@ +GNULIB_ATOLL = @GNULIB_ATOLL@ +GNULIB_BIND = @GNULIB_BIND@ +GNULIB_BTOWC = @GNULIB_BTOWC@ +GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@ +GNULIB_CEILF = @GNULIB_CEILF@ +GNULIB_CEILL = @GNULIB_CEILL@ GNULIB_CHOWN = @GNULIB_CHOWN@ +GNULIB_CLOSE = @GNULIB_CLOSE@ +GNULIB_CONNECT = @GNULIB_CONNECT@ +GNULIB_DIRFD = @GNULIB_DIRFD@ +GNULIB_DPRINTF = @GNULIB_DPRINTF@ GNULIB_DUP2 = @GNULIB_DUP2@ +GNULIB_ENVIRON = @GNULIB_ENVIRON@ +GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@ GNULIB_FCHDIR = @GNULIB_FCHDIR@ +GNULIB_FCLOSE = @GNULIB_FCLOSE@ +GNULIB_FFLUSH = @GNULIB_FFLUSH@ +GNULIB_FLOORF = @GNULIB_FLOORF@ +GNULIB_FLOORL = @GNULIB_FLOORL@ +GNULIB_FOPEN = @GNULIB_FOPEN@ +GNULIB_FPRINTF = @GNULIB_FPRINTF@ GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@ +GNULIB_FPUTC = @GNULIB_FPUTC@ +GNULIB_FPUTS = @GNULIB_FPUTS@ +GNULIB_FREOPEN = @GNULIB_FREOPEN@ +GNULIB_FREXP = @GNULIB_FREXP@ +GNULIB_FREXPL = @GNULIB_FREXPL@ +GNULIB_FSEEK = @GNULIB_FSEEK@ +GNULIB_FSEEKO = @GNULIB_FSEEKO@ +GNULIB_FSYNC = @GNULIB_FSYNC@ +GNULIB_FTELL = @GNULIB_FTELL@ +GNULIB_FTELLO = @GNULIB_FTELLO@ GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@ +GNULIB_FWRITE = @GNULIB_FWRITE@ +GNULIB_GETADDRINFO = @GNULIB_GETADDRINFO@ GNULIB_GETCWD = @GNULIB_GETCWD@ +GNULIB_GETDELIM = @GNULIB_GETDELIM@ +GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@ +GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@ +GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@ +GNULIB_GETLINE = @GNULIB_GETLINE@ +GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@ GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ +GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@ +GNULIB_GETPEERNAME = @GNULIB_GETPEERNAME@ +GNULIB_GETSOCKNAME = @GNULIB_GETSOCKNAME@ +GNULIB_GETSOCKOPT = @GNULIB_GETSOCKOPT@ GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ +GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@ GNULIB_IMAXABS = @GNULIB_IMAXABS@ GNULIB_IMAXDIV = @GNULIB_IMAXDIV@ +GNULIB_INET_NTOP = @GNULIB_INET_NTOP@ +GNULIB_INET_PTON = @GNULIB_INET_PTON@ +GNULIB_IOCTL = @GNULIB_IOCTL@ +GNULIB_ISFINITE = @GNULIB_ISFINITE@ +GNULIB_ISINF = @GNULIB_ISINF@ +GNULIB_ISNAN = @GNULIB_ISNAN@ +GNULIB_ISNAND = @GNULIB_ISNAND@ +GNULIB_ISNANF = @GNULIB_ISNANF@ +GNULIB_ISNANL = @GNULIB_ISNANL@ +GNULIB_LCHMOD = @GNULIB_LCHMOD@ +GNULIB_LCHOWN = @GNULIB_LCHOWN@ +GNULIB_LDEXPL = @GNULIB_LDEXPL@ +GNULIB_LINK = @GNULIB_LINK@ +GNULIB_LISTEN = @GNULIB_LISTEN@ +GNULIB_LSEEK = @GNULIB_LSEEK@ +GNULIB_LSTAT = @GNULIB_LSTAT@ +GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@ +GNULIB_MATHL = @GNULIB_MATHL@ +GNULIB_MBRLEN = @GNULIB_MBRLEN@ +GNULIB_MBRTOWC = @GNULIB_MBRTOWC@ GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@ GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@ GNULIB_MBSCHR = @GNULIB_MBSCHR@ GNULIB_MBSCSPN = @GNULIB_MBSCSPN@ +GNULIB_MBSINIT = @GNULIB_MBSINIT@ GNULIB_MBSLEN = @GNULIB_MBSLEN@ GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@ +GNULIB_MBSNLEN = @GNULIB_MBSNLEN@ +GNULIB_MBSNRTOWCS = @GNULIB_MBSNRTOWCS@ GNULIB_MBSPBRK = @GNULIB_MBSPBRK@ GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@ GNULIB_MBSRCHR = @GNULIB_MBSRCHR@ +GNULIB_MBSRTOWCS = @GNULIB_MBSRTOWCS@ GNULIB_MBSSEP = @GNULIB_MBSSEP@ GNULIB_MBSSPN = @GNULIB_MBSSPN@ GNULIB_MBSSTR = @GNULIB_MBSSTR@ @@ -319,82 +486,230 @@ GNULIB_MEMPCPY = @GNULIB_MEMPCPY@ GNULIB_MEMRCHR = @GNULIB_MEMRCHR@ GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ GNULIB_MKSTEMP = @GNULIB_MKSTEMP@ +GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@ +GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@ +GNULIB_OPEN = @GNULIB_OPEN@ +GNULIB_PERROR = @GNULIB_PERROR@ +GNULIB_PRINTF = @GNULIB_PRINTF@ GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@ +GNULIB_PUTC = @GNULIB_PUTC@ +GNULIB_PUTCHAR = @GNULIB_PUTCHAR@ +GNULIB_PUTENV = @GNULIB_PUTENV@ +GNULIB_PUTS = @GNULIB_PUTS@ +GNULIB_RANDOM_R = @GNULIB_RANDOM_R@ +GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@ GNULIB_READLINK = @GNULIB_READLINK@ +GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@ +GNULIB_RECV = @GNULIB_RECV@ +GNULIB_RECVFROM = @GNULIB_RECVFROM@ +GNULIB_ROUND = @GNULIB_ROUND@ +GNULIB_ROUNDF = @GNULIB_ROUNDF@ +GNULIB_ROUNDL = @GNULIB_ROUNDL@ +GNULIB_RPMATCH = @GNULIB_RPMATCH@ +GNULIB_SCANDIR = @GNULIB_SCANDIR@ +GNULIB_SELECT = @GNULIB_SELECT@ +GNULIB_SEND = @GNULIB_SEND@ +GNULIB_SENDTO = @GNULIB_SENDTO@ +GNULIB_SETENV = @GNULIB_SETENV@ +GNULIB_SETSOCKOPT = @GNULIB_SETSOCKOPT@ +GNULIB_SHUTDOWN = @GNULIB_SHUTDOWN@ +GNULIB_SIGACTION = @GNULIB_SIGACTION@ +GNULIB_SIGNAL_H_SIGPIPE = @GNULIB_SIGNAL_H_SIGPIPE@ +GNULIB_SIGNBIT = @GNULIB_SIGNBIT@ +GNULIB_SIGPROCMASK = @GNULIB_SIGPROCMASK@ +GNULIB_SLEEP = @GNULIB_SLEEP@ GNULIB_SNPRINTF = @GNULIB_SNPRINTF@ +GNULIB_SOCKET = @GNULIB_SOCKET@ GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@ +GNULIB_STDIO_H_SIGPIPE = @GNULIB_STDIO_H_SIGPIPE@ GNULIB_STPCPY = @GNULIB_STPCPY@ GNULIB_STPNCPY = @GNULIB_STPNCPY@ GNULIB_STRCASESTR = @GNULIB_STRCASESTR@ GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@ GNULIB_STRDUP = @GNULIB_STRDUP@ +GNULIB_STRERROR = @GNULIB_STRERROR@ GNULIB_STRNDUP = @GNULIB_STRNDUP@ GNULIB_STRNLEN = @GNULIB_STRNLEN@ GNULIB_STRPBRK = @GNULIB_STRPBRK@ GNULIB_STRSEP = @GNULIB_STRSEP@ +GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@ +GNULIB_STRSTR = @GNULIB_STRSTR@ +GNULIB_STRTOD = @GNULIB_STRTOD@ GNULIB_STRTOIMAX = @GNULIB_STRTOIMAX@ GNULIB_STRTOK_R = @GNULIB_STRTOK_R@ +GNULIB_STRTOLL = @GNULIB_STRTOLL@ +GNULIB_STRTOULL = @GNULIB_STRTOULL@ GNULIB_STRTOUMAX = @GNULIB_STRTOUMAX@ +GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@ +GNULIB_TRUNC = @GNULIB_TRUNC@ +GNULIB_TRUNCF = @GNULIB_TRUNCF@ +GNULIB_TRUNCL = @GNULIB_TRUNCL@ +GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@ +GNULIB_UNSETENV = @GNULIB_UNSETENV@ +GNULIB_VASPRINTF = @GNULIB_VASPRINTF@ +GNULIB_VDPRINTF = @GNULIB_VDPRINTF@ +GNULIB_VFPRINTF = @GNULIB_VFPRINTF@ GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@ +GNULIB_VPRINTF = @GNULIB_VPRINTF@ GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@ GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@ GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@ -GNU_PACKAGE = @GNU_PACKAGE@ +GNULIB_WCRTOMB = @GNULIB_WCRTOMB@ +GNULIB_WCSNRTOMBS = @GNULIB_WCSNRTOMBS@ +GNULIB_WCSRTOMBS = @GNULIB_WCSRTOMBS@ +GNULIB_WCTOB = @GNULIB_WCTOB@ +GNULIB_WCWIDTH = @GNULIB_WCWIDTH@ +GNULIB_WRITE = @GNULIB_WRITE@ GREP = @GREP@ +HAVE_ALPHASORT = @HAVE_ALPHASORT@ +HAVE_ARPA_INET_H = @HAVE_ARPA_INET_H@ +HAVE_ATOLL = @HAVE_ATOLL@ +HAVE_BTOWC = @HAVE_BTOWC@ +HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@ +HAVE_DECL_ACOSL = @HAVE_DECL_ACOSL@ +HAVE_DECL_ASINL = @HAVE_DECL_ASINL@ +HAVE_DECL_ATANL = @HAVE_DECL_ATANL@ +HAVE_DECL_COSL = @HAVE_DECL_COSL@ +HAVE_DECL_DIRFD = @HAVE_DECL_DIRFD@ +HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@ +HAVE_DECL_EXPL = @HAVE_DECL_EXPL@ +HAVE_DECL_FREEADDRINFO = @HAVE_DECL_FREEADDRINFO@ +HAVE_DECL_FREXPL = @HAVE_DECL_FREXPL@ +HAVE_DECL_GAI_STRERROR = @HAVE_DECL_GAI_STRERROR@ +HAVE_DECL_GETADDRINFO = @HAVE_DECL_GETADDRINFO@ +HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@ +HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@ +HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@ HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ +HAVE_DECL_GETNAMEINFO = @HAVE_DECL_GETNAMEINFO@ HAVE_DECL_IMAXABS = @HAVE_DECL_IMAXABS@ HAVE_DECL_IMAXDIV = @HAVE_DECL_IMAXDIV@ +HAVE_DECL_INET_NTOP = @HAVE_DECL_INET_NTOP@ +HAVE_DECL_INET_PTON = @HAVE_DECL_INET_PTON@ +HAVE_DECL_LDEXPL = @HAVE_DECL_LDEXPL@ +HAVE_DECL_LOGL = @HAVE_DECL_LOGL@ HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@ HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@ +HAVE_DECL_OBSTACK_PRINTF = @HAVE_DECL_OBSTACK_PRINTF@ +HAVE_DECL_SINL = @HAVE_DECL_SINL@ HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@ +HAVE_DECL_SQRTL = @HAVE_DECL_SQRTL@ HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@ -HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@ +HAVE_DECL_STRERROR = @HAVE_DECL_STRERROR@ HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@ HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@ +HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@ HAVE_DECL_STRTOIMAX = @HAVE_DECL_STRTOIMAX@ HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@ HAVE_DECL_STRTOUMAX = @HAVE_DECL_STRTOUMAX@ +HAVE_DECL_TANL = @HAVE_DECL_TANL@ +HAVE_DECL_TRUNC = @HAVE_DECL_TRUNC@ +HAVE_DECL_TRUNCF = @HAVE_DECL_TRUNCF@ HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@ +HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@ +HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@ +HAVE_DPRINTF = @HAVE_DPRINTF@ HAVE_DUP2 = @HAVE_DUP2@ +HAVE_EUIDACCESS = @HAVE_EUIDACCESS@ +HAVE_FSEEKO = @HAVE_FSEEKO@ +HAVE_FSYNC = @HAVE_FSYNC@ +HAVE_FTELLO = @HAVE_FTELLO@ HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ +HAVE_GETDOMAINNAME = @HAVE_GETDOMAINNAME@ +HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@ +HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@ +HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@ HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ +HAVE_GETUSERSHELL = @HAVE_GETUSERSHELL@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ +HAVE_ISNAND = @HAVE_ISNAND@ +HAVE_ISNANF = @HAVE_ISNANF@ +HAVE_ISNANL = @HAVE_ISNANL@ +HAVE_ISWCNTRL = @HAVE_ISWCNTRL@ +HAVE_LCHMOD = @HAVE_LCHMOD@ +HAVE_LINK = @HAVE_LINK@ HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ +HAVE_LSTAT = @HAVE_LSTAT@ +HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@ +HAVE_MBRLEN = @HAVE_MBRLEN@ +HAVE_MBRTOWC = @HAVE_MBRTOWC@ +HAVE_MBSINIT = @HAVE_MBSINIT@ +HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@ +HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@ HAVE_MEMPCPY = @HAVE_MEMPCPY@ HAVE_MKDTEMP = @HAVE_MKDTEMP@ +HAVE_NETDB_H = @HAVE_NETDB_H@ HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@ +HAVE_OS_H = @HAVE_OS_H@ +HAVE_POSIX_SIGNALBLOCKING = @HAVE_POSIX_SIGNALBLOCKING@ +HAVE_RANDOM_H = @HAVE_RANDOM_H@ +HAVE_RANDOM_R = @HAVE_RANDOM_R@ +HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@ HAVE_READLINK = @HAVE_READLINK@ +HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@ +HAVE_RPMATCH = @HAVE_RPMATCH@ +HAVE_SCANDIR = @HAVE_SCANDIR@ +HAVE_SETENV = @HAVE_SETENV@ +HAVE_SIGACTION = @HAVE_SIGACTION@ +HAVE_SIGINFO_T = @HAVE_SIGINFO_T@ HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@ HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@ HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@ +HAVE_SIGSET_T = @HAVE_SIGSET_T@ +HAVE_SLEEP = @HAVE_SLEEP@ HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE_STPCPY = @HAVE_STPCPY@ HAVE_STPNCPY = @HAVE_STPNCPY@ -HAVE_STRCASECMP = @HAVE_STRCASECMP@ HAVE_STRCASESTR = @HAVE_STRCASESTR@ HAVE_STRCHRNUL = @HAVE_STRCHRNUL@ HAVE_STRNDUP = @HAVE_STRNDUP@ HAVE_STRPBRK = @HAVE_STRPBRK@ HAVE_STRSEP = @HAVE_STRSEP@ +HAVE_STRTOD = @HAVE_STRTOD@ +HAVE_STRTOLL = @HAVE_STRTOLL@ +HAVE_STRTOULL = @HAVE_STRTOULL@ +HAVE_STRUCT_ADDRINFO = @HAVE_STRUCT_ADDRINFO@ +HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@ +HAVE_STRUCT_SIGACTION_SA_SIGACTION = @HAVE_STRUCT_SIGACTION_SA_SIGACTION@ HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@ +HAVE_STRVERSCMP = @HAVE_STRVERSCMP@ HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@ +HAVE_SYS_IOCTL_H = @HAVE_SYS_IOCTL_H@ +HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@ +HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@ +HAVE_SYS_SELECT_H = @HAVE_SYS_SELECT_H@ HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@ HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ +HAVE_TYPE_VOLATILE_SIG_ATOMIC_T = @HAVE_TYPE_VOLATILE_SIG_ATOMIC_T@ HAVE_UNISTD_H = @HAVE_UNISTD_H@ +HAVE_UNSETENV = @HAVE_UNSETENV@ HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ +HAVE_VASPRINTF = @HAVE_VASPRINTF@ +HAVE_VDPRINTF = @HAVE_VDPRINTF@ +HAVE_WCHAR_H = @HAVE_WCHAR_H@ +HAVE_WCRTOMB = @HAVE_WCRTOMB@ +HAVE_WCSNRTOMBS = @HAVE_WCSNRTOMBS@ +HAVE_WCSRTOMBS = @HAVE_WCSRTOMBS@ HAVE_WCTYPE_H = @HAVE_WCTYPE_H@ HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@ HAVE_WINT_T = @HAVE_WINT_T@ HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@ HAVE__BOOL = @HAVE__BOOL@ HELP2MAN = @HELP2MAN@ +HOSTENT_LIB = @HOSTENT_LIB@ +ICONV_H = @ICONV_H@ +INCLUDE_NEXT = @INCLUDE_NEXT@ +INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTALL_SU = @INSTALL_SU@ +INT32_MAX_LT_INTMAX_MAX = @INT32_MAX_LT_INTMAX_MAX@ +INT64_MAX_EQ_LONG_MAX = @INT64_MAX_EQ_LONG_MAX@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ INTTYPES_H = @INTTYPES_H@ @@ -406,15 +721,26 @@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ $(POW_LIB) +LIBSOCKET = @LIBSOCKET@ +LIBTESTS_LIBDEPS = @LIBTESTS_LIBDEPS@ LIB_ACL = @LIB_ACL@ -LIB_ACL_TRIVIAL = @LIB_ACL_TRIVIAL@ +LIB_CAP = @LIB_CAP@ LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@ LIB_CRYPT = @LIB_CRYPT@ LIB_EACCESS = @LIB_EACCESS@ LIB_FDATASYNC = @LIB_FDATASYNC@ LIB_GETHRXTIME = @LIB_GETHRXTIME@ +LIB_GMP = @LIB_GMP@ LIB_NANOSLEEP = @LIB_NANOSLEEP@ +LIB_SELINUX = @LIB_SELINUX@ +LIB_XATTR = @LIB_XATTR@ LN_S = @LN_S@ +LOCALCHARSET_TESTS_ENVIRONMENT = @LOCALCHARSET_TESTS_ENVIRONMENT@ +LOCALE_FR = @LOCALE_FR@ +LOCALE_FR_UTF8 = @LOCALE_FR_UTF8@ +LOCALE_JA = @LOCALE_JA@ +LOCALE_TR_UTF8 = @LOCALE_TR_UTF8@ +LOCALE_ZH_CN = @LOCALE_ZH_CN@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ @@ -425,7 +751,34 @@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ NEED_SETGID = @NEED_SETGID@ +NETDB_H = @NETDB_H@ NETINET_IN_H = @NETINET_IN_H@ +NEXT_ARPA_INET_H = @NEXT_ARPA_INET_H@ +NEXT_DIRENT_H = @NEXT_DIRENT_H@ +NEXT_ERRNO_H = @NEXT_ERRNO_H@ +NEXT_FCNTL_H = @NEXT_FCNTL_H@ +NEXT_FLOAT_H = @NEXT_FLOAT_H@ +NEXT_ICONV_H = @NEXT_ICONV_H@ +NEXT_INTTYPES_H = @NEXT_INTTYPES_H@ +NEXT_MATH_H = @NEXT_MATH_H@ +NEXT_NETDB_H = @NEXT_NETDB_H@ +NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@ +NEXT_SIGNAL_H = @NEXT_SIGNAL_H@ +NEXT_STDARG_H = @NEXT_STDARG_H@ +NEXT_STDINT_H = @NEXT_STDINT_H@ +NEXT_STDIO_H = @NEXT_STDIO_H@ +NEXT_STDLIB_H = @NEXT_STDLIB_H@ +NEXT_STRING_H = @NEXT_STRING_H@ +NEXT_SYS_IOCTL_H = @NEXT_SYS_IOCTL_H@ +NEXT_SYS_SELECT_H = @NEXT_SYS_SELECT_H@ +NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_H@ +NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@ +NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@ +NEXT_TIME_H = @NEXT_TIME_H@ +NEXT_UNISTD_H = @NEXT_UNISTD_H@ +NEXT_WCHAR_H = @NEXT_WCHAR_H@ +NEXT_WCTYPE_H = @NEXT_WCTYPE_H@ +NO_INSTALL_PROGS_DEFAULT = @NO_INSTALL_PROGS_DEFAULT@ OBJEXT = @OBJEXT@ OPTIONAL_BIN_PROGS = @OPTIONAL_BIN_PROGS@ PACKAGE = @PACKAGE@ @@ -433,56 +786,142 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ +POSIX_SHELL = @POSIX_SHELL@ POSUB = @POSUB@ POW_LIB = @POW_LIB@ +PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@ +PREFERABLY_POSIX_SHELL = @PREFERABLY_POSIX_SHELL@ PRIPTR_PREFIX = @PRIPTR_PREFIX@ PRI_MACROS_BROKEN = @PRI_MACROS_BROKEN@ PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ RANLIB = @RANLIB@ +REPLACE_BTOWC = @REPLACE_BTOWC@ +REPLACE_CEILF = @REPLACE_CEILF@ +REPLACE_CEILL = @REPLACE_CEILL@ REPLACE_CHOWN = @REPLACE_CHOWN@ +REPLACE_CLOSE = @REPLACE_CLOSE@ +REPLACE_DPRINTF = @REPLACE_DPRINTF@ REPLACE_FCHDIR = @REPLACE_FCHDIR@ +REPLACE_FCLOSE = @REPLACE_FCLOSE@ +REPLACE_FFLUSH = @REPLACE_FFLUSH@ +REPLACE_FLOORF = @REPLACE_FLOORF@ +REPLACE_FLOORL = @REPLACE_FLOORL@ +REPLACE_FOPEN = @REPLACE_FOPEN@ REPLACE_FPRINTF = @REPLACE_FPRINTF@ +REPLACE_FREOPEN = @REPLACE_FREOPEN@ +REPLACE_FREXP = @REPLACE_FREXP@ +REPLACE_FREXPL = @REPLACE_FREXPL@ +REPLACE_FSEEK = @REPLACE_FSEEK@ +REPLACE_FSEEKO = @REPLACE_FSEEKO@ +REPLACE_FTELL = @REPLACE_FTELL@ +REPLACE_FTELLO = @REPLACE_FTELLO@ REPLACE_GETCWD = @REPLACE_GETCWD@ +REPLACE_GETLINE = @REPLACE_GETLINE@ +REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@ REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@ +REPLACE_HUGE_VAL = @REPLACE_HUGE_VAL@ +REPLACE_ICONV = @REPLACE_ICONV@ +REPLACE_ICONV_OPEN = @REPLACE_ICONV_OPEN@ +REPLACE_ICONV_UTF = @REPLACE_ICONV_UTF@ +REPLACE_ISFINITE = @REPLACE_ISFINITE@ +REPLACE_ISINF = @REPLACE_ISINF@ +REPLACE_ISNAN = @REPLACE_ISNAN@ +REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@ +REPLACE_LCHOWN = @REPLACE_LCHOWN@ +REPLACE_LDEXPL = @REPLACE_LDEXPL@ REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@ +REPLACE_LSEEK = @REPLACE_LSEEK@ +REPLACE_LSTAT = @REPLACE_LSTAT@ +REPLACE_MBRLEN = @REPLACE_MBRLEN@ +REPLACE_MBRTOWC = @REPLACE_MBRTOWC@ +REPLACE_MBSINIT = @REPLACE_MBSINIT@ +REPLACE_MBSNRTOWCS = @REPLACE_MBSNRTOWCS@ +REPLACE_MBSRTOWCS = @REPLACE_MBSRTOWCS@ +REPLACE_MBSTATE_T = @REPLACE_MBSTATE_T@ +REPLACE_MEMMEM = @REPLACE_MEMMEM@ +REPLACE_MKDIR = @REPLACE_MKDIR@ REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ +REPLACE_NAN = @REPLACE_NAN@ REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@ +REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@ +REPLACE_OPEN = @REPLACE_OPEN@ +REPLACE_PERROR = @REPLACE_PERROR@ REPLACE_PRINTF = @REPLACE_PRINTF@ +REPLACE_PUTENV = @REPLACE_PUTENV@ +REPLACE_ROUND = @REPLACE_ROUND@ +REPLACE_ROUNDF = @REPLACE_ROUNDF@ +REPLACE_ROUNDL = @REPLACE_ROUNDL@ +REPLACE_SELECT = @REPLACE_SELECT@ +REPLACE_SIGNBIT = @REPLACE_SIGNBIT@ +REPLACE_SIGNBIT_USING_GCC = @REPLACE_SIGNBIT_USING_GCC@ REPLACE_SNPRINTF = @REPLACE_SNPRINTF@ REPLACE_SPRINTF = @REPLACE_SPRINTF@ +REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@ +REPLACE_STRCASESTR = @REPLACE_STRCASESTR@ +REPLACE_STRDUP = @REPLACE_STRDUP@ +REPLACE_STRERROR = @REPLACE_STRERROR@ REPLACE_STRPTIME = @REPLACE_STRPTIME@ +REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@ +REPLACE_STRSTR = @REPLACE_STRSTR@ +REPLACE_STRTOD = @REPLACE_STRTOD@ REPLACE_TIMEGM = @REPLACE_TIMEGM@ +REPLACE_TRUNCL = @REPLACE_TRUNCL@ +REPLACE_VASPRINTF = @REPLACE_VASPRINTF@ +REPLACE_VDPRINTF = @REPLACE_VDPRINTF@ REPLACE_VFPRINTF = @REPLACE_VFPRINTF@ REPLACE_VPRINTF = @REPLACE_VPRINTF@ REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@ REPLACE_VSPRINTF = @REPLACE_VSPRINTF@ +REPLACE_WCRTOMB = @REPLACE_WCRTOMB@ +REPLACE_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@ +REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@ +REPLACE_WCTOB = @REPLACE_WCTOB@ +REPLACE_WCWIDTH = @REPLACE_WCWIDTH@ +REPLACE_WRITE = @REPLACE_WRITE@ +SELINUX_CONTEXT_H = @SELINUX_CONTEXT_H@ +SELINUX_SELINUX_H = @SELINUX_SELINUX_H@ SEQ_LIBM = @SEQ_LIBM@ +SERVENT_LIB = @SERVENT_LIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@ SIZE_T_SUFFIX = @SIZE_T_SUFFIX@ +STDARG_H = @STDARG_H@ STDBOOL_H = @STDBOOL_H@ STDINT_H = @STDINT_H@ STRIP = @STRIP@ +SYS_IOCTL_H = @SYS_IOCTL_H@ +SYS_IOCTL_H_HAVE_WINSOCK2_H = @SYS_IOCTL_H_HAVE_WINSOCK2_H@ +SYS_SELECT_H = @SYS_SELECT_H@ SYS_SOCKET_H = @SYS_SOCKET_H@ SYS_STAT_H = @SYS_STAT_H@ SYS_TIME_H = @SYS_TIME_H@ SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@ TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@ U = @U@ +UINT32_MAX_LT_UINTMAX_MAX = @UINT32_MAX_LT_UINTMAX_MAX@ +UINT64_MAX_EQ_ULONG_MAX = @UINT64_MAX_EQ_ULONG_MAX@ +UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@ +USE_ACL = @USE_ACL@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ +VOID_UNSETENV = @VOID_UNSETENV@ +WARN_CFLAGS = @WARN_CFLAGS@ WCHAR_H = @WCHAR_H@ WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ WCTYPE_H = @WCTYPE_H@ +WERROR_CFLAGS = @WERROR_CFLAGS@ WINT_T_SUFFIX = @WINT_T_SUFFIX@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ +XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ YACC = @YACC@ YFLAGS = @YFLAGS@ +abs_aux_dir = @abs_aux_dir@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ @@ -507,6 +946,8 @@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gl_LIBOBJS = @gl_LIBOBJS@ gl_LTLIBOBJS = @gl_LTLIBOBJS@ +gltests_LIBOBJS = @gltests_LIBOBJS@ +gltests_LTLIBOBJS = @gltests_LTLIBOBJS@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ @@ -532,95 +973,14 @@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -AUTOMAKE_OPTIONS = 1.5 gnits +AUTOMAKE_OPTIONS = 1.5 gnits subdir-objects +SUBDIRS = noinst_HEADERS = noinst_LIBRARIES = libcoreutils.a noinst_LTLIBRARIES = -EXTRA_DIST = acl-internal.h acl.c acl.h acl_entries.c file-has-acl.c \ - alloca.c alloca_.h allocsa.valgrind argmatch.c argmatch.h \ - atexit.c backupfile.c backupfile.h c-strtod.c c-strtod.h \ - c-strtod.c c-strtod.h c-strtold.c calloc.c canon-host.c \ - canon-host.h canonicalize.c canonicalize.h pathmax.h \ - chdir-long.c chdir-long.h chown.c fchown-stub.c cloexec.c \ - cloexec.h close-stream.c close-stream.h closeout.c closeout.h \ - cycle-check.c cycle-check.h dev-ino.h dirfd.c dirfd.h \ - basename.c dirname.c dirname.h stripslash.c dup2.c error.c \ - error.h euidaccess.c euidaccess.h exclude.c exclude.h \ - exitfail.c exitfail.h dirent_.h fchdir.c fcntl_.h \ - creat-safer.c fcntl--.h fcntl-safer.h open-safer.c file-type.c \ - file-type.h fileblocks.c filemode.c filemode.h filenamecat.c \ - filenamecat.h fnmatch.c fnmatch_.h fnmatch_loop.c \ - fopen-safer.c stdio--.h stdio-safer.h __fpending.c \ - __fpending.h fprintftime.c fprintftime.h free.c fsusage.c \ - fsusage.h ftruncate.c fts-cycle.c fts.c fts_.h gai_strerror.c \ - getaddrinfo.c getaddrinfo.h getcwd.c getdate.c getdate.h \ - getdelim.c getdelim.h getgroups.c gethostname.c gethrxtime.c \ - gethrxtime.h xtime.h getline.c getline.h getloadavg.c \ - getndelim2.c getndelim2.h getopt.c getopt1.c getopt_.h \ - getopt_int.h getpagesize.h getpass.c getpass.h gettime.c \ - gettimeofday.c getugroups.c getusershell.c group-member.c \ - group-member.h hard-locale.c hard-locale.h hash.c hash.h \ - human.c human.h i-ring.c i-ring.h idcache.c inet_ntop.c \ - inet_ntop.h intprops.h imaxtostr.c inttostr.c inttostr.h \ - offtostr.c uinttostr.c umaxtostr.c inttypes_.h isapipe.c \ - isapipe.h lchmod.h lchown.c lchown.h config.charset \ - ref-add.sin ref-del.sin long-options.c long-options.h lstat.c \ - lstat.h malloc.c mbchar.h md5.c md5.h memcasecmp.c \ - memcasecmp.h memchr.c memcmp.c memcoll.c memcoll.h memcpy.c \ - memmove.c mempcpy.c memrchr.c memset.c mkancesdirs.c \ - mkancesdirs.h mkdir.c dirchownmod.c dirchownmod.h mkdir-p.c \ - mkdir-p.h mkstemp.c mktime.c modechange.c modechange.h \ - mountlist.c mountlist.h mpsort.c mpsort.h nanosleep.c \ - netinet_in_.h obstack.c obstack.h at-func.c fchmodat.c \ - fchownat.c fstatat.c mkdirat.c openat-die.c openat-priv.h \ - openat-proc.c openat.c openat.h pathmax.h physmem.c physmem.h \ - posixtm.c posixtm.h posixver.c posixver.h putenv.c quote.c \ - quote.h quotearg.c quotearg.h raise.c readlink.c readtokens.c \ - readtokens.h readutmp.c readutmp.h realloc.c regcomp.c regex.c \ - regex.h regex_internal.c regex_internal.h regexec.c rename.c \ - rename-dest-slash.c rmdir.c root-dev-ino.c root-dev-ino.h \ - rpmatch.c safe-read.c safe-read.h safe-write.c safe-write.h \ - same.c same.h same-inode.h save-cwd.c save-cwd.h savedir.c \ - savedir.h setenv.c setenv.h unsetenv.c settime.c sha1.c sha1.h \ - sig2str.c sig2str.h snprintf.c stat-macros.h stat-time.h \ - stdbool_.h stdint_.h stdio_.h stdlib_.h mkstemp-safer.c \ - stdlib--.h stdlib-safer.h stpcpy.c strcspn.c strdup.c \ - strftime.c strftime.h string_.h strndup.c strnlen.c strpbrk.c \ - strtod.c strtoimax.c strtol.c strtoll.c strtoul.c strtoull.c \ - strtoumax.c strverscmp.c strverscmp.h socket_.h stat_.h \ - sys_time_.h tempname.c tempname.h time_.h time_r.c timespec.h \ - unistd_.h dup-safer.c fd-safer.c pipe-safer.c unistd--.h \ - unistd-safer.h unlinkdir.c unlinkdir.h unlocked-io.h \ - inttostr.h userspec.c userspec.h utime.c utimecmp.c utimecmp.h \ - utimens.c utimens.h asnprintf.c printf-args.c printf-args.h \ - printf-parse.c printf-parse.h vasnprintf.c vasnprintf.h \ - asprintf.c vasprintf.c vasprintf.h wchar_.h wctype_.h xalloc.h \ - xmalloc.c xgetcwd.c xgetcwd.h xnanosleep.c xnanosleep.h \ - xreadlink.h xreadlink.h xstrtod.c xstrtod.h xstrtol.c \ - xstrtol.h xstrtoul.c xstrtod.c xstrtod.h xstrtold.c yesno.c \ - yesno.h -BUILT_SOURCES = $(ALLOCA_H) $(ARPA_INET_H) configmake.h $(DIRENT_H) \ - $(FCNTL_H) $(FNMATCH_H) getdate.c $(GETOPT_H) $(INTTYPES_H) \ - $(NETINET_IN_H) $(STDBOOL_H) $(STDINT_H) stdio.h stdlib.h \ - string.h $(SYS_SOCKET_H) $(SYS_STAT_H) $(SYS_TIME_H) time.h \ - unistd.h $(WCHAR_H) $(WCTYPE_H) -SUFFIXES = .sed .sin -MOSTLYCLEANFILES = core *.stackdump alloca.h alloca.h-t arpa/inet.h \ - arpa/inet.h-t dirent.h dirent.h-t fcntl.h fcntl.h-t fnmatch.h \ - fnmatch.h-t getopt.h getopt.h-t inttypes.h inttypes.h-t \ - netinet/in.h netinet/in.h-t stdbool.h stdbool.h-t stdint.h \ - stdint.h-t stdio.h stdio.h-t stdlib.h stdlib.h-t string.h \ - string.h-t sys/socket.h sys/socket.h-t sys/stat.h sys/stat.h-t \ - sys/time.h sys/time.h-t time.h time.h-t unistd.h unistd.h-t \ - wchar.h wchar.h-t wctype.h wctype.h-t -MOSTLYCLEANDIRS = arpa netinet sys sys -CLEANFILES = configmake.h configmake.h-t charset.alias ref-add.sed \ - ref-del.sed -DISTCLEANFILES = -MAINTAINERCLEANFILES = getdate.c -AM_CPPFLAGS = # This is for those projects which use "gettextize --intl" to put a source-code # copy of libintl into their package. In such projects, every Makefile.am needs @@ -631,63 +991,216 @@ AM_CPPFLAGS = # directory contains no libintl.h file) or when the project does not use # "gettextize --intl". #AM_CPPFLAGS += -I$(top_builddir)/intl -libcoreutils_a_SOURCES = allocsa.h allocsa.c base64.h base64.c \ - c-ctype.h c-ctype.c c-strcase.h c-strcasecmp.c c-strncasecmp.c \ - diacrit.h diacrit.c full-read.h full-read.c full-write.h \ + +#script: script.in +# rm -f $@-t $@ +# sed -e 's#@''PREFERABLY_POSIX_SHELL''@#$(PREFERABLY_POSIX_SHELL)#g' \ +# -e 's#@''POSIX_SHELL''@#$(POSIX_SHELL)#g' \ +# -e $(srcdir)/$@.in >$@-t +# chmod a+x $@-t +# mv $@-t $@ +#EXTRA_DIST += script.in +#MOSTLYCLEANFILES += script script-t +EXTRA_DIST = acl-internal.h acl.h acl_entries.c alloca.c alloca.in.h \ + $(top_srcdir)/build-aux/announce-gen areadlink.h argmatch.c \ + argmatch.h arpa_inet.in.h atexit.c backupfile.c backupfile.h \ + btowc.c c-strtod.c c-strtod.h c-strtod.c c-strtod.h \ + c-strtold.c calloc.c calloc.c canon-host.c canon-host.h \ + canonicalize.c canonicalize.h pathmax.h chdir-long.c \ + chdir-long.h chown.c fchown-stub.c cloexec.c cloexec.h close.c \ + close-hook.h close-stream.c close-stream.h closein.c closein.h \ + closeout.c closeout.h md5.c md5.h sha1.c sha1.h sha256.c \ + sha256.h sha512.c sha512.h cycle-check.c cycle-check.h \ + dev-ino.h dirent.in.h dirfd.c basename.c dirname.c dirname.h \ + stripslash.c dup2.c errno.in.h error.c error.h euidaccess.c \ + exclude.c exclude.h exitfail.c exitfail.h fchdir.c fclose.c \ + fcntl.in.h creat-safer.c fcntl--.h fcntl-safer.h open-safer.c \ + fflush.c stdio-impl.h file-set.h file-type.c file-type.h \ + fileblocks.c filemode.c filemode.h filenamecat.c filenamecat.h \ + filevercmp.h float.in.h fnmatch.c fnmatch.in.h fnmatch_loop.c \ + fopen-safer.c stdio--.h stdio-safer.h fpending.c fpending.h \ + fprintftime.c fprintftime.h fpucw.h fpurge.h stdio-impl.h \ + freadahead.h stdio-impl.h freading.h stdio-impl.h freadptr.h \ + stdio-impl.h freadseek.h stdio-impl.h frexp.c frexp.c frexpl.c \ + fseeko.c stdio-impl.h fseterr.h stdio-impl.h fsusage.c \ + fsusage.h ftello.c ftruncate.c fts-cycle.c fts.c fts_.h \ + $(top_srcdir)/build-aux/gendocs.sh gai_strerror.c \ + getaddrinfo.c getcwd.c getdate.c getdate.h getdelim.c \ + getgroups.c gethostname.c gethrxtime.c gethrxtime.h xtime.h \ + getline.c getloadavg.c getndelim2.c getndelim2.h getopt.c \ + getopt.in.h getopt1.c getopt_int.h getpagesize.c getpass.c \ + getpass.h $(top_srcdir)/build-aux/config.rpath gettime.c \ + gettimeofday.c getugroups.c getugroups.h getusershell.c \ + $(top_srcdir)/build-aux/git-version-gen \ + $(top_srcdir)/build-aux/gitlog-to-changelog \ + $(top_srcdir)/GNUmakefile $(top_srcdir)/build-aux/gnupload \ + group-member.c group-member.h hard-locale.c hard-locale.h \ + hash.c hash.h hash-triple.h \ + $(top_srcdir)/build-aux/config.rpath human.c human.h i-ring.c \ + i-ring.h iconv_open-aix.h iconv_open-hpux.h iconv_open-irix.h \ + iconv_open-osf.h iconv.in.h iconv_open-aix.gperf \ + iconv_open-hpux.gperf iconv_open-irix.gperf \ + iconv_open-osf.gperf iconv_open.c idcache.c idcache.h \ + inet_ntop.c intprops.h imaxtostr.c inttostr.c inttostr.h \ + offtostr.c uinttostr.c umaxtostr.c inttypes.in.h isapipe.c \ + isapipe.h float+.h isnan.c isnand-nolibm.h isnand.c float+.h \ + isnan.c isnanf-nolibm.h isnanf.c float+.h isnan.c \ + isnanl-nolibm.h isnanl.c lchown.c \ + $(top_srcdir)/build-aux/link-warning.h config.charset \ + ref-add.sin ref-del.sin long-options.c long-options.h lseek.c \ + lstat.c $(top_srcdir)/maint.mk malloc.c malloc.c malloca.h \ + malloca.valgrind math.in.h mbchar.h mbrlen.c mbrtowc.c \ + mbsinit.c mbsrtowcs-state.c mbsrtowcs.c str-kmp.h memcasecmp.c \ + memcasecmp.h memchr.c memcmp.c memcmp2.h memcoll.c memcoll.h \ + memcpy.c memmove.c mempcpy.c memrchr.c memset.c mgetgroups.c \ + mgetgroups.h mkancesdirs.c mkancesdirs.h mkdir.c dirchownmod.c \ + dirchownmod.h mkdir-p.c mkdir-p.h mkstemp.c mktime.c \ + modechange.c modechange.h mountlist.c mountlist.h mpsort.c \ + mpsort.h nanosleep.c netdb.in.h netinet_in.in.h obstack.c \ + obstack.h open.c at-func.c fchmodat.c fchownat.c fstatat.c \ + mkdirat.c openat-priv.h openat-proc.c openat.c openat.h \ + pathmax.h physmem.c physmem.h posixtm.c posixtm.h posixver.c \ + posixver.h printf-frexp.h printf-frexp.c printf-frexpl.h \ + priv-set.h putenv.c quote.c quote.h quotearg.c quotearg.h \ + raise.c readlink.c readtokens.c readtokens.h readutmp.c \ + readutmp.h realloc.c realloc.c regcomp.c regex.c regex.h \ + regex_internal.c regex_internal.h regexec.c rename.c \ + rename-dest-slash.c rmdir.c root-dev-ino.c root-dev-ino.h \ + rpmatch.c safe-read.c safe-read.h safe-write.c safe-write.h \ + same.c same.h same-inode.h save-cwd.c save-cwd.h savedir.c \ + savedir.h select.c selinux-at.c selinux-at.h setenv.c \ + settime.c sig2str.c sig2str.h sig-handler.h sigaction.c \ + signal.in.h float+.h signbitd.c signbitf.c signbitl.c \ + sigprocmask.c snprintf.c stat-macros.h stat-time.h stdarg.in.h \ + stdbool.in.h stdint.in.h stdio-write.c stdio.in.h stdlib.in.h \ + mkstemp-safer.c stdlib--.h stdlib-safer.h stpcpy.c stpncpy.c \ + strcspn.c strdup.c strdup.c streq.h strerror.c strftime.c \ + strftime.h string.in.h strndup.c strnlen.c strpbrk.c strtod.c \ + strtoimax.c strtol.c strtoll.c strtoul.c strtoull.c \ + strtoumax.c strverscmp.c sys_select.in.h sys_socket.in.h \ + sys_stat.in.h sys_time.in.h tempname.c tempname.h time.in.h \ + time_r.c timespec.h trim.h u64.h unistd.in.h dup-safer.c \ + fd-safer.c pipe-safer.c unistd--.h unistd-safer.h unistr.h \ + unitypes.h localcharset.h uniwidth.h uniwidth/cjk.h \ + unlinkdir.c unlinkdir.h unlocked-io.h unsetenv.c \ + $(top_srcdir)/build-aux/useless-if-before-free inttostr.h \ + userspec.c userspec.h utimecmp.c utimecmp.h utimens.c \ + utimens.h asnprintf.c float+.h printf-args.c printf-args.h \ + printf-parse.c printf-parse.h vasnprintf.c vasnprintf.h \ + asprintf.c vasprintf.c $(top_srcdir)/build-aux/vc-list-files \ + vfprintf.c vprintf.c wchar.in.h wcrtomb.c wctype.in.h \ + wcwidth.c write.c write-any-file.c write-any-file.h xalloc.h \ + xmalloc.c xgetcwd.c xgetcwd.h xnanosleep.c xnanosleep.h \ + xstrtod.c xstrtod.h xstrtol-error.c xstrtol.c xstrtol.h \ + xstrtoul.c xstrtod.c xstrtod.h xstrtold.c xalloc.h yesno.c \ + yesno.h +BUILT_SOURCES = $(ALLOCA_H) $(ARPA_INET_H) configmake.h $(DIRENT_H) \ + $(ERRNO_H) $(FCNTL_H) $(FLOAT_H) $(FNMATCH_H) getdate.c \ + $(GETOPT_H) $(ICONV_H) iconv_open-aix.h iconv_open-hpux.h \ + iconv_open-irix.h iconv_open-osf.h $(INTTYPES_H) math.h \ + $(NETDB_H) $(NETINET_IN_H) $(SELINUX_SELINUX_H) \ + $(SELINUX_CONTEXT_H) signal.h $(STDARG_H) $(STDBOOL_H) \ + $(STDINT_H) stdio.h stdlib.h string.h $(SYS_SELECT_H) \ + $(SYS_SOCKET_H) $(SYS_STAT_H) $(SYS_TIME_H) time.h unistd.h \ + $(WCHAR_H) $(WCTYPE_H) +SUFFIXES = .sed .sin +MOSTLYCLEANFILES = core *.stackdump alloca.h alloca.h-t arpa/inet.h \ + arpa/inet.h-t dirent.h dirent.h-t errno.h errno.h-t fcntl.h \ + fcntl.h-t float.h float.h-t fnmatch.h fnmatch.h-t getopt.h \ + getopt.h-t iconv.h iconv.h-t iconv_open-aix.h-t \ + iconv_open-hpux.h-t iconv_open-irix.h-t iconv_open-osf.h-t \ + inttypes.h inttypes.h-t math.h math.h-t netdb.h netdb.h-t \ + netinet/in.h netinet/in.h-t selinux/selinux.h \ + selinux/selinux.h-t selinux/context.h selinux/context.h-t \ + signal.h signal.h-t stdarg.h stdarg.h-t stdbool.h stdbool.h-t \ + stdint.h stdint.h-t stdio.h stdio.h-t stdlib.h stdlib.h-t \ + string.h string.h-t sys/select.h sys/select.h-t sys/socket.h \ + sys/socket.h-t sys/stat.h sys/stat.h-t sys/time.h sys/time.h-t \ + time.h time.h-t unistd.h unistd.h-t wchar.h wchar.h-t wctype.h \ + wctype.h-t +MOSTLYCLEANDIRS = arpa netinet selinux sys sys sys +CLEANFILES = configmake.h configmake.h-t charset.alias ref-add.sed \ + ref-del.sed +DISTCLEANFILES = +MAINTAINERCLEANFILES = getdate.c iconv_open-aix.h iconv_open-hpux.h \ + iconv_open-irix.h iconv_open-osf.h +AM_CPPFLAGS = +AM_CFLAGS = $(WARN_CFLAGS) # $(WERROR_CFLAGS) +libcoreutils_a_SOURCES = set-mode-acl.c copy-acl.c file-has-acl.c \ + areadlink-with-size.c argv-iter.c argv-iter.h base64.h \ + base64.c c-ctype.h c-ctype.c c-strcase.h c-strcasecmp.c \ + c-strncasecmp.c close-hook.c diacrit.h diacrit.c file-set.c \ + filevercmp.c fpurge.c freadahead.c freading.c freadptr.c \ + freadseek.c fseterr.c full-read.h full-read.c full-write.h \ full-write.c getdate.y gettext.h hash-pjw.h hash-pjw.c \ - linebuffer.h linebuffer.c localcharset.h localcharset.c \ - mbchar.c mbscasecmp.c mbswidth.h mbswidth.c mbuiter.h \ - readtokens0.h readtokens0.c savewd.h savewd.c strnlen1.h \ - strnlen1.c unicodeio.h unicodeio.c verify.h version-etc.h \ - version-etc.c version-etc-fsf.c wcwidth.h xalloc-die.c \ - xgethostname.h xgethostname.c xmemcoll.h xmemcoll.c \ - xreadlink.c xreadlink-with-size.c xstrndup.h xstrndup.c \ - xstrtoimax.c xstrtoumax.c buffer-lcm.c buffer-lcm.h xmemxfrm.c \ - xmemxfrm.h + hash-triple.c ignore-value.h linebuffer.h linebuffer.c \ + localcharset.h localcharset.c malloca.c mbchar.c mbiter.h \ + mbsalign.c mbsalign.h mbscasecmp.c mbslen.c mbsstr.c \ + mbswidth.h mbswidth.c mbuiter.h memchr2.h memchr2.c memcmp2.c \ + openat-die.c printf-frexp.c printf-frexpl.c priv-set.c \ + progname.h progname.c propername.h propername.c randint.c \ + randint.h randperm.c randperm.h randread.c randread.h \ + rand-isaac.c rand-isaac.h readtokens0.h readtokens0.c savewd.h \ + savewd.c se-context.in.h se-selinux.in.h size_max.h striconv.h \ + striconv.c strnlen1.h strnlen1.c trim.c unicodeio.h \ + unicodeio.c unistr/u8-uctomb.c unistr/u8-uctomb-aux.c \ + uniwidth/width.c verify.h verror.h verror.c version-etc.h \ + version-etc.c version-etc-fsf.c xalloc-die.c xfreopen.c \ + xfreopen.h xgethostname.h xgethostname.c xmemcoll.h xmemcoll.c \ + xprintf.h xprintf.c xsize.h xstriconv.h xstriconv.c xstrndup.h \ + xstrndup.c xstrtoimax.c xstrtoumax.c xvasprintf.h xvasprintf.c \ + xasprintf.c buffer-lcm.c buffer-lcm.h xmemxfrm.c xmemxfrm.h libcoreutils_a_LIBADD = $(gl_LIBOBJS) @ALLOCA@ $(LIBOBJS) libcoreutils_a_DEPENDENCIES = $(gl_LIBOBJS) @ALLOCA@ $(LIBOBJS) -EXTRA_libcoreutils_a_SOURCES = acl.c acl_entries.c file-has-acl.c \ - alloca.c argmatch.c atexit.c backupfile.c c-strtod.c \ - c-strtod.c c-strtold.c calloc.c canon-host.c canonicalize.c \ - chdir-long.c chown.c fchown-stub.c cloexec.c close-stream.c \ - closeout.c cycle-check.c dirfd.c basename.c dirname.c \ +EXTRA_libcoreutils_a_SOURCES = acl_entries.c alloca.c argmatch.c \ + atexit.c backupfile.c btowc.c c-strtod.c c-strtod.c \ + c-strtold.c calloc.c calloc.c canon-host.c canonicalize.c \ + chdir-long.c chown.c fchown-stub.c cloexec.c close.c \ + close-stream.c closein.c closeout.c md5.c sha1.c sha256.c \ + sha512.c cycle-check.c dirfd.c basename.c dirname.c \ stripslash.c dup2.c error.c euidaccess.c exclude.c exitfail.c \ - fchdir.c creat-safer.c open-safer.c file-type.c fileblocks.c \ - filemode.c filenamecat.c fnmatch.c fnmatch_loop.c \ - fopen-safer.c __fpending.c fprintftime.c free.c fsusage.c \ - ftruncate.c fts-cycle.c fts.c gai_strerror.c getaddrinfo.c \ - getcwd.c getdelim.c getgroups.c gethostname.c gethrxtime.c \ - getline.c getloadavg.c getndelim2.c getopt.c getopt1.c \ + fchdir.c fclose.c creat-safer.c open-safer.c fflush.c \ + file-type.c fileblocks.c filemode.c filenamecat.c fnmatch.c \ + fnmatch_loop.c fopen-safer.c fpending.c fprintftime.c frexp.c \ + frexp.c frexpl.c fseeko.c fsusage.c ftello.c ftruncate.c \ + fts-cycle.c fts.c gai_strerror.c getaddrinfo.c getcwd.c \ + getdelim.c getgroups.c gethostname.c gethrxtime.c getline.c \ + getloadavg.c getndelim2.c getopt.c getopt1.c getpagesize.c \ getpass.c gettime.c gettimeofday.c getugroups.c getusershell.c \ - group-member.c hard-locale.c hash.c human.c i-ring.c idcache.c \ - inet_ntop.c imaxtostr.c inttostr.c offtostr.c uinttostr.c \ - umaxtostr.c isapipe.c lchown.c long-options.c lstat.c malloc.c \ - md5.c memcasecmp.c memchr.c memcmp.c memcoll.c memcpy.c \ - memmove.c mempcpy.c memrchr.c memset.c mkancesdirs.c mkdir.c \ - dirchownmod.c mkdir-p.c mkstemp.c mktime.c modechange.c \ - mountlist.c mpsort.c nanosleep.c obstack.c at-func.c \ - fchmodat.c fchownat.c fstatat.c mkdirat.c openat-die.c \ - openat-proc.c openat.c physmem.c posixtm.c posixver.c putenv.c \ - quote.c quotearg.c raise.c readlink.c readtokens.c readutmp.c \ - realloc.c regcomp.c regex.c regex_internal.c regexec.c \ - rename.c rename-dest-slash.c rmdir.c root-dev-ino.c rpmatch.c \ - safe-read.c safe-write.c same.c save-cwd.c savedir.c setenv.c \ - unsetenv.c settime.c sha1.c sig2str.c snprintf.c \ - mkstemp-safer.c stpcpy.c strcspn.c strdup.c strftime.c \ - strndup.c strnlen.c strpbrk.c strtod.c strtoimax.c strtol.c \ - strtoll.c strtoul.c strtoull.c strtoumax.c strverscmp.c \ - tempname.c time_r.c dup-safer.c fd-safer.c pipe-safer.c \ - unlinkdir.c userspec.c utime.c utimecmp.c utimens.c \ - asnprintf.c printf-args.c printf-parse.c vasnprintf.c \ - asprintf.c vasprintf.c xmalloc.c xgetcwd.c xnanosleep.c \ - xstrtod.c xstrtol.c xstrtoul.c xstrtod.c xstrtold.c yesno.c + group-member.c hard-locale.c hash.c human.c i-ring.c \ + iconv_open.c idcache.c inet_ntop.c imaxtostr.c inttostr.c \ + offtostr.c uinttostr.c umaxtostr.c isapipe.c isnan.c isnand.c \ + isnan.c isnanf.c isnan.c isnanl.c lchown.c long-options.c \ + lseek.c lstat.c malloc.c malloc.c mbrlen.c mbrtowc.c mbsinit.c \ + mbsrtowcs-state.c mbsrtowcs.c memcasecmp.c memchr.c memcmp.c \ + memcoll.c memcpy.c memmove.c mempcpy.c memrchr.c memset.c \ + mgetgroups.c mkancesdirs.c mkdir.c dirchownmod.c mkdir-p.c \ + mkstemp.c mktime.c modechange.c mountlist.c mpsort.c \ + nanosleep.c obstack.c open.c at-func.c fchmodat.c fchownat.c \ + fstatat.c mkdirat.c openat-proc.c openat.c physmem.c posixtm.c \ + posixver.c printf-frexp.c putenv.c quote.c quotearg.c raise.c \ + readlink.c readtokens.c readutmp.c realloc.c realloc.c \ + regcomp.c regex.c regex_internal.c regexec.c rename.c \ + rename-dest-slash.c rmdir.c root-dev-ino.c rpmatch.c \ + safe-read.c safe-write.c same.c save-cwd.c savedir.c select.c \ + selinux-at.c setenv.c settime.c sig2str.c sigaction.c \ + signbitd.c signbitf.c signbitl.c sigprocmask.c snprintf.c \ + stdio-write.c mkstemp-safer.c stpcpy.c stpncpy.c strcspn.c \ + strdup.c strdup.c strerror.c strftime.c strndup.c strnlen.c \ + strpbrk.c strtod.c strtoimax.c strtol.c strtoll.c strtoul.c \ + strtoull.c strtoumax.c strverscmp.c tempname.c time_r.c \ + dup-safer.c fd-safer.c pipe-safer.c unlinkdir.c unsetenv.c \ + userspec.c utimecmp.c utimens.c asnprintf.c printf-args.c \ + printf-parse.c vasnprintf.c asprintf.c vasprintf.c vfprintf.c \ + vprintf.c wcrtomb.c wcwidth.c write.c write-any-file.c \ + xmalloc.c xgetcwd.c xnanosleep.c xstrtod.c xstrtol-error.c \ + xstrtol.c xstrtoul.c xstrtod.c xstrtold.c yesno.c +GPERF = gperf LINK_WARNING_H = $(top_srcdir)/build-aux/link-warning.h charset_alias = $(DESTDIR)$(libdir)/charset.alias charset_tmp = $(DESTDIR)$(libdir)/charset.tmp -AM_CFLAGS = $(WARNING_CFLAGS) $(WERROR_CFLAGS) -LDADD = $(noinst_LIBRARIES) all: $(BUILT_SOURCES) config.h - $(MAKE) $(AM_MAKEFLAGS) all-am + $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: .SUFFIXES: .sed .sin .c .o .obj .y @@ -695,14 +1208,14 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(srcdir)/gnulib.mk $(am__configur @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnits lib/Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnits lib/Makefile + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnits lib/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnits lib/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ @@ -720,6 +1233,7 @@ $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): config.h: stamp-h1 @if test ! -f $@; then \ @@ -731,7 +1245,7 @@ stamp-h1: $(srcdir)/config.hin $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status lib/config.h $(srcdir)/config.hin: $(am__configure_deps) - cd $(top_srcdir) && $(AUTOHEADER) + $(am__cd) $(top_srcdir) && $(AUTOHEADER) rm -f stamp-h1 touch $@ @@ -740,10 +1254,28 @@ distclean-hdr: clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) +unistr/$(am__dirstamp): + @$(MKDIR_P) unistr + @: > unistr/$(am__dirstamp) +unistr/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) unistr/$(DEPDIR) + @: > unistr/$(DEPDIR)/$(am__dirstamp) +unistr/u8-uctomb.$(OBJEXT): unistr/$(am__dirstamp) \ + unistr/$(DEPDIR)/$(am__dirstamp) +unistr/u8-uctomb-aux.$(OBJEXT): unistr/$(am__dirstamp) \ + unistr/$(DEPDIR)/$(am__dirstamp) +uniwidth/$(am__dirstamp): + @$(MKDIR_P) uniwidth + @: > uniwidth/$(am__dirstamp) +uniwidth/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) uniwidth/$(DEPDIR) + @: > uniwidth/$(DEPDIR)/$(am__dirstamp) +uniwidth/width.$(OBJEXT): uniwidth/$(am__dirstamp) \ + uniwidth/$(DEPDIR)/$(am__dirstamp) libcoreutils.a: $(libcoreutils_a_OBJECTS) $(libcoreutils_a_DEPENDENCIES) - -rm -f libcoreutils.a - $(libcoreutils_a_AR) libcoreutils.a $(libcoreutils_a_OBJECTS) $(libcoreutils_a_LIBADD) - $(RANLIB) libcoreutils.a + $(AM_V_at)-rm -f libcoreutils.a + $(AM_V_AR)$(libcoreutils_a_AR) libcoreutils.a $(libcoreutils_a_OBJECTS) $(libcoreutils_a_LIBADD) + $(AM_V_at)$(RANLIB) libcoreutils.a clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @@ -754,14 +1286,11 @@ clean-noinstLTLIBRARIES: rm -f "$${dir}/so_locations"; \ done -clean-noinstPROGRAMS: - -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS) -t-fpending$(EXEEXT): $(t_fpending_OBJECTS) $(t_fpending_DEPENDENCIES) - @rm -f t-fpending$(EXEEXT) - $(LINK) $(t_fpending_OBJECTS) $(t_fpending_LDADD) $(LIBS) - mostlyclean-compile: -rm -f *.$(OBJEXT) + -rm -f unistr/u8-uctomb-aux.$(OBJEXT) + -rm -f unistr/u8-uctomb.$(OBJEXT) + -rm -f uniwidth/width.$(OBJEXT) distclean-compile: -rm -f *.tab.c @@ -770,21 +1299,14 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/euidaccess-stat.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/fd-reopen.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/memxfrm.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/rand-isaac.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/randint.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/randperm.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/randread.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/sha256.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/sha512.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/strintcmp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/strnumcmp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/xfts.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/__fpending.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/acl.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/acl_entries.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alloca.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/allocsa.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/areadlink-with-size.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/argmatch.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/argv-iter.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asnprintf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asprintf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/at-func.Po@am__quote@ @@ -792,6 +1314,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/backupfile.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/base64.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/basename.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/btowc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/buffer-lcm.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/c-ctype.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/c-strcasecmp.Po@am__quote@ @@ -804,8 +1327,12 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chdir-long.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chown.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cloexec.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/close-hook.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/close-stream.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/close.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/closein.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/closeout.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/copy-acl.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/creat-safer.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cycle-check.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/diacrit.Po@am__quote@ @@ -822,19 +1349,33 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fchmodat.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fchown-stub.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fchownat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fclose.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fd-safer.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fflush.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/file-has-acl.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/file-set.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/file-type.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fileblocks.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filemode.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filenamecat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filevercmp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fnmatch.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fnmatch_loop.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fopen-safer.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fpending.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fprintftime.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/free.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fpurge.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/freadahead.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/freading.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/freadptr.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/freadseek.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/frexp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/frexpl.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fseeko.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fseterr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstatat.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fsusage.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ftello.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ftruncate.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fts-cycle.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fts.Po@am__quote@ @@ -853,6 +1394,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getndelim2.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt1.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getpagesize.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getpass.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gettime.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gettimeofday.Po@am__quote@ @@ -861,33 +1403,52 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/group-member.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hard-locale.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hash-pjw.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hash-triple.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hash.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/human.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/i-ring.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iconv_open.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/idcache.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/imaxtostr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inet_ntop.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inttostr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isapipe.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isnan.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isnand.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isnanf.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isnanl.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lchown.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/linebuffer.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/localcharset.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/long-options.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lseek.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lstat.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/malloc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/malloca.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbchar.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbrlen.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbrtowc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbsalign.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbscasecmp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbsinit.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbslen.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbsrtowcs-state.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbsrtowcs.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbsstr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbswidth.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/md5.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memcasecmp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memchr.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memchr2.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memcmp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memcmp2.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memcoll.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memcpy.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memmove.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mempcpy.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memrchr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memset.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mgetgroups.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mkancesdirs.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mkdir-p.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mkdir.Po@am__quote@ @@ -902,6 +1463,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/obstack.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/offtostr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/open-safer.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/open.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/openat-die.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/openat-proc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/openat.Po@am__quote@ @@ -910,11 +1472,20 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/posixtm.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/posixver.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/printf-args.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/printf-frexp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/printf-frexpl.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/printf-parse.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/priv-set.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/progname.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/propername.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/putenv.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quote.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quotearg.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/raise.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rand-isaac.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/randint.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/randperm.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/randread.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readlink.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readtokens.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readtokens0.Po@am__quote@ @@ -935,15 +1506,29 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/save-cwd.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/savedir.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/savewd.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/select.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/selinux-at.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/set-mode-acl.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setenv.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/settime.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sha1.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sha256.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sha512.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sig2str.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sigaction.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/signbitd.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/signbitf.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/signbitl.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sigprocmask.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/snprintf.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stdio-write.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stpcpy.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stpncpy.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strcspn.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strdup.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strerror.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strftime.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/striconv.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stripslash.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strndup.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strnlen.Po@am__quote@ @@ -957,101 +1542,205 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strtoull.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strtoumax.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strverscmp.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t-fpending.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tempname.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/time_r.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/trim.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uinttostr.Po@am__quote@ @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)/unlinkdir.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unsetenv.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/userspec.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utime.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utimecmp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utimens.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vasnprintf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vasprintf.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/verror.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/version-etc-fsf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/version-etc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vfprintf.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vprintf.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wcrtomb.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wcwidth.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/write-any-file.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/write.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xalloc-die.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xasprintf.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xfreopen.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@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmalloc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmemcoll.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmemxfrm.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xnanosleep.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xreadlink-with-size.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xreadlink.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xprintf.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xstriconv.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xstrndup.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xstrtod.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xstrtoimax.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xstrtol-error.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xstrtol.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xstrtold.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xstrtoul.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xstrtoumax.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xvasprintf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/yesno.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@unistr/$(DEPDIR)/u8-uctomb-aux.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@unistr/$(DEPDIR)/u8-uctomb.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@uniwidth/$(DEPDIR)/width.Po@am__quote@ .c.o: -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c $< +@am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ $< .c.obj: -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .y.c: - $(am__skipyacc) $(SHELL) $(YLWRAP) $< y.tab.c $@ y.tab.h $*.h y.output $*.output -- $(YACCCOMPILE) + $(AM_V_YACC)$(am__skipyacc) $(SHELL) $(YLWRAP) $< y.tab.c $@ y.tab.h $*.h y.output $*.output -- $(YACCCOMPILE) + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +$(RECURSIVE_CLEAN_TARGETS): + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS -TAGS: $(HEADERS) $(SOURCES) config.hin $(TAGS_DEPENDENCIES) \ +TAGS: tags-recursive $(HEADERS) $(SOURCES) config.hin $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) - tags=; \ + set x; \ here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ list='$(SOURCES) $(HEADERS) config.hin $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ fi ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) config.hin $(TAGS_DEPENDENCIES) \ +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.hin $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ list='$(SOURCES) $(HEADERS) config.hin $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique + $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags @@ -1072,32 +1761,65 @@ distdir: $(DISTFILES) if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done check-am: all-am check: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) check-am -all-am: Makefile $(LIBRARIES) $(LTLIBRARIES) $(PROGRAMS) $(HEADERS) \ - config.h all-local -installdirs: + $(MAKE) $(AM_MAKEFLAGS) check-recursive +all-am: Makefile $(LIBRARIES) $(LTLIBRARIES) $(HEADERS) config.h \ + all-local +installdirs: installdirs-recursive +installdirs-am: install: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am + $(MAKE) $(AM_MAKEFLAGS) install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am -installcheck: installcheck-am +installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ @@ -1111,6 +1833,11 @@ clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + -rm -f unistr/$(DEPDIR)/$(am__dirstamp) + -rm -f unistr/$(am__dirstamp) + -rm -f uniwidth/$(DEPDIR)/$(am__dirstamp) + -rm -f uniwidth/$(am__dirstamp) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @@ -1119,97 +1846,122 @@ maintainer-clean-generic: -rm -f getdate.c -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) -clean: clean-am +clean: clean-recursive clean-am: clean-generic clean-noinstLIBRARIES clean-noinstLTLIBRARIES \ - clean-noinstPROGRAMS mostlyclean-am + mostlyclean-am -distclean: distclean-am - -rm -rf $(DEPDIR) ./$(DEPDIR) +distclean: distclean-recursive + -rm -rf $(DEPDIR) ./$(DEPDIR) unistr/$(DEPDIR) uniwidth/$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ - distclean-hdr distclean-tags + distclean-hdr distclean-local distclean-tags -dvi: dvi-am +dvi: dvi-recursive dvi-am: -html: html-am +html: html-recursive -info: info-am +html-am: + +info: info-recursive info-am: install-data-am: -install-dvi: install-dvi-am +install-dvi: install-dvi-recursive + +install-dvi-am: install-exec-am: install-exec-local -install-html: install-html-am +install-html: install-html-recursive -install-info: install-info-am +install-html-am: + +install-info: install-info-recursive + +install-info-am: install-man: -install-pdf: install-pdf-am +install-pdf: install-pdf-recursive -install-ps: install-ps-am +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: installcheck-am: -maintainer-clean: maintainer-clean-am - -rm -rf $(DEPDIR) ./$(DEPDIR) +maintainer-clean: maintainer-clean-recursive + -rm -rf $(DEPDIR) ./$(DEPDIR) unistr/$(DEPDIR) uniwidth/$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic -mostlyclean: mostlyclean-am +mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-local -pdf: pdf-am +pdf: pdf-recursive pdf-am: -ps: ps-am +ps: ps-recursive ps-am: uninstall-am: uninstall-local -.MAKE: install-am install-strip +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all check \ + ctags-recursive install install-am install-strip \ + tags-recursive -.PHONY: CTAGS GTAGS all all-am all-local check check-am clean \ - clean-generic clean-noinstLIBRARIES clean-noinstLTLIBRARIES \ - clean-noinstPROGRAMS ctags distclean distclean-compile \ - distclean-generic distclean-hdr distclean-tags distdir dvi \ +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am all-local check check-am clean clean-generic \ + clean-noinstLIBRARIES clean-noinstLTLIBRARIES ctags \ + ctags-recursive distclean distclean-compile distclean-generic \ + distclean-hdr distclean-local distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-exec-local install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-compile mostlyclean-generic mostlyclean-local pdf \ - pdf-am ps ps-am tags uninstall uninstall-am uninstall-local + installdirs-am maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic \ + mostlyclean-local pdf pdf-am ps ps-am tags tags-recursive \ + uninstall uninstall-am uninstall-local # We need the following in order to create when the system # doesn't have one that works with the given compiler. -alloca.h: alloca_.h +alloca.h: alloca.in.h { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ - cat $(srcdir)/alloca_.h; \ + cat $(srcdir)/alloca.in.h; \ } > $@-t mv -f $@-t $@ # We need the following in order to create when the system # doesn't have one. -arpa/inet.h: +arpa/inet.h: arpa_inet.in.h @MKDIR_P@ arpa rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ - echo '#include '; \ + sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''NEXT_ARPA_INET_H''@|$(NEXT_ARPA_INET_H)|g' \ + -e 's|@''HAVE_ARPA_INET_H''@|$(HAVE_ARPA_INET_H)|g' \ + -e 's|@''GNULIB_INET_NTOP''@|$(GNULIB_INET_NTOP)|g' \ + -e 's|@''GNULIB_INET_PTON''@|$(GNULIB_INET_PTON)|g' \ + -e 's|@''HAVE_DECL_INET_NTOP''@|$(HAVE_DECL_INET_NTOP)|g' \ + -e 's|@''HAVE_DECL_INET_PTON''@|$(HAVE_DECL_INET_PTON)|g' \ + -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ + < $(srcdir)/arpa_inet.in.h; \ } > $@-t mv $@-t $@ @@ -1231,7 +1983,7 @@ arpa/inet.h: # The Automake-defined pkg* macros are appended, in the order # listed in the Automake 1.10a+ documentation. configmake.h: Makefile - rm -f $@-t $@ + rm -f $@-t { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ echo '#define PREFIX "$(prefix)"'; \ echo '#define EXEC_PREFIX "$(exec_prefix)"'; \ @@ -1261,53 +2013,144 @@ configmake.h: Makefile echo '#define PKGLIBDIR "$(pkglibdir)"'; \ echo '#define PKGLIBEXECDIR "$(pkglibexecdir)"'; \ } | sed '/""/d' > $@-t - mv $@-t $@ + if test -f $@ && cmp $@-t $@ > /dev/null; then \ + rm -f $@-t; \ + else \ + rm -f $@; mv $@-t $@; \ + fi # We need the following in order to create when the system # doesn't have one that works with the given compiler. -dirent.h: dirent_.h +dirent.h: dirent.in.h rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ - sed -e 's|@''ABSOLUTE_DIRENT_H''@|$(ABSOLUTE_DIRENT_H)|g' \ + sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''NEXT_DIRENT_H''@|$(NEXT_DIRENT_H)|g' \ + -e 's|@''GNULIB_DIRFD''@|$(GNULIB_DIRFD)|g' \ + -e 's|@''GNULIB_SCANDIR''@|$(GNULIB_SCANDIR)|g' \ + -e 's|@''GNULIB_ALPHASORT''@|$(GNULIB_ALPHASORT)|g' \ + -e 's|@''HAVE_DECL_DIRFD''@|$(HAVE_DECL_DIRFD)|g' \ + -e 's|@''HAVE_SCANDIR''@|$(HAVE_SCANDIR)|g' \ + -e 's|@''HAVE_ALPHASORT''@|$(HAVE_ALPHASORT)|g' \ -e 's|@''REPLACE_FCHDIR''@|$(REPLACE_FCHDIR)|g' \ - < $(srcdir)/dirent_.h; \ + -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ + < $(srcdir)/dirent.in.h; \ + } > $@-t + mv $@-t $@ + +# We need the following in order to create when the system +# doesn't have one that is POSIX compliant. +errno.h: errno.in.h + rm -f $@-t $@ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ + sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''NEXT_ERRNO_H''@|$(NEXT_ERRNO_H)|g' \ + -e 's|@''EMULTIHOP_HIDDEN''@|$(EMULTIHOP_HIDDEN)|g' \ + -e 's|@''EMULTIHOP_VALUE''@|$(EMULTIHOP_VALUE)|g' \ + -e 's|@''ENOLINK_HIDDEN''@|$(ENOLINK_HIDDEN)|g' \ + -e 's|@''ENOLINK_VALUE''@|$(ENOLINK_VALUE)|g' \ + -e 's|@''EOVERFLOW_HIDDEN''@|$(EOVERFLOW_HIDDEN)|g' \ + -e 's|@''EOVERFLOW_VALUE''@|$(EOVERFLOW_VALUE)|g' \ + < $(srcdir)/errno.in.h; \ } > $@-t mv $@-t $@ # We need the following in order to create when the system # doesn't have one that works with the given compiler. -fcntl.h: fcntl_.h +fcntl.h: fcntl.in.h rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ - sed -e 's|@''ABSOLUTE_FCNTL_H''@|$(ABSOLUTE_FCNTL_H)|g' \ - < $(srcdir)/fcntl_.h; \ + sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''NEXT_FCNTL_H''@|$(NEXT_FCNTL_H)|g' \ + -e 's|@''GNULIB_OPEN''@|$(GNULIB_OPEN)|g' \ + -e 's|@''REPLACE_OPEN''@|$(REPLACE_OPEN)|g' \ + < $(srcdir)/fcntl.in.h; \ + } > $@-t + mv $@-t $@ + +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +float.h: float.in.h + rm -f $@-t $@ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ + sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''NEXT_FLOAT_H''@|$(NEXT_FLOAT_H)|g' \ + < $(srcdir)/float.in.h; \ } > $@-t mv $@-t $@ # We need the following in order to create when the system # doesn't have one that supports the required API. -fnmatch.h: fnmatch_.h +fnmatch.h: fnmatch.in.h { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ - cat $(srcdir)/fnmatch_.h; \ + cat $(srcdir)/fnmatch.in.h; \ } > $@-t mv -f $@-t $@ # We need the following in order to create when the system # doesn't have one that works with the given compiler. -getopt.h: getopt_.h +getopt.h: getopt.in.h { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ - cat $(srcdir)/getopt_.h; \ + cat $(srcdir)/getopt.in.h; \ } > $@-t mv -f $@-t $@ +#if GNU_MAKE +# [nicer features that work only with GNU Make] +#else +# [fallback features that work in any 'make' implementation; see +# http://www.opengroup.org/susv3/utilities/make.html +# for the 2004 POSIX specification] +#endif + +distclean-local: clean-GNUmakefile +clean-GNUmakefile: + test x'$(VPATH)' != x && rm -f $(top_builddir)/GNUmakefile || : + +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +iconv.h: iconv.in.h + rm -f $@-t $@ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ + sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''NEXT_ICONV_H''@|$(NEXT_ICONV_H)|g' \ + -e 's|@''ICONV_CONST''@|$(ICONV_CONST)|g' \ + -e 's|@''REPLACE_ICONV''@|$(REPLACE_ICONV)|g' \ + -e 's|@''REPLACE_ICONV_OPEN''@|$(REPLACE_ICONV_OPEN)|g' \ + -e 's|@''REPLACE_ICONV_UTF''@|$(REPLACE_ICONV_UTF)|g' \ + < $(srcdir)/iconv.in.h; \ + } > $@-t + mv $@-t $@ + +iconv_open-aix.h: iconv_open-aix.gperf + $(GPERF) -m 10 $(srcdir)/iconv_open-aix.gperf > $(srcdir)/iconv_open-aix.h-t + mv $(srcdir)/iconv_open-aix.h-t $(srcdir)/iconv_open-aix.h +iconv_open-hpux.h: iconv_open-hpux.gperf + $(GPERF) -m 10 $(srcdir)/iconv_open-hpux.gperf > $(srcdir)/iconv_open-hpux.h-t + mv $(srcdir)/iconv_open-hpux.h-t $(srcdir)/iconv_open-hpux.h +iconv_open-irix.h: iconv_open-irix.gperf + $(GPERF) -m 10 $(srcdir)/iconv_open-irix.gperf > $(srcdir)/iconv_open-irix.h-t + mv $(srcdir)/iconv_open-irix.h-t $(srcdir)/iconv_open-irix.h +iconv_open-osf.h: iconv_open-osf.gperf + $(GPERF) -m 10 $(srcdir)/iconv_open-osf.gperf > $(srcdir)/iconv_open-osf.h-t + mv $(srcdir)/iconv_open-osf.h-t $(srcdir)/iconv_open-osf.h + # We need the following in order to create when the system # doesn't have one that works with the given compiler. -inttypes.h: inttypes_.h +inttypes.h: inttypes.in.h rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ sed -e 's/@''HAVE_INTTYPES_H''@/$(HAVE_INTTYPES_H)/g' \ - -e 's|@''ABSOLUTE_INTTYPES_H''@|$(ABSOLUTE_INTTYPES_H)|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''NEXT_INTTYPES_H''@|$(NEXT_INTTYPES_H)|g' \ -e 's/@''PRI_MACROS_BROKEN''@/$(PRI_MACROS_BROKEN)/g' \ + -e 's/@''APPLE_UNIVERSAL_BUILD''@/$(APPLE_UNIVERSAL_BUILD)/g' \ -e 's/@''HAVE_LONG_LONG_INT''@/$(HAVE_LONG_LONG_INT)/g' \ -e 's/@''HAVE_UNSIGNED_LONG_LONG_INT''@/$(HAVE_UNSIGNED_LONG_LONG_INT)/g' \ -e 's/@''PRIPTR_PREFIX''@/$(PRIPTR_PREFIX)/g' \ @@ -1319,8 +2162,12 @@ inttypes.h: inttypes_.h -e 's/@''HAVE_DECL_IMAXDIV''@/$(HAVE_DECL_IMAXDIV)/g' \ -e 's/@''HAVE_DECL_STRTOIMAX''@/$(HAVE_DECL_STRTOIMAX)/g' \ -e 's/@''HAVE_DECL_STRTOUMAX''@/$(HAVE_DECL_STRTOUMAX)/g' \ + -e 's/@''INT32_MAX_LT_INTMAX_MAX''@/$(INT32_MAX_LT_INTMAX_MAX)/g' \ + -e 's/@''INT64_MAX_EQ_LONG_MAX''@/$(INT64_MAX_EQ_LONG_MAX)/g' \ + -e 's/@''UINT32_MAX_LT_UINTMAX_MAX''@/$(UINT32_MAX_LT_UINTMAX_MAX)/g' \ + -e 's/@''UINT64_MAX_EQ_ULONG_MAX''@/$(UINT64_MAX_EQ_ULONG_MAX)/g' \ -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ - < $(srcdir)/inttypes_.h; \ + < $(srcdir)/inttypes.in.h; \ } > $@-t mv $@-t $@ @@ -1332,21 +2179,37 @@ inttypes.h: inttypes_.h # avoid installing it. all-local: charset.alias ref-add.sed ref-del.sed -install-exec-local: all-local - test $(GLIBC21) != no || $(mkinstalldirs) $(DESTDIR)$(libdir) +install-exec-local: install-exec-localcharset +install-exec-localcharset: all-local + if test $(GLIBC21) = no; then \ + case '$(host_os)' in \ + darwin[56]*) \ + need_charset_alias=true ;; \ + darwin* | cygwin* | mingw* | pw32* | cegcc*) \ + need_charset_alias=false ;; \ + *) \ + need_charset_alias=true ;; \ + esac ; \ + else \ + need_charset_alias=false ; \ + fi ; \ + if $$need_charset_alias; then \ + $(mkinstalldirs) $(DESTDIR)$(libdir) ; \ + fi ; \ if test -f $(charset_alias); then \ sed -f ref-add.sed $(charset_alias) > $(charset_tmp) ; \ $(INSTALL_DATA) $(charset_tmp) $(charset_alias) ; \ rm -f $(charset_tmp) ; \ else \ - if test $(GLIBC21) = no; then \ + if $$need_charset_alias; then \ sed -f ref-add.sed charset.alias > $(charset_tmp) ; \ $(INSTALL_DATA) $(charset_tmp) $(charset_alias) ; \ rm -f $(charset_tmp) ; \ fi ; \ fi -uninstall-local: all-local +uninstall-local: uninstall-localcharset +uninstall-localcharset: all-local if test -f $(charset_alias); then \ sed -f ref-del.sed $(charset_alias) > $(charset_tmp); \ if grep '^# Packages using this file: $$' $(charset_tmp) \ @@ -1367,40 +2230,178 @@ charset.alias: config.charset sed -e '/^#/d' -e 's/@''PACKAGE''@/$(PACKAGE)/g' $< > t-$@ mv t-$@ $@ +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +math.h: math.in.h + rm -f $@-t $@ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ + sed -e 's|@''INCLUDE_NEXT_AS_FIRST_DIRECTIVE''@|$(INCLUDE_NEXT_AS_FIRST_DIRECTIVE)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''NEXT_MATH_H''@|$(NEXT_MATH_H)|g' \ + -e 's|@''GNULIB_CEILF''@|$(GNULIB_CEILF)|g' \ + -e 's|@''GNULIB_CEILL''@|$(GNULIB_CEILL)|g' \ + -e 's|@''GNULIB_FLOORF''@|$(GNULIB_FLOORF)|g' \ + -e 's|@''GNULIB_FLOORL''@|$(GNULIB_FLOORL)|g' \ + -e 's|@''GNULIB_FREXP''@|$(GNULIB_FREXP)|g' \ + -e 's|@''GNULIB_FREXPL''@|$(GNULIB_FREXPL)|g' \ + -e 's|@''GNULIB_ISFINITE''@|$(GNULIB_ISFINITE)|g' \ + -e 's|@''GNULIB_ISINF''@|$(GNULIB_ISINF)|g' \ + -e 's|@''GNULIB_ISNAN''@|$(GNULIB_ISNAN)|g' \ + -e 's|@''GNULIB_ISNANF''@|$(GNULIB_ISNANF)|g' \ + -e 's|@''GNULIB_ISNAND''@|$(GNULIB_ISNAND)|g' \ + -e 's|@''GNULIB_ISNANL''@|$(GNULIB_ISNANL)|g' \ + -e 's|@''GNULIB_LDEXPL''@|$(GNULIB_LDEXPL)|g' \ + -e 's|@''GNULIB_MATHL''@|$(GNULIB_MATHL)|g' \ + -e 's|@''GNULIB_ROUND''@|$(GNULIB_ROUND)|g' \ + -e 's|@''GNULIB_ROUNDF''@|$(GNULIB_ROUNDF)|g' \ + -e 's|@''GNULIB_ROUNDL''@|$(GNULIB_ROUNDL)|g' \ + -e 's|@''GNULIB_SIGNBIT''@|$(GNULIB_SIGNBIT)|g' \ + -e 's|@''GNULIB_TRUNC''@|$(GNULIB_TRUNC)|g' \ + -e 's|@''GNULIB_TRUNCF''@|$(GNULIB_TRUNCF)|g' \ + -e 's|@''GNULIB_TRUNCL''@|$(GNULIB_TRUNCL)|g' \ + -e 's|@''HAVE_ISNANF''@|$(HAVE_ISNANF)|g' \ + -e 's|@''HAVE_ISNAND''@|$(HAVE_ISNAND)|g' \ + -e 's|@''HAVE_ISNANL''@|$(HAVE_ISNANL)|g' \ + -e 's|@''HAVE_DECL_ACOSL''@|$(HAVE_DECL_ACOSL)|g' \ + -e 's|@''HAVE_DECL_ASINL''@|$(HAVE_DECL_ASINL)|g' \ + -e 's|@''HAVE_DECL_ATANL''@|$(HAVE_DECL_ATANL)|g' \ + -e 's|@''HAVE_DECL_COSL''@|$(HAVE_DECL_COSL)|g' \ + -e 's|@''HAVE_DECL_EXPL''@|$(HAVE_DECL_EXPL)|g' \ + -e 's|@''HAVE_DECL_FREXPL''@|$(HAVE_DECL_FREXPL)|g' \ + -e 's|@''HAVE_DECL_LDEXPL''@|$(HAVE_DECL_LDEXPL)|g' \ + -e 's|@''HAVE_DECL_LOGL''@|$(HAVE_DECL_LOGL)|g' \ + -e 's|@''HAVE_DECL_SINL''@|$(HAVE_DECL_SINL)|g' \ + -e 's|@''HAVE_DECL_SQRTL''@|$(HAVE_DECL_SQRTL)|g' \ + -e 's|@''HAVE_DECL_TANL''@|$(HAVE_DECL_TANL)|g' \ + -e 's|@''HAVE_DECL_TRUNC''@|$(HAVE_DECL_TRUNC)|g' \ + -e 's|@''HAVE_DECL_TRUNCF''@|$(HAVE_DECL_TRUNCF)|g' \ + -e 's|@''REPLACE_CEILF''@|$(REPLACE_CEILF)|g' \ + -e 's|@''REPLACE_CEILL''@|$(REPLACE_CEILL)|g' \ + -e 's|@''REPLACE_FLOORF''@|$(REPLACE_FLOORF)|g' \ + -e 's|@''REPLACE_FLOORL''@|$(REPLACE_FLOORL)|g' \ + -e 's|@''REPLACE_FREXP''@|$(REPLACE_FREXP)|g' \ + -e 's|@''REPLACE_FREXPL''@|$(REPLACE_FREXPL)|g' \ + -e 's|@''REPLACE_HUGE_VAL''@|$(REPLACE_HUGE_VAL)|g' \ + -e 's|@''REPLACE_ISFINITE''@|$(REPLACE_ISFINITE)|g' \ + -e 's|@''REPLACE_ISINF''@|$(REPLACE_ISINF)|g' \ + -e 's|@''REPLACE_ISNAN''@|$(REPLACE_ISNAN)|g' \ + -e 's|@''REPLACE_LDEXPL''@|$(REPLACE_LDEXPL)|g' \ + -e 's|@''REPLACE_NAN''@|$(REPLACE_NAN)|g' \ + -e 's|@''REPLACE_ROUND''@|$(REPLACE_ROUND)|g' \ + -e 's|@''REPLACE_ROUNDF''@|$(REPLACE_ROUNDF)|g' \ + -e 's|@''REPLACE_ROUNDL''@|$(REPLACE_ROUNDL)|g' \ + -e 's|@''REPLACE_SIGNBIT''@|$(REPLACE_SIGNBIT)|g' \ + -e 's|@''REPLACE_SIGNBIT_USING_GCC''@|$(REPLACE_SIGNBIT_USING_GCC)|g' \ + -e 's|@''REPLACE_TRUNCL''@|$(REPLACE_TRUNCL)|g' \ + -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ + < $(srcdir)/math.in.h; \ + } > $@-t + mv $@-t $@ + +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +netdb.h: netdb.in.h + rm -f $@-t $@ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''NEXT_NETDB_H''@|$(NEXT_NETDB_H)|g' \ + -e 's|@''HAVE_NETDB_H''@|$(HAVE_NETDB_H)|g' \ + -e 's|@''GNULIB_GETADDRINFO''@|$(GNULIB_GETADDRINFO)|g' \ + -e 's|@''HAVE_STRUCT_ADDRINFO''@|$(HAVE_STRUCT_ADDRINFO)|g' \ + -e 's|@''HAVE_DECL_FREEADDRINFO''@|$(HAVE_DECL_FREEADDRINFO)|g' \ + -e 's|@''HAVE_DECL_GAI_STRERROR''@|$(HAVE_DECL_GAI_STRERROR)|g' \ + -e 's|@''HAVE_DECL_GETADDRINFO''@|$(HAVE_DECL_GETADDRINFO)|g' \ + -e 's|@''HAVE_DECL_GETNAMEINFO''@|$(HAVE_DECL_GETNAMEINFO)|g' \ + < $(srcdir)/netdb.in.h; \ + } > $@-t + mv $@-t $@ + # We need the following in order to create when the system # doesn't have one. -netinet/in.h: +netinet/in.h: netinet_in.in.h @MKDIR_P@ netinet rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ - sed -e 's|@''ABSOLUTE_NETINET_IN_H''@|$(ABSOLUTE_NETINET_IN_H)|g' \ + sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''NEXT_NETINET_IN_H''@|$(NEXT_NETINET_IN_H)|g' \ -e 's|@''HAVE_NETINET_IN_H''@|$(HAVE_NETINET_IN_H)|g' \ - < $(srcdir)/netinet_in_.h; \ + < $(srcdir)/netinet_in.in.h; \ + } > $@-t + mv $@-t $@ +selinux/selinux.h: se-selinux.in.h + rm -f $@-t $@ + $(MKDIR_P) selinux + cp $(srcdir)/se-selinux.in.h $@-t + chmod a-x $@-t + mv $@-t $@ +selinux/context.h: se-context.in.h + rm -f $@-t $@ + $(MKDIR_P) selinux + cp $(srcdir)/se-context.in.h $@-t + chmod a-x $@-t + mv $@-t $@ + +# We need the following in order to create when the system +# doesn't have a complete one. +signal.h: signal.in.h + rm -f $@-t $@ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ + sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''NEXT_SIGNAL_H''@|$(NEXT_SIGNAL_H)|g' \ + -e 's|@''GNULIB_SIGNAL_H_SIGPIPE''@|$(GNULIB_SIGNAL_H_SIGPIPE)|g' \ + -e 's|@''GNULIB_SIGPROCMASK''@|$(GNULIB_SIGPROCMASK)|g' \ + -e 's|@''GNULIB_SIGACTION''@|$(GNULIB_SIGACTION)|g' \ + -e 's|@''HAVE_POSIX_SIGNALBLOCKING''@|$(HAVE_POSIX_SIGNALBLOCKING)|g' \ + -e 's|@''HAVE_SIGSET_T''@|$(HAVE_SIGSET_T)|g' \ + -e 's|@''HAVE_SIGINFO_T''@|$(HAVE_SIGINFO_T)|g' \ + -e 's|@''HAVE_SIGACTION''@|$(HAVE_SIGACTION)|g' \ + -e 's|@''HAVE_STRUCT_SIGACTION_SA_SIGACTION''@|$(HAVE_STRUCT_SIGACTION_SA_SIGACTION)|g' \ + -e 's|@''HAVE_TYPE_VOLATILE_SIG_ATOMIC_T''@|$(HAVE_TYPE_VOLATILE_SIG_ATOMIC_T)|g' \ + -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ + < $(srcdir)/signal.in.h; \ + } > $@-t + mv $@-t $@ + +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +stdarg.h: stdarg.in.h + rm -f $@-t $@ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ + sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''NEXT_STDARG_H''@|$(NEXT_STDARG_H)|g' \ + < $(srcdir)/stdarg.in.h; \ } > $@-t mv $@-t $@ # We need the following in order to create when the system # doesn't have one that works. -stdbool.h: stdbool_.h +stdbool.h: stdbool.in.h rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ - sed -e 's/@''HAVE__BOOL''@/$(HAVE__BOOL)/g' < $(srcdir)/stdbool_.h; \ + sed -e 's/@''HAVE__BOOL''@/$(HAVE__BOOL)/g' < $(srcdir)/stdbool.in.h; \ } > $@-t mv $@-t $@ # We need the following in order to create when the system # doesn't have one that works with the given compiler. -stdint.h: stdint_.h +stdint.h: stdint.in.h rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ sed -e 's/@''HAVE_STDINT_H''@/$(HAVE_STDINT_H)/g' \ - -e 's|@''ABSOLUTE_STDINT_H''@|$(ABSOLUTE_STDINT_H)|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''NEXT_STDINT_H''@|$(NEXT_STDINT_H)|g' \ -e 's/@''HAVE_SYS_TYPES_H''@/$(HAVE_SYS_TYPES_H)/g' \ -e 's/@''HAVE_INTTYPES_H''@/$(HAVE_INTTYPES_H)/g' \ -e 's/@''HAVE_SYS_INTTYPES_H''@/$(HAVE_SYS_INTTYPES_H)/g' \ -e 's/@''HAVE_SYS_BITYPES_H''@/$(HAVE_SYS_BITYPES_H)/g' \ -e 's/@''HAVE_LONG_LONG_INT''@/$(HAVE_LONG_LONG_INT)/g' \ -e 's/@''HAVE_UNSIGNED_LONG_LONG_INT''@/$(HAVE_UNSIGNED_LONG_LONG_INT)/g' \ + -e 's/@''APPLE_UNIVERSAL_BUILD''@/$(APPLE_UNIVERSAL_BUILD)/g' \ -e 's/@''BITSIZEOF_PTRDIFF_T''@/$(BITSIZEOF_PTRDIFF_T)/g' \ -e 's/@''PTRDIFF_T_SUFFIX''@/$(PTRDIFF_T_SUFFIX)/g' \ -e 's/@''BITSIZEOF_SIG_ATOMIC_T''@/$(BITSIZEOF_SIG_ATOMIC_T)/g' \ @@ -1414,24 +2415,54 @@ stdint.h: stdint_.h -e 's/@''BITSIZEOF_WINT_T''@/$(BITSIZEOF_WINT_T)/g' \ -e 's/@''HAVE_SIGNED_WINT_T''@/$(HAVE_SIGNED_WINT_T)/g' \ -e 's/@''WINT_T_SUFFIX''@/$(WINT_T_SUFFIX)/g' \ - < $(srcdir)/stdint_.h; \ + < $(srcdir)/stdint.in.h; \ } > $@-t mv $@-t $@ # We need the following in order to create when the system # doesn't have one that works with the given compiler. -stdio.h: stdio_.h +stdio.h: stdio.in.h rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ - sed -e 's|@''ABSOLUTE_STDIO_H''@|$(ABSOLUTE_STDIO_H)|g' \ + sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''NEXT_STDIO_H''@|$(NEXT_STDIO_H)|g' \ + -e 's|@''GNULIB_FPRINTF''@|$(GNULIB_FPRINTF)|g' \ -e 's|@''GNULIB_FPRINTF_POSIX''@|$(GNULIB_FPRINTF_POSIX)|g' \ + -e 's|@''GNULIB_PRINTF''@|$(GNULIB_PRINTF)|g' \ -e 's|@''GNULIB_PRINTF_POSIX''@|$(GNULIB_PRINTF_POSIX)|g' \ -e 's|@''GNULIB_SNPRINTF''@|$(GNULIB_SNPRINTF)|g' \ -e 's|@''GNULIB_SPRINTF_POSIX''@|$(GNULIB_SPRINTF_POSIX)|g' \ + -e 's|@''GNULIB_VFPRINTF''@|$(GNULIB_VFPRINTF)|g' \ -e 's|@''GNULIB_VFPRINTF_POSIX''@|$(GNULIB_VFPRINTF_POSIX)|g' \ + -e 's|@''GNULIB_VPRINTF''@|$(GNULIB_VPRINTF)|g' \ -e 's|@''GNULIB_VPRINTF_POSIX''@|$(GNULIB_VPRINTF_POSIX)|g' \ -e 's|@''GNULIB_VSNPRINTF''@|$(GNULIB_VSNPRINTF)|g' \ -e 's|@''GNULIB_VSPRINTF_POSIX''@|$(GNULIB_VSPRINTF_POSIX)|g' \ + -e 's|@''GNULIB_DPRINTF''@|$(GNULIB_DPRINTF)|g' \ + -e 's|@''GNULIB_VDPRINTF''@|$(GNULIB_VDPRINTF)|g' \ + -e 's|@''GNULIB_VASPRINTF''@|$(GNULIB_VASPRINTF)|g' \ + -e 's|@''GNULIB_OBSTACK_PRINTF''@|$(GNULIB_OBSTACK_PRINTF)|g' \ + -e 's|@''GNULIB_OBSTACK_PRINTF_POSIX''@|$(GNULIB_OBSTACK_PRINTF_POSIX)|g' \ + -e 's|@''GNULIB_FOPEN''@|$(GNULIB_FOPEN)|g' \ + -e 's|@''GNULIB_FREOPEN''@|$(GNULIB_FREOPEN)|g' \ + -e 's|@''GNULIB_FSEEK''@|$(GNULIB_FSEEK)|g' \ + -e 's|@''GNULIB_FSEEKO''@|$(GNULIB_FSEEKO)|g' \ + -e 's|@''GNULIB_FTELL''@|$(GNULIB_FTELL)|g' \ + -e 's|@''GNULIB_FTELLO''@|$(GNULIB_FTELLO)|g' \ + -e 's|@''GNULIB_FFLUSH''@|$(GNULIB_FFLUSH)|g' \ + -e 's|@''GNULIB_FCLOSE''@|$(GNULIB_FCLOSE)|g' \ + -e 's|@''GNULIB_FPUTC''@|$(GNULIB_FPUTC)|g' \ + -e 's|@''GNULIB_PUTC''@|$(GNULIB_PUTC)|g' \ + -e 's|@''GNULIB_PUTCHAR''@|$(GNULIB_PUTCHAR)|g' \ + -e 's|@''GNULIB_FPUTS''@|$(GNULIB_FPUTS)|g' \ + -e 's|@''GNULIB_PUTS''@|$(GNULIB_PUTS)|g' \ + -e 's|@''GNULIB_FWRITE''@|$(GNULIB_FWRITE)|g' \ + -e 's|@''GNULIB_GETDELIM''@|$(GNULIB_GETDELIM)|g' \ + -e 's|@''GNULIB_GETLINE''@|$(GNULIB_GETLINE)|g' \ + -e 's|@''GNULIB_PERROR''@|$(GNULIB_PERROR)|g' \ + -e 's|@''GNULIB_STDIO_H_SIGPIPE''@|$(GNULIB_STDIO_H_SIGPIPE)|g' \ + -e 's|@''REPLACE_STDIO_WRITE_FUNCS''@|$(REPLACE_STDIO_WRITE_FUNCS)|g' \ -e 's|@''REPLACE_FPRINTF''@|$(REPLACE_FPRINTF)|g' \ -e 's|@''REPLACE_VFPRINTF''@|$(REPLACE_VFPRINTF)|g' \ -e 's|@''REPLACE_PRINTF''@|$(REPLACE_PRINTF)|g' \ @@ -1442,35 +2473,91 @@ stdio.h: stdio_.h -e 's|@''HAVE_DECL_VSNPRINTF''@|$(HAVE_DECL_VSNPRINTF)|g' \ -e 's|@''REPLACE_SPRINTF''@|$(REPLACE_SPRINTF)|g' \ -e 's|@''REPLACE_VSPRINTF''@|$(REPLACE_VSPRINTF)|g' \ + -e 's|@''HAVE_DPRINTF''@|$(HAVE_DPRINTF)|g' \ + -e 's|@''REPLACE_DPRINTF''@|$(REPLACE_DPRINTF)|g' \ + -e 's|@''HAVE_VDPRINTF''@|$(HAVE_VDPRINTF)|g' \ + -e 's|@''REPLACE_VDPRINTF''@|$(REPLACE_VDPRINTF)|g' \ + -e 's|@''HAVE_VASPRINTF''@|$(HAVE_VASPRINTF)|g' \ + -e 's|@''REPLACE_VASPRINTF''@|$(REPLACE_VASPRINTF)|g' \ + -e 's|@''HAVE_DECL_OBSTACK_PRINTF''@|$(HAVE_DECL_OBSTACK_PRINTF)|g' \ + -e 's|@''REPLACE_OBSTACK_PRINTF''@|$(REPLACE_OBSTACK_PRINTF)|g' \ + -e 's|@''REPLACE_FOPEN''@|$(REPLACE_FOPEN)|g' \ + -e 's|@''REPLACE_FREOPEN''@|$(REPLACE_FREOPEN)|g' \ + -e 's|@''REPLACE_FSEEKO''@|$(REPLACE_FSEEKO)|g' \ + -e 's|@''REPLACE_FSEEK''@|$(REPLACE_FSEEK)|g' \ + -e 's|@''REPLACE_FTELLO''@|$(REPLACE_FTELLO)|g' \ + -e 's|@''REPLACE_FTELL''@|$(REPLACE_FTELL)|g' \ + -e 's|@''REPLACE_FFLUSH''@|$(REPLACE_FFLUSH)|g' \ + -e 's|@''REPLACE_FCLOSE''@|$(REPLACE_FCLOSE)|g' \ + -e 's|@''HAVE_DECL_GETDELIM''@|$(HAVE_DECL_GETDELIM)|g' \ + -e 's|@''HAVE_DECL_GETLINE''@|$(HAVE_DECL_GETLINE)|g' \ + -e 's|@''REPLACE_GETLINE''@|$(REPLACE_GETLINE)|g' \ + -e 's|@''REPLACE_PERROR''@|$(REPLACE_PERROR)|g' \ -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ - < $(srcdir)/stdio_.h; \ + < $(srcdir)/stdio.in.h; \ } > $@-t mv $@-t $@ # We need the following in order to create when the system # doesn't have one that works with the given compiler. -stdlib.h: stdlib_.h +stdlib.h: stdlib.in.h rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ - sed -e 's|@''ABSOLUTE_STDLIB_H''@|$(ABSOLUTE_STDLIB_H)|g' \ + sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''NEXT_STDLIB_H''@|$(NEXT_STDLIB_H)|g' \ + -e 's|@''HAVE_RANDOM_H''@|$(HAVE_RANDOM_H)|g' \ + -e 's|@''GNULIB_MALLOC_POSIX''@|$(GNULIB_MALLOC_POSIX)|g' \ + -e 's|@''GNULIB_REALLOC_POSIX''@|$(GNULIB_REALLOC_POSIX)|g' \ + -e 's|@''GNULIB_CALLOC_POSIX''@|$(GNULIB_CALLOC_POSIX)|g' \ + -e 's|@''GNULIB_ATOLL''@|$(GNULIB_ATOLL)|g' \ + -e 's|@''GNULIB_GETLOADAVG''@|$(GNULIB_GETLOADAVG)|g' \ -e 's|@''GNULIB_GETSUBOPT''@|$(GNULIB_GETSUBOPT)|g' \ -e 's|@''GNULIB_MKDTEMP''@|$(GNULIB_MKDTEMP)|g' \ -e 's|@''GNULIB_MKSTEMP''@|$(GNULIB_MKSTEMP)|g' \ + -e 's|@''GNULIB_PUTENV''@|$(GNULIB_PUTENV)|g' \ + -e 's|@''GNULIB_RANDOM_R''@|$(GNULIB_RANDOM_R)|g' \ + -e 's|@''GNULIB_RPMATCH''@|$(GNULIB_RPMATCH)|g' \ + -e 's|@''GNULIB_SETENV''@|$(GNULIB_SETENV)|g' \ + -e 's|@''GNULIB_STRTOD''@|$(GNULIB_STRTOD)|g' \ + -e 's|@''GNULIB_STRTOLL''@|$(GNULIB_STRTOLL)|g' \ + -e 's|@''GNULIB_STRTOULL''@|$(GNULIB_STRTOULL)|g' \ + -e 's|@''GNULIB_UNSETENV''@|$(GNULIB_UNSETENV)|g' \ + -e 's|@''HAVE_ATOLL''@|$(HAVE_ATOLL)|g' \ + -e 's|@''HAVE_CALLOC_POSIX''@|$(HAVE_CALLOC_POSIX)|g' \ -e 's|@''HAVE_GETSUBOPT''@|$(HAVE_GETSUBOPT)|g' \ + -e 's|@''HAVE_MALLOC_POSIX''@|$(HAVE_MALLOC_POSIX)|g' \ -e 's|@''HAVE_MKDTEMP''@|$(HAVE_MKDTEMP)|g' \ + -e 's|@''HAVE_REALLOC_POSIX''@|$(HAVE_REALLOC_POSIX)|g' \ + -e 's|@''HAVE_RANDOM_R''@|$(HAVE_RANDOM_R)|g' \ + -e 's|@''HAVE_RPMATCH''@|$(HAVE_RPMATCH)|g' \ + -e 's|@''HAVE_SETENV''@|$(HAVE_SETENV)|g' \ + -e 's|@''HAVE_STRTOD''@|$(HAVE_STRTOD)|g' \ + -e 's|@''HAVE_STRTOLL''@|$(HAVE_STRTOLL)|g' \ + -e 's|@''HAVE_STRTOULL''@|$(HAVE_STRTOULL)|g' \ + -e 's|@''HAVE_STRUCT_RANDOM_DATA''@|$(HAVE_STRUCT_RANDOM_DATA)|g' \ + -e 's|@''HAVE_SYS_LOADAVG_H''@|$(HAVE_SYS_LOADAVG_H)|g' \ + -e 's|@''HAVE_UNSETENV''@|$(HAVE_UNSETENV)|g' \ + -e 's|@''HAVE_DECL_GETLOADAVG''@|$(HAVE_DECL_GETLOADAVG)|g' \ -e 's|@''REPLACE_MKSTEMP''@|$(REPLACE_MKSTEMP)|g' \ + -e 's|@''REPLACE_PUTENV''@|$(REPLACE_PUTENV)|g' \ + -e 's|@''REPLACE_STRTOD''@|$(REPLACE_STRTOD)|g' \ + -e 's|@''VOID_UNSETENV''@|$(VOID_UNSETENV)|g' \ -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ - < $(srcdir)/stdlib_.h; \ + < $(srcdir)/stdlib.in.h; \ } > $@-t mv $@-t $@ # We need the following in order to create when the system # doesn't have one that works with the given compiler. -string.h: string_.h +string.h: string.in.h rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ - sed -e 's|@''ABSOLUTE_STRING_H''@|$(ABSOLUTE_STRING_H)|g' \ + sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''NEXT_STRING_H''@|$(NEXT_STRING_H)|g' \ -e 's|@''GNULIB_MBSLEN''@|$(GNULIB_MBSLEN)|g' \ + -e 's|@''GNULIB_MBSNLEN''@|$(GNULIB_MBSNLEN)|g' \ -e 's|@''GNULIB_MBSCHR''@|$(GNULIB_MBSCHR)|g' \ -e 's|@''GNULIB_MBSRCHR''@|$(GNULIB_MBSRCHR)|g' \ -e 's|@''GNULIB_MBSSTR''@|$(GNULIB_MBSSTR)|g' \ @@ -1486,6 +2573,7 @@ string.h: string_.h -e 's|@''GNULIB_MEMMEM''@|$(GNULIB_MEMMEM)|g' \ -e 's|@''GNULIB_MEMPCPY''@|$(GNULIB_MEMPCPY)|g' \ -e 's|@''GNULIB_MEMRCHR''@|$(GNULIB_MEMRCHR)|g' \ + -e 's|@''GNULIB_RAWMEMCHR''@|$(GNULIB_RAWMEMCHR)|g' \ -e 's|@''GNULIB_STPCPY''@|$(GNULIB_STPCPY)|g' \ -e 's|@''GNULIB_STPNCPY''@|$(GNULIB_STPNCPY)|g' \ -e 's|@''GNULIB_STRCHRNUL''@|$(GNULIB_STRCHRNUL)|g' \ @@ -1494,15 +2582,18 @@ string.h: string_.h -e 's|@''GNULIB_STRNLEN''@|$(GNULIB_STRNLEN)|g' \ -e 's|@''GNULIB_STRPBRK''@|$(GNULIB_STRPBRK)|g' \ -e 's|@''GNULIB_STRSEP''@|$(GNULIB_STRSEP)|g' \ + -e 's|@''GNULIB_STRSTR''@|$(GNULIB_STRSTR)|g' \ -e 's|@''GNULIB_STRCASESTR''@|$(GNULIB_STRCASESTR)|g' \ -e 's|@''GNULIB_STRTOK_R''@|$(GNULIB_STRTOK_R)|g' \ + -e 's|@''GNULIB_STRERROR''@|$(GNULIB_STRERROR)|g' \ + -e 's|@''GNULIB_STRSIGNAL''@|$(GNULIB_STRSIGNAL)|g' \ + -e 's|@''GNULIB_STRVERSCMP''@|$(GNULIB_STRVERSCMP)|g' \ -e 's|@''HAVE_DECL_MEMMEM''@|$(HAVE_DECL_MEMMEM)|g' \ -e 's|@''HAVE_MEMPCPY''@|$(HAVE_MEMPCPY)|g' \ -e 's|@''HAVE_DECL_MEMRCHR''@|$(HAVE_DECL_MEMRCHR)|g' \ + -e 's|@''HAVE_RAWMEMCHR''@|$(HAVE_RAWMEMCHR)|g' \ -e 's|@''HAVE_STPCPY''@|$(HAVE_STPCPY)|g' \ -e 's|@''HAVE_STPNCPY''@|$(HAVE_STPNCPY)|g' \ - -e 's|@''HAVE_STRCASECMP''@|$(HAVE_STRCASECMP)|g' \ - -e 's|@''HAVE_DECL_STRNCASECMP''@|$(HAVE_DECL_STRNCASECMP)|g' \ -e 's|@''HAVE_STRCHRNUL''@|$(HAVE_STRCHRNUL)|g' \ -e 's|@''HAVE_DECL_STRDUP''@|$(HAVE_DECL_STRDUP)|g' \ -e 's|@''HAVE_STRNDUP''@|$(HAVE_STRNDUP)|g' \ @@ -1512,110 +2603,246 @@ string.h: string_.h -e 's|@''HAVE_STRSEP''@|$(HAVE_STRSEP)|g' \ -e 's|@''HAVE_STRCASESTR''@|$(HAVE_STRCASESTR)|g' \ -e 's|@''HAVE_DECL_STRTOK_R''@|$(HAVE_DECL_STRTOK_R)|g' \ + -e 's|@''HAVE_DECL_STRERROR''@|$(HAVE_DECL_STRERROR)|g' \ + -e 's|@''HAVE_DECL_STRSIGNAL''@|$(HAVE_DECL_STRSIGNAL)|g' \ + -e 's|@''HAVE_STRVERSCMP''@|$(HAVE_STRVERSCMP)|g' \ + -e 's|@''REPLACE_MEMMEM''@|$(REPLACE_MEMMEM)|g' \ + -e 's|@''REPLACE_STRCASESTR''@|$(REPLACE_STRCASESTR)|g' \ + -e 's|@''REPLACE_STRDUP''@|$(REPLACE_STRDUP)|g' \ + -e 's|@''REPLACE_STRSTR''@|$(REPLACE_STRSTR)|g' \ + -e 's|@''REPLACE_STRERROR''@|$(REPLACE_STRERROR)|g' \ + -e 's|@''REPLACE_STRSIGNAL''@|$(REPLACE_STRSIGNAL)|g' \ -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ - < $(srcdir)/string_.h; \ + < $(srcdir)/string.in.h; \ + } > $@-t + mv $@-t $@ + +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +sys/select.h: sys_select.in.h + @MKDIR_P@ sys + rm -f $@-t $@ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''NEXT_SYS_SELECT_H''@|$(NEXT_SYS_SELECT_H)|g' \ + -e 's|@''HAVE_SYS_SELECT_H''@|$(HAVE_SYS_SELECT_H)|g' \ + -e 's|@''GNULIB_SELECT''@|$(GNULIB_SELECT)|g' \ + -e 's|@''HAVE_WINSOCK2_H''@|$(HAVE_WINSOCK2_H)|g' \ + -e 's|@''REPLACE_SELECT''@|$(REPLACE_SELECT)|g' \ + -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ + < $(srcdir)/sys_select.in.h; \ } > $@-t mv $@-t $@ # We need the following in order to create when the system # doesn't have one that works with the given compiler. -sys/socket.h: socket_.h +sys/socket.h: sys_socket.in.h @MKDIR_P@ sys { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ - sed -e 's|@''ABSOLUTE_SYS_SOCKET_H''@|$(ABSOLUTE_SYS_SOCKET_H)|g' \ + sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''NEXT_SYS_SOCKET_H''@|$(NEXT_SYS_SOCKET_H)|g' \ -e 's|@''HAVE_SYS_SOCKET_H''@|$(HAVE_SYS_SOCKET_H)|g' \ + -e 's|@''GNULIB_CLOSE''@|$(GNULIB_CLOSE)|g' \ + -e 's|@''GNULIB_SOCKET''@|$(GNULIB_SOCKET)|g' \ + -e 's|@''GNULIB_CONNECT''@|$(GNULIB_CONNECT)|g' \ + -e 's|@''GNULIB_ACCEPT''@|$(GNULIB_ACCEPT)|g' \ + -e 's|@''GNULIB_BIND''@|$(GNULIB_BIND)|g' \ + -e 's|@''GNULIB_GETPEERNAME''@|$(GNULIB_GETPEERNAME)|g' \ + -e 's|@''GNULIB_GETSOCKNAME''@|$(GNULIB_GETSOCKNAME)|g' \ + -e 's|@''GNULIB_GETSOCKOPT''@|$(GNULIB_GETSOCKOPT)|g' \ + -e 's|@''GNULIB_LISTEN''@|$(GNULIB_LISTEN)|g' \ + -e 's|@''GNULIB_RECV''@|$(GNULIB_RECV)|g' \ + -e 's|@''GNULIB_SEND''@|$(GNULIB_SEND)|g' \ + -e 's|@''GNULIB_RECVFROM''@|$(GNULIB_RECVFROM)|g' \ + -e 's|@''GNULIB_SENDTO''@|$(GNULIB_SENDTO)|g' \ + -e 's|@''GNULIB_SETSOCKOPT''@|$(GNULIB_SETSOCKOPT)|g' \ + -e 's|@''GNULIB_SHUTDOWN''@|$(GNULIB_SHUTDOWN)|g' \ -e 's|@''HAVE_WINSOCK2_H''@|$(HAVE_WINSOCK2_H)|g' \ -e 's|@''HAVE_WS2TCPIP_H''@|$(HAVE_WS2TCPIP_H)|g' \ - < $(srcdir)/socket_.h; \ + -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ + < $(srcdir)/sys_socket.in.h; \ } > $@-t mv -f $@-t $@ # We need the following in order to create when the system # has one that is incomplete. -sys/stat.h: stat_.h +sys/stat.h: sys_stat.in.h @MKDIR_P@ sys rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ - sed -e 's|@''ABSOLUTE_SYS_STAT_H''@|$(ABSOLUTE_SYS_STAT_H)|g' \ - < $(srcdir)/stat_.h; \ + sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''NEXT_SYS_STAT_H''@|$(NEXT_SYS_STAT_H)|g' \ + -e 's|@''GNULIB_LCHMOD''@|$(GNULIB_LCHMOD)|g' \ + -e 's|@''GNULIB_LSTAT''@|$(GNULIB_LSTAT)|g' \ + -e 's|@''HAVE_LCHMOD''@|$(HAVE_LCHMOD)|g' \ + -e 's|@''HAVE_LSTAT''@|$(HAVE_LSTAT)|g' \ + -e 's|@''REPLACE_LSTAT''@|$(REPLACE_LSTAT)|g' \ + -e 's|@''REPLACE_MKDIR''@|$(REPLACE_MKDIR)|g' \ + -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ + < $(srcdir)/sys_stat.in.h; \ } > $@-t mv $@-t $@ # We need the following in order to create when the system # doesn't have one that works with the given compiler. -sys/time.h: sys_time_.h +sys/time.h: sys_time.in.h @MKDIR_P@ sys rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ sed -e 's/@''HAVE_SYS_TIME_H''@/$(HAVE_SYS_TIME_H)/g' \ - -e 's|@''ABSOLUTE_SYS_TIME_H''@|$(ABSOLUTE_SYS_TIME_H)|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''NEXT_SYS_TIME_H''@|$(NEXT_SYS_TIME_H)|g' \ -e 's/@''REPLACE_GETTIMEOFDAY''@/$(REPLACE_GETTIMEOFDAY)/g' \ -e 's/@''HAVE_STRUCT_TIMEVAL''@/$(HAVE_STRUCT_TIMEVAL)/g' \ - < $(srcdir)/sys_time_.h; \ + < $(srcdir)/sys_time.in.h; \ } > $@-t mv $@-t $@ # We need the following in order to create when the system # doesn't have one that works with the given compiler. -time.h: time_.h +time.h: time.in.h rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ - sed -e 's|@ABSOLUTE_TIME_H''@|$(ABSOLUTE_TIME_H)|g' \ - -e 's|@REPLACE_LOCALTIME_R''@|$(REPLACE_LOCALTIME_R)|g' \ - -e 's|@REPLACE_NANOSLEEP''@|$(REPLACE_NANOSLEEP)|g' \ - -e 's|@REPLACE_STRPTIME''@|$(REPLACE_STRPTIME)|g' \ - -e 's|@REPLACE_TIMEGM''@|$(REPLACE_TIMEGM)|g' \ - -e 's|@SYS_TIME_H_DEFINES_STRUCT_TIMESPEC''@|$(SYS_TIME_H_DEFINES_STRUCT_TIMESPEC)|g' \ - -e 's|@TIME_H_DEFINES_STRUCT_TIMESPEC''@|$(TIME_H_DEFINES_STRUCT_TIMESPEC)|g' \ - < $(srcdir)/time_.h; \ + sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@NEXT_TIME_H''@|$(NEXT_TIME_H)|g' \ + -e 's|@REPLACE_LOCALTIME_R''@|$(REPLACE_LOCALTIME_R)|g' \ + -e 's|@REPLACE_NANOSLEEP''@|$(REPLACE_NANOSLEEP)|g' \ + -e 's|@REPLACE_STRPTIME''@|$(REPLACE_STRPTIME)|g' \ + -e 's|@REPLACE_TIMEGM''@|$(REPLACE_TIMEGM)|g' \ + -e 's|@SYS_TIME_H_DEFINES_STRUCT_TIMESPEC''@|$(SYS_TIME_H_DEFINES_STRUCT_TIMESPEC)|g' \ + -e 's|@TIME_H_DEFINES_STRUCT_TIMESPEC''@|$(TIME_H_DEFINES_STRUCT_TIMESPEC)|g' \ + < $(srcdir)/time.in.h; \ } > $@-t mv $@-t $@ # We need the following in order to create an empty placeholder for # when the system doesn't have one. -unistd.h: unistd_.h +unistd.h: unistd.in.h rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ sed -e 's|@''HAVE_UNISTD_H''@|$(HAVE_UNISTD_H)|g' \ - -e 's|@''ABSOLUTE_UNISTD_H''@|$(ABSOLUTE_UNISTD_H)|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''NEXT_UNISTD_H''@|$(NEXT_UNISTD_H)|g' \ -e 's|@''GNULIB_CHOWN''@|$(GNULIB_CHOWN)|g' \ + -e 's|@''GNULIB_CLOSE''@|$(GNULIB_CLOSE)|g' \ -e 's|@''GNULIB_DUP2''@|$(GNULIB_DUP2)|g' \ + -e 's|@''GNULIB_ENVIRON''@|$(GNULIB_ENVIRON)|g' \ + -e 's|@''GNULIB_EUIDACCESS''@|$(GNULIB_EUIDACCESS)|g' \ -e 's|@''GNULIB_FCHDIR''@|$(GNULIB_FCHDIR)|g' \ + -e 's|@''GNULIB_FSYNC''@|$(GNULIB_FSYNC)|g' \ -e 's|@''GNULIB_FTRUNCATE''@|$(GNULIB_FTRUNCATE)|g' \ -e 's|@''GNULIB_GETCWD''@|$(GNULIB_GETCWD)|g' \ + -e 's|@''GNULIB_GETDOMAINNAME''@|$(GNULIB_GETDOMAINNAME)|g' \ + -e 's|@''GNULIB_GETDTABLESIZE''@|$(GNULIB_GETDTABLESIZE)|g' \ + -e 's|@''GNULIB_GETHOSTNAME''@|$(GNULIB_GETHOSTNAME)|g' \ -e 's|@''GNULIB_GETLOGIN_R''@|$(GNULIB_GETLOGIN_R)|g' \ + -e 's|@''GNULIB_GETPAGESIZE''@|$(GNULIB_GETPAGESIZE)|g' \ + -e 's|@''GNULIB_GETUSERSHELL''@|$(GNULIB_GETUSERSHELL)|g' \ + -e 's|@''GNULIB_LCHOWN''@|$(GNULIB_LCHOWN)|g' \ + -e 's|@''GNULIB_LINK''@|$(GNULIB_LINK)|g' \ + -e 's|@''GNULIB_LSEEK''@|$(GNULIB_LSEEK)|g' \ -e 's|@''GNULIB_READLINK''@|$(GNULIB_READLINK)|g' \ + -e 's|@''GNULIB_SLEEP''@|$(GNULIB_SLEEP)|g' \ + -e 's|@''GNULIB_UNISTD_H_SIGPIPE''@|$(GNULIB_UNISTD_H_SIGPIPE)|g' \ + -e 's|@''GNULIB_WRITE''@|$(GNULIB_WRITE)|g' \ -e 's|@''HAVE_DUP2''@|$(HAVE_DUP2)|g' \ + -e 's|@''HAVE_EUIDACCESS''@|$(HAVE_EUIDACCESS)|g' \ + -e 's|@''HAVE_FSYNC''@|$(HAVE_FSYNC)|g' \ -e 's|@''HAVE_FTRUNCATE''@|$(HAVE_FTRUNCATE)|g' \ + -e 's|@''HAVE_GETDOMAINNAME''@|$(HAVE_GETDOMAINNAME)|g' \ + -e 's|@''HAVE_GETDTABLESIZE''@|$(HAVE_GETDTABLESIZE)|g' \ + -e 's|@''HAVE_GETHOSTNAME''@|$(HAVE_GETHOSTNAME)|g' \ + -e 's|@''HAVE_GETPAGESIZE''@|$(HAVE_GETPAGESIZE)|g' \ + -e 's|@''HAVE_GETUSERSHELL''@|$(HAVE_GETUSERSHELL)|g' \ + -e 's|@''HAVE_LINK''@|$(HAVE_LINK)|g' \ -e 's|@''HAVE_READLINK''@|$(HAVE_READLINK)|g' \ + -e 's|@''HAVE_SLEEP''@|$(HAVE_SLEEP)|g' \ + -e 's|@''HAVE_DECL_ENVIRON''@|$(HAVE_DECL_ENVIRON)|g' \ -e 's|@''HAVE_DECL_GETLOGIN_R''@|$(HAVE_DECL_GETLOGIN_R)|g' \ + -e 's|@''HAVE_OS_H''@|$(HAVE_OS_H)|g' \ + -e 's|@''HAVE_SYS_PARAM_H''@|$(HAVE_SYS_PARAM_H)|g' \ -e 's|@''REPLACE_CHOWN''@|$(REPLACE_CHOWN)|g' \ + -e 's|@''REPLACE_CLOSE''@|$(REPLACE_CLOSE)|g' \ -e 's|@''REPLACE_FCHDIR''@|$(REPLACE_FCHDIR)|g' \ -e 's|@''REPLACE_GETCWD''@|$(REPLACE_GETCWD)|g' \ - < $(srcdir)/unistd_.h; \ + -e 's|@''REPLACE_GETPAGESIZE''@|$(REPLACE_GETPAGESIZE)|g' \ + -e 's|@''REPLACE_LCHOWN''@|$(REPLACE_LCHOWN)|g' \ + -e 's|@''REPLACE_LSEEK''@|$(REPLACE_LSEEK)|g' \ + -e 's|@''REPLACE_WRITE''@|$(REPLACE_WRITE)|g' \ + -e 's|@''UNISTD_H_HAVE_WINSOCK2_H''@|$(UNISTD_H_HAVE_WINSOCK2_H)|g' \ + -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ + < $(srcdir)/unistd.in.h; \ } > $@-t mv $@-t $@ # We need the following in order to create when the system # version does not work standalone. -wchar.h: wchar_.h +wchar.h: wchar.in.h rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ - sed -e 's|@''ABSOLUTE_WCHAR_H''@|$(ABSOLUTE_WCHAR_H)|g' \ - < $(srcdir)/wchar_.h; \ + sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''NEXT_WCHAR_H''@|$(NEXT_WCHAR_H)|g' \ + -e 's|@''HAVE_WCHAR_H''@|$(HAVE_WCHAR_H)|g' \ + -e 's|@''GNULIB_BTOWC''@|$(GNULIB_BTOWC)|g' \ + -e 's|@''GNULIB_WCTOB''@|$(GNULIB_WCTOB)|g' \ + -e 's|@''GNULIB_MBSINIT''@|$(GNULIB_MBSINIT)|g' \ + -e 's|@''GNULIB_MBRTOWC''@|$(GNULIB_MBRTOWC)|g' \ + -e 's|@''GNULIB_MBRLEN''@|$(GNULIB_MBRLEN)|g' \ + -e 's|@''GNULIB_MBSRTOWCS''@|$(GNULIB_MBSRTOWCS)|g' \ + -e 's|@''GNULIB_MBSNRTOWCS''@|$(GNULIB_MBSNRTOWCS)|g' \ + -e 's|@''GNULIB_WCRTOMB''@|$(GNULIB_WCRTOMB)|g' \ + -e 's|@''GNULIB_WCSRTOMBS''@|$(GNULIB_WCSRTOMBS)|g' \ + -e 's|@''GNULIB_WCSNRTOMBS''@|$(GNULIB_WCSNRTOMBS)|g' \ + -e 's|@''GNULIB_WCWIDTH''@|$(GNULIB_WCWIDTH)|g' \ + -e 's|@''HAVE_WINT_T''@|$(HAVE_WINT_T)|g' \ + -e 's|@''HAVE_BTOWC''@|$(HAVE_BTOWC)|g' \ + -e 's|@''HAVE_MBSINIT''@|$(HAVE_MBSINIT)|g' \ + -e 's|@''HAVE_MBRTOWC''@|$(HAVE_MBRTOWC)|g' \ + -e 's|@''HAVE_MBRLEN''@|$(HAVE_MBRLEN)|g' \ + -e 's|@''HAVE_MBSRTOWCS''@|$(HAVE_MBSRTOWCS)|g' \ + -e 's|@''HAVE_MBSNRTOWCS''@|$(HAVE_MBSNRTOWCS)|g' \ + -e 's|@''HAVE_WCRTOMB''@|$(HAVE_WCRTOMB)|g' \ + -e 's|@''HAVE_WCSRTOMBS''@|$(HAVE_WCSRTOMBS)|g' \ + -e 's|@''HAVE_WCSNRTOMBS''@|$(HAVE_WCSNRTOMBS)|g' \ + -e 's|@''HAVE_DECL_WCTOB''@|$(HAVE_DECL_WCTOB)|g' \ + -e 's|@''HAVE_DECL_WCWIDTH''@|$(HAVE_DECL_WCWIDTH)|g' \ + -e 's|@''REPLACE_MBSTATE_T''@|$(REPLACE_MBSTATE_T)|g' \ + -e 's|@''REPLACE_BTOWC''@|$(REPLACE_BTOWC)|g' \ + -e 's|@''REPLACE_WCTOB''@|$(REPLACE_WCTOB)|g' \ + -e 's|@''REPLACE_MBSINIT''@|$(REPLACE_MBSINIT)|g' \ + -e 's|@''REPLACE_MBRTOWC''@|$(REPLACE_MBRTOWC)|g' \ + -e 's|@''REPLACE_MBRLEN''@|$(REPLACE_MBRLEN)|g' \ + -e 's|@''REPLACE_MBSRTOWCS''@|$(REPLACE_MBSRTOWCS)|g' \ + -e 's|@''REPLACE_MBSNRTOWCS''@|$(REPLACE_MBSNRTOWCS)|g' \ + -e 's|@''REPLACE_WCRTOMB''@|$(REPLACE_WCRTOMB)|g' \ + -e 's|@''REPLACE_WCSRTOMBS''@|$(REPLACE_WCSRTOMBS)|g' \ + -e 's|@''REPLACE_WCSNRTOMBS''@|$(REPLACE_WCSNRTOMBS)|g' \ + -e 's|@''REPLACE_WCWIDTH''@|$(REPLACE_WCWIDTH)|g' \ + -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ + < $(srcdir)/wchar.in.h; \ } > $@-t mv $@-t $@ # We need the following in order to create when the system # doesn't have one that works with the given compiler. -wctype.h: wctype_.h +wctype.h: wctype.in.h rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ sed -e 's/@''HAVE_WCTYPE_H''@/$(HAVE_WCTYPE_H)/g' \ - -e 's|@''ABSOLUTE_WCTYPE_H''@|$(ABSOLUTE_WCTYPE_H)|g' \ - -e 's/@''HAVE_WCTYPE_CTMP_BUG''@/$(HAVE_WCTYPE_CTMP_BUG)/g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''NEXT_WCTYPE_H''@|$(NEXT_WCTYPE_H)|g' \ + -e 's/@''HAVE_ISWCNTRL''@/$(HAVE_ISWCNTRL)/g' \ -e 's/@''HAVE_WINT_T''@/$(HAVE_WINT_T)/g' \ - < $(srcdir)/wctype_.h; \ + -e 's/@''REPLACE_ISWCNTRL''@/$(REPLACE_ISWCNTRL)/g' \ + < $(srcdir)/wctype.in.h; \ } > $@-t mv $@-t $@ @@ -1624,13 +2851,9 @@ mostlyclean-local: mostlyclean-generic if test -n "$$dir" && test -d $$dir; then \ echo "rmdir $$dir"; rmdir $$dir; \ fi; \ - done + done; \ + : -check: unit-test - -.PHONY: unit-test -unit-test: t-fpending - ./t-fpending > /dev/null # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff --git a/src/bin/coreutils/lib/acl-internal.h b/src/bin/coreutils/lib/acl-internal.h index e224a78dcf..e4661e8173 100644 --- a/src/bin/coreutils/lib/acl-internal.h +++ b/src/bin/coreutils/lib/acl-internal.h @@ -1,11 +1,11 @@ /* Internal implementation of access control lists. - Copyright (C) 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc. + Copyright (C) 2002-2003, 2005-2009 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,18 +13,24 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + along with this program. If not, see . - Written by Paul Eggert and Andreas Gruenbacher. */ - -#include + Written by Paul Eggert, Andreas Grünbacher, and Bruno Haible. */ #include "acl.h" #include #include +/* All systems define the ACL related API in . */ +#if HAVE_SYS_ACL_H +# include +#endif +#if defined HAVE_ACL && ! defined GETACLCNT && defined ACL_CNT +# define GETACLCNT ACL_CNT +#endif + +/* On Linux, additional ACL related API is available in . */ #ifdef HAVE_ACL_LIBACL_H # include #endif @@ -40,47 +46,175 @@ # define ENOTSUP (-1) #endif -#include "gettext.h" -#define _(msgid) gettext (msgid) - #ifndef HAVE_FCHMOD # define HAVE_FCHMOD false # define fchmod(fd, mode) (-1) #endif -#ifndef MIN_ACL_ENTRIES -# define MIN_ACL_ENTRIES 4 -#endif + +#if USE_ACL + +# if HAVE_ACL_GET_FILE +/* POSIX 1003.1e (draft 17 -- abandoned) specific version. */ +/* Linux, FreeBSD, MacOS X, IRIX, Tru64 */ + +# ifndef MIN_ACL_ENTRIES +# define MIN_ACL_ENTRIES 4 +# endif /* POSIX 1003.1e (draft 17) */ -#ifndef HAVE_ACL_GET_FD -# define HAVE_ACL_GET_FD false -# define acl_get_fd(fd) (NULL) -#endif +# ifdef HAVE_ACL_GET_FD +/* Most platforms have a 1-argument acl_get_fd, only OSF/1 has a 2-argument + macro(!). */ +# if HAVE_ACL_FREE_TEXT /* OSF/1 */ +static inline acl_t +rpl_acl_get_fd (int fd) +{ + return acl_get_fd (fd, ACL_TYPE_ACCESS); +} +# undef acl_get_fd +# define acl_get_fd rpl_acl_get_fd +# endif +# else +# define HAVE_ACL_GET_FD false +# undef acl_get_fd +# define acl_get_fd(fd) (NULL) +# endif /* POSIX 1003.1e (draft 17) */ -#ifndef HAVE_ACL_SET_FD -# define HAVE_ACL_SET_FD false -# define acl_set_fd(fd, acl) (-1) -#endif +# ifdef HAVE_ACL_SET_FD +/* Most platforms have a 2-argument acl_set_fd, only OSF/1 has a 3-argument + macro(!). */ +# if HAVE_ACL_FREE_TEXT /* OSF/1 */ +static inline int +rpl_acl_set_fd (int fd, acl_t acl) +{ + return acl_set_fd (fd, ACL_TYPE_ACCESS, acl); +} +# undef acl_set_fd +# define acl_set_fd rpl_acl_set_fd +# endif +# else +# define HAVE_ACL_SET_FD false +# undef acl_set_fd +# define acl_set_fd(fd, acl) (-1) +# endif + +/* POSIX 1003.1e (draft 13) */ +# if ! HAVE_ACL_FREE_TEXT +# define acl_free_text(buf) acl_free (buf) +# endif /* Linux-specific */ -#ifndef HAVE_ACL_EXTENDED_FILE -# define HAVE_ACL_EXTENDED_FILE false -# define acl_extended_file(name) (-1) -#endif +# ifndef HAVE_ACL_EXTENDED_FILE +# define HAVE_ACL_EXTENDED_FILE false +# define acl_extended_file(name) (-1) +# endif /* Linux-specific */ -#ifndef HAVE_ACL_FROM_MODE -# define HAVE_ACL_FROM_MODE false -# define acl_from_mode(mode) (NULL) -#endif +# ifndef HAVE_ACL_FROM_MODE +# define HAVE_ACL_FROM_MODE false +# define acl_from_mode(mode) (NULL) +# endif -#define ACL_NOT_WELL_SUPPORTED(Errno) \ - ((Errno) == ENOTSUP || (Errno) == ENOSYS || (Errno) == EINVAL) +/* Set to 1 if a file's mode is implicit by the ACL. + Set to 0 if a file's mode is stored independently from the ACL. */ +# if HAVE_ACL_COPY_EXT_NATIVE && HAVE_ACL_CREATE_ENTRY_NP /* MacOS X */ +# define MODE_INSIDE_ACL 0 +# else +# define MODE_INSIDE_ACL 1 +# endif + +# if defined __APPLE__ && defined __MACH__ /* MacOS X */ +# define ACL_NOT_WELL_SUPPORTED(Err) \ + ((Err) == ENOTSUP || (Err) == ENOSYS || (Err) == EINVAL || (Err) == EBUSY || (Err) == ENOENT) +# elif defined EOPNOTSUPP /* Tru64 NFS */ +# define ACL_NOT_WELL_SUPPORTED(Err) \ + ((Err) == ENOTSUP || (Err) == ENOSYS || (Err) == EINVAL || (Err) == EBUSY || (Err) == EOPNOTSUPP) +# else +# define ACL_NOT_WELL_SUPPORTED(Err) \ + ((Err) == ENOTSUP || (Err) == ENOSYS || (Err) == EINVAL || (Err) == EBUSY) +# endif + +/* Return the number of entries in ACL. + Return -1 and set errno upon failure to determine it. */ +/* Define a replacement for acl_entries if needed. (Only Linux has it.) */ +# if !HAVE_ACL_ENTRIES +# define acl_entries rpl_acl_entries +extern int acl_entries (acl_t); +# endif + +# if HAVE_ACL_TYPE_EXTENDED /* MacOS X */ +/* ACL is an ACL, from a file, stored as type ACL_TYPE_EXTENDED. + Return 1 if the given ACL is non-trivial. + Return 0 if it is trivial. */ +extern int acl_extended_nontrivial (acl_t); +# else +/* ACL is an ACL, from a file, stored as type ACL_TYPE_ACCESS. + Return 1 if the given ACL is non-trivial. + Return 0 if it is trivial, i.e. equivalent to a simple stat() mode. + Return -1 and set errno upon failure to determine it. */ +extern int acl_access_nontrivial (acl_t); +# endif + +# elif HAVE_ACL && defined GETACL /* Solaris, Cygwin, not HP-UX */ + +/* Set to 1 if a file's mode is implicit by the ACL. + Set to 0 if a file's mode is stored independently from the ACL. */ +# if defined __CYGWIN__ /* Cygwin */ +# define MODE_INSIDE_ACL 0 +# else /* Solaris */ +# define MODE_INSIDE_ACL 1 +# endif + +# if !defined ACL_NO_TRIVIAL /* Solaris <= 10, Cygwin */ + +/* Return 1 if the given ACL is non-trivial. + Return 0 if it is trivial, i.e. equivalent to a simple stat() mode. */ +extern int acl_nontrivial (int count, aclent_t *entries); + +# ifdef ACE_GETACL /* Solaris 10 */ + +/* Test an ACL retrieved with ACE_GETACL. + Return 1 if the given ACL, consisting of COUNT entries, is non-trivial. + Return 0 if it is trivial, i.e. equivalent to a simple stat() mode. */ +extern int acl_ace_nontrivial (int count, ace_t *entries); + +/* Definitions for when the built executable is executed on Solaris 10 + (newer version) or Solaris 11. */ +/* For a_type. */ +# define ACE_ACCESS_ALLOWED_ACE_TYPE 0 /* replaces ALLOW */ +# define ACE_ACCESS_DENIED_ACE_TYPE 1 /* replaces DENY */ +/* For a_flags. */ +# define NEW_ACE_OWNER 0x1000 +# define NEW_ACE_GROUP 0x2000 +# define NEW_ACE_IDENTIFIER_GROUP 0x0040 +# define ACE_EVERYONE 0x4000 +/* For a_access_mask. */ +# define NEW_ACE_READ_DATA 0x001 /* corresponds to 'r' */ +# define NEW_ACE_WRITE_DATA 0x002 /* corresponds to 'w' */ +# define NEW_ACE_EXECUTE 0x004 /* corresponds to 'x' */ + +# endif + +# endif + +# elif HAVE_GETACL /* HP-UX */ + +/* Return 1 if the given ACL is non-trivial. + Return 0 if it is trivial, i.e. equivalent to a simple stat() mode. */ +extern int acl_nontrivial (int count, struct acl_entry *entries, struct stat *sb); + +# elif HAVE_ACLX_GET && 0 /* AIX */ + +/* TODO */ + +# elif HAVE_STATACL /* older AIX */ + +/* Return 1 if the given ACL is non-trivial. + Return 0 if it is trivial, i.e. equivalent to a simple stat() mode. */ +extern int acl_nontrivial (struct acl *a); + +# endif -/* Define a replacement for acl_entries if needed. */ -#if USE_ACL && HAVE_ACL_GET_FILE && HAVE_ACL_FREE && !HAVE_ACL_ENTRIES -# define acl_entries rpl_acl_entries -int acl_entries (acl_t); #endif diff --git a/src/bin/coreutils/lib/acl.c b/src/bin/coreutils/lib/acl.c deleted file mode 100644 index 84c595ab24..0000000000 --- a/src/bin/coreutils/lib/acl.c +++ /dev/null @@ -1,256 +0,0 @@ -/* acl.c - access control lists - - Copyright (C) 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - - Written by Paul Eggert and Andreas Gruenbacher. */ - -#include - -#include "acl.h" - -#include "acl-internal.h" - -/* If DESC is a valid file descriptor use fchmod to change the - file's mode to MODE on systems that have fchown. On systems - that don't have fchown and if DESC is invalid, use chown on - NAME instead. */ - -int -chmod_or_fchmod (const char *name, int desc, mode_t mode) -{ - if (HAVE_FCHMOD && desc != -1) - return fchmod (desc, mode); - else - return chmod (name, mode); -} - -/* Copy access control lists from one file to another. If SOURCE_DESC is - a valid file descriptor, use file descriptor operations, else use - filename based operations on SRC_NAME. Likewise for DEST_DESC and - DEST_NAME. - If access control lists are not available, fchmod the target file to - MODE. Also sets the non-permission bits of the destination file - (S_ISUID, S_ISGID, S_ISVTX) to those from MODE if any are set. - System call return value semantics. */ - -int -copy_acl (const char *src_name, int source_desc, const char *dst_name, - int dest_desc, mode_t mode) -{ - int ret; - -#if USE_ACL && HAVE_ACL_GET_FILE && HAVE_ACL_SET_FILE && HAVE_ACL_FREE - /* POSIX 1003.1e (draft 17 -- abandoned) specific version. */ - - acl_t acl; - if (HAVE_ACL_GET_FD && source_desc != -1) - acl = acl_get_fd (source_desc); - else - acl = acl_get_file (src_name, ACL_TYPE_ACCESS); - if (acl == NULL) - { - if (ACL_NOT_WELL_SUPPORTED (errno)) - return set_acl (dst_name, dest_desc, mode); - else - { - error (0, errno, "%s", quote (src_name)); - return -1; - } - } - - if (HAVE_ACL_SET_FD && dest_desc != -1) - ret = acl_set_fd (dest_desc, acl); - else - ret = acl_set_file (dst_name, ACL_TYPE_ACCESS, acl); - if (ret != 0) - { - int saved_errno = errno; - - if (ACL_NOT_WELL_SUPPORTED (errno)) - { - int n = acl_entries (acl); - - acl_free (acl); - if (n == 3) - { - if (chmod_or_fchmod (dst_name, dest_desc, mode) != 0) - saved_errno = errno; - else - return 0; - } - else - chmod_or_fchmod (dst_name, dest_desc, mode); - } - else - { - acl_free (acl); - chmod_or_fchmod (dst_name, dest_desc, mode); - } - error (0, saved_errno, _("preserving permissions for %s"), - quote (dst_name)); - return -1; - } - else - acl_free (acl); - - if (mode & (S_ISUID | S_ISGID | S_ISVTX)) - { - /* We did not call chmod so far, so the special bits have not yet - been set. */ - - if (chmod_or_fchmod (dst_name, dest_desc, mode) != 0) - { - error (0, errno, _("preserving permissions for %s"), - quote (dst_name)); - return -1; - } - } - - if (S_ISDIR (mode)) - { - acl = acl_get_file (src_name, ACL_TYPE_DEFAULT); - if (acl == NULL) - { - error (0, errno, "%s", quote (src_name)); - return -1; - } - - if (acl_set_file (dst_name, ACL_TYPE_DEFAULT, acl)) - { - error (0, errno, _("preserving permissions for %s"), - quote (dst_name)); - acl_free (acl); - return -1; - } - else - acl_free (acl); - } - return 0; -#else - ret = chmod_or_fchmod (dst_name, dest_desc, mode); - if (ret != 0) - error (0, errno, _("preserving permissions for %s"), quote (dst_name)); - return ret; -#endif -} - -/* Set the access control lists of a file. If DESC is a valid file - descriptor, use file descriptor operations where available, else use - filename based operations on NAME. If access control lists are not - available, fchmod the target file to MODE. Also sets the - non-permission bits of the destination file (S_ISUID, S_ISGID, S_ISVTX) - to those from MODE if any are set. System call return value - semantics. */ - -int -set_acl (char const *name, int desc, mode_t mode) -{ -#if USE_ACL && HAVE_ACL_SET_FILE && HAVE_ACL_FREE - /* POSIX 1003.1e draft 17 (abandoned) specific version. */ - - /* We must also have have_acl_from_text and acl_delete_def_file. - (acl_delete_def_file could be emulated with acl_init followed - by acl_set_file, but acl_set_file with an empty acl is - unspecified.) */ - -# ifndef HAVE_ACL_FROM_TEXT -# error Must have acl_from_text (see POSIX 1003.1e draft 17). -# endif -# ifndef HAVE_ACL_DELETE_DEF_FILE -# error Must have acl_delete_def_file (see POSIX 1003.1e draft 17). -# endif - - acl_t acl; - int ret; - - if (HAVE_ACL_FROM_MODE) - { - acl = acl_from_mode (mode); - if (!acl) - { - error (0, errno, "%s", quote (name)); - return -1; - } - } - else - { - char acl_text[] = "u::---,g::---,o::---"; - - if (mode & S_IRUSR) acl_text[ 3] = 'r'; - if (mode & S_IWUSR) acl_text[ 4] = 'w'; - if (mode & S_IXUSR) acl_text[ 5] = 'x'; - if (mode & S_IRGRP) acl_text[10] = 'r'; - if (mode & S_IWGRP) acl_text[11] = 'w'; - if (mode & S_IXGRP) acl_text[12] = 'x'; - if (mode & S_IROTH) acl_text[17] = 'r'; - if (mode & S_IWOTH) acl_text[18] = 'w'; - if (mode & S_IXOTH) acl_text[19] = 'x'; - - acl = acl_from_text (acl_text); - if (!acl) - { - error (0, errno, "%s", quote (name)); - return -1; - } - } - if (HAVE_ACL_SET_FD && desc != -1) - ret = acl_set_fd (desc, acl); - else - ret = acl_set_file (name, ACL_TYPE_ACCESS, acl); - if (ret != 0) - { - int saved_errno = errno; - acl_free (acl); - - if (ACL_NOT_WELL_SUPPORTED (errno)) - { - if (chmod_or_fchmod (name, desc, mode) != 0) - saved_errno = errno; - else - return 0; - } - error (0, saved_errno, _("setting permissions for %s"), quote (name)); - return -1; - } - else - acl_free (acl); - - if (S_ISDIR (mode) && acl_delete_def_file (name)) - { - error (0, errno, _("setting permissions for %s"), quote (name)); - return -1; - } - - if (mode & (S_ISUID | S_ISGID | S_ISVTX)) - { - /* We did not call chmod so far, so the special bits have not yet - been set. */ - - if (chmod_or_fchmod (name, desc, mode)) - { - error (0, errno, _("preserving permissions for %s"), quote (name)); - return -1; - } - } - return 0; -#else - int ret = chmod_or_fchmod (name, desc, mode); - if (ret) - error (0, errno, _("setting permissions for %s"), quote (name)); - return ret; -#endif -} diff --git a/src/bin/coreutils/lib/acl.h b/src/bin/coreutils/lib/acl.h index 18fb7324d0..fcb00f5ae1 100644 --- a/src/bin/coreutils/lib/acl.h +++ b/src/bin/coreutils/lib/acl.h @@ -1,11 +1,11 @@ /* acl.c - access control lists - Copyright (C) 2002 Free Software Foundation, Inc. + Copyright (C) 2002, 2008 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,23 +13,15 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + along with this program. If not, see . Written by Paul Eggert. */ #include - -#if HAVE_SYS_ACL_H -# include -#endif -#if defined HAVE_ACL && ! defined GETACLCNT && defined ACL_CNT -# define GETACLCNT ACL_CNT -#endif - #include int file_has_acl (char const *, struct stat const *); int copy_acl (char const *, int, char const *, int, mode_t); int set_acl (char const *, int, mode_t); +int qset_acl (char const *, int, mode_t); int chmod_or_fchmod (char const *, int, mode_t); diff --git a/src/bin/coreutils/lib/acl_entries.c b/src/bin/coreutils/lib/acl_entries.c index 25c8bb8250..12e85e565d 100644 --- a/src/bin/coreutils/lib/acl_entries.c +++ b/src/bin/coreutils/lib/acl_entries.c @@ -1,11 +1,11 @@ /* Return the number of entries in an ACL. - Copyright (C) 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc. + Copyright (C) 2002-2003, 2005-2009 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + along with this program. If not, see . Written by Paul Eggert and Andreas Gruenbacher. */ @@ -22,18 +21,55 @@ #include "acl-internal.h" -/* Return the number of entries in ACL. */ +/* This file assumes POSIX-draft like ACLs + (Linux, FreeBSD, MacOS X, IRIX, Tru64). */ + +/* Return the number of entries in ACL. + Return -1 and set errno upon failure to determine it. */ int acl_entries (acl_t acl) { - char *t; - int entries = 0; - char *text = acl_to_text (acl, NULL); - if (! text) - return -1; - for (t = text; *t; t++) - entries += (*t == '\n'); - acl_free (text); - return entries; + int count = 0; + + if (acl != NULL) + { +#if HAVE_ACL_FIRST_ENTRY /* Linux, FreeBSD, MacOS X */ +# if HAVE_ACL_TYPE_EXTENDED /* MacOS X */ + /* acl_get_entry returns 0 when it successfully fetches an entry, + and -1/EINVAL at the end. */ + acl_entry_t ace; + int got_one; + + for (got_one = acl_get_entry (acl, ACL_FIRST_ENTRY, &ace); + got_one >= 0; + got_one = acl_get_entry (acl, ACL_NEXT_ENTRY, &ace)) + count++; +# else /* Linux, FreeBSD */ + /* acl_get_entry returns 1 when it successfully fetches an entry, + and 0 at the end. */ + acl_entry_t ace; + int got_one; + + for (got_one = acl_get_entry (acl, ACL_FIRST_ENTRY, &ace); + got_one > 0; + got_one = acl_get_entry (acl, ACL_NEXT_ENTRY, &ace)) + count++; + if (got_one < 0) + return -1; +# endif +#else /* IRIX, Tru64 */ +# if HAVE_ACL_TO_SHORT_TEXT /* IRIX */ + /* Don't use acl_get_entry: it is undocumented. */ + count = acl->acl_cnt; +# endif +# if HAVE_ACL_FREE_TEXT /* Tru64 */ + /* Don't use acl_get_entry: it takes only one argument and does not + work. */ + count = acl->acl_num; +# endif +#endif + } + + return count; } diff --git a/src/bin/coreutils/lib/alloca.c b/src/bin/coreutils/lib/alloca.c index 3a1f4e273a..4083ab1132 100644 --- a/src/bin/coreutils/lib/alloca.c +++ b/src/bin/coreutils/lib/alloca.c @@ -1,3 +1,6 @@ +/* -*- buffer-read-only: t -*- vi: set ro: */ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 /* alloca.c -- allocate automatically reclaimed memory (Mostly) portable public-domain implementation -- D A Gwyn @@ -486,4 +489,4 @@ i00afunc (long address) # endif /* CRAY */ # endif /* no alloca */ -#endif /* not GCC version 2 */ +#endif /* not GCC version 3 */ diff --git a/src/bin/coreutils/lib/alloca_.h b/src/bin/coreutils/lib/alloca.in.h similarity index 82% rename from src/bin/coreutils/lib/alloca_.h rename to src/bin/coreutils/lib/alloca.in.h index dd0b3e98f5..ed33a8233f 100644 --- a/src/bin/coreutils/lib/alloca_.h +++ b/src/bin/coreutils/lib/alloca.in.h @@ -1,11 +1,14 @@ +/* -*- buffer-read-only: t -*- vi: set ro: */ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 /* Memory allocation on the stack. - Copyright (C) 1995, 1999, 2001, 2002, 2003, 2004, 2006 Free Software + Copyright (C) 1995, 1999, 2001-2004, 2006-2008 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published - by the Free Software Foundation; either version 2, or (at your option) + by the Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -20,8 +23,8 @@ /* Avoid using the symbol _ALLOCA_H here, as Bison assumes _ALLOCA_H means there is a real alloca function. */ -#ifndef _GNULIB_ALLOCA_H -# define _GNULIB_ALLOCA_H +#ifndef _GL_ALLOCA_H +#define _GL_ALLOCA_H /* alloca (N) returns a pointer to N bytes of memory allocated on the stack, which will last until the function returns. @@ -42,6 +45,8 @@ # elif defined _MSC_VER # include # define alloca _alloca +# elif defined __DECC && defined __VMS +# define alloca __ALLOCA # else # include # ifdef __cplusplus @@ -51,4 +56,4 @@ void *alloca (size_t); # endif #endif -#endif /* _GNULIB_ALLOCA_H */ +#endif /* _GL_ALLOCA_H */ diff --git a/src/bin/coreutils/lib/xreadlink-with-size.c b/src/bin/coreutils/lib/areadlink-with-size.c similarity index 71% rename from src/bin/coreutils/lib/xreadlink-with-size.c rename to src/bin/coreutils/lib/areadlink-with-size.c index 5524a8ac4d..d0bcb70ad5 100644 --- a/src/bin/coreutils/lib/xreadlink-with-size.c +++ b/src/bin/coreutils/lib/areadlink-with-size.c @@ -1,12 +1,12 @@ -/* xreadlink.c -- readlink wrapper to return the link name in malloc'd storage +/* readlink wrapper to return the link name in malloc'd storage. + Unlike xreadlink and xreadlink_with_size, don't ever call exit. - Copyright (C) 2001, 2003, 2004, 2005, 2006, 2007 Free Software - Foundation, Inc. + Copyright (C) 2001, 2003-2007 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,15 +14,13 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. - If not, write to the Free Software Foundation, - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Jim Meyering */ #include -#include "xreadlink.h" +#include "areadlink.h" #include #include @@ -47,18 +45,15 @@ #define MAXSIZE (SIZE_MAX < SSIZE_MAX ? SIZE_MAX : SSIZE_MAX) -#include "xalloc.h" - /* Call readlink to get the symbolic link value of FILE. SIZE is a hint as to how long the link is expected to be; typically it is taken from st_size. It need not be correct. Return a pointer to that NUL-terminated string in malloc'd storage. - If readlink fails, return NULL (caller may use errno to diagnose). - If malloc fails, or if the link value is longer than SSIZE_MAX :-), - give a diagnostic and exit. */ + If readlink fails, malloc fails, or if the link value is longer + than SSIZE_MAX, return NULL (caller may use errno to diagnose). */ char * -xreadlink_with_size (char const *file, size_t size) +areadlink_with_size (char const *file, size_t size) { /* Some buggy file systems report garbage in st_size. Defend against them by ignoring outlandish st_size values in the initial @@ -74,9 +69,14 @@ xreadlink_with_size (char const *file, size_t size) while (1) { - char *buffer = xmalloc (buf_size); - ssize_t r = readlink (file, buffer, buf_size); - size_t link_length = r; + ssize_t r; + size_t link_length; + char *buffer = malloc (buf_size); + + if (buffer == NULL) + return NULL; + r = readlink (file, buffer, buf_size); + link_length = r; /* On AIX 5L v5.3 and HP-UX 11i v2 04/09, readlink returns -1 with errno == ERANGE if the buffer is too small. */ @@ -100,6 +100,9 @@ xreadlink_with_size (char const *file, size_t size) else if (buf_size < MAXSIZE) buf_size = MAXSIZE; else - xalloc_die (); + { + errno = ENOMEM; + return NULL; + } } } diff --git a/src/bin/coreutils/lib/areadlink.h b/src/bin/coreutils/lib/areadlink.h new file mode 100644 index 0000000000..8720ed9a61 --- /dev/null +++ b/src/bin/coreutils/lib/areadlink.h @@ -0,0 +1,23 @@ +/* Read symbolic links without size limitation. + + Copyright (C) 2001, 2003, 2004, 2007 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* Written by Jim Meyering */ + +#include + +extern char *areadlink (char const *filename); +extern char *areadlink_with_size (char const *filename, size_t size_hint); diff --git a/src/bin/coreutils/lib/argmatch.c b/src/bin/coreutils/lib/argmatch.c index 72d92483ec..925449bfd4 100644 --- a/src/bin/coreutils/lib/argmatch.c +++ b/src/bin/coreutils/lib/argmatch.c @@ -3,10 +3,10 @@ Copyright (C) 1990, 1998, 1999, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by David MacKenzie Modified by Akim Demaille */ diff --git a/src/bin/coreutils/lib/argmatch.h b/src/bin/coreutils/lib/argmatch.h index f2dfe59bda..cc403145ac 100644 --- a/src/bin/coreutils/lib/argmatch.h +++ b/src/bin/coreutils/lib/argmatch.h @@ -3,10 +3,10 @@ Copyright (C) 1990, 1998, 1999, 2001, 2002, 2004, 2005 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by David MacKenzie Modified by Akim Demaille */ diff --git a/src/bin/coreutils/lib/argv-iter.c b/src/bin/coreutils/lib/argv-iter.c new file mode 100644 index 0000000000..4c79b109f5 --- /dev/null +++ b/src/bin/coreutils/lib/argv-iter.c @@ -0,0 +1,117 @@ +/* Iterate over arguments from argv or --files0-from=FILE + Copyright (C) 2008 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* Written by Jim Meyering. */ + +#include +#include "argv-iter.h" + +#include +#include + +struct argv_iterator +{ + /* Test FP to determine whether in read-mode or argv-mode. */ + /* file-mode: fp records position */ + FILE *fp; + size_t item_idx; + char *tok; + size_t buf_len; + + /* argv-mode: record just argv and current pointer */ + char **arg_list; + char **p; +}; + +struct argv_iterator * +argv_iter_init_argv (char **argv) +{ + struct argv_iterator *ai = malloc (sizeof *ai); + if (!ai) + return NULL; + ai->fp = NULL; + ai->arg_list = argv; + ai->p = argv; + return ai; +} + +/* Initialize to read from the stream, FP. + The input is expected to contain a list of NUL-delimited tokens. */ +struct argv_iterator * +argv_iter_init_stream (FILE *fp) +{ + struct argv_iterator *ai = malloc (sizeof *ai); + if (!ai) + return NULL; + ai->fp = fp; + ai->tok = NULL; + ai->buf_len = 0; + + ai->item_idx = 0; + ai->arg_list = NULL; + return ai; +} + +char * +argv_iter (struct argv_iterator *ai, enum argv_iter_err *err) +{ + if (ai->fp) + { + ssize_t len = getdelim (&ai->tok, &ai->buf_len, '\0', ai->fp); + if (len < 0) + { + *err = feof (ai->fp) ? AI_ERR_EOF : AI_ERR_READ; + return NULL; + } + + *err = AI_ERR_OK; + ai->item_idx++; + return ai->tok; + } + else + { + if (*(ai->p) == NULL) + { + *err = AI_ERR_EOF; + return NULL; + } + else + { + *err = AI_ERR_OK; + return *(ai->p++); + } + } +} + +size_t +argv_iter_n_args (struct argv_iterator const *ai) +{ + return ai->fp ? ai->item_idx : ai->p - ai->arg_list; +} + +void +argv_iter_free (struct argv_iterator *ai) +{ + if (ai->fp) + free (ai->tok); + free (ai); +} + +/* + * Local variables: + * indent-tabs-mode: nil + * End: + */ diff --git a/src/bin/coreutils/lib/argv-iter.h b/src/bin/coreutils/lib/argv-iter.h new file mode 100644 index 0000000000..537fb1ea29 --- /dev/null +++ b/src/bin/coreutils/lib/argv-iter.h @@ -0,0 +1,47 @@ +/* Iterate over arguments from argv or --files0-from=FILE + Copyright (C) 2008-2009 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#include +#include + +struct argv_iterator; +enum argv_iter_err; + +#undef _ATTRIBUTE_NONNULL_ +#if __GNUC__ == 3 && __GNUC_MINOR__ >= 3 || 3 < __GNUC__ +# define _ATTRIBUTE_NONNULL_(m) __attribute__ ((__nonnull__ (m))) +#else +# define _ATTRIBUTE_NONNULL_(m) +#endif + +enum argv_iter_err +{ + AI_ERR_OK = 1, + AI_ERR_EOF, + AI_ERR_MEM, + AI_ERR_READ +}; + +struct argv_iterator *argv_iter_init_argv (char **argv) + _ATTRIBUTE_NONNULL_ (1); +struct argv_iterator *argv_iter_init_stream (FILE *fp) + _ATTRIBUTE_NONNULL_ (1); +char *argv_iter (struct argv_iterator *, enum argv_iter_err *) + _ATTRIBUTE_NONNULL_ (1) _ATTRIBUTE_NONNULL_ (2); +size_t argv_iter_n_args (struct argv_iterator const *) + _ATTRIBUTE_NONNULL_ (1); +void argv_iter_free (struct argv_iterator *) + _ATTRIBUTE_NONNULL_ (1); diff --git a/src/bin/coreutils/lib/inet_ntop.h b/src/bin/coreutils/lib/arpa_inet.in.h similarity index 51% rename from src/bin/coreutils/lib/inet_ntop.h rename to src/bin/coreutils/lib/arpa_inet.in.h index bd1e085aed..090b117c57 100644 --- a/src/bin/coreutils/lib/inet_ntop.h +++ b/src/bin/coreutils/lib/arpa_inet.in.h @@ -1,9 +1,13 @@ -/* Convert internet address from internal to printable, presentable format. - Copyright (C) 2005, 2006 Free Software Foundation, Inc. +/* -*- buffer-read-only: t -*- vi: set ro: */ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 +/* A GNU-like . + + Copyright (C) 2005-2006, 2008 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) + the Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -15,11 +19,34 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include -#include -#include -#include +#ifndef _GL_ARPA_INET_H +/* Gnulib's sys/socket.h is responsible for pulling in winsock2.h etc + under MinGW. */ +#include + +#if @HAVE_ARPA_INET_H@ + +# if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +# endif + +/* The include_next requires a split double-inclusion guard. */ +# @INCLUDE_NEXT@ @NEXT_ARPA_INET_H@ + +#endif + +#ifndef _GL_ARPA_INET_H +#define _GL_ARPA_INET_H + +/* The definition of GL_LINK_WARNING is copied here. */ + +#ifdef __cplusplus +extern "C" { +#endif + +#if @GNULIB_INET_NTOP@ +# if !@HAVE_DECL_INET_NTOP@ /* Converts an internet address from internal format to a printable, presentable format. AF is an internet address family, such as AF_INET or AF_INET6. @@ -35,8 +62,32 @@ For more details, see the POSIX:2001 specification . */ - -#if !HAVE_DECL_INET_NTOP extern const char *inet_ntop (int af, const void *restrict src, char *restrict dst, socklen_t cnt); +# endif +#elif defined GNULIB_POSIXCHECK +# undef inet_ntop +# define inet_ntop(af,src,dst,cnt) \ + (GL_LINK_WARNING ("inet_ntop is unportable - " \ + "use gnulib module inet_ntop for portability"), \ + inet_ntop (af, src, dst, cnt)) #endif + +#if @GNULIB_INET_PTON@ +# if !@HAVE_DECL_INET_PTON@ +extern int inet_pton (int af, const char *restrict src, void *restrict dst); +# endif +#elif defined GNULIB_POSIXCHECK +# undef inet_pton +# define inet_pton(af,src,dst) \ + (GL_LINK_WARNING ("inet_pton is unportable - " \ + "use gnulib module inet_pton for portability"), \ + inet_pton (af, src, dst)) +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* _GL_ARPA_INET_H */ +#endif /* _GL_ARPA_INET_H */ diff --git a/src/bin/coreutils/lib/asnprintf.c b/src/bin/coreutils/lib/asnprintf.c index 26c3988b01..d2ad8db272 100644 --- a/src/bin/coreutils/lib/asnprintf.c +++ b/src/bin/coreutils/lib/asnprintf.c @@ -1,9 +1,12 @@ +/* -*- buffer-read-only: t -*- vi: set ro: */ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 /* Formatted output to strings. Copyright (C) 1999, 2002, 2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) + the Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/src/bin/coreutils/lib/asprintf.c b/src/bin/coreutils/lib/asprintf.c index 29ac6cf2d1..51ccf4973b 100644 --- a/src/bin/coreutils/lib/asprintf.c +++ b/src/bin/coreutils/lib/asprintf.c @@ -1,9 +1,12 @@ +/* -*- buffer-read-only: t -*- vi: set ro: */ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 /* Formatted output to strings. - Copyright (C) 1999, 2002, 2006 Free Software Foundation, Inc. + Copyright (C) 1999, 2002, 2006-2007 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) + the Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -18,7 +21,11 @@ #include /* Specification. */ -#include "vasprintf.h" +#ifdef IN_LIBASPRINTF +# include "vasprintf.h" +#else +# include +#endif #include diff --git a/src/bin/coreutils/lib/at-func.c b/src/bin/coreutils/lib/at-func.c index f98c207e72..c7963fe3d2 100644 --- a/src/bin/coreutils/lib/at-func.c +++ b/src/bin/coreutils/lib/at-func.c @@ -1,10 +1,10 @@ /* Define an at-style functions like fstatat, unlinkat, fchownat, etc. Copyright (C) 2006 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* written by Jim Meyering */ diff --git a/src/bin/coreutils/lib/backupfile.c b/src/bin/coreutils/lib/backupfile.c index adfc0e5411..1420edd8cd 100644 --- a/src/bin/coreutils/lib/backupfile.c +++ b/src/bin/coreutils/lib/backupfile.c @@ -4,10 +4,10 @@ 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -15,9 +15,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. - If not, write to the Free Software Foundation, - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Paul Eggert and David MacKenzie. Some algorithms adapted from GNU Emacs. */ diff --git a/src/bin/coreutils/lib/backupfile.h b/src/bin/coreutils/lib/backupfile.h index 7b44e58063..3cfdd8c687 100644 --- a/src/bin/coreutils/lib/backupfile.h +++ b/src/bin/coreutils/lib/backupfile.h @@ -3,10 +3,10 @@ Copyright (C) 1990, 1991, 1992, 1997, 1998, 1999, 2003, 2004 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,9 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. - If not, write to the Free Software Foundation, - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ #ifndef BACKUPFILE_H_ # define BACKUPFILE_H_ diff --git a/src/bin/coreutils/lib/base64.c b/src/bin/coreutils/lib/base64.c index 531290218a..866a596c90 100644 --- a/src/bin/coreutils/lib/base64.c +++ b/src/bin/coreutils/lib/base64.c @@ -1,12 +1,13 @@ /* -*- buffer-read-only: t -*- vi: set ro: */ /* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 /* base64.c -- Encode binary data using printable characters. - Copyright (C) 1999, 2000, 2001, 2004, 2005, 2006, 2007 Free Software + Copyright (C) 1999, 2000, 2001, 2004, 2005, 2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) + the Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -452,20 +453,32 @@ decode_4 (char const *restrict in, size_t inlen, Initially, CTX must have been initialized via base64_decode_ctx_init. Subsequent calls to this function must reuse whatever state is recorded in that buffer. It is necessary for when a quadruple of base64 input - bytes spans two input buffers. */ + bytes spans two input buffers. + + If CTX is NULL then newlines are treated as garbage and the input + buffer is processed as a unit. */ bool -base64_decode (struct base64_decode_context *ctx, - const char *restrict in, size_t inlen, - char *restrict out, size_t *outlen) +base64_decode_ctx (struct base64_decode_context *ctx, + const char *restrict in, size_t inlen, + char *restrict out, size_t *outlen) { size_t outleft = *outlen; - bool flush_ctx = inlen == 0; + bool ignore_newlines = ctx != NULL; + bool flush_ctx = false; + unsigned int ctx_i = 0; + + if (ignore_newlines) + { + ctx_i = ctx->i; + flush_ctx = inlen == 0; + } + while (true) { size_t outleft_save = outleft; - if (ctx->i == 0 && !flush_ctx) + if (ctx_i == 0 && !flush_ctx) { while (true) { @@ -485,7 +498,7 @@ base64_decode (struct base64_decode_context *ctx, /* Handle the common case of 72-byte wrapped lines. This also handles any other multiple-of-4-byte wrapping. */ - if (inlen && *in == '\n') + if (inlen && *in == '\n' && ignore_newlines) { ++in; --inlen; @@ -498,12 +511,17 @@ base64_decode (struct base64_decode_context *ctx, { char const *in_end = in + inlen; - char const *non_nl = get_4 (ctx, &in, in_end, &inlen); + char const *non_nl; + + if (ignore_newlines) + non_nl = get_4 (ctx, &in, in_end, &inlen); + else + non_nl = in; /* Might have nl in this case. */ /* If the input is empty or consists solely of newlines (0 non-newlines), then we're done. Likewise if there are fewer than 4 bytes when not - flushing context. */ - if (inlen == 0 || (inlen < 4 && !flush_ctx)) + flushing context and not treating newlines as garbage. */ + if (inlen == 0 || (inlen < 4 && !flush_ctx && ignore_newlines)) { inlen = 0; break; @@ -532,9 +550,9 @@ base64_decode (struct base64_decode_context *ctx, input was invalid, in which case *OUT is NULL and *OUTLEN is undefined. */ bool -base64_decode_alloc (struct base64_decode_context *ctx, - const char *in, size_t inlen, char **out, - size_t *outlen) +base64_decode_alloc_ctx (struct base64_decode_context *ctx, + const char *in, size_t inlen, char **out, + size_t *outlen) { /* This may allocate a few bytes too many, depending on input, but it's not worth the extra CPU time to compute the exact size. @@ -547,7 +565,7 @@ base64_decode_alloc (struct base64_decode_context *ctx, if (!*out) return true; - if (!base64_decode (ctx, in, inlen, *out, &needlen)) + if (!base64_decode_ctx (ctx, in, inlen, *out, &needlen)) { free (*out); *out = NULL; diff --git a/src/bin/coreutils/lib/base64.h b/src/bin/coreutils/lib/base64.h index 0399edf753..a7e01598ac 100644 --- a/src/bin/coreutils/lib/base64.h +++ b/src/bin/coreutils/lib/base64.h @@ -1,12 +1,13 @@ /* -*- buffer-read-only: t -*- vi: set ro: */ /* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 /* base64.h -- Encode binary data using printable characters. Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc. Written by Simon Josefsson. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) + the Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -45,12 +46,19 @@ extern void base64_encode (const char *restrict in, size_t inlen, extern size_t base64_encode_alloc (const char *in, size_t inlen, char **out); extern void base64_decode_ctx_init (struct base64_decode_context *ctx); -extern bool base64_decode (struct base64_decode_context *ctx, - const char *restrict in, size_t inlen, - char *restrict out, size_t *outlen); -extern bool base64_decode_alloc (struct base64_decode_context *ctx, - const char *in, size_t inlen, - char **out, size_t *outlen); +extern bool base64_decode_ctx (struct base64_decode_context *ctx, + const char *restrict in, size_t inlen, + char *restrict out, size_t *outlen); + +extern bool base64_decode_alloc_ctx (struct base64_decode_context *ctx, + const char *in, size_t inlen, + char **out, size_t *outlen); + +#define base64_decode(in, inlen, out, outlen) \ + base64_decode_ctx (NULL, in, inlen, out, outlen) + +#define base64_decode_alloc(in, inlen, out, outlen) \ + base64_decode_alloc_ctx (NULL, in, inlen, out, outlen) #endif /* BASE64_H */ diff --git a/src/bin/coreutils/lib/basename.c b/src/bin/coreutils/lib/basename.c index fbe17ff910..426ed40f1a 100644 --- a/src/bin/coreutils/lib/basename.c +++ b/src/bin/coreutils/lib/basename.c @@ -3,10 +3,10 @@ Copyright (C) 1990, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ #include diff --git a/src/bin/coreutils/lib/btowc.c b/src/bin/coreutils/lib/btowc.c new file mode 100644 index 0000000000..7f3b9663c4 --- /dev/null +++ b/src/bin/coreutils/lib/btowc.c @@ -0,0 +1,38 @@ +/* Convert unibyte character to wide character. + Copyright (C) 2008 Free Software Foundation, Inc. + Written by Bruno Haible , 2008. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#include + +/* Specification. */ +#include + +#include + +wint_t +btowc (int c) +{ + if (c != EOF) + { + char buf[1]; + wchar_t wc; + + buf[0] = c; + if (mbtowc (&wc, buf, 1) >= 0) + return wc; + } + return WEOF; +} diff --git a/src/bin/coreutils/lib/buffer-lcm.c b/src/bin/coreutils/lib/buffer-lcm.c index c3f610943e..9f4505672d 100644 --- a/src/bin/coreutils/lib/buffer-lcm.c +++ b/src/bin/coreutils/lib/buffer-lcm.c @@ -2,10 +2,10 @@ Copyright (C) 2002, 2005 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Paul Eggert. */ diff --git a/src/bin/coreutils/lib/c-ctype.c b/src/bin/coreutils/lib/c-ctype.c index 36569b818e..d1ca044531 100644 --- a/src/bin/coreutils/lib/c-ctype.c +++ b/src/bin/coreutils/lib/c-ctype.c @@ -1,10 +1,13 @@ +/* -*- buffer-read-only: t -*- vi: set ro: */ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 /* Character handling in C locale. Copyright 2000-2003, 2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or +the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/src/bin/coreutils/lib/c-ctype.h b/src/bin/coreutils/lib/c-ctype.h index b26eccfb3d..825e6bb305 100644 --- a/src/bin/coreutils/lib/c-ctype.h +++ b/src/bin/coreutils/lib/c-ctype.h @@ -1,3 +1,6 @@ +/* -*- buffer-read-only: t -*- vi: set ro: */ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 /* Character handling in C locale. These functions work like the corresponding functions in , @@ -5,11 +8,11 @@ functions' behaviour depends on the current locale set via setlocale. - Copyright (C) 2000-2003, 2006 Free Software Foundation, Inc. + Copyright (C) 2000-2003, 2006, 2008 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or +the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -103,6 +106,21 @@ extern "C" { /* Function declarations. */ +/* Unlike the functions in , which require an argument in the range + of the 'unsigned char' type, the functions here operate on values that are + in the 'unsigned char' range or in the 'char' range. In other words, + when you have a 'char' value, you need to cast it before using it as + argument to a function: + + const char *s = ...; + if (isalpha ((unsigned char) *s)) ... + + but you don't need to cast it for the functions defined in this file: + + const char *s = ...; + if (c_isalpha (*s)) ... + */ + extern bool c_isascii (int c); /* not locale dependent */ extern bool c_isalnum (int c); diff --git a/src/bin/coreutils/lib/c-strcase.h b/src/bin/coreutils/lib/c-strcase.h index 1ababffe84..65c5ed5d2c 100644 --- a/src/bin/coreutils/lib/c-strcase.h +++ b/src/bin/coreutils/lib/c-strcase.h @@ -1,9 +1,12 @@ +/* -*- buffer-read-only: t -*- vi: set ro: */ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 /* Case-insensitive string comparison functions in C locale. Copyright (C) 1995-1996, 2001, 2003, 2005 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) + the Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/src/bin/coreutils/lib/c-strcasecmp.c b/src/bin/coreutils/lib/c-strcasecmp.c index 13b15f989c..acebbb5f35 100644 --- a/src/bin/coreutils/lib/c-strcasecmp.c +++ b/src/bin/coreutils/lib/c-strcasecmp.c @@ -1,9 +1,12 @@ +/* -*- buffer-read-only: t -*- vi: set ro: */ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 /* c-strcasecmp.c -- case insensitive string comparator in C locale Copyright (C) 1998-1999, 2005-2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) + the Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/src/bin/coreutils/lib/c-strncasecmp.c b/src/bin/coreutils/lib/c-strncasecmp.c index 274e9b7ea0..1537069d18 100644 --- a/src/bin/coreutils/lib/c-strncasecmp.c +++ b/src/bin/coreutils/lib/c-strncasecmp.c @@ -1,9 +1,12 @@ +/* -*- buffer-read-only: t -*- vi: set ro: */ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 /* c-strncasecmp.c -- case insensitive string comparator in C locale Copyright (C) 1998-1999, 2005-2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) + the Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/src/bin/coreutils/lib/c-strtod.c b/src/bin/coreutils/lib/c-strtod.c index 2234ed0f8d..51e996e5da 100644 --- a/src/bin/coreutils/lib/c-strtod.c +++ b/src/bin/coreutils/lib/c-strtod.c @@ -1,11 +1,11 @@ /* Convert string to double, using the C locale. - Copyright (C) 2003, 2004, 2006 Free Software Foundation, Inc. + Copyright (C) 2003, 2004, 2006, 2009 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Paul Eggert. */ @@ -22,10 +21,10 @@ #include "c-strtod.h" +#include #include #include - -#include "xalloc.h" +#include #if LONG # define C_STRTOD c_strtold @@ -44,6 +43,25 @@ # define STRTOD strtod #endif +#ifdef LC_ALL_MASK + +/* Cache for the C locale object. + Marked volatile so that different threads see the same value + (avoids locking). */ +static volatile locale_t c_locale_cache; + +/* Return the C locale object, or (locale_t) 0 with errno set + if it cannot be created. */ +static inline locale_t +c_locale (void) +{ + if (!c_locale_cache) + c_locale_cache = newlocale (LC_ALL_MASK, "C", (locale_t) 0); + return c_locale_cache; +} + +#endif + DOUBLE C_STRTOD (char const *nptr, char **endptr) { @@ -51,9 +69,15 @@ C_STRTOD (char const *nptr, char **endptr) #ifdef LC_ALL_MASK - locale_t c_locale = newlocale (LC_ALL_MASK, "C", 0); - r = STRTOD_L (nptr, endptr, c_locale); - freelocale (c_locale); + locale_t locale = c_locale (); + if (!locale) + { + if (endptr) + *endptr = (char *) nptr; + return 0; /* errno is set here */ + } + + r = STRTOD_L (nptr, endptr, locale); #else @@ -61,7 +85,13 @@ C_STRTOD (char const *nptr, char **endptr) if (saved_locale) { - saved_locale = xstrdup (saved_locale); + saved_locale = strdup (saved_locale); + if (saved_locale == NULL) + { + if (endptr) + *endptr = (char *) nptr; + return 0; /* errno is set here */ + } setlocale (LC_NUMERIC, "C"); } @@ -69,8 +99,11 @@ C_STRTOD (char const *nptr, char **endptr) if (saved_locale) { + int saved_errno = errno; + setlocale (LC_NUMERIC, saved_locale); free (saved_locale); + errno = saved_errno; } #endif diff --git a/src/bin/coreutils/lib/c-strtod.h b/src/bin/coreutils/lib/c-strtod.h index ca9a9e7c2c..2b3f84735a 100644 --- a/src/bin/coreutils/lib/c-strtod.h +++ b/src/bin/coreutils/lib/c-strtod.h @@ -1,2 +1,37 @@ -double c_strtod (char const *, char **); -long double c_strtold (char const *, char **); +/* Convert string to double, using the C locale. + + Copyright (C) 2003-2004, 2009 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* Parse the initial portion of the string pointed to by NPTR as a floating- + point number (in decimal or hexadecimal notation), like in the C locale: + accepting only the ASCII digits '0'..'9', and only '.' as decimal point + character. + If ENDPTR is not NULL, set *ENDPTR to point to the first byte beyond the + parsed number or to NPTR if the string does not start with a parseable + number. + Return value: + - If successful, return the value as a double or 'long double', + respectively, and don't modify errno. + - In case of overflow, return ±HUGE_VAL or ±HUGE_VALL, respectively, and + set errno to ERANGE. + - In case of underflow, return a value very near to 0 and set errno to + ERANGE. + - If the string does not start with a number at all, return 0 (and recall + that if ENDPTR != NULL, *ENDPTR is set to NPTR), and maybe set errno to + EINVAL. + - In case of other error, return 0 and set errno, for example to ENOMEM. */ +extern double c_strtod (char const *nptr, char **endptr); +extern long double c_strtold (char const *nptr, char **endptr); diff --git a/src/bin/coreutils/lib/calloc.c b/src/bin/coreutils/lib/calloc.c index c8b1e1ebab..554a58da93 100644 --- a/src/bin/coreutils/lib/calloc.c +++ b/src/bin/coreutils/lib/calloc.c @@ -1,11 +1,11 @@ /* calloc() function that is glibc compatible. - This wrapper function is required at least on Tru64 UNIX 5.1. - Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc. + This wrapper function is required at least on Tru64 UNIX 5.1 and mingw. + Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,32 +13,58 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ -/* written by Jim Meyering */ +/* written by Jim Meyering and Bruno Haible */ #include -#undef calloc +/* Only the AC_FUNC_CALLOC macro defines 'calloc' already in config.h. */ +#ifdef calloc +# define NEED_CALLOC_GNU +# undef calloc +#endif +/* Specification. */ #include +#include + +/* Call the system's calloc below. */ +#undef calloc + /* Allocate and zero-fill an NxS-byte block of memory from the heap. If N or S is zero, allocate and zero-fill a 1-byte block. */ void * rpl_calloc (size_t n, size_t s) { - size_t bytes; + void *result; +#ifdef NEED_CALLOC_GNU if (n == 0 || s == 0) - return calloc (1, 1); + { + n = 1; + s = 1; + } + else + { + /* Defend against buggy calloc implementations that mishandle + size_t overflow. */ + size_t bytes = n * s; + if (bytes / s != n) + { + errno = ENOMEM; + return NULL; + } + } +#endif - /* Defend against buggy calloc implementations that mishandle - size_t overflow. */ - bytes = n * s; - if (bytes / s != n) - return NULL; + result = calloc (n, s); - return calloc (n, s); +#if !HAVE_CALLOC_POSIX + if (result == NULL) + errno = ENOMEM; +#endif + + return result; } diff --git a/src/bin/coreutils/lib/canon-host.c b/src/bin/coreutils/lib/canon-host.c index 50ba67a6cf..df9cbbfb2e 100644 --- a/src/bin/coreutils/lib/canon-host.c +++ b/src/bin/coreutils/lib/canon-host.c @@ -1,30 +1,28 @@ /* Host name canonicalization - Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc. + Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc. Written by Derek Price . - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License as - published by the Free Software Foundation; either version 2, or (at - your option) any later version. + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ #include #include "canon-host.h" #include - -#include "getaddrinfo.h" +#include /* Store the last error for the single-threaded version of this function. */ static int last_cherror; diff --git a/src/bin/coreutils/lib/canon-host.h b/src/bin/coreutils/lib/canon-host.h index c1f6cb178d..2037f3ebd1 100644 --- a/src/bin/coreutils/lib/canon-host.h +++ b/src/bin/coreutils/lib/canon-host.h @@ -4,19 +4,18 @@ Written by Derek Price - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License as - published by the Free Software Foundation; either version 2, or (at - your option) any later version. + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ #ifndef CANON_HOST_H # define CANON_HOST_H 1 diff --git a/src/bin/coreutils/lib/canonicalize.c b/src/bin/coreutils/lib/canonicalize.c index 48e4a239a3..4f348398fd 100644 --- a/src/bin/coreutils/lib/canonicalize.c +++ b/src/bin/coreutils/lib/canonicalize.c @@ -1,10 +1,10 @@ /* Return the canonical absolute name of a given file. - Copyright (C) 1996-2007 Free Software Foundation, Inc. + Copyright (C) 1996-2008 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,9 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. - If not, write to the Free Software Foundation, - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ #include @@ -34,8 +32,9 @@ #include #include -#include "cycle-check.h" +#include "file-set.h" #include "filenamecat.h" +#include "hash-triple.h" #include "xalloc.h" #include "xgetcwd.h" @@ -47,9 +46,9 @@ #endif #include "pathmax.h" -#include "xreadlink.h" +#include "areadlink.h" -#if !HAVE_CANONICALIZE_FILE_NAME +#if !(HAVE_CANONICALIZE_FILE_NAME || GNULIB_CANONICALIZE_LGPL) /* Return the canonical absolute name of file NAME. A canonical name does not contain any `.', `..' components nor any repeated file name separators ('/') or symlinks. All components must exist. @@ -123,6 +122,30 @@ canonicalize_file_name (const char *name) } #endif /* !HAVE_CANONICALIZE_FILE_NAME */ +/* Return true if we've already seen the triple, . + If *HT is not initialized, initialize it. */ +static bool +seen_triple (Hash_table **ht, char const *filename, struct stat const *st) +{ + if (*ht == NULL) + { + size_t initial_capacity = 7; + *ht = hash_initialize (initial_capacity, + NULL, + triple_hash, + triple_compare_ino_str, + triple_free); + if (*ht == NULL) + xalloc_die (); + } + + if (seen_file (*ht, filename, st)) + return true; + + record_file (*ht, filename, st); + return false; +} + /* Return the canonical absolute name of file NAME. A canonical name does not contain any `.', `..' components nor any repeated file name separators ('/') or symlinks. Whether components must exist @@ -136,7 +159,7 @@ canonicalize_filename_mode (const char *name, canonicalize_mode_t can_mode) char const *end; char const *rname_limit; size_t extra_len = 0; - struct cycle_check_state cycle_state; + Hash_table *ht = NULL; if (name == NULL) { @@ -176,7 +199,6 @@ canonicalize_filename_mode (const char *name, canonicalize_mode_t can_mode) dest = rname + 1; } - cycle_check_init (&cycle_state); for (start = end = name; *start; start = end) { /* Skip sequence of multiple file name separators. */ @@ -237,7 +259,11 @@ canonicalize_filename_mode (const char *name, canonicalize_mode_t can_mode) char *buf; size_t n, len; - if (cycle_check (&cycle_state, &st)) + /* Detect loops. We cannot use the cycle-check module here, + since it's actually possible to encounter the same symlink + more than once in a given traversal. However, encountering + the same symlink,NAME pair twice does indicate a loop. */ + if (seen_triple (&ht, name, &st)) { __set_errno (ELOOP); if (can_mode == CAN_MISSING) @@ -246,10 +272,10 @@ canonicalize_filename_mode (const char *name, canonicalize_mode_t can_mode) goto error; } - buf = xreadlink_with_size (rname, st.st_size); + buf = areadlink_with_size (rname, st.st_size); if (!buf) { - if (can_mode == CAN_MISSING) + if (can_mode == CAN_MISSING && errno != ENOMEM) continue; else goto error; @@ -298,10 +324,14 @@ canonicalize_filename_mode (const char *name, canonicalize_mode_t can_mode) *dest = '\0'; free (extra_buf); + if (ht) + hash_free (ht); return rname; error: free (extra_buf); free (rname); + if (ht) + hash_free (ht); return NULL; } diff --git a/src/bin/coreutils/lib/canonicalize.h b/src/bin/coreutils/lib/canonicalize.h index 5c4d3f1a5e..8ca4fb4226 100644 --- a/src/bin/coreutils/lib/canonicalize.h +++ b/src/bin/coreutils/lib/canonicalize.h @@ -1,10 +1,10 @@ /* Return the canonical absolute name of a given file. Copyright (C) 1996-2007 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,9 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. - If not, write to the Free Software Foundation, - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ #ifndef CANONICALIZE_H_ # define CANONICALIZE_H_ diff --git a/src/bin/coreutils/lib/chdir-long.c b/src/bin/coreutils/lib/chdir-long.c index 3fc7ef2a84..291b58c289 100644 --- a/src/bin/coreutils/lib/chdir-long.c +++ b/src/bin/coreutils/lib/chdir-long.c @@ -1,10 +1,10 @@ /* provide a chdir function that tries not to fail due to ENAMETOOLONG - Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc. + Copyright (C) 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* written by Jim Meyering */ @@ -206,7 +205,6 @@ chdir_long (char *dir) #if TEST_CHDIR -# include # include "closeout.h" # include "error.h" diff --git a/src/bin/coreutils/lib/chdir-long.h b/src/bin/coreutils/lib/chdir-long.h index 4852b40d16..5bf0bbc25c 100644 --- a/src/bin/coreutils/lib/chdir-long.h +++ b/src/bin/coreutils/lib/chdir-long.h @@ -1,10 +1,10 @@ /* provide a chdir function that tries not to fail due to ENAMETOOLONG Copyright (C) 2004, 2005 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Jim Meyering. */ diff --git a/src/bin/coreutils/lib/chown.c b/src/bin/coreutils/lib/chown.c index b7786f6205..3582b04d67 100644 --- a/src/bin/coreutils/lib/chown.c +++ b/src/bin/coreutils/lib/chown.c @@ -3,10 +3,10 @@ Copyright (C) 1997, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* written by Jim Meyering */ diff --git a/src/bin/coreutils/lib/cloexec.c b/src/bin/coreutils/lib/cloexec.c index 6480006a5b..ff8105ba02 100644 --- a/src/bin/coreutils/lib/cloexec.c +++ b/src/bin/coreutils/lib/cloexec.c @@ -2,10 +2,10 @@ Copyright (C) 1991, 2004, 2005, 2006 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + along with this program. If not, see . The code is taken from glibc/manual/llio.texi */ diff --git a/src/bin/coreutils/lib/close-hook.c b/src/bin/coreutils/lib/close-hook.c new file mode 100644 index 0000000000..bd92925ef7 --- /dev/null +++ b/src/bin/coreutils/lib/close-hook.c @@ -0,0 +1,94 @@ +/* -*- buffer-read-only: t -*- vi: set ro: */ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 +/* Hook for making the close() function extensible. + Copyright (C) 2009 Free Software Foundation, Inc. + Written by Bruno Haible , 2009. + + This program is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published + by the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#include + +/* Specification. */ +#include "close-hook.h" + +#include +#include + +#undef close + + +/* Currently, this entire code is only needed for the handling of sockets + on native Windows platforms. */ +#if WINDOWS_SOCKETS + +/* The first and last link in the doubly linked list. + Initially the list is empty. */ +static struct close_hook anchor = { &anchor, &anchor, NULL }; + +int +execute_close_hooks (int fd, const struct close_hook *remaining_list) +{ + if (remaining_list == &anchor) + /* End of list reached. */ + return close (fd); + else + return remaining_list->private_fn (fd, remaining_list->private_next); +} + +int +execute_all_close_hooks (int fd) +{ + return execute_close_hooks (fd, anchor.private_next); +} + +void +register_close_hook (close_hook_fn hook, struct close_hook *link) +{ + if (link->private_next == NULL && link->private_prev == NULL) + { + /* Add the link to the doubly linked list. */ + link->private_next = anchor.private_next; + link->private_prev = &anchor; + link->private_fn = hook; + anchor.private_next->private_prev = link; + anchor.private_next = link; + } + else + { + /* The link is already in use. */ + if (link->private_fn != hook) + abort (); + } +} + +void +unregister_close_hook (struct close_hook *link) +{ + struct close_hook *next = link->private_next; + struct close_hook *prev = link->private_prev; + + if (next != NULL && prev != NULL) + { + /* The link is in use. Remove it from the doubly linked list. */ + prev->private_next = next; + next->private_prev = prev; + /* Clear the link, to mark it unused. */ + link->private_next = NULL; + link->private_prev = NULL; + link->private_fn = NULL; + } +} + +#endif diff --git a/src/bin/coreutils/lib/close-hook.h b/src/bin/coreutils/lib/close-hook.h new file mode 100644 index 0000000000..9e1e966d6f --- /dev/null +++ b/src/bin/coreutils/lib/close-hook.h @@ -0,0 +1,75 @@ +/* -*- buffer-read-only: t -*- vi: set ro: */ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 +/* Hook for making the close() function extensible. + Copyright (C) 2009 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published + by the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + + +#ifndef CLOSE_HOOK_H +#define CLOSE_HOOK_H + +#ifdef __cplusplus +extern "C" { +#endif + + +/* Currently, this entire code is only needed for the handling of sockets + on native Windows platforms. */ +#if WINDOWS_SOCKETS + + +/* An element of the list of close hooks. + The fields of this structure are considered private. */ +struct close_hook +{ + /* Doubly linked list. */ + struct close_hook *private_next; + struct close_hook *private_prev; + /* Function that treats the types of FD that it knows about and calls + execute_close_hooks (FD, REMAINING_LIST) as a fallback. */ + int (*private_fn) (int fd, const struct close_hook *remaining_list); +}; + +/* This type of function closes FD, applying special knowledge for the FD + types it knows about, and calls execute_close_hooks (FD, REMAINING_LIST) + for the other FD types. */ +typedef int (*close_hook_fn) (int fd, const struct close_hook *remaining_list); + +/* Execute the close hooks in REMAINING_LIST. + Return 0 or -1, like close() would do. */ +extern int execute_close_hooks (int fd, const struct close_hook *remaining_list); + +/* Execute all close hooks. + Return 0 or -1, like close() would do. */ +extern int execute_all_close_hooks (int fd); + +/* Add a function to the list of close hooks. + The LINK variable points to a piece of memory which is guaranteed to be + accessible until the corresponding call to unregister_close_hook. */ +extern void register_close_hook (close_hook_fn hook, struct close_hook *link); + +/* Removes a function from the list of close hooks. */ +extern void unregister_close_hook (struct close_hook *link); + + +#endif + + +#ifdef __cplusplus +} +#endif + +#endif /* CLOSE_HOOK_H */ diff --git a/src/bin/coreutils/lib/close-stream.c b/src/bin/coreutils/lib/close-stream.c index 72d0d6816c..59ab616b1e 100644 --- a/src/bin/coreutils/lib/close-stream.c +++ b/src/bin/coreutils/lib/close-stream.c @@ -1,12 +1,12 @@ /* Close a stream, with nicer error checking than fclose's. - Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004, 2006 Free + Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004, 2006, 2007, 2008 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ #include @@ -24,7 +23,7 @@ #include #include -#include "__fpending.h" +#include "fpending.h" #if USE_UNLOCKED_IO # include "unlocked-io.h" @@ -34,6 +33,10 @@ otherwise. A failure might set errno to 0 if the error number cannot be determined. + A failure with errno set to EPIPE may or may not indicate an error + situation worth signaling to the user. See the documentation of the + close_stdout_set_ignore_EPIPE function for details. + If a program writes *anything* to STREAM, that program should close STREAM and make sure that it succeeds before exiting. Otherwise, suppose that you go to the extreme of checking the return status diff --git a/src/bin/coreutils/lib/close.c b/src/bin/coreutils/lib/close.c new file mode 100644 index 0000000000..0e56dcb27f --- /dev/null +++ b/src/bin/coreutils/lib/close.c @@ -0,0 +1,42 @@ +/* close replacement. + Copyright (C) 2008-2009 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#include + +/* Specification. */ +#include + +#include "close-hook.h" + +/* Override close() to call into other gnulib modules. */ + +int +rpl_close (int fd) +#undef close +{ +#if WINDOWS_SOCKETS + int retval = execute_all_close_hooks (fd); +#else + int retval = close (fd); +#endif + +#ifdef FCHDIR_REPLACEMENT + if (retval >= 0) + _gl_unregister_fd (fd); +#endif + + return retval; +} diff --git a/src/bin/coreutils/lib/closein.c b/src/bin/coreutils/lib/closein.c new file mode 100644 index 0000000000..c7fb581eaa --- /dev/null +++ b/src/bin/coreutils/lib/closein.c @@ -0,0 +1,111 @@ +/* Close standard input, rewinding seekable stdin if necessary. + + Copyright (C) 2007 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#include + +#include "closein.h" + +#include +#include +#include +#include + +#include "gettext.h" +#define _(msgid) gettext (msgid) + +#include "close-stream.h" +#include "closeout.h" +#include "error.h" +#include "exitfail.h" +#include "freadahead.h" +#include "quotearg.h" + +static const char *file_name; + +/* Set the file name to be reported in the event an error is detected + on stdin by close_stdin. See also close_stdout_set_file_name, if + an error is detected when closing stdout. */ +void +close_stdin_set_file_name (const char *file) +{ + file_name = file; +} + +/* Close standard input, rewinding any unused input if stdin is + seekable. On error, issue a diagnostic and _exit with status + 'exit_failure'. Then call close_stdout. + + Most programs can get by with close_stdout. close_stdin is only + needed when a program wants to guarantee that partially read input + from seekable stdin is not consumed, for any subsequent clients. + For example, POSIX requires that these two commands behave alike: + + (sed -ne 1q; cat) < file + tail -n 1 file + + Since close_stdin is commonly registered via 'atexit', POSIX + and the C standard both say that it should not call 'exit', + because the behavior is undefined if 'exit' is called more than + once. So it calls '_exit' instead of 'exit'. If close_stdin + is registered via atexit before other functions are registered, + the other functions can act before this _exit is invoked. + + Applications that use close_stdout should flush any streams other + than stdin, stdout, and stderr before exiting, since the call to + _exit will bypass other buffer flushing. Applications should be + flushing and closing other streams anyway, to check for I/O errors. + Also, applications should not use tmpfile, since _exit can bypass + the removal of these files. + + It's important to detect such failures and exit nonzero because many + tools (most notably `make' and other build-management systems) depend + on being able to detect failure in other tools via their exit status. */ + +void +close_stdin (void) +{ + bool fail = false; + + /* There is no need to flush stdin if we can determine quickly that stdin's + input buffer is empty; in this case we know that if stdin is seekable, + fseeko (stdin, 0, SEEK_CUR) == lseek (0, 0, SEEK_CUR). */ + if (freadahead (stdin) > 0) + { + /* Only attempt flush if stdin is seekable, as fflush is entitled to + fail on non-seekable streams. */ + if (fseeko (stdin, 0, SEEK_CUR) == 0 && fflush (stdin) != 0) + fail = true; + } + if (close_stream (stdin) != 0) + fail = true; + if (fail) + { + /* Report failure, but defer exit until after closing stdout, + since the failure report should still be flushed. */ + char const *close_error = _("error closing file"); + if (file_name) + error (0, errno, "%s: %s", quotearg_colon (file_name), + close_error); + else + error (0, errno, "%s", close_error); + } + + close_stdout (); + + if (fail) + _exit (exit_failure); +} diff --git a/src/bin/coreutils/lib/closein.h b/src/bin/coreutils/lib/closein.h new file mode 100644 index 0000000000..837ead641d --- /dev/null +++ b/src/bin/coreutils/lib/closein.h @@ -0,0 +1,32 @@ +/* Close standard input, rewinding seekable stdin if necessary. + + Copyright (C) 2007 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#ifndef _GL_CLOSEIN_H +# define _GL_CLOSEIN_H 1 + +# ifdef __cplusplus +extern "C" { +# endif + +void close_stdin_set_file_name (const char *file); +void close_stdin (void); + +# ifdef __cplusplus +} +# endif + +#endif diff --git a/src/bin/coreutils/lib/closeout.c b/src/bin/coreutils/lib/closeout.c index 830f16f8ae..6a0b82ffaf 100644 --- a/src/bin/coreutils/lib/closeout.c +++ b/src/bin/coreutils/lib/closeout.c @@ -1,12 +1,12 @@ /* Close standard output and standard error, exiting with a diagnostic on error. - Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004, 2006 Free + Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004, 2006, 2008 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,14 +14,14 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ #include #include "closeout.h" #include +#include #include #include @@ -43,6 +43,43 @@ close_stdout_set_file_name (const char *file) file_name = file; } +static bool ignore_EPIPE /* = false */; + +/* Specify the reaction to an EPIPE error during the closing of stdout: + - If ignore = true, it shall be ignored. + - If ignore = false, it shall evoke a diagnostic, along with a nonzero + exit status. + The default is ignore = false. + + This setting matters only if the SIGPIPE signal is ignored (i.e. its + handler set to SIG_IGN) or blocked. Only particular programs need to + temporarily ignore SIGPIPE. If SIGPIPE is ignored or blocked because + it was ignored or blocked in the parent process when it created the + child process, it usually is a bug in the parent process: It is bad + practice to have SIGPIPE ignored or blocked while creating a child + process. + + EPIPE occurs when writing to a pipe or socket that has no readers now, + when SIGPIPE is ignored or blocked. + + The ignore = false setting is suitable for a scenario where it is normally + guaranteed that the pipe writer terminates before the pipe reader. In + this case, an EPIPE is an indication of a premature termination of the + pipe reader and should lead to a diagnostic and a nonzero exit status. + + The ignore = true setting is suitable for a scenario where you don't know + ahead of time whether the pipe writer or the pipe reader will terminate + first. In this case, an EPIPE is an indication that the pipe writer can + stop doing useless write() calls; this is what close_stdout does anyway. + EPIPE is part of the normal pipe/socket shutdown protocol in this case, + and should not lead to a diagnostic message. */ + +void +close_stdout_set_ignore_EPIPE (bool ignore) +{ + ignore_EPIPE = ignore; +} + /* Close standard output. On error, issue a diagnostic and _exit with status 'exit_failure'. @@ -69,7 +106,8 @@ close_stdout_set_file_name (const char *file) void close_stdout (void) { - if (close_stream (stdout) != 0) + if (close_stream (stdout) != 0 + && !(ignore_EPIPE && errno == EPIPE)) { char const *write_error = _("write error"); if (file_name) diff --git a/src/bin/coreutils/lib/closeout.h b/src/bin/coreutils/lib/closeout.h index 8bed23b5f1..34e61effbf 100644 --- a/src/bin/coreutils/lib/closeout.h +++ b/src/bin/coreutils/lib/closeout.h @@ -1,11 +1,12 @@ /* Close standard output and standard error. - Copyright (C) 1998, 2000, 2003, 2004, 2006 Free Software Foundation, Inc. + Copyright (C) 1998, 2000, 2003, 2004, 2006, 2008 Free Software Foundation, + Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,17 +14,19 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ #ifndef CLOSEOUT_H # define CLOSEOUT_H 1 +# include + # ifdef __cplusplus extern "C" { # endif void close_stdout_set_file_name (const char *file); +void close_stdout_set_ignore_EPIPE (bool ignore); void close_stdout (void); # ifdef __cplusplus diff --git a/src/bin/coreutils/lib/config.charset b/src/bin/coreutils/lib/config.charset index 148ea441fa..7f91212032 100755 --- a/src/bin/coreutils/lib/config.charset +++ b/src/bin/coreutils/lib/config.charset @@ -1,11 +1,11 @@ #! /bin/sh # Output a system dependent table of character encoding aliases. # -# Copyright (C) 2000-2004, 2006 Free Software Foundation, Inc. +# Copyright (C) 2000-2004, 2006-2009 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) +# the Free Software Foundation; either version 3, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, @@ -31,20 +31,20 @@ # # name MIME? used by which systems # ASCII, ANSI_X3.4-1968 glibc solaris freebsd netbsd darwin -# ISO-8859-1 Y glibc aix hpux irix osf solaris freebsd netbsd darwin -# ISO-8859-2 Y glibc aix hpux irix osf solaris freebsd netbsd darwin +# ISO-8859-1 Y glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin +# ISO-8859-2 Y glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin # ISO-8859-3 Y glibc solaris -# ISO-8859-4 Y osf solaris freebsd netbsd darwin -# ISO-8859-5 Y glibc aix hpux irix osf solaris freebsd netbsd darwin +# ISO-8859-4 Y osf solaris freebsd netbsd openbsd darwin +# ISO-8859-5 Y glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin # ISO-8859-6 Y glibc aix hpux solaris -# ISO-8859-7 Y glibc aix hpux irix osf solaris netbsd darwin +# ISO-8859-7 Y glibc aix hpux irix osf solaris netbsd openbsd darwin # ISO-8859-8 Y glibc aix hpux osf solaris # ISO-8859-9 Y glibc aix hpux irix osf solaris darwin -# ISO-8859-13 glibc netbsd darwin +# ISO-8859-13 glibc netbsd openbsd darwin # ISO-8859-14 glibc -# ISO-8859-15 glibc aix osf solaris freebsd darwin -# KOI8-R Y glibc solaris freebsd netbsd darwin -# KOI8-U Y glibc freebsd netbsd darwin +# ISO-8859-15 glibc aix osf solaris freebsd netbsd openbsd darwin +# KOI8-R Y glibc solaris freebsd netbsd openbsd darwin +# KOI8-U Y glibc freebsd netbsd openbsd darwin # KOI8-T glibc # CP437 dos # CP775 dos @@ -57,20 +57,21 @@ # CP862 dos # CP864 dos # CP865 dos -# CP866 freebsd netbsd darwin dos +# CP866 freebsd netbsd openbsd darwin dos # CP869 dos # CP874 woe32 dos # CP922 aix # CP932 aix woe32 dos # CP943 aix -# CP949 osf woe32 dos +# CP949 osf darwin woe32 dos # CP950 woe32 dos # CP1046 aix # CP1124 aix # CP1125 dos # CP1129 aix +# CP1131 darwin # CP1250 woe32 -# CP1251 glibc solaris netbsd darwin woe32 +# CP1251 glibc solaris netbsd openbsd darwin woe32 # CP1252 aix woe32 # CP1253 woe32 # CP1254 woe32 @@ -82,15 +83,17 @@ # EUC-KR Y glibc aix hpux irix osf solaris freebsd netbsd darwin # EUC-TW glibc aix hpux irix osf solaris netbsd # BIG5 Y glibc aix hpux osf solaris freebsd netbsd darwin -# BIG5-HKSCS glibc solaris -# GBK glibc aix osf solaris woe32 dos -# GB18030 glibc solaris netbsd +# BIG5-HKSCS glibc solaris darwin +# GBK glibc aix osf solaris darwin woe32 dos +# GB18030 glibc solaris netbsd darwin # SHIFT_JIS Y hpux osf solaris freebsd netbsd darwin # JOHAB glibc solaris woe32 # TIS-620 glibc aix hpux osf solaris # VISCII Y glibc # TCVN5712-1 glibc +# ARMSCII-8 glibc darwin # GEORGIAN-PS glibc +# PT154 glibc # HP-ROMAN8 hpux # HP-ARABIC8 hpux # HP-GREEK8 hpux @@ -397,6 +400,16 @@ case "$os" in echo "BIG5 BIG5" echo "SJIS SHIFT_JIS" ;; + openbsd*) + echo "646 ASCII" + echo "ISO8859-1 ISO-8859-1" + echo "ISO8859-2 ISO-8859-2" + echo "ISO8859-4 ISO-8859-4" + echo "ISO8859-5 ISO-8859-5" + echo "ISO8859-7 ISO-8859-7" + echo "ISO8859-13 ISO-8859-13" + echo "ISO8859-15 ISO-8859-15" + ;; darwin[56]*) # Darwin 6.8 doesn't have nl_langinfo(CODESET); therefore # localcharset.c falls back to using the full locale name @@ -439,7 +452,8 @@ case "$os" in echo "ko_KR.EUC EUC-KR" ;; darwin*) - # Darwin 7.5 has nl_langinfo(CODESET), but it is useless: + # Darwin 7.5 has nl_langinfo(CODESET), but sometimes its value is + # useless: # - It returns the empty string when LANG is set to a locale of the # form ll_CC, although ll_CC/LC_CTYPE is a symlink to an UTF-8 # LC_CTYPE file. @@ -466,10 +480,40 @@ case "$os" in # minimize the use of decomposed Unicode. Unfortunately, through the # Darwin file system, decomposed UTF-8 strings are leaked into user # space nevertheless. + # Then there are also the locales with encodings other than US-ASCII + # and UTF-8. These locales can be occasionally useful to users (e.g. + # when grepping through ISO-8859-1 encoded text files), when all their + # file names are in US-ASCII. + echo "ISO8859-1 ISO-8859-1" + echo "ISO8859-2 ISO-8859-2" + echo "ISO8859-4 ISO-8859-4" + echo "ISO8859-5 ISO-8859-5" + echo "ISO8859-7 ISO-8859-7" + echo "ISO8859-9 ISO-8859-9" + echo "ISO8859-13 ISO-8859-13" + echo "ISO8859-15 ISO-8859-15" + echo "KOI8-R KOI8-R" + echo "KOI8-U KOI8-U" + echo "CP866 CP866" + echo "CP949 CP949" + echo "CP1131 CP1131" + echo "CP1251 CP1251" + echo "eucCN GB2312" + echo "GB2312 GB2312" + echo "eucJP EUC-JP" + echo "eucKR EUC-KR" + echo "Big5 BIG5" + echo "Big5HKSCS BIG5-HKSCS" + echo "GBK GBK" + echo "GB18030 GB18030" + echo "SJIS SHIFT_JIS" + echo "ARMSCII-8 ARMSCII-8" + echo "PT154 PT154" + #echo "ISCII-DEV ?" echo "* UTF-8" ;; - beos*) - # BeOS has a single locale, and it has UTF-8 encoding. + beos* | haiku*) + # BeOS and Haiku have a single locale, and it has UTF-8 encoding. echo "* UTF-8" ;; msdosdjgpp*) diff --git a/src/bin/coreutils/lib/config.h b/src/bin/coreutils/lib/config.h index 6836262ddc..2445b80da0 100644 --- a/src/bin/coreutils/lib/config.h +++ b/src/bin/coreutils/lib/config.h @@ -132,6 +132,12 @@ /* Define to 1 when using the gnulib fopen-safer module. */ #define GNULIB_FOPEN_SAFER 1 +/* Define to 1 when using the gnulib module fts. */ +#define GNULIB_FTS 1 + +/* Define to 1 when using the gnulib module unistr/u8-uctomb. */ +#define GNULIB_UNISTR_U8_UCTOMB 1 + /* The concatenation of the strings `GNU ', and PACKAGE. */ #define GNU_PACKAGE "GNU coreutils" @@ -1823,9 +1829,6 @@ /* Define to `int' if does not define. */ /* #undef pid_t */ -/* Define to rpl_putenv if the replacement function should be used. */ -#define putenv rpl_putenv - /* Define to rpl_re_comp if the replacement should be used. */ /* #undef re_comp rpl_re_comp */ @@ -1906,6 +1909,15 @@ /* Define to rpl_utime if the replacement function should be used. */ /* #undef utime */ +/* Define as a marker that can be attached to function parameter declarations + for parameters that are not used. This helps to reduce warnings, such as + from GCC -Wunused-parameter. */ +#if __GNUC__ >= 3 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) +# define _UNUSED_PARAMETER_ __attribute__ ((__unused__)) +#else +# define _UNUSED_PARAMETER_ +#endif + /* Define as a macro for copying va_list variables. */ #if __GNUC__ < 3 #define va_copy __va_copy diff --git a/src/bin/coreutils/lib/config.hin b/src/bin/coreutils/lib/config.hin index 748b425d13..7e5ee32977 100644 --- a/src/bin/coreutils/lib/config.hin +++ b/src/bin/coreutils/lib/config.hin @@ -1,49 +1,11 @@ /* lib/config.hin. Generated from configure.ac by autoheader. */ -/* Define this to an absolute name of . */ -#undef ABSOLUTE_DIRENT_H +/* Define if the compiler is building for multiple architectures of Apple + platforms at once. */ +#undef AA_APPLE_UNIVERSAL_BUILD -/* Define this to an absolute name of . */ -#undef ABSOLUTE_FCNTL_H - -/* Define this to an absolute name of . */ -#undef ABSOLUTE_INTTYPES_H - -/* Define this to an absolute name of . */ -#undef ABSOLUTE_NETINET_IN_H - -/* Define this to an absolute name of . */ -#undef ABSOLUTE_STDINT_H - -/* Define this to an absolute name of . */ -#undef ABSOLUTE_STDIO_H - -/* Define this to an absolute name of . */ -#undef ABSOLUTE_STDLIB_H - -/* Define this to an absolute name of . */ -#undef ABSOLUTE_STRING_H - -/* Define this to an absolute name of . */ -#undef ABSOLUTE_SYS_SOCKET_H - -/* Define this to an absolute name of . */ -#undef ABSOLUTE_SYS_STAT_H - -/* Define this to an absolute name of . */ -#undef ABSOLUTE_SYS_TIME_H - -/* Define this to an absolute name of . */ -#undef ABSOLUTE_TIME_H - -/* Define this to an absolute name of . */ -#undef ABSOLUTE_UNISTD_H - -/* Define this to an absolute name of . */ -#undef ABSOLUTE_WCHAR_H - -/* Define this to an absolute name of . */ -#undef ABSOLUTE_WCTYPE_H +/* Define if building universal (internal helper macro) */ +#undef AC_APPLE_UNIVERSAL_BUILD /* Define to the function xargmatch calls on failures. */ #undef ARGMATCH_DIE @@ -66,6 +28,10 @@ /* Define to the number of bits in type 'wint_t'. */ #undef BITSIZEOF_WINT_T +/* Define if you wish *printf() functions that have a safe handling of + non-IEEE-754 'long double' values. */ +#undef CHECK_PRINTF_SAFE + /* Define if chown is not POSIX compliant regarding IDs of -1. */ #undef CHOWN_FAILS_TO_HONOR_ID_OF_NEGATIVE_ONE @@ -83,6 +49,19 @@ /* Define to 1 if using `getloadavg.c'. */ #undef C_GETLOADAVG +/* Define as the bit index in the word where to find bit 0 of the exponent of + 'double'. */ +#undef DBL_EXPBIT0_BIT + +/* Define as the word index where to find the exponent of 'double'. */ +#undef DBL_EXPBIT0_WORD + +/* Define as the bit index in the word where to find the sign of 'double'. */ +#undef DBL_SIGNBIT_BIT + +/* Define as the word index where to find the sign of 'double'. */ +#undef DBL_SIGNBIT_WORD + /* Define the default level of POSIX conformance. The value is of the form YYYYMM, specifying the year and month the standard was adopted. If not defined here, it defaults to the value of _POSIX2_VERSION in . @@ -111,17 +90,13 @@ /* Define to 1 if // is a file system root distinct from /. */ #undef DOUBLE_SLASH_IS_DISTINCT_ROOT -/* Define if there is a member named d_ino in the struct describing directory - headers. */ +/* Define if struct dirent has a member d_ino that actually works. */ #undef D_INO_IN_DIRENT /* Define to 1 if translation of program messages to the user's native language is requested. */ #undef ENABLE_NLS -/* Define as good substitute value for EOVERFLOW. */ -#undef EOVERFLOW - /* Define if gnulib's fchdir() replacement is used. */ #undef FCHDIR_REPLACEMENT @@ -147,6 +122,22 @@ MSVC and with C++ compilers. */ #undef FLEXIBLE_ARRAY_MEMBER +/* Define as the bit index in the word where to find bit 0 of the exponent of + 'float'. */ +#undef FLT_EXPBIT0_BIT + +/* Define as the word index where to find the exponent of 'float'. */ +#undef FLT_EXPBIT0_WORD + +/* Define as the bit index in the word where to find the sign of 'float'. */ +#undef FLT_SIGNBIT_BIT + +/* Define as the word index where to find the sign of 'float'. */ +#undef FLT_SIGNBIT_WORD + +/* Define to 1 if ungetc is broken when used on arbitrary bytes. */ +#undef FUNC_UNGETC_BROKEN + /* Define to the type of elements in the array set by `getgroups'. Usually this is either `int' or `gid_t'. */ #undef GETGROUPS_T @@ -158,6 +149,9 @@ /* Define if gettimeofday clobbers the localtime buffer. */ #undef GETTIMEOFDAY_CLOBBERS_LOCALTIME +/* Define to make the limit macros in visible. */ +#undef GL_TRIGGER_STDC_LIMIT_MACROS + /* Define to 1 when using the gnulib module canonicalize. */ #undef GNULIB_CANONICALIZE @@ -173,8 +167,23 @@ /* Define to 1 when using the gnulib module fts. */ #undef GNULIB_FTS -/* The concatenation of the strings `GNU ', and PACKAGE. */ -#undef GNU_PACKAGE +/* Define to 1 when using the gnulib module ioctl. */ +#undef GNULIB_IOCTL + +/* Define to indicate the 'malloc' module. */ +#undef GNULIB_MALLOC_GNU + +/* Define to 1 when using the gnulib module open. */ +#undef GNULIB_OPEN + +/* enable some gnulib portability checks */ +#undef GNULIB_PORTCHECK + +/* Define to indicate the 'realloc' module. */ +#undef GNULIB_REALLOC_GNU + +/* Define to 1 when using the gnulib module unistr/u8-uctomb. */ +#undef GNULIB_UNISTR_U8_UCTOMB /* Define if your system defines TIOCGWINSZ in sys/ioctl.h. */ #undef GWINSZ_IN_SYS_IOCTL @@ -185,18 +194,39 @@ /* Define to 1 if you have the `acl' function. */ #undef HAVE_ACL +/* Define to 1 if you have the `aclx_get' function. */ +#undef HAVE_ACLX_GET + +/* Define to 1 if you have the `acl_copy_ext_native' function. */ +#undef HAVE_ACL_COPY_EXT_NATIVE + +/* Define to 1 if you have the `acl_create_entry_np' function. */ +#undef HAVE_ACL_CREATE_ENTRY_NP + /* Define to 1 if you have the `acl_delete_def_file' function. */ #undef HAVE_ACL_DELETE_DEF_FILE +/* Define to 1 if you have the `acl_delete_fd_np' function. */ +#undef HAVE_ACL_DELETE_FD_NP + +/* Define to 1 if you have the `acl_delete_file_np' function. */ +#undef HAVE_ACL_DELETE_FILE_NP + /* Define to 1 if you have the `acl_entries' function. */ #undef HAVE_ACL_ENTRIES /* Define to 1 if you have the `acl_extended_file' function. */ #undef HAVE_ACL_EXTENDED_FILE +/* Define to 1 if the constant ACL_FIRST_ENTRY exists. */ +#undef HAVE_ACL_FIRST_ENTRY + /* Define to 1 if you have the `acl_free' function. */ #undef HAVE_ACL_FREE +/* Define to 1 if you have the `acl_free_text' function. */ +#undef HAVE_ACL_FREE_TEXT + /* Define to 1 if you have the `acl_from_mode' function. */ #undef HAVE_ACL_FROM_MODE @@ -218,9 +248,15 @@ /* Define to 1 if you have the `acl_set_file' function. */ #undef HAVE_ACL_SET_FILE +/* Define to 1 if you have the `acl_to_short_text' function. */ +#undef HAVE_ACL_TO_SHORT_TEXT + /* Define to 1 if you have the `acl_trivial' function. */ #undef HAVE_ACL_TRIVIAL +/* Define to 1 if the ACL type ACL_TYPE_EXTENDED exists. */ +#undef HAVE_ACL_TYPE_EXTENDED + /* Define to 1 if you have the `alarm' function. */ #undef HAVE_ALARM @@ -228,8 +264,8 @@ may be supplied by this distribution. */ #undef HAVE_ALLOCA -/* Define HAVE_ALLOCA_H for backward compatibility with older code that - includes only if HAVE_ALLOCA_H is defined. */ +/* Define to 1 if you have and it should be used (not on Ultrix). + */ #undef HAVE_ALLOCA_H /* Define if you have an arithmetic hrtime_t type. */ @@ -241,13 +277,22 @@ /* Define to 1 if you have the `atexit' function. */ #undef HAVE_ATEXIT +/* Define to 1 if you have the `attr_copy_file' function. */ +#undef HAVE_ATTR_COPY_FILE + +/* Define to 1 if you have the header file. */ +#undef HAVE_ATTR_ERROR_CONTEXT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_ATTR_LIBATTR_H + /* Define to 1 if you have the header file. */ #undef HAVE_BP_SYM_H /* Define to 1 if you have the `btowc' function. */ #undef HAVE_BTOWC -/* Define to 1 if nanosleep mishandle large arguments. */ +/* Define to 1 if nanosleep mishandles large arguments. */ #undef HAVE_BUG_BIG_NANOSLEEP /* Define to 1 if strtold conforms to C99. */ @@ -257,9 +302,15 @@ to 0 otherwise. */ #undef HAVE_CALLOC +/* Define if the 'calloc' function is POSIX compliant. */ +#undef HAVE_CALLOC_POSIX + /* Define to 1 if you have the `canonicalize_file_name' function. */ #undef HAVE_CANONICALIZE_FILE_NAME +/* libcap usability */ +#undef HAVE_CAP + /* Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the CoreFoundation framework. */ #undef HAVE_CFLOCALECOPYCURRENT @@ -286,6 +337,18 @@ /* Define if you have compound literals. */ #undef HAVE_COMPOUND_LITERALS +/* Define if the copysignf function is declared in and available in + libc. */ +#undef HAVE_COPYSIGNF_IN_LIBC + +/* Define if the copysignl function is declared in and available in + libc. */ +#undef HAVE_COPYSIGNL_IN_LIBC + +/* Define if the copysign function is declared in and available in + libc. */ +#undef HAVE_COPYSIGN_IN_LIBC + /* FIXME */ #undef HAVE_C_LINE @@ -301,14 +364,22 @@ you don't. */ #undef HAVE_DECL_CLEARERR_UNLOCKED +/* Define to 1 if you have the declaration of `copysign', and to 0 if you + don't. */ +#undef HAVE_DECL_COPYSIGN + +/* Define to 1 if you have the declaration of `copysignf', and to 0 if you + don't. */ +#undef HAVE_DECL_COPYSIGNF + +/* Define to 1 if you have the declaration of `copysignl', and to 0 if you + don't. */ +#undef HAVE_DECL_COPYSIGNL + /* Define to 1 if you have the declaration of `dirfd', and to 0 if you don't. */ #undef HAVE_DECL_DIRFD -/* Define to 1 if you have the declaration of `euidaccess', and to 0 if you - don't. */ -#undef HAVE_DECL_EUIDACCESS - /* Define to 1 if you have the declaration of `feof_unlocked', and to 0 if you don't. */ #undef HAVE_DECL_FEOF_UNLOCKED @@ -329,6 +400,10 @@ don't. */ #undef HAVE_DECL_FLOCKFILE +/* Define to 1 if you have the declaration of `fpurge', and to 0 if you don't. + */ +#undef HAVE_DECL_FPURGE + /* Define to 1 if you have the declaration of `fputc_unlocked', and to 0 if you don't. */ #undef HAVE_DECL_FPUTC_UNLOCKED @@ -437,14 +512,14 @@ don't. */ #undef HAVE_DECL_INET_NTOP +/* Define to 1 if you have the declaration of `inet_pton', and to 0 if you + don't. */ +#undef HAVE_DECL_INET_PTON + /* Define to 1 if you have the declaration of `isblank', and to 0 if you don't. */ #undef HAVE_DECL_ISBLANK -/* Define to 1 if you have the declaration of `lchown', and to 0 if you don't. - */ -#undef HAVE_DECL_LCHOWN - /* Define to 1 if you have the declaration of `lseek', and to 0 if you don't. */ #undef HAVE_DECL_LSEEK @@ -465,10 +540,6 @@ don't. */ #undef HAVE_DECL_MEMRCHR -/* Define to 1 if you have the declaration of `mkdir', and to 0 if you don't. - */ -#undef HAVE_DECL_MKDIR - /* Define to 1 if you have the declaration of `putchar_unlocked', and to 0 if you don't. */ #undef HAVE_DECL_PUTCHAR_UNLOCKED @@ -485,6 +556,10 @@ don't. */ #undef HAVE_DECL_SETREGID +/* Define to 1 if you have the declaration of `sleep', and to 0 if you don't. + */ +#undef HAVE_DECL_SLEEP + /* Define to 1 if you have the declaration of `snprintf', and to 0 if you don't. */ #undef HAVE_DECL_SNPRINTF @@ -493,6 +568,10 @@ */ #undef HAVE_DECL_STRDUP +/* Define to 1 if you have the declaration of `strerror', and to 0 if you + don't. */ +#undef HAVE_DECL_STRERROR + /* Define to 1 if you have the declaration of `strerror_r', and to 0 if you don't. */ #undef HAVE_DECL_STRERROR_R @@ -541,10 +620,18 @@ */ #undef HAVE_DECL_TZNAME +/* Define to 1 if you have the declaration of `wctob', and to 0 if you don't. + */ +#undef HAVE_DECL_WCTOB + /* Define to 1 if you have the declaration of `wcwidth', and to 0 if you don't. */ #undef HAVE_DECL_WCWIDTH +/* Define to 1 if you have the declaration of `_snprintf', and to 0 if you + don't. */ +#undef HAVE_DECL__SNPRINTF + /* Define to 1 if you have the declaration of `_sys_siglist', and to 0 if you don't. */ #undef HAVE_DECL__SYS_SIGLIST @@ -588,6 +675,9 @@ /* Define if you have the declaration of environ. */ #undef HAVE_ENVIRON_DECL +/* Define to 1 if you have the header file. */ +#undef HAVE_ERRNO_H + /* Define to 1 if you have the `euidaccess' function. */ #undef HAVE_EUIDACCESS @@ -616,15 +706,30 @@ */ #undef HAVE_FIFO_PIPES +/* Define to 1 if you have the header file. */ +#undef HAVE_FLOAT_H + /* Define to 1 if you have the `flockfile' function. */ #undef HAVE_FLOCKFILE /* Define to 1 if you have the `fork' function. */ #undef HAVE_FORK +/* Define to 1 if you have the `fpurge' function. */ +#undef HAVE_FPURGE + +/* Define if the frexpl function is available in libc. */ +#undef HAVE_FREXPL_IN_LIBC + +/* Define if the frexp function is available in libc. */ +#undef HAVE_FREXP_IN_LIBC + /* Define to 1 if fseeko (and presumably ftello) exists and is declared. */ #undef HAVE_FSEEKO +/* Define to 1 if you have the `fstatfs' function. */ +#undef HAVE_FSTATFS + /* Define to 1 if you have the header file. */ #undef HAVE_FS_INFO_H @@ -637,21 +742,24 @@ /* Define to 1 if you have the `funlockfile' function. */ #undef HAVE_FUNLOCKFILE +/* Define to 1 if you have the `futimens' function. */ +#undef HAVE_FUTIMENS + /* Define to 1 if you have the `futimes' function. */ #undef HAVE_FUTIMES /* Define to 1 if you have the `futimesat' function. */ #undef HAVE_FUTIMESAT -/* Define to 1 if you have the `gai_strerror' function. */ -#undef HAVE_GAI_STRERROR - -/* Define to 1 if you have the `getaddrinfo' function. */ -#undef HAVE_GETADDRINFO +/* Define to 1 if you have the `getacl' function. */ +#undef HAVE_GETACL /* Define to 1 if you have the `getdelim' function. */ #undef HAVE_GETDELIM +/* Define to 1 if you have the `getgrouplist' function. */ +#undef HAVE_GETGROUPLIST + /* Define to 1 if your system has a working `getgroups' function. */ #undef HAVE_GETGROUPS @@ -682,6 +790,12 @@ /* Define to 1 if you have the `getpagesize' function. */ #undef HAVE_GETPAGESIZE +/* Define to 1 if you have the `getppriv' function. */ +#undef HAVE_GETPPRIV + +/* Define to 1 if you have the `getservbyname' function. */ +#undef HAVE_GETSERVBYNAME + /* Define to 1 if you have the `getspnam' function. */ #undef HAVE_GETSPNAM @@ -697,6 +811,9 @@ /* Define to 1 if you have the `getusershell' function. */ #undef HAVE_GETUSERSHELL +/* Define if you have GNU libgmp (or replacement) */ +#undef HAVE_GMP + /* Define to 1 if you have the header file. */ #undef HAVE_GRP_H @@ -706,12 +823,18 @@ /* Define to 1 if you have the header file. */ #undef HAVE_HURD_H -/* Define if you have the iconv() function. */ +/* Define if you have the iconv() function and it works. */ #undef HAVE_ICONV +/* Define to 1 if you have the header file. */ +#undef HAVE_ICONV_H + /* Define to 1 if you have the `inet_ntop' function. */ #undef HAVE_INET_NTOP +/* Define to 1 if you have the `inet_pton' function. */ +#undef HAVE_INET_PTON + /* Define to 1 if you have the `initgroups' function. */ #undef HAVE_INITGROUPS @@ -730,9 +853,6 @@ declares uintmax_t. */ #undef HAVE_INTTYPES_H_WITH_UINTMAX -/* Define to 1 if you have the header file. */ -#undef HAVE_IO_H - /* Define to 1 if defines AF_INET. */ #undef HAVE_IPV4 @@ -745,6 +865,18 @@ /* Define to 1 if you have the `isascii' function. */ #undef HAVE_ISASCII +/* Define to 1 if you have the `isblank' function. */ +#undef HAVE_ISBLANK + +/* Define if the isnan(double) function is available in libc. */ +#undef HAVE_ISNAND_IN_LIBC + +/* Define if the isnan(float) function is available in libc. */ +#undef HAVE_ISNANF_IN_LIBC + +/* Define if the isnan(long double) function is available in libc. */ +#undef HAVE_ISNANL_IN_LIBC + /* Define to 1 if you have the `iswcntrl' function. */ #undef HAVE_ISWCNTRL @@ -757,18 +889,30 @@ /* Define if you have and nl_langinfo(CODESET). */ #undef HAVE_LANGINFO_CODESET +/* Define if you have and nl_langinfo(YESEXPR). */ +#undef HAVE_LANGINFO_YESEXPR + /* Define to 1 if you have the `lchmod' function. */ #undef HAVE_LCHMOD /* Define to 1 if you have the `lchown' function. */ #undef HAVE_LCHOWN +/* Define if the ldexpl function is available in libc. */ +#undef HAVE_LDEXPL_IN_LIBC + +/* Define if the ldexp function is available in libc. */ +#undef HAVE_LDEXP_IN_LIBC + /* Define to 1 if you have the `dgc' library (-ldgc). */ #undef HAVE_LIBDGC /* Define to 1 if you have the header file. */ #undef HAVE_LIBGEN_H +/* Define to 1 if you have the header file. */ +#undef HAVE_LIBINTL_H + /* Define to 1 if you have the `kstat' library (-lkstat). */ #undef HAVE_LIBKSTAT @@ -778,6 +922,9 @@ /* Define to 1 if you have the `os' library (-los). */ #undef HAVE_LIBOS +/* Define to 1 if you have the `perfstat' library (-lperfstat). */ +#undef HAVE_LIBPERFSTAT + /* Define to 1 if you have the `ypsec' library (-lypsec). */ #undef HAVE_LIBYPSEC @@ -787,20 +934,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_LOCALE_H -/* Define to 1 if the type `long double' works and has more range or precision - than `double'. */ -#undef HAVE_LONG_DOUBLE - -/* Define to 1 if the type `long double' works and has more range or precision - than `double'. */ -#undef HAVE_LONG_DOUBLE_WIDER - /* Define to 1 if you support file names longer than 14 characters. */ #undef HAVE_LONG_FILE_NAMES -/* Define if you have the 'long long' type. */ -#undef HAVE_LONG_LONG - /* Define to 1 if the system has the type `long long int'. */ #undef HAVE_LONG_LONG_INT @@ -821,8 +957,14 @@ to 0 otherwise. */ #undef HAVE_MALLOC -/* Define to 1 if you have the `mblen' function. */ -#undef HAVE_MBLEN +/* Define if the 'malloc' function is POSIX compliant. */ +#undef HAVE_MALLOC_POSIX + +/* Define to 1 if you have the `matchpathcon_init_prefix' function. */ +#undef HAVE_MATCHPATHCON_INIT_PREFIX + +/* Define to 1 if you have the header file. */ +#undef HAVE_MATH_H /* Define to 1 if you have the `mbrlen' function. */ #undef HAVE_MBRLEN @@ -899,6 +1041,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_NLIST_H +/* Define to 1 if you have the `nl_langinfo' function. */ +#undef HAVE_NL_LANGINFO + /* Define to 1 if libc includes obstacks. */ #undef HAVE_OBSTACK @@ -935,15 +1080,15 @@ /* Define to 1 if you have the `pstat_getstatic' function. */ #undef HAVE_PSTAT_GETSTATIC -/* Define to 1 if the system has the type `ptrdiff_t'. */ -#undef HAVE_PTRDIFF_T - /* Define to 1 if you have the header file. */ #undef HAVE_PWD_H /* Define to 1 if you have the `raise' function. */ #undef HAVE_RAISE +/* Define to 1 if you have the header file. */ +#undef HAVE_RANDOM_H + /* Define to 1 if you have the `readlink' function. */ #undef HAVE_READLINK @@ -951,6 +1096,9 @@ and to 0 otherwise. */ #undef HAVE_REALLOC +/* Define if the 'realloc' function is POSIX compliant. */ +#undef HAVE_REALLOC_POSIX + /* Define to 1 if you have the `resolvepath' function. */ #undef HAVE_RESOLVEPATH @@ -966,6 +1114,15 @@ /* Define to 1 if you have the header file. */ #undef HAVE_SEARCH_H +/* Define to 1 if you have the header file. */ +#undef HAVE_SELINUX_CONTEXT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SELINUX_FLASK_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SELINUX_SELINUX_H + /* Define to 1 if you have the `setenv' function. */ #undef HAVE_SETENV @@ -981,12 +1138,27 @@ /* Define to 1 if you have the header file. */ #undef HAVE_SHADOW_H +/* Define to 1 if you have the `shutdown' function. */ +#undef HAVE_SHUTDOWN + /* Define to 1 if you have the `sig2str' function. */ #undef HAVE_SIG2STR +/* Define to 1 if you have the `sigaction' function. */ +#undef HAVE_SIGACTION + +/* Define to 1 if you have the `sigaltstack' function. */ +#undef HAVE_SIGALTSTACK + +/* Define to 1 if the system has the type `siginfo_t'. */ +#undef HAVE_SIGINFO_T + /* Define to 1 if you have the `siginterrupt' function. */ #undef HAVE_SIGINTERRUPT +/* Define to 1 if you have the header file. */ +#undef HAVE_SIGNAL_H + /* Define to 1 if 'sig_atomic_t' is a signed integer type. */ #undef HAVE_SIGNED_SIG_ATOMIC_T @@ -996,9 +1168,18 @@ /* Define to 1 if 'wint_t' is a signed integer type. */ #undef HAVE_SIGNED_WINT_T +/* Define to 1 if the system has the type `sigset_t'. */ +#undef HAVE_SIGSET_T + /* Define to 1 if you have the `snprintf' function. */ #undef HAVE_SNPRINTF +/* Define to 1 if you have the `statacl' function. */ +#undef HAVE_STATACL + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDARG_H + /* Define to 1 if stdbool.h conforms to C99. */ #undef HAVE_STDBOOL_H @@ -1024,6 +1205,9 @@ /* Define to 1 if you have the `stpcpy' function. */ #undef HAVE_STPCPY +/* Define if you have the stpncpy() function and it works. */ +#undef HAVE_STPNCPY + /* Define to 1 if you have the `strcoll' function and it is properly defined. */ #undef HAVE_STRCOLL @@ -1046,6 +1230,9 @@ /* Define if you have the strndup() function and it works. */ #undef HAVE_STRNDUP +/* Define to 1 if you have the `strnlen' function. */ +#undef HAVE_STRNLEN + /* Define to 1 if you have the header file. */ #undef HAVE_STROPTS_H @@ -1077,122 +1264,137 @@ headers. */ #undef HAVE_STRUCT_DIRENT_D_TYPE -/* Define to 1 if `f_fstypename' is member of `struct fsstat'. */ +/* Define to 1 if `struct fsstat' is a member of `f_fstypename'. */ #undef HAVE_STRUCT_FSSTAT_F_FSTYPENAME -/* Define to 1 if `n_un.n_name' is member of `struct nlist'. */ +/* Define to 1 if `struct nlist' is a member of `n_un.n_name'. */ #undef HAVE_STRUCT_NLIST_N_UN_N_NAME -/* Define to 1 if `sp_pwdp' is member of `struct spwd'. */ +/* Define to 1 if the system has the type `struct random_data'. */ +#undef HAVE_STRUCT_RANDOM_DATA + +/* Define to 1 if `struct sigaction' is a member of `sa_sigaction'. */ +#undef HAVE_STRUCT_SIGACTION_SA_SIGACTION + +/* Define to 1 if `struct sockaddr' is a member of `sa_len'. */ +#undef HAVE_STRUCT_SOCKADDR_SA_LEN + +/* Define to 1 if `struct spwd' is a member of `sp_pwdp'. */ #undef HAVE_STRUCT_SPWD_SP_PWDP -/* Define to 1 if `f_fstypename' is member of `struct statfs'. */ +/* Define to 1 if `struct statfs' is a member of `f_fstypename'. */ #undef HAVE_STRUCT_STATFS_F_FSTYPENAME -/* Define to 1 if `f_namelen' is member of `struct statfs'. */ +/* Define to 1 if `struct statfs' is a member of `f_namelen'. */ #undef HAVE_STRUCT_STATFS_F_NAMELEN -/* Define to 1 if `f_type' is member of `struct statfs'. */ +/* Define to 1 if `struct statfs' is a member of `f_type'. */ #undef HAVE_STRUCT_STATFS_F_TYPE -/* Define to 1 if `f_basetype' is member of `struct statvfs'. */ +/* Define to 1 if `struct statvfs' is a member of `f_basetype'. */ #undef HAVE_STRUCT_STATVFS_F_BASETYPE -/* Define to 1 if `f_fstypename' is member of `struct statvfs'. */ +/* Define to 1 if `struct statvfs' is a member of `f_fstypename'. */ #undef HAVE_STRUCT_STATVFS_F_FSTYPENAME -/* Define to 1 if `f_namemax' is member of `struct statvfs'. */ +/* Define to 1 if `struct statvfs' is a member of `f_namemax'. */ #undef HAVE_STRUCT_STATVFS_F_NAMEMAX -/* Define to 1 if `f_type' is member of `struct statvfs'. */ +/* Define to 1 if `struct statvfs' is a member of `f_type'. */ #undef HAVE_STRUCT_STATVFS_F_TYPE -/* Define to 1 if `st_atimensec' is member of `struct stat'. */ +/* Define to 1 if `struct stat' is a member of `st_atimensec'. */ #undef HAVE_STRUCT_STAT_ST_ATIMENSEC -/* Define to 1 if `st_atimespec.tv_nsec' is member of `struct stat'. */ +/* Define to 1 if `struct stat' is a member of `st_atimespec.tv_nsec'. */ #undef HAVE_STRUCT_STAT_ST_ATIMESPEC_TV_NSEC -/* Define to 1 if `st_atim.st__tim.tv_nsec' is member of `struct stat'. */ +/* Define to 1 if `struct stat' is a member of `st_atim.st__tim.tv_nsec'. */ #undef HAVE_STRUCT_STAT_ST_ATIM_ST__TIM_TV_NSEC -/* Define to 1 if `st_atim.tv_nsec' is member of `struct stat'. */ +/* Define to 1 if `struct stat' is a member of `st_atim.tv_nsec'. */ #undef HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC -/* Define to 1 if `st_author' is member of `struct stat'. */ +/* Define to 1 if `struct stat' is a member of `st_author'. */ #undef HAVE_STRUCT_STAT_ST_AUTHOR -/* Define to 1 if `st_blocks' is member of `struct stat'. */ +/* Define to 1 if `struct stat' is a member of `st_birthtimensec'. */ +#undef HAVE_STRUCT_STAT_ST_BIRTHTIMENSEC + +/* Define to 1 if `struct stat' is a member of `st_birthtimespec.tv_nsec'. */ +#undef HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC + +/* Define to 1 if `struct stat' is a member of `st_birthtim.tv_nsec'. */ +#undef HAVE_STRUCT_STAT_ST_BIRTHTIM_TV_NSEC + +/* Define to 1 if `struct stat' is a member of `st_blocks'. */ #undef HAVE_STRUCT_STAT_ST_BLOCKS -/* Define to 1 if `st_spare1' is member of `struct stat'. */ -#undef HAVE_STRUCT_STAT_ST_SPARE1 - -/* Define to 1 if `tm_zone' is member of `struct tm'. */ +/* Define to 1 if `struct tm' is a member of `tm_zone'. */ #undef HAVE_STRUCT_TM_TM_ZONE /* Define if struct utimbuf is declared -- usually in . Some systems have utime.h but don't declare the struct anywhere. */ #undef HAVE_STRUCT_UTIMBUF -/* Define to 1 if `ut_exit' is member of `struct utmpx'. */ +/* Define to 1 if `struct utmpx' is a member of `ut_exit'. */ #undef HAVE_STRUCT_UTMPX_UT_EXIT -/* Define to 1 if `ut_exit.e_exit' is member of `struct utmpx'. */ +/* Define to 1 if `struct utmpx' is a member of `ut_exit.e_exit'. */ #undef HAVE_STRUCT_UTMPX_UT_EXIT_E_EXIT -/* Define to 1 if `ut_exit.e_termination' is member of `struct utmpx'. */ +/* Define to 1 if `struct utmpx' is a member of `ut_exit.e_termination'. */ #undef HAVE_STRUCT_UTMPX_UT_EXIT_E_TERMINATION -/* Define to 1 if `ut_exit.ut_exit' is member of `struct utmpx'. */ +/* Define to 1 if `struct utmpx' is a member of `ut_exit.ut_exit'. */ #undef HAVE_STRUCT_UTMPX_UT_EXIT_UT_EXIT -/* Define to 1 if `ut_exit.ut_termination' is member of `struct utmpx'. */ +/* Define to 1 if `struct utmpx' is a member of `ut_exit.ut_termination'. */ #undef HAVE_STRUCT_UTMPX_UT_EXIT_UT_TERMINATION -/* Define to 1 if `ut_id' is member of `struct utmpx'. */ +/* Define to 1 if `struct utmpx' is a member of `ut_id'. */ #undef HAVE_STRUCT_UTMPX_UT_ID -/* Define to 1 if `ut_name' is member of `struct utmpx'. */ +/* Define to 1 if `struct utmpx' is a member of `ut_name'. */ #undef HAVE_STRUCT_UTMPX_UT_NAME -/* Define to 1 if `ut_pid' is member of `struct utmpx'. */ +/* Define to 1 if `struct utmpx' is a member of `ut_pid'. */ #undef HAVE_STRUCT_UTMPX_UT_PID -/* Define to 1 if `ut_type' is member of `struct utmpx'. */ +/* Define to 1 if `struct utmpx' is a member of `ut_type'. */ #undef HAVE_STRUCT_UTMPX_UT_TYPE -/* Define to 1 if `ut_user' is member of `struct utmpx'. */ +/* Define to 1 if `struct utmpx' is a member of `ut_user'. */ #undef HAVE_STRUCT_UTMPX_UT_USER -/* Define to 1 if `ut_exit' is member of `struct utmp'. */ +/* Define to 1 if `struct utmp' is a member of `ut_exit'. */ #undef HAVE_STRUCT_UTMP_UT_EXIT -/* Define to 1 if `ut_exit.e_exit' is member of `struct utmp'. */ +/* Define to 1 if `struct utmp' is a member of `ut_exit.e_exit'. */ #undef HAVE_STRUCT_UTMP_UT_EXIT_E_EXIT -/* Define to 1 if `ut_exit.e_termination' is member of `struct utmp'. */ +/* Define to 1 if `struct utmp' is a member of `ut_exit.e_termination'. */ #undef HAVE_STRUCT_UTMP_UT_EXIT_E_TERMINATION -/* Define to 1 if `ut_exit.ut_exit' is member of `struct utmp'. */ +/* Define to 1 if `struct utmp' is a member of `ut_exit.ut_exit'. */ #undef HAVE_STRUCT_UTMP_UT_EXIT_UT_EXIT -/* Define to 1 if `ut_exit.ut_termination' is member of `struct utmp'. */ +/* Define to 1 if `struct utmp' is a member of `ut_exit.ut_termination'. */ #undef HAVE_STRUCT_UTMP_UT_EXIT_UT_TERMINATION -/* Define to 1 if `ut_id' is member of `struct utmp'. */ +/* Define to 1 if `struct utmp' is a member of `ut_id'. */ #undef HAVE_STRUCT_UTMP_UT_ID -/* Define to 1 if `ut_name' is member of `struct utmp'. */ +/* Define to 1 if `struct utmp' is a member of `ut_name'. */ #undef HAVE_STRUCT_UTMP_UT_NAME -/* Define to 1 if `ut_pid' is member of `struct utmp'. */ +/* Define to 1 if `struct utmp' is a member of `ut_pid'. */ #undef HAVE_STRUCT_UTMP_UT_PID -/* Define to 1 if `ut_type' is member of `struct utmp'. */ +/* Define to 1 if `struct utmp' is a member of `ut_type'. */ #undef HAVE_STRUCT_UTMP_UT_TYPE -/* Define to 1 if `ut_user' is member of `struct utmp'. */ +/* Define to 1 if `struct utmp' is a member of `ut_user'. */ #undef HAVE_STRUCT_UTMP_UT_USER /* Define to 1 if you have the `strverscmp' function. */ @@ -1247,6 +1449,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_SYS_IOCTL_H +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_LOADAVG_H + /* Define to 1 if you have the header file. */ #undef HAVE_SYS_MNTENT_H @@ -1360,15 +1565,12 @@ /* Define to 1 if the system has the type `unsigned long long int'. */ #undef HAVE_UNSIGNED_LONG_LONG_INT -/* Define if utimes accepts a null argument */ -#undef HAVE_UTIMES_NULL +/* Define to 1 if you have the `utimensat' function. */ +#undef HAVE_UTIMENSAT /* Define to 1 if you have the header file. */ #undef HAVE_UTIME_H -/* Define to 1 if `utime(file, NULL)' sets file's timestamp to the present. */ -#undef HAVE_UTIME_NULL - /* Define to 1 if you have the `utmpname' function. */ #undef HAVE_UTMPNAME @@ -1411,6 +1613,12 @@ /* Define to 1 if you have the `wcslen' function. */ #undef HAVE_WCSLEN +/* Define to 1 if you have the `wcsnlen' function. */ +#undef HAVE_WCSNLEN + +/* Define to 1 if you have the `wctob' function. */ +#undef HAVE_WCTOB + /* Define to 1 if you have the header file. */ #undef HAVE_WCTYPE_H @@ -1463,6 +1671,12 @@ /* Define to 1 if you have the `__fpending' function. */ #undef HAVE___FPENDING +/* Define to 1 if you have the `__fpurge' function. */ +#undef HAVE___FPURGE + +/* Define to 1 if you have the `__freading' function. */ +#undef HAVE___FREADING + /* Define to 1 if you have the `__fsetlocking' function. */ #undef HAVE___FSETLOCKING @@ -1472,18 +1686,39 @@ /* Define as const if the declaration of iconv() needs const. */ #undef ICONV_CONST +/* Define to a symbolic name denoting the flavor of iconv_open() + implementation. */ +#undef ICONV_FLAVOR + #if FILE_SYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR # define ISSLASH(C) ((C) == '/' || (C) == '\\') #else # define ISSLASH(C) ((C) == '/') #endif +/* Define as the bit index in the word where to find bit 0 of the exponent of + 'long double'. */ +#undef LDBL_EXPBIT0_BIT + +/* Define as the word index where to find the exponent of 'long double'. */ +#undef LDBL_EXPBIT0_WORD + +/* Define as the bit index in the word where to find the sign of 'long + double'. */ +#undef LDBL_SIGNBIT_BIT + +/* Define as the word index where to find the sign of 'long double'. */ +#undef LDBL_SIGNBIT_WORD + /* Define if `link(2)' dereferences symbolic links. */ #undef LINK_FOLLOWS_SYMLINKS /* FIXME */ #undef LOCALTIME_CACHE +/* Define to 1 if lseek does not detect pipes. */ +#undef LSEEK_PIPE_BROKEN + /* Define to 1 if `lstat' dereferences a symlink specified with a trailing slash. */ #undef LSTAT_FOLLOWS_SLASHED_SYMLINK @@ -1499,6 +1734,15 @@ /* If malloc(0) is != NULL, define this to 1. Otherwise define this to 0. */ #undef MALLOC_0_IS_NONNULL +/* Define if the mbrtowc function has the NULL string argument bug. */ +#undef MBRTOWC_NULL_ARG_BUG + +/* Define if the mbrtowc function does not return 0 for a NUL character. */ +#undef MBRTOWC_NUL_RETVAL_BUG + +/* Define if the mbrtowc function returns a wrong return value. */ +#undef MBRTOWC_RETVAL_BUG + /* Define if there is no specific function for reading the list of mounted file systems. fread will be used to read /etc/mnttab. (SVR2) */ #undef MOUNTED_FREAD @@ -1551,6 +1795,54 @@ /* Define to 1 if assertions should be disabled. */ #undef NDEBUG +/* Define if the vasnprintf implementation needs special code for the 'a' and + 'A' directives. */ +#undef NEED_PRINTF_DIRECTIVE_A + +/* Define if the vasnprintf implementation needs special code for the 'F' + directive. */ +#undef NEED_PRINTF_DIRECTIVE_F + +/* Define if the vasnprintf implementation needs special code for the 'ls' + directive. */ +#undef NEED_PRINTF_DIRECTIVE_LS + +/* Define if the vasnprintf implementation needs special code for 'double' + arguments. */ +#undef NEED_PRINTF_DOUBLE + +/* Define if the vasnprintf implementation needs special code for surviving + out-of-memory conditions. */ +#undef NEED_PRINTF_ENOMEM + +/* Define if the vasnprintf implementation needs special code for the ' flag. + */ +#undef NEED_PRINTF_FLAG_GROUPING + +/* Define if the vasnprintf implementation needs special code for the '-' + flag. */ +#undef NEED_PRINTF_FLAG_LEFTADJUST + +/* Define if the vasnprintf implementation needs special code for the 0 flag. + */ +#undef NEED_PRINTF_FLAG_ZERO + +/* Define if the vasnprintf implementation needs special code for infinite + 'double' arguments. */ +#undef NEED_PRINTF_INFINITE_DOUBLE + +/* Define if the vasnprintf implementation needs special code for infinite + 'long double' arguments. */ +#undef NEED_PRINTF_INFINITE_LONG_DOUBLE + +/* Define if the vasnprintf implementation needs special code for 'long + double' arguments. */ +#undef NEED_PRINTF_LONG_DOUBLE + +/* Define if the vasnprintf implementation needs special code for supporting + large precisions without arbitrary bounds. */ +#undef NEED_PRINTF_UNBOUNDED_PRECISION + /* Define to 1 if your `struct nlist' has an `n_un' member. Obsolete, depend on `HAVE_STRUCT_NLIST_N_UN_N_NAME */ #undef NLIST_NAME_UNION @@ -1558,6 +1850,9 @@ /* Define to 1 if your C compiler doesn't accept -c and -o together. */ #undef NO_MINUS_C_MINUS_O +/* Define to 1 if open() fails to recognize a trailing slash. */ +#undef OPEN_TRAILING_SLASH_BUG + /* Name of package */ #undef PACKAGE @@ -1573,6 +1868,9 @@ /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME +/* Define to the home page for this package. */ +#undef PACKAGE_URL + /* Define to the version of this package. */ #undef PACKAGE_VERSION @@ -1599,15 +1897,27 @@ 'ptrdiff_t'. */ #undef PTRDIFF_T_SUFFIX +/* Define if rename does not work when the destination file exists, as on + Windows. */ +#undef RENAME_DEST_EXISTS_BUG + /* Define if rename does not work for source file names with a trailing slash, like the one from SunOS 4.1.1_U1. */ #undef RENAME_TRAILING_SLASH_BUG +/* Define this to 1 if strerror is broken. */ +#undef REPLACE_STRERROR + /* Define if vasnprintf exists but is overridden by gnulib. */ #undef REPLACE_VASNPRINTF -/* Define if vasprintf exists but is overridden by gnulib. */ -#undef REPLACE_VASPRINTF +/* Define if vfprintf is overridden by a POSIX compliant gnulib + implementation. */ +#undef REPLACE_VFPRINTF_POSIX + +/* Define if vprintf is overridden by a POSIX compliant gnulib implementation. + */ +#undef REPLACE_VPRINTF_POSIX /* the value to which errno is set when rmdir fails on a nonempty directory */ #undef RMDIR_ERRNO_NOT_EMPTY @@ -1616,6 +1926,10 @@ 'sig_atomic_t'. */ #undef SIG_ATOMIC_T_SUFFIX +/* Define as the maximum value of type 'size_t', if the system doesn't define + it. */ +#undef SIZE_MAX + /* Define to l, ll, u, ul, ull, etc., as suitable for constants of type 'size_t'. */ #undef SIZE_T_SUFFIX @@ -1703,7 +2017,7 @@ /* Define to 1 if unlink (dir) cannot possibly succeed. */ #undef UNLINK_CANNOT_UNLINK_DIR -/* Define if you want access control list support. */ +/* Define to nonzero if you want access control list support. */ #undef USE_ACL /* Define to 1 if you want getc etc. to use unlocked I/O if available. @@ -1711,16 +2025,19 @@ safe for multithreaded apps. */ #undef USE_UNLOCKED_IO +/* Define if you want extended attribute support. */ +#undef USE_XATTR + /* Version number of package */ #undef VERSION -/* Define if unsetenv() returns void, not int. */ -#undef VOID_UNSETENV - /* Define to l, ll, u, ul, ull, etc., as suitable for constants of type 'wchar_t'. */ #undef WCHAR_T_SUFFIX +/* Define if WSAStartup is needed. */ +#undef WINDOWS_SOCKETS + /* Define if sys/ptem.h is required for struct winsize. */ #undef WINSIZE_IN_PTEM @@ -1728,24 +2045,23 @@ 'wint_t'. */ #undef WINT_T_SUFFIX -/* Define to 1 if your processor stores words with the most significant byte - first (like Motorola and SPARC, unlike Intel and VAX). */ -#undef WORDS_BIGENDIAN - -/* Define to 1 if on AIX 3. - System headers sometimes define this. - We just want to avoid a redefinition error message. */ -#ifndef _ALL_SOURCE -# undef _ALL_SOURCE +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +# undef WORDS_BIGENDIAN +# endif #endif /* Number of bits in a file offset, on hosts where this is settable. */ #undef _FILE_OFFSET_BITS -/* Enable GNU extensions on systems that have them. */ -#ifndef _GNU_SOURCE -# undef _GNU_SOURCE -#endif +/* enable compile-time and run-time bounds-checking, and some warnings */ +#undef _FORTIFY_SOURCE /* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */ #undef _LARGEFILE_SOURCE @@ -1766,16 +2082,30 @@ /* Define if you want regoff_t to be at least as wide POSIX requires. */ #undef _REGEX_LARGE_OFFSETS -/* Enable extensions on Solaris. */ -#ifndef __EXTENSIONS__ -# undef __EXTENSIONS__ +/* Define to 500 only on HP-UX. */ +#undef _XOPEN_SOURCE + +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# undef _ALL_SOURCE #endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# undef _GNU_SOURCE +#endif +/* Enable threading extensions on Solaris. */ #ifndef _POSIX_PTHREAD_SEMANTICS # undef _POSIX_PTHREAD_SEMANTICS #endif +/* Enable extensions on HP NonStop. */ #ifndef _TANDEM_SOURCE # undef _TANDEM_SOURCE #endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# undef __EXTENSIONS__ +#endif + /* Define to rpl_ if the getopt replacement functions and variables should be used. */ @@ -1787,6 +2117,13 @@ /* Define like PROTOTYPES; this can be used by system headers. */ #undef __PROTOTYPES +/* Ensure that defines the limit macros, since gnulib's + relies on them. */ +#if defined __cplusplus && !defined __STDC_LIMIT_MACROS && GL_TRIGGER_STDC_LIMIT_MACROS +# define __STDC_LIMIT_MACROS 1 +#endif + + /* Define to rpl_calloc if the replacement function should be used. */ #undef calloc @@ -1796,15 +2133,9 @@ /* Define to a replacement function name for fnmatch(). */ #undef fnmatch -/* Define to rpl_free if the replacement function should be used. */ -#undef free - /* Define as rpl_getgroups if getgroups doesn't work right. */ #undef getgroups -/* Define to a replacement function name for getline(). */ -#undef getline - /* Define to a replacement function name for getpass(). */ #undef getpass @@ -1829,6 +2160,19 @@ /* Define to long or long long if and don't define. */ #undef intmax_t +/* Work around a bug in Apple GCC 4.0.1 build 5465: In C99 mode, it supports + the ISO C 99 semantics of 'extern inline' (unlike the GNU C semantics of + earlier versions), but does not display it by setting __GNUC_STDC_INLINE__. + __APPLE__ && __MACH__ test for MacOS X. + __APPLE_CC__ tests for the Apple compiler and its version. + __STDC_VERSION__ tests for the C99 mode. */ +#if defined __APPLE__ && defined __MACH__ && __APPLE_CC__ >= 5465 && !defined __cplusplus && __STDC_VERSION__ >= 199901L && !defined __GNUC_STDC_INLINE__ +# define __GNUC_STDC_INLINE__ 1 +#endif + +/* Define to 1 if the compiler is checking for lint. */ +#undef lint + /* Define to rpl_localtime if the replacement function should be used. */ #undef localtime @@ -1847,9 +2191,6 @@ /* Define to `unsigned int' if does not define. */ #undef minor_t -/* Define to rpl_mkdir if the replacement function should be used. */ -#undef mkdir - /* Define to rpl_mktime if the replacement function should be used. */ #undef mktime @@ -1859,14 +2200,18 @@ /* Define to the name of the strftime replacement function. */ #undef my_strftime +/* Define to the type of st_nlink in struct stat, or a supertype. */ +#undef nlink_t + /* Define to `long int' if does not define. */ #undef off_t /* Define to `int' if does not define. */ #undef pid_t -/* Define to rpl_putenv if the replacement function should be used. */ -#undef putenv +/* Define as the type of the result of subtracting two pointers, if the system + doesn't define it. */ +#undef ptrdiff_t /* Define to rpl_re_comp if the replacement should be used. */ #undef re_comp @@ -1920,9 +2265,18 @@ */ #undef rename -/* Define to equivalent of C99 restrict keyword, or to nothing if this is not - supported. Do not define if restrict is supported directly. */ +/* Define to the equivalent of the C99 'restrict' keyword, or to + nothing if this is not supported. Do not define if restrict is + supported directly. */ #undef restrict +/* Work around a bug in Sun C++: it does not support _Restrict, even + though the corresponding Sun C compiler does, which causes + "#define restrict _Restrict" in the previous line. Perhaps some future + version of Sun C++ will work with _Restrict; if so, it'll probably + define __RESTRICT, just as Sun C does. */ +#if defined __SUNPRO_CC && !defined __RESTRICT +# define _Restrict +#endif /* Define to `unsigned int' if does not define. */ #undef size_t @@ -1936,17 +2290,21 @@ /* Define to rpl_strnlen if the replacement function should be used. */ #undef strnlen -/* Define to rpl_strtod if the replacement function should be used. */ -#undef strtod - /* Define to rpl_tzset if the wrapper function should be used. */ #undef tzset /* Define to `int' if doesn't define. */ #undef uid_t -/* Define to rpl_utime if the replacement function should be used. */ -#undef utime +/* Define as a marker that can be attached to function parameter declarations + for parameters that are not used. This helps to reduce warnings, such as + from GCC -Wunused-parameter. */ +#if __GNUC__ >= 3 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) +# define _UNUSED_PARAMETER_ __attribute__ ((__unused__)) +#else +# define _UNUSED_PARAMETER_ +#endif + /* Define as a macro for copying va_list variables. */ #undef va_copy diff --git a/src/bin/coreutils/lib/copy-acl.c b/src/bin/coreutils/lib/copy-acl.c new file mode 100644 index 0000000000..af85a08fb9 --- /dev/null +++ b/src/bin/coreutils/lib/copy-acl.c @@ -0,0 +1,553 @@ +/* copy-acl.c - copy access control list from one file to another file + + Copyright (C) 2002-2003, 2005-2008 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + + Written by Paul Eggert, Andreas Grünbacher, and Bruno Haible. */ + +#include + +#include "acl.h" + +#include "acl-internal.h" + +#include "gettext.h" +#define _(msgid) gettext (msgid) + + +/* Copy access control lists from one file to another. If SOURCE_DESC is + a valid file descriptor, use file descriptor operations, else use + filename based operations on SRC_NAME. Likewise for DEST_DESC and + DST_NAME. + If access control lists are not available, fchmod the target file to + MODE. Also sets the non-permission bits of the destination file + (S_ISUID, S_ISGID, S_ISVTX) to those from MODE if any are set. + Return 0 if successful. + Return -2 and set errno for an error relating to the source file. + Return -1 and set errno for an error relating to the destination file. */ + +static int +qcopy_acl (const char *src_name, int source_desc, const char *dst_name, + int dest_desc, mode_t mode) +{ +#if USE_ACL && HAVE_ACL_GET_FILE + /* POSIX 1003.1e (draft 17 -- abandoned) specific version. */ + /* Linux, FreeBSD, MacOS X, IRIX, Tru64 */ +# if MODE_INSIDE_ACL + /* Linux, FreeBSD, IRIX, Tru64 */ + + acl_t acl; + int ret; + + if (HAVE_ACL_GET_FD && source_desc != -1) + acl = acl_get_fd (source_desc); + else + acl = acl_get_file (src_name, ACL_TYPE_ACCESS); + if (acl == NULL) + { + if (ACL_NOT_WELL_SUPPORTED (errno)) + return qset_acl (dst_name, dest_desc, mode); + else + return -2; + } + + if (HAVE_ACL_SET_FD && dest_desc != -1) + ret = acl_set_fd (dest_desc, acl); + else + ret = acl_set_file (dst_name, ACL_TYPE_ACCESS, acl); + if (ret != 0) + { + int saved_errno = errno; + + if (ACL_NOT_WELL_SUPPORTED (errno) && !acl_access_nontrivial (acl)) + { + acl_free (acl); + return chmod_or_fchmod (dst_name, dest_desc, mode); + } + else + { + acl_free (acl); + chmod_or_fchmod (dst_name, dest_desc, mode); + errno = saved_errno; + return -1; + } + } + else + acl_free (acl); + + if (mode & (S_ISUID | S_ISGID | S_ISVTX)) + { + /* We did not call chmod so far, and either the mode and the ACL are + separate or special bits are to be set which don't fit into ACLs. */ + + if (chmod_or_fchmod (dst_name, dest_desc, mode) != 0) + return -1; + } + + if (S_ISDIR (mode)) + { + acl = acl_get_file (src_name, ACL_TYPE_DEFAULT); + if (acl == NULL) + return -2; + + if (acl_set_file (dst_name, ACL_TYPE_DEFAULT, acl)) + { + int saved_errno = errno; + + acl_free (acl); + errno = saved_errno; + return -1; + } + else + acl_free (acl); + } + return 0; + +# else /* !MODE_INSIDE_ACL */ + /* MacOS X */ + +# if !HAVE_ACL_TYPE_EXTENDED +# error Must have ACL_TYPE_EXTENDED +# endif + + /* On MacOS X, acl_get_file (name, ACL_TYPE_ACCESS) + and acl_get_file (name, ACL_TYPE_DEFAULT) + always return NULL / EINVAL. You have to use + acl_get_file (name, ACL_TYPE_EXTENDED) + or acl_get_fd (open (name, ...)) + to retrieve an ACL. + On the other hand, + acl_set_file (name, ACL_TYPE_ACCESS, acl) + and acl_set_file (name, ACL_TYPE_DEFAULT, acl) + have the same effect as + acl_set_file (name, ACL_TYPE_EXTENDED, acl): + Each of these calls sets the file's ACL. */ + + acl_t acl; + int ret; + + if (HAVE_ACL_GET_FD && source_desc != -1) + acl = acl_get_fd (source_desc); + else + acl = acl_get_file (src_name, ACL_TYPE_EXTENDED); + if (acl == NULL) + { + if (ACL_NOT_WELL_SUPPORTED (errno)) + return qset_acl (dst_name, dest_desc, mode); + else + return -2; + } + + if (HAVE_ACL_SET_FD && dest_desc != -1) + ret = acl_set_fd (dest_desc, acl); + else + ret = acl_set_file (dst_name, ACL_TYPE_EXTENDED, acl); + if (ret != 0) + { + int saved_errno = errno; + + if (ACL_NOT_WELL_SUPPORTED (errno) && !acl_extended_nontrivial (acl)) + { + acl_free (acl); + return chmod_or_fchmod (dst_name, dest_desc, mode); + } + else + { + acl_free (acl); + chmod_or_fchmod (dst_name, dest_desc, mode); + errno = saved_errno; + return -1; + } + } + else + acl_free (acl); + + /* Since !MODE_INSIDE_ACL, we have to call chmod explicitly. */ + return chmod_or_fchmod (dst_name, dest_desc, mode); + +# endif + +#elif USE_ACL && defined GETACL /* Solaris, Cygwin, not HP-UX */ + +# if defined ACL_NO_TRIVIAL + /* Solaris 10 (newer version), which has additional API declared in + (acl_t) and implemented in libsec (acl_set, acl_trivial, + acl_fromtext, ...). */ + + int ret; + acl_t *aclp = NULL; + ret = (source_desc < 0 + ? acl_get (src_name, ACL_NO_TRIVIAL, &aclp) + : facl_get (source_desc, ACL_NO_TRIVIAL, &aclp)); + if (ret != 0 && errno != ENOSYS) + return -2; + + ret = qset_acl (dst_name, dest_desc, mode); + if (ret != 0) + return -1; + + if (aclp) + { + ret = (dest_desc < 0 + ? acl_set (dst_name, aclp) + : facl_set (dest_desc, aclp)); + if (ret != 0) + { + int saved_errno = errno; + + acl_free (aclp); + errno = saved_errno; + return -1; + } + acl_free (aclp); + } + + return 0; + +# else /* Solaris, Cygwin, general case */ + + /* Solaris 2.5 through Solaris 10, Cygwin, and contemporaneous versions + of Unixware. The acl() call returns the access and default ACL both + at once. */ +# ifdef ACE_GETACL + int ace_count; + ace_t *ace_entries; +# endif + int count; + aclent_t *entries; + int did_chmod; + int saved_errno; + int ret; + +# ifdef ACE_GETACL + /* Solaris also has a different variant of ACLs, used in ZFS and NFSv4 + file systems (whereas the other ones are used in UFS file systems). + There is an API + pathconf (name, _PC_ACL_ENABLED) + fpathconf (desc, _PC_ACL_ENABLED) + that allows to determine which of the two kinds of ACLs is supported + for the given file. But some file systems may implement this call + incorrectly, so better not use it. + When fetching the source ACL, we simply fetch both ACL types. + When setting the destination ACL, we try either ACL types, assuming + that the kernel will translate the ACL from one form to the other. + (See in + the description of ENOTSUP.) */ + for (;;) + { + ace_count = (source_desc != -1 + ? facl (source_desc, ACE_GETACLCNT, 0, NULL) + : acl (src_name, ACE_GETACLCNT, 0, NULL)); + + if (ace_count < 0) + { + if (errno == ENOSYS || errno == EINVAL) + { + ace_count = 0; + ace_entries = NULL; + break; + } + else + return -2; + } + + if (ace_count == 0) + { + ace_entries = NULL; + break; + } + + ace_entries = (ace_t *) malloc (ace_count * sizeof (ace_t)); + if (ace_entries == NULL) + { + errno = ENOMEM; + return -2; + } + + if ((source_desc != -1 + ? facl (source_desc, ACE_GETACL, ace_count, ace_entries) + : acl (src_name, ACE_GETACL, ace_count, ace_entries)) + == ace_count) + break; + /* Huh? The number of ACL entries changed since the last call. + Repeat. */ + } +# endif + + for (;;) + { + count = (source_desc != -1 + ? facl (source_desc, GETACLCNT, 0, NULL) + : acl (src_name, GETACLCNT, 0, NULL)); + + if (count < 0) + { + if (errno == ENOSYS || errno == ENOTSUP) + { + count = 0; + entries = NULL; + break; + } + else + return -2; + } + + if (count == 0) + { + entries = NULL; + break; + } + + entries = (aclent_t *) malloc (count * sizeof (aclent_t)); + if (entries == NULL) + { + errno = ENOMEM; + return -2; + } + + if ((source_desc != -1 + ? facl (source_desc, GETACL, count, entries) + : acl (src_name, GETACL, count, entries)) + == count) + break; + /* Huh? The number of ACL entries changed since the last call. + Repeat. */ + } + + /* Is there an ACL of either kind? */ +# ifdef ACE_GETACL + if (ace_count == 0) +# endif + if (count == 0) + return qset_acl (dst_name, dest_desc, mode); + + did_chmod = 0; /* set to 1 once the mode bits in 0777 have been set */ + saved_errno = 0; /* the first non-ignorable error code */ + + if (!MODE_INSIDE_ACL) + { + /* On Cygwin, it is necessary to call chmod before acl, because + chmod can change the contents of the ACL (in ways that don't + change the allowed accesses, but still visible). */ + if (chmod_or_fchmod (dst_name, dest_desc, mode) != 0) + saved_errno = errno; + did_chmod = 1; + } + + /* If both ace_entries and entries are available, try SETACL before + ACE_SETACL, because SETACL cannot fail with ENOTSUP whereas ACE_SETACL + can. */ + + if (count > 0) + { + ret = (dest_desc != -1 + ? facl (dest_desc, SETACL, count, entries) + : acl (dst_name, SETACL, count, entries)); + if (ret < 0 && saved_errno == 0) + { + saved_errno = errno; + if (errno == ENOSYS && !acl_nontrivial (count, entries)) + saved_errno = 0; + } + else + did_chmod = 1; + } + free (entries); + +# ifdef ACE_GETACL + if (ace_count > 0) + { + ret = (dest_desc != -1 + ? facl (dest_desc, ACE_SETACL, ace_count, ace_entries) + : acl (dst_name, ACE_SETACL, ace_count, ace_entries)); + if (ret < 0 && saved_errno == 0) + { + saved_errno = errno; + if ((errno == ENOSYS || errno == EINVAL || errno == ENOTSUP) + && !acl_ace_nontrivial (ace_count, ace_entries)) + saved_errno = 0; + } + } + free (ace_entries); +# endif + + if (MODE_INSIDE_ACL + && did_chmod <= ((mode & (S_ISUID | S_ISGID | S_ISVTX)) ? 1 : 0)) + { + /* We did not call chmod so far, and either the mode and the ACL are + separate or special bits are to be set which don't fit into ACLs. */ + + if (chmod_or_fchmod (dst_name, dest_desc, mode) != 0) + { + if (saved_errno == 0) + saved_errno = errno; + } + } + + if (saved_errno) + { + errno = saved_errno; + return -1; + } + return 0; + +# endif + +#elif USE_ACL && HAVE_GETACL /* HP-UX */ + + int count; + struct acl_entry entries[NACLENTRIES]; + int ret; + + for (;;) + { + count = (source_desc != -1 + ? fgetacl (source_desc, 0, NULL) + : getacl (src_name, 0, NULL)); + + if (count < 0) + { + if (errno == ENOSYS || errno == EOPNOTSUPP) + { + count = 0; + break; + } + else + return -2; + } + + if (count == 0) + break; + + if (count > NACLENTRIES) + /* If NACLENTRIES cannot be trusted, use dynamic memory allocation. */ + abort (); + + if ((source_desc != -1 + ? fgetacl (source_desc, count, entries) + : getacl (src_name, count, entries)) + == count) + break; + /* Huh? The number of ACL entries changed since the last call. + Repeat. */ + } + + if (count == 0) + return qset_acl (dst_name, dest_desc, mode); + + ret = (dest_desc != -1 + ? fsetacl (dest_desc, count, entries) + : setacl (dst_name, count, entries)); + if (ret < 0) + { + int saved_errno = errno; + + if (errno == ENOSYS || errno == EOPNOTSUPP) + { + struct stat source_statbuf; + + if ((source_desc != -1 + ? fstat (source_desc, &source_statbuf) + : stat (src_name, &source_statbuf)) == 0) + { + if (!acl_nontrivial (count, entries, &source_statbuf)) + return chmod_or_fchmod (dst_name, dest_desc, mode); + } + else + saved_errno = errno; + } + + chmod_or_fchmod (dst_name, dest_desc, mode); + errno = saved_errno; + return -1; + } + + if (mode & (S_ISUID | S_ISGID | S_ISVTX)) + { + /* We did not call chmod so far, and either the mode and the ACL are + separate or special bits are to be set which don't fit into ACLs. */ + + return chmod_or_fchmod (dst_name, dest_desc, mode); + } + return 0; + +#elif USE_ACL && HAVE_ACLX_GET && 0 /* AIX */ + + /* TODO */ + +#elif USE_ACL && HAVE_STATACL /* older AIX */ + + union { struct acl a; char room[4096]; } u; + int ret; + + if ((source_desc != -1 + ? fstatacl (source_desc, STX_NORMAL, &u.a, sizeof (u)) + : statacl (src_name, STX_NORMAL, &u.a, sizeof (u))) + < 0) + return -2; + + ret = (dest_desc != -1 + ? fchacl (dest_desc, &u.a, u.a.acl_len) + : chacl (dst_name, &u.a, u.a.acl_len)); + if (ret < 0) + { + int saved_errno = errno; + + chmod_or_fchmod (dst_name, dest_desc, mode); + errno = saved_errno; + return -1; + } + + /* No need to call chmod_or_fchmod at this point, since the mode bits + S_ISUID, S_ISGID, S_ISVTX are also stored in the ACL. */ + + return 0; + +#else + + return qset_acl (dst_name, dest_desc, mode); + +#endif +} + + +/* Copy access control lists from one file to another. If SOURCE_DESC is + a valid file descriptor, use file descriptor operations, else use + filename based operations on SRC_NAME. Likewise for DEST_DESC and + DST_NAME. + If access control lists are not available, fchmod the target file to + MODE. Also sets the non-permission bits of the destination file + (S_ISUID, S_ISGID, S_ISVTX) to those from MODE if any are set. + Return 0 if successful, otherwise output a diagnostic and return -1. */ + +int +copy_acl (const char *src_name, int source_desc, const char *dst_name, + int dest_desc, mode_t mode) +{ + int ret = qcopy_acl (src_name, source_desc, dst_name, dest_desc, mode); + switch (ret) + { + case -2: + error (0, errno, "%s", quote (src_name)); + return -1; + + case -1: + error (0, errno, _("preserving permissions for %s"), quote (dst_name)); + return -1; + + default: + return 0; + } +} diff --git a/src/bin/coreutils/lib/creat-safer.c b/src/bin/coreutils/lib/creat-safer.c index f4a2e59db1..fc314ba432 100644 --- a/src/bin/coreutils/lib/creat-safer.c +++ b/src/bin/coreutils/lib/creat-safer.c @@ -2,10 +2,10 @@ Copyright (C) 2005, 2006 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Jim Meyering. */ diff --git a/src/bin/coreutils/lib/cycle-check.c b/src/bin/coreutils/lib/cycle-check.c index 5359d71e08..e120460e61 100644 --- a/src/bin/coreutils/lib/cycle-check.c +++ b/src/bin/coreutils/lib/cycle-check.c @@ -2,10 +2,10 @@ Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,9 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. - If not, write to the Free Software Foundation, - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Jim Meyering */ diff --git a/src/bin/coreutils/lib/cycle-check.h b/src/bin/coreutils/lib/cycle-check.h index afd7a8f2b9..ee3bf214ba 100644 --- a/src/bin/coreutils/lib/cycle-check.h +++ b/src/bin/coreutils/lib/cycle-check.h @@ -2,10 +2,10 @@ Copyright (C) 2003, 2004, 2006 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,9 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. - If not, write to the Free Software Foundation, - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Jim Meyering */ diff --git a/src/bin/coreutils/lib/diacrit.c b/src/bin/coreutils/lib/diacrit.c index fc2d6b71dd..7fe3a81f82 100644 --- a/src/bin/coreutils/lib/diacrit.c +++ b/src/bin/coreutils/lib/diacrit.c @@ -7,10 +7,10 @@ All this file is a temporary hack, waiting for locales in GNU. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -18,9 +18,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. - If not, write to the Free Software Foundation, - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ #include diff --git a/src/bin/coreutils/lib/diacrit.h b/src/bin/coreutils/lib/diacrit.h index 54eb60fadb..36b514d7a6 100644 --- a/src/bin/coreutils/lib/diacrit.h +++ b/src/bin/coreutils/lib/diacrit.h @@ -4,10 +4,10 @@ All this file is a temporary hack, waiting for locales in GNU. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -15,9 +15,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. - If not, write to the Free Software Foundation, - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ extern const char diacrit_base[]; /* characters without diacritics */ extern const char diacrit_diac[]; /* diacritic code for each character */ diff --git a/src/bin/coreutils/lib/dirchownmod.c b/src/bin/coreutils/lib/dirchownmod.c index b3e9518086..3b21a758a5 100644 --- a/src/bin/coreutils/lib/dirchownmod.c +++ b/src/bin/coreutils/lib/dirchownmod.c @@ -1,11 +1,11 @@ /* Change the ownership and mode bits of a directory. - Copyright (C) 2006 Free Software Foundation, Inc. + Copyright (C) 2006, 2007, 2008 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Paul Eggert. */ @@ -27,8 +26,6 @@ #include #include -#include "lchmod.h" -#include "lchown.h" #include "stat-macros.h" #ifndef HAVE_FCHMOD diff --git a/src/bin/coreutils/lib/dirent.in.h b/src/bin/coreutils/lib/dirent.in.h new file mode 100644 index 0000000000..15f0245b09 --- /dev/null +++ b/src/bin/coreutils/lib/dirent.in.h @@ -0,0 +1,98 @@ +/* A GNU-like . + Copyright (C) 2006-2009 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#ifndef _GL_DIRENT_H + +#if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +#endif + +/* The include_next requires a split double-inclusion guard. */ +#@INCLUDE_NEXT@ @NEXT_DIRENT_H@ + +#ifndef _GL_DIRENT_H +#define _GL_DIRENT_H + +/* The definition of GL_LINK_WARNING is copied here. */ + + +#ifdef __cplusplus +extern "C" { +#endif + +/* Declare overridden functions. */ + +#if @REPLACE_FCHDIR@ +# define opendir rpl_opendir +extern DIR * opendir (const char *); +# define closedir rpl_closedir +extern int closedir (DIR *); +#endif + +/* Declare other POSIX functions. */ + +#if @GNULIB_DIRFD@ +# if !@HAVE_DECL_DIRFD@ && !defined dirfd +/* Return the file descriptor associated with the given directory stream, + or -1 if none exists. */ +extern int dirfd (DIR const *dir); +# endif +#elif defined GNULIB_POSIXCHECK +# undef dirfd +# define dirfd(d) \ + (GL_LINK_WARNING ("dirfd is unportable - " \ + "use gnulib module dirfd for portability"), \ + dirfd (d)) +#endif + +#if @GNULIB_SCANDIR@ +/* Scan the directory DIR, calling FILTER on each directory entry. + Entries for which FILTER returns nonzero are individually malloc'd, + sorted using qsort with CMP, and collected in a malloc'd array in + *NAMELIST. Returns the number of entries selected, or -1 on error. */ +# if !@HAVE_SCANDIR@ +extern int scandir (const char *dir, struct dirent ***namelist, + int (*filter) (const struct dirent *), + int (*cmp) (const struct dirent **, const struct dirent **)); +# endif +#elif defined GNULIB_POSIXCHECK +# undef scandir +# define scandir(d,n,f,c) \ + (GL_LINK_WARNING ("scandir is unportable - " \ + "use gnulib module scandir for portability"), \ + scandir (d, n, f, c)) +#endif + +#if @GNULIB_ALPHASORT@ +/* Compare two 'struct dirent' entries alphabetically. */ +# if !@HAVE_ALPHASORT@ +extern int alphasort (const struct dirent **, const struct dirent **); +# endif +#elif defined GNULIB_POSIXCHECK +# undef alphasort +# define alphasort(a,b) \ + (GL_LINK_WARNING ("alphasort is unportable - " \ + "use gnulib module alphasort for portability"), \ + alphasort (a, b)) +#endif + +#ifdef __cplusplus +} +#endif + + +#endif /* _GL_DIRENT_H */ +#endif /* _GL_DIRENT_H */ diff --git a/src/bin/coreutils/lib/dirfd.c b/src/bin/coreutils/lib/dirfd.c index 06cb3c46f8..81993c502c 100644 --- a/src/bin/coreutils/lib/dirfd.c +++ b/src/bin/coreutils/lib/dirfd.c @@ -1,11 +1,11 @@ /* dirfd.c -- return the file descriptor associated with an open DIR* - Copyright (C) 2001, 2006 Free Software Foundation, Inc. + Copyright (C) 2001, 2006, 2008-2009 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,17 +13,20 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Jim Meyering. */ #include -#include "dirfd.h" +#include +#include int dirfd (DIR const *dir_p) { - return DIR_TO_FD (dir_p); + int fd = DIR_TO_FD (dir_p); + if (fd == -1) + errno = ENOTSUP; + return fd; } diff --git a/src/bin/coreutils/lib/dirfd.h b/src/bin/coreutils/lib/dirfd.h deleted file mode 100644 index 05b77774f6..0000000000 --- a/src/bin/coreutils/lib/dirfd.h +++ /dev/null @@ -1,29 +0,0 @@ -/* Declare dirfd, if necessary. - Copyright (C) 2001, 2002, 2006 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - - Written by Jim Meyering. */ - -#include - -#include - -#ifndef HAVE_DECL_DIRFD -"this configure-time declaration test was not run" -#endif -#if !HAVE_DECL_DIRFD && !defined dirfd -int dirfd (DIR const *); -#endif diff --git a/src/bin/coreutils/lib/dirname.c b/src/bin/coreutils/lib/dirname.c index 16552c64d2..c27e5b5d8b 100644 --- a/src/bin/coreutils/lib/dirname.c +++ b/src/bin/coreutils/lib/dirname.c @@ -3,10 +3,10 @@ Copyright (C) 1990, 1998, 2000, 2001, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ #include diff --git a/src/bin/coreutils/lib/dirname.h b/src/bin/coreutils/lib/dirname.h index 91e7ed3366..f592350b81 100644 --- a/src/bin/coreutils/lib/dirname.h +++ b/src/bin/coreutils/lib/dirname.h @@ -2,10 +2,10 @@ Copyright (C) 1998, 2001, 2003-2006 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ #ifndef DIRNAME_H_ # define DIRNAME_H_ 1 diff --git a/src/bin/coreutils/lib/dup-safer.c b/src/bin/coreutils/lib/dup-safer.c index 7b12b615ca..7d9b2be349 100644 --- a/src/bin/coreutils/lib/dup-safer.c +++ b/src/bin/coreutils/lib/dup-safer.c @@ -1,11 +1,12 @@ /* Invoke dup, but avoid some glitches. - Copyright (C) 2001, 2004, 2005, 2006 Free Software Foundation, Inc. + Copyright (C) 2001, 2004, 2005, 2006, 2009 Free Software + Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Paul Eggert. */ @@ -25,9 +25,6 @@ #include #include -#ifndef STDERR_FILENO -# define STDERR_FILENO 2 -#endif /* Like dup, but do not return STDIN_FILENO, STDOUT_FILENO, or STDERR_FILENO. */ diff --git a/src/bin/coreutils/lib/dup2.c b/src/bin/coreutils/lib/dup2.c index 88944817cf..09990823be 100644 --- a/src/bin/coreutils/lib/dup2.c +++ b/src/bin/coreutils/lib/dup2.c @@ -2,10 +2,10 @@ Copyright (C) 1999, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* written by Paul Eggert */ diff --git a/src/bin/coreutils/lib/errno.in.h b/src/bin/coreutils/lib/errno.in.h new file mode 100644 index 0000000000..a69170cff6 --- /dev/null +++ b/src/bin/coreutils/lib/errno.in.h @@ -0,0 +1,158 @@ +/* -*- buffer-read-only: t -*- vi: set ro: */ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 +/* A POSIX-like . + + Copyright (C) 2008 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + +#ifndef _GL_ERRNO_H + +#if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +#endif + +/* The include_next requires a split double-inclusion guard. */ +#@INCLUDE_NEXT@ @NEXT_ERRNO_H@ + +#ifndef _GL_ERRNO_H +#define _GL_ERRNO_H + + +/* On native Windows platforms, many macros are not defined. */ +# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ + +/* POSIX says that EAGAIN and EWOULDBLOCK may have the same value. */ +# define EWOULDBLOCK EAGAIN + +/* Values >= 100 seem safe to use. */ +# define ETXTBSY 100 +# define GNULIB_defined_ETXTBSY 1 + +/* These are intentionally the same values as the WSA* error numbers, defined + in . */ +# define EINPROGRESS 10036 +# define EALREADY 10037 +# define ENOTSOCK 10038 +# define EDESTADDRREQ 10039 +# define EMSGSIZE 10040 +# define EPROTOTYPE 10041 +# define ENOPROTOOPT 10042 +# define EPROTONOSUPPORT 10043 +# define ESOCKTNOSUPPORT 10044 /* not required by POSIX */ +# define EOPNOTSUPP 10045 +# define EPFNOSUPPORT 10046 /* not required by POSIX */ +# define EAFNOSUPPORT 10047 +# define EADDRINUSE 10048 +# define EADDRNOTAVAIL 10049 +# define ENETDOWN 10050 +# define ENETUNREACH 10051 +# define ENETRESET 10052 +# define ECONNABORTED 10053 +# define ECONNRESET 10054 +# define ENOBUFS 10055 +# define EISCONN 10056 +# define ENOTCONN 10057 +# define ESHUTDOWN 10058 /* not required by POSIX */ +# define ETOOMANYREFS 10059 /* not required by POSIX */ +# define ETIMEDOUT 10060 +# define ECONNREFUSED 10061 +# define ELOOP 10062 +# define EHOSTDOWN 10064 /* not required by POSIX */ +# define EHOSTUNREACH 10065 +# define EPROCLIM 10067 /* not required by POSIX */ +# define EUSERS 10068 /* not required by POSIX */ +# define EDQUOT 10069 +# define ESTALE 10070 +# define EREMOTE 10071 /* not required by POSIX */ +# define GNULIB_defined_ESOCK 1 + +# endif + + +/* On OSF/1 5.1, when _XOPEN_SOURCE_EXTENDED is not defined, the macros + EMULTIHOP, ENOLINK, EOVERFLOW are not defined. */ +# if @EMULTIHOP_HIDDEN@ +# define EMULTIHOP @EMULTIHOP_VALUE@ +# define GNULIB_defined_EMULTIHOP 1 +# endif +# if @ENOLINK_HIDDEN@ +# define ENOLINK @ENOLINK_VALUE@ +# define GNULIB_defined_ENOLINK 1 +# endif +# if @EOVERFLOW_HIDDEN@ +# define EOVERFLOW @EOVERFLOW_VALUE@ +# define GNULIB_defined_EOVERFLOW 1 +# endif + + +/* On OpenBSD 4.0 and on native Windows, the macros ENOMSG, EIDRM, ENOLINK, + EPROTO, EMULTIHOP, EBADMSG, EOVERFLOW, ENOTSUP, ECANCELED are not defined. + Define them here. Values >= 2000 seem safe to use: Solaris ESTALE = 151, + HP-UX EWOULDBLOCK = 246, IRIX EDQUOT = 1133. + + Note: When one of these systems defines some of these macros some day, + binaries will have to be recompiled so that they recognizes the new + errno values from the system. */ + +# ifndef ENOMSG +# define ENOMSG 2000 +# define GNULIB_defined_ENOMSG 1 +# endif + +# ifndef EIDRM +# define EIDRM 2001 +# define GNULIB_defined_EIDRM 1 +# endif + +# ifndef ENOLINK +# define ENOLINK 2002 +# define GNULIB_defined_ENOLINK 1 +# endif + +# ifndef EPROTO +# define EPROTO 2003 +# define GNULIB_defined_EPROTO 1 +# endif + +# ifndef EMULTIHOP +# define EMULTIHOP 2004 +# define GNULIB_defined_EMULTIHOP 1 +# endif + +# ifndef EBADMSG +# define EBADMSG 2005 +# define GNULIB_defined_EBADMSG 1 +# endif + +# ifndef EOVERFLOW +# define EOVERFLOW 2006 +# define GNULIB_defined_EOVERFLOW 1 +# endif + +# ifndef ENOTSUP +# define ENOTSUP 2007 +# define GNULIB_defined_ENOTSUP 1 +# endif + +# ifndef ECANCELED +# define ECANCELED 2008 +# define GNULIB_defined_ECANCELED 1 +# endif + + +#endif /* _GL_ERRNO_H */ +#endif /* _GL_ERRNO_H */ diff --git a/src/bin/coreutils/lib/error.c b/src/bin/coreutils/lib/error.c index cf86343320..3177bd5d2c 100644 --- a/src/bin/coreutils/lib/error.c +++ b/src/bin/coreutils/lib/error.c @@ -1,20 +1,19 @@ /* Error handler for noninteractive utilities - Copyright (C) 1990-1998, 2000-2005, 2006 Free Software Foundation, Inc. + Copyright (C) 1990-1998, 2000-2007 Free Software Foundation, Inc. This file is part of the GNU C Library. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ /* Written by David MacKenzie . */ @@ -31,6 +30,7 @@ #if !_LIBC && ENABLE_NLS # include "gettext.h" +# define _(msgid) gettext (msgid) #endif #ifdef _LIBC diff --git a/src/bin/coreutils/lib/error.h b/src/bin/coreutils/lib/error.h index 5a5f247658..6d49681146 100644 --- a/src/bin/coreutils/lib/error.h +++ b/src/bin/coreutils/lib/error.h @@ -1,27 +1,26 @@ /* Declaration for error-reporting function - Copyright (C) 1995, 1996, 1997, 2003, 2006 Free Software Foundation, Inc. + Copyright (C) 1995, 1996, 1997, 2003, 2006, 2008 Free Software Foundation, Inc. This file is part of the GNU C Library. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ #ifndef _ERROR_H #define _ERROR_H 1 #ifndef __attribute__ /* This feature is available in gcc versions 2.5 and later. */ -# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__ +# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) # define __attribute__(Spec) /* empty */ # endif /* The __-protected variants of `format' and `printf' attributes diff --git a/src/bin/coreutils/lib/euidaccess-stat.c b/src/bin/coreutils/lib/euidaccess-stat.c index 7663c463ee..2cc516108d 100644 --- a/src/bin/coreutils/lib/euidaccess-stat.c +++ b/src/bin/coreutils/lib/euidaccess-stat.c @@ -4,19 +4,18 @@ Copyright (C) 2005, 2006 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ /* Adapted for use in GNU remove.c by Jim Meyering. */ diff --git a/src/bin/coreutils/lib/euidaccess.c b/src/bin/coreutils/lib/euidaccess.c index 5148a5b3e3..17eb724972 100644 --- a/src/bin/coreutils/lib/euidaccess.c +++ b/src/bin/coreutils/lib/euidaccess.c @@ -1,30 +1,28 @@ /* euidaccess -- check if effective user id can access file - Copyright (C) 1990, 1991, 1995, 1998, 2000, 2003, 2004, 2005, 2006 + Copyright (C) 1990, 1991, 1995, 1998, 2000, 2003, 2004, 2005, 2006, 2008 Free Software Foundation, Inc. This file is part of the GNU C Library. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ /* Written by David MacKenzie and Torbjorn Granlund. Adapted for GNU C library by Roland McGrath. */ #ifndef _LIBC # include -# include "euidaccess.h" #endif #include diff --git a/src/bin/coreutils/lib/euidaccess.h b/src/bin/coreutils/lib/euidaccess.h deleted file mode 100644 index 17b7e98138..0000000000 --- a/src/bin/coreutils/lib/euidaccess.h +++ /dev/null @@ -1,3 +0,0 @@ -#if ! HAVE_DECL_EUIDACCESS -int euidaccess (char const *file, int mode); -#endif diff --git a/src/bin/coreutils/lib/exclude.c b/src/bin/coreutils/lib/exclude.c index ed34d0f1f7..f38abf2ba6 100644 --- a/src/bin/coreutils/lib/exclude.c +++ b/src/bin/coreutils/lib/exclude.c @@ -3,10 +3,10 @@ Copyright (C) 1992, 1993, 1994, 1997, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,9 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. - If not, write to the Free Software Foundation, - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Paul Eggert */ diff --git a/src/bin/coreutils/lib/exclude.h b/src/bin/coreutils/lib/exclude.h index 203e38485d..7d03bc12ad 100644 --- a/src/bin/coreutils/lib/exclude.h +++ b/src/bin/coreutils/lib/exclude.h @@ -3,10 +3,10 @@ Copyright (C) 1992, 1993, 1994, 1997, 1999, 2001, 2002, 2003, 2005, 2006 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,9 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. - If not, write to the Free Software Foundation, - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Paul Eggert */ diff --git a/src/bin/coreutils/lib/exitfail.c b/src/bin/coreutils/lib/exitfail.c index 373d325c5a..6d1fe4aea0 100644 --- a/src/bin/coreutils/lib/exitfail.c +++ b/src/bin/coreutils/lib/exitfail.c @@ -2,10 +2,10 @@ Copyright (C) 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,9 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. - If not, write to the Free Software Foundation, - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ #include diff --git a/src/bin/coreutils/lib/exitfail.h b/src/bin/coreutils/lib/exitfail.h index e46cf9c166..713f2591a7 100644 --- a/src/bin/coreutils/lib/exitfail.h +++ b/src/bin/coreutils/lib/exitfail.h @@ -2,10 +2,10 @@ Copyright (C) 2002 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +13,6 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. - If not, write to the Free Software Foundation, - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ extern int volatile exit_failure; diff --git a/src/bin/coreutils/lib/fchdir.c b/src/bin/coreutils/lib/fchdir.c index e3ec2fcf6d..969e984c95 100644 --- a/src/bin/coreutils/lib/fchdir.c +++ b/src/bin/coreutils/lib/fchdir.c @@ -1,10 +1,10 @@ /* fchdir replacement. - Copyright (C) 2006, 2007 Free Software Foundation, Inc. + Copyright (C) 2006-2008 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,14 +12,14 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ #include /* Specification. */ #include +#include #include #include #include @@ -27,10 +27,8 @@ #include #include #include -#include #include "canonicalize.h" -#include "dirfd.h" /* This replacement assumes that a directory is not renamed while opened through a file descriptor. */ @@ -76,84 +74,53 @@ ensure_dirs_slot (size_t fd) } } -/* Override open() and close(), to keep track of the open file descriptors. */ +/* Hook into the gnulib replacements for open() and close() to keep track + of the open file descriptors. */ -int -close (int fd) -#undef close +void +_gl_unregister_fd (int fd) { - int retval = close (fd); - - if (retval >= 0 && fd >= 0 && fd < dirs_allocated) + if (fd >= 0 && fd < dirs_allocated) { if (dirs[fd].name != NULL) free (dirs[fd].name); dirs[fd].name = NULL; dirs[fd].saved_errno = ENOTDIR; } - return retval; } -int -open (const char *filename, int flags, ...) -#undef open +void +_gl_register_fd (int fd, const char *filename) { - mode_t mode; - int fd; struct stat statbuf; - mode = 0; - if (flags & O_CREAT) + ensure_dirs_slot (fd); + if (fd < dirs_allocated + && fstat (fd, &statbuf) >= 0 && S_ISDIR (statbuf.st_mode)) { - va_list arg; - va_start (arg, flags); - - /* If mode_t is narrower than int, use the promoted type (int), - not mode_t. Use sizeof to guess whether mode_t is narrower; - we don't know of any practical counterexamples. */ - mode = (sizeof (mode_t) < sizeof (int) - ? va_arg (arg, int) - : va_arg (arg, mode_t)); - - va_end (arg); + dirs[fd].name = canonicalize_file_name (filename); + if (dirs[fd].name == NULL) + dirs[fd].saved_errno = errno; } - fd = open (filename, flags, mode); - if (fd >= 0) - { - ensure_dirs_slot (fd); - if (fd < dirs_allocated - && fstat (fd, &statbuf) >= 0 && S_ISDIR (statbuf.st_mode)) - { - dirs[fd].name = canonicalize_file_name (filename); - if (dirs[fd].name == NULL) - dirs[fd].saved_errno = errno; - } - } - return fd; } /* Override opendir() and closedir(), to keep track of the open file descriptors. Needed because there is a function dirfd(). */ int -closedir (DIR *dp) +rpl_closedir (DIR *dp) #undef closedir { int fd = dirfd (dp); int retval = closedir (dp); - if (retval >= 0 && fd >= 0 && fd < dirs_allocated) - { - if (dirs[fd].name != NULL) - free (dirs[fd].name); - dirs[fd].name = NULL; - dirs[fd].saved_errno = ENOTDIR; - } + if (retval >= 0) + _gl_unregister_fd (fd); return retval; } DIR * -opendir (const char *filename) +rpl_opendir (const char *filename) #undef opendir { DIR *dp; @@ -163,15 +130,7 @@ opendir (const char *filename) { int fd = dirfd (dp); if (fd >= 0) - { - ensure_dirs_slot (fd); - if (fd < dirs_allocated) - { - dirs[fd].name = canonicalize_file_name (filename); - if (dirs[fd].name == NULL) - dirs[fd].saved_errno = errno; - } - } + _gl_register_fd (fd, filename); } return dp; } @@ -179,7 +138,7 @@ opendir (const char *filename) /* Override dup() and dup2(), to keep track of open file descriptors. */ int -dup (int oldfd) +rpl_dup (int oldfd) #undef dup { int newfd = dup (oldfd); @@ -214,7 +173,7 @@ dup (int oldfd) } int -dup2 (int oldfd, int newfd) +rpl_dup2 (int oldfd, int newfd) #undef dup2 { int retval = dup2 (oldfd, newfd); diff --git a/src/bin/coreutils/lib/fchmodat.c b/src/bin/coreutils/lib/fchmodat.c index 2598b7015f..935bdcbca1 100644 --- a/src/bin/coreutils/lib/fchmodat.c +++ b/src/bin/coreutils/lib/fchmodat.c @@ -1,10 +1,10 @@ /* Change the protections of file relative to an open directory. Copyright (C) 2006 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* written by Jim Meyering */ diff --git a/src/bin/coreutils/lib/fchownat.c b/src/bin/coreutils/lib/fchownat.c index 801c92a07e..a1d5e60f21 100644 --- a/src/bin/coreutils/lib/fchownat.c +++ b/src/bin/coreutils/lib/fchownat.c @@ -6,10 +6,10 @@ Copyright (C) 2006-2007 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -17,8 +17,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* written by Jim Meyering */ @@ -29,7 +28,6 @@ #include #include "dirname.h" /* solely for definition of IS_ABSOLUTE_FILE_NAME */ -#include "lchown.h" #include "save-cwd.h" #include "openat-priv.h" diff --git a/src/bin/coreutils/lib/fclose.c b/src/bin/coreutils/lib/fclose.c new file mode 100644 index 0000000000..a0074b77d7 --- /dev/null +++ b/src/bin/coreutils/lib/fclose.c @@ -0,0 +1,47 @@ +/* fclose replacement. + Copyright (C) 2008 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#include + +/* Specification. */ +#include + +#include +#include + +/* Override fclose() to call the overridden close(). */ + +int +rpl_fclose (FILE *fp) +#undef fclose +{ + int saved_errno = 0; + + if (fflush (fp)) + saved_errno = errno; + + if (close (fileno (fp)) < 0 && saved_errno == 0) + saved_errno = errno; + + fclose (fp); /* will fail with errno = EBADF */ + + if (saved_errno != 0) + { + errno = saved_errno; + return EOF; + } + return 0; +} diff --git a/src/bin/coreutils/lib/fcntl--.h b/src/bin/coreutils/lib/fcntl--.h index 51b869e687..5a6a8792d0 100644 --- a/src/bin/coreutils/lib/fcntl--.h +++ b/src/bin/coreutils/lib/fcntl--.h @@ -2,10 +2,10 @@ Copyright (C) 2005 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Paul Eggert. */ diff --git a/src/bin/coreutils/lib/fcntl-safer.h b/src/bin/coreutils/lib/fcntl-safer.h index cab6aab1ad..99f38656d0 100644 --- a/src/bin/coreutils/lib/fcntl-safer.h +++ b/src/bin/coreutils/lib/fcntl-safer.h @@ -2,10 +2,10 @@ Copyright (C) 2005 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Paul Eggert. */ diff --git a/src/bin/coreutils/lib/fcntl_.h b/src/bin/coreutils/lib/fcntl.in.h similarity index 61% rename from src/bin/coreutils/lib/fcntl_.h rename to src/bin/coreutils/lib/fcntl.in.h index 758b5bdb3d..fd7520e8da 100644 --- a/src/bin/coreutils/lib/fcntl_.h +++ b/src/bin/coreutils/lib/fcntl.in.h @@ -1,11 +1,11 @@ /* Like , but with non-working flags defined to 0. - Copyright (C) 2006 Free Software Foundation, Inc. + Copyright (C) 2006-2008 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,18 +13,35 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* written by Paul Eggert */ -#ifndef _GL_FCNTL_H -#define _GL_FCNTL_H +#if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +#endif + +#if defined __need_system_fcntl_h +/* Special invocation convention. */ #include #include #include -#include @ABSOLUTE_FCNTL_H@ +#@INCLUDE_NEXT@ @NEXT_FCNTL_H@ + +#else +/* Normal invocation convention. */ + +#ifndef _GL_FCNTL_H + +#include +#include +#include +/* The include_next requires a split double-inclusion guard. */ +#@INCLUDE_NEXT@ @NEXT_FCNTL_H@ + +#ifndef _GL_FCNTL_H +#define _GL_FCNTL_H /* Declare overridden functions. */ @@ -33,9 +50,17 @@ extern "C" { #endif +#if @GNULIB_OPEN@ +# if @REPLACE_OPEN@ +# undef open +# define open rpl_open +extern int open (const char *filename, int flags, ...); +# endif +#endif + #ifdef FCHDIR_REPLACEMENT -# define open rpl_open -extern int open (const char *, int, ...); +/* gnulib internal function. */ +extern void _gl_register_fd (int fd, const char *filename); #endif #ifdef __cplusplus @@ -102,8 +127,8 @@ extern int open (const char *, int, ...); # define O_TEXT _O_TEXT #endif -#if (defined(__BEOS__) || defined(__HAIKU__)) - /* BeOS 5 has O_BINARY and O_TEXT, but they have no effect. */ +#if defined __BEOS__ || defined __HAIKU__ + /* BeOS 5 and Haiku have O_BINARY and O_TEXT, but they have no effect. */ # undef O_BINARY # undef O_TEXT #endif @@ -113,4 +138,7 @@ extern int open (const char *, int, ...); # define O_TEXT 0 #endif + +#endif /* _GL_FCNTL_H */ +#endif /* _GL_FCNTL_H */ #endif diff --git a/src/bin/coreutils/lib/fd-reopen.c b/src/bin/coreutils/lib/fd-reopen.c index 99376e380d..c12fef6029 100644 --- a/src/bin/coreutils/lib/fd-reopen.c +++ b/src/bin/coreutils/lib/fd-reopen.c @@ -1,11 +1,11 @@ /* Invoke open, but return either a desired file descriptor or -1. - Copyright (C) 2005, 2006 Free Software Foundation, Inc. + Copyright (C) 2005, 2006, 2008 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Paul Eggert. */ @@ -32,15 +31,13 @@ int fd_reopen (int desired_fd, char const *file, int flags, mode_t mode) { - int fd; + int fd = open (file, flags, mode); - close (desired_fd); - fd = open (file, flags, mode); if (fd == desired_fd || fd < 0) return fd; else { - int fd2 = fcntl (fd, F_DUPFD, desired_fd); + int fd2 = dup2 (fd, desired_fd); int saved_errno = errno; close (fd); errno = saved_errno; diff --git a/src/bin/coreutils/lib/fd-reopen.h b/src/bin/coreutils/lib/fd-reopen.h index af4bcfeb4b..ff008dc108 100644 --- a/src/bin/coreutils/lib/fd-reopen.h +++ b/src/bin/coreutils/lib/fd-reopen.h @@ -2,10 +2,10 @@ Copyright (C) 2005 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Paul Eggert. */ diff --git a/src/bin/coreutils/lib/fd-safer.c b/src/bin/coreutils/lib/fd-safer.c index 256bfa4a0e..fb9900180e 100644 --- a/src/bin/coreutils/lib/fd-safer.c +++ b/src/bin/coreutils/lib/fd-safer.c @@ -1,11 +1,11 @@ /* Return a safer copy of a file descriptor. - Copyright (C) 2005, 2006 Free Software Foundation, Inc. + Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Paul Eggert. */ @@ -25,12 +24,6 @@ #include #include -#ifndef STDIN_FILENO -# define STDIN_FILENO 0 -#endif -#ifndef STDERR_FILENO -# define STDERR_FILENO 2 -#endif /* Return FD, unless FD would be a copy of standard input, output, or error; in that case, return a duplicate of FD, closing FD. On diff --git a/src/bin/coreutils/lib/fflush.c b/src/bin/coreutils/lib/fflush.c new file mode 100644 index 0000000000..9f75ccdc13 --- /dev/null +++ b/src/bin/coreutils/lib/fflush.c @@ -0,0 +1,204 @@ +/* fflush.c -- allow flushing input streams + Copyright (C) 2007-2009 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* Written by Eric Blake. */ + +#include + +/* Specification. */ +#include + +#include +#include + +#include "freading.h" +#include "fpurge.h" + +#include "stdio-impl.h" + +#undef fflush + + +#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ + +/* Clear the stream's ungetc buffer, preserving the value of ftello (fp). */ +static inline void +clear_ungetc_buffer_preserving_position (FILE *fp) +{ + if (fp->_flags & _IO_IN_BACKUP) + /* _IO_free_backup_area is a bit complicated. Simply call fseek. */ + fseek (fp, 0, SEEK_CUR); +} + +#else + +/* Clear the stream's ungetc buffer. May modify the value of ftello (fp). */ +static inline void +clear_ungetc_buffer (FILE *fp) +{ +# if defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, MacOS X, Cygwin */ + if (HASUB (fp)) + { + fp_->_p += fp_->_r; + fp_->_r = 0; + } +# elif defined __EMX__ /* emx+gcc */ + if (fp->_ungetc_count > 0) + { + fp->_ungetc_count = 0; + fp->_rcount = - fp->_rcount; + } +# elif defined _IOERR /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw */ + /* Nothing to do. */ +# else /* other implementations */ + fseek (fp, 0, SEEK_CUR); +# endif +} + +#endif + +#if (defined __sferror || defined __DragonFly__) && defined __SNPT /* FreeBSD, NetBSD, OpenBSD, DragonFly, MacOS X, Cygwin */ + +static inline int +disable_seek_optimization (FILE *fp) +{ + int saved_flags = fp_->_flags & (__SOPT | __SNPT); + fp_->_flags = (fp_->_flags & ~__SOPT) | __SNPT; + return saved_flags; +} + +static inline void +restore_seek_optimization (FILE *fp, int saved_flags) +{ + fp_->_flags = (fp_->_flags & ~(__SOPT | __SNPT)) | saved_flags; +} + +#endif + +static inline void +update_fpos_cache (FILE *fp, off_t pos) +{ +#if defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, MacOS X, Cygwin */ + fp_->_offset = pos; + fp_->_flags |= __SOFF; +#endif +} + +/* Flush all pending data on STREAM according to POSIX rules. Both + output and seekable input streams are supported. */ +int +rpl_fflush (FILE *stream) +{ + /* When stream is NULL, POSIX and C99 only require flushing of "output + streams and update streams in which the most recent operation was not + input", and all implementations do this. + + When stream is "an output stream or an update stream in which the most + recent operation was not input", POSIX and C99 requires that fflush + writes out any buffered data, and all implementations do this. + + When stream is, however, an input stream or an update stream in + which the most recent operation was input, C99 specifies nothing, + and POSIX only specifies behavior if the stream is seekable. + mingw, in particular, drops the input buffer, leaving the file + descriptor positioned at the end of the input buffer. I.e. ftell + (stream) is lost. We don't want to call the implementation's + fflush in this case. + + We test ! freading (stream) here, rather than fwriting (stream), because + what we need to know is whether the stream holds a "read buffer", and on + mingw this is indicated by _IOREAD, regardless of _IOWRT. */ + if (stream == NULL || ! freading (stream)) + return fflush (stream); + +#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ + + clear_ungetc_buffer_preserving_position (stream); + + return fflush (stream); + +#else + { + /* Notes about the file-position indicator: + 1) The file position indicator is incremented by fgetc() and decremented + by ungetc(): + + "... the fgetc() function shall ... advance the associated file + position indicator for the stream ..." + + "The file-position indicator is decremented by each successful + call to ungetc()..." + 2) says: + "The value of the file-position indicator for the stream after + reading or discarding all pushed-back bytes shall be the same + as it was before the bytes were pushed back." + Here we are discarding all pushed-back bytes. But more specifically, + 3) says: + "[After fflush(),] the file offset of the underlying open file + description shall be set to the file position of the stream, and + any characters pushed back onto the stream by ungetc() ... shall + be discarded." */ + + /* POSIX does not specify fflush behavior for non-seekable input + streams. Some implementations purge unread data, some return + EBADF, some do nothing. */ + off_t pos = ftello (stream); + if (pos == -1) + { + errno = EBADF; + return EOF; + } + + /* Clear the ungetc buffer. */ + clear_ungetc_buffer (stream); + + /* To get here, we must be flushing a seekable input stream, so the + semantics of fpurge are now appropriate to clear the buffer. To + avoid losing data, the lseek is also necessary. */ + { + int result = fpurge (stream); + if (result != 0) + return result; + } + +# if (defined __sferror || defined __DragonFly__) && defined __SNPT /* FreeBSD, NetBSD, OpenBSD, DragonFly, MacOS X, Cygwin */ + + { + /* Disable seek optimization for the next fseeko call. This tells the + following fseeko call to seek to the desired position directly, rather + than to seek to a block-aligned boundary. */ + int saved_flags = disable_seek_optimization (stream); + int result = fseeko (stream, pos, SEEK_SET); + + restore_seek_optimization (stream, saved_flags); + return result; + } + +# else + + pos = lseek (fileno (stream), pos, SEEK_SET); + if (pos == -1) + return EOF; + /* After a successful lseek, update the file descriptor's position cache + in the stream. */ + update_fpos_cache (stream, pos); + + return 0; + +# endif + } +#endif +} diff --git a/src/bin/coreutils/lib/file-has-acl.c b/src/bin/coreutils/lib/file-has-acl.c index 218f52ec86..c3b77c395f 100644 --- a/src/bin/coreutils/lib/file-has-acl.c +++ b/src/bin/coreutils/lib/file-has-acl.c @@ -1,11 +1,11 @@ /* Test whether a file has a nontrivial access control list. - Copyright (C) 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc. + Copyright (C) 2002-2003, 2005-2009 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,10 +13,9 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + along with this program. If not, see . - Written by Paul Eggert and Andreas Gruenbacher. */ + Written by Paul Eggert, Andreas Grünbacher, and Bruno Haible. */ #include @@ -24,6 +23,250 @@ #include "acl-internal.h" + +#if USE_ACL && HAVE_ACL_GET_FILE + +# if HAVE_ACL_TYPE_EXTENDED /* MacOS X */ + +/* ACL is an ACL, from a file, stored as type ACL_TYPE_EXTENDED. + Return 1 if the given ACL is non-trivial. + Return 0 if it is trivial. */ +int +acl_extended_nontrivial (acl_t acl) +{ + /* acl is non-trivial if it is non-empty. */ + return (acl_entries (acl) > 0); +} + +# else /* Linux, FreeBSD, IRIX, Tru64 */ + +/* ACL is an ACL, from a file, stored as type ACL_TYPE_ACCESS. + Return 1 if the given ACL is non-trivial. + Return 0 if it is trivial, i.e. equivalent to a simple stat() mode. + Return -1 and set errno upon failure to determine it. */ +int +acl_access_nontrivial (acl_t acl) +{ + /* acl is non-trivial if it has some entries other than for "user::", + "group::", and "other::". Normally these three should be present + at least, allowing us to write + return (3 < acl_entries (acl)); + but the following code is more robust. */ +# if HAVE_ACL_FIRST_ENTRY /* Linux, FreeBSD */ + + acl_entry_t ace; + int got_one; + + for (got_one = acl_get_entry (acl, ACL_FIRST_ENTRY, &ace); + got_one > 0; + got_one = acl_get_entry (acl, ACL_NEXT_ENTRY, &ace)) + { + acl_tag_t tag; + if (acl_get_tag_type (ace, &tag) < 0) + return -1; + if (!(tag == ACL_USER_OBJ || tag == ACL_GROUP_OBJ || tag == ACL_OTHER)) + return 1; + } + return got_one; + +# else /* IRIX, Tru64 */ +# if HAVE_ACL_TO_SHORT_TEXT /* IRIX */ + /* Don't use acl_get_entry: it is undocumented. */ + + int count = acl->acl_cnt; + int i; + + for (i = 0; i < count; i++) + { + acl_entry_t ace = &acl->acl_entry[i]; + acl_tag_t tag = ace->ae_tag; + + if (!(tag == ACL_USER_OBJ || tag == ACL_GROUP_OBJ + || tag == ACL_OTHER_OBJ)) + return 1; + } + return 0; + +# endif +# if HAVE_ACL_FREE_TEXT /* Tru64 */ + /* Don't use acl_get_entry: it takes only one argument and does not work. */ + + int count = acl->acl_num; + acl_entry_t ace; + + for (ace = acl->acl_first; count > 0; ace = ace->next, count--) + { + acl_tag_t tag; + acl_perm_t perm; + + tag = ace->entry->acl_type; + if (!(tag == ACL_USER_OBJ || tag == ACL_GROUP_OBJ || tag == ACL_OTHER)) + return 1; + + perm = ace->entry->acl_perm; + /* On Tru64, perm can also contain non-standard bits such as + PERM_INSERT, PERM_DELETE, PERM_MODIFY, PERM_LOOKUP, ... */ + if ((perm & ~(ACL_READ | ACL_WRITE | ACL_EXECUTE)) != 0) + return 1; + } + return 0; + +# endif +# endif +} + +# endif + + +#elif USE_ACL && HAVE_ACL && defined GETACL /* Solaris, Cygwin, not HP-UX */ + +# if !defined ACL_NO_TRIVIAL /* Solaris <= 10, Cygwin */ + +/* Test an ACL retrieved with GETACL. + Return 1 if the given ACL, consisting of COUNT entries, is non-trivial. + Return 0 if it is trivial, i.e. equivalent to a simple stat() mode. */ +int +acl_nontrivial (int count, aclent_t *entries) +{ + int i; + + for (i = 0; i < count; i++) + { + aclent_t *ace = &entries[i]; + + /* Note: If ace->a_type = USER_OBJ, ace->a_id is the st_uid from stat(). + If ace->a_type = GROUP_OBJ, ace->a_id is the st_gid from stat(). + We don't need to check ace->a_id in these cases. */ + if (!(ace->a_type == USER_OBJ + || ace->a_type == GROUP_OBJ + || ace->a_type == OTHER_OBJ + /* Note: Cygwin does not return a CLASS_OBJ ("mask:") entry + sometimes. */ + || ace->a_type == CLASS_OBJ)) + return 1; + } + return 0; +} + +# ifdef ACE_GETACL + +/* Test an ACL retrieved with ACE_GETACL. + Return 1 if the given ACL, consisting of COUNT entries, is non-trivial. + Return 0 if it is trivial, i.e. equivalent to a simple stat() mode. */ +int +acl_ace_nontrivial (int count, ace_t *entries) +{ + int i; + + /* The flags in the ace_t structure changed in a binary incompatible way + when ACL_NO_TRIVIAL etc. were introduced in version 1.15. + How to distinguish the two conventions at runtime? + In the old convention, usually three ACEs have a_flags = ACE_OWNER / + ACE_GROUP / ACE_OTHER, in the range 0x0100..0x0400. In the new + convention, these values are not used. */ + int old_convention = 0; + + for (i = 0; i < count; i++) + if (entries[i].a_flags & (ACE_OWNER | ACE_GROUP | ACE_OTHER)) + { + old_convention = 1; + break; + } + + if (old_convention) + /* Running on Solaris 10. */ + for (i = 0; i < count; i++) + { + ace_t *ace = &entries[i]; + + /* Note: + If ace->a_flags = ACE_OWNER, ace->a_who is the st_uid from stat(). + If ace->a_flags = ACE_GROUP, ace->a_who is the st_gid from stat(). + We don't need to check ace->a_who in these cases. */ + if (!(ace->a_type == ALLOW + && (ace->a_flags == ACE_OWNER + || ace->a_flags == ACE_GROUP + || ace->a_flags == ACE_OTHER))) + return 1; + } + else + /* Running on Solaris 10 (newer version) or Solaris 11. */ + for (i = 0; i < count; i++) + { + ace_t *ace = &entries[i]; + + if (!(ace->a_type == ACE_ACCESS_ALLOWED_ACE_TYPE + && (ace->a_flags == NEW_ACE_OWNER + || ace->a_flags + == (NEW_ACE_GROUP | NEW_ACE_IDENTIFIER_GROUP) + || ace->a_flags == ACE_EVERYONE) + && (ace->a_access_mask + & ~(NEW_ACE_READ_DATA | NEW_ACE_WRITE_DATA | NEW_ACE_EXECUTE)) + == 0)) + return 1; + } + + return 0; +} + +# endif + +# endif + +#elif USE_ACL && HAVE_GETACL /* HP-UX */ + +/* Return 1 if the given ACL is non-trivial. + Return 0 if it is trivial, i.e. equivalent to a simple stat() mode. */ +int +acl_nontrivial (int count, struct acl_entry *entries, struct stat *sb) +{ + int i; + + for (i = 0; i < count; i++) + { + struct acl_entry *ace = &entries[i]; + + if (!((ace->uid == sb->st_uid && ace->gid == ACL_NSGROUP) + || (ace->uid == ACL_NSUSER && ace->gid == sb->st_gid) + || (ace->uid == ACL_NSUSER && ace->gid == ACL_NSGROUP))) + return 1; + } + return 0; +} + +#elif USE_ACL && HAVE_ACLX_GET && 0 /* AIX */ + +/* TODO */ + +#elif USE_ACL && HAVE_STATACL /* older AIX */ + +/* Return 1 if the given ACL is non-trivial. + Return 0 if it is trivial, i.e. equivalent to a simple stat() mode. */ +int +acl_nontrivial (struct acl *a) +{ + /* The normal way to iterate through an ACL is like this: + struct acl_entry *ace; + for (ace = a->acl_ext; ace != acl_last (a); ace = acl_nxt (ace)) + { + struct ace_id *aei; + switch (ace->ace_type) + { + case ACC_PERMIT: + case ACC_DENY: + case ACC_SPECIFY: + ...; + } + for (aei = ace->ace_id; aei != id_last (ace); aei = id_nxt (aei)) + ... + } + */ + return (acl_last (a) != a->acl_ext ? 1 : 0); +} + +#endif + + /* Return 1 if NAME has a nontrivial access control list, 0 if NAME only has no or a base access control list, and -1 (setting errno) on error. SB must be set to the stat buffer of FILE. */ @@ -31,34 +274,58 @@ int file_has_acl (char const *name, struct stat const *sb) { +#if USE_ACL if (! S_ISLNK (sb->st_mode)) { -#if USE_ACL && HAVE_ACL_TRIVIAL - - /* Solaris 10, which also has NFSv4 and ZFS style ACLs. */ - return acl_trivial (name); - -#elif USE_ACL && HAVE_ACL && defined GETACLCNT - - /* Solaris 2.5 through Solaris 9, and contemporaneous versions of - HP-UX and Unixware. */ - int n = acl (name, GETACLCNT, 0, NULL); - return n < 0 ? (errno == ENOSYS ? 0 : -1) : (MIN_ACL_ENTRIES < n); - -#elif USE_ACL && HAVE_ACL_GET_FILE && HAVE_ACL_FREE +# if HAVE_ACL_GET_FILE /* POSIX 1003.1e (draft 17 -- abandoned) specific version. */ + /* Linux, FreeBSD, MacOS X, IRIX, Tru64 */ int ret; - if (HAVE_ACL_EXTENDED_FILE) - ret = acl_extended_file (name); - else + if (HAVE_ACL_EXTENDED_FILE) /* Linux */ { + /* On Linux, acl_extended_file is an optimized function: It only + makes two calls to getxattr(), one for ACL_TYPE_ACCESS, one for + ACL_TYPE_DEFAULT. */ + ret = acl_extended_file (name); + } + else /* FreeBSD, MacOS X, IRIX, Tru64 */ + { +# if HAVE_ACL_TYPE_EXTENDED /* MacOS X */ + /* On MacOS X, acl_get_file (name, ACL_TYPE_ACCESS) + and acl_get_file (name, ACL_TYPE_DEFAULT) + always return NULL / EINVAL. There is no point in making + these two useless calls. The real ACL is retrieved through + acl_get_file (name, ACL_TYPE_EXTENDED). */ + acl_t acl = acl_get_file (name, ACL_TYPE_EXTENDED); + if (acl) + { + ret = acl_extended_nontrivial (acl); + acl_free (acl); + } + else + ret = -1; +# else /* FreeBSD, IRIX, Tru64 */ acl_t acl = acl_get_file (name, ACL_TYPE_ACCESS); if (acl) { - ret = (3 < acl_entries (acl)); + int saved_errno; + + ret = acl_access_nontrivial (acl); + saved_errno = errno; acl_free (acl); + errno = saved_errno; +# if HAVE_ACL_FREE_TEXT /* Tru64 */ + /* On OSF/1, acl_get_file (name, ACL_TYPE_DEFAULT) always + returns NULL with errno not set. There is no point in + making this call. */ +# else /* FreeBSD, IRIX */ + /* On Linux, FreeBSD, IRIX, acl_get_file (name, ACL_TYPE_ACCESS) + and acl_get_file (name, ACL_TYPE_DEFAULT) on a directory + either both succeed or both fail; it depends on the + filesystem. Therefore there is no point in making the second + call if the first one already failed. */ if (ret == 0 && S_ISDIR (sb->st_mode)) { acl = acl_get_file (name, ACL_TYPE_DEFAULT); @@ -70,18 +337,184 @@ file_has_acl (char const *name, struct stat const *sb) else ret = -1; } +# endif } else ret = -1; +# endif } if (ret < 0) return ACL_NOT_WELL_SUPPORTED (errno) ? 0 : -1; return ret; -#endif - } - /* FIXME: Add support for AIX, Irix, and Tru64. Please see Samba's - source/lib/sysacls.c file for fix-related ideas. */ +# elif HAVE_ACL && defined GETACLCNT /* Solaris, Cygwin, not HP-UX */ + +# if defined ACL_NO_TRIVIAL + + /* Solaris 10 (newer version), which has additional API declared in + (acl_t) and implemented in libsec (acl_set, acl_trivial, + acl_fromtext, ...). */ + return acl_trivial (name); + +# else /* Solaris, Cygwin, general case */ + + /* Solaris 2.5 through Solaris 10, Cygwin, and contemporaneous versions + of Unixware. The acl() call returns the access and default ACL both + at once. */ + int count; + { + aclent_t *entries; + + for (;;) + { + count = acl (name, GETACLCNT, 0, NULL); + + if (count < 0) + { + if (errno == ENOSYS || errno == ENOTSUP) + break; + else + return -1; + } + + if (count == 0) + break; + + /* Don't use MIN_ACL_ENTRIES: It's set to 4 on Cygwin, but Cygwin + returns only 3 entries for files with no ACL. But this is safe: + If there are more than 4 entries, there cannot be only the + "user::", "group::", "other:", and "mask:" entries. */ + if (count > 4) + return 1; + + entries = (aclent_t *) malloc (count * sizeof (aclent_t)); + if (entries == NULL) + { + errno = ENOMEM; + return -1; + } + if (acl (name, GETACL, count, entries) == count) + { + if (acl_nontrivial (count, entries)) + { + free (entries); + return 1; + } + free (entries); + break; + } + /* Huh? The number of ACL entries changed since the last call. + Repeat. */ + free (entries); + } + } + +# ifdef ACE_GETACL + /* Solaris also has a different variant of ACLs, used in ZFS and NFSv4 + file systems (whereas the other ones are used in UFS file systems). */ + { + ace_t *entries; + + for (;;) + { + count = acl (name, ACE_GETACLCNT, 0, NULL); + + if (count < 0) + { + if (errno == ENOSYS || errno == EINVAL) + break; + else + return -1; + } + + if (count == 0) + break; + + /* If there are more than 3 entries, there cannot be only the + ACE_OWNER, ACE_GROUP, ACE_OTHER entries. */ + if (count > 3) + return 1; + + entries = (ace_t *) malloc (count * sizeof (ace_t)); + if (entries == NULL) + { + errno = ENOMEM; + return -1; + } + if (acl (name, ACE_GETACL, count, entries) == count) + { + if (acl_ace_nontrivial (count, entries)) + { + free (entries); + return 1; + } + free (entries); + break; + } + /* Huh? The number of ACL entries changed since the last call. + Repeat. */ + free (entries); + } + } +# endif + + return 0; +# endif + +# elif HAVE_GETACL /* HP-UX */ + + int count; + struct acl_entry entries[NACLENTRIES]; + + for (;;) + { + count = getacl (name, 0, NULL); + + if (count < 0) + return (errno == ENOSYS || errno == EOPNOTSUPP ? 0 : -1); + + if (count == 0) + return 0; + + if (count > NACLENTRIES) + /* If NACLENTRIES cannot be trusted, use dynamic memory + allocation. */ + abort (); + + /* If there are more than 3 entries, there cannot be only the + (uid,%), (%,gid), (%,%) entries. */ + if (count > 3) + return 1; + + if (getacl (name, count, entries) == count) + { + struct stat statbuf; + + if (stat (name, &statbuf) < 0) + return -1; + + return acl_nontrivial (count, entries, &statbuf); + } + /* Huh? The number of ACL entries changed since the last call. + Repeat. */ + } + +# elif HAVE_ACLX_GET && 0 /* AIX */ + + /* TODO: use aclx_get(), and then? */ + +# elif HAVE_STATACL /* older AIX */ + + union { struct acl a; char room[4096]; } u; + + if (statacl (name, STX_NORMAL, &u.a, sizeof (u)) < 0) + return -1; + + return acl_nontrivial (&u.a); + +# endif + } +#endif return 0; } diff --git a/src/bin/coreutils/lib/file-set.c b/src/bin/coreutils/lib/file-set.c new file mode 100644 index 0000000000..46dcf5fbb4 --- /dev/null +++ b/src/bin/coreutils/lib/file-set.c @@ -0,0 +1,74 @@ +/* Specialized functions to manipulate a set of files. + Copyright (C) 2007 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* written by Jim Meyering */ + +#include +#include "file-set.h" + +#include "hash-triple.h" +#include "xalloc.h" + +/* Record file, FILE, and dev/ino from *STATS, in the hash table, HT. + If HT is NULL, return immediately. + If memory allocation fails, exit immediately. */ +void +record_file (Hash_table *ht, char const *file, struct stat const *stats) +{ + struct F_triple *ent; + + if (ht == NULL) + return; + + ent = xmalloc (sizeof *ent); + ent->name = xstrdup (file); + ent->st_ino = stats->st_ino; + ent->st_dev = stats->st_dev; + + { + struct F_triple *ent_from_table = hash_insert (ht, ent); + if (ent_from_table == NULL) + { + /* Insertion failed due to lack of memory. */ + xalloc_die (); + } + + if (ent_from_table != ent) + { + /* There was alread a matching entry in the table, so ENT was + not inserted. Free it. */ + triple_free (ent); + } + } +} + +/* Return true if there is an entry in hash table, HT, + for the file described by FILE and STATS. */ +bool +seen_file (Hash_table const *ht, char const *file, + struct stat const *stats) +{ + struct F_triple new_ent; + + if (ht == NULL) + return false; + + new_ent.name = (char *) file; + new_ent.st_ino = stats->st_ino; + new_ent.st_dev = stats->st_dev; + + return !!hash_lookup (ht, &new_ent); +} diff --git a/src/bin/coreutils/lib/file-set.h b/src/bin/coreutils/lib/file-set.h new file mode 100644 index 0000000000..a5a159e94d --- /dev/null +++ b/src/bin/coreutils/lib/file-set.h @@ -0,0 +1,12 @@ +#include +#include +#include + +#include "hash.h" + +extern void record_file (Hash_table *ht, char const *file, + struct stat const *stats) + __attribute__((nonnull(2, 3))); + +extern bool seen_file (Hash_table const *ht, char const *file, + struct stat const *stats); diff --git a/src/bin/coreutils/lib/file-type.c b/src/bin/coreutils/lib/file-type.c index 9fc7c524bd..3035f75f9d 100644 --- a/src/bin/coreutils/lib/file-type.c +++ b/src/bin/coreutils/lib/file-type.c @@ -3,10 +3,10 @@ Copyright (C) 1993, 1994, 2001, 2002, 2004, 2005, 2006 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Paul Eggert. */ diff --git a/src/bin/coreutils/lib/file-type.h b/src/bin/coreutils/lib/file-type.h index 1f4ca3da68..5596d7866e 100644 --- a/src/bin/coreutils/lib/file-type.h +++ b/src/bin/coreutils/lib/file-type.h @@ -3,10 +3,10 @@ Copyright (C) 1993, 1994, 2001, 2002, 2004, 2005 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Paul Eggert and Jim Meyering. */ diff --git a/src/bin/coreutils/lib/fileblocks.c b/src/bin/coreutils/lib/fileblocks.c index 4024d1ef24..822935af93 100644 --- a/src/bin/coreutils/lib/fileblocks.c +++ b/src/bin/coreutils/lib/fileblocks.c @@ -3,10 +3,10 @@ Copyright (C) 1990, 1997, 1998, 1999, 2004, 2005, 2006 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Brian L. Matthews, blm@6sceng.UUCP. */ diff --git a/src/bin/coreutils/lib/filemode.c b/src/bin/coreutils/lib/filemode.c index 726c331b7f..ac62bfc6ef 100644 --- a/src/bin/coreutils/lib/filemode.c +++ b/src/bin/coreutils/lib/filemode.c @@ -3,10 +3,10 @@ Copyright (C) 1985, 1990, 1993, 1998-2000, 2004, 2006 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ #include diff --git a/src/bin/coreutils/lib/filemode.h b/src/bin/coreutils/lib/filemode.h index f71d994e01..29deecdc75 100644 --- a/src/bin/coreutils/lib/filemode.h +++ b/src/bin/coreutils/lib/filemode.h @@ -2,10 +2,10 @@ Copyright (C) 1998, 1999, 2003, 2006 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ #ifndef FILEMODE_H_ diff --git a/src/bin/coreutils/lib/filenamecat.c b/src/bin/coreutils/lib/filenamecat.c index bccffb25d8..ef46de209a 100644 --- a/src/bin/coreutils/lib/filenamecat.c +++ b/src/bin/coreutils/lib/filenamecat.c @@ -1,12 +1,11 @@ /* Concatenate two arbitrary file names. - Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, - 2005, 2006 Free Software Foundation, Inc. + Copyright (C) 1996-2007 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Jim Meyering. */ @@ -24,6 +22,7 @@ /* Specification. */ #include "filenamecat.h" +#include #include #include "dirname.h" @@ -57,10 +56,10 @@ longest_relative_suffix (char const *f) set *BASE_IN_RESULT to point to the sole corresponding slash that is copied into the result buffer. - Report an error if memory is exhausted. */ + Return NULL if malloc fails. */ char * -file_name_concat (char const *dir, char const *abase, char **base_in_result) +mfile_name_concat (char const *dir, char const *abase, char **base_in_result) { char const *dirbase = last_component (dir); size_t dirbaselen = base_len (dirbase); @@ -70,9 +69,12 @@ file_name_concat (char const *dir, char const *abase, char **base_in_result) char const *base = longest_relative_suffix (abase); size_t baselen = strlen (base); - char *p_concat = xmalloc (dirlen + needs_separator + baselen + 1); + char *p_concat = malloc (dirlen + needs_separator + baselen + 1); char *p; + if (p_concat == NULL) + return NULL; + p = mempcpy (p_concat, dir, dirlen); *p = DIRECTORY_SEPARATOR; p += needs_separator; @@ -86,39 +88,15 @@ file_name_concat (char const *dir, char const *abase, char **base_in_result) return p_concat; } -#ifdef TEST_FILE_NAME_CONCAT -# include -# include -int -main () -{ - static char const *const tests[][3] = - { - {"a", "b", "a/b"}, - {"a/", "b", "a/b"}, - {"a/", "/b", "a/b"}, - {"a", "/b", "a/b"}, +/* Just like mfile_name_concat, above, except, rather than + returning NULL upon malloc failure, here, we report the + "memory exhausted" condition and exit. */ - {"/", "b", "/b"}, - {"/", "/b", "/b"}, - {"/", "/", "/"}, - {"a", "/", "a/"}, /* this might deserve a diagnostic */ - {"/a", "/", "/a/"}, /* this might deserve a diagnostic */ - {"a", "//b", "a/b"}, - }; - size_t i; - bool fail = false; - for (i = 0; i < sizeof tests / sizeof tests[0]; i++) - { - char *base_in_result; - char const *const *t = tests[i]; - char *res = file_name_concat (t[0], t[1], &base_in_result); - if (strcmp (res, t[2]) != 0) - { - printf ("got %s, expected %s\n", res, t[2]); - fail = true; - } - } - exit (fail ? EXIT_FAILURE : EXIT_SUCCESS); +char * +file_name_concat (char const *dir, char const *abase, char **base_in_result) +{ + char *p = mfile_name_concat (dir, abase, base_in_result); + if (p == NULL) + xalloc_die (); + return p; } -#endif diff --git a/src/bin/coreutils/lib/filenamecat.h b/src/bin/coreutils/lib/filenamecat.h index c943b67d77..334c887c77 100644 --- a/src/bin/coreutils/lib/filenamecat.h +++ b/src/bin/coreutils/lib/filenamecat.h @@ -1,11 +1,11 @@ /* Concatenate two arbitrary file names. - Copyright (C) 1996, 1997, 2003, 2005 Free Software Foundation, Inc. + Copyright (C) 1996, 1997, 2003, 2005, 2007 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,10 +13,12 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Jim Meyering. */ char *file_name_concat (char const *dir, char const *base, char **base_in_result); + +char *mfile_name_concat (char const *dir, char const *base, + char **base_in_result); diff --git a/src/bin/coreutils/lib/filevercmp.c b/src/bin/coreutils/lib/filevercmp.c new file mode 100644 index 0000000000..20522d1c4c --- /dev/null +++ b/src/bin/coreutils/lib/filevercmp.c @@ -0,0 +1,181 @@ +/* + Copyright (C) 1995 Ian Jackson + Copyright (C) 2001 Anthony Towns + Copyright (C) 2008-2009 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#include +#include "filevercmp.h" + +#include +#include +#include +#include +#include +#include + +/* Match a file suffix defined by this regular expression: + /(\.[A-Za-z~][A-Za-z0-9~]*)*$/ + Scan the string *STR and return a pointer to the matching suffix, or + NULL if not found. Upon return, *STR points to terminating NUL. */ +static const char * +match_suffix (const char **str) +{ + const char *match = NULL; + bool read_alpha = false; + while (**str) + { + if (read_alpha) + { + read_alpha = false; + if (!c_isalpha (**str) && '~' != **str) + match = NULL; + } + else if ('.' == **str) + { + read_alpha = true; + if (!match) + match = *str; + } + else if (!c_isalnum (**str) && '~' != **str) + match = NULL; + (*str)++; + } + return match; +} + +/* verrevcmp helper function */ +static inline int +order (unsigned char c) +{ + if (c_isdigit (c)) + return 0; + else if (c_isalpha (c)) + return c; + else if (c == '~') + return -1; + else + return (int) c + UCHAR_MAX + 1; +} + +/* slightly modified verrevcmp function from dpkg + S1, S2 - compared string + S1_LEN, S2_LEN - length of strings to be scanned + + This implements the algorithm for comparison of version strings + specified by Debian and now widely adopted. The detailed + specification can be found in the Debian Policy Manual in the + section on the `Version' control field. This version of the code + implements that from s5.6.12 of Debian Policy v3.8.0.1 + http://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Version */ +static int +verrevcmp (const char *s1, size_t s1_len, const char *s2, size_t s2_len) +{ + size_t s1_pos = 0; + size_t s2_pos = 0; + while (s1_pos < s1_len || s2_pos < s2_len) + { + int first_diff = 0; + while ((s1_pos < s1_len && !c_isdigit (s1[s1_pos])) + || (s2_pos < s2_len && !c_isdigit (s2[s2_pos]))) + { + int s1_c = (s1_pos == s1_len) ? 0 : order (s1[s1_pos]); + int s2_c = (s2_pos == s2_len) ? 0 : order (s2[s2_pos]); + if (s1_c != s2_c) + return s1_c - s2_c; + s1_pos++; + s2_pos++; + } + while (s1[s1_pos] == '0') + s1_pos++; + while (s2[s2_pos] == '0') + s2_pos++; + while (c_isdigit (s1[s1_pos]) && c_isdigit (s2[s2_pos])) + { + if (!first_diff) + first_diff = s1[s1_pos] - s2[s2_pos]; + s1_pos++; + s2_pos++; + } + if (c_isdigit (s1[s1_pos])) + return 1; + if (c_isdigit (s2[s2_pos])) + return -1; + if (first_diff) + return first_diff; + } + return 0; +} + +/* Compare version strings S1 and S2. + See filevercmp.h for function description. */ +int +filevercmp (const char *s1, const char *s2) +{ + const char *s1_pos; + const char *s2_pos; + const char *s1_suffix, *s2_suffix; + size_t s1_len, s2_len; + int result; + + /* easy comparison to see if strings are identical */ + int simple_cmp = strcmp (s1, s2); + if (simple_cmp == 0) + return 0; + + /* special handle for "", "." and ".." */ + if (!*s1) + return -1; + if (!*s2) + return 1; + if (0 == strcmp (".", s1)) + return -1; + if (0 == strcmp (".", s2)) + return 1; + if (0 == strcmp ("..", s1)) + return -1; + if (0 == strcmp ("..", s2)) + return 1; + + /* special handle for other hidden files */ + if (*s1 == '.' && *s2 != '.') + return -1; + if (*s1 != '.' && *s2 == '.') + return 1; + if (*s1 == '.' && *s2 == '.') + { + s1++; + s2++; + } + + /* "cut" file suffixes */ + s1_pos = s1; + s2_pos = s2; + s1_suffix = match_suffix (&s1_pos); + s2_suffix = match_suffix (&s2_pos); + s1_len = (s1_suffix ? s1_suffix : s1_pos) - s1; + s2_len = (s2_suffix ? s2_suffix : s2_pos) - s2; + + /* restore file suffixes if strings are identical after "cut" */ + if ((s1_suffix || s2_suffix) && (s1_len == s2_len) + && 0 == strncmp (s1, s2, s1_len)) + { + s1_len = s1_pos - s1; + s2_len = s2_pos - s2; + } + + result = verrevcmp (s1, s1_len, s2, s2_len); + return result == 0 ? simple_cmp : result; +} diff --git a/src/bin/coreutils/lib/filevercmp.h b/src/bin/coreutils/lib/filevercmp.h new file mode 100644 index 0000000000..f3d78f0cdc --- /dev/null +++ b/src/bin/coreutils/lib/filevercmp.h @@ -0,0 +1,42 @@ +/* + Copyright (C) 1995 Ian Jackson + Copyright (C) 2001 Anthony Towns + Copyright (C) 2008-2009 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#ifndef FILEVERCMP_H +#define FILEVERCMP_H + +/* Compare version strings: + + This function compares strings S1 and S2: + 1) By PREFIX in the same way as strcmp. + 2) Then by VERSION (most similarly to version compare of Debian's dpkg). + Leading zeros in version numbers are ignored. + 3) If both (PREFIX and VERSION) are equal, strcmp function is used for + comparison. So this function can return 0 if (and only if) strings S1 + and S2 are identical. + + It returns number >0 for S1 > S2, 0 for S1 == S2 and number <0 for S1 < S2. + + This function compares strings, in a way that if VER1 and VER2 are version + numbers and PREFIX and SUFFIX (SUFFIX defined as (\.[A-Za-z~][A-Za-z0-9~]*)*) + are strings then VER1 < VER2 implies filevercmp (PREFIX VER1 SUFFIX, + PREFIX VER2 SUFFIX) < 0. + + This function is intended to be a replacement for strverscmp. */ +int filevercmp (const char *s1, const char *s2); + +#endif /* FILEVERCMP_H */ diff --git a/src/bin/coreutils/lib/float+.h b/src/bin/coreutils/lib/float+.h new file mode 100644 index 0000000000..f401cabc88 --- /dev/null +++ b/src/bin/coreutils/lib/float+.h @@ -0,0 +1,151 @@ +/* -*- buffer-read-only: t -*- vi: set ro: */ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 +/* Supplemental information about the floating-point formats. + Copyright (C) 2007 Free Software Foundation, Inc. + Written by Bruno Haible , 2007. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + +#ifndef _FLOATPLUS_H +#define _FLOATPLUS_H + +#include +#include + +/* Number of bits in the mantissa of a floating-point number, including the + "hidden bit". */ +#if FLT_RADIX == 2 +# define FLT_MANT_BIT FLT_MANT_DIG +# define DBL_MANT_BIT DBL_MANT_DIG +# define LDBL_MANT_BIT LDBL_MANT_DIG +#elif FLT_RADIX == 4 +# define FLT_MANT_BIT (FLT_MANT_DIG * 2) +# define DBL_MANT_BIT (DBL_MANT_DIG * 2) +# define LDBL_MANT_BIT (LDBL_MANT_DIG * 2) +#elif FLT_RADIX == 16 +# define FLT_MANT_BIT (FLT_MANT_DIG * 4) +# define DBL_MANT_BIT (DBL_MANT_DIG * 4) +# define LDBL_MANT_BIT (LDBL_MANT_DIG * 4) +#endif + +/* Bit mask that can be used to mask the exponent, as an unsigned number. */ +#define FLT_EXP_MASK ((FLT_MAX_EXP - FLT_MIN_EXP) | 7) +#define DBL_EXP_MASK ((DBL_MAX_EXP - DBL_MIN_EXP) | 7) +#define LDBL_EXP_MASK ((LDBL_MAX_EXP - LDBL_MIN_EXP) | 7) + +/* Number of bits used for the exponent of a floating-point number, including + the exponent's sign. */ +#define FLT_EXP_BIT \ + (FLT_EXP_MASK < 0x100 ? 8 : \ + FLT_EXP_MASK < 0x200 ? 9 : \ + FLT_EXP_MASK < 0x400 ? 10 : \ + FLT_EXP_MASK < 0x800 ? 11 : \ + FLT_EXP_MASK < 0x1000 ? 12 : \ + FLT_EXP_MASK < 0x2000 ? 13 : \ + FLT_EXP_MASK < 0x4000 ? 14 : \ + FLT_EXP_MASK < 0x8000 ? 15 : \ + FLT_EXP_MASK < 0x10000 ? 16 : \ + FLT_EXP_MASK < 0x20000 ? 17 : \ + FLT_EXP_MASK < 0x40000 ? 18 : \ + FLT_EXP_MASK < 0x80000 ? 19 : \ + FLT_EXP_MASK < 0x100000 ? 20 : \ + FLT_EXP_MASK < 0x200000 ? 21 : \ + FLT_EXP_MASK < 0x400000 ? 22 : \ + FLT_EXP_MASK < 0x800000 ? 23 : \ + FLT_EXP_MASK < 0x1000000 ? 24 : \ + FLT_EXP_MASK < 0x2000000 ? 25 : \ + FLT_EXP_MASK < 0x4000000 ? 26 : \ + FLT_EXP_MASK < 0x8000000 ? 27 : \ + FLT_EXP_MASK < 0x10000000 ? 28 : \ + FLT_EXP_MASK < 0x20000000 ? 29 : \ + FLT_EXP_MASK < 0x40000000 ? 30 : \ + FLT_EXP_MASK <= 0x7fffffff ? 31 : \ + 32) +#define DBL_EXP_BIT \ + (DBL_EXP_MASK < 0x100 ? 8 : \ + DBL_EXP_MASK < 0x200 ? 9 : \ + DBL_EXP_MASK < 0x400 ? 10 : \ + DBL_EXP_MASK < 0x800 ? 11 : \ + DBL_EXP_MASK < 0x1000 ? 12 : \ + DBL_EXP_MASK < 0x2000 ? 13 : \ + DBL_EXP_MASK < 0x4000 ? 14 : \ + DBL_EXP_MASK < 0x8000 ? 15 : \ + DBL_EXP_MASK < 0x10000 ? 16 : \ + DBL_EXP_MASK < 0x20000 ? 17 : \ + DBL_EXP_MASK < 0x40000 ? 18 : \ + DBL_EXP_MASK < 0x80000 ? 19 : \ + DBL_EXP_MASK < 0x100000 ? 20 : \ + DBL_EXP_MASK < 0x200000 ? 21 : \ + DBL_EXP_MASK < 0x400000 ? 22 : \ + DBL_EXP_MASK < 0x800000 ? 23 : \ + DBL_EXP_MASK < 0x1000000 ? 24 : \ + DBL_EXP_MASK < 0x2000000 ? 25 : \ + DBL_EXP_MASK < 0x4000000 ? 26 : \ + DBL_EXP_MASK < 0x8000000 ? 27 : \ + DBL_EXP_MASK < 0x10000000 ? 28 : \ + DBL_EXP_MASK < 0x20000000 ? 29 : \ + DBL_EXP_MASK < 0x40000000 ? 30 : \ + DBL_EXP_MASK <= 0x7fffffff ? 31 : \ + 32) +#define LDBL_EXP_BIT \ + (LDBL_EXP_MASK < 0x100 ? 8 : \ + LDBL_EXP_MASK < 0x200 ? 9 : \ + LDBL_EXP_MASK < 0x400 ? 10 : \ + LDBL_EXP_MASK < 0x800 ? 11 : \ + LDBL_EXP_MASK < 0x1000 ? 12 : \ + LDBL_EXP_MASK < 0x2000 ? 13 : \ + LDBL_EXP_MASK < 0x4000 ? 14 : \ + LDBL_EXP_MASK < 0x8000 ? 15 : \ + LDBL_EXP_MASK < 0x10000 ? 16 : \ + LDBL_EXP_MASK < 0x20000 ? 17 : \ + LDBL_EXP_MASK < 0x40000 ? 18 : \ + LDBL_EXP_MASK < 0x80000 ? 19 : \ + LDBL_EXP_MASK < 0x100000 ? 20 : \ + LDBL_EXP_MASK < 0x200000 ? 21 : \ + LDBL_EXP_MASK < 0x400000 ? 22 : \ + LDBL_EXP_MASK < 0x800000 ? 23 : \ + LDBL_EXP_MASK < 0x1000000 ? 24 : \ + LDBL_EXP_MASK < 0x2000000 ? 25 : \ + LDBL_EXP_MASK < 0x4000000 ? 26 : \ + LDBL_EXP_MASK < 0x8000000 ? 27 : \ + LDBL_EXP_MASK < 0x10000000 ? 28 : \ + LDBL_EXP_MASK < 0x20000000 ? 29 : \ + LDBL_EXP_MASK < 0x40000000 ? 30 : \ + LDBL_EXP_MASK <= 0x7fffffff ? 31 : \ + 32) + +/* Number of bits used for a floating-point number: the mantissa (not + counting the "hidden bit", since it may or may not be explicit), the + exponent, and the sign. */ +#define FLT_TOTAL_BIT ((FLT_MANT_BIT - 1) + FLT_EXP_BIT + 1) +#define DBL_TOTAL_BIT ((DBL_MANT_BIT - 1) + DBL_EXP_BIT + 1) +#define LDBL_TOTAL_BIT ((LDBL_MANT_BIT - 1) + LDBL_EXP_BIT + 1) + +/* Number of bytes used for a floating-point number. + This can be smaller than the 'sizeof'. For example, on i386 systems, + 'long double' most often have LDBL_MANT_BIT = 64, LDBL_EXP_BIT = 16, hence + LDBL_TOTAL_BIT = 80 bits, i.e. 10 bytes of consecutive memory, but + sizeof (long double) = 12 or = 16. */ +#define SIZEOF_FLT ((FLT_TOTAL_BIT + CHAR_BIT - 1) / CHAR_BIT) +#define SIZEOF_DBL ((DBL_TOTAL_BIT + CHAR_BIT - 1) / CHAR_BIT) +#define SIZEOF_LDBL ((LDBL_TOTAL_BIT + CHAR_BIT - 1) / CHAR_BIT) + +/* Verify that SIZEOF_FLT <= sizeof (float) etc. */ +typedef int verify_sizeof_flt[2 * (SIZEOF_FLT <= sizeof (float)) - 1]; +typedef int verify_sizeof_dbl[2 * (SIZEOF_DBL <= sizeof (double)) - 1]; +typedef int verify_sizeof_ldbl[2 * (SIZEOF_LDBL <= sizeof (long double)) - 1]; + +#endif /* _FLOATPLUS_H */ diff --git a/src/bin/coreutils/lib/float.in.h b/src/bin/coreutils/lib/float.in.h new file mode 100644 index 0000000000..9ba2bce4b5 --- /dev/null +++ b/src/bin/coreutils/lib/float.in.h @@ -0,0 +1,62 @@ +/* A correct . + + Copyright (C) 2007-2008 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#ifndef _GL_FLOAT_H + +#if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +#endif + +/* The include_next requires a split double-inclusion guard. */ +#@INCLUDE_NEXT@ @NEXT_FLOAT_H@ + +#ifndef _GL_FLOAT_H +#define _GL_FLOAT_H + +/* 'long double' properties. */ +#if defined __i386__ && (defined __BEOS__ || defined __OpenBSD__) +/* Number of mantissa units, in base FLT_RADIX. */ +# undef LDBL_MANT_DIG +# define LDBL_MANT_DIG 64 +/* Number of decimal digits that is sufficient for representing a number. */ +# undef LDBL_DIG +# define LDBL_DIG 18 +/* x-1 where x is the smallest representable number > 1. */ +# undef LDBL_EPSILON +# define LDBL_EPSILON 1.0842021724855044340E-19L +/* Minimum e such that FLT_RADIX^(e-1) is a normalized number. */ +# undef LDBL_MIN_EXP +# define LDBL_MIN_EXP (-16381) +/* Maximum e such that FLT_RADIX^(e-1) is a representable finite number. */ +# undef LDBL_MAX_EXP +# define LDBL_MAX_EXP 16384 +/* Minimum positive normalized number. */ +# undef LDBL_MIN +# define LDBL_MIN 3.3621031431120935063E-4932L +/* Maximum representable finite number. */ +# undef LDBL_MAX +# define LDBL_MAX 1.1897314953572317650E+4932L +/* Minimum e such that 10^e is in the range of normalized numbers. */ +# undef LDBL_MIN_10_EXP +# define LDBL_MIN_10_EXP (-4931) +/* Maximum e such that 10^e is in the range of representable finite numbers. */ +# undef LDBL_MAX_10_EXP +# define LDBL_MAX_10_EXP 4932 +#endif + +#endif /* _GL_FLOAT_H */ +#endif /* _GL_FLOAT_H */ diff --git a/src/bin/coreutils/lib/fnmatch.c b/src/bin/coreutils/lib/fnmatch.c index 02dd365adb..1c0c7041cd 100644 --- a/src/bin/coreutils/lib/fnmatch.c +++ b/src/bin/coreutils/lib/fnmatch.c @@ -1,9 +1,12 @@ +/* -*- buffer-read-only: t -*- vi: set ro: */ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 /* Copyright (C) 1991,1992,1993,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006,2007 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) + the Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -85,7 +88,7 @@ extern int fnmatch (const char *pattern, const char *string, int flags); #if defined _LIBC || !defined __GNU_LIBRARY__ || !HAVE_FNMATCH_GNU -# if ! (defined isblank || HAVE_DECL_ISBLANK) +# if ! (defined isblank || (HAVE_ISBLANK && HAVE_DECL_ISBLANK)) # define isblank(c) ((c) == ' ' || (c) == '\t') # endif diff --git a/src/bin/coreutils/lib/fnmatch_.h b/src/bin/coreutils/lib/fnmatch.in.h similarity index 93% rename from src/bin/coreutils/lib/fnmatch_.h rename to src/bin/coreutils/lib/fnmatch.in.h index b086b45aac..6ba297f105 100644 --- a/src/bin/coreutils/lib/fnmatch_.h +++ b/src/bin/coreutils/lib/fnmatch.in.h @@ -1,3 +1,6 @@ +/* -*- buffer-read-only: t -*- vi: set ro: */ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 /* Copyright (C) 1991, 1992, 1993, 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2005, 2007 Free Software Foundation, Inc. @@ -5,7 +8,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) + the Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/src/bin/coreutils/lib/fnmatch_loop.c b/src/bin/coreutils/lib/fnmatch_loop.c index d1008c247d..4f857b5233 100644 --- a/src/bin/coreutils/lib/fnmatch_loop.c +++ b/src/bin/coreutils/lib/fnmatch_loop.c @@ -1,10 +1,13 @@ +/* -*- buffer-read-only: t -*- vi: set ro: */ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 /* Copyright (C) 1991,1992,1993,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) + the Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/src/bin/coreutils/lib/fopen-safer.c b/src/bin/coreutils/lib/fopen-safer.c index 3502dbaa8c..9c79922371 100644 --- a/src/bin/coreutils/lib/fopen-safer.c +++ b/src/bin/coreutils/lib/fopen-safer.c @@ -1,11 +1,12 @@ /* Invoke fopen, but avoid some glitches. - Copyright (C) 2001, 2004, 2005, 2006 Free Software Foundation, Inc. + Copyright (C) 2001, 2004, 2005, 2006, 2009 Free Software + Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Paul Eggert. */ @@ -26,10 +26,6 @@ #include #include "unistd-safer.h" -#ifndef STDERR_FILENO -# define STDERR_FILENO 2 -#endif - /* Like fopen, but do not return stdin, stdout, or stderr. */ FILE * diff --git a/src/bin/coreutils/lib/__fpending.c b/src/bin/coreutils/lib/fpending.c similarity index 57% rename from src/bin/coreutils/lib/__fpending.c rename to src/bin/coreutils/lib/fpending.c index 221aee69de..9250d6af9d 100644 --- a/src/bin/coreutils/lib/__fpending.c +++ b/src/bin/coreutils/lib/fpending.c @@ -1,10 +1,10 @@ -/* __fpending.c -- return the number of pending output bytes on a stream - Copyright (C) 2000, 2004, 2006 Free Software Foundation, Inc. +/* fpending.c -- return the number of pending output bytes on a stream + Copyright (C) 2000, 2004, 2006, 2007 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,14 +12,13 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Jim Meyering. */ #include -#include "__fpending.h" +#include "fpending.h" /* Return the number of pending (aka buffered, unflushed) bytes on the stream, FP, that is open for writing. */ diff --git a/src/bin/coreutils/lib/__fpending.h b/src/bin/coreutils/lib/fpending.h similarity index 71% rename from src/bin/coreutils/lib/__fpending.h rename to src/bin/coreutils/lib/fpending.h index 8a8aabcc22..c6a493ddf4 100644 --- a/src/bin/coreutils/lib/__fpending.h +++ b/src/bin/coreutils/lib/fpending.h @@ -2,10 +2,10 @@ Copyright (C) 2000, 2003, 2005, 2006 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + along with this program. If not, see . Written by Jim Meyering. */ diff --git a/src/bin/coreutils/lib/fprintftime.h b/src/bin/coreutils/lib/fprintftime.h index e0be5cded1..886a7dd4f3 100644 --- a/src/bin/coreutils/lib/fprintftime.h +++ b/src/bin/coreutils/lib/fprintftime.h @@ -2,19 +2,18 @@ /* Copyright (C) 2005 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ #include #include diff --git a/src/bin/coreutils/lib/fpucw.h b/src/bin/coreutils/lib/fpucw.h new file mode 100644 index 0000000000..a6226afcf8 --- /dev/null +++ b/src/bin/coreutils/lib/fpucw.h @@ -0,0 +1,107 @@ +/* Manipulating the FPU control word. + Copyright (C) 2007-2008 Free Software Foundation, Inc. + Written by Bruno Haible , 2007. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#ifndef _FPUCW_H +#define _FPUCW_H + +/* The i386 floating point hardware (the 387 compatible FPU, not the modern + SSE/SSE2 hardware) has a controllable rounding precision. It is specified + through the 'PC' bits in the FPU control word ('fctrl' register). (See + the GNU libc i386 header for details.) + + On some platforms, such as Linux or Solaris, the default precision setting + is set to "extended precision". This means that 'long double' instructions + operate correctly, but 'double' computations often produce slightly + different results as on strictly IEEE 754 conforming systems. + + On some platforms, such as NetBSD, the default precision is set to + "double precision". This means that 'long double' instructions will operate + only as 'double', i.e. lead wrong results. + + The FPU control word is under control of the application, i.e. it is + not required to be set either way by the ABI. (In fact, the i386 ABI + http://refspecs.freestandards.org/elf/abi386-4.pdf page 3-12 = page 38 + is not clear about it. But in any case, gcc treats the control word + like a "preserved" register: it emits code that assumes that the control + word is preserved across calls, and it restores the control word at the + end of functions that modify it.) + + See Vincent Lefèvre's page http://www.vinc17.org/research/extended.en.html + for a good explanation. + See http://www.uwsg.iu.edu/hypermail/linux/kernel/0103.0/0453.html for + some argumentation which setting should be the default. */ + +/* This header file provides the following facilities: + fpucw_t integral type holding the value of 'fctrl' + FPU_PC_MASK bit mask denoting the precision control + FPU_PC_DOUBLE precision control for 53 bits mantissa + FPU_PC_EXTENDED precision control for 64 bits mantissa + GET_FPUCW () yields the current FPU control word + SET_FPUCW (word) sets the FPU control word + DECL_LONG_DOUBLE_ROUNDING variable declaration for + BEGIN/END_LONG_DOUBLE_ROUNDING + BEGIN_LONG_DOUBLE_ROUNDING () starts a sequence of instructions with + 'long double' safe operation precision + END_LONG_DOUBLE_ROUNDING () ends a sequence of instructions with + 'long double' safe operation precision + */ + +/* Inline assembler like this works only with GNU C. */ +#if (defined __i386__ || defined __x86_64__) && defined __GNUC__ + +typedef unsigned short fpucw_t; /* glibc calls this fpu_control_t */ + +# define FPU_PC_MASK 0x0300 +# define FPU_PC_DOUBLE 0x200 /* glibc calls this _FPU_DOUBLE */ +# define FPU_PC_EXTENDED 0x300 /* glibc calls this _FPU_EXTENDED */ + +# define GET_FPUCW() \ + ({ fpucw_t _cw; \ + __asm__ __volatile__ ("fnstcw %0" : "=m" (*&_cw)); \ + _cw; \ + }) +# define SET_FPUCW(word) \ + (void)({ fpucw_t _ncw = (word); \ + __asm__ __volatile__ ("fldcw %0" : : "m" (*&_ncw)); \ + }) + +# define DECL_LONG_DOUBLE_ROUNDING \ + fpucw_t oldcw; +# define BEGIN_LONG_DOUBLE_ROUNDING() \ + (void)(oldcw = GET_FPUCW (), \ + SET_FPUCW ((oldcw & ~FPU_PC_MASK) | FPU_PC_EXTENDED)) +# define END_LONG_DOUBLE_ROUNDING() \ + SET_FPUCW (oldcw) + +#else + +typedef unsigned int fpucw_t; + +# define FPU_PC_MASK 0 +# define FPU_PC_DOUBLE 0 +# define FPU_PC_EXTENDED 0 + +# define GET_FPUCW() 0 +# define SET_FPUCW(word) (void)(word) + +# define DECL_LONG_DOUBLE_ROUNDING +# define BEGIN_LONG_DOUBLE_ROUNDING() +# define END_LONG_DOUBLE_ROUNDING() + +#endif + +#endif /* _FPUCW_H */ diff --git a/src/bin/coreutils/lib/fpurge.c b/src/bin/coreutils/lib/fpurge.c new file mode 100644 index 0000000000..5e0d47ddab --- /dev/null +++ b/src/bin/coreutils/lib/fpurge.c @@ -0,0 +1,137 @@ +/* Flushing buffers of a FILE stream. + Copyright (C) 2007-2009 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#include + +/* Specification. */ +#include "fpurge.h" + +#if HAVE___FPURGE /* glibc >= 2.2, Haiku, Solaris >= 7 */ +# include +#endif +#include + +#include "stdio-impl.h" + +int +fpurge (FILE *fp) +{ +#if HAVE___FPURGE /* glibc >= 2.2, Haiku, Solaris >= 7 */ + + __fpurge (fp); + /* The __fpurge function does not have a return value. */ + return 0; + +#elif HAVE_FPURGE /* FreeBSD, NetBSD, OpenBSD, DragonFly, MacOS X */ + + /* Call the system's fpurge function. */ +# undef fpurge +# if !HAVE_DECL_FPURGE + extern int fpurge (FILE *); +# endif + int result = fpurge (fp); +# if defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, MacOS X, Cygwin */ + if (result == 0) + /* Correct the invariants that fpurge broke. + on BSD systems says: + "The following always hold: if _flags & __SRD, _w is 0." + If this invariant is not fulfilled and the stream is read-write but + currently writing, subsequent putc or fputc calls will write directly + into the buffer, although they shouldn't be allowed to. */ + if ((fp_->_flags & __SRD) != 0) + fp_->_w = 0; +# endif + return result; + +#else + + /* Most systems provide FILE as a struct and the necessary bitmask in + , because they need it for implementing getc() and putc() as + fast macros. */ +# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ + fp->_IO_read_end = fp->_IO_read_ptr; + fp->_IO_write_ptr = fp->_IO_write_base; + /* Avoid memory leak when there is an active ungetc buffer. */ + if (fp->_IO_save_base != NULL) + { + free (fp->_IO_save_base); + fp->_IO_save_base = NULL; + } + return 0; +# elif defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, MacOS X, Cygwin */ + fp_->_p = fp_->_bf._base; + fp_->_r = 0; + fp_->_w = ((fp_->_flags & (__SLBF | __SNBF | __SRD)) == 0 /* fully buffered and not currently reading? */ + ? fp_->_bf._size + : 0); + /* Avoid memory leak when there is an active ungetc buffer. */ + if (fp_ub._base != NULL) + { + if (fp_ub._base != fp_->_ubuf) + free (fp_ub._base); + fp_ub._base = NULL; + } + return 0; +# elif defined __EMX__ /* emx+gcc */ + fp->_ptr = fp->_buffer; + fp->_rcount = 0; + fp->_wcount = 0; + fp->_ungetc_count = 0; + return 0; +# elif defined _IOERR /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw */ + fp->_ptr = fp->_base; + if (fp->_ptr != NULL) + fp->_cnt = 0; + return 0; +# elif defined __UCLIBC__ /* uClibc */ +# ifdef __STDIO_BUFFERS + if (fp->__modeflags & __FLAG_WRITING) + fp->__bufpos = fp->__bufstart; + else if (fp->__modeflags & (__FLAG_READONLY | __FLAG_READING)) + fp->__bufpos = fp->__bufread; +# endif + return 0; +# elif defined __QNX__ /* QNX */ + fp->_Rback = fp->_Back + sizeof (fp->_Back); + fp->_Rsave = NULL; + if (fp->_Mode & 0x2000 /* _MWRITE */) + /* fp->_Buf <= fp->_Next <= fp->_Wend */ + fp->_Next = fp->_Buf; + else + /* fp->_Buf <= fp->_Next <= fp->_Rend */ + fp->_Rend = fp->_Next; + return 0; +# elif defined __MINT__ /* Atari FreeMiNT */ + if (fp->__pushed_back) + { + fp->__bufp = fp->__pushback_bufp; + fp->__pushed_back = 0; + } + /* Preserve the current file position. */ + if (fp->__target != -1) + fp->__target += fp->__bufp - fp->__buffer; + fp->__bufp = fp->__buffer; + /* Nothing in the buffer, next getc is nontrivial. */ + fp->__get_limit = fp->__bufp; + /* Nothing in the buffer, next putc is nontrivial. */ + fp->__put_limit = fp->__buffer; + return 0; +# else + #error "Please port gnulib fpurge.c to your platform! Look at the definitions of fflush, setvbuf and ungetc on your system, then report this to bug-gnulib." +# endif + +#endif +} diff --git a/src/bin/coreutils/lib/fpurge.h b/src/bin/coreutils/lib/fpurge.h new file mode 100644 index 0000000000..d7150a1a65 --- /dev/null +++ b/src/bin/coreutils/lib/fpurge.h @@ -0,0 +1,38 @@ +/* Flushing buffers of a FILE stream. + Copyright (C) 2007 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#ifndef _GL_FPURGE_H +#define _GL_FPURGE_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Discard all pending buffered I/O on the stream STREAM. + STREAM must not be wide-character oriented. + Return 0 if successful. Upon error, return -1 and set errno. */ +#if HAVE_FPURGE +# define fpurge rpl_fpurge +#endif +extern int fpurge (FILE *stream); + +#ifdef __cplusplus +} +#endif + +#endif /* _GL_FPURGE_H */ diff --git a/src/bin/coreutils/lib/freadahead.c b/src/bin/coreutils/lib/freadahead.c new file mode 100644 index 0000000000..f4b5ed7029 --- /dev/null +++ b/src/bin/coreutils/lib/freadahead.c @@ -0,0 +1,85 @@ +/* Retrieve information about a FILE stream. + Copyright (C) 2007-2009 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#include + +/* Specification. */ +#include "freadahead.h" + +#include +#include "stdio-impl.h" + +size_t +freadahead (FILE *fp) +{ +#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ + if (fp->_IO_write_ptr > fp->_IO_write_base) + return 0; + return (fp->_IO_read_end - fp->_IO_read_ptr) + + (fp->_flags & _IO_IN_BACKUP ? fp->_IO_save_end - fp->_IO_save_base : + 0); +#elif defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, MacOS X, Cygwin */ + if ((fp_->_flags & __SWR) != 0 || fp_->_r < 0) + return 0; +# if defined __DragonFly__ + return __sreadahead (fp); +# else + return fp_->_r + + (HASUB (fp) ? fp_->_ur : 0); +# endif +#elif defined __EMX__ /* emx+gcc */ + if ((fp->_flags & _IOWRT) != 0) + return 0; + /* Note: fp->_ungetc_count > 0 implies fp->_rcount <= 0, + fp->_ungetc_count = 0 implies fp->_rcount >= 0. */ + /* equivalent to + (fp->_ungetc_count == 0 ? fp->_rcount : fp->_ungetc_count - fp->_rcount) */ + return (fp->_rcount > 0 ? fp->_rcount : fp->_ungetc_count - fp->_rcount); +#elif defined _IOERR /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw */ + if ((fp_->_flag & _IOWRT) != 0) + return 0; + return fp_->_cnt; +#elif defined __UCLIBC__ /* uClibc */ +# ifdef __STDIO_BUFFERS + if (fp->__modeflags & __FLAG_WRITING) + return 0; + return (fp->__bufread - fp->__bufpos) + + (fp->__modeflags & __FLAG_UNGOT ? 1 : 0); +# else + return 0; +# endif +#elif defined __QNX__ /* QNX */ + if ((fp->_Mode & 0x2000 /* _MWRITE */) != 0) + return 0; + /* fp->_Buf <= fp->_Next <= fp->_Rend, + and fp->_Rend may be overridden by fp->_Rsave. */ + return ((fp->_Rsave ? fp->_Rsave : fp->_Rend) - fp->_Next) + + (fp->_Mode & 0x4000 /* _MBYTE */ + ? (fp->_Back + sizeof (fp->_Back)) - fp->_Rback + : 0); +#elif defined __MINT__ /* Atari FreeMiNT */ + if (!fp->__mode.__read) + return 0; + return (fp->__pushed_back + ? fp->__get_limit - fp->__pushback_bufp + 1 + : fp->__get_limit - fp->__bufp); +#elif defined SLOW_BUT_NO_HACKS /* users can define this */ + abort (); + return 0; +#else + #error "Please port gnulib freadahead.c to your platform! Look at the definition of fflush, fread, ungetc on your system, then report this to bug-gnulib." +#endif +} diff --git a/src/bin/coreutils/lib/freadahead.h b/src/bin/coreutils/lib/freadahead.h new file mode 100644 index 0000000000..96a97d192c --- /dev/null +++ b/src/bin/coreutils/lib/freadahead.h @@ -0,0 +1,38 @@ +/* Retrieve information about a FILE stream. + Copyright (C) 2007-2008 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Assuming the stream STREAM is open for reading: + Return the number of bytes waiting in the input buffer of STREAM. + This includes both the bytes that have been read from the underlying input + source and the bytes that have been pushed back through 'ungetc'. + + If this number is 0 and the stream is not currently writing, + fflush (STREAM) is known to be a no-op. + + STREAM must not be wide-character oriented. */ + +extern size_t freadahead (FILE *stream); + +#ifdef __cplusplus +} +#endif diff --git a/src/bin/coreutils/lib/freading.c b/src/bin/coreutils/lib/freading.c new file mode 100644 index 0000000000..4da0e31bb2 --- /dev/null +++ b/src/bin/coreutils/lib/freading.c @@ -0,0 +1,64 @@ +/* Retrieve information about a FILE stream. + Copyright (C) 2007-2009 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#include + +/* Specification. */ +#include "freading.h" + +#include "stdio-impl.h" + +/* Don't use glibc's __freading function in glibc < 2.7, see + */ +#if !(HAVE___FREADING && (!defined __GLIBC__ || __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 7))) + +bool +freading (FILE *fp) +{ + /* Most systems provide FILE as a struct and the necessary bitmask in + , because they need it for implementing getc() and putc() as + fast macros. */ +#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ + return ((fp->_flags & _IO_NO_WRITES) != 0 + || ((fp->_flags & (_IO_NO_READS | _IO_CURRENTLY_PUTTING)) == 0 + && fp->_IO_read_base != NULL)); +#elif defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, MacOS X, Cygwin */ + return (fp_->_flags & __SRD) != 0; +#elif defined __EMX__ /* emx+gcc */ + return (fp->_flags & _IOREAD) != 0; +#elif defined _IOERR /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw */ + return (fp->_flag & _IOREAD) != 0; +#elif defined __UCLIBC__ /* uClibc */ + return (fp->__modeflags & (__FLAG_READONLY | __FLAG_READING)) != 0; +#elif defined __QNX__ /* QNX */ + return ((fp->_Mode & 0x2 /* _MOPENW */) == 0 + || (fp->_Mode & 0x1000 /* _MREAD */) != 0); +#elif defined __MINT__ /* Atari FreeMiNT */ + if (!fp->__mode.__write) + return 1; + if (!fp->__mode.__read) + return 0; +# ifdef _IO_CURRENTLY_GETTING /* Flag added on 2009-02-28 */ + return (fp->__flags & _IO_CURRENTLY_GETTING) != 0; +# else + return (fp->__buffer < fp->__get_limit /*|| fp->__bufp == fp->__put_limit ??*/); +# endif +#else + #error "Please port gnulib freading.c to your platform!" +#endif +} + +#endif diff --git a/src/bin/coreutils/lib/freading.h b/src/bin/coreutils/lib/freading.h new file mode 100644 index 0000000000..5c41ae4451 --- /dev/null +++ b/src/bin/coreutils/lib/freading.h @@ -0,0 +1,53 @@ +/* Retrieve information about a FILE stream. + Copyright (C) 2007-2008 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#include +#include + +/* Return true if the stream STREAM is opened read-only, or if the + last operation on the stream was a read operation. Return false if + the stream is opened write-only or append-only, or if it supports + writing and there is no current read operation (such as fgetc). + + freading and fwriting will never both be true. If STREAM supports + both reads and writes, then: + - both freading and fwriting might be false when the stream is first + opened, after read encounters EOF, or after fflush, + - freading might be false or true and fwriting might be false + after repositioning (such as fseek, fsetpos, or rewind), + depending on the underlying implementation. + + STREAM must not be wide-character oriented. */ + +#if HAVE___FREADING && (!defined __GLIBC__ || __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 7)) +/* Solaris >= 7, not glibc >= 2.2, but glibc >= 2.7 */ + +# include +# define freading(stream) (__freading (stream) != 0) + +#else + +# ifdef __cplusplus +extern "C" { +# endif + +extern bool freading (FILE *stream); + +# ifdef __cplusplus +} +# endif + +#endif diff --git a/src/bin/coreutils/lib/freadptr.c b/src/bin/coreutils/lib/freadptr.c new file mode 100644 index 0000000000..3abe58e639 --- /dev/null +++ b/src/bin/coreutils/lib/freadptr.c @@ -0,0 +1,103 @@ +/* Retrieve information about a FILE stream. + Copyright (C) 2007-2009 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#include + +/* Specification. */ +#include "freadptr.h" + +#include + +#include "stdio-impl.h" + +const char * +freadptr (FILE *fp, size_t *sizep) +{ + size_t size; + + /* Keep this code in sync with freadahead! */ +#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ + if (fp->_IO_write_ptr > fp->_IO_write_base) + return NULL; + size = fp->_IO_read_end - fp->_IO_read_ptr; + if (size == 0) + return NULL; + *sizep = size; + return (const char *) fp->_IO_read_ptr; +#elif defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, MacOS X, Cygwin */ + if ((fp_->_flags & __SWR) != 0 || fp_->_r < 0) + return NULL; + size = fp_->_r; + if (size == 0) + return NULL; + *sizep = size; + return (const char *) fp_->_p; +#elif defined __EMX__ /* emx+gcc */ + if ((fp->_flags & _IOWRT) != 0) + return NULL; + /* Note: fp->_ungetc_count > 0 implies fp->_rcount <= 0, + fp->_ungetc_count = 0 implies fp->_rcount >= 0. */ + if (fp->_rcount <= 0) + return NULL; + if (!(fp->_ungetc_count == 0)) + abort (); + *sizep = fp->_rcount; + return fp->_ptr; +#elif defined _IOERR /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw */ + if ((fp_->_flag & _IOWRT) != 0) + return NULL; + size = fp_->_cnt; + if (size == 0) + return NULL; + *sizep = size; + return (const char *) fp_->_ptr; +#elif defined __UCLIBC__ /* uClibc */ +# ifdef __STDIO_BUFFERS + if (fp->__modeflags & __FLAG_WRITING) + return NULL; + size = fp->__bufread - fp->__bufpos; + if (size == 0) + return NULL; + *sizep = size; + return (const char *) fp->__bufpos; +# else + return NULL; +# endif +#elif defined __QNX__ /* QNX */ + if ((fp->_Mode & 0x2000 /* _MWRITE */) != 0) + return NULL; + /* fp->_Buf <= fp->_Next <= fp->_Rend */ + size = fp->_Rend - fp->_Next; + if (size == 0) + return NULL; + *sizep = size; + return (const char *) fp->_Next; +#elif defined __MINT__ /* Atari FreeMiNT */ + if (!fp->__mode.__read) + return NULL; + size = fp->__get_limit - fp->__bufp; + if (size == 0) + return NULL; + *sizep = size; + return fp->__bufp; +#elif defined SLOW_BUT_NO_HACKS /* users can define this */ + /* This implementation is correct on any ANSI C platform. It is just + awfully slow. */ + return NULL; +#else + #error "Please port gnulib freadptr.c to your platform! Look at the definition of fflush, fread, getc, getc_unlocked on your system, then report this to bug-gnulib." +#endif +} diff --git a/src/bin/coreutils/lib/freadptr.h b/src/bin/coreutils/lib/freadptr.h new file mode 100644 index 0000000000..2aa800b56d --- /dev/null +++ b/src/bin/coreutils/lib/freadptr.h @@ -0,0 +1,39 @@ +/* Retrieve information about a FILE stream. + Copyright (C) 2007-2008 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Assuming the stream STREAM is open for reading: + Return a pointer to the input buffer of STREAM, or NULL. + If the returned pointer is non-NULL, *SIZEP is set to the (positive) size + of the input buffer. + If the returned pointer is NULL, you should use getc (STREAM), + fgetc (STREAM), or fread (..., STREAM) to access the input from STREAM. + + The resulting pointer becomes invalid upon any operation on STREAM. + + STREAM must not be wide-character oriented. */ + +extern const char * freadptr (FILE *stream, size_t *sizep); + +#ifdef __cplusplus +} +#endif diff --git a/src/bin/coreutils/lib/freadseek.c b/src/bin/coreutils/lib/freadseek.c new file mode 100644 index 0000000000..23046fa4c4 --- /dev/null +++ b/src/bin/coreutils/lib/freadseek.c @@ -0,0 +1,136 @@ +/* Skipping input from a FILE stream. + Copyright (C) 2007-2009 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#include + +/* Specification. */ +#include "freadseek.h" + +#include +#include + +#include "freadahead.h" +#include "freadptr.h" + +#include "stdio-impl.h" + +/* Increment the in-memory pointer. INCREMENT must be at most the buffer size + returned by freadptr(). + This is very cheap (no system calls). */ +static inline void +freadptrinc (FILE *fp, size_t increment) +{ + /* Keep this code in sync with freadptr! */ +#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ + fp->_IO_read_ptr += increment; +#elif defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, MacOS X, Cygwin */ + fp_->_p += increment; + fp_->_r -= increment; +#elif defined __EMX__ /* emx+gcc */ + fp->_ptr += increment; + fp->_rcount -= increment; +#elif defined _IOERR /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw */ + fp_->_ptr += increment; + fp_->_cnt -= increment; +#elif defined __UCLIBC__ /* uClibc */ +# ifdef __STDIO_BUFFERS + fp->__bufpos += increment; +# else + abort (); +# endif +#elif defined __QNX__ /* QNX */ + fp->_Next += increment; +#elif defined __MINT__ /* Atari FreeMiNT */ + fp->__bufp += increment; +#elif defined SLOW_BUT_NO_HACKS /* users can define this */ +#else + #error "Please port gnulib freadseek.c to your platform! Look at the definition of getc, getc_unlocked on your system, then report this to bug-gnulib." +#endif +} + +int +freadseek (FILE *fp, size_t offset) +{ + size_t total_buffered; + int fd; + + if (offset == 0) + return 0; + + /* Seek over the already read and buffered input as quickly as possible, + without doing any system calls. */ + total_buffered = freadahead (fp); + /* This loop is usually executed at most twice: once for ungetc buffer (if + present) and once for the main buffer. */ + while (total_buffered > 0) + { + size_t buffered; + + if (freadptr (fp, &buffered) != NULL && buffered > 0) + { + size_t increment = (buffered < offset ? buffered : offset); + + freadptrinc (fp, increment); + offset -= increment; + if (offset == 0) + return 0; + total_buffered -= increment; + if (total_buffered == 0) + break; + } + /* Read one byte. If we were reading from the ungetc buffer, this + switches the stream back to the main buffer. */ + if (fgetc (fp) == EOF) + goto eof; + offset--; + if (offset == 0) + return 0; + total_buffered--; + } + + /* Test whether the stream is seekable or not. */ + fd = fileno (fp); + if (fd >= 0 && lseek (fd, 0, SEEK_CUR) >= 0) + { + /* FP refers to a regular file. fseek is most efficient in this case. */ + return fseek (fp, offset, SEEK_CUR); + } + else + { + /* FP is a non-seekable stream, possibly not even referring to a file + descriptor. Read OFFSET bytes explicitly and discard them. */ + char buf[4096]; + + do + { + size_t count = (sizeof (buf) < offset ? sizeof (buf) : offset); + if (fread (buf, 1, count, fp) < count) + goto eof; + offset -= count; + } + while (offset > 0); + + return 0; + } + + eof: + /* EOF, or error before or while reading. */ + if (ferror (fp)) + return EOF; + else + /* Encountered EOF. */ + return 0; +} diff --git a/src/bin/coreutils/lib/freadseek.h b/src/bin/coreutils/lib/freadseek.h new file mode 100644 index 0000000000..723967250f --- /dev/null +++ b/src/bin/coreutils/lib/freadseek.h @@ -0,0 +1,42 @@ +/* Skipping input from a FILE stream. + Copyright (C) 2007-2008 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Assuming the stream STREAM is open for reading: + + Read and discard OFFSET bytes from STREAM. + + freadseek (STREAM, OFFSET) is the same as + fseek (STREAM, OFFSET, SEEK_CUR), except that the latter does not work + on non-seekable input streams (such as pipes). + + Upon success, return 0. + Upon premature end of stream, return 0 (like fseek does). + Upon error, set the error indicator in the stream and return EOF. + + STREAM must not be wide-character oriented. */ + +extern int freadseek (FILE *stream, size_t offset); + +#ifdef __cplusplus +} +#endif diff --git a/src/bin/coreutils/lib/free.c b/src/bin/coreutils/lib/free.c deleted file mode 100644 index 73a125a75f..0000000000 --- a/src/bin/coreutils/lib/free.c +++ /dev/null @@ -1,31 +0,0 @@ -/* Work around incompatibility on older systems where free (NULL) fails. - - Copyright (C) 2003, 2006 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ - -/* written by Paul Eggert */ - -#include -#undef free - -#include - -void -rpl_free (void *p) -{ - if (p) - free (p); -} diff --git a/src/bin/coreutils/lib/frexp.c b/src/bin/coreutils/lib/frexp.c new file mode 100644 index 0000000000..7e1f5d1ad4 --- /dev/null +++ b/src/bin/coreutils/lib/frexp.c @@ -0,0 +1,166 @@ +/* Split a double into fraction and mantissa. + Copyright (C) 2007-2008 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* Written by Paolo Bonzini , 2003, and + Bruno Haible , 2007. */ + +#include + +/* Specification. */ +#include + +#include +#ifdef USE_LONG_DOUBLE +# include "isnanl-nolibm.h" +# include "fpucw.h" +#else +# include "isnand-nolibm.h" +#endif + +/* This file assumes FLT_RADIX = 2. If FLT_RADIX is a power of 2 greater + than 2, or not even a power of 2, some rounding errors can occur, so that + then the returned mantissa is only guaranteed to be <= 1.0, not < 1.0. */ + +#ifdef USE_LONG_DOUBLE +# define FUNC frexpl +# define DOUBLE long double +# define ISNAN isnanl +# define DECL_ROUNDING DECL_LONG_DOUBLE_ROUNDING +# define BEGIN_ROUNDING() BEGIN_LONG_DOUBLE_ROUNDING () +# define END_ROUNDING() END_LONG_DOUBLE_ROUNDING () +# define L_(literal) literal##L +#else +# define FUNC frexp +# define DOUBLE double +# define ISNAN isnand +# define DECL_ROUNDING +# define BEGIN_ROUNDING() +# define END_ROUNDING() +# define L_(literal) literal +#endif + +DOUBLE +FUNC (DOUBLE x, int *expptr) +{ + int sign; + int exponent; + DECL_ROUNDING + + /* Test for NaN, infinity, and zero. */ + if (ISNAN (x) || x + x == x) + { + *expptr = 0; + return x; + } + + sign = 0; + if (x < 0) + { + x = - x; + sign = -1; + } + + BEGIN_ROUNDING (); + + { + /* Since the exponent is an 'int', it fits in 64 bits. Therefore the + loops are executed no more than 64 times. */ + DOUBLE pow2[64]; /* pow2[i] = 2^2^i */ + DOUBLE powh[64]; /* powh[i] = 2^-2^i */ + int i; + + exponent = 0; + if (x >= L_(1.0)) + { + /* A positive exponent. */ + DOUBLE pow2_i; /* = pow2[i] */ + DOUBLE powh_i; /* = powh[i] */ + + /* Invariants: pow2_i = 2^2^i, powh_i = 2^-2^i, + x * 2^exponent = argument, x >= 1.0. */ + for (i = 0, pow2_i = L_(2.0), powh_i = L_(0.5); + ; + i++, pow2_i = pow2_i * pow2_i, powh_i = powh_i * powh_i) + { + if (x >= pow2_i) + { + exponent += (1 << i); + x *= powh_i; + } + else + break; + + pow2[i] = pow2_i; + powh[i] = powh_i; + } + /* Avoid making x too small, as it could become a denormalized + number and thus lose precision. */ + while (i > 0 && x < pow2[i - 1]) + { + i--; + powh_i = powh[i]; + } + exponent += (1 << i); + x *= powh_i; + /* Here 2^-2^i <= x < 1.0. */ + } + else + { + /* A negative or zero exponent. */ + DOUBLE pow2_i; /* = pow2[i] */ + DOUBLE powh_i; /* = powh[i] */ + + /* Invariants: pow2_i = 2^2^i, powh_i = 2^-2^i, + x * 2^exponent = argument, x < 1.0. */ + for (i = 0, pow2_i = L_(2.0), powh_i = L_(0.5); + ; + i++, pow2_i = pow2_i * pow2_i, powh_i = powh_i * powh_i) + { + if (x < powh_i) + { + exponent -= (1 << i); + x *= pow2_i; + } + else + break; + + pow2[i] = pow2_i; + powh[i] = powh_i; + } + /* Here 2^-2^i <= x < 1.0. */ + } + + /* Invariants: x * 2^exponent = argument, and 2^-2^i <= x < 1.0. */ + while (i > 0) + { + i--; + if (x < powh[i]) + { + exponent -= (1 << i); + x *= pow2[i]; + } + } + /* Here 0.5 <= x < 1.0. */ + } + + if (sign < 0) + x = - x; + + END_ROUNDING (); + + *expptr = exponent; + return x; +} diff --git a/src/bin/coreutils/lib/frexpl.c b/src/bin/coreutils/lib/frexpl.c new file mode 100644 index 0000000000..d6f0d7650d --- /dev/null +++ b/src/bin/coreutils/lib/frexpl.c @@ -0,0 +1,18 @@ +/* Split a 'long double' into fraction and mantissa. + Copyright (C) 2007 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#define USE_LONG_DOUBLE +#include "frexp.c" diff --git a/src/bin/coreutils/lib/fseeko.c b/src/bin/coreutils/lib/fseeko.c new file mode 100644 index 0000000000..51bafc1e10 --- /dev/null +++ b/src/bin/coreutils/lib/fseeko.c @@ -0,0 +1,133 @@ +/* -*- buffer-read-only: t -*- vi: set ro: */ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 +/* An fseeko() function that, together with fflush(), is POSIX compliant. + Copyright (C) 2007-2009 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + +#include + +/* Specification. */ +#include + +/* Get off_t and lseek. */ +#include + +#include "stdio-impl.h" + +#undef fseeko +#if !HAVE_FSEEKO +# undef fseek +# define fseeko fseek +#endif + +int +rpl_fseeko (FILE *fp, off_t offset, int whence) +{ +#if LSEEK_PIPE_BROKEN + /* mingw gives bogus answers rather than failure on non-seekable files. */ + if (lseek (fileno (fp), 0, SEEK_CUR) == -1) + return EOF; +#endif + + /* These tests are based on fpurge.c. */ +#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ + if (fp->_IO_read_end == fp->_IO_read_ptr + && fp->_IO_write_ptr == fp->_IO_write_base + && fp->_IO_save_base == NULL) +#elif defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, MacOS X, Cygwin */ +# if defined __SL64 && defined __SCLE /* Cygwin */ + if ((fp->_flags & __SL64) == 0) + { + /* Cygwin 1.5.0 through 1.5.24 failed to open stdin in 64-bit + mode; but has an fseeko that requires 64-bit mode. */ + FILE *tmp = fopen ("/dev/null", "r"); + if (!tmp) + return -1; + fp->_flags |= __SL64; + fp->_seek64 = tmp->_seek64; + fclose (tmp); + } +# endif + if (fp_->_p == fp_->_bf._base + && fp_->_r == 0 + && fp_->_w == ((fp_->_flags & (__SLBF | __SNBF | __SRD)) == 0 /* fully buffered and not currently reading? */ + ? fp_->_bf._size + : 0) + && fp_ub._base == NULL) +#elif defined __EMX__ /* emx+gcc */ + if (fp->_ptr == fp->_buffer + && fp->_rcount == 0 + && fp->_wcount == 0 + && fp->_ungetc_count == 0) +#elif defined _IOERR /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw */ + if (fp_->_ptr == fp_->_base + && (fp_->_ptr == NULL || fp_->_cnt == 0)) +#elif defined __UCLIBC__ /* uClibc */ + if (((fp->__modeflags & __FLAG_WRITING) == 0 + || fp->__bufpos == fp->__bufstart) + && ((fp->__modeflags & (__FLAG_READONLY | __FLAG_READING)) == 0 + || fp->__bufpos == fp->__bufread)) +#elif defined __QNX__ /* QNX */ + if ((fp->_Mode & _MWRITE ? fp->_Next == fp->_Buf : fp->_Next == fp->_Rend) + && fp->_Rback == fp->_Back + sizeof (fp->_Back) + && fp->_Rsave == NULL) +#elif defined __MINT__ /* Atari FreeMiNT */ + if (fp->__bufp == fp->__buffer + && fp->__get_limit == fp->__bufp + && fp->__put_limit == fp->__bufp + && !fp->__pushed_back) +#else + #error "Please port gnulib fseeko.c to your platform! Look at the code in fpurge.c, then report this to bug-gnulib." +#endif + { + /* We get here when an fflush() call immediately preceded this one. We + know there are no buffers. + POSIX requires us to modify the file descriptor's position. + But we cannot position beyond end of file here. */ + off_t pos = + lseek (fileno (fp), + whence == SEEK_END && offset > 0 ? 0 : offset, + whence); + if (pos == -1) + { +#if defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, MacOS X, Cygwin */ + fp_->_flags &= ~__SOFF; +#endif + return -1; + } + +#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ + fp->_flags &= ~_IO_EOF_SEEN; +#elif defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, MacOS X, Cygwin */ + fp_->_offset = pos; + fp_->_flags |= __SOFF; + fp_->_flags &= ~__SEOF; +#elif defined __EMX__ /* emx+gcc */ + fp->_flags &= ~_IOEOF; +#elif defined _IOERR /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw */ + fp->_flag &= ~_IOEOF; +#elif defined __MINT__ /* Atari FreeMiNT */ + fp->__offset = pos; + fp->__eof = 0; +#endif + /* If we were not requested to position beyond end of file, we're + done. */ + if (!(whence == SEEK_END && offset > 0)) + return 0; + } + return fseeko (fp, offset, whence); +} diff --git a/src/bin/coreutils/lib/fseterr.c b/src/bin/coreutils/lib/fseterr.c new file mode 100644 index 0000000000..110716bfdc --- /dev/null +++ b/src/bin/coreutils/lib/fseterr.c @@ -0,0 +1,74 @@ +/* Set the error indicator of a stream. + Copyright (C) 2007-2009 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#include + +/* Specification. */ +#include "fseterr.h" + +#include + +#include "stdio-impl.h" + +void +fseterr (FILE *fp) +{ + /* Most systems provide FILE as a struct and the necessary bitmask in + , because they need it for implementing getc() and putc() as + fast macros. */ +#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ + fp->_flags |= _IO_ERR_SEEN; +#elif defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, MacOS X, Cygwin */ + fp_->_flags |= __SERR; +#elif defined __EMX__ /* emx+gcc */ + fp->_flags |= _IOERR; +#elif defined _IOERR /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw */ + fp_->_flag |= _IOERR; +#elif defined __UCLIBC__ /* uClibc */ + fp->__modeflags |= __FLAG_ERROR; +#elif defined __QNX__ /* QNX */ + fp->_Mode |= 0x200 /* _MERR */; +#elif defined __MINT__ /* Atari FreeMiNT */ + fp->__error = 1; +#elif 0 /* unknown */ + /* Portable fallback, based on an idea by Rich Felker. + Wow! 6 system calls for something that is just a bit operation! + Not activated on any system, because there is no way to repair FP when + the sequence of system calls fails, and library code should not call + abort(). */ + int saved_errno; + int fd; + int fd2; + + saved_errno = errno; + fflush (fp); + fd = fileno (fp); + fd2 = dup (fd); + if (fd2 >= 0) + { + close (fd); + fputc ('\0', fp); /* This should set the error indicator. */ + fflush (fp); /* Or this. */ + if (dup2 (fd2, fd) < 0) + /* Whee... we botched the stream and now cannot restore it! */ + abort (); + close (fd2); + } + errno = saved_errno; +#else + #error "Please port gnulib fseterr.c to your platform! Look at the definitions of ferror and clearerr on your system, then report this to bug-gnulib." +#endif +} diff --git a/src/bin/coreutils/lib/fseterr.h b/src/bin/coreutils/lib/fseterr.h new file mode 100644 index 0000000000..3104f6fcb3 --- /dev/null +++ b/src/bin/coreutils/lib/fseterr.h @@ -0,0 +1,37 @@ +/* Set the error indicator of a stream. + Copyright (C) 2007 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#ifndef _FSETERR_H +#define _FSETERR_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + + +/* Set the error indicator of the stream FP. + The "error indicator" is set when an I/O operation on the stream fails, and + is cleared (together with the "end-of-file" indicator) by clearerr (FP). */ +extern void fseterr (FILE *fp); + + +#ifdef __cplusplus +} +#endif + +#endif /* _FSETERR_H */ diff --git a/src/bin/coreutils/lib/fstatat.c b/src/bin/coreutils/lib/fstatat.c index 92a516457f..8b6291225f 100644 --- a/src/bin/coreutils/lib/fstatat.c +++ b/src/bin/coreutils/lib/fstatat.c @@ -2,10 +2,10 @@ Copyright (C) 2006 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Paul Eggert and Jim Meyering. */ diff --git a/src/bin/coreutils/lib/fsusage.c b/src/bin/coreutils/lib/fsusage.c index 337bf5315d..db0d3bc537 100644 --- a/src/bin/coreutils/lib/fsusage.c +++ b/src/bin/coreutils/lib/fsusage.c @@ -1,12 +1,12 @@ /* fsusage.c -- return space usage of mounted file systems - Copyright (C) 1991, 1992, 1996, 1998, 1999, 2002, 2003, 2004, 2005, 2006 + Copyright (C) 1991-1992, 1996, 1998-1999, 2002-2006, 2009 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ #include @@ -233,6 +232,7 @@ get_fs_usage (char const *file, char const *disk, struct fs_usage *fsp) #endif + (void) disk; /* avoid argument-unused warning */ return 0; } diff --git a/src/bin/coreutils/lib/fsusage.h b/src/bin/coreutils/lib/fsusage.h index 7fa9f8d6ac..b32abe1836 100644 --- a/src/bin/coreutils/lib/fsusage.h +++ b/src/bin/coreutils/lib/fsusage.h @@ -3,10 +3,10 @@ Copyright (C) 1991, 1992, 1997, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Space usage statistics for a file system. Blocks are 512-byte. */ diff --git a/src/bin/coreutils/lib/ftello.c b/src/bin/coreutils/lib/ftello.c new file mode 100644 index 0000000000..f2524084c3 --- /dev/null +++ b/src/bin/coreutils/lib/ftello.c @@ -0,0 +1,54 @@ +/* An ftello() function that works around platform bugs. + Copyright (C) 2007 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#include + +/* Specification. */ +#include + +/* Get lseek. */ +#include + +#undef ftello +#if !HAVE_FTELLO +# undef ftell +# define ftello ftell +#endif + +off_t +rpl_ftello (FILE *fp) +{ +#if LSEEK_PIPE_BROKEN + /* mingw gives bogus answers rather than failure on non-seekable files. */ + if (lseek (fileno (fp), 0, SEEK_CUR) == -1) + return -1; +#endif + +#if defined __SL64 && defined __SCLE /* Cygwin */ + if ((fp->_flags & __SL64) == 0) + { + /* Cygwin 1.5.0 through 1.5.24 failed to open stdin in 64-bit + mode; but has an ftello that requires 64-bit mode. */ + FILE *tmp = fopen ("/dev/null", "r"); + if (!tmp) + return -1; + fp->_flags |= __SL64; + fp->_seek64 = tmp->_seek64; + fclose (tmp); + } +#endif + return ftello (fp); +} diff --git a/src/bin/coreutils/lib/fts-cycle.c b/src/bin/coreutils/lib/fts-cycle.c index 669db58f55..5f81610a35 100644 --- a/src/bin/coreutils/lib/fts-cycle.c +++ b/src/bin/coreutils/lib/fts-cycle.c @@ -4,10 +4,10 @@ Written by Jim Meyering. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -15,8 +15,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ #include "cycle-check.h" #include "hash.h" diff --git a/src/bin/coreutils/lib/fts.c b/src/bin/coreutils/lib/fts.c index 1b5384b007..0cbb9fb642 100644 --- a/src/bin/coreutils/lib/fts.c +++ b/src/bin/coreutils/lib/fts.c @@ -1,11 +1,11 @@ /* Traverse a file hierarchy. - Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc. + Copyright (C) 2004-2009 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /*- * Copyright (c) 1990, 1993, 1994 @@ -63,7 +62,6 @@ static char sccsid[] = "@(#)fts.c 8.6 (Berkeley) 8/14/94"; #endif #include #include -#include "dirfd.h" #include #include #include @@ -71,7 +69,6 @@ static char sccsid[] = "@(#)fts.c 8.6 (Berkeley) 8/14/94"; #if ! _LIBC # include "fcntl--.h" -# include "lstat.h" # include "openat.h" # include "unistd--.h" # include "same-inode.h" @@ -87,11 +84,63 @@ static char sccsid[] = "@(#)fts.c 8.6 (Berkeley) 8/14/94"; # define DT_IS_KNOWN(d) ((d)->d_type != DT_UNKNOWN) /* True if the type of the directory entry D must be T. */ # define DT_MUST_BE(d, t) ((d)->d_type == (t)) +# define D_TYPE(d) ((d)->d_type) #else # define DT_IS_KNOWN(d) false # define DT_MUST_BE(d, t) false +# define D_TYPE(d) DT_UNKNOWN + +# undef DT_UNKNOWN +# define DT_UNKNOWN 0 + +/* Any nonzero values will do here, so long as they're distinct. + Undef any existing macros out of the way. */ +# undef DT_BLK +# undef DT_CHR +# undef DT_DIR +# undef DT_FIFO +# undef DT_LNK +# undef DT_REG +# undef DT_SOCK +# define DT_BLK 1 +# define DT_CHR 2 +# define DT_DIR 3 +# define DT_FIFO 4 +# define DT_LNK 5 +# define DT_REG 6 +# define DT_SOCK 7 #endif +#ifndef S_IFLNK +# define S_IFLNK 0 +#endif +#ifndef S_IFSOCK +# define S_IFSOCK 0 +#endif + +enum +{ + NOT_AN_INODE_NUMBER = 0 +}; + +#ifdef D_INO_IN_DIRENT +# define D_INO(dp) (dp)->d_ino +#else +/* Some systems don't have inodes, so fake them to avoid lots of ifdefs. */ +# define D_INO(dp) NOT_AN_INODE_NUMBER +#endif + +/* If there are more than this many entries in a directory, + and the conditions mentioned below are satisfied, then sort + the entries on inode number before any further processing. */ +#ifndef FTS_INODE_SORT_DIR_ENTRIES_THRESHOLD +# define FTS_INODE_SORT_DIR_ENTRIES_THRESHOLD 10000 +#endif +enum +{ + _FTS_INODE_SORT_DIR_ENTRIES_THRESHOLD = FTS_INODE_SORT_DIR_ENTRIES_THRESHOLD +}; + enum Fts_stat { FTS_NO_STAT_REQUIRED = 1, @@ -121,7 +170,7 @@ enum Fts_stat #endif #ifndef __attribute__ -# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8) || __STRICT_ANSI__ +# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8) # define __attribute__(x) /* empty */ # endif #endif @@ -568,6 +617,12 @@ fts_close (FTS *sp) } fd_ring_clear (&sp->fts_fd_ring); + +#if GNULIB_FTS + if (sp->fts_leaf_optimization_works_ht) + hash_free (sp->fts_leaf_optimization_works_ht); +#endif + free_dir (sp); /* Free up the stream pointer. */ @@ -582,6 +637,172 @@ fts_close (FTS *sp) return (0); } +#if defined __linux__ \ + && HAVE_SYS_VFS_H && HAVE_FSTATFS && HAVE_STRUCT_STATFS_F_TYPE + +#include + +/* Linux-specific constants from coreutils' src/fs.h */ +# define S_MAGIC_TMPFS 0x1021994 +# define S_MAGIC_NFS 0x6969 +# define S_MAGIC_REISERFS 0x52654973 +# define S_MAGIC_PROC 0x9FA0 + +/* Return false if it is easy to determine the file system type of + the directory on which DIR_FD is open, and sorting dirents on + inode numbers is known not to improve traversal performance with + that type of file system. Otherwise, return true. */ +static bool +dirent_inode_sort_may_be_useful (int dir_fd) +{ + /* Skip the sort only if we can determine efficiently + that skipping it is the right thing to do. + The cost of performing an unnecessary sort is negligible, + while the cost of *not* performing it can be O(N^2) with + a very large constant. */ + struct statfs fs_buf; + + /* If fstatfs fails, assume sorting would be useful. */ + if (fstatfs (dir_fd, &fs_buf) != 0) + return true; + + /* FIXME: what about when f_type is not an integral type? + deal with that if/when it's encountered. */ + switch (fs_buf.f_type) + { + case S_MAGIC_TMPFS: + case S_MAGIC_NFS: + /* On a file system of any of these types, sorting + is unnecessary, and hence wasteful. */ + return false; + + default: + return true; + } +} + +/* Given a file descriptor DIR_FD open on a directory D, + return true if it is valid to apply the leaf-optimization + technique of counting directories in D via stat.st_nlink. */ +static bool +leaf_optimization_applies (int dir_fd) +{ + struct statfs fs_buf; + + /* If fstatfs fails, assume we can't use the optimization. */ + if (fstatfs (dir_fd, &fs_buf) != 0) + return false; + + /* FIXME: do we need to detect AFS mount points? I doubt it, + unless fstatfs can report S_MAGIC_REISERFS for such a directory. */ + + switch (fs_buf.f_type) + { + /* List here the file system types that lack useable dirent.d_type + info, yet for which the optimization does apply. */ + case S_MAGIC_REISERFS: + return true; + + case S_MAGIC_PROC: + /* Explicitly listing this or any other file system type for which + the optimization is not applicable is not necessary, but we leave + it here to document the risk. Per http://bugs.debian.org/143111, + /proc may have bogus stat.st_nlink values. */ + /* fall through */ + default: + return false; + } +} + +#else +static bool dirent_inode_sort_may_be_useful (int dir_fd) { return true; } +static bool leaf_optimization_applies (int dir_fd) { return false; } +#endif + +#if GNULIB_FTS +/* link-count-optimization entry: + map an stat.st_dev number to a boolean: leaf_optimization_works */ +struct LCO_ent +{ + dev_t st_dev; + bool opt_ok; +}; + +/* Use a tiny initial size. If a traversal encounters more than + a few devices, the cost of growing/rehashing this table will be + rendered negligible by the number of inodes processed. */ +enum { LCO_HT_INITIAL_SIZE = 13 }; + +static size_t +LCO_hash (void const *x, size_t table_size) +{ + struct LCO_ent const *ax = x; + return (uintmax_t) ax->st_dev % table_size; +} + +static bool +LCO_compare (void const *x, void const *y) +{ + struct LCO_ent const *ax = x; + struct LCO_ent const *ay = y; + return ax->st_dev == ay->st_dev; +} + +/* Ask the same question as leaf_optimization_applies, but query + the cache first (FTS.fts_leaf_optimization_works_ht), and if necessary, + update that cache. */ +static bool +link_count_optimize_ok (FTSENT const *p) +{ + FTS *sp = p->fts_fts; + Hash_table *h = sp->fts_leaf_optimization_works_ht; + struct LCO_ent tmp; + struct LCO_ent *ent; + bool opt_ok; + struct LCO_ent *t2; + + /* If we're not in CWDFD mode, don't bother with this optimization, + since the caller is not serious about performance. */ + if (!ISSET(FTS_CWDFD)) + return false; + + /* map st_dev to the boolean, leaf_optimization_works */ + if (h == NULL) + { + h = sp->fts_leaf_optimization_works_ht + = hash_initialize (LCO_HT_INITIAL_SIZE, NULL, LCO_hash, + LCO_compare, free); + if (h == NULL) + return false; + } + tmp.st_dev = p->fts_statp->st_dev; + ent = hash_lookup (h, &tmp); + if (ent) + return ent->opt_ok; + + /* Look-up failed. Query directly and cache the result. */ + t2 = malloc (sizeof *t2); + if (t2 == NULL) + return false; + + /* Is it ok to perform the optimization in the dir, FTS_CWD_FD? */ + opt_ok = leaf_optimization_applies (sp->fts_cwd_fd); + t2->opt_ok = opt_ok; + t2->st_dev = p->fts_statp->st_dev; + + ent = hash_insert (h, t2); + if (ent == NULL) + { + /* insertion failed */ + free (t2); + return false; + } + fts_assert (ent == t2); + + return opt_ok; +} +#endif + /* * Special case of "/" at the end of the file name so that slashes aren't * appended which would cause file names to be written as "....//foo". @@ -685,7 +906,7 @@ fts_read (register FTS *sp) /* If fts_build's call to fts_safe_changedir failed because it was not able to fchdir into a subdirectory, tell the caller. */ - if (p->fts_errno) + if (p->fts_errno && p->fts_info != FTS_DNR) p->fts_info = FTS_ERR; LEAVE_DIR (sp, p, "2"); return (p); @@ -742,7 +963,27 @@ check_for_dir: if (p->fts_info == FTS_NSOK) { if (p->fts_statp->st_size == FTS_STAT_REQUIRED) - p->fts_info = fts_stat(sp, p, false); + { + FTSENT *parent = p->fts_parent; + if (FTS_ROOTLEVEL < p->fts_level + /* ->fts_n_dirs_remaining is not valid + for command-line-specified names. */ + && parent->fts_n_dirs_remaining == 0 + && ISSET(FTS_NOSTAT) + && ISSET(FTS_PHYSICAL) + && link_count_optimize_ok (parent)) + { + /* nothing more needed */ + } + else + { + p->fts_info = fts_stat(sp, p, false); + if (S_ISDIR(p->fts_statp->st_mode) + && p->fts_level != FTS_ROOTLEVEL + && parent->fts_n_dirs_remaining) + parent->fts_n_dirs_remaining--; + } + } else fts_assert (p->fts_statp->st_size == FTS_NO_STAT_REQUIRED); } @@ -912,6 +1153,53 @@ fts_children (register FTS *sp, int instr) return (sp->fts_child); } +/* A comparison function to sort on increasing inode number. + For some file system types, sorting either way makes a huge + performance difference for a directory with very many entries, + but sorting on increasing values is slightly better than sorting + on decreasing values. The difference is in the 5% range. */ +static int +fts_compare_ino (struct _ftsent const **a, struct _ftsent const **b) +{ + return (a[0]->fts_statp->st_ino < b[0]->fts_statp->st_ino ? -1 + : b[0]->fts_statp->st_ino < a[0]->fts_statp->st_ino ? 1 : 0); +} + +/* Map the dirent.d_type value, DTYPE, to the corresponding stat.st_mode + S_IF* bit and set ST.st_mode, thus clearing all other bits in that field. */ +static void +set_stat_type (struct stat *st, unsigned int dtype) +{ + mode_t type; + switch (dtype) + { + case DT_BLK: + type = S_IFBLK; + break; + case DT_CHR: + type = S_IFCHR; + break; + case DT_DIR: + type = S_IFDIR; + break; + case DT_FIFO: + type = S_IFIFO; + break; + case DT_LNK: + type = S_IFLNK; + break; + case DT_REG: + type = S_IFREG; + break; + case DT_SOCK: + type = S_IFSOCK; + break; + default: + type = 0; + } + st->st_mode = type; +} + /* * This is the tricky part -- do not casually change *anything* in here. The * idea is to build the linked list of entries that are used by fts_children @@ -1091,7 +1379,7 @@ mem1: saved_errno = errno; new_len = len + _D_EXACT_NAMLEN (dp); if (new_len < len) { /* - * In the unlikely even that we would end up + * In the unlikely event that we would end up * with a file name longer than SIZE_MAX, free up * the current structure and the structures already * allocated, then error out with ENAMETOOLONG. @@ -1112,6 +1400,9 @@ mem1: saved_errno = errno; if (dp->d_type == DT_WHT) p->fts_flags |= FTS_ISW; #endif + /* Store dirent.d_ino, in case we need to sort + entries before processing them. */ + p->fts_statp->st_ino = D_INO (dp); /* Build a file name for fts_stat to stat. */ if (ISSET(FTS_NOCHDIR)) { @@ -1138,8 +1429,11 @@ mem1: saved_errno = errno; && DT_IS_KNOWN(dp) && ! DT_MUST_BE(dp, DT_DIR)); p->fts_info = FTS_NSOK; + /* Propagate dirent.d_type information back + to caller, when possible. */ + set_stat_type (p->fts_statp, D_TYPE (dp)); fts_set_stat_required(p, !skip_stat); - is_dir = (ISSET(FTS_PHYSICAL) && ISSET(FTS_NOSTAT) + is_dir = (ISSET(FTS_PHYSICAL) && DT_MUST_BE(dp, DT_DIR)); } else { p->fts_info = fts_stat(sp, p, false); @@ -1207,6 +1501,19 @@ mem1: saved_errno = errno; return (NULL); } + /* If there are many entries, no sorting function has been specified, + and this file system is of a type that may be slow with a large + number of entries, then sort the directory entries on increasing + inode numbers. */ + if (nitems > _FTS_INODE_SORT_DIR_ENTRIES_THRESHOLD + && !sp->fts_compar + && ISSET (FTS_CWDFD) + && dirent_inode_sort_may_be_useful (sp->fts_cwd_fd)) { + sp->fts_compar = fts_compare_ino; + head = fts_sort (sp, head, nitems); + sp->fts_compar = NULL; + } + /* Sort the entries. */ if (sp->fts_compar && nitems > 1) head = fts_sort(sp, head, nitems); @@ -1400,6 +1707,8 @@ err: memset(sbp, 0, sizeof(struct stat)); } if (S_ISDIR(sbp->st_mode)) { + p->fts_n_dirs_remaining = (sbp->st_nlink + - (ISSET(FTS_SEEDOT) ? 0 : 2)); if (ISDOT(p->fts_name)) { /* Command-line "." and ".." are real directories. */ return (p->fts_level == FTS_ROOTLEVEL ? FTS_D : FTS_DOT); @@ -1476,7 +1785,7 @@ fts_sort (FTS *sp, FTSENT *head, register size_t nitems) * 40 so don't realloc one entry at a time. */ if (nitems > sp->fts_nitems) { - struct _ftsent **a; + FTSENT **a; sp->fts_nitems = nitems + 40; if (SIZE_MAX / sizeof *a < sp->fts_nitems diff --git a/src/bin/coreutils/lib/fts_.h b/src/bin/coreutils/lib/fts_.h index a8a52d2690..ad339cab5c 100644 --- a/src/bin/coreutils/lib/fts_.h +++ b/src/bin/coreutils/lib/fts_.h @@ -1,11 +1,11 @@ /* Traverse a file hierarchy. - Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc. + Copyright (C) 2004-2009 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* * Copyright (c) 1989, 1993 @@ -130,9 +129,12 @@ typedef struct { file systems like FAT, CIFS, FUSE-based ones, etc., when entries from their name/inode cache are flushed too early. Use this flag to make fts_open and fts_read defer the stat/lstat/fststat - of each entry until it actually processed. However, note that if you use - this option and also specify a comparison function, that function may not - examine any data via fts_statp. */ + of each entry until it is actually processed. However, note that if you + use this option and also specify a comparison function, that function may + not examine any data via fts_statp. However, when fts_statp->st_mode is + nonzero, the S_IFMT type bits are valid, with mapped dirent.d_type data. + Of course, that happens only on file systems that provide useful + dirent.d_type data. */ # define FTS_DEFER_STAT 0x0400 # define FTS_OPTIONMASK 0x07ff /* valid user option mask */ @@ -142,6 +144,15 @@ typedef struct { int fts_options; /* fts_open options, global flags */ # if GNULIB_FTS + /* Map a directory's device number to a boolean. The boolean is + true if for that file system (type determined by a single fstatfs + call per FS) st_nlink can be used to calculate the number of + sub-directory entries in a directory. + Using this table is an optimization that permits us to look up + file system type on a per-inode basis at the minimal cost of + calling fstatfs only once per traversed device. */ + struct hash_table *fts_leaf_optimization_works_ht; + union { /* This data structure is used if FTS_TIGHT_CYCLE_CHECK is specified. It records the directories between a starting @@ -190,6 +201,7 @@ typedef struct _ftsent { ptrdiff_t fts_level; /* depth (-1 to N) */ size_t fts_namelen; /* strlen(fts_name) */ + nlink_t fts_n_dirs_remaining; /* count down from st_nlink */ # define FTS_D 1 /* preorder directory */ # define FTS_DC 2 /* directory that causes cycles */ diff --git a/src/bin/coreutils/lib/full-read.c b/src/bin/coreutils/lib/full-read.c index 8c3472a40f..fb7212bbec 100644 --- a/src/bin/coreutils/lib/full-read.c +++ b/src/bin/coreutils/lib/full-read.c @@ -1,10 +1,10 @@ /* An interface to read that retries after partial reads and interrupts. Copyright (C) 2002, 2003 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ #define FULL_READ #include "full-write.c" diff --git a/src/bin/coreutils/lib/full-read.h b/src/bin/coreutils/lib/full-read.h index 05d83a762b..a341ee0060 100644 --- a/src/bin/coreutils/lib/full-read.h +++ b/src/bin/coreutils/lib/full-read.h @@ -2,10 +2,10 @@ Copyright (C) 2002 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,7 +14,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, read to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ #include diff --git a/src/bin/coreutils/lib/full-write.c b/src/bin/coreutils/lib/full-write.c index cc168720ea..51f2d3819b 100644 --- a/src/bin/coreutils/lib/full-write.c +++ b/src/bin/coreutils/lib/full-write.c @@ -3,10 +3,10 @@ Copyright (C) 1993, 1994, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ #include diff --git a/src/bin/coreutils/lib/full-write.h b/src/bin/coreutils/lib/full-write.h index d20d2fe4ab..9a80146445 100644 --- a/src/bin/coreutils/lib/full-write.h +++ b/src/bin/coreutils/lib/full-write.h @@ -2,10 +2,10 @@ Copyright (C) 2002-2003 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ #include diff --git a/src/bin/coreutils/lib/gai_strerror.c b/src/bin/coreutils/lib/gai_strerror.c index aa733d6cc3..86dfdfab5a 100644 --- a/src/bin/coreutils/lib/gai_strerror.c +++ b/src/bin/coreutils/lib/gai_strerror.c @@ -1,10 +1,13 @@ -/* Copyright (C) 1997, 2001, 2002, 2004, 2005, 2006 Free Software Foundation, Inc. +/* -*- buffer-read-only: t -*- vi: set ro: */ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 +/* Copyright (C) 1997, 2001, 2002, 2004, 2005, 2006, 2008, 2009 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Philip Blundell , 1997. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) + the Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -18,13 +21,10 @@ #ifndef _LIBC # include -# include "getaddrinfo.h" #endif #include -#ifdef HAVE_NETDB_H -# include -#endif +#include #ifdef _LIBC # include @@ -53,7 +53,7 @@ values[] = { EAI_SOCKTYPE, N_("ai_socktype not supported") }, { EAI_SYSTEM, N_("System error") }, { EAI_OVERFLOW, N_("Argument buffer too small") }, -#ifdef __USE_GNU +#ifdef EAI_INPROGRESS { EAI_INPROGRESS, N_("Processing request in progress") }, { EAI_CANCELED, N_("Request canceled") }, { EAI_NOTCANCELED, N_("Request not canceled") }, diff --git a/src/bin/coreutils/lib/getaddrinfo.c b/src/bin/coreutils/lib/getaddrinfo.c index cc718bcf33..bd8d02388f 100644 --- a/src/bin/coreutils/lib/getaddrinfo.c +++ b/src/bin/coreutils/lib/getaddrinfo.c @@ -1,11 +1,14 @@ +/* -*- buffer-read-only: t -*- vi: set ro: */ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 /* Get address information (partial implementation). - Copyright (C) 1997, 2001, 2002, 2004, 2005, 2006, 2007 Free Software + Copyright (C) 1997, 2001, 2002, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. Contributed by Simon Josefsson . This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) + the Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -19,12 +22,15 @@ #include -#include "getaddrinfo.h" +#include #if HAVE_NETINET_IN_H # include #endif +/* Get inet_ntop. */ +#include + /* Get calloc. */ #include @@ -40,8 +46,6 @@ #define _(String) gettext (String) #define N_(String) String -#include "inet_ntop.h" - /* BeOS has AF_INET, but not PF_INET. */ #ifndef PF_INET # define PF_INET AF_INET @@ -179,7 +183,7 @@ getaddrinfo (const char *restrict nodename, const char *proto = (hints && hints->ai_socktype == SOCK_DGRAM) ? "udp" : "tcp"; - if (!(hints->ai_flags & AI_NUMERICSERV)) + if (hints == NULL || !(hints->ai_flags & AI_NUMERICSERV)) /* FIXME: Use getservbyname_r if available. */ se = getservbyname (servname, proto); @@ -300,6 +304,22 @@ getaddrinfo (const char *restrict nodename, tmp->ai_addr->sa_family = he->h_addrtype; tmp->ai_family = he->h_addrtype; +#ifdef HAVE_STRUCT_SOCKADDR_SA_LEN + switch (he->h_addrtype) + { +#if HAVE_IPV4 + case AF_INET: + tmp->ai_addr->sa_len = sizeof (struct sockaddr_in); + break; +#endif +#if HAVE_IPV6 + case AF_INET6: + tmp->ai_addr->sa_len = sizeof (struct sockaddr_in6); + break; +#endif + } +#endif + /* FIXME: If more than one address, create linked list of addrinfo's. */ *res = tmp; @@ -326,7 +346,7 @@ freeaddrinfo (struct addrinfo *ai) cur = ai; ai = ai->ai_next; - if (cur->ai_canonname) free (cur->ai_canonname); + free (cur->ai_canonname); free (cur); } } diff --git a/src/bin/coreutils/lib/getaddrinfo.h b/src/bin/coreutils/lib/getaddrinfo.h deleted file mode 100644 index b4ef242cf1..0000000000 --- a/src/bin/coreutils/lib/getaddrinfo.h +++ /dev/null @@ -1,155 +0,0 @@ -/* Get address information. - Copyright (C) 1996-2002, 2003, 2004, 2005, 2006 - Free Software Foundation, Inc. - Contributed by Simon Josefsson . - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ - -#ifndef GETADDRINFO_H -#define GETADDRINFO_H - -/* sys/socket.h in i386-unknown-freebsd4.10 and - powerpc-apple-darwin5.5 require sys/types.h, so include it first. - Then we'll also get 'socklen_t' and 'struct sockaddr' which are - used below. */ -#include -/* Get all getaddrinfo related declarations, if available. */ -#include -#ifdef HAVE_NETDB_H -# include -#endif - -#ifndef HAVE_STRUCT_ADDRINFO - -/* Structure to contain information about address of a service provider. */ -struct addrinfo -{ - int ai_flags; /* Input flags. */ - int ai_family; /* Protocol family for socket. */ - int ai_socktype; /* Socket type. */ - int ai_protocol; /* Protocol for socket. */ - socklen_t ai_addrlen; /* Length of socket address. */ - struct sockaddr *ai_addr; /* Socket address for socket. */ - char *ai_canonname; /* Canonical name for service location. */ - struct addrinfo *ai_next; /* Pointer to next in list. */ -}; -#endif - -/* Possible values for `ai_flags' field in `addrinfo' structure. */ -#ifndef AI_PASSIVE -# define AI_PASSIVE 0x0001 /* Socket address is intended for `bind'. */ -#endif -#ifndef AI_CANONNAME -# define AI_CANONNAME 0x0002 /* Request for canonical name. */ -#endif -#ifndef AI_NUMERICSERV -# define AI_NUMERICSERV 0x0400 /* Don't use name resolution. */ -#endif - -#if 0 -/* The commented out definitions below are not yet implemented in the - GNULIB getaddrinfo() replacement, so are not yet needed and may, in fact, - cause conflicts on systems with a getaddrinfo() function which does not - define them. - - If they are restored, be sure to protect the definitions with #ifndef. */ -#define AI_NUMERICHOST 0x0004 /* Don't use name resolution. */ -#define AI_V4MAPPED 0x0008 /* IPv4 mapped addresses are acceptable. */ -#define AI_ALL 0x0010 /* Return IPv4 mapped and IPv6 addresses. */ -#define AI_ADDRCONFIG 0x0020 /* Use configuration of this host to choose - returned address type.. */ -#endif /* 0 */ - -/* Error values for `getaddrinfo' function. */ -#ifndef EAI_BADFLAGS -# define EAI_BADFLAGS -1 /* Invalid value for `ai_flags' field. */ -# define EAI_NONAME -2 /* NAME or SERVICE is unknown. */ -# define EAI_AGAIN -3 /* Temporary failure in name resolution. */ -# define EAI_FAIL -4 /* Non-recoverable failure in name res. */ -# define EAI_NODATA -5 /* No address associated with NAME. */ -# define EAI_FAMILY -6 /* `ai_family' not supported. */ -# define EAI_SOCKTYPE -7 /* `ai_socktype' not supported. */ -# define EAI_SERVICE -8 /* SERVICE not supported for `ai_socktype'. */ -# define EAI_MEMORY -10 /* Memory allocation failure. */ -#endif -#ifndef EAI_OVERFLOW -/* Not defined on mingw32. */ -# define EAI_OVERFLOW -12 /* Argument buffer overflow. */ -#endif -#ifndef EAI_ADDRFAMILY -/* Not defined on mingw32. */ -# define EAI_ADDRFAMILY -9 /* Address family for NAME not supported. */ -#endif -#ifndef EAI_SYSTEM -/* Not defined on mingw32. */ -# define EAI_SYSTEM -11 /* System error returned in `errno'. */ -#endif - -#ifdef __USE_GNU -# ifndef EAI_INPROGRESS -# define EAI_INPROGRESS -100 /* Processing request in progress. */ -# define EAI_CANCELED -101 /* Request canceled. */ -# define EAI_NOTCANCELED -102 /* Request not canceled. */ -# define EAI_ALLDONE -103 /* All requests done. */ -# define EAI_INTR -104 /* Interrupted by a signal. */ -# define EAI_IDN_ENCODE -105 /* IDN encoding failed. */ -# endif -#endif - -#if !HAVE_DECL_GETADDRINFO -/* Translate name of a service location and/or a service name to set of - socket addresses. - For more details, see the POSIX:2001 specification - . */ -extern int getaddrinfo (const char *restrict nodename, - const char *restrict servname, - const struct addrinfo *restrict hints, - struct addrinfo **restrict res); -#endif - -#if !HAVE_DECL_FREEADDRINFO -/* Free `addrinfo' structure AI including associated storage. - For more details, see the POSIX:2001 specification - . */ -extern void freeaddrinfo (struct addrinfo *ai); -#endif - -#if !HAVE_DECL_GAI_STRERROR -/* Convert error return from getaddrinfo() to a string. - For more details, see the POSIX:2001 specification - . */ -extern const char *gai_strerror (int ecode); -#endif - -#if !HAVE_DECL_GETNAMEINFO -/* Convert socket address to printable node and service names. - For more details, see the POSIX:2001 specification - . */ -extern int getnameinfo(const struct sockaddr *restrict sa, socklen_t salen, - char *restrict node, socklen_t nodelen, - char *restrict service, socklen_t servicelen, - int flags); - -#endif - -/* Possible flags for getnameinfo. */ -#ifndef NI_NUMERICHOST -# define NI_NUMERICHOST 1 -#endif -#ifndef NI_NUMERICSERV -# define NI_NUMERICSERV 2 -#endif - -#endif /* GETADDRINFO_H */ diff --git a/src/bin/coreutils/lib/getcwd.c b/src/bin/coreutils/lib/getcwd.c index 23b35de679..b9e57d31a9 100644 --- a/src/bin/coreutils/lib/getcwd.c +++ b/src/bin/coreutils/lib/getcwd.c @@ -1,25 +1,22 @@ -/* Copyright (C) 1991,92,93,94,95,96,97,98,99,2004,2005,2006,2007 Free Software - Foundation, Inc. +/* Copyright (C) 1991-1999, 2004-2008 Free Software Foundation, Inc. This file is part of the GNU C Library. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ #if !_LIBC # include # include -# include "dirfd.h" #endif #include @@ -30,6 +27,14 @@ #include /* For AT_FDCWD on Solaris 9. */ +/* If this host provides the openat function, then enable + code below to make getcwd more efficient and robust. */ +#ifdef HAVE_OPENAT +# define HAVE_OPENAT_SUPPORT 1 +#else +# define HAVE_OPENAT_SUPPORT 0 +#endif + #ifndef __set_errno # define __set_errno(val) (errno = (val)) #endif @@ -90,7 +95,7 @@ #endif #if !_LIBC -# define __getcwd getcwd +# define __getcwd rpl_getcwd # define __lstat lstat # define __closedir closedir # define __opendir opendir @@ -123,7 +128,7 @@ __getcwd (char *buf, size_t size) DEEP_NESTING = 100 }; -#ifdef AT_FDCWD +#if HAVE_OPENAT_SUPPORT int fd = AT_FDCWD; bool fd_needs_closing = false; #else @@ -204,7 +209,7 @@ __getcwd (char *buf, size_t size) bool use_d_ino = true; /* Look at the parent directory. */ -#ifdef AT_FDCWD +#if HAVE_OPENAT_SUPPORT fd = openat (fd, "..", O_RDONLY); if (fd < 0) goto lose; @@ -231,7 +236,7 @@ __getcwd (char *buf, size_t size) mount_point = dotdev != thisdev; /* Search for the last directory. */ -#ifdef AT_FDCWD +#if HAVE_OPENAT_SUPPORT dirstream = fdopendir (fd); if (dirstream == NULL) goto lose; @@ -287,7 +292,7 @@ __getcwd (char *buf, size_t size) { int entry_status; -#ifdef AT_FDCWD +#if HAVE_OPENAT_SUPPORT entry_status = fstatat (fd, d->d_name, &st, AT_SYMLINK_NOFOLLOW); #else /* Compute size needed for this file name, or for the file @@ -383,7 +388,7 @@ __getcwd (char *buf, size_t size) if (dirp == &dir[allocated - 1]) *--dirp = '/'; -#ifndef AT_FDCWD +#if ! HAVE_OPENAT_SUPPORT if (dotlist != dots) free (dotlist); #endif @@ -409,7 +414,7 @@ __getcwd (char *buf, size_t size) int save = errno; if (dirstream) __closedir (dirstream); -#ifdef AT_FDCWD +#if HAVE_OPENAT_SUPPORT if (fd_needs_closing) close (fd); #else diff --git a/src/bin/coreutils/lib/getdate.c b/src/bin/coreutils/lib/getdate.c index 5b0788420e..347521d4e6 100644 --- a/src/bin/coreutils/lib/getdate.c +++ b/src/bin/coreutils/lib/getdate.c @@ -1,24 +1,23 @@ -/* A Bison parser, made by GNU Bison 2.3a. */ + +/* A Bison parser, made by GNU Bison 2.4. */ /* Skeleton implementation for Bison's Yacc-like parsers in C - - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify + + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work @@ -29,7 +28,7 @@ special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. - + This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ @@ -47,7 +46,7 @@ #define YYBISON 1 /* Bison version. */ -#define YYBISON_VERSION "2.3a" +#define YYBISON_VERSION "2.4" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -55,24 +54,31 @@ /* Pure parsers. */ #define YYPURE 1 +/* Push parsers. */ +#define YYPUSH 0 + +/* Pull parsers. */ +#define YYPULL 1 + /* Using locations. */ #define YYLSP_NEEDED 0 /* Copy the first part of user declarations. */ -/* Line 164 of yacc.c. */ + +/* Line 189 of yacc.c */ #line 1 "getdate.y" /* Parse a string into an internal time stamp. - Copyright (C) 1999, 2000, 2002, 2003, 2004, 2005, 2006, 2007 Free Software - Foundation, Inc. + Copyright (C) 1999, 2000, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 + Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -80,8 +86,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Originally written by Steven M. Bellovin while at the University of North Carolina at Chapel Hill. Later tweaked by @@ -100,7 +105,10 @@ #include #include "getdate.h" + +#include "intprops.h" #include "timespec.h" +#include "verify.h" /* There's no need to extend the stack, so there's no need to involve alloca. */ @@ -123,13 +131,12 @@ # undef static #endif -#include +#include #include #include #include #include -#include "setenv.h" #include "xalloc.h" @@ -172,6 +179,13 @@ #define HOUR(x) ((x) * 60) +/* Lots of this code assumes time_t and time_t-like values fit into + long int. It also assumes that signed integer overflow silently + wraps around, but there's no portable way to check for that at + compile-time. */ +verify (TYPE_IS_INTEGER (time_t)); +verify (LONG_MIN <= TYPE_MINIMUM (time_t) && TYPE_MAXIMUM (time_t) <= LONG_MAX); + /* An integer value, and the number of digits in its textual representation. */ typedef struct @@ -262,10 +276,77 @@ typedef struct union YYSTYPE; static int yylex (union YYSTYPE *, parser_control *); static int yyerror (parser_control const *, char const *); -static long int time_zone_hhmm (textint, long int); +static long int time_zone_hhmm (parser_control *, textint, long int); + +/* Extract into *PC any date and time info from a string of digits + of the form e.g., YYYYMMDD, YYMMDD, HHMM, HH (and sometimes YYY, + YYYY, ...). */ +static void +digits_to_date_time (parser_control *pc, textint text_int) +{ + if (pc->dates_seen && ! pc->year.digits + && ! pc->rels_seen && (pc->times_seen || 2 < text_int.digits)) + pc->year = text_int; + else + { + if (4 < text_int.digits) + { + pc->dates_seen++; + pc->day = text_int.value % 100; + pc->month = (text_int.value / 100) % 100; + pc->year.value = text_int.value / 10000; + pc->year.digits = text_int.digits - 4; + } + else + { + pc->times_seen++; + if (text_int.digits <= 2) + { + pc->hour = text_int.value; + pc->minutes = 0; + } + else + { + pc->hour = text_int.value / 100; + pc->minutes = text_int.value % 100; + } + pc->seconds.tv_sec = 0; + pc->seconds.tv_nsec = 0; + pc->meridian = MER24; + } + } +} + +/* Increment PC->rel by FACTOR * REL (FACTOR is 1 or -1). */ +static void +apply_relative_time (parser_control *pc, relative_time rel, int factor) +{ + pc->rel.ns += factor * rel.ns; + pc->rel.seconds += factor * rel.seconds; + pc->rel.minutes += factor * rel.minutes; + pc->rel.hour += factor * rel.hour; + pc->rel.day += factor * rel.day; + pc->rel.month += factor * rel.month; + pc->rel.year += factor * rel.year; + pc->rels_seen = true; +} + +/* Set PC-> hour, minutes, seconds and nanoseconds members from arguments. */ +static void +set_hhmmss (parser_control *pc, long int hour, long int minutes, + time_t sec, long int nsec) +{ + pc->hour = hour; + pc->minutes = minutes; + pc->seconds.tv_sec = sec; + pc->seconds.tv_nsec = nsec; +} +/* Line 189 of yacc.c */ +#line 349 "getdate.c" + /* Enabling traces. */ #ifndef YYDEBUG # define YYDEBUG 0 @@ -299,17 +380,18 @@ static long int time_zone_hhmm (textint, long int); tMINUTE_UNIT = 263, tSEC_UNIT = 264, tDAY_UNIT = 265, - tDAY = 266, - tDAYZONE = 267, - tLOCAL_ZONE = 268, - tMERIDIAN = 269, - tMONTH = 270, - tORDINAL = 271, - tZONE = 272, - tSNUMBER = 273, - tUNUMBER = 274, - tSDECIMAL_NUMBER = 275, - tUDECIMAL_NUMBER = 276 + tDAY_SHIFT = 266, + tDAY = 267, + tDAYZONE = 268, + tLOCAL_ZONE = 269, + tMERIDIAN = 270, + tMONTH = 271, + tORDINAL = 272, + tZONE = 273, + tSNUMBER = 274, + tUNUMBER = 275, + tSDECIMAL_NUMBER = 276, + tUDECIMAL_NUMBER = 277 }; #endif /* Tokens. */ @@ -321,46 +403,50 @@ static long int time_zone_hhmm (textint, long int); #define tMINUTE_UNIT 263 #define tSEC_UNIT 264 #define tDAY_UNIT 265 -#define tDAY 266 -#define tDAYZONE 267 -#define tLOCAL_ZONE 268 -#define tMERIDIAN 269 -#define tMONTH 270 -#define tORDINAL 271 -#define tZONE 272 -#define tSNUMBER 273 -#define tUNUMBER 274 -#define tSDECIMAL_NUMBER 275 -#define tUDECIMAL_NUMBER 276 +#define tDAY_SHIFT 266 +#define tDAY 267 +#define tDAYZONE 268 +#define tLOCAL_ZONE 269 +#define tMERIDIAN 270 +#define tMONTH 271 +#define tORDINAL 272 +#define tZONE 273 +#define tSNUMBER 274 +#define tUNUMBER 275 +#define tSDECIMAL_NUMBER 276 +#define tUDECIMAL_NUMBER 277 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE -{/* Line 191 of yacc.c. */ -#line 214 "getdate.y" +{ + +/* Line 214 of yacc.c */ +#line 286 "getdate.y" long int intval; textint textintval; struct timespec timespec; relative_time rel; -} -/* Line 191 of yacc.c. */ -#line 351 "getdate.c" - YYSTYPE; + + + +/* Line 214 of yacc.c */ +#line 438 "getdate.c" +} YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 #endif - - /* Copy the second part of user declarations. */ -/* Line 221 of yacc.c. */ -#line 364 "getdate.c" + +/* Line 264 of yacc.c */ +#line 450 "getdate.c" #ifdef short # undef short @@ -523,9 +609,9 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */ /* A type that is properly aligned for any stack member. */ union yyalloc { - yytype_int16 yyss; - YYSTYPE yyvs; - }; + yytype_int16 yyss_alloc; + YYSTYPE yyvs_alloc; +}; /* The size of the maximum gap between one aligned stack and the next. */ # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) @@ -559,12 +645,12 @@ union yyalloc elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */ -# define YYSTACK_RELOCATE(Stack) \ +# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ do \ { \ YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack, Stack, yysize); \ - Stack = &yyptr->Stack; \ + YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ + Stack = &yyptr->Stack_alloc; \ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ yyptr += yynewbytes / sizeof (*yyptr); \ } \ @@ -575,20 +661,20 @@ union yyalloc /* YYFINAL -- State number of the termination state. */ #define YYFINAL 12 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 91 +#define YYLAST 98 /* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 26 +#define YYNTOKENS 27 /* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 19 +#define YYNNTS 21 /* YYNRULES -- Number of rules. */ -#define YYNRULES 78 +#define YYNRULES 82 /* YYNRULES -- Number of states. */ -#define YYNSTATES 96 +#define YYNSTATES 100 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 -#define YYMAXUTOK 276 +#define YYMAXUTOK 277 #define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) @@ -600,9 +686,9 @@ static const yytype_uint8 yytranslate[] = 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 24, 2, 2, 25, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 23, 2, - 2, 2, 2, 2, 22, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 25, 2, 2, 26, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 24, 2, + 2, 2, 2, 2, 23, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -623,7 +709,7 @@ static const yytype_uint8 yytranslate[] = 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21 + 15, 16, 17, 18, 19, 20, 21, 22 }; #if YYDEBUG @@ -632,54 +718,57 @@ static const yytype_uint8 yytranslate[] = static const yytype_uint8 yyprhs[] = { 0, 0, 3, 5, 7, 10, 11, 14, 16, 18, - 20, 22, 24, 26, 28, 31, 36, 42, 49, 57, - 59, 62, 64, 67, 71, 73, 76, 78, 81, 84, - 87, 91, 97, 101, 105, 109, 112, 117, 120, 124, - 127, 129, 132, 135, 137, 140, 143, 145, 148, 151, - 153, 156, 159, 161, 164, 167, 169, 172, 175, 178, - 181, 183, 185, 188, 191, 194, 197, 200, 203, 205, - 207, 209, 211, 213, 215, 217, 218, 221, 222 + 20, 22, 24, 26, 28, 30, 33, 38, 44, 51, + 59, 61, 64, 66, 69, 73, 75, 78, 80, 83, + 86, 89, 93, 99, 103, 107, 111, 114, 119, 122, + 126, 129, 131, 133, 136, 139, 141, 144, 147, 149, + 152, 155, 157, 160, 163, 165, 168, 171, 173, 176, + 179, 182, 185, 187, 189, 192, 195, 198, 201, 204, + 207, 209, 211, 213, 215, 217, 219, 221, 223, 226, + 227, 230, 231 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ static const yytype_int8 yyrhs[] = { - 27, 0, -1, 28, -1, 29, -1, 22, 39, -1, - -1, 29, 30, -1, 31, -1, 32, -1, 33, -1, - 35, -1, 34, -1, 36, -1, 42, -1, 19, 14, - -1, 19, 23, 19, 44, -1, 19, 23, 19, 18, - 43, -1, 19, 23, 19, 23, 41, 44, -1, 19, - 23, 19, 23, 41, 18, 43, -1, 13, -1, 13, - 4, -1, 17, -1, 17, 38, -1, 17, 18, 43, - -1, 12, -1, 17, 4, -1, 11, -1, 11, 24, - -1, 16, 11, -1, 19, 11, -1, 19, 25, 19, - -1, 19, 25, 19, 25, 19, -1, 19, 18, 18, - -1, 19, 15, 18, -1, 15, 18, 18, -1, 15, - 19, -1, 15, 19, 24, 19, -1, 19, 15, -1, - 19, 15, 19, -1, 37, 3, -1, 37, -1, 16, - 5, -1, 19, 5, -1, 5, -1, 16, 6, -1, - 19, 6, -1, 6, -1, 16, 10, -1, 19, 10, - -1, 10, -1, 16, 7, -1, 19, 7, -1, 7, - -1, 16, 8, -1, 19, 8, -1, 8, -1, 16, - 9, -1, 19, 9, -1, 20, 9, -1, 21, 9, - -1, 9, -1, 38, -1, 18, 5, -1, 18, 6, - -1, 18, 10, -1, 18, 7, -1, 18, 8, -1, - 18, 9, -1, 40, -1, 41, -1, 20, -1, 18, - -1, 21, -1, 19, -1, 19, -1, -1, 23, 19, - -1, -1, 14, -1 + 28, 0, -1, 29, -1, 30, -1, 23, 41, -1, + -1, 30, 31, -1, 32, -1, 33, -1, 34, -1, + 36, -1, 35, -1, 37, -1, 44, -1, 45, -1, + 20, 15, -1, 20, 24, 20, 47, -1, 20, 24, + 20, 19, 46, -1, 20, 24, 20, 24, 43, 47, + -1, 20, 24, 20, 24, 43, 19, 46, -1, 14, + -1, 14, 4, -1, 18, -1, 18, 39, -1, 18, + 19, 46, -1, 13, -1, 18, 4, -1, 12, -1, + 12, 25, -1, 17, 12, -1, 20, 12, -1, 20, + 26, 20, -1, 20, 26, 20, 26, 20, -1, 20, + 19, 19, -1, 20, 16, 19, -1, 16, 19, 19, + -1, 16, 20, -1, 16, 20, 25, 20, -1, 20, + 16, -1, 20, 16, 20, -1, 38, 3, -1, 38, + -1, 40, -1, 17, 5, -1, 20, 5, -1, 5, + -1, 17, 6, -1, 20, 6, -1, 6, -1, 17, + 10, -1, 20, 10, -1, 10, -1, 17, 7, -1, + 20, 7, -1, 7, -1, 17, 8, -1, 20, 8, + -1, 8, -1, 17, 9, -1, 20, 9, -1, 21, + 9, -1, 22, 9, -1, 9, -1, 39, -1, 19, + 5, -1, 19, 6, -1, 19, 10, -1, 19, 7, + -1, 19, 8, -1, 19, 9, -1, 11, -1, 42, + -1, 43, -1, 21, -1, 19, -1, 22, -1, 20, + -1, 20, -1, 20, 39, -1, -1, 24, 20, -1, + -1, 15, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 240, 240, 241, 245, 252, 254, 258, 260, 262, - 264, 266, 268, 270, 274, 282, 290, 300, 307, 319, - 324, 332, 334, 344, 346, 348, 353, 358, 363, 368, - 376, 381, 401, 408, 416, 424, 429, 435, 440, 449, - 459, 472, 474, 476, 478, 480, 482, 484, 486, 488, - 490, 492, 494, 496, 498, 500, 502, 504, 506, 508, - 510, 512, 516, 518, 520, 522, 524, 526, 530, 530, - 533, 534, 539, 540, 545, 583, 584, 590, 591 + 0, 312, 312, 313, 317, 324, 326, 330, 332, 334, + 336, 338, 340, 341, 342, 346, 351, 356, 363, 368, + 378, 383, 391, 393, 396, 398, 400, 405, 410, 415, + 420, 428, 433, 453, 460, 468, 476, 481, 487, 492, + 501, 503, 505, 510, 512, 514, 516, 518, 520, 522, + 524, 526, 528, 530, 532, 534, 536, 538, 540, 542, + 544, 546, 548, 550, 554, 556, 558, 560, 562, 564, + 569, 573, 573, 576, 577, 582, 583, 588, 593, 604, + 605, 611, 612 }; #endif @@ -690,12 +779,13 @@ static const char *const yytname[] = { "$end", "error", "$undefined", "tAGO", "tDST", "tYEAR_UNIT", "tMONTH_UNIT", "tHOUR_UNIT", "tMINUTE_UNIT", "tSEC_UNIT", "tDAY_UNIT", - "tDAY", "tDAYZONE", "tLOCAL_ZONE", "tMERIDIAN", "tMONTH", "tORDINAL", - "tZONE", "tSNUMBER", "tUNUMBER", "tSDECIMAL_NUMBER", "tUDECIMAL_NUMBER", - "'@'", "':'", "','", "'/'", "$accept", "spec", "timespec", "items", - "item", "time", "local_zone", "zone", "day", "date", "rel", "relunit", - "relunit_snumber", "seconds", "signed_seconds", "unsigned_seconds", - "number", "o_colon_minutes", "o_merid", 0 + "tDAY_SHIFT", "tDAY", "tDAYZONE", "tLOCAL_ZONE", "tMERIDIAN", "tMONTH", + "tORDINAL", "tZONE", "tSNUMBER", "tUNUMBER", "tSDECIMAL_NUMBER", + "tUDECIMAL_NUMBER", "'@'", "':'", "','", "'/'", "$accept", "spec", + "timespec", "items", "item", "time", "local_zone", "zone", "day", "date", + "rel", "relunit", "relunit_snumber", "dayshift", "seconds", + "signed_seconds", "unsigned_seconds", "number", "hybrid", + "o_colon_minutes", "o_merid", 0 }; #endif @@ -706,34 +796,36 @@ static const yytype_uint16 yytoknum[] = { 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 64, 58, 44, 47 + 275, 276, 277, 64, 58, 44, 47 }; # endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const yytype_uint8 yyr1[] = { - 0, 26, 27, 27, 28, 29, 29, 30, 30, 30, - 30, 30, 30, 30, 31, 31, 31, 31, 31, 32, - 32, 33, 33, 33, 33, 33, 34, 34, 34, 34, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 36, - 36, 37, 37, 37, 37, 37, 37, 37, 37, 37, - 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, - 37, 37, 38, 38, 38, 38, 38, 38, 39, 39, - 40, 40, 41, 41, 42, 43, 43, 44, 44 + 0, 27, 28, 28, 29, 30, 30, 31, 31, 31, + 31, 31, 31, 31, 31, 32, 32, 32, 32, 32, + 33, 33, 34, 34, 34, 34, 34, 35, 35, 35, + 35, 36, 36, 36, 36, 36, 36, 36, 36, 36, + 37, 37, 37, 38, 38, 38, 38, 38, 38, 38, + 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, + 38, 38, 38, 38, 39, 39, 39, 39, 39, 39, + 40, 41, 41, 42, 42, 43, 43, 44, 45, 46, + 46, 47, 47 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ static const yytype_uint8 yyr2[] = { 0, 2, 1, 1, 2, 0, 2, 1, 1, 1, - 1, 1, 1, 1, 2, 4, 5, 6, 7, 1, - 2, 1, 2, 3, 1, 2, 1, 2, 2, 2, - 3, 5, 3, 3, 3, 2, 4, 2, 3, 2, - 1, 2, 2, 1, 2, 2, 1, 2, 2, 1, - 2, 2, 1, 2, 2, 1, 2, 2, 2, 2, - 1, 1, 2, 2, 2, 2, 2, 2, 1, 1, - 1, 1, 1, 1, 1, 0, 2, 0, 1 + 1, 1, 1, 1, 1, 2, 4, 5, 6, 7, + 1, 2, 1, 2, 3, 1, 2, 1, 2, 2, + 2, 3, 5, 3, 3, 3, 2, 4, 2, 3, + 2, 1, 1, 2, 2, 1, 2, 2, 1, 2, + 2, 1, 2, 2, 1, 2, 2, 1, 2, 2, + 2, 2, 1, 1, 2, 2, 2, 2, 2, 2, + 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, + 2, 0, 1 }; /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state @@ -741,47 +833,49 @@ static const yytype_uint8 yyr2[] = means the default is an error. */ static const yytype_uint8 yydefact[] = { - 5, 0, 0, 2, 3, 71, 73, 70, 72, 4, - 68, 69, 1, 43, 46, 52, 55, 60, 49, 26, - 24, 19, 0, 0, 21, 0, 74, 0, 0, 6, - 7, 8, 9, 11, 10, 12, 40, 61, 13, 27, - 20, 0, 35, 41, 44, 50, 53, 56, 47, 28, - 25, 75, 22, 62, 63, 65, 66, 67, 64, 42, - 45, 51, 54, 57, 48, 29, 14, 37, 0, 0, - 0, 58, 59, 39, 34, 0, 0, 23, 33, 38, - 32, 77, 30, 36, 76, 78, 75, 0, 15, 0, - 16, 77, 31, 75, 17, 18 + 5, 0, 0, 2, 3, 74, 76, 73, 75, 4, + 71, 72, 1, 45, 48, 54, 57, 62, 51, 70, + 27, 25, 20, 0, 0, 22, 0, 77, 0, 0, + 6, 7, 8, 9, 11, 10, 12, 41, 63, 42, + 13, 14, 28, 21, 0, 36, 43, 46, 52, 55, + 58, 49, 29, 26, 79, 23, 64, 65, 67, 68, + 69, 66, 44, 47, 53, 56, 59, 50, 30, 15, + 38, 0, 0, 0, 78, 60, 61, 40, 35, 0, + 0, 24, 34, 39, 33, 81, 31, 37, 80, 82, + 79, 0, 16, 0, 17, 81, 32, 79, 18, 19 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int8 yydefgoto[] = { - -1, 2, 3, 4, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 9, 10, 11, 38, 77, 88 + -1, 2, 3, 4, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 9, 10, 11, 40, 41, 81, + 92 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ -#define YYPACT_NINF -79 +#define YYPACT_NINF -82 static const yytype_int8 yypact[] = { - -10, 47, 27, -79, 25, -79, -79, -79, -79, -79, - -79, -79, -79, -79, -79, -79, -79, -79, -79, 5, - -79, 59, 43, 42, 10, 49, -5, 62, 63, -79, - -79, -79, -79, -79, -79, -79, 70, -79, -79, -79, - -79, 56, 52, -79, -79, -79, -79, -79, -79, -79, - -79, 16, -79, -79, -79, -79, -79, -79, -79, -79, - -79, -79, -79, -79, -79, -79, -79, 51, 57, 58, - 60, -79, -79, -79, -79, 61, 64, -79, -79, -79, - -79, -7, 53, -79, -79, -79, 65, -2, -79, 66, - -79, 46, -79, 65, -79, -79 + -17, 56, 15, -82, 26, -82, -82, -82, -82, -82, + -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, + 36, -82, 68, 10, 50, 9, 59, -5, 72, 73, + -82, -82, -82, -82, -82, -82, -82, 80, -82, -82, + -82, -82, -82, -82, 65, 61, -82, -82, -82, -82, + -82, -82, -82, -82, 17, -82, -82, -82, -82, -82, + -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, + 60, 44, 67, 69, -82, -82, -82, -82, -82, 70, + 71, -82, -82, -82, -82, -7, 62, -82, -82, -82, + 74, -2, -82, 75, -82, 55, -82, 74, -82, -82 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int8 yypgoto[] = { - -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, - -79, -79, 67, -79, -79, -6, -79, -78, -9 + -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, + -82, -82, 46, -82, -82, -82, -6, -82, -82, -81, + -3 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If @@ -791,46 +885,46 @@ static const yytype_int8 yypgoto[] = #define YYTABLE_NINF -1 static const yytype_uint8 yytable[] = { - 59, 60, 61, 62, 63, 64, 65, 85, 90, 66, - 67, 86, 1, 68, 50, 95, 87, 6, 69, 8, - 70, 53, 54, 55, 56, 57, 58, 12, 51, 39, - 13, 14, 15, 16, 17, 18, 19, 20, 21, 76, - 22, 23, 24, 25, 26, 27, 28, 43, 44, 45, - 46, 47, 48, 49, 53, 54, 55, 56, 57, 58, - 85, 41, 42, 40, 93, 5, 6, 7, 8, 78, - 79, 71, 72, 73, 74, 80, 75, 81, 89, 82, - 83, 91, 94, 84, 0, 92, 0, 0, 76, 0, - 0, 52 + 62, 63, 64, 65, 66, 67, 1, 68, 89, 94, + 69, 70, 90, 53, 71, 12, 99, 91, 6, 72, + 8, 73, 56, 57, 58, 59, 60, 61, 54, 44, + 45, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 80, 23, 24, 25, 26, 27, 28, 29, 56, + 57, 58, 59, 60, 61, 46, 47, 48, 49, 50, + 51, 42, 52, 84, 56, 57, 58, 59, 60, 61, + 89, 55, 43, 74, 97, 5, 6, 7, 8, 82, + 83, 75, 76, 77, 78, 95, 79, 85, 93, 86, + 87, 88, 98, 0, 0, 96, 0, 0, 80 }; static const yytype_int8 yycheck[] = { - 5, 6, 7, 8, 9, 10, 11, 14, 86, 14, - 15, 18, 22, 18, 4, 93, 23, 19, 23, 21, - 25, 5, 6, 7, 8, 9, 10, 0, 18, 24, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 23, - 15, 16, 17, 18, 19, 20, 21, 5, 6, 7, - 8, 9, 10, 11, 5, 6, 7, 8, 9, 10, - 14, 18, 19, 4, 18, 18, 19, 20, 21, 18, - 19, 9, 9, 3, 18, 18, 24, 19, 25, 19, - 19, 87, 91, 19, -1, 19, -1, -1, 23, -1, - -1, 24 + 5, 6, 7, 8, 9, 10, 23, 12, 15, 90, + 15, 16, 19, 4, 19, 0, 97, 24, 20, 24, + 22, 26, 5, 6, 7, 8, 9, 10, 19, 19, + 20, 5, 6, 7, 8, 9, 10, 11, 12, 13, + 14, 24, 16, 17, 18, 19, 20, 21, 22, 5, + 6, 7, 8, 9, 10, 5, 6, 7, 8, 9, + 10, 25, 12, 19, 5, 6, 7, 8, 9, 10, + 15, 25, 4, 27, 19, 19, 20, 21, 22, 19, + 20, 9, 9, 3, 19, 91, 25, 20, 26, 20, + 20, 20, 95, -1, -1, 20, -1, -1, 24 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const yytype_uint8 yystos[] = { - 0, 22, 27, 28, 29, 18, 19, 20, 21, 39, - 40, 41, 0, 5, 6, 7, 8, 9, 10, 11, - 12, 13, 15, 16, 17, 18, 19, 20, 21, 30, - 31, 32, 33, 34, 35, 36, 37, 38, 42, 24, - 4, 18, 19, 5, 6, 7, 8, 9, 10, 11, - 4, 18, 38, 5, 6, 7, 8, 9, 10, 5, - 6, 7, 8, 9, 10, 11, 14, 15, 18, 23, - 25, 9, 9, 3, 18, 24, 23, 43, 18, 19, - 18, 19, 19, 19, 19, 14, 18, 23, 44, 25, - 43, 41, 19, 18, 44, 43 + 0, 23, 28, 29, 30, 19, 20, 21, 22, 41, + 42, 43, 0, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 16, 17, 18, 19, 20, 21, 22, + 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 44, 45, 25, 4, 19, 20, 5, 6, 7, 8, + 9, 10, 12, 4, 19, 39, 5, 6, 7, 8, + 9, 10, 5, 6, 7, 8, 9, 10, 12, 15, + 16, 19, 24, 26, 39, 9, 9, 3, 19, 25, + 24, 46, 19, 20, 19, 20, 20, 20, 20, 15, + 19, 24, 47, 26, 46, 43, 20, 19, 47, 46 }; #define yyerrok (yyerrstatus = 0) @@ -1066,11 +1160,11 @@ yy_reduce_print (yyvsp, yyrule, pc) /* The symbols being reduced. */ for (yyi = 0; yyi < yynrhs; yyi++) { - fprintf (stderr, " $%d = ", yyi + 1); + YYFPRINTF (stderr, " $%d = ", yyi + 1); yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], &(yyvsp[(yyi + 1) - (yynrhs)]) , pc); - fprintf (stderr, "\n"); + YYFPRINTF (stderr, "\n"); } } @@ -1352,10 +1446,8 @@ yydestruct (yymsg, yytype, yyvaluep, pc) break; } } - /* Prevent warnings from -Wmissing-prototypes. */ - #ifdef YYPARSE_PARAM #if defined __STDC__ || defined __cplusplus int yyparse (void *YYPARSE_PARAM); @@ -1374,10 +1466,9 @@ int yyparse (); - -/*----------. -| yyparse. | -`----------*/ +/*-------------------------. +| yyparse or yypush_parse. | +`-------------------------*/ #ifdef YYPARSE_PARAM #if (defined __STDC__ || defined __C99__FUNC__ \ @@ -1401,22 +1492,46 @@ yyparse (pc) #endif #endif { - /* The lookahead symbol. */ +/* The lookahead symbol. */ int yychar; /* The semantic value of the lookahead symbol. */ YYSTYPE yylval; -/* Number of syntax errors so far. */ -int yynerrs; + /* Number of syntax errors so far. */ + int yynerrs; + + int yystate; + /* Number of tokens to shift before error messages enabled. */ + int yyerrstatus; + + /* The stacks and their tools: + `yyss': related to states. + `yyvs': related to semantic values. + + Refer to the stacks thru separate pointers, to allow yyoverflow + to reallocate them elsewhere. */ + + /* The state stack. */ + yytype_int16 yyssa[YYINITDEPTH]; + yytype_int16 *yyss; + yytype_int16 *yyssp; + + /* The semantic value stack. */ + YYSTYPE yyvsa[YYINITDEPTH]; + YYSTYPE *yyvs; + YYSTYPE *yyvsp; + + YYSIZE_T yystacksize; - int yystate; int yyn; int yyresult; - /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; /* Lookahead token as an internal (translated) token number. */ - int yytoken = 0; + int yytoken; + /* The variables used to return semantic value and location from the + action routines. */ + YYSTYPE yyval; + #if YYERROR_VERBOSE /* Buffer for error messages, and its allocated size. */ char yymsgbuf[128]; @@ -1424,51 +1539,28 @@ int yynerrs; YYSIZE_T yymsg_alloc = sizeof yymsgbuf; #endif - /* Three stacks and their tools: - `yyss': related to states, - `yyvs': related to semantic values, - `yyls': related to locations. - - Refer to the stacks thru separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ - - /* The state stack. */ - yytype_int16 yyssa[YYINITDEPTH]; - yytype_int16 *yyss = yyssa; - yytype_int16 *yyssp; - - /* The semantic value stack. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs = yyvsa; - YYSTYPE *yyvsp; - - - #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) - YYSIZE_T yystacksize = YYINITDEPTH; - - /* The variables used to return semantic value and location from the - action routines. */ - YYSTYPE yyval; - - /* The number of symbols on the RHS of the reduced rule. Keep to zero when no symbol should be popped. */ int yylen = 0; + yytoken = 0; + yyss = yyssa; + yyvs = yyvsa; + yystacksize = YYINITDEPTH; + YYDPRINTF ((stderr, "Starting parse\n")); yystate = 0; yyerrstatus = 0; yynerrs = 0; - yychar = YYEMPTY; /* Cause a token to be read. */ + yychar = YYEMPTY; /* Cause a token to be read. */ /* Initialize stack pointers. Waste one element of value and location stack so that they stay on the same level as the state stack. The wasted elements are never initialized. */ - yyssp = yyss; yyvsp = yyvs; @@ -1498,7 +1590,6 @@ int yynerrs; YYSTYPE *yyvs1 = yyvs; yytype_int16 *yyss1 = yyss; - /* Each stack pointer address is followed by the size of the data in use in that stack, in bytes. This used to be a conditional around just the two extra args, but that might @@ -1506,7 +1597,6 @@ int yynerrs; yyoverflow (YY_("memory exhausted"), &yyss1, yysize * sizeof (*yyssp), &yyvs1, yysize * sizeof (*yyvsp), - &yystacksize); yyss = yyss1; @@ -1529,9 +1619,8 @@ int yynerrs; (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); if (! yyptr) goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss); - YYSTACK_RELOCATE (yyvs); - + YYSTACK_RELOCATE (yyss_alloc, yyss); + YYSTACK_RELOCATE (yyvs_alloc, yyvs); # undef YYSTACK_RELOCATE if (yyss1 != yyssa) YYSTACK_FREE (yyss1); @@ -1542,7 +1631,6 @@ int yynerrs; yyssp = yyss + yysize - 1; yyvsp = yyvs + yysize - 1; - YYDPRINTF ((stderr, "Stack size increased to %lu\n", (unsigned long int) yystacksize)); @@ -1653,8 +1741,9 @@ yyreduce: switch (yyn) { case 4: -/* Line 1269 of yacc.c. */ -#line 246 "getdate.y" + +/* Line 1455 of yacc.c */ +#line 318 "getdate.y" { pc->seconds = (yyvsp[(2) - (2)].timespec); pc->timespec_seen = true; @@ -1662,207 +1751,204 @@ yyreduce: break; case 7: -/* Line 1269 of yacc.c. */ -#line 259 "getdate.y" + +/* Line 1455 of yacc.c */ +#line 331 "getdate.y" { pc->times_seen++; } break; case 8: -/* Line 1269 of yacc.c. */ -#line 261 "getdate.y" + +/* Line 1455 of yacc.c */ +#line 333 "getdate.y" { pc->local_zones_seen++; } break; case 9: -/* Line 1269 of yacc.c. */ -#line 263 "getdate.y" + +/* Line 1455 of yacc.c */ +#line 335 "getdate.y" { pc->zones_seen++; } break; case 10: -/* Line 1269 of yacc.c. */ -#line 265 "getdate.y" + +/* Line 1455 of yacc.c */ +#line 337 "getdate.y" { pc->dates_seen++; } break; case 11: -/* Line 1269 of yacc.c. */ -#line 267 "getdate.y" + +/* Line 1455 of yacc.c */ +#line 339 "getdate.y" { pc->days_seen++; } break; - case 12: -/* Line 1269 of yacc.c. */ -#line 269 "getdate.y" - { pc->rels_seen = true; } - break; + case 15: - case 14: -/* Line 1269 of yacc.c. */ -#line 275 "getdate.y" +/* Line 1455 of yacc.c */ +#line 347 "getdate.y" { - pc->hour = (yyvsp[(1) - (2)].textintval).value; - pc->minutes = 0; - pc->seconds.tv_sec = 0; - pc->seconds.tv_nsec = 0; + set_hhmmss (pc, (yyvsp[(1) - (2)].textintval).value, 0, 0, 0); pc->meridian = (yyvsp[(2) - (2)].intval); } break; - case 15: -/* Line 1269 of yacc.c. */ -#line 283 "getdate.y" + case 16: + +/* Line 1455 of yacc.c */ +#line 352 "getdate.y" { - pc->hour = (yyvsp[(1) - (4)].textintval).value; - pc->minutes = (yyvsp[(3) - (4)].textintval).value; - pc->seconds.tv_sec = 0; - pc->seconds.tv_nsec = 0; + set_hhmmss (pc, (yyvsp[(1) - (4)].textintval).value, (yyvsp[(3) - (4)].textintval).value, 0, 0); pc->meridian = (yyvsp[(4) - (4)].intval); } break; - case 16: -/* Line 1269 of yacc.c. */ -#line 291 "getdate.y" + case 17: + +/* Line 1455 of yacc.c */ +#line 357 "getdate.y" { - pc->hour = (yyvsp[(1) - (5)].textintval).value; - pc->minutes = (yyvsp[(3) - (5)].textintval).value; - pc->seconds.tv_sec = 0; - pc->seconds.tv_nsec = 0; + set_hhmmss (pc, (yyvsp[(1) - (5)].textintval).value, (yyvsp[(3) - (5)].textintval).value, 0, 0); pc->meridian = MER24; pc->zones_seen++; - pc->time_zone = time_zone_hhmm ((yyvsp[(4) - (5)].textintval), (yyvsp[(5) - (5)].intval)); - } - break; - - case 17: -/* Line 1269 of yacc.c. */ -#line 301 "getdate.y" - { - pc->hour = (yyvsp[(1) - (6)].textintval).value; - pc->minutes = (yyvsp[(3) - (6)].textintval).value; - pc->seconds = (yyvsp[(5) - (6)].timespec); - pc->meridian = (yyvsp[(6) - (6)].intval); + pc->time_zone = time_zone_hhmm (pc, (yyvsp[(4) - (5)].textintval), (yyvsp[(5) - (5)].intval)); } break; case 18: -/* Line 1269 of yacc.c. */ -#line 308 "getdate.y" + +/* Line 1455 of yacc.c */ +#line 364 "getdate.y" { - pc->hour = (yyvsp[(1) - (7)].textintval).value; - pc->minutes = (yyvsp[(3) - (7)].textintval).value; - pc->seconds = (yyvsp[(5) - (7)].timespec); - pc->meridian = MER24; - pc->zones_seen++; - pc->time_zone = time_zone_hhmm ((yyvsp[(6) - (7)].textintval), (yyvsp[(7) - (7)].intval)); + set_hhmmss (pc, (yyvsp[(1) - (6)].textintval).value, (yyvsp[(3) - (6)].textintval).value, (yyvsp[(5) - (6)].timespec).tv_sec, (yyvsp[(5) - (6)].timespec).tv_nsec); + pc->meridian = (yyvsp[(6) - (6)].intval); } break; case 19: -/* Line 1269 of yacc.c. */ -#line 320 "getdate.y" + +/* Line 1455 of yacc.c */ +#line 369 "getdate.y" + { + set_hhmmss (pc, (yyvsp[(1) - (7)].textintval).value, (yyvsp[(3) - (7)].textintval).value, (yyvsp[(5) - (7)].timespec).tv_sec, (yyvsp[(5) - (7)].timespec).tv_nsec); + pc->meridian = MER24; + pc->zones_seen++; + pc->time_zone = time_zone_hhmm (pc, (yyvsp[(6) - (7)].textintval), (yyvsp[(7) - (7)].intval)); + } + break; + + case 20: + +/* Line 1455 of yacc.c */ +#line 379 "getdate.y" { pc->local_isdst = (yyvsp[(1) - (1)].intval); pc->dsts_seen += (0 < (yyvsp[(1) - (1)].intval)); } break; - case 20: -/* Line 1269 of yacc.c. */ -#line 325 "getdate.y" + case 21: + +/* Line 1455 of yacc.c */ +#line 384 "getdate.y" { pc->local_isdst = 1; pc->dsts_seen += (0 < (yyvsp[(1) - (2)].intval)) + 1; } break; - case 21: -/* Line 1269 of yacc.c. */ -#line 333 "getdate.y" + case 22: + +/* Line 1455 of yacc.c */ +#line 392 "getdate.y" { pc->time_zone = (yyvsp[(1) - (1)].intval); } break; - case 22: -/* Line 1269 of yacc.c. */ -#line 335 "getdate.y" - { pc->time_zone = (yyvsp[(1) - (2)].intval); - pc->rel.ns += (yyvsp[(2) - (2)].rel).ns; - pc->rel.seconds += (yyvsp[(2) - (2)].rel).seconds; - pc->rel.minutes += (yyvsp[(2) - (2)].rel).minutes; - pc->rel.hour += (yyvsp[(2) - (2)].rel).hour; - pc->rel.day += (yyvsp[(2) - (2)].rel).day; - pc->rel.month += (yyvsp[(2) - (2)].rel).month; - pc->rel.year += (yyvsp[(2) - (2)].rel).year; - pc->rels_seen = true; } - break; - case 23: -/* Line 1269 of yacc.c. */ -#line 345 "getdate.y" - { pc->time_zone = (yyvsp[(1) - (3)].intval) + time_zone_hhmm ((yyvsp[(2) - (3)].textintval), (yyvsp[(3) - (3)].intval)); } + +/* Line 1455 of yacc.c */ +#line 394 "getdate.y" + { pc->time_zone = (yyvsp[(1) - (2)].intval); + apply_relative_time (pc, (yyvsp[(2) - (2)].rel), 1); } break; case 24: -/* Line 1269 of yacc.c. */ -#line 347 "getdate.y" - { pc->time_zone = (yyvsp[(1) - (1)].intval) + 60; } + +/* Line 1455 of yacc.c */ +#line 397 "getdate.y" + { pc->time_zone = (yyvsp[(1) - (3)].intval) + time_zone_hhmm (pc, (yyvsp[(2) - (3)].textintval), (yyvsp[(3) - (3)].intval)); } break; case 25: -/* Line 1269 of yacc.c. */ -#line 349 "getdate.y" - { pc->time_zone = (yyvsp[(1) - (2)].intval) + 60; } + +/* Line 1455 of yacc.c */ +#line 399 "getdate.y" + { pc->time_zone = (yyvsp[(1) - (1)].intval) + 60; } break; case 26: -/* Line 1269 of yacc.c. */ -#line 354 "getdate.y" + +/* Line 1455 of yacc.c */ +#line 401 "getdate.y" + { pc->time_zone = (yyvsp[(1) - (2)].intval) + 60; } + break; + + case 27: + +/* Line 1455 of yacc.c */ +#line 406 "getdate.y" { - pc->day_ordinal = 1; + pc->day_ordinal = 0; pc->day_number = (yyvsp[(1) - (1)].intval); } break; - case 27: -/* Line 1269 of yacc.c. */ -#line 359 "getdate.y" + case 28: + +/* Line 1455 of yacc.c */ +#line 411 "getdate.y" { - pc->day_ordinal = 1; + pc->day_ordinal = 0; pc->day_number = (yyvsp[(1) - (2)].intval); } break; - case 28: -/* Line 1269 of yacc.c. */ -#line 364 "getdate.y" + case 29: + +/* Line 1455 of yacc.c */ +#line 416 "getdate.y" { pc->day_ordinal = (yyvsp[(1) - (2)].intval); pc->day_number = (yyvsp[(2) - (2)].intval); } break; - case 29: -/* Line 1269 of yacc.c. */ -#line 369 "getdate.y" + case 30: + +/* Line 1455 of yacc.c */ +#line 421 "getdate.y" { pc->day_ordinal = (yyvsp[(1) - (2)].textintval).value; pc->day_number = (yyvsp[(2) - (2)].intval); } break; - case 30: -/* Line 1269 of yacc.c. */ -#line 377 "getdate.y" + case 31: + +/* Line 1455 of yacc.c */ +#line 429 "getdate.y" { pc->month = (yyvsp[(1) - (3)].textintval).value; pc->day = (yyvsp[(3) - (3)].textintval).value; } break; - case 31: -/* Line 1269 of yacc.c. */ -#line 382 "getdate.y" + case 32: + +/* Line 1455 of yacc.c */ +#line 434 "getdate.y" { /* Interpret as YYYY/MM/DD if the first value has 4 or more digits, otherwise as MM/DD/YY. @@ -1884,9 +1970,10 @@ yyreduce: } break; - case 32: -/* Line 1269 of yacc.c. */ -#line 402 "getdate.y" + case 33: + +/* Line 1455 of yacc.c */ +#line 454 "getdate.y" { /* ISO 8601 format. YYYY-MM-DD. */ pc->year = (yyvsp[(1) - (3)].textintval); @@ -1895,9 +1982,10 @@ yyreduce: } break; - case 33: -/* Line 1269 of yacc.c. */ -#line 409 "getdate.y" + case 34: + +/* Line 1455 of yacc.c */ +#line 461 "getdate.y" { /* e.g. 17-JUN-1992. */ pc->day = (yyvsp[(1) - (3)].textintval).value; @@ -1907,9 +1995,10 @@ yyreduce: } break; - case 34: -/* Line 1269 of yacc.c. */ -#line 417 "getdate.y" + case 35: + +/* Line 1455 of yacc.c */ +#line 469 "getdate.y" { /* e.g. JUN-17-1992. */ pc->month = (yyvsp[(1) - (3)].intval); @@ -1919,18 +2008,20 @@ yyreduce: } break; - case 35: -/* Line 1269 of yacc.c. */ -#line 425 "getdate.y" + case 36: + +/* Line 1455 of yacc.c */ +#line 477 "getdate.y" { pc->month = (yyvsp[(1) - (2)].intval); pc->day = (yyvsp[(2) - (2)].textintval).value; } break; - case 36: -/* Line 1269 of yacc.c. */ -#line 430 "getdate.y" + case 37: + +/* Line 1455 of yacc.c */ +#line 482 "getdate.y" { pc->month = (yyvsp[(1) - (4)].intval); pc->day = (yyvsp[(2) - (4)].textintval).value; @@ -1938,18 +2029,20 @@ yyreduce: } break; - case 37: -/* Line 1269 of yacc.c. */ -#line 436 "getdate.y" + case 38: + +/* Line 1455 of yacc.c */ +#line 488 "getdate.y" { pc->day = (yyvsp[(1) - (2)].textintval).value; pc->month = (yyvsp[(2) - (2)].intval); } break; - case 38: -/* Line 1269 of yacc.c. */ -#line 441 "getdate.y" + case 39: + +/* Line 1455 of yacc.c */ +#line 493 "getdate.y" { pc->day = (yyvsp[(1) - (3)].textintval).value; pc->month = (yyvsp[(2) - (3)].intval); @@ -1957,267 +2050,281 @@ yyreduce: } break; - case 39: -/* Line 1269 of yacc.c. */ -#line 450 "getdate.y" - { - pc->rel.ns -= (yyvsp[(1) - (2)].rel).ns; - pc->rel.seconds -= (yyvsp[(1) - (2)].rel).seconds; - pc->rel.minutes -= (yyvsp[(1) - (2)].rel).minutes; - pc->rel.hour -= (yyvsp[(1) - (2)].rel).hour; - pc->rel.day -= (yyvsp[(1) - (2)].rel).day; - pc->rel.month -= (yyvsp[(1) - (2)].rel).month; - pc->rel.year -= (yyvsp[(1) - (2)].rel).year; - } - break; - case 40: -/* Line 1269 of yacc.c. */ -#line 460 "getdate.y" - { - pc->rel.ns += (yyvsp[(1) - (1)].rel).ns; - pc->rel.seconds += (yyvsp[(1) - (1)].rel).seconds; - pc->rel.minutes += (yyvsp[(1) - (1)].rel).minutes; - pc->rel.hour += (yyvsp[(1) - (1)].rel).hour; - pc->rel.day += (yyvsp[(1) - (1)].rel).day; - pc->rel.month += (yyvsp[(1) - (1)].rel).month; - pc->rel.year += (yyvsp[(1) - (1)].rel).year; - } + +/* Line 1455 of yacc.c */ +#line 502 "getdate.y" + { apply_relative_time (pc, (yyvsp[(1) - (2)].rel), -1); } break; case 41: -/* Line 1269 of yacc.c. */ -#line 473 "getdate.y" - { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).year = (yyvsp[(1) - (2)].intval); } + +/* Line 1455 of yacc.c */ +#line 504 "getdate.y" + { apply_relative_time (pc, (yyvsp[(1) - (1)].rel), 1); } break; case 42: -/* Line 1269 of yacc.c. */ -#line 475 "getdate.y" - { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).year = (yyvsp[(1) - (2)].textintval).value; } + +/* Line 1455 of yacc.c */ +#line 506 "getdate.y" + { apply_relative_time (pc, (yyvsp[(1) - (1)].rel), 1); } break; case 43: -/* Line 1269 of yacc.c. */ -#line 477 "getdate.y" - { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).year = 1; } + +/* Line 1455 of yacc.c */ +#line 511 "getdate.y" + { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).year = (yyvsp[(1) - (2)].intval); } break; case 44: -/* Line 1269 of yacc.c. */ -#line 479 "getdate.y" - { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).month = (yyvsp[(1) - (2)].intval); } - break; - case 45: -/* Line 1269 of yacc.c. */ -#line 481 "getdate.y" - { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).month = (yyvsp[(1) - (2)].textintval).value; } - break; - - case 46: -/* Line 1269 of yacc.c. */ -#line 483 "getdate.y" - { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).month = 1; } - break; - - case 47: -/* Line 1269 of yacc.c. */ -#line 485 "getdate.y" - { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).day = (yyvsp[(1) - (2)].intval) * (yyvsp[(2) - (2)].intval); } - break; - - case 48: -/* Line 1269 of yacc.c. */ -#line 487 "getdate.y" - { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).day = (yyvsp[(1) - (2)].textintval).value * (yyvsp[(2) - (2)].intval); } - break; - - case 49: -/* Line 1269 of yacc.c. */ -#line 489 "getdate.y" - { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).day = (yyvsp[(1) - (1)].intval); } - break; - - case 50: -/* Line 1269 of yacc.c. */ -#line 491 "getdate.y" - { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).hour = (yyvsp[(1) - (2)].intval); } - break; - - case 51: -/* Line 1269 of yacc.c. */ -#line 493 "getdate.y" - { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).hour = (yyvsp[(1) - (2)].textintval).value; } - break; - - case 52: -/* Line 1269 of yacc.c. */ -#line 495 "getdate.y" - { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).hour = 1; } - break; - - case 53: -/* Line 1269 of yacc.c. */ -#line 497 "getdate.y" - { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).minutes = (yyvsp[(1) - (2)].intval); } - break; - - case 54: -/* Line 1269 of yacc.c. */ -#line 499 "getdate.y" - { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).minutes = (yyvsp[(1) - (2)].textintval).value; } - break; - - case 55: -/* Line 1269 of yacc.c. */ -#line 501 "getdate.y" - { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).minutes = 1; } - break; - - case 56: -/* Line 1269 of yacc.c. */ -#line 503 "getdate.y" - { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).seconds = (yyvsp[(1) - (2)].intval); } - break; - - case 57: -/* Line 1269 of yacc.c. */ -#line 505 "getdate.y" - { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).seconds = (yyvsp[(1) - (2)].textintval).value; } - break; - - case 58: -/* Line 1269 of yacc.c. */ -#line 507 "getdate.y" - { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).seconds = (yyvsp[(1) - (2)].timespec).tv_sec; (yyval.rel).ns = (yyvsp[(1) - (2)].timespec).tv_nsec; } - break; - - case 59: -/* Line 1269 of yacc.c. */ -#line 509 "getdate.y" - { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).seconds = (yyvsp[(1) - (2)].timespec).tv_sec; (yyval.rel).ns = (yyvsp[(1) - (2)].timespec).tv_nsec; } - break; - - case 60: -/* Line 1269 of yacc.c. */ -#line 511 "getdate.y" - { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).seconds = 1; } - break; - - case 62: -/* Line 1269 of yacc.c. */ -#line 517 "getdate.y" +/* Line 1455 of yacc.c */ +#line 513 "getdate.y" { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).year = (yyvsp[(1) - (2)].textintval).value; } break; - case 63: -/* Line 1269 of yacc.c. */ + case 45: + +/* Line 1455 of yacc.c */ +#line 515 "getdate.y" + { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).year = 1; } + break; + + case 46: + +/* Line 1455 of yacc.c */ +#line 517 "getdate.y" + { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).month = (yyvsp[(1) - (2)].intval); } + break; + + case 47: + +/* Line 1455 of yacc.c */ #line 519 "getdate.y" { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).month = (yyvsp[(1) - (2)].textintval).value; } break; - case 64: -/* Line 1269 of yacc.c. */ + case 48: + +/* Line 1455 of yacc.c */ #line 521 "getdate.y" + { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).month = 1; } + break; + + case 49: + +/* Line 1455 of yacc.c */ +#line 523 "getdate.y" + { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).day = (yyvsp[(1) - (2)].intval) * (yyvsp[(2) - (2)].intval); } + break; + + case 50: + +/* Line 1455 of yacc.c */ +#line 525 "getdate.y" { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).day = (yyvsp[(1) - (2)].textintval).value * (yyvsp[(2) - (2)].intval); } break; - case 65: -/* Line 1269 of yacc.c. */ -#line 523 "getdate.y" + case 51: + +/* Line 1455 of yacc.c */ +#line 527 "getdate.y" + { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).day = (yyvsp[(1) - (1)].intval); } + break; + + case 52: + +/* Line 1455 of yacc.c */ +#line 529 "getdate.y" + { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).hour = (yyvsp[(1) - (2)].intval); } + break; + + case 53: + +/* Line 1455 of yacc.c */ +#line 531 "getdate.y" { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).hour = (yyvsp[(1) - (2)].textintval).value; } break; - case 66: -/* Line 1269 of yacc.c. */ -#line 525 "getdate.y" + case 54: + +/* Line 1455 of yacc.c */ +#line 533 "getdate.y" + { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).hour = 1; } + break; + + case 55: + +/* Line 1455 of yacc.c */ +#line 535 "getdate.y" + { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).minutes = (yyvsp[(1) - (2)].intval); } + break; + + case 56: + +/* Line 1455 of yacc.c */ +#line 537 "getdate.y" { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).minutes = (yyvsp[(1) - (2)].textintval).value; } break; - case 67: -/* Line 1269 of yacc.c. */ -#line 527 "getdate.y" + case 57: + +/* Line 1455 of yacc.c */ +#line 539 "getdate.y" + { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).minutes = 1; } + break; + + case 58: + +/* Line 1455 of yacc.c */ +#line 541 "getdate.y" + { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).seconds = (yyvsp[(1) - (2)].intval); } + break; + + case 59: + +/* Line 1455 of yacc.c */ +#line 543 "getdate.y" { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).seconds = (yyvsp[(1) - (2)].textintval).value; } break; - case 71: -/* Line 1269 of yacc.c. */ -#line 535 "getdate.y" - { (yyval.timespec).tv_sec = (yyvsp[(1) - (1)].textintval).value; (yyval.timespec).tv_nsec = 0; } + case 60: + +/* Line 1455 of yacc.c */ +#line 545 "getdate.y" + { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).seconds = (yyvsp[(1) - (2)].timespec).tv_sec; (yyval.rel).ns = (yyvsp[(1) - (2)].timespec).tv_nsec; } break; - case 73: -/* Line 1269 of yacc.c. */ -#line 541 "getdate.y" - { (yyval.timespec).tv_sec = (yyvsp[(1) - (1)].textintval).value; (yyval.timespec).tv_nsec = 0; } + case 61: + +/* Line 1455 of yacc.c */ +#line 547 "getdate.y" + { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).seconds = (yyvsp[(1) - (2)].timespec).tv_sec; (yyval.rel).ns = (yyvsp[(1) - (2)].timespec).tv_nsec; } + break; + + case 62: + +/* Line 1455 of yacc.c */ +#line 549 "getdate.y" + { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).seconds = 1; } + break; + + case 64: + +/* Line 1455 of yacc.c */ +#line 555 "getdate.y" + { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).year = (yyvsp[(1) - (2)].textintval).value; } + break; + + case 65: + +/* Line 1455 of yacc.c */ +#line 557 "getdate.y" + { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).month = (yyvsp[(1) - (2)].textintval).value; } + break; + + case 66: + +/* Line 1455 of yacc.c */ +#line 559 "getdate.y" + { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).day = (yyvsp[(1) - (2)].textintval).value * (yyvsp[(2) - (2)].intval); } + break; + + case 67: + +/* Line 1455 of yacc.c */ +#line 561 "getdate.y" + { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).hour = (yyvsp[(1) - (2)].textintval).value; } + break; + + case 68: + +/* Line 1455 of yacc.c */ +#line 563 "getdate.y" + { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).minutes = (yyvsp[(1) - (2)].textintval).value; } + break; + + case 69: + +/* Line 1455 of yacc.c */ +#line 565 "getdate.y" + { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).seconds = (yyvsp[(1) - (2)].textintval).value; } + break; + + case 70: + +/* Line 1455 of yacc.c */ +#line 570 "getdate.y" + { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).day = (yyvsp[(1) - (1)].intval); } break; case 74: -/* Line 1269 of yacc.c. */ -#line 546 "getdate.y" - { - if (pc->dates_seen && ! pc->year.digits - && ! pc->rels_seen && (pc->times_seen || 2 < (yyvsp[(1) - (1)].textintval).digits)) - pc->year = (yyvsp[(1) - (1)].textintval); - else - { - if (4 < (yyvsp[(1) - (1)].textintval).digits) - { - pc->dates_seen++; - pc->day = (yyvsp[(1) - (1)].textintval).value % 100; - pc->month = ((yyvsp[(1) - (1)].textintval).value / 100) % 100; - pc->year.value = (yyvsp[(1) - (1)].textintval).value / 10000; - pc->year.digits = (yyvsp[(1) - (1)].textintval).digits - 4; - } - else - { - pc->times_seen++; - if ((yyvsp[(1) - (1)].textintval).digits <= 2) - { - pc->hour = (yyvsp[(1) - (1)].textintval).value; - pc->minutes = 0; - } - else - { - pc->hour = (yyvsp[(1) - (1)].textintval).value / 100; - pc->minutes = (yyvsp[(1) - (1)].textintval).value % 100; - } - pc->seconds.tv_sec = 0; - pc->seconds.tv_nsec = 0; - pc->meridian = MER24; - } - } - } - break; - case 75: -/* Line 1269 of yacc.c. */ -#line 583 "getdate.y" - { (yyval.intval) = -1; } +/* Line 1455 of yacc.c */ +#line 578 "getdate.y" + { (yyval.timespec).tv_sec = (yyvsp[(1) - (1)].textintval).value; (yyval.timespec).tv_nsec = 0; } break; case 76: -/* Line 1269 of yacc.c. */ -#line 585 "getdate.y" - { (yyval.intval) = (yyvsp[(2) - (2)].textintval).value; } + +/* Line 1455 of yacc.c */ +#line 584 "getdate.y" + { (yyval.timespec).tv_sec = (yyvsp[(1) - (1)].textintval).value; (yyval.timespec).tv_nsec = 0; } break; case 77: -/* Line 1269 of yacc.c. */ -#line 590 "getdate.y" - { (yyval.intval) = MER24; } + +/* Line 1455 of yacc.c */ +#line 589 "getdate.y" + { digits_to_date_time (pc, (yyvsp[(1) - (1)].textintval)); } break; case 78: -/* Line 1269 of yacc.c. */ -#line 592 "getdate.y" + +/* Line 1455 of yacc.c */ +#line 594 "getdate.y" + { + /* Hybrid all-digit and relative offset, so that we accept e.g., + "YYYYMMDD +N days" as well as "YYYYMMDD N days". */ + digits_to_date_time (pc, (yyvsp[(1) - (2)].textintval)); + apply_relative_time (pc, (yyvsp[(2) - (2)].rel), 1); + } + break; + + case 79: + +/* Line 1455 of yacc.c */ +#line 604 "getdate.y" + { (yyval.intval) = -1; } + break; + + case 80: + +/* Line 1455 of yacc.c */ +#line 606 "getdate.y" + { (yyval.intval) = (yyvsp[(2) - (2)].textintval).value; } + break; + + case 81: + +/* Line 1455 of yacc.c */ +#line 611 "getdate.y" + { (yyval.intval) = MER24; } + break; + + case 82: + +/* Line 1455 of yacc.c */ +#line 613 "getdate.y" { (yyval.intval) = (yyvsp[(1) - (1)].intval); } break; -/* Line 1269 of yacc.c. */ -#line 2221 "getdate.c" + +/* Line 1455 of yacc.c */ +#line 2328 "getdate.c" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); @@ -2228,7 +2335,6 @@ yyreduce: *++yyvsp = yyval; - /* Now `shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ @@ -2391,7 +2497,7 @@ yyabortlab: yyresult = 1; goto yyreturn; -#ifndef yyoverflow +#if !defined(yyoverflow) || YYERROR_VERBOSE /*-------------------------------------------------. | yyexhaustedlab -- memory exhaustion comes here. | `-------------------------------------------------*/ @@ -2428,8 +2534,9 @@ yyreturn: } -/* Line 1486 of yacc.c. */ -#line 595 "getdate.y" + +/* Line 1675 of yacc.c */ +#line 616 "getdate.y" static table const meridian_table[] = @@ -2493,10 +2600,10 @@ static table const time_units_table[] = /* Assorted relative-time words. */ static table const relative_time_table[] = { - { "TOMORROW", tDAY_UNIT, 1 }, - { "YESTERDAY",tDAY_UNIT, -1 }, - { "TODAY", tDAY_UNIT, 0 }, - { "NOW", tDAY_UNIT, 0 }, + { "TOMORROW", tDAY_SHIFT, 1 }, + { "YESTERDAY",tDAY_SHIFT, -1 }, + { "TODAY", tDAY_SHIFT, 0 }, + { "NOW", tDAY_SHIFT, 0 }, { "LAST", tORDINAL, -1 }, { "THIS", tORDINAL, 0 }, { "NEXT", tORDINAL, 1 }, @@ -2619,15 +2726,33 @@ static table const military_table[] = /* Convert a time zone expressed as HH:MM into an integer count of minutes. If MM is negative, then S is of the form HHMM and needs - to be picked apart; otherwise, S is of the form HH. */ + to be picked apart; otherwise, S is of the form HH. As specified in + http://www.opengroup.org/susv3xbd/xbd_chap08.html#tag_08_03, allow + only valid TZ range, and consider first two digits as hours, if no + minutes specified. */ static long int -time_zone_hhmm (textint s, long int mm) +time_zone_hhmm (parser_control *pc, textint s, long int mm) { + long int n_minutes; + + /* If the length of S is 1 or 2 and no minutes are specified, + interpret it as a number of hours. */ + if (s.digits <= 2 && mm < 0) + s.value *= 100; + if (mm < 0) - return (s.value / 100) * 60 + s.value % 100; + n_minutes = (s.value / 100) * 60 + s.value % 100; else - return s.value * 60 + (s.negative ? -mm : mm); + n_minutes = s.value * 60 + (s.negative ? -mm : mm); + + /* If the absolute number of minutes is larger than 24 hours, + arrange to reject it by incrementing pc->zones_seen. Thus, + we allow only values in the range UTC-24:00 to UTC+24:00. */ + if (24 * 60 < abs (n_minutes)) + pc->zones_seen++; + + return n_minutes; } static int @@ -2724,7 +2849,7 @@ lookup_word (parser_control const *pc, char *word) for (p = word; *p; p++) { unsigned char ch = *p; - *p = toupper (ch); + *p = c_toupper (ch); } for (tp = meridian_table; tp->name; tp++) @@ -2789,7 +2914,7 @@ yylex (YYSTYPE *lvalp, parser_control *pc) for (;;) { - while (c = *pc->input, isspace (c)) + while (c = *pc->input, c_isspace (c)) pc->input++; if (ISDIGIT (c) || c == '-' || c == '+') @@ -2800,7 +2925,7 @@ yylex (YYSTYPE *lvalp, parser_control *pc) if (c == '-' || c == '+') { sign = c == '-' ? -1 : 1; - while (c = *++pc->input, isspace (c)) + while (c = *++pc->input, c_isspace (c)) continue; if (! ISDIGIT (c)) /* skip the '-' sign */ @@ -2904,7 +3029,7 @@ yylex (YYSTYPE *lvalp, parser_control *pc) } } - if (isalpha (c)) + if (c_isalpha (c)) { char buff[20]; char *p = buff; @@ -2916,7 +3041,7 @@ yylex (YYSTYPE *lvalp, parser_control *pc) *p++ = c; c = *++pc->input; } - while (isalpha (c) || c == '.'); + while (c_isalpha (c) || c == '.'); *p = '\0'; tp = lookup_word (pc, buff); @@ -3029,7 +3154,7 @@ get_date (struct timespec *result, char const *p, struct timespec const *now) if (! tmp) return false; - while (c = *p, isspace (c)) + while (c = *p, c_isspace (c)) p++; if (strncmp (p, "TZ=\"", 4) == 0) @@ -3067,6 +3192,12 @@ get_date (struct timespec *result, char const *p, struct timespec const *now) } } + /* As documented, be careful to treat the empty string just like + a date string of "0". Without this, an empty string would be + declared invalid when parsed during a DST transition. */ + if (*p == '\0') + p = "0"; + pc.input = p; pc.year.value = tmp->tm_year; pc.year.value += TM_YEAR_BASE; @@ -3120,7 +3251,7 @@ get_date (struct timespec *result, char const *p, struct timespec const *now) #else #if HAVE_TZNAME { -# ifndef tzname +# if !HAVE_DECL_TZNAME extern char *tzname[]; # endif int i; @@ -3228,32 +3359,15 @@ get_date (struct timespec *result, char const *p, struct timespec const *now) if (pc.days_seen && ! pc.dates_seen) { tm.tm_mday += ((pc.day_number - tm.tm_wday + 7) % 7 - + 7 * (pc.day_ordinal - (0 < pc.day_ordinal))); + + 7 * (pc.day_ordinal + - (0 < pc.day_ordinal + && tm.tm_wday != pc.day_number))); tm.tm_isdst = -1; Start = mktime (&tm); if (Start == (time_t) -1) goto fail; } - if (pc.zones_seen) - { - long int delta = pc.time_zone * 60; - time_t t1; -#ifdef HAVE_TM_GMTOFF - delta -= tm.tm_gmtoff; -#else - time_t t = Start; - struct tm const *gmt = gmtime (&t); - if (! gmt) - goto fail; - delta -= tm_diff (&tm, gmt); -#endif - t1 = Start - delta; - if ((Start < t1) != (delta < 0)) - goto fail; /* time_t overflow */ - Start = t1; - } - /* Add relative date. */ if (pc.rel.year | pc.rel.month | pc.rel.day) { @@ -3276,6 +3390,27 @@ get_date (struct timespec *result, char const *p, struct timespec const *now) goto fail; } + /* The only "output" of this if-block is an updated Start value, + so this block must follow others that clobber Start. */ + if (pc.zones_seen) + { + long int delta = pc.time_zone * 60; + time_t t1; +#ifdef HAVE_TM_GMTOFF + delta -= tm.tm_gmtoff; +#else + time_t t = Start; + struct tm const *gmt = gmtime (&t); + if (! gmt) + goto fail; + delta -= tm_diff (&tm, gmt); +#endif + t1 = Start - delta; + if ((Start < t1) != (delta < 0)) + goto fail; /* time_t overflow */ + Start = t1; + } + /* Add relative hours, minutes, and seconds. On hosts that support leap seconds, ignore the possibility of leap seconds; e.g., "+ 10 minutes" adds 600 seconds, even if one of them is a diff --git a/src/bin/coreutils/lib/getdate.h b/src/bin/coreutils/lib/getdate.h index 142231e286..73b6188392 100644 --- a/src/bin/coreutils/lib/getdate.h +++ b/src/bin/coreutils/lib/getdate.h @@ -3,10 +3,10 @@ Copyright (C) 1995, 1997, 1998, 2003, 2004, 2007 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ #include #include diff --git a/src/bin/coreutils/lib/getdate.y b/src/bin/coreutils/lib/getdate.y index cbf3ca104a..2f3c924134 100644 --- a/src/bin/coreutils/lib/getdate.y +++ b/src/bin/coreutils/lib/getdate.y @@ -1,13 +1,13 @@ %{ /* Parse a string into an internal time stamp. - Copyright (C) 1999, 2000, 2002, 2003, 2004, 2005, 2006, 2007 Free Software - Foundation, Inc. + Copyright (C) 1999, 2000, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 + Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -15,8 +15,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Originally written by Steven M. Bellovin while at the University of North Carolina at Chapel Hill. Later tweaked by @@ -35,7 +34,10 @@ #include #include "getdate.h" + +#include "intprops.h" #include "timespec.h" +#include "verify.h" /* There's no need to extend the stack, so there's no need to involve alloca. */ @@ -58,13 +60,12 @@ # undef static #endif -#include +#include #include #include #include #include -#include "setenv.h" #include "xalloc.h" @@ -107,6 +108,13 @@ #define HOUR(x) ((x) * 60) +/* Lots of this code assumes time_t and time_t-like values fit into + long int. It also assumes that signed integer overflow silently + wraps around, but there's no portable way to check for that at + compile-time. */ +verify (TYPE_IS_INTEGER (time_t)); +verify (LONG_MIN <= TYPE_MINIMUM (time_t) && TYPE_MAXIMUM (time_t) <= LONG_MAX); + /* An integer value, and the number of digits in its textual representation. */ typedef struct @@ -197,7 +205,71 @@ typedef struct union YYSTYPE; static int yylex (union YYSTYPE *, parser_control *); static int yyerror (parser_control const *, char const *); -static long int time_zone_hhmm (textint, long int); +static long int time_zone_hhmm (parser_control *, textint, long int); + +/* Extract into *PC any date and time info from a string of digits + of the form e.g., YYYYMMDD, YYMMDD, HHMM, HH (and sometimes YYY, + YYYY, ...). */ +static void +digits_to_date_time (parser_control *pc, textint text_int) +{ + if (pc->dates_seen && ! pc->year.digits + && ! pc->rels_seen && (pc->times_seen || 2 < text_int.digits)) + pc->year = text_int; + else + { + if (4 < text_int.digits) + { + pc->dates_seen++; + pc->day = text_int.value % 100; + pc->month = (text_int.value / 100) % 100; + pc->year.value = text_int.value / 10000; + pc->year.digits = text_int.digits - 4; + } + else + { + pc->times_seen++; + if (text_int.digits <= 2) + { + pc->hour = text_int.value; + pc->minutes = 0; + } + else + { + pc->hour = text_int.value / 100; + pc->minutes = text_int.value % 100; + } + pc->seconds.tv_sec = 0; + pc->seconds.tv_nsec = 0; + pc->meridian = MER24; + } + } +} + +/* Increment PC->rel by FACTOR * REL (FACTOR is 1 or -1). */ +static void +apply_relative_time (parser_control *pc, relative_time rel, int factor) +{ + pc->rel.ns += factor * rel.ns; + pc->rel.seconds += factor * rel.seconds; + pc->rel.minutes += factor * rel.minutes; + pc->rel.hour += factor * rel.hour; + pc->rel.day += factor * rel.day; + pc->rel.month += factor * rel.month; + pc->rel.year += factor * rel.year; + pc->rels_seen = true; +} + +/* Set PC-> hour, minutes, seconds and nanoseconds members from arguments. */ +static void +set_hhmmss (parser_control *pc, long int hour, long int minutes, + time_t sec, long int nsec) +{ + pc->hour = hour; + pc->minutes = minutes; + pc->seconds.tv_sec = sec; + pc->seconds.tv_nsec = nsec; +} %} @@ -221,7 +293,7 @@ static long int time_zone_hhmm (textint, long int); %token tAGO tDST %token tYEAR_UNIT tMONTH_UNIT tHOUR_UNIT tMINUTE_UNIT tSEC_UNIT -%token tDAY_UNIT +%token tDAY_UNIT tDAY_SHIFT %token tDAY tDAYZONE tLOCAL_ZONE tMERIDIAN %token tMONTH tORDINAL tZONE @@ -232,7 +304,7 @@ static long int time_zone_hhmm (textint, long int); %type o_colon_minutes o_merid %type seconds signed_seconds unsigned_seconds -%type relunit relunit_snumber +%type relunit relunit_snumber dayshift %% @@ -266,52 +338,39 @@ item: | day { pc->days_seen++; } | rel - { pc->rels_seen = true; } | number + | hybrid ; time: tUNUMBER tMERIDIAN { - pc->hour = $1.value; - pc->minutes = 0; - pc->seconds.tv_sec = 0; - pc->seconds.tv_nsec = 0; + set_hhmmss (pc, $1.value, 0, 0, 0); pc->meridian = $2; } | tUNUMBER ':' tUNUMBER o_merid { - pc->hour = $1.value; - pc->minutes = $3.value; - pc->seconds.tv_sec = 0; - pc->seconds.tv_nsec = 0; + set_hhmmss (pc, $1.value, $3.value, 0, 0); pc->meridian = $4; } | tUNUMBER ':' tUNUMBER tSNUMBER o_colon_minutes { - pc->hour = $1.value; - pc->minutes = $3.value; - pc->seconds.tv_sec = 0; - pc->seconds.tv_nsec = 0; + set_hhmmss (pc, $1.value, $3.value, 0, 0); pc->meridian = MER24; pc->zones_seen++; - pc->time_zone = time_zone_hhmm ($4, $5); + pc->time_zone = time_zone_hhmm (pc, $4, $5); } | tUNUMBER ':' tUNUMBER ':' unsigned_seconds o_merid { - pc->hour = $1.value; - pc->minutes = $3.value; - pc->seconds = $5; + set_hhmmss (pc, $1.value, $3.value, $5.tv_sec, $5.tv_nsec); pc->meridian = $6; } | tUNUMBER ':' tUNUMBER ':' unsigned_seconds tSNUMBER o_colon_minutes { - pc->hour = $1.value; - pc->minutes = $3.value; - pc->seconds = $5; + set_hhmmss (pc, $1.value, $3.value, $5.tv_sec, $5.tv_nsec); pc->meridian = MER24; pc->zones_seen++; - pc->time_zone = time_zone_hhmm ($6, $7); + pc->time_zone = time_zone_hhmm (pc, $6, $7); } ; @@ -333,16 +392,9 @@ zone: { pc->time_zone = $1; } | tZONE relunit_snumber { pc->time_zone = $1; - pc->rel.ns += $2.ns; - pc->rel.seconds += $2.seconds; - pc->rel.minutes += $2.minutes; - pc->rel.hour += $2.hour; - pc->rel.day += $2.day; - pc->rel.month += $2.month; - pc->rel.year += $2.year; - pc->rels_seen = true; } + apply_relative_time (pc, $2, 1); } | tZONE tSNUMBER o_colon_minutes - { pc->time_zone = $1 + time_zone_hhmm ($2, $3); } + { pc->time_zone = $1 + time_zone_hhmm (pc, $2, $3); } | tDAYZONE { pc->time_zone = $1 + 60; } | tZONE tDST @@ -352,12 +404,12 @@ zone: day: tDAY { - pc->day_ordinal = 1; + pc->day_ordinal = 0; pc->day_number = $1; } | tDAY ',' { - pc->day_ordinal = 1; + pc->day_ordinal = 0; pc->day_number = $1; } | tORDINAL tDAY @@ -447,25 +499,11 @@ date: rel: relunit tAGO - { - pc->rel.ns -= $1.ns; - pc->rel.seconds -= $1.seconds; - pc->rel.minutes -= $1.minutes; - pc->rel.hour -= $1.hour; - pc->rel.day -= $1.day; - pc->rel.month -= $1.month; - pc->rel.year -= $1.year; - } + { apply_relative_time (pc, $1, -1); } | relunit - { - pc->rel.ns += $1.ns; - pc->rel.seconds += $1.seconds; - pc->rel.minutes += $1.minutes; - pc->rel.hour += $1.hour; - pc->rel.day += $1.day; - pc->rel.month += $1.month; - pc->rel.year += $1.year; - } + { apply_relative_time (pc, $1, 1); } + | dayshift + { apply_relative_time (pc, $1, 1); } ; relunit: @@ -527,6 +565,11 @@ relunit_snumber: { $$ = RELATIVE_TIME_0; $$.seconds = $1.value; } ; +dayshift: + tDAY_SHIFT + { $$ = RELATIVE_TIME_0; $$.day = $1; } + ; + seconds: signed_seconds | unsigned_seconds; signed_seconds: @@ -543,38 +586,16 @@ unsigned_seconds: number: tUNUMBER + { digits_to_date_time (pc, $1); } + ; + +hybrid: + tUNUMBER relunit_snumber { - if (pc->dates_seen && ! pc->year.digits - && ! pc->rels_seen && (pc->times_seen || 2 < $1.digits)) - pc->year = $1; - else - { - if (4 < $1.digits) - { - pc->dates_seen++; - pc->day = $1.value % 100; - pc->month = ($1.value / 100) % 100; - pc->year.value = $1.value / 10000; - pc->year.digits = $1.digits - 4; - } - else - { - pc->times_seen++; - if ($1.digits <= 2) - { - pc->hour = $1.value; - pc->minutes = 0; - } - else - { - pc->hour = $1.value / 100; - pc->minutes = $1.value % 100; - } - pc->seconds.tv_sec = 0; - pc->seconds.tv_nsec = 0; - pc->meridian = MER24; - } - } + /* Hybrid all-digit and relative offset, so that we accept e.g., + "YYYYMMDD +N days" as well as "YYYYMMDD N days". */ + digits_to_date_time (pc, $1); + apply_relative_time (pc, $2, 1); } ; @@ -655,10 +676,10 @@ static table const time_units_table[] = /* Assorted relative-time words. */ static table const relative_time_table[] = { - { "TOMORROW", tDAY_UNIT, 1 }, - { "YESTERDAY",tDAY_UNIT, -1 }, - { "TODAY", tDAY_UNIT, 0 }, - { "NOW", tDAY_UNIT, 0 }, + { "TOMORROW", tDAY_SHIFT, 1 }, + { "YESTERDAY",tDAY_SHIFT, -1 }, + { "TODAY", tDAY_SHIFT, 0 }, + { "NOW", tDAY_SHIFT, 0 }, { "LAST", tORDINAL, -1 }, { "THIS", tORDINAL, 0 }, { "NEXT", tORDINAL, 1 }, @@ -781,15 +802,33 @@ static table const military_table[] = /* Convert a time zone expressed as HH:MM into an integer count of minutes. If MM is negative, then S is of the form HHMM and needs - to be picked apart; otherwise, S is of the form HH. */ + to be picked apart; otherwise, S is of the form HH. As specified in + http://www.opengroup.org/susv3xbd/xbd_chap08.html#tag_08_03, allow + only valid TZ range, and consider first two digits as hours, if no + minutes specified. */ static long int -time_zone_hhmm (textint s, long int mm) +time_zone_hhmm (parser_control *pc, textint s, long int mm) { + long int n_minutes; + + /* If the length of S is 1 or 2 and no minutes are specified, + interpret it as a number of hours. */ + if (s.digits <= 2 && mm < 0) + s.value *= 100; + if (mm < 0) - return (s.value / 100) * 60 + s.value % 100; + n_minutes = (s.value / 100) * 60 + s.value % 100; else - return s.value * 60 + (s.negative ? -mm : mm); + n_minutes = s.value * 60 + (s.negative ? -mm : mm); + + /* If the absolute number of minutes is larger than 24 hours, + arrange to reject it by incrementing pc->zones_seen. Thus, + we allow only values in the range UTC-24:00 to UTC+24:00. */ + if (24 * 60 < abs (n_minutes)) + pc->zones_seen++; + + return n_minutes; } static int @@ -886,7 +925,7 @@ lookup_word (parser_control const *pc, char *word) for (p = word; *p; p++) { unsigned char ch = *p; - *p = toupper (ch); + *p = c_toupper (ch); } for (tp = meridian_table; tp->name; tp++) @@ -951,7 +990,7 @@ yylex (YYSTYPE *lvalp, parser_control *pc) for (;;) { - while (c = *pc->input, isspace (c)) + while (c = *pc->input, c_isspace (c)) pc->input++; if (ISDIGIT (c) || c == '-' || c == '+') @@ -962,7 +1001,7 @@ yylex (YYSTYPE *lvalp, parser_control *pc) if (c == '-' || c == '+') { sign = c == '-' ? -1 : 1; - while (c = *++pc->input, isspace (c)) + while (c = *++pc->input, c_isspace (c)) continue; if (! ISDIGIT (c)) /* skip the '-' sign */ @@ -1066,7 +1105,7 @@ yylex (YYSTYPE *lvalp, parser_control *pc) } } - if (isalpha (c)) + if (c_isalpha (c)) { char buff[20]; char *p = buff; @@ -1078,7 +1117,7 @@ yylex (YYSTYPE *lvalp, parser_control *pc) *p++ = c; c = *++pc->input; } - while (isalpha (c) || c == '.'); + while (c_isalpha (c) || c == '.'); *p = '\0'; tp = lookup_word (pc, buff); @@ -1191,7 +1230,7 @@ get_date (struct timespec *result, char const *p, struct timespec const *now) if (! tmp) return false; - while (c = *p, isspace (c)) + while (c = *p, c_isspace (c)) p++; if (strncmp (p, "TZ=\"", 4) == 0) @@ -1229,6 +1268,12 @@ get_date (struct timespec *result, char const *p, struct timespec const *now) } } + /* As documented, be careful to treat the empty string just like + a date string of "0". Without this, an empty string would be + declared invalid when parsed during a DST transition. */ + if (*p == '\0') + p = "0"; + pc.input = p; pc.year.value = tmp->tm_year; pc.year.value += TM_YEAR_BASE; @@ -1282,7 +1327,7 @@ get_date (struct timespec *result, char const *p, struct timespec const *now) #else #if HAVE_TZNAME { -# ifndef tzname +# if !HAVE_DECL_TZNAME extern char *tzname[]; # endif int i; @@ -1390,32 +1435,15 @@ get_date (struct timespec *result, char const *p, struct timespec const *now) if (pc.days_seen && ! pc.dates_seen) { tm.tm_mday += ((pc.day_number - tm.tm_wday + 7) % 7 - + 7 * (pc.day_ordinal - (0 < pc.day_ordinal))); + + 7 * (pc.day_ordinal + - (0 < pc.day_ordinal + && tm.tm_wday != pc.day_number))); tm.tm_isdst = -1; Start = mktime (&tm); if (Start == (time_t) -1) goto fail; } - if (pc.zones_seen) - { - long int delta = pc.time_zone * 60; - time_t t1; -#ifdef HAVE_TM_GMTOFF - delta -= tm.tm_gmtoff; -#else - time_t t = Start; - struct tm const *gmt = gmtime (&t); - if (! gmt) - goto fail; - delta -= tm_diff (&tm, gmt); -#endif - t1 = Start - delta; - if ((Start < t1) != (delta < 0)) - goto fail; /* time_t overflow */ - Start = t1; - } - /* Add relative date. */ if (pc.rel.year | pc.rel.month | pc.rel.day) { @@ -1438,6 +1466,27 @@ get_date (struct timespec *result, char const *p, struct timespec const *now) goto fail; } + /* The only "output" of this if-block is an updated Start value, + so this block must follow others that clobber Start. */ + if (pc.zones_seen) + { + long int delta = pc.time_zone * 60; + time_t t1; +#ifdef HAVE_TM_GMTOFF + delta -= tm.tm_gmtoff; +#else + time_t t = Start; + struct tm const *gmt = gmtime (&t); + if (! gmt) + goto fail; + delta -= tm_diff (&tm, gmt); +#endif + t1 = Start - delta; + if ((Start < t1) != (delta < 0)) + goto fail; /* time_t overflow */ + Start = t1; + } + /* Add relative hours, minutes, and seconds. On hosts that support leap seconds, ignore the possibility of leap seconds; e.g., "+ 10 minutes" adds 600 seconds, even if one of them is a diff --git a/src/bin/coreutils/lib/getdelim.c b/src/bin/coreutils/lib/getdelim.c index e0b8a708ba..f44a2d41d6 100644 --- a/src/bin/coreutils/lib/getdelim.c +++ b/src/bin/coreutils/lib/getdelim.c @@ -1,10 +1,13 @@ +/* -*- buffer-read-only: t -*- vi: set ro: */ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 /* getdelim.c --- Implementation of replacement getdelim function. - Copyright (C) 1994, 1996, 1997, 1998, 2001, 2003, 2005, 2006 Free + Copyright (C) 1994, 1996, 1997, 1998, 2001, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as - published by the Free Software Foundation; either version 2, or (at + published by the Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, but @@ -21,7 +24,7 @@ #include -#include "getdelim.h" +#include #include #include @@ -33,13 +36,18 @@ #ifndef SSIZE_MAX # define SSIZE_MAX ((ssize_t) (SIZE_MAX / 2)) #endif -#if !HAVE_FLOCKFILE + +#if USE_UNLOCKED_IO +# include "unlocked-io.h" +# define getc_maybe_unlocked(fp) getc(fp) +#elif !HAVE_FLOCKFILE || !HAVE_FUNLOCKFILE || !HAVE_DECL_GETC_UNLOCKED # undef flockfile -# define flockfile(x) ((void) 0) -#endif -#if !HAVE_FUNLOCKFILE # undef funlockfile +# define flockfile(x) ((void) 0) # define funlockfile(x) ((void) 0) +# define getc_maybe_unlocked(fp) getc(fp) +#else +# define getc_maybe_unlocked(fp) getc_unlocked(fp) #endif /* Read up to (and including) a DELIMITER from FP into *LINEPTR (and @@ -64,20 +72,22 @@ getdelim (char **lineptr, size_t *n, int delimiter, FILE *fp) if (*lineptr == NULL || *n == 0) { + char *new_lineptr; *n = 120; - *lineptr = (char *) malloc (*n); - if (*lineptr == NULL) + new_lineptr = (char *) realloc (*lineptr, *n); + if (new_lineptr == NULL) { result = -1; goto unlock_return; } + *lineptr = new_lineptr; } for (;;) { int i; - i = getc (fp); + i = getc_maybe_unlocked (fp); if (i == EOF) { result = -1; @@ -97,6 +107,7 @@ getdelim (char **lineptr, size_t *n, int delimiter, FILE *fp) if (cur_len + 1 >= needed) { result = -1; + errno = EOVERFLOW; goto unlock_return; } @@ -121,6 +132,7 @@ getdelim (char **lineptr, size_t *n, int delimiter, FILE *fp) result = cur_len ? cur_len : result; unlock_return: - funlockfile (fp); + funlockfile (fp); /* doesn't set errno */ + return result; } diff --git a/src/bin/coreutils/lib/getdelim.h b/src/bin/coreutils/lib/getdelim.h deleted file mode 100644 index 8bc61307e5..0000000000 --- a/src/bin/coreutils/lib/getdelim.h +++ /dev/null @@ -1,28 +0,0 @@ -/* getdelim.h --- Prototype for replacement getdelim function. - Copyright (C) 2005 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License as - published by the Free Software Foundation; either version 2, or (at - your option) any later version. - - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - 02110-1301, USA. */ - -/* Written by Simon Josefsson. */ - -/* Get size_t, FILE, ssize_t. And getdelim, if available. */ -# include -# include -# include - -#if !HAVE_DECL_GETDELIM -ssize_t getdelim (char **lineptr, size_t *n, int delimiter, FILE *stream); -#endif /* !HAVE_GETDELIM */ diff --git a/src/bin/coreutils/lib/getgroups.c b/src/bin/coreutils/lib/getgroups.c index 615bd4f5d3..1e9cbc6495 100644 --- a/src/bin/coreutils/lib/getgroups.c +++ b/src/bin/coreutils/lib/getgroups.c @@ -1,11 +1,12 @@ /* provide consistent interface to getgroups for systems that don't allow N==0 - Copyright (C) 1996, 1999, 2003, 2006 Free Software Foundation, Inc. + Copyright (C) 1996, 1999, 2003, 2006, 2007, 2008 Free Software + Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,17 +14,19 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* written by Jim Meyering */ #include +#undef getgroups + #include #include #include #include +#include #include "xalloc.h" @@ -33,14 +36,12 @@ provided function handle all others. */ int -getgroups (int n, GETGROUPS_T *group) +rpl_getgroups (int n, GETGROUPS_T *group) { int n_groups; GETGROUPS_T *gbuf; int saved_errno; -#undef getgroups - if (n != 0) return getgroups (n, group); diff --git a/src/bin/coreutils/lib/gethostname.c b/src/bin/coreutils/lib/gethostname.c index eedc40ec4f..acff351d87 100644 --- a/src/bin/coreutils/lib/gethostname.c +++ b/src/bin/coreutils/lib/gethostname.c @@ -1,11 +1,11 @@ /* gethostname emulation for SysV and POSIX.1. - Copyright (C) 1992, 2003, 2006 Free Software Foundation, Inc. + Copyright (C) 1992, 2003, 2006, 2008 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,17 +13,21 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* David MacKenzie */ #include +/* Specification. */ +#include + #ifdef HAVE_UNAME # include #endif +#include + /* Put up to LEN chars of the host name into NAME. Null terminate it if the name is shorter than LEN. Return 0 if ok, -1 if error. */ diff --git a/src/bin/coreutils/lib/gethrxtime.c b/src/bin/coreutils/lib/gethrxtime.c index 2046e0607f..7aa648455b 100644 --- a/src/bin/coreutils/lib/gethrxtime.c +++ b/src/bin/coreutils/lib/gethrxtime.c @@ -2,10 +2,10 @@ Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Paul Eggert. */ diff --git a/src/bin/coreutils/lib/gethrxtime.h b/src/bin/coreutils/lib/gethrxtime.h index 2247f968d3..bd54f95688 100644 --- a/src/bin/coreutils/lib/gethrxtime.h +++ b/src/bin/coreutils/lib/gethrxtime.h @@ -2,10 +2,10 @@ Copyright (C) 2005 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Paul Eggert. */ diff --git a/src/bin/coreutils/lib/getline.c b/src/bin/coreutils/lib/getline.c index c8c9244a04..7bf8544420 100644 --- a/src/bin/coreutils/lib/getline.c +++ b/src/bin/coreutils/lib/getline.c @@ -1,9 +1,12 @@ +/* -*- buffer-read-only: t -*- vi: set ro: */ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 /* getline.c --- Implementation of replacement getline function. - Copyright (C) 2005, 2006 Free Software Foundation, Inc. + Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as - published by the Free Software Foundation; either version 2, or (at + published by the Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, but @@ -20,8 +23,7 @@ #include -#include "getdelim.h" -#include "getline.h" +#include ssize_t getline (char **lineptr, size_t *n, FILE *stream) diff --git a/src/bin/coreutils/lib/getline.h b/src/bin/coreutils/lib/getline.h deleted file mode 100644 index f0f61c4b2e..0000000000 --- a/src/bin/coreutils/lib/getline.h +++ /dev/null @@ -1,28 +0,0 @@ -/* getline.h --- Prototype for replacement getline function. - Copyright (C) 2005 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License as - published by the Free Software Foundation; either version 2, or (at - your option) any later version. - - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - 02110-1301, USA. */ - -/* Written by Simon Josefsson. */ - -/* Get size_t, FILE, ssize_t. And getline, if available. */ -# include -# include -# include - -#if !HAVE_DECL_GETLINE -ssize_t getline (char **lineptr, size_t *n, FILE *stream); -#endif /* !HAVE_GETLINE */ diff --git a/src/bin/coreutils/lib/getloadavg.c b/src/bin/coreutils/lib/getloadavg.c index cfa62735bb..5a4005cee0 100644 --- a/src/bin/coreutils/lib/getloadavg.c +++ b/src/bin/coreutils/lib/getloadavg.c @@ -1,16 +1,16 @@ /* Get the system load averages. Copyright (C) 1985, 1986, 1987, 1988, 1989, 1991, 1992, 1993, 1994, - 1995, 1997, 1999, 2000, 2003, 2004, 2005, 2006 Free Software - Foundation, Inc. + 1995, 1997, 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free + Software Foundation, Inc. NOTE: The canonical source of this file is maintained with gnulib. Bugs can be reported to bug-gnulib@gnu.org. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -18,9 +18,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - USA. */ + along with this program. If not, see . */ /* Compile-time symbols that this file uses: @@ -32,6 +30,8 @@ If that isn't an option, then just put AC_CHECK_FUNCS(pstat_getdynamic) in your configure.in file. + HAVE_LIBPERFSTAT Define this if your system has the + perfstat_cpu_total function in libperfstat (AIX). FIXUP_KERNEL_SYMBOL_ADDR() Adjust address in returned struct nlist. KERNEL_FILE Name of the kernel file to nlist. LDAV_CVT() Scale the load average from the kernel. @@ -89,9 +89,11 @@ # include #endif +/* Specification. */ +#include + #include #include -#include /* Exclude all the code except the test program at the end if the system has its own `getloadavg' function. */ @@ -188,6 +190,8 @@ # include # include # include +/* Tru64 4.0D's table.h redefines sys */ +# undef sys # endif # if defined (__osf__) && (defined (mips) || defined (__mips__)) @@ -254,7 +258,7 @@ # define LOAD_AVE_TYPE long # endif -# ifdef _AIX +# if defined _AIX && ! defined HAVE_LIBPERFSTAT # define LOAD_AVE_TYPE long # endif @@ -309,7 +313,7 @@ # define FSCALE 100.0 # endif -# ifdef _AIX +# if defined _AIX && !defined HAVE_LIBPERFSTAT # define FSCALE 65536.0 # endif @@ -347,7 +351,7 @@ # define LDAV_SYMBOL "_Loadavg" # endif -# if !defined (LDAV_SYMBOL) && ((defined (hpux) && !defined (hp9000s300)) || defined (_SEQUENT_) || defined (SVR4) || defined (ISC) || defined (sgi) || (defined (ardent) && defined (titan)) || defined (_AIX)) +# if !defined (LDAV_SYMBOL) && ((defined (hpux) && !defined (hp9000s300)) || defined (_SEQUENT_) || defined (SVR4) || defined (ISC) || defined (sgi) || (defined (ardent) && defined (titan)) || (defined (_AIX) && !defined(HAVE_LIBPERFSTAT))) # define LDAV_SYMBOL "avenrun" # endif @@ -404,6 +408,15 @@ # endif /* LOAD_AVE_TYPE */ +# if defined HAVE_LIBPERFSTAT +# include +# include +# include +# ifndef SBITS +# define SBITS 16 +# endif +# endif + # if defined (__GNU__) && !defined (NeXT) /* Note that NeXT Openstep defines __GNU__ even though it should not. */ /* GNU system acts much like NeXT, for load average purposes, @@ -568,6 +581,22 @@ getloadavg (double loadavg[], int nelem) # endif /* hpux && HAVE_PSTAT_GETDYNAMIC */ +# if ! defined LDAV_DONE && defined HAVE_LIBPERFSTAT +# define LDAV_DONE +# undef LOAD_AVE_TYPE +/* Use perfstat_cpu_total because we don't have to be root. */ + { + perfstat_cpu_total_t cpu_stats; + int result = perfstat_cpu_total (NULL, &cpu_stats, sizeof cpu_stats, 1); + if (result == -1) + return result; + loadavg[0] = cpu_stats.loadavg[0] / (double)(1 << SBITS); + loadavg[1] = cpu_stats.loadavg[1] / (double)(1 << SBITS); + loadavg[2] = cpu_stats.loadavg[2] / (double)(1 << SBITS); + elem = 3; + } +# endif + # if !defined (LDAV_DONE) && (defined (__linux__) || defined (__CYGWIN__)) # define LDAV_DONE # undef LOAD_AVE_TYPE @@ -592,8 +621,11 @@ getloadavg (double loadavg[], int nelem) for (elem = 0; elem < nelem; elem++) { char *endptr; - double d = c_strtod (ptr, &endptr); - if (ptr == endptr) + double d; + + errno = 0; + d = c_strtod (ptr, &endptr); + if (ptr == endptr || (d == 0 && errno != 0)) { if (elem == 0) return -1; diff --git a/src/bin/coreutils/lib/getndelim2.c b/src/bin/coreutils/lib/getndelim2.c index 9a9e6e756a..9dcb9feb46 100644 --- a/src/bin/coreutils/lib/getndelim2.c +++ b/src/bin/coreutils/lib/getndelim2.c @@ -1,13 +1,13 @@ /* getndelim2 - Read a line from a stream, stopping at one of 2 delimiters, with bounded memory allocation. - Copyright (C) 1993, 1996, 1997, 1998, 2000, 2003, 2004, 2006 Free + Copyright (C) 1993, 1996, 1997, 1998, 2000, 2003, 2004, 2006, 2008 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -15,8 +15,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Originally written by Jan Brittenson, bson@gnu.ai.mit.edu. */ @@ -24,20 +23,41 @@ #include "getndelim2.h" -#include +#include #include +#include +#include #if USE_UNLOCKED_IO # include "unlocked-io.h" #endif +#if !HAVE_FLOCKFILE +# undef flockfile +# define flockfile(x) ((void) 0) +#endif +#if !HAVE_FUNLOCKFILE +# undef funlockfile +# define funlockfile(x) ((void) 0) +#endif #include #include +#include "freadptr.h" +#include "freadseek.h" +#include "memchr2.h" + #ifndef SSIZE_MAX # define SSIZE_MAX ((ssize_t) (SIZE_MAX / 2)) #endif +/* Use this to suppress gcc's `...may be used before initialized' warnings. */ +#ifdef lint +# define IF_LINT(Code) Code +#else +# define IF_LINT(Code) /* empty */ +#endif + /* The maximum value that getndelim2 can return without suffering from overflow problems, either internally (because of pointer subtraction overflow) or due to the API (because of ssize_t). */ @@ -56,6 +76,7 @@ getndelim2 (char **lineptr, size_t *linesize, size_t offset, size_t nmax, ssize_t bytes_stored = -1; char *ptr = *lineptr; size_t size = *linesize; + bool found_delimiter; if (!ptr) { @@ -74,21 +95,69 @@ getndelim2 (char **lineptr, size_t *linesize, size_t offset, size_t nmax, if (nbytes_avail == 0 && nmax <= size) goto done; - for (;;) - { - /* Here always ptr + size == read_pos + nbytes_avail. */ + /* Normalize delimiters, since memchr2 doesn't handle EOF. */ + if (delim1 == EOF) + delim1 = delim2; + else if (delim2 == EOF) + delim2 = delim1; - int c; + flockfile (stream); + + found_delimiter = false; + do + { + /* Here always ptr + size == read_pos + nbytes_avail. + Also nbytes_avail > 0 || size < nmax. */ + + int c IF_LINT (= 0); + const char *buffer; + size_t buffer_len; + + buffer = freadptr (stream, &buffer_len); + if (buffer) + { + if (delim1 != EOF) + { + const char *end = memchr2 (buffer, delim1, delim2, buffer_len); + if (end) + { + buffer_len = end - buffer + 1; + found_delimiter = true; + } + } + } + else + { + c = getc (stream); + if (c == EOF) + { + /* Return partial line, if any. */ + if (read_pos == ptr) + goto unlock_done; + else + break; + } + if (c == delim1 || c == delim2) + found_delimiter = true; + buffer_len = 1; + } /* We always want at least one byte left in the buffer, since we always (unless we get an error while reading the first byte) NUL-terminate the line buffer. */ - if (nbytes_avail < 2 && size < nmax) + if (nbytes_avail < buffer_len + 1 && size < nmax) { + /* Grow size proportionally, not linearly, to avoid O(n^2) + running time. */ size_t newsize = size < MIN_CHUNK ? size + MIN_CHUNK : 2 * size; char *newptr; + /* Increase newsize so that it becomes + >= (read_pos - ptr) + buffer_len. */ + if (newsize - (read_pos - ptr) < buffer_len + 1) + newsize = (read_pos - ptr) + buffer_len + 1; + /* Respect nmax. This handles possible integer overflow. */ if (! (size < newsize && newsize <= nmax)) newsize = nmax; @@ -96,39 +165,41 @@ getndelim2 (char **lineptr, size_t *linesize, size_t offset, size_t nmax, { size_t newsizemax = offset + GETNDELIM2_MAXIMUM + 1; if (size == newsizemax) - goto done; + goto unlock_done; newsize = newsizemax; } nbytes_avail = newsize - (read_pos - ptr); newptr = realloc (ptr, newsize); if (!newptr) - goto done; + goto unlock_done; ptr = newptr; size = newsize; read_pos = size - nbytes_avail + ptr; } - c = getc (stream); - if (c == EOF) + /* Here, if size < nmax, nbytes_avail >= buffer_len + 1. + If size == nmax, nbytes_avail > 0. */ + + if (1 < nbytes_avail) { - /* Return partial line, if any. */ - if (read_pos == ptr) - goto done; + size_t copy_len = nbytes_avail - 1; + if (buffer_len < copy_len) + copy_len = buffer_len; + if (buffer) + memcpy (read_pos, buffer, copy_len); else - break; + *read_pos = c; + read_pos += copy_len; + nbytes_avail -= copy_len; } - if (nbytes_avail >= 2) - { - *read_pos++ = c; - nbytes_avail--; - } + /* Here still nbytes_avail > 0. */ - if (c == delim1 || c == delim2) - /* Return the line. */ - break; + if (buffer && freadseek (stream, buffer_len)) + goto unlock_done; } + while (!found_delimiter); /* Done - NUL terminate and return the number of bytes read. At this point we know that nbytes_avail >= 1. */ @@ -136,8 +207,11 @@ getndelim2 (char **lineptr, size_t *linesize, size_t offset, size_t nmax, bytes_stored = read_pos - (ptr + offset); + unlock_done: + funlockfile (stream); + done: *lineptr = ptr; *linesize = size; - return bytes_stored; + return bytes_stored ? bytes_stored : -1; } diff --git a/src/bin/coreutils/lib/getndelim2.h b/src/bin/coreutils/lib/getndelim2.h index 37a597f7c2..c1c8375810 100644 --- a/src/bin/coreutils/lib/getndelim2.h +++ b/src/bin/coreutils/lib/getndelim2.h @@ -3,10 +3,10 @@ Copyright (C) 2003, 2004, 2006 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ #ifndef GETNDELIM2_H #define GETNDELIM2_H 1 diff --git a/src/bin/coreutils/lib/getopt.c b/src/bin/coreutils/lib/getopt.c index 3580ad825c..f1e6d1f7c7 100644 --- a/src/bin/coreutils/lib/getopt.c +++ b/src/bin/coreutils/lib/getopt.c @@ -2,23 +2,22 @@ NOTE: getopt is now part of the C library, so if you don't know what "Keep this file name-space clean" means, talk to drepper@gnu.org before changing it! - Copyright (C) 1987,88,89,90,91,92,93,94,95,96,98,99,2000,2001,2002,2003,2004,2006 + Copyright (C) 1987,88,89,90,91,92,93,94,95,96,98,99,2000,2001,2002,2003,2004,2006,2008 Free Software Foundation, Inc. This file is part of the GNU C Library. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ #ifndef _LIBC # include @@ -31,10 +30,6 @@ #include #include -#ifdef __VMS -# include -#endif - #ifdef _LIBC # include #else diff --git a/src/bin/coreutils/lib/getopt_.h b/src/bin/coreutils/lib/getopt.in.h similarity index 96% rename from src/bin/coreutils/lib/getopt_.h rename to src/bin/coreutils/lib/getopt.in.h index 615ef9a3b6..d2d3e6e63b 100644 --- a/src/bin/coreutils/lib/getopt_.h +++ b/src/bin/coreutils/lib/getopt.in.h @@ -3,19 +3,18 @@ Free Software Foundation, Inc. This file is part of the GNU C Library. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ #ifndef _GETOPT_H diff --git a/src/bin/coreutils/lib/getopt1.c b/src/bin/coreutils/lib/getopt1.c index cc0746ea43..ba115c472e 100644 --- a/src/bin/coreutils/lib/getopt1.c +++ b/src/bin/coreutils/lib/getopt1.c @@ -1,21 +1,20 @@ /* getopt_long and getopt_long_only entry points for GNU getopt. - Copyright (C) 1987,88,89,90,91,92,93,94,96,97,98,2004,2006 + Copyright (C) 1987,88,89,90,91,92,93,94,96,97,98,2004,2006,2009 Free Software Foundation, Inc. This file is part of the GNU C Library. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ #ifdef _LIBC # include @@ -92,7 +91,7 @@ main (int argc, char **argv) { int this_option_optind = optind ? optind : 1; int option_index = 0; - static struct option long_options[] = + static const struct option long_options[] = { {"add", 1, 0, 0}, {"append", 0, 0, 0}, diff --git a/src/bin/coreutils/lib/getopt_int.h b/src/bin/coreutils/lib/getopt_int.h index 401579fd28..3c6628bb94 100644 --- a/src/bin/coreutils/lib/getopt_int.h +++ b/src/bin/coreutils/lib/getopt_int.h @@ -3,19 +3,18 @@ Free Software Foundation, Inc. This file is part of the GNU C Library. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ #ifndef _GETOPT_INT_H #define _GETOPT_INT_H 1 diff --git a/src/bin/coreutils/lib/getpagesize.c b/src/bin/coreutils/lib/getpagesize.c new file mode 100644 index 0000000000..5498aa9483 --- /dev/null +++ b/src/bin/coreutils/lib/getpagesize.c @@ -0,0 +1,39 @@ +/* getpagesize emulation for systems where it cannot be done in a C macro. + + Copyright (C) 2007 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* Written by Bruno Haible and Martin Lambers. */ + +#include + +/* Specification. */ +#include + +/* This implementation is only for native Win32 systems. */ +#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ + +# define WIN32_LEAN_AND_MEAN +# include + +int +getpagesize (void) +{ + SYSTEM_INFO system_info; + GetSystemInfo (&system_info); + return system_info.dwPageSize; +} + +#endif diff --git a/src/bin/coreutils/lib/getpagesize.h b/src/bin/coreutils/lib/getpagesize.h deleted file mode 100644 index 8863336666..0000000000 --- a/src/bin/coreutils/lib/getpagesize.h +++ /dev/null @@ -1,68 +0,0 @@ -/* Emulate getpagesize on systems that lack it. - Copyright (C) 1999, 2000, 2004, 2005 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - USA. */ - -#ifndef HAVE_GETPAGESIZE - -#include - -#if !defined getpagesize && defined _SC_PAGESIZE -# if ! (defined __VMS && __VMS_VER < 70000000) -# define getpagesize() sysconf (_SC_PAGESIZE) -# endif -#endif - -#if !defined getpagesize && defined __VMS -# ifdef __ALPHA -# define getpagesize() 8192 -# else -# define getpagesize() 512 -# endif -#endif - -/* This is for BeOS. */ -#if !defined getpagesize && HAVE_OS_H -# include -# if defined B_PAGE_SIZE -# define getpagesize() B_PAGE_SIZE -# endif -#endif - -/* This is for AmigaOS4.0. */ -#if !defined getpagesize && defined __amigaos4__ -# define getpagesize() 2048 -#endif - -#if !defined getpagesize && HAVE_SYS_PARAM_H -# include -# ifdef EXEC_PAGESIZE -# define getpagesize() EXEC_PAGESIZE -# else -# ifdef NBPG -# ifndef CLSIZE -# define CLSIZE 1 -# endif -# define getpagesize() (NBPG * CLSIZE) -# else -# ifdef NBPC -# define getpagesize() NBPC -# endif -# endif -# endif -#endif - -#endif /* not HAVE_GETPAGESIZE */ diff --git a/src/bin/coreutils/lib/getpass.c b/src/bin/coreutils/lib/getpass.c index 5b39b6d813..e144eff621 100644 --- a/src/bin/coreutils/lib/getpass.c +++ b/src/bin/coreutils/lib/getpass.c @@ -1,11 +1,14 @@ -/* Copyright (C) 1992-2001, 2003, 2004, 2005, 2006 Free Software +/* -*- buffer-read-only: t -*- vi: set ro: */ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 +/* Copyright (C) 1992-2001, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. This file is part of the GNU C Library. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) + the Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -41,8 +44,6 @@ # include #endif -#include "getline.h" - #if USE_UNLOCKED_IO # include "unlocked-io.h" #else @@ -142,7 +143,7 @@ getpass (const char *prompt) == fileno (out). The POSIX restrictions are tricky and change from POSIX version to POSIX version, so play it safe and invoke fseek even if in != out. */ - fseek (out, 0, SEEK_CUR); + fseeko (out, 0, SEEK_CUR); if (buf != NULL) { diff --git a/src/bin/coreutils/lib/getpass.h b/src/bin/coreutils/lib/getpass.h index bdff8754d4..cb987ea9c1 100644 --- a/src/bin/coreutils/lib/getpass.h +++ b/src/bin/coreutils/lib/getpass.h @@ -1,10 +1,13 @@ +/* -*- buffer-read-only: t -*- vi: set ro: */ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 /* getpass.h -- Read a password of arbitrary length from /dev/tty or stdin. Copyright (C) 2004 Free Software Foundation, Inc. Contributed by Simon Josefsson , 2004. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) + the Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/src/bin/coreutils/lib/gettext.h b/src/bin/coreutils/lib/gettext.h index 9d76ec9afc..34edd9d0c5 100644 --- a/src/bin/coreutils/lib/gettext.h +++ b/src/bin/coreutils/lib/gettext.h @@ -1,9 +1,12 @@ +/* -*- buffer-read-only: t -*- vi: set ro: */ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 /* Convenience header for conditional use of GNU . - Copyright (C) 1995-1998, 2000-2002, 2004-2006 Free Software Foundation, Inc. + Copyright (C) 1995-1998, 2000-2002, 2004-2006, 2009 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) + the Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -63,21 +66,30 @@ for invalid uses of the value returned from these functions. On pre-ANSI systems without 'const', the config.h file is supposed to contain "#define const". */ +# undef gettext # define gettext(Msgid) ((const char *) (Msgid)) +# undef dgettext # define dgettext(Domainname, Msgid) ((void) (Domainname), gettext (Msgid)) +# undef dcgettext # define dcgettext(Domainname, Msgid, Category) \ ((void) (Category), dgettext (Domainname, Msgid)) +# undef ngettext # define ngettext(Msgid1, Msgid2, N) \ ((N) == 1 \ ? ((void) (Msgid2), (const char *) (Msgid1)) \ : ((void) (Msgid1), (const char *) (Msgid2))) +# undef dngettext # define dngettext(Domainname, Msgid1, Msgid2, N) \ ((void) (Domainname), ngettext (Msgid1, Msgid2, N)) +# undef dcngettext # define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \ ((void) (Category), dngettext(Domainname, Msgid1, Msgid2, N)) +# undef textdomain # define textdomain(Domainname) ((const char *) (Domainname)) +# undef bindtextdomain # define bindtextdomain(Domainname, Dirname) \ ((void) (Domainname), (const char *) (Dirname)) +# undef bind_textdomain_codeset # define bind_textdomain_codeset(Domainname, Codeset) \ ((void) (Domainname), (const char *) (Codeset)) diff --git a/src/bin/coreutils/lib/gettime.c b/src/bin/coreutils/lib/gettime.c index 86bd325091..1b8533637d 100644 --- a/src/bin/coreutils/lib/gettime.c +++ b/src/bin/coreutils/lib/gettime.c @@ -2,10 +2,10 @@ Copyright (C) 2002, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Paul Eggert. */ diff --git a/src/bin/coreutils/lib/gettimeofday.c b/src/bin/coreutils/lib/gettimeofday.c index bd5576cb09..12a910fb2b 100644 --- a/src/bin/coreutils/lib/gettimeofday.c +++ b/src/bin/coreutils/lib/gettimeofday.c @@ -1,3 +1,6 @@ +/* -*- buffer-read-only: t -*- vi: set ro: */ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 /* Provide gettimeofday for systems that don't have it or for which it's broken. Copyright (C) 2001, 2002, 2003, 2005, 2006, 2007 Free Software @@ -5,7 +8,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) + the Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -41,6 +44,12 @@ static struct tm tm_zero_buffer; static struct tm *localtime_buffer_addr = &tm_zero_buffer; +#undef localtime +extern struct tm *localtime (time_t const *); + +#undef gmtime +extern struct tm *gmtime (time_t const *); + /* This is a wrapper for localtime. It is used only on systems for which gettimeofday clobbers the static buffer used for localtime's result. @@ -48,10 +57,8 @@ static struct tm *localtime_buffer_addr = &tm_zero_buffer; localtime uses for its result. */ struct tm * -localtime (time_t const *timep) +rpl_localtime (time_t const *timep) { -#undef localtime - extern struct tm *localtime (time_t const *); struct tm *tm = localtime (timep); if (localtime_buffer_addr == &tm_zero_buffer) @@ -62,10 +69,8 @@ localtime (time_t const *timep) /* Same as above, since gmtime and localtime use the same buffer. */ struct tm * -gmtime (time_t const *timep) +rpl_gmtime (time_t const *timep) { -#undef gmtime - extern struct tm *gmtime (time_t const *); struct tm *tm = gmtime (timep); if (localtime_buffer_addr == &tm_zero_buffer) @@ -77,14 +82,15 @@ gmtime (time_t const *timep) #endif /* GETTIMEOFDAY_CLOBBERS_LOCALTIME || TZSET_CLOBBERS_LOCALTIME */ #if TZSET_CLOBBERS_LOCALTIME + +#undef tzset +extern void tzset (void); + /* This is a wrapper for tzset, for systems on which tzset may clobber the static buffer used for localtime's result. */ void -tzset (void) +rpl_tzset (void) { -#undef tzset - extern void tzset (void); - /* Save and restore the contents of the buffer used for localtime's result around the call to tzset. */ struct tm save = *localtime_buffer_addr; diff --git a/src/bin/coreutils/lib/getugroups.c b/src/bin/coreutils/lib/getugroups.c index 970192e675..b266bb8c32 100644 --- a/src/bin/coreutils/lib/getugroups.c +++ b/src/bin/coreutils/lib/getugroups.c @@ -1,12 +1,11 @@ /* getugroups.c -- return a list of the groups a user is in - Copyright (C) 1990, 1991, 1998, 1999, 2000, 2003, 2004, 2005, 2006 - Free Software Foundation. + Copyright (C) 1990, 1991, 1998-2000, 2003-2008 Free Software Foundation. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,28 +13,26 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by David MacKenzie. */ #include -#include +#include "getugroups.h" + +#include #include /* grp.h on alpha OSF1 V2.0 uses "FILE *". */ #include #include #include -#ifndef EOVERFLOW -# define EOVERFLOW EINVAL -#endif /* Some old header files might not declare setgrent, getgrent, and endgrent. If you don't have them at all, we can't implement this function. You lose! */ -struct group *getgrent (); +struct group *getgrent (void); #include @@ -45,15 +42,14 @@ struct group *getgrent (); process. Store at most MAXCOUNT group IDs in the GROUPLIST array. If GID is not -1, store it first (if possible). GID should be the group ID (pw_gid) obtained from getpwuid, in case USERNAME is not - listed in /etc/groups. - Always return the number of groups of which USERNAME is a member. */ + listed in /etc/groups. Upon failure, set errno and return -1. + Otherwise, return the number of IDs we've written into GROUPLIST. */ int -getugroups (int maxcount, GETGROUPS_T *grouplist, char *username, gid_t gid) +getugroups (int maxcount, GETGROUPS_T *grouplist, char const *username, + gid_t gid) { - struct group *grp; - register char **cp; - register int count = 0; + int count = 0; if (gid != (gid_t) -1) { @@ -63,8 +59,16 @@ getugroups (int maxcount, GETGROUPS_T *grouplist, char *username, gid_t gid) } setgrent (); - while ((grp = getgrent ()) != 0) + while (1) { + char **cp; + struct group *grp; + + errno = 0; + grp = getgrent (); + if (grp == NULL) + break; + for (cp = grp->gr_mem; *cp; ++cp) { int n; @@ -83,22 +87,28 @@ getugroups (int maxcount, GETGROUPS_T *grouplist, char *username, gid_t gid) if (maxcount != 0) { if (count >= maxcount) - { - endgrent (); - return count; - } + goto done; grouplist[count] = grp->gr_gid; } - count++; - if (count < 0) + if (count == INT_MAX) { errno = EOVERFLOW; - return -1; + goto done; } + count++; } } } - endgrent (); + + if (errno != 0) + count = -1; + + done: + { + int saved_errno = errno; + endgrent (); + errno = saved_errno; + } return count; } diff --git a/src/bin/coreutils/lib/getugroups.h b/src/bin/coreutils/lib/getugroups.h new file mode 100644 index 0000000000..f2914add7f --- /dev/null +++ b/src/bin/coreutils/lib/getugroups.h @@ -0,0 +1,19 @@ +/* Get a list of group IDs associated with a specified user ID. + Copyright (C) 2007 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#include +int getugroups (int maxcount, GETGROUPS_T *grouplist, char const *username, + gid_t gid); diff --git a/src/bin/coreutils/lib/getusershell.c b/src/bin/coreutils/lib/getusershell.c index 6e7a443f12..bea62a07af 100644 --- a/src/bin/coreutils/lib/getusershell.c +++ b/src/bin/coreutils/lib/getusershell.c @@ -1,12 +1,12 @@ /* getusershell.c -- Return names of valid user shells. - Copyright (C) 1991, 1997, 2000, 2001, 2003, 2004, 2005, 2006 Free + Copyright (C) 1991, 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,13 +14,15 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by David MacKenzie */ #include +/* Specification. */ +#include + #ifndef SHELLS_FILE # ifndef __DJGPP__ /* File containing a list of nonrestricted shells, one per line. */ diff --git a/src/bin/coreutils/lib/gnulib.mk b/src/bin/coreutils/lib/gnulib.mk index e833d14fb5..94d776213d 100644 --- a/src/bin/coreutils/lib/gnulib.mk +++ b/src/bin/coreutils/lib/gnulib.mk @@ -1,6 +1,6 @@ ## DO NOT EDIT! GENERATED AUTOMATICALLY! ## Process this file with automake to produce Makefile.in. -# Copyright (C) 2004-2007 Free Software Foundation, Inc. +# Copyright (C) 2002-2009 Free Software Foundation, Inc. # # This file is free software, distributed under the terms of the GNU # General Public License. As a special exception to the GNU General @@ -9,10 +9,11 @@ # the same distribution terms as the rest of that program. # # Generated by gnulib-tool. -# Reproduce by: gnulib-tool --import --dir=. --local-dir=gl --lib=libcoreutils --source-base=lib --m4-base=m4 --doc-base=doc --aux-dir=build-aux --avoid=lock --avoid=size_max --avoid=xsize --avoid=canonicalize-lgpl --no-libtool --macro-prefix=gl acl alloca announce-gen argmatch assert atexit backupfile base64 c-strcase c-strtod c-strtold calloc canon-host canonicalize chown cloexec closeout config-h configmake cycle-check d-ino d-type diacrit dirfd dirname dup2 error euidaccess exclude exitfail fchdir fcntl fcntl-safer fdl file-type fileblocks filemode filenamecat fnmatch-gnu fopen-safer fprintftime free fsusage ftruncate fts getdate getgroups gethrxtime getline getloadavg getndelim2 getopt getpagesize getpass-gnu gettext gettime gettimeofday getugroups getusershell gnupload group-member hard-locale hash hash-pjw host-os human idcache inttostr inttypes isapipe lchmod lchown lib-ignore linebuffer link-follow long-options lstat malloc mbswidth md5 memcasecmp memchr memcmp memcpy memmove mempcpy memrchr memset mkancesdirs mkdir mkdir-p mkstemp mktime modechange mountlist mpsort obstack pathmax perl physmem posixtm posixver putenv quote quotearg raise readlink readtokens readtokens0 readutmp realloc regex rename rename-dest-slash rmdir rmdir-errno root-dev-ino rpmatch safe-read same save-cwd savedir savewd settime sha1 sig2str ssize_t stat-macros stat-time stdbool stdlib-safer stpcpy strcspn strftime strpbrk strtod strtoimax strtol strtoumax strverscmp sys_stat timespec tzset unicodeio unistd-safer unlink-busy unlinkdir unlocked-io uptime userspec utime utimecmp utimens vasprintf verify version-etc-fsf wcwidth winsz-ioctl winsz-termios xalloc xgetcwd xgethostname xmemcoll xnanosleep xreadlink xreadlink-with-size xstrtod xstrtoimax xstrtol xstrtold xstrtoumax yesno +# Reproduce by: gnulib-tool --import --dir=. --local-dir=gl --lib=libcoreutils --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=gnulib-tests --aux-dir=build-aux --with-tests --avoid=canonicalize-lgpl --avoid=dummy --avoid=lock --no-libtool --macro-prefix=gl acl alloca announce-gen areadlink-with-size argmatch argv-iter assert atexit autobuild backupfile base64 c-strcase c-strtod c-strtold calloc canon-host canonicalize chown cloexec closein closeout config-h configmake crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 cycle-check d-ino d-type diacrit dirfd dirname dup2 error euidaccess exclude exitfail fchdir fcntl fcntl-safer fdl file-type fileblocks filemode filenamecat filevercmp fnmatch-gnu fopen-safer fprintftime fseeko fsusage ftello ftruncate fts gendocs getdate getgroups gethrxtime getline getloadavg getndelim2 getopt getpagesize getpass-gnu gettext gettime gettimeofday getugroups getusershell git-version-gen gitlog-to-changelog gnu-make gnumakefile gnupload group-member hard-locale hash hash-pjw host-os human idcache ignore-value inttostr inttypes isapipe lchmod lchown lib-ignore linebuffer link-follow long-options lstat maintainer-makefile malloc manywarnings mbrtowc mbsalign mbswidth memcasecmp memchr memcmp memcmp2 memcpy memmove mempcpy memrchr memset mgetgroups mkancesdirs mkdir mkdir-p mkstemp mktime modechange mountlist mpsort obstack pathmax perl physmem posix-shell posixtm posixver priv-set progname propername putenv quote quotearg raise randint randperm readlink readtokens readtokens0 readutmp realloc regex rename rename-dest-slash rmdir rmdir-errno root-dev-ino rpmatch safe-read same save-cwd savedir savewd selinux-at settime sig2str sigaction ssize_t stat-macros stat-time stdbool stdlib-safer stpcpy stpncpy strcspn strdup strftime strpbrk strtod strtoimax strtol strtoumax strverscmp sys_stat timespec tzset unicodeio unistd-safer unlink-busy unlinkdir unlocked-io uptime useless-if-before-free userspec utimecmp utimens vasprintf-posix vc-list-files verify verror version-etc-fsf warnings wcwidth winsz-ioctl winsz-termios write-any-file xalloc xfreopen xgetcwd xgethostname xmemcoll xnanosleep xprintf xprintf-posix xstrtod xstrtoimax xstrtol xstrtold xstrtoumax yesno -AUTOMAKE_OPTIONS = 1.5 gnits +AUTOMAKE_OPTIONS = 1.5 gnits subdir-objects +SUBDIRS = noinst_HEADERS = noinst_LIBRARIES = noinst_LTLIBRARIES = @@ -26,6 +27,7 @@ DISTCLEANFILES = MAINTAINERCLEANFILES = AM_CPPFLAGS = +AM_CFLAGS = noinst_LIBRARIES += libcoreutils.a @@ -36,10 +38,11 @@ EXTRA_libcoreutils_a_SOURCES = ## begin gnulib module acl +libcoreutils_a_SOURCES += set-mode-acl.c copy-acl.c file-has-acl.c -EXTRA_DIST += acl-internal.h acl.c acl.h acl_entries.c file-has-acl.c +EXTRA_DIST += acl-internal.h acl.h acl_entries.c -EXTRA_libcoreutils_a_SOURCES += acl.c acl_entries.c file-has-acl.c +EXTRA_libcoreutils_a_SOURCES += acl_entries.c ## end gnulib module acl @@ -60,24 +63,31 @@ BUILT_SOURCES += $(ALLOCA_H) # We need the following in order to create when the system # doesn't have one that works with the given compiler. -alloca.h: alloca_.h +alloca.h: alloca.in.h { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ - cat $(srcdir)/alloca_.h; \ + cat $(srcdir)/alloca.in.h; \ } > $@-t mv -f $@-t $@ MOSTLYCLEANFILES += alloca.h alloca.h-t -EXTRA_DIST += alloca_.h +EXTRA_DIST += alloca.in.h ## end gnulib module alloca-opt -## begin gnulib module allocsa +## begin gnulib module announce-gen -libcoreutils_a_SOURCES += allocsa.h allocsa.c -EXTRA_DIST += allocsa.valgrind +EXTRA_DIST += $(top_srcdir)/build-aux/announce-gen -## end gnulib module allocsa +## end gnulib module announce-gen + +## begin gnulib module areadlink-with-size + +libcoreutils_a_SOURCES += areadlink-with-size.c + +EXTRA_DIST += areadlink.h + +## end gnulib module areadlink-with-size ## begin gnulib module argmatch @@ -88,22 +98,39 @@ EXTRA_libcoreutils_a_SOURCES += argmatch.c ## end gnulib module argmatch +## begin gnulib module argv-iter + +libcoreutils_a_SOURCES += argv-iter.c argv-iter.h + +## end gnulib module argv-iter + ## begin gnulib module arpa_inet BUILT_SOURCES += $(ARPA_INET_H) # We need the following in order to create when the system # doesn't have one. -arpa/inet.h: +arpa/inet.h: arpa_inet.in.h @MKDIR_P@ arpa rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ - echo '#include '; \ + sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''NEXT_ARPA_INET_H''@|$(NEXT_ARPA_INET_H)|g' \ + -e 's|@''HAVE_ARPA_INET_H''@|$(HAVE_ARPA_INET_H)|g' \ + -e 's|@''GNULIB_INET_NTOP''@|$(GNULIB_INET_NTOP)|g' \ + -e 's|@''GNULIB_INET_PTON''@|$(GNULIB_INET_PTON)|g' \ + -e 's|@''HAVE_DECL_INET_NTOP''@|$(HAVE_DECL_INET_NTOP)|g' \ + -e 's|@''HAVE_DECL_INET_PTON''@|$(HAVE_DECL_INET_PTON)|g' \ + -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ + < $(srcdir)/arpa_inet.in.h; \ } > $@-t mv $@-t $@ MOSTLYCLEANFILES += arpa/inet.h arpa/inet.h-t MOSTLYCLEANDIRS += arpa +EXTRA_DIST += arpa_inet.in.h + ## end gnulib module arpa_inet ## begin gnulib module atexit @@ -130,6 +157,15 @@ libcoreutils_a_SOURCES += base64.h base64.c ## end gnulib module base64 +## begin gnulib module btowc + + +EXTRA_DIST += btowc.c + +EXTRA_libcoreutils_a_SOURCES += btowc.c + +## end gnulib module btowc + ## begin gnulib module c-ctype libcoreutils_a_SOURCES += c-ctype.h c-ctype.c @@ -169,6 +205,15 @@ EXTRA_libcoreutils_a_SOURCES += calloc.c ## end gnulib module calloc +## begin gnulib module calloc-posix + + +EXTRA_DIST += calloc.c + +EXTRA_libcoreutils_a_SOURCES += calloc.c + +## end gnulib module calloc-posix + ## begin gnulib module canon-host @@ -214,6 +259,23 @@ EXTRA_libcoreutils_a_SOURCES += cloexec.c ## end gnulib module cloexec +## begin gnulib module close + + +EXTRA_DIST += close.c + +EXTRA_libcoreutils_a_SOURCES += close.c + +## end gnulib module close + +## begin gnulib module close-hook + +libcoreutils_a_SOURCES += close-hook.c + +EXTRA_DIST += close-hook.h + +## end gnulib module close-hook + ## begin gnulib module close-stream @@ -223,6 +285,15 @@ EXTRA_libcoreutils_a_SOURCES += close-stream.c ## end gnulib module close-stream +## begin gnulib module closein + + +EXTRA_DIST += closein.c closein.h + +EXTRA_libcoreutils_a_SOURCES += closein.c + +## end gnulib module closein + ## begin gnulib module closeout @@ -252,7 +323,7 @@ EXTRA_libcoreutils_a_SOURCES += closeout.c # The Automake-defined pkg* macros are appended, in the order # listed in the Automake 1.10a+ documentation. configmake.h: Makefile - rm -f $@-t $@ + rm -f $@-t { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ echo '#define PREFIX "$(prefix)"'; \ echo '#define EXEC_PREFIX "$(exec_prefix)"'; \ @@ -282,12 +353,53 @@ configmake.h: Makefile echo '#define PKGLIBDIR "$(pkglibdir)"'; \ echo '#define PKGLIBEXECDIR "$(pkglibexecdir)"'; \ } | sed '/""/d' > $@-t - mv $@-t $@ + if test -f $@ && cmp $@-t $@ > /dev/null; then \ + rm -f $@-t; \ + else \ + rm -f $@; mv $@-t $@; \ + fi + BUILT_SOURCES += configmake.h CLEANFILES += configmake.h configmake.h-t ## end gnulib module configmake +## begin gnulib module crypto/md5 + + +EXTRA_DIST += md5.c md5.h + +EXTRA_libcoreutils_a_SOURCES += md5.c + +## end gnulib module crypto/md5 + +## begin gnulib module crypto/sha1 + + +EXTRA_DIST += sha1.c sha1.h + +EXTRA_libcoreutils_a_SOURCES += sha1.c + +## end gnulib module crypto/sha1 + +## begin gnulib module crypto/sha256 + + +EXTRA_DIST += sha256.c sha256.h + +EXTRA_libcoreutils_a_SOURCES += sha256.c + +## end gnulib module crypto/sha256 + +## begin gnulib module crypto/sha512 + + +EXTRA_DIST += sha512.c sha512.h + +EXTRA_libcoreutils_a_SOURCES += sha512.c + +## end gnulib module crypto/sha512 + ## begin gnulib module cycle-check @@ -310,10 +422,39 @@ libcoreutils_a_SOURCES += diacrit.h diacrit.c ## end gnulib module diacrit +## begin gnulib module dirent + +BUILT_SOURCES += $(DIRENT_H) + +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +dirent.h: dirent.in.h + rm -f $@-t $@ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''NEXT_DIRENT_H''@|$(NEXT_DIRENT_H)|g' \ + -e 's|@''GNULIB_DIRFD''@|$(GNULIB_DIRFD)|g' \ + -e 's|@''GNULIB_SCANDIR''@|$(GNULIB_SCANDIR)|g' \ + -e 's|@''GNULIB_ALPHASORT''@|$(GNULIB_ALPHASORT)|g' \ + -e 's|@''HAVE_DECL_DIRFD''@|$(HAVE_DECL_DIRFD)|g' \ + -e 's|@''HAVE_SCANDIR''@|$(HAVE_SCANDIR)|g' \ + -e 's|@''HAVE_ALPHASORT''@|$(HAVE_ALPHASORT)|g' \ + -e 's|@''REPLACE_FCHDIR''@|$(REPLACE_FCHDIR)|g' \ + -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ + < $(srcdir)/dirent.in.h; \ + } > $@-t + mv $@-t $@ +MOSTLYCLEANFILES += dirent.h dirent.h-t + +EXTRA_DIST += dirent.in.h + +## end gnulib module dirent + ## begin gnulib module dirfd -EXTRA_DIST += dirfd.c dirfd.h +EXTRA_DIST += dirfd.c EXTRA_libcoreutils_a_SOURCES += dirfd.c @@ -337,6 +478,33 @@ EXTRA_libcoreutils_a_SOURCES += dup2.c ## end gnulib module dup2 +## begin gnulib module errno + +BUILT_SOURCES += $(ERRNO_H) + +# We need the following in order to create when the system +# doesn't have one that is POSIX compliant. +errno.h: errno.in.h + rm -f $@-t $@ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ + sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''NEXT_ERRNO_H''@|$(NEXT_ERRNO_H)|g' \ + -e 's|@''EMULTIHOP_HIDDEN''@|$(EMULTIHOP_HIDDEN)|g' \ + -e 's|@''EMULTIHOP_VALUE''@|$(EMULTIHOP_VALUE)|g' \ + -e 's|@''ENOLINK_HIDDEN''@|$(ENOLINK_HIDDEN)|g' \ + -e 's|@''ENOLINK_VALUE''@|$(ENOLINK_VALUE)|g' \ + -e 's|@''EOVERFLOW_HIDDEN''@|$(EOVERFLOW_HIDDEN)|g' \ + -e 's|@''EOVERFLOW_VALUE''@|$(EOVERFLOW_VALUE)|g' \ + < $(srcdir)/errno.in.h; \ + } > $@-t + mv $@-t $@ +MOSTLYCLEANFILES += errno.h errno.h-t + +EXTRA_DIST += errno.in.h + +## end gnulib module errno + ## begin gnulib module error @@ -349,7 +517,7 @@ EXTRA_libcoreutils_a_SOURCES += error.c ## begin gnulib module euidaccess -EXTRA_DIST += euidaccess.c euidaccess.h +EXTRA_DIST += euidaccess.c EXTRA_libcoreutils_a_SOURCES += euidaccess.c @@ -375,42 +543,42 @@ EXTRA_libcoreutils_a_SOURCES += exitfail.c ## begin gnulib module fchdir -BUILT_SOURCES += $(DIRENT_H) -# We need the following in order to create when the system -# doesn't have one that works with the given compiler. -dirent.h: dirent_.h - rm -f $@-t $@ - { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ - sed -e 's|@''ABSOLUTE_DIRENT_H''@|$(ABSOLUTE_DIRENT_H)|g' \ - -e 's|@''REPLACE_FCHDIR''@|$(REPLACE_FCHDIR)|g' \ - < $(srcdir)/dirent_.h; \ - } > $@-t - mv $@-t $@ -MOSTLYCLEANFILES += dirent.h dirent.h-t - -EXTRA_DIST += dirent_.h fchdir.c +EXTRA_DIST += fchdir.c EXTRA_libcoreutils_a_SOURCES += fchdir.c ## end gnulib module fchdir +## begin gnulib module fclose + + +EXTRA_DIST += fclose.c + +EXTRA_libcoreutils_a_SOURCES += fclose.c + +## end gnulib module fclose + ## begin gnulib module fcntl BUILT_SOURCES += $(FCNTL_H) # We need the following in order to create when the system # doesn't have one that works with the given compiler. -fcntl.h: fcntl_.h +fcntl.h: fcntl.in.h rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ - sed -e 's|@''ABSOLUTE_FCNTL_H''@|$(ABSOLUTE_FCNTL_H)|g' \ - < $(srcdir)/fcntl_.h; \ + sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''NEXT_FCNTL_H''@|$(NEXT_FCNTL_H)|g' \ + -e 's|@''GNULIB_OPEN''@|$(GNULIB_OPEN)|g' \ + -e 's|@''REPLACE_OPEN''@|$(REPLACE_OPEN)|g' \ + < $(srcdir)/fcntl.in.h; \ } > $@-t mv $@-t $@ MOSTLYCLEANFILES += fcntl.h fcntl.h-t -EXTRA_DIST += fcntl_.h +EXTRA_DIST += fcntl.in.h ## end gnulib module fcntl @@ -423,6 +591,23 @@ EXTRA_libcoreutils_a_SOURCES += creat-safer.c open-safer.c ## end gnulib module fcntl-safer +## begin gnulib module fflush + + +EXTRA_DIST += fflush.c stdio-impl.h + +EXTRA_libcoreutils_a_SOURCES += fflush.c + +## end gnulib module fflush + +## begin gnulib module file-set + +libcoreutils_a_SOURCES += file-set.c + +EXTRA_DIST += file-set.h + +## end gnulib module file-set + ## begin gnulib module file-type @@ -459,20 +644,49 @@ EXTRA_libcoreutils_a_SOURCES += filenamecat.c ## end gnulib module filenamecat +## begin gnulib module filevercmp + +libcoreutils_a_SOURCES += filevercmp.c + +EXTRA_DIST += filevercmp.h + +## end gnulib module filevercmp + +## begin gnulib module float + +BUILT_SOURCES += $(FLOAT_H) + +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +float.h: float.in.h + rm -f $@-t $@ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ + sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''NEXT_FLOAT_H''@|$(NEXT_FLOAT_H)|g' \ + < $(srcdir)/float.in.h; \ + } > $@-t + mv $@-t $@ +MOSTLYCLEANFILES += float.h float.h-t + +EXTRA_DIST += float.in.h + +## end gnulib module float + ## begin gnulib module fnmatch BUILT_SOURCES += $(FNMATCH_H) # We need the following in order to create when the system # doesn't have one that supports the required API. -fnmatch.h: fnmatch_.h +fnmatch.h: fnmatch.in.h { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ - cat $(srcdir)/fnmatch_.h; \ + cat $(srcdir)/fnmatch.in.h; \ } > $@-t mv -f $@-t $@ MOSTLYCLEANFILES += fnmatch.h fnmatch.h-t -EXTRA_DIST += fnmatch.c fnmatch_.h fnmatch_loop.c +EXTRA_DIST += fnmatch.c fnmatch.in.h fnmatch_loop.c EXTRA_libcoreutils_a_SOURCES += fnmatch.c fnmatch_loop.c @@ -490,9 +704,9 @@ EXTRA_libcoreutils_a_SOURCES += fopen-safer.c ## begin gnulib module fpending -EXTRA_DIST += __fpending.c __fpending.h +EXTRA_DIST += fpending.c fpending.h -EXTRA_libcoreutils_a_SOURCES += __fpending.c +EXTRA_libcoreutils_a_SOURCES += fpending.c ## end gnulib module fpending @@ -505,14 +719,87 @@ EXTRA_libcoreutils_a_SOURCES += fprintftime.c ## end gnulib module fprintftime -## begin gnulib module free +## begin gnulib module fpucw -EXTRA_DIST += free.c +EXTRA_DIST += fpucw.h -EXTRA_libcoreutils_a_SOURCES += free.c +## end gnulib module fpucw -## end gnulib module free +## begin gnulib module fpurge + +libcoreutils_a_SOURCES += fpurge.c + +EXTRA_DIST += fpurge.h stdio-impl.h + +## end gnulib module fpurge + +## begin gnulib module freadahead + +libcoreutils_a_SOURCES += freadahead.c + +EXTRA_DIST += freadahead.h stdio-impl.h + +## end gnulib module freadahead + +## begin gnulib module freading + +libcoreutils_a_SOURCES += freading.c + +EXTRA_DIST += freading.h stdio-impl.h + +## end gnulib module freading + +## begin gnulib module freadptr + +libcoreutils_a_SOURCES += freadptr.c + +EXTRA_DIST += freadptr.h stdio-impl.h + +## end gnulib module freadptr + +## begin gnulib module freadseek + +libcoreutils_a_SOURCES += freadseek.c + +EXTRA_DIST += freadseek.h stdio-impl.h + +## end gnulib module freadseek + +## begin gnulib module frexp-nolibm + + +EXTRA_DIST += frexp.c + +EXTRA_libcoreutils_a_SOURCES += frexp.c + +## end gnulib module frexp-nolibm + +## begin gnulib module frexpl-nolibm + + +EXTRA_DIST += frexp.c frexpl.c + +EXTRA_libcoreutils_a_SOURCES += frexp.c frexpl.c + +## end gnulib module frexpl-nolibm + +## begin gnulib module fseeko + + +EXTRA_DIST += fseeko.c stdio-impl.h + +EXTRA_libcoreutils_a_SOURCES += fseeko.c + +## end gnulib module fseeko + +## begin gnulib module fseterr + +libcoreutils_a_SOURCES += fseterr.c + +EXTRA_DIST += fseterr.h stdio-impl.h + +## end gnulib module fseterr ## begin gnulib module fsusage @@ -523,6 +810,15 @@ EXTRA_libcoreutils_a_SOURCES += fsusage.c ## end gnulib module fsusage +## begin gnulib module ftello + + +EXTRA_DIST += ftello.c + +EXTRA_libcoreutils_a_SOURCES += ftello.c + +## end gnulib module ftello + ## begin gnulib module ftruncate @@ -553,10 +849,17 @@ libcoreutils_a_SOURCES += full-write.h full-write.c ## end gnulib module full-write +## begin gnulib module gendocs + + +EXTRA_DIST += $(top_srcdir)/build-aux/gendocs.sh + +## end gnulib module gendocs + ## begin gnulib module getaddrinfo -EXTRA_DIST += gai_strerror.c getaddrinfo.c getaddrinfo.h +EXTRA_DIST += gai_strerror.c getaddrinfo.c EXTRA_libcoreutils_a_SOURCES += gai_strerror.c getaddrinfo.c @@ -585,7 +888,7 @@ EXTRA_DIST += getdate.h ## begin gnulib module getdelim -EXTRA_DIST += getdelim.c getdelim.h +EXTRA_DIST += getdelim.c EXTRA_libcoreutils_a_SOURCES += getdelim.c @@ -621,7 +924,7 @@ EXTRA_libcoreutils_a_SOURCES += gethrxtime.c ## begin gnulib module getline -EXTRA_DIST += getline.c getline.h +EXTRA_DIST += getline.c EXTRA_libcoreutils_a_SOURCES += getline.c @@ -651,14 +954,14 @@ BUILT_SOURCES += $(GETOPT_H) # We need the following in order to create when the system # doesn't have one that works with the given compiler. -getopt.h: getopt_.h +getopt.h: getopt.in.h { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ - cat $(srcdir)/getopt_.h; \ + cat $(srcdir)/getopt.in.h; \ } > $@-t mv -f $@-t $@ MOSTLYCLEANFILES += getopt.h getopt.h-t -EXTRA_DIST += getopt.c getopt1.c getopt_.h getopt_int.h +EXTRA_DIST += getopt.c getopt.in.h getopt1.c getopt_int.h EXTRA_libcoreutils_a_SOURCES += getopt.c getopt1.c @@ -667,7 +970,9 @@ EXTRA_libcoreutils_a_SOURCES += getopt.c getopt1.c ## begin gnulib module getpagesize -EXTRA_DIST += getpagesize.h +EXTRA_DIST += getpagesize.c + +EXTRA_libcoreutils_a_SOURCES += getpagesize.c ## end gnulib module getpagesize @@ -692,6 +997,8 @@ EXTRA_libcoreutils_a_SOURCES += getpass.c # "gettextize --intl". #AM_CPPFLAGS += -I$(top_builddir)/intl +EXTRA_DIST += $(top_srcdir)/build-aux/config.rpath + ## end gnulib module gettext ## begin gnulib module gettext-h @@ -721,7 +1028,7 @@ EXTRA_libcoreutils_a_SOURCES += gettimeofday.c ## begin gnulib module getugroups -EXTRA_DIST += getugroups.c +EXTRA_DIST += getugroups.c getugroups.h EXTRA_libcoreutils_a_SOURCES += getugroups.c @@ -736,6 +1043,56 @@ EXTRA_libcoreutils_a_SOURCES += getusershell.c ## end gnulib module getusershell +## begin gnulib module git-version-gen + + +EXTRA_DIST += $(top_srcdir)/build-aux/git-version-gen + +## end gnulib module git-version-gen + +## begin gnulib module gitlog-to-changelog + + +EXTRA_DIST += $(top_srcdir)/build-aux/gitlog-to-changelog + +## end gnulib module gitlog-to-changelog + +## begin gnulib module gnu-make + +##Sample usage of gnu-make module: +#if GNU_MAKE +# [nicer features that work only with GNU Make] +#else +# [fallback features that work in any 'make' implementation; see +# http://www.opengroup.org/susv3/utilities/make.html +# for the 2004 POSIX specification] +#endif + +## end gnulib module gnu-make + +## begin gnulib module gnumakefile + +distclean-local: clean-GNUmakefile +clean-GNUmakefile: + test x'$(VPATH)' != x && rm -f $(top_builddir)/GNUmakefile || : + +EXTRA_DIST += $(top_srcdir)/GNUmakefile + +## end gnulib module gnumakefile + +## begin gnulib module gnupload + + +EXTRA_DIST += $(top_srcdir)/build-aux/gnupload + +## end gnulib module gnupload + +## begin gnulib module gperf + +GPERF = gperf + +## end gnulib module gperf + ## begin gnulib module group-member @@ -769,6 +1126,21 @@ libcoreutils_a_SOURCES += hash-pjw.h hash-pjw.c ## end gnulib module hash-pjw +## begin gnulib module hash-triple + +libcoreutils_a_SOURCES += hash-triple.c + +EXTRA_DIST += hash-triple.h + +## end gnulib module hash-triple + +## begin gnulib module havelib + + +EXTRA_DIST += $(top_srcdir)/build-aux/config.rpath + +## end gnulib module havelib + ## begin gnulib module human @@ -787,19 +1159,69 @@ EXTRA_libcoreutils_a_SOURCES += i-ring.c ## end gnulib module i-ring +## begin gnulib module iconv_open + +BUILT_SOURCES += $(ICONV_H) + +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +iconv.h: iconv.in.h + rm -f $@-t $@ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ + sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''NEXT_ICONV_H''@|$(NEXT_ICONV_H)|g' \ + -e 's|@''ICONV_CONST''@|$(ICONV_CONST)|g' \ + -e 's|@''REPLACE_ICONV''@|$(REPLACE_ICONV)|g' \ + -e 's|@''REPLACE_ICONV_OPEN''@|$(REPLACE_ICONV_OPEN)|g' \ + -e 's|@''REPLACE_ICONV_UTF''@|$(REPLACE_ICONV_UTF)|g' \ + < $(srcdir)/iconv.in.h; \ + } > $@-t + mv $@-t $@ +MOSTLYCLEANFILES += iconv.h iconv.h-t + +iconv_open-aix.h: iconv_open-aix.gperf + $(GPERF) -m 10 $(srcdir)/iconv_open-aix.gperf > $(srcdir)/iconv_open-aix.h-t + mv $(srcdir)/iconv_open-aix.h-t $(srcdir)/iconv_open-aix.h +iconv_open-hpux.h: iconv_open-hpux.gperf + $(GPERF) -m 10 $(srcdir)/iconv_open-hpux.gperf > $(srcdir)/iconv_open-hpux.h-t + mv $(srcdir)/iconv_open-hpux.h-t $(srcdir)/iconv_open-hpux.h +iconv_open-irix.h: iconv_open-irix.gperf + $(GPERF) -m 10 $(srcdir)/iconv_open-irix.gperf > $(srcdir)/iconv_open-irix.h-t + mv $(srcdir)/iconv_open-irix.h-t $(srcdir)/iconv_open-irix.h +iconv_open-osf.h: iconv_open-osf.gperf + $(GPERF) -m 10 $(srcdir)/iconv_open-osf.gperf > $(srcdir)/iconv_open-osf.h-t + mv $(srcdir)/iconv_open-osf.h-t $(srcdir)/iconv_open-osf.h +BUILT_SOURCES += iconv_open-aix.h iconv_open-hpux.h iconv_open-irix.h iconv_open-osf.h +MOSTLYCLEANFILES += iconv_open-aix.h-t iconv_open-hpux.h-t iconv_open-irix.h-t iconv_open-osf.h-t +MAINTAINERCLEANFILES += iconv_open-aix.h iconv_open-hpux.h iconv_open-irix.h iconv_open-osf.h +EXTRA_DIST += iconv_open-aix.h iconv_open-hpux.h iconv_open-irix.h iconv_open-osf.h + +EXTRA_DIST += iconv.in.h iconv_open-aix.gperf iconv_open-hpux.gperf iconv_open-irix.gperf iconv_open-osf.gperf iconv_open.c + +EXTRA_libcoreutils_a_SOURCES += iconv_open.c + +## end gnulib module iconv_open + ## begin gnulib module idcache -EXTRA_DIST += idcache.c +EXTRA_DIST += idcache.c idcache.h EXTRA_libcoreutils_a_SOURCES += idcache.c ## end gnulib module idcache +## begin gnulib module ignore-value + +libcoreutils_a_SOURCES += ignore-value.h + +## end gnulib module ignore-value + ## begin gnulib module inet_ntop -EXTRA_DIST += inet_ntop.c inet_ntop.h +EXTRA_DIST += inet_ntop.c EXTRA_libcoreutils_a_SOURCES += inet_ntop.c @@ -827,12 +1249,15 @@ BUILT_SOURCES += $(INTTYPES_H) # We need the following in order to create when the system # doesn't have one that works with the given compiler. -inttypes.h: inttypes_.h +inttypes.h: inttypes.in.h rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ sed -e 's/@''HAVE_INTTYPES_H''@/$(HAVE_INTTYPES_H)/g' \ - -e 's|@''ABSOLUTE_INTTYPES_H''@|$(ABSOLUTE_INTTYPES_H)|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''NEXT_INTTYPES_H''@|$(NEXT_INTTYPES_H)|g' \ -e 's/@''PRI_MACROS_BROKEN''@/$(PRI_MACROS_BROKEN)/g' \ + -e 's/@''APPLE_UNIVERSAL_BUILD''@/$(APPLE_UNIVERSAL_BUILD)/g' \ -e 's/@''HAVE_LONG_LONG_INT''@/$(HAVE_LONG_LONG_INT)/g' \ -e 's/@''HAVE_UNSIGNED_LONG_LONG_INT''@/$(HAVE_UNSIGNED_LONG_LONG_INT)/g' \ -e 's/@''PRIPTR_PREFIX''@/$(PRIPTR_PREFIX)/g' \ @@ -844,13 +1269,17 @@ inttypes.h: inttypes_.h -e 's/@''HAVE_DECL_IMAXDIV''@/$(HAVE_DECL_IMAXDIV)/g' \ -e 's/@''HAVE_DECL_STRTOIMAX''@/$(HAVE_DECL_STRTOIMAX)/g' \ -e 's/@''HAVE_DECL_STRTOUMAX''@/$(HAVE_DECL_STRTOUMAX)/g' \ + -e 's/@''INT32_MAX_LT_INTMAX_MAX''@/$(INT32_MAX_LT_INTMAX_MAX)/g' \ + -e 's/@''INT64_MAX_EQ_LONG_MAX''@/$(INT64_MAX_EQ_LONG_MAX)/g' \ + -e 's/@''UINT32_MAX_LT_UINTMAX_MAX''@/$(UINT32_MAX_LT_UINTMAX_MAX)/g' \ + -e 's/@''UINT64_MAX_EQ_ULONG_MAX''@/$(UINT64_MAX_EQ_ULONG_MAX)/g' \ -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ - < $(srcdir)/inttypes_.h; \ + < $(srcdir)/inttypes.in.h; \ } > $@-t mv $@-t $@ MOSTLYCLEANFILES += inttypes.h inttypes.h-t -EXTRA_DIST += inttypes_.h +EXTRA_DIST += inttypes.in.h ## end gnulib module inttypes @@ -863,17 +1292,37 @@ EXTRA_libcoreutils_a_SOURCES += isapipe.c ## end gnulib module isapipe -## begin gnulib module lchmod +## begin gnulib module isnand-nolibm -EXTRA_DIST += lchmod.h +EXTRA_DIST += float+.h isnan.c isnand-nolibm.h isnand.c -## end gnulib module lchmod +EXTRA_libcoreutils_a_SOURCES += isnan.c isnand.c + +## end gnulib module isnand-nolibm + +## begin gnulib module isnanf-nolibm + + +EXTRA_DIST += float+.h isnan.c isnanf-nolibm.h isnanf.c + +EXTRA_libcoreutils_a_SOURCES += isnan.c isnanf.c + +## end gnulib module isnanf-nolibm + +## begin gnulib module isnanl-nolibm + + +EXTRA_DIST += float+.h isnan.c isnanl-nolibm.h isnanl.c + +EXTRA_libcoreutils_a_SOURCES += isnan.c isnanl.c + +## end gnulib module isnanl-nolibm ## begin gnulib module lchown -EXTRA_DIST += lchown.c lchown.h +EXTRA_DIST += lchown.c EXTRA_libcoreutils_a_SOURCES += lchown.c @@ -889,6 +1338,8 @@ libcoreutils_a_SOURCES += linebuffer.h linebuffer.c LINK_WARNING_H=$(top_srcdir)/build-aux/link-warning.h +EXTRA_DIST += $(top_srcdir)/build-aux/link-warning.h + ## end gnulib module link-warning ## begin gnulib module localcharset @@ -906,21 +1357,37 @@ all-local: charset.alias ref-add.sed ref-del.sed charset_alias = $(DESTDIR)$(libdir)/charset.alias charset_tmp = $(DESTDIR)$(libdir)/charset.tmp -install-exec-local: all-local - test $(GLIBC21) != no || $(mkinstalldirs) $(DESTDIR)$(libdir) +install-exec-local: install-exec-localcharset +install-exec-localcharset: all-local + if test $(GLIBC21) = no; then \ + case '$(host_os)' in \ + darwin[56]*) \ + need_charset_alias=true ;; \ + darwin* | cygwin* | mingw* | pw32* | cegcc*) \ + need_charset_alias=false ;; \ + *) \ + need_charset_alias=true ;; \ + esac ; \ + else \ + need_charset_alias=false ; \ + fi ; \ + if $$need_charset_alias; then \ + $(mkinstalldirs) $(DESTDIR)$(libdir) ; \ + fi ; \ if test -f $(charset_alias); then \ sed -f ref-add.sed $(charset_alias) > $(charset_tmp) ; \ $(INSTALL_DATA) $(charset_tmp) $(charset_alias) ; \ rm -f $(charset_tmp) ; \ else \ - if test $(GLIBC21) = no; then \ + if $$need_charset_alias; then \ sed -f ref-add.sed charset.alias > $(charset_tmp) ; \ $(INSTALL_DATA) $(charset_tmp) $(charset_alias) ; \ rm -f $(charset_tmp) ; \ fi ; \ fi -uninstall-local: all-local +uninstall-local: uninstall-localcharset +uninstall-localcharset: all-local if test -f $(charset_alias); then \ sed -f ref-del.sed $(charset_alias) > $(charset_tmp); \ if grep '^# Packages using this file: $$' $(charset_tmp) \ @@ -958,15 +1425,30 @@ EXTRA_libcoreutils_a_SOURCES += long-options.c ## end gnulib module long-options +## begin gnulib module lseek + + +EXTRA_DIST += lseek.c + +EXTRA_libcoreutils_a_SOURCES += lseek.c + +## end gnulib module lseek + ## begin gnulib module lstat -EXTRA_DIST += lstat.c lstat.h +EXTRA_DIST += lstat.c EXTRA_libcoreutils_a_SOURCES += lstat.c ## end gnulib module lstat +## begin gnulib module maintainer-makefile + +EXTRA_DIST += $(top_srcdir)/maint.mk + +## end gnulib module maintainer-makefile + ## begin gnulib module malloc @@ -976,6 +1458,100 @@ EXTRA_libcoreutils_a_SOURCES += malloc.c ## end gnulib module malloc +## begin gnulib module malloc-posix + + +EXTRA_DIST += malloc.c + +EXTRA_libcoreutils_a_SOURCES += malloc.c + +## end gnulib module malloc-posix + +## begin gnulib module malloca + +libcoreutils_a_SOURCES += malloca.c + +EXTRA_DIST += malloca.h malloca.valgrind + +## end gnulib module malloca + +## begin gnulib module math + +BUILT_SOURCES += math.h + +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +math.h: math.in.h + rm -f $@-t $@ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ + sed -e 's|@''INCLUDE_NEXT_AS_FIRST_DIRECTIVE''@|$(INCLUDE_NEXT_AS_FIRST_DIRECTIVE)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''NEXT_MATH_H''@|$(NEXT_MATH_H)|g' \ + -e 's|@''GNULIB_CEILF''@|$(GNULIB_CEILF)|g' \ + -e 's|@''GNULIB_CEILL''@|$(GNULIB_CEILL)|g' \ + -e 's|@''GNULIB_FLOORF''@|$(GNULIB_FLOORF)|g' \ + -e 's|@''GNULIB_FLOORL''@|$(GNULIB_FLOORL)|g' \ + -e 's|@''GNULIB_FREXP''@|$(GNULIB_FREXP)|g' \ + -e 's|@''GNULIB_FREXPL''@|$(GNULIB_FREXPL)|g' \ + -e 's|@''GNULIB_ISFINITE''@|$(GNULIB_ISFINITE)|g' \ + -e 's|@''GNULIB_ISINF''@|$(GNULIB_ISINF)|g' \ + -e 's|@''GNULIB_ISNAN''@|$(GNULIB_ISNAN)|g' \ + -e 's|@''GNULIB_ISNANF''@|$(GNULIB_ISNANF)|g' \ + -e 's|@''GNULIB_ISNAND''@|$(GNULIB_ISNAND)|g' \ + -e 's|@''GNULIB_ISNANL''@|$(GNULIB_ISNANL)|g' \ + -e 's|@''GNULIB_LDEXPL''@|$(GNULIB_LDEXPL)|g' \ + -e 's|@''GNULIB_MATHL''@|$(GNULIB_MATHL)|g' \ + -e 's|@''GNULIB_ROUND''@|$(GNULIB_ROUND)|g' \ + -e 's|@''GNULIB_ROUNDF''@|$(GNULIB_ROUNDF)|g' \ + -e 's|@''GNULIB_ROUNDL''@|$(GNULIB_ROUNDL)|g' \ + -e 's|@''GNULIB_SIGNBIT''@|$(GNULIB_SIGNBIT)|g' \ + -e 's|@''GNULIB_TRUNC''@|$(GNULIB_TRUNC)|g' \ + -e 's|@''GNULIB_TRUNCF''@|$(GNULIB_TRUNCF)|g' \ + -e 's|@''GNULIB_TRUNCL''@|$(GNULIB_TRUNCL)|g' \ + -e 's|@''HAVE_ISNANF''@|$(HAVE_ISNANF)|g' \ + -e 's|@''HAVE_ISNAND''@|$(HAVE_ISNAND)|g' \ + -e 's|@''HAVE_ISNANL''@|$(HAVE_ISNANL)|g' \ + -e 's|@''HAVE_DECL_ACOSL''@|$(HAVE_DECL_ACOSL)|g' \ + -e 's|@''HAVE_DECL_ASINL''@|$(HAVE_DECL_ASINL)|g' \ + -e 's|@''HAVE_DECL_ATANL''@|$(HAVE_DECL_ATANL)|g' \ + -e 's|@''HAVE_DECL_COSL''@|$(HAVE_DECL_COSL)|g' \ + -e 's|@''HAVE_DECL_EXPL''@|$(HAVE_DECL_EXPL)|g' \ + -e 's|@''HAVE_DECL_FREXPL''@|$(HAVE_DECL_FREXPL)|g' \ + -e 's|@''HAVE_DECL_LDEXPL''@|$(HAVE_DECL_LDEXPL)|g' \ + -e 's|@''HAVE_DECL_LOGL''@|$(HAVE_DECL_LOGL)|g' \ + -e 's|@''HAVE_DECL_SINL''@|$(HAVE_DECL_SINL)|g' \ + -e 's|@''HAVE_DECL_SQRTL''@|$(HAVE_DECL_SQRTL)|g' \ + -e 's|@''HAVE_DECL_TANL''@|$(HAVE_DECL_TANL)|g' \ + -e 's|@''HAVE_DECL_TRUNC''@|$(HAVE_DECL_TRUNC)|g' \ + -e 's|@''HAVE_DECL_TRUNCF''@|$(HAVE_DECL_TRUNCF)|g' \ + -e 's|@''REPLACE_CEILF''@|$(REPLACE_CEILF)|g' \ + -e 's|@''REPLACE_CEILL''@|$(REPLACE_CEILL)|g' \ + -e 's|@''REPLACE_FLOORF''@|$(REPLACE_FLOORF)|g' \ + -e 's|@''REPLACE_FLOORL''@|$(REPLACE_FLOORL)|g' \ + -e 's|@''REPLACE_FREXP''@|$(REPLACE_FREXP)|g' \ + -e 's|@''REPLACE_FREXPL''@|$(REPLACE_FREXPL)|g' \ + -e 's|@''REPLACE_HUGE_VAL''@|$(REPLACE_HUGE_VAL)|g' \ + -e 's|@''REPLACE_ISFINITE''@|$(REPLACE_ISFINITE)|g' \ + -e 's|@''REPLACE_ISINF''@|$(REPLACE_ISINF)|g' \ + -e 's|@''REPLACE_ISNAN''@|$(REPLACE_ISNAN)|g' \ + -e 's|@''REPLACE_LDEXPL''@|$(REPLACE_LDEXPL)|g' \ + -e 's|@''REPLACE_NAN''@|$(REPLACE_NAN)|g' \ + -e 's|@''REPLACE_ROUND''@|$(REPLACE_ROUND)|g' \ + -e 's|@''REPLACE_ROUNDF''@|$(REPLACE_ROUNDF)|g' \ + -e 's|@''REPLACE_ROUNDL''@|$(REPLACE_ROUNDL)|g' \ + -e 's|@''REPLACE_SIGNBIT''@|$(REPLACE_SIGNBIT)|g' \ + -e 's|@''REPLACE_SIGNBIT_USING_GCC''@|$(REPLACE_SIGNBIT_USING_GCC)|g' \ + -e 's|@''REPLACE_TRUNCL''@|$(REPLACE_TRUNCL)|g' \ + -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ + < $(srcdir)/math.in.h; \ + } > $@-t + mv $@-t $@ +MOSTLYCLEANFILES += math.h math.h-t + +EXTRA_DIST += math.in.h + +## end gnulib module math + ## begin gnulib module mbchar libcoreutils_a_SOURCES += mbchar.c @@ -984,12 +1560,74 @@ EXTRA_DIST += mbchar.h ## end gnulib module mbchar +## begin gnulib module mbiter + +libcoreutils_a_SOURCES += mbiter.h + +## end gnulib module mbiter + +## begin gnulib module mbrlen + + +EXTRA_DIST += mbrlen.c + +EXTRA_libcoreutils_a_SOURCES += mbrlen.c + +## end gnulib module mbrlen + +## begin gnulib module mbrtowc + + +EXTRA_DIST += mbrtowc.c + +EXTRA_libcoreutils_a_SOURCES += mbrtowc.c + +## end gnulib module mbrtowc + +## begin gnulib module mbsalign + +libcoreutils_a_SOURCES += mbsalign.c mbsalign.h + +## end gnulib module mbsalign + ## begin gnulib module mbscasecmp libcoreutils_a_SOURCES += mbscasecmp.c ## end gnulib module mbscasecmp +## begin gnulib module mbsinit + + +EXTRA_DIST += mbsinit.c + +EXTRA_libcoreutils_a_SOURCES += mbsinit.c + +## end gnulib module mbsinit + +## begin gnulib module mbslen + +libcoreutils_a_SOURCES += mbslen.c + +## end gnulib module mbslen + +## begin gnulib module mbsrtowcs + + +EXTRA_DIST += mbsrtowcs-state.c mbsrtowcs.c + +EXTRA_libcoreutils_a_SOURCES += mbsrtowcs-state.c mbsrtowcs.c + +## end gnulib module mbsrtowcs + +## begin gnulib module mbsstr + +libcoreutils_a_SOURCES += mbsstr.c + +EXTRA_DIST += str-kmp.h + +## end gnulib module mbsstr + ## begin gnulib module mbswidth libcoreutils_a_SOURCES += mbswidth.h mbswidth.c @@ -1002,15 +1640,6 @@ libcoreutils_a_SOURCES += mbuiter.h ## end gnulib module mbuiter -## begin gnulib module md5 - - -EXTRA_DIST += md5.c md5.h - -EXTRA_libcoreutils_a_SOURCES += md5.c - -## end gnulib module md5 - ## begin gnulib module memcasecmp @@ -1029,6 +1658,12 @@ EXTRA_libcoreutils_a_SOURCES += memchr.c ## end gnulib module memchr +## begin gnulib module memchr2 + +libcoreutils_a_SOURCES += memchr2.h memchr2.c + +## end gnulib module memchr2 + ## begin gnulib module memcmp @@ -1038,6 +1673,14 @@ EXTRA_libcoreutils_a_SOURCES += memcmp.c ## end gnulib module memcmp +## begin gnulib module memcmp2 + +libcoreutils_a_SOURCES += memcmp2.c + +EXTRA_DIST += memcmp2.h + +## end gnulib module memcmp2 + ## begin gnulib module memcoll @@ -1092,6 +1735,15 @@ EXTRA_libcoreutils_a_SOURCES += memset.c ## end gnulib module memset +## begin gnulib module mgetgroups + + +EXTRA_DIST += mgetgroups.c mgetgroups.h + +EXTRA_libcoreutils_a_SOURCES += mgetgroups.c + +## end gnulib module mgetgroups + ## begin gnulib module mkancesdirs @@ -1173,25 +1825,55 @@ EXTRA_libcoreutils_a_SOURCES += nanosleep.c ## end gnulib module nanosleep +## begin gnulib module netdb + +BUILT_SOURCES += $(NETDB_H) + +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +netdb.h: netdb.in.h + rm -f $@-t $@ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''NEXT_NETDB_H''@|$(NEXT_NETDB_H)|g' \ + -e 's|@''HAVE_NETDB_H''@|$(HAVE_NETDB_H)|g' \ + -e 's|@''GNULIB_GETADDRINFO''@|$(GNULIB_GETADDRINFO)|g' \ + -e 's|@''HAVE_STRUCT_ADDRINFO''@|$(HAVE_STRUCT_ADDRINFO)|g' \ + -e 's|@''HAVE_DECL_FREEADDRINFO''@|$(HAVE_DECL_FREEADDRINFO)|g' \ + -e 's|@''HAVE_DECL_GAI_STRERROR''@|$(HAVE_DECL_GAI_STRERROR)|g' \ + -e 's|@''HAVE_DECL_GETADDRINFO''@|$(HAVE_DECL_GETADDRINFO)|g' \ + -e 's|@''HAVE_DECL_GETNAMEINFO''@|$(HAVE_DECL_GETNAMEINFO)|g' \ + < $(srcdir)/netdb.in.h; \ + } > $@-t + mv $@-t $@ +MOSTLYCLEANFILES += netdb.h netdb.h-t + +EXTRA_DIST += netdb.in.h + +## end gnulib module netdb + ## begin gnulib module netinet_in BUILT_SOURCES += $(NETINET_IN_H) # We need the following in order to create when the system # doesn't have one. -netinet/in.h: +netinet/in.h: netinet_in.in.h @MKDIR_P@ netinet rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ - sed -e 's|@''ABSOLUTE_NETINET_IN_H''@|$(ABSOLUTE_NETINET_IN_H)|g' \ + sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''NEXT_NETINET_IN_H''@|$(NEXT_NETINET_IN_H)|g' \ -e 's|@''HAVE_NETINET_IN_H''@|$(HAVE_NETINET_IN_H)|g' \ - < $(srcdir)/netinet_in_.h; \ + < $(srcdir)/netinet_in.in.h; \ } > $@-t mv $@-t $@ MOSTLYCLEANFILES += netinet/in.h netinet/in.h-t MOSTLYCLEANDIRS += netinet -EXTRA_DIST += netinet_in_.h +EXTRA_DIST += netinet_in.in.h ## end gnulib module netinet_in @@ -1204,15 +1886,30 @@ EXTRA_libcoreutils_a_SOURCES += obstack.c ## end gnulib module obstack +## begin gnulib module open + + +EXTRA_DIST += open.c + +EXTRA_libcoreutils_a_SOURCES += open.c + +## end gnulib module open + ## begin gnulib module openat -EXTRA_DIST += at-func.c fchmodat.c fchownat.c fstatat.c mkdirat.c openat-die.c openat-priv.h openat-proc.c openat.c openat.h +EXTRA_DIST += at-func.c fchmodat.c fchownat.c fstatat.c mkdirat.c openat-priv.h openat-proc.c openat.c openat.h -EXTRA_libcoreutils_a_SOURCES += at-func.c fchmodat.c fchownat.c fstatat.c mkdirat.c openat-die.c openat-proc.c openat.c +EXTRA_libcoreutils_a_SOURCES += at-func.c fchmodat.c fchownat.c fstatat.c mkdirat.c openat-proc.c openat.c ## end gnulib module openat +## begin gnulib module openat-die + +libcoreutils_a_SOURCES += openat-die.c + +## end gnulib module openat-die + ## begin gnulib module pathmax @@ -1229,6 +1926,21 @@ EXTRA_libcoreutils_a_SOURCES += physmem.c ## end gnulib module physmem +## begin gnulib module posix-shell + +##Sample usage of posix-shell module: +#script: script.in +# rm -f $@-t $@ +# sed -e 's#@''PREFERABLY_POSIX_SHELL''@#$(PREFERABLY_POSIX_SHELL)#g' \ +# -e 's#@''POSIX_SHELL''@#$(POSIX_SHELL)#g' \ +# -e $(srcdir)/$@.in >$@-t +# chmod a+x $@-t +# mv $@-t $@ +#EXTRA_DIST += script.in +#MOSTLYCLEANFILES += script script-t + +## end gnulib module posix-shell + ## begin gnulib module posixtm @@ -1247,6 +1959,44 @@ EXTRA_libcoreutils_a_SOURCES += posixver.c ## end gnulib module posixver +## begin gnulib module printf-frexp + +libcoreutils_a_SOURCES += printf-frexp.c + +EXTRA_DIST += printf-frexp.h + +## end gnulib module printf-frexp + +## begin gnulib module printf-frexpl + +libcoreutils_a_SOURCES += printf-frexpl.c + +EXTRA_DIST += printf-frexp.c printf-frexpl.h + +EXTRA_libcoreutils_a_SOURCES += printf-frexp.c + +## end gnulib module printf-frexpl + +## begin gnulib module priv-set + +libcoreutils_a_SOURCES += priv-set.c + +EXTRA_DIST += priv-set.h + +## end gnulib module priv-set + +## begin gnulib module progname + +libcoreutils_a_SOURCES += progname.h progname.c + +## end gnulib module progname + +## begin gnulib module propername + +libcoreutils_a_SOURCES += propername.h propername.c + +## end gnulib module propername + ## begin gnulib module putenv @@ -1283,6 +2033,24 @@ EXTRA_libcoreutils_a_SOURCES += raise.c ## end gnulib module raise +## begin gnulib module randint + +libcoreutils_a_SOURCES += randint.c randint.h + +## end gnulib module randint + +## begin gnulib module randperm + +libcoreutils_a_SOURCES += randperm.c randperm.h + +## end gnulib module randperm + +## begin gnulib module randread + +libcoreutils_a_SOURCES += randread.c randread.h rand-isaac.c rand-isaac.h + +## end gnulib module randread + ## begin gnulib module readlink @@ -1325,6 +2093,15 @@ EXTRA_libcoreutils_a_SOURCES += realloc.c ## end gnulib module realloc +## begin gnulib module realloc-posix + + +EXTRA_DIST += realloc.c + +EXTRA_libcoreutils_a_SOURCES += realloc.c + +## end gnulib module realloc-posix + ## begin gnulib module regex @@ -1437,12 +2214,55 @@ libcoreutils_a_SOURCES += savewd.h savewd.c ## end gnulib module savewd +## begin gnulib module select + + +EXTRA_DIST += select.c + +EXTRA_libcoreutils_a_SOURCES += select.c + +## end gnulib module select + +## begin gnulib module selinux-at + + +EXTRA_DIST += selinux-at.c selinux-at.h + +EXTRA_libcoreutils_a_SOURCES += selinux-at.c + +## end gnulib module selinux-at + +## begin gnulib module selinux-h + +libcoreutils_a_SOURCES += se-context.in.h se-selinux.in.h + +BUILT_SOURCES += $(SELINUX_SELINUX_H) +selinux/selinux.h: se-selinux.in.h + rm -f $@-t $@ + $(MKDIR_P) selinux + cp $(srcdir)/se-selinux.in.h $@-t + chmod a-x $@-t + mv $@-t $@ +MOSTLYCLEANFILES += selinux/selinux.h selinux/selinux.h-t + +BUILT_SOURCES += $(SELINUX_CONTEXT_H) +selinux/context.h: se-context.in.h + rm -f $@-t $@ + $(MKDIR_P) selinux + cp $(srcdir)/se-context.in.h $@-t + chmod a-x $@-t + mv $@-t $@ +MOSTLYCLEANFILES += selinux/context.h selinux/context.h-t +MOSTLYCLEANDIRS += selinux + +## end gnulib module selinux-h + ## begin gnulib module setenv -EXTRA_DIST += setenv.c setenv.h unsetenv.c +EXTRA_DIST += setenv.c -EXTRA_libcoreutils_a_SOURCES += setenv.c unsetenv.c +EXTRA_libcoreutils_a_SOURCES += setenv.c ## end gnulib module setenv @@ -1455,15 +2275,6 @@ EXTRA_libcoreutils_a_SOURCES += settime.c ## end gnulib module settime -## begin gnulib module sha1 - - -EXTRA_DIST += sha1.c sha1.h - -EXTRA_libcoreutils_a_SOURCES += sha1.c - -## end gnulib module sha1 - ## begin gnulib module sig2str @@ -1473,6 +2284,70 @@ EXTRA_libcoreutils_a_SOURCES += sig2str.c ## end gnulib module sig2str +## begin gnulib module sigaction + + +EXTRA_DIST += sig-handler.h sigaction.c + +EXTRA_libcoreutils_a_SOURCES += sigaction.c + +## end gnulib module sigaction + +## begin gnulib module signal + +BUILT_SOURCES += signal.h + +# We need the following in order to create when the system +# doesn't have a complete one. +signal.h: signal.in.h + rm -f $@-t $@ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ + sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''NEXT_SIGNAL_H''@|$(NEXT_SIGNAL_H)|g' \ + -e 's|@''GNULIB_SIGNAL_H_SIGPIPE''@|$(GNULIB_SIGNAL_H_SIGPIPE)|g' \ + -e 's|@''GNULIB_SIGPROCMASK''@|$(GNULIB_SIGPROCMASK)|g' \ + -e 's|@''GNULIB_SIGACTION''@|$(GNULIB_SIGACTION)|g' \ + -e 's|@''HAVE_POSIX_SIGNALBLOCKING''@|$(HAVE_POSIX_SIGNALBLOCKING)|g' \ + -e 's|@''HAVE_SIGSET_T''@|$(HAVE_SIGSET_T)|g' \ + -e 's|@''HAVE_SIGINFO_T''@|$(HAVE_SIGINFO_T)|g' \ + -e 's|@''HAVE_SIGACTION''@|$(HAVE_SIGACTION)|g' \ + -e 's|@''HAVE_STRUCT_SIGACTION_SA_SIGACTION''@|$(HAVE_STRUCT_SIGACTION_SA_SIGACTION)|g' \ + -e 's|@''HAVE_TYPE_VOLATILE_SIG_ATOMIC_T''@|$(HAVE_TYPE_VOLATILE_SIG_ATOMIC_T)|g' \ + -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ + < $(srcdir)/signal.in.h; \ + } > $@-t + mv $@-t $@ +MOSTLYCLEANFILES += signal.h signal.h-t + +EXTRA_DIST += signal.in.h + +## end gnulib module signal + +## begin gnulib module signbit + + +EXTRA_DIST += float+.h signbitd.c signbitf.c signbitl.c + +EXTRA_libcoreutils_a_SOURCES += signbitd.c signbitf.c signbitl.c + +## end gnulib module signbit + +## begin gnulib module sigprocmask + + +EXTRA_DIST += sigprocmask.c + +EXTRA_libcoreutils_a_SOURCES += sigprocmask.c + +## end gnulib module sigprocmask + +## begin gnulib module size_max + +libcoreutils_a_SOURCES += size_max.h + +## end gnulib module size_max + ## begin gnulib module snprintf @@ -1496,21 +2371,42 @@ EXTRA_DIST += stat-time.h ## end gnulib module stat-time +## begin gnulib module stdarg + +BUILT_SOURCES += $(STDARG_H) + +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +stdarg.h: stdarg.in.h + rm -f $@-t $@ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ + sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''NEXT_STDARG_H''@|$(NEXT_STDARG_H)|g' \ + < $(srcdir)/stdarg.in.h; \ + } > $@-t + mv $@-t $@ +MOSTLYCLEANFILES += stdarg.h stdarg.h-t + +EXTRA_DIST += stdarg.in.h + +## end gnulib module stdarg + ## begin gnulib module stdbool BUILT_SOURCES += $(STDBOOL_H) # We need the following in order to create when the system # doesn't have one that works. -stdbool.h: stdbool_.h +stdbool.h: stdbool.in.h rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ - sed -e 's/@''HAVE__BOOL''@/$(HAVE__BOOL)/g' < $(srcdir)/stdbool_.h; \ + sed -e 's/@''HAVE__BOOL''@/$(HAVE__BOOL)/g' < $(srcdir)/stdbool.in.h; \ } > $@-t mv $@-t $@ MOSTLYCLEANFILES += stdbool.h stdbool.h-t -EXTRA_DIST += stdbool_.h +EXTRA_DIST += stdbool.in.h ## end gnulib module stdbool @@ -1520,17 +2416,20 @@ BUILT_SOURCES += $(STDINT_H) # We need the following in order to create when the system # doesn't have one that works with the given compiler. -stdint.h: stdint_.h +stdint.h: stdint.in.h rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ sed -e 's/@''HAVE_STDINT_H''@/$(HAVE_STDINT_H)/g' \ - -e 's|@''ABSOLUTE_STDINT_H''@|$(ABSOLUTE_STDINT_H)|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''NEXT_STDINT_H''@|$(NEXT_STDINT_H)|g' \ -e 's/@''HAVE_SYS_TYPES_H''@/$(HAVE_SYS_TYPES_H)/g' \ -e 's/@''HAVE_INTTYPES_H''@/$(HAVE_INTTYPES_H)/g' \ -e 's/@''HAVE_SYS_INTTYPES_H''@/$(HAVE_SYS_INTTYPES_H)/g' \ -e 's/@''HAVE_SYS_BITYPES_H''@/$(HAVE_SYS_BITYPES_H)/g' \ -e 's/@''HAVE_LONG_LONG_INT''@/$(HAVE_LONG_LONG_INT)/g' \ -e 's/@''HAVE_UNSIGNED_LONG_LONG_INT''@/$(HAVE_UNSIGNED_LONG_LONG_INT)/g' \ + -e 's/@''APPLE_UNIVERSAL_BUILD''@/$(APPLE_UNIVERSAL_BUILD)/g' \ -e 's/@''BITSIZEOF_PTRDIFF_T''@/$(BITSIZEOF_PTRDIFF_T)/g' \ -e 's/@''PTRDIFF_T_SUFFIX''@/$(PTRDIFF_T_SUFFIX)/g' \ -e 's/@''BITSIZEOF_SIG_ATOMIC_T''@/$(BITSIZEOF_SIG_ATOMIC_T)/g' \ @@ -1544,12 +2443,12 @@ stdint.h: stdint_.h -e 's/@''BITSIZEOF_WINT_T''@/$(BITSIZEOF_WINT_T)/g' \ -e 's/@''HAVE_SIGNED_WINT_T''@/$(HAVE_SIGNED_WINT_T)/g' \ -e 's/@''WINT_T_SUFFIX''@/$(WINT_T_SUFFIX)/g' \ - < $(srcdir)/stdint_.h; \ + < $(srcdir)/stdint.in.h; \ } > $@-t mv $@-t $@ MOSTLYCLEANFILES += stdint.h stdint.h-t -EXTRA_DIST += stdint_.h +EXTRA_DIST += stdint.in.h ## end gnulib module stdint @@ -1559,18 +2458,48 @@ BUILT_SOURCES += stdio.h # We need the following in order to create when the system # doesn't have one that works with the given compiler. -stdio.h: stdio_.h +stdio.h: stdio.in.h rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ - sed -e 's|@''ABSOLUTE_STDIO_H''@|$(ABSOLUTE_STDIO_H)|g' \ + sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''NEXT_STDIO_H''@|$(NEXT_STDIO_H)|g' \ + -e 's|@''GNULIB_FPRINTF''@|$(GNULIB_FPRINTF)|g' \ -e 's|@''GNULIB_FPRINTF_POSIX''@|$(GNULIB_FPRINTF_POSIX)|g' \ + -e 's|@''GNULIB_PRINTF''@|$(GNULIB_PRINTF)|g' \ -e 's|@''GNULIB_PRINTF_POSIX''@|$(GNULIB_PRINTF_POSIX)|g' \ -e 's|@''GNULIB_SNPRINTF''@|$(GNULIB_SNPRINTF)|g' \ -e 's|@''GNULIB_SPRINTF_POSIX''@|$(GNULIB_SPRINTF_POSIX)|g' \ + -e 's|@''GNULIB_VFPRINTF''@|$(GNULIB_VFPRINTF)|g' \ -e 's|@''GNULIB_VFPRINTF_POSIX''@|$(GNULIB_VFPRINTF_POSIX)|g' \ + -e 's|@''GNULIB_VPRINTF''@|$(GNULIB_VPRINTF)|g' \ -e 's|@''GNULIB_VPRINTF_POSIX''@|$(GNULIB_VPRINTF_POSIX)|g' \ -e 's|@''GNULIB_VSNPRINTF''@|$(GNULIB_VSNPRINTF)|g' \ -e 's|@''GNULIB_VSPRINTF_POSIX''@|$(GNULIB_VSPRINTF_POSIX)|g' \ + -e 's|@''GNULIB_DPRINTF''@|$(GNULIB_DPRINTF)|g' \ + -e 's|@''GNULIB_VDPRINTF''@|$(GNULIB_VDPRINTF)|g' \ + -e 's|@''GNULIB_VASPRINTF''@|$(GNULIB_VASPRINTF)|g' \ + -e 's|@''GNULIB_OBSTACK_PRINTF''@|$(GNULIB_OBSTACK_PRINTF)|g' \ + -e 's|@''GNULIB_OBSTACK_PRINTF_POSIX''@|$(GNULIB_OBSTACK_PRINTF_POSIX)|g' \ + -e 's|@''GNULIB_FOPEN''@|$(GNULIB_FOPEN)|g' \ + -e 's|@''GNULIB_FREOPEN''@|$(GNULIB_FREOPEN)|g' \ + -e 's|@''GNULIB_FSEEK''@|$(GNULIB_FSEEK)|g' \ + -e 's|@''GNULIB_FSEEKO''@|$(GNULIB_FSEEKO)|g' \ + -e 's|@''GNULIB_FTELL''@|$(GNULIB_FTELL)|g' \ + -e 's|@''GNULIB_FTELLO''@|$(GNULIB_FTELLO)|g' \ + -e 's|@''GNULIB_FFLUSH''@|$(GNULIB_FFLUSH)|g' \ + -e 's|@''GNULIB_FCLOSE''@|$(GNULIB_FCLOSE)|g' \ + -e 's|@''GNULIB_FPUTC''@|$(GNULIB_FPUTC)|g' \ + -e 's|@''GNULIB_PUTC''@|$(GNULIB_PUTC)|g' \ + -e 's|@''GNULIB_PUTCHAR''@|$(GNULIB_PUTCHAR)|g' \ + -e 's|@''GNULIB_FPUTS''@|$(GNULIB_FPUTS)|g' \ + -e 's|@''GNULIB_PUTS''@|$(GNULIB_PUTS)|g' \ + -e 's|@''GNULIB_FWRITE''@|$(GNULIB_FWRITE)|g' \ + -e 's|@''GNULIB_GETDELIM''@|$(GNULIB_GETDELIM)|g' \ + -e 's|@''GNULIB_GETLINE''@|$(GNULIB_GETLINE)|g' \ + -e 's|@''GNULIB_PERROR''@|$(GNULIB_PERROR)|g' \ + -e 's|@''GNULIB_STDIO_H_SIGPIPE''@|$(GNULIB_STDIO_H_SIGPIPE)|g' \ + -e 's|@''REPLACE_STDIO_WRITE_FUNCS''@|$(REPLACE_STDIO_WRITE_FUNCS)|g' \ -e 's|@''REPLACE_FPRINTF''@|$(REPLACE_FPRINTF)|g' \ -e 's|@''REPLACE_VFPRINTF''@|$(REPLACE_VFPRINTF)|g' \ -e 's|@''REPLACE_PRINTF''@|$(REPLACE_PRINTF)|g' \ @@ -1581,13 +2510,35 @@ stdio.h: stdio_.h -e 's|@''HAVE_DECL_VSNPRINTF''@|$(HAVE_DECL_VSNPRINTF)|g' \ -e 's|@''REPLACE_SPRINTF''@|$(REPLACE_SPRINTF)|g' \ -e 's|@''REPLACE_VSPRINTF''@|$(REPLACE_VSPRINTF)|g' \ + -e 's|@''HAVE_DPRINTF''@|$(HAVE_DPRINTF)|g' \ + -e 's|@''REPLACE_DPRINTF''@|$(REPLACE_DPRINTF)|g' \ + -e 's|@''HAVE_VDPRINTF''@|$(HAVE_VDPRINTF)|g' \ + -e 's|@''REPLACE_VDPRINTF''@|$(REPLACE_VDPRINTF)|g' \ + -e 's|@''HAVE_VASPRINTF''@|$(HAVE_VASPRINTF)|g' \ + -e 's|@''REPLACE_VASPRINTF''@|$(REPLACE_VASPRINTF)|g' \ + -e 's|@''HAVE_DECL_OBSTACK_PRINTF''@|$(HAVE_DECL_OBSTACK_PRINTF)|g' \ + -e 's|@''REPLACE_OBSTACK_PRINTF''@|$(REPLACE_OBSTACK_PRINTF)|g' \ + -e 's|@''REPLACE_FOPEN''@|$(REPLACE_FOPEN)|g' \ + -e 's|@''REPLACE_FREOPEN''@|$(REPLACE_FREOPEN)|g' \ + -e 's|@''REPLACE_FSEEKO''@|$(REPLACE_FSEEKO)|g' \ + -e 's|@''REPLACE_FSEEK''@|$(REPLACE_FSEEK)|g' \ + -e 's|@''REPLACE_FTELLO''@|$(REPLACE_FTELLO)|g' \ + -e 's|@''REPLACE_FTELL''@|$(REPLACE_FTELL)|g' \ + -e 's|@''REPLACE_FFLUSH''@|$(REPLACE_FFLUSH)|g' \ + -e 's|@''REPLACE_FCLOSE''@|$(REPLACE_FCLOSE)|g' \ + -e 's|@''HAVE_DECL_GETDELIM''@|$(HAVE_DECL_GETDELIM)|g' \ + -e 's|@''HAVE_DECL_GETLINE''@|$(HAVE_DECL_GETLINE)|g' \ + -e 's|@''REPLACE_GETLINE''@|$(REPLACE_GETLINE)|g' \ + -e 's|@''REPLACE_PERROR''@|$(REPLACE_PERROR)|g' \ -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ - < $(srcdir)/stdio_.h; \ + < $(srcdir)/stdio.in.h; \ } > $@-t mv $@-t $@ MOSTLYCLEANFILES += stdio.h stdio.h-t -EXTRA_DIST += stdio_.h +EXTRA_DIST += stdio-write.c stdio.in.h + +EXTRA_libcoreutils_a_SOURCES += stdio-write.c ## end gnulib module stdio @@ -1597,23 +2548,56 @@ BUILT_SOURCES += stdlib.h # We need the following in order to create when the system # doesn't have one that works with the given compiler. -stdlib.h: stdlib_.h +stdlib.h: stdlib.in.h rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ - sed -e 's|@''ABSOLUTE_STDLIB_H''@|$(ABSOLUTE_STDLIB_H)|g' \ + sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''NEXT_STDLIB_H''@|$(NEXT_STDLIB_H)|g' \ + -e 's|@''HAVE_RANDOM_H''@|$(HAVE_RANDOM_H)|g' \ + -e 's|@''GNULIB_MALLOC_POSIX''@|$(GNULIB_MALLOC_POSIX)|g' \ + -e 's|@''GNULIB_REALLOC_POSIX''@|$(GNULIB_REALLOC_POSIX)|g' \ + -e 's|@''GNULIB_CALLOC_POSIX''@|$(GNULIB_CALLOC_POSIX)|g' \ + -e 's|@''GNULIB_ATOLL''@|$(GNULIB_ATOLL)|g' \ + -e 's|@''GNULIB_GETLOADAVG''@|$(GNULIB_GETLOADAVG)|g' \ -e 's|@''GNULIB_GETSUBOPT''@|$(GNULIB_GETSUBOPT)|g' \ -e 's|@''GNULIB_MKDTEMP''@|$(GNULIB_MKDTEMP)|g' \ -e 's|@''GNULIB_MKSTEMP''@|$(GNULIB_MKSTEMP)|g' \ + -e 's|@''GNULIB_PUTENV''@|$(GNULIB_PUTENV)|g' \ + -e 's|@''GNULIB_RANDOM_R''@|$(GNULIB_RANDOM_R)|g' \ + -e 's|@''GNULIB_RPMATCH''@|$(GNULIB_RPMATCH)|g' \ + -e 's|@''GNULIB_SETENV''@|$(GNULIB_SETENV)|g' \ + -e 's|@''GNULIB_STRTOD''@|$(GNULIB_STRTOD)|g' \ + -e 's|@''GNULIB_STRTOLL''@|$(GNULIB_STRTOLL)|g' \ + -e 's|@''GNULIB_STRTOULL''@|$(GNULIB_STRTOULL)|g' \ + -e 's|@''GNULIB_UNSETENV''@|$(GNULIB_UNSETENV)|g' \ + -e 's|@''HAVE_ATOLL''@|$(HAVE_ATOLL)|g' \ + -e 's|@''HAVE_CALLOC_POSIX''@|$(HAVE_CALLOC_POSIX)|g' \ -e 's|@''HAVE_GETSUBOPT''@|$(HAVE_GETSUBOPT)|g' \ + -e 's|@''HAVE_MALLOC_POSIX''@|$(HAVE_MALLOC_POSIX)|g' \ -e 's|@''HAVE_MKDTEMP''@|$(HAVE_MKDTEMP)|g' \ + -e 's|@''HAVE_REALLOC_POSIX''@|$(HAVE_REALLOC_POSIX)|g' \ + -e 's|@''HAVE_RANDOM_R''@|$(HAVE_RANDOM_R)|g' \ + -e 's|@''HAVE_RPMATCH''@|$(HAVE_RPMATCH)|g' \ + -e 's|@''HAVE_SETENV''@|$(HAVE_SETENV)|g' \ + -e 's|@''HAVE_STRTOD''@|$(HAVE_STRTOD)|g' \ + -e 's|@''HAVE_STRTOLL''@|$(HAVE_STRTOLL)|g' \ + -e 's|@''HAVE_STRTOULL''@|$(HAVE_STRTOULL)|g' \ + -e 's|@''HAVE_STRUCT_RANDOM_DATA''@|$(HAVE_STRUCT_RANDOM_DATA)|g' \ + -e 's|@''HAVE_SYS_LOADAVG_H''@|$(HAVE_SYS_LOADAVG_H)|g' \ + -e 's|@''HAVE_UNSETENV''@|$(HAVE_UNSETENV)|g' \ + -e 's|@''HAVE_DECL_GETLOADAVG''@|$(HAVE_DECL_GETLOADAVG)|g' \ -e 's|@''REPLACE_MKSTEMP''@|$(REPLACE_MKSTEMP)|g' \ + -e 's|@''REPLACE_PUTENV''@|$(REPLACE_PUTENV)|g' \ + -e 's|@''REPLACE_STRTOD''@|$(REPLACE_STRTOD)|g' \ + -e 's|@''VOID_UNSETENV''@|$(VOID_UNSETENV)|g' \ -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ - < $(srcdir)/stdlib_.h; \ + < $(srcdir)/stdlib.in.h; \ } > $@-t mv $@-t $@ MOSTLYCLEANFILES += stdlib.h stdlib.h-t -EXTRA_DIST += stdlib_.h +EXTRA_DIST += stdlib.in.h ## end gnulib module stdlib @@ -1635,6 +2619,15 @@ EXTRA_libcoreutils_a_SOURCES += stpcpy.c ## end gnulib module stpcpy +## begin gnulib module stpncpy + + +EXTRA_DIST += stpncpy.c + +EXTRA_libcoreutils_a_SOURCES += stpncpy.c + +## end gnulib module stpncpy + ## begin gnulib module strcspn @@ -1653,6 +2646,31 @@ EXTRA_libcoreutils_a_SOURCES += strdup.c ## end gnulib module strdup +## begin gnulib module strdup-posix + + +EXTRA_DIST += strdup.c + +EXTRA_libcoreutils_a_SOURCES += strdup.c + +## end gnulib module strdup-posix + +## begin gnulib module streq + + +EXTRA_DIST += streq.h + +## end gnulib module streq + +## begin gnulib module strerror + + +EXTRA_DIST += strerror.c + +EXTRA_libcoreutils_a_SOURCES += strerror.c + +## end gnulib module strerror + ## begin gnulib module strftime @@ -1662,17 +2680,28 @@ EXTRA_libcoreutils_a_SOURCES += strftime.c ## end gnulib module strftime +## begin gnulib module striconv + +libcoreutils_a_SOURCES += striconv.h striconv.c +if GL_COND_LIBTOOL +endif + +## end gnulib module striconv + ## begin gnulib module string BUILT_SOURCES += string.h # We need the following in order to create when the system # doesn't have one that works with the given compiler. -string.h: string_.h +string.h: string.in.h rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ - sed -e 's|@''ABSOLUTE_STRING_H''@|$(ABSOLUTE_STRING_H)|g' \ + sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''NEXT_STRING_H''@|$(NEXT_STRING_H)|g' \ -e 's|@''GNULIB_MBSLEN''@|$(GNULIB_MBSLEN)|g' \ + -e 's|@''GNULIB_MBSNLEN''@|$(GNULIB_MBSNLEN)|g' \ -e 's|@''GNULIB_MBSCHR''@|$(GNULIB_MBSCHR)|g' \ -e 's|@''GNULIB_MBSRCHR''@|$(GNULIB_MBSRCHR)|g' \ -e 's|@''GNULIB_MBSSTR''@|$(GNULIB_MBSSTR)|g' \ @@ -1688,6 +2717,7 @@ string.h: string_.h -e 's|@''GNULIB_MEMMEM''@|$(GNULIB_MEMMEM)|g' \ -e 's|@''GNULIB_MEMPCPY''@|$(GNULIB_MEMPCPY)|g' \ -e 's|@''GNULIB_MEMRCHR''@|$(GNULIB_MEMRCHR)|g' \ + -e 's|@''GNULIB_RAWMEMCHR''@|$(GNULIB_RAWMEMCHR)|g' \ -e 's|@''GNULIB_STPCPY''@|$(GNULIB_STPCPY)|g' \ -e 's|@''GNULIB_STPNCPY''@|$(GNULIB_STPNCPY)|g' \ -e 's|@''GNULIB_STRCHRNUL''@|$(GNULIB_STRCHRNUL)|g' \ @@ -1696,15 +2726,18 @@ string.h: string_.h -e 's|@''GNULIB_STRNLEN''@|$(GNULIB_STRNLEN)|g' \ -e 's|@''GNULIB_STRPBRK''@|$(GNULIB_STRPBRK)|g' \ -e 's|@''GNULIB_STRSEP''@|$(GNULIB_STRSEP)|g' \ + -e 's|@''GNULIB_STRSTR''@|$(GNULIB_STRSTR)|g' \ -e 's|@''GNULIB_STRCASESTR''@|$(GNULIB_STRCASESTR)|g' \ -e 's|@''GNULIB_STRTOK_R''@|$(GNULIB_STRTOK_R)|g' \ + -e 's|@''GNULIB_STRERROR''@|$(GNULIB_STRERROR)|g' \ + -e 's|@''GNULIB_STRSIGNAL''@|$(GNULIB_STRSIGNAL)|g' \ + -e 's|@''GNULIB_STRVERSCMP''@|$(GNULIB_STRVERSCMP)|g' \ -e 's|@''HAVE_DECL_MEMMEM''@|$(HAVE_DECL_MEMMEM)|g' \ -e 's|@''HAVE_MEMPCPY''@|$(HAVE_MEMPCPY)|g' \ -e 's|@''HAVE_DECL_MEMRCHR''@|$(HAVE_DECL_MEMRCHR)|g' \ + -e 's|@''HAVE_RAWMEMCHR''@|$(HAVE_RAWMEMCHR)|g' \ -e 's|@''HAVE_STPCPY''@|$(HAVE_STPCPY)|g' \ -e 's|@''HAVE_STPNCPY''@|$(HAVE_STPNCPY)|g' \ - -e 's|@''HAVE_STRCASECMP''@|$(HAVE_STRCASECMP)|g' \ - -e 's|@''HAVE_DECL_STRNCASECMP''@|$(HAVE_DECL_STRNCASECMP)|g' \ -e 's|@''HAVE_STRCHRNUL''@|$(HAVE_STRCHRNUL)|g' \ -e 's|@''HAVE_DECL_STRDUP''@|$(HAVE_DECL_STRDUP)|g' \ -e 's|@''HAVE_STRNDUP''@|$(HAVE_STRNDUP)|g' \ @@ -1714,13 +2747,22 @@ string.h: string_.h -e 's|@''HAVE_STRSEP''@|$(HAVE_STRSEP)|g' \ -e 's|@''HAVE_STRCASESTR''@|$(HAVE_STRCASESTR)|g' \ -e 's|@''HAVE_DECL_STRTOK_R''@|$(HAVE_DECL_STRTOK_R)|g' \ + -e 's|@''HAVE_DECL_STRERROR''@|$(HAVE_DECL_STRERROR)|g' \ + -e 's|@''HAVE_DECL_STRSIGNAL''@|$(HAVE_DECL_STRSIGNAL)|g' \ + -e 's|@''HAVE_STRVERSCMP''@|$(HAVE_STRVERSCMP)|g' \ + -e 's|@''REPLACE_MEMMEM''@|$(REPLACE_MEMMEM)|g' \ + -e 's|@''REPLACE_STRCASESTR''@|$(REPLACE_STRCASESTR)|g' \ + -e 's|@''REPLACE_STRDUP''@|$(REPLACE_STRDUP)|g' \ + -e 's|@''REPLACE_STRSTR''@|$(REPLACE_STRSTR)|g' \ + -e 's|@''REPLACE_STRERROR''@|$(REPLACE_STRERROR)|g' \ + -e 's|@''REPLACE_STRSIGNAL''@|$(REPLACE_STRSIGNAL)|g' \ -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ - < $(srcdir)/string_.h; \ + < $(srcdir)/string.in.h; \ } > $@-t mv $@-t $@ MOSTLYCLEANFILES += string.h string.h-t -EXTRA_DIST += string_.h +EXTRA_DIST += string.in.h ## end gnulib module string @@ -1824,32 +2866,78 @@ EXTRA_libcoreutils_a_SOURCES += strtoumax.c ## begin gnulib module strverscmp -EXTRA_DIST += strverscmp.c strverscmp.h +EXTRA_DIST += strverscmp.c EXTRA_libcoreutils_a_SOURCES += strverscmp.c ## end gnulib module strverscmp +## begin gnulib module sys_select + +BUILT_SOURCES += $(SYS_SELECT_H) + +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +sys/select.h: sys_select.in.h + @MKDIR_P@ sys + rm -f $@-t $@ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''NEXT_SYS_SELECT_H''@|$(NEXT_SYS_SELECT_H)|g' \ + -e 's|@''HAVE_SYS_SELECT_H''@|$(HAVE_SYS_SELECT_H)|g' \ + -e 's|@''GNULIB_SELECT''@|$(GNULIB_SELECT)|g' \ + -e 's|@''HAVE_WINSOCK2_H''@|$(HAVE_WINSOCK2_H)|g' \ + -e 's|@''REPLACE_SELECT''@|$(REPLACE_SELECT)|g' \ + -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ + < $(srcdir)/sys_select.in.h; \ + } > $@-t + mv $@-t $@ +MOSTLYCLEANFILES += sys/select.h sys/select.h-t +MOSTLYCLEANDIRS += sys + +EXTRA_DIST += sys_select.in.h + +## end gnulib module sys_select + ## begin gnulib module sys_socket BUILT_SOURCES += $(SYS_SOCKET_H) # We need the following in order to create when the system # doesn't have one that works with the given compiler. -sys/socket.h: socket_.h +sys/socket.h: sys_socket.in.h @MKDIR_P@ sys { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ - sed -e 's|@''ABSOLUTE_SYS_SOCKET_H''@|$(ABSOLUTE_SYS_SOCKET_H)|g' \ + sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''NEXT_SYS_SOCKET_H''@|$(NEXT_SYS_SOCKET_H)|g' \ -e 's|@''HAVE_SYS_SOCKET_H''@|$(HAVE_SYS_SOCKET_H)|g' \ + -e 's|@''GNULIB_CLOSE''@|$(GNULIB_CLOSE)|g' \ + -e 's|@''GNULIB_SOCKET''@|$(GNULIB_SOCKET)|g' \ + -e 's|@''GNULIB_CONNECT''@|$(GNULIB_CONNECT)|g' \ + -e 's|@''GNULIB_ACCEPT''@|$(GNULIB_ACCEPT)|g' \ + -e 's|@''GNULIB_BIND''@|$(GNULIB_BIND)|g' \ + -e 's|@''GNULIB_GETPEERNAME''@|$(GNULIB_GETPEERNAME)|g' \ + -e 's|@''GNULIB_GETSOCKNAME''@|$(GNULIB_GETSOCKNAME)|g' \ + -e 's|@''GNULIB_GETSOCKOPT''@|$(GNULIB_GETSOCKOPT)|g' \ + -e 's|@''GNULIB_LISTEN''@|$(GNULIB_LISTEN)|g' \ + -e 's|@''GNULIB_RECV''@|$(GNULIB_RECV)|g' \ + -e 's|@''GNULIB_SEND''@|$(GNULIB_SEND)|g' \ + -e 's|@''GNULIB_RECVFROM''@|$(GNULIB_RECVFROM)|g' \ + -e 's|@''GNULIB_SENDTO''@|$(GNULIB_SENDTO)|g' \ + -e 's|@''GNULIB_SETSOCKOPT''@|$(GNULIB_SETSOCKOPT)|g' \ + -e 's|@''GNULIB_SHUTDOWN''@|$(GNULIB_SHUTDOWN)|g' \ -e 's|@''HAVE_WINSOCK2_H''@|$(HAVE_WINSOCK2_H)|g' \ -e 's|@''HAVE_WS2TCPIP_H''@|$(HAVE_WS2TCPIP_H)|g' \ - < $(srcdir)/socket_.h; \ + -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ + < $(srcdir)/sys_socket.in.h; \ } > $@-t mv -f $@-t $@ MOSTLYCLEANFILES += sys/socket.h sys/socket.h-t MOSTLYCLEANDIRS += sys -EXTRA_DIST += socket_.h +EXTRA_DIST += sys_socket.in.h ## end gnulib module sys_socket @@ -1859,18 +2947,27 @@ BUILT_SOURCES += $(SYS_STAT_H) # We need the following in order to create when the system # has one that is incomplete. -sys/stat.h: stat_.h +sys/stat.h: sys_stat.in.h @MKDIR_P@ sys rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ - sed -e 's|@''ABSOLUTE_SYS_STAT_H''@|$(ABSOLUTE_SYS_STAT_H)|g' \ - < $(srcdir)/stat_.h; \ + sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''NEXT_SYS_STAT_H''@|$(NEXT_SYS_STAT_H)|g' \ + -e 's|@''GNULIB_LCHMOD''@|$(GNULIB_LCHMOD)|g' \ + -e 's|@''GNULIB_LSTAT''@|$(GNULIB_LSTAT)|g' \ + -e 's|@''HAVE_LCHMOD''@|$(HAVE_LCHMOD)|g' \ + -e 's|@''HAVE_LSTAT''@|$(HAVE_LSTAT)|g' \ + -e 's|@''REPLACE_LSTAT''@|$(REPLACE_LSTAT)|g' \ + -e 's|@''REPLACE_MKDIR''@|$(REPLACE_MKDIR)|g' \ + -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ + < $(srcdir)/sys_stat.in.h; \ } > $@-t mv $@-t $@ MOSTLYCLEANFILES += sys/stat.h sys/stat.h-t MOSTLYCLEANDIRS += sys -EXTRA_DIST += stat_.h +EXTRA_DIST += sys_stat.in.h ## end gnulib module sys_stat @@ -1880,20 +2977,22 @@ 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. -sys/time.h: sys_time_.h +sys/time.h: sys_time.in.h @MKDIR_P@ sys rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ sed -e 's/@''HAVE_SYS_TIME_H''@/$(HAVE_SYS_TIME_H)/g' \ - -e 's|@''ABSOLUTE_SYS_TIME_H''@|$(ABSOLUTE_SYS_TIME_H)|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''NEXT_SYS_TIME_H''@|$(NEXT_SYS_TIME_H)|g' \ -e 's/@''REPLACE_GETTIMEOFDAY''@/$(REPLACE_GETTIMEOFDAY)/g' \ -e 's/@''HAVE_STRUCT_TIMEVAL''@/$(HAVE_STRUCT_TIMEVAL)/g' \ - < $(srcdir)/sys_time_.h; \ + < $(srcdir)/sys_time.in.h; \ } > $@-t mv $@-t $@ MOSTLYCLEANFILES += sys/time.h sys/time.h-t -EXTRA_DIST += sys_time_.h +EXTRA_DIST += sys_time.in.h ## end gnulib module sys_time @@ -1912,22 +3011,24 @@ BUILT_SOURCES += time.h # We need the following in order to create when the system # doesn't have one that works with the given compiler. -time.h: time_.h +time.h: time.in.h rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ - sed -e 's|@ABSOLUTE_TIME_H''@|$(ABSOLUTE_TIME_H)|g' \ - -e 's|@REPLACE_LOCALTIME_R''@|$(REPLACE_LOCALTIME_R)|g' \ - -e 's|@REPLACE_NANOSLEEP''@|$(REPLACE_NANOSLEEP)|g' \ - -e 's|@REPLACE_STRPTIME''@|$(REPLACE_STRPTIME)|g' \ - -e 's|@REPLACE_TIMEGM''@|$(REPLACE_TIMEGM)|g' \ - -e 's|@SYS_TIME_H_DEFINES_STRUCT_TIMESPEC''@|$(SYS_TIME_H_DEFINES_STRUCT_TIMESPEC)|g' \ - -e 's|@TIME_H_DEFINES_STRUCT_TIMESPEC''@|$(TIME_H_DEFINES_STRUCT_TIMESPEC)|g' \ - < $(srcdir)/time_.h; \ + sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@NEXT_TIME_H''@|$(NEXT_TIME_H)|g' \ + -e 's|@REPLACE_LOCALTIME_R''@|$(REPLACE_LOCALTIME_R)|g' \ + -e 's|@REPLACE_NANOSLEEP''@|$(REPLACE_NANOSLEEP)|g' \ + -e 's|@REPLACE_STRPTIME''@|$(REPLACE_STRPTIME)|g' \ + -e 's|@REPLACE_TIMEGM''@|$(REPLACE_TIMEGM)|g' \ + -e 's|@SYS_TIME_H_DEFINES_STRUCT_TIMESPEC''@|$(SYS_TIME_H_DEFINES_STRUCT_TIMESPEC)|g' \ + -e 's|@TIME_H_DEFINES_STRUCT_TIMESPEC''@|$(TIME_H_DEFINES_STRUCT_TIMESPEC)|g' \ + < $(srcdir)/time.in.h; \ } > $@-t mv $@-t $@ MOSTLYCLEANFILES += time.h time.h-t -EXTRA_DIST += time_.h +EXTRA_DIST += time.in.h ## end gnulib module time @@ -1947,6 +3048,20 @@ EXTRA_DIST += timespec.h ## end gnulib module timespec +## begin gnulib module trim + +libcoreutils_a_SOURCES += trim.c + +EXTRA_DIST += trim.h + +## end gnulib module trim + +## begin gnulib module u64 + +EXTRA_DIST += u64.h + +## end gnulib module u64 + ## begin gnulib module unicodeio libcoreutils_a_SOURCES += unicodeio.h unicodeio.c @@ -1959,31 +3074,67 @@ BUILT_SOURCES += unistd.h # We need the following in order to create an empty placeholder for # when the system doesn't have one. -unistd.h: unistd_.h +unistd.h: unistd.in.h rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ sed -e 's|@''HAVE_UNISTD_H''@|$(HAVE_UNISTD_H)|g' \ - -e 's|@''ABSOLUTE_UNISTD_H''@|$(ABSOLUTE_UNISTD_H)|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''NEXT_UNISTD_H''@|$(NEXT_UNISTD_H)|g' \ -e 's|@''GNULIB_CHOWN''@|$(GNULIB_CHOWN)|g' \ + -e 's|@''GNULIB_CLOSE''@|$(GNULIB_CLOSE)|g' \ -e 's|@''GNULIB_DUP2''@|$(GNULIB_DUP2)|g' \ + -e 's|@''GNULIB_ENVIRON''@|$(GNULIB_ENVIRON)|g' \ + -e 's|@''GNULIB_EUIDACCESS''@|$(GNULIB_EUIDACCESS)|g' \ -e 's|@''GNULIB_FCHDIR''@|$(GNULIB_FCHDIR)|g' \ + -e 's|@''GNULIB_FSYNC''@|$(GNULIB_FSYNC)|g' \ -e 's|@''GNULIB_FTRUNCATE''@|$(GNULIB_FTRUNCATE)|g' \ -e 's|@''GNULIB_GETCWD''@|$(GNULIB_GETCWD)|g' \ + -e 's|@''GNULIB_GETDOMAINNAME''@|$(GNULIB_GETDOMAINNAME)|g' \ + -e 's|@''GNULIB_GETDTABLESIZE''@|$(GNULIB_GETDTABLESIZE)|g' \ + -e 's|@''GNULIB_GETHOSTNAME''@|$(GNULIB_GETHOSTNAME)|g' \ -e 's|@''GNULIB_GETLOGIN_R''@|$(GNULIB_GETLOGIN_R)|g' \ + -e 's|@''GNULIB_GETPAGESIZE''@|$(GNULIB_GETPAGESIZE)|g' \ + -e 's|@''GNULIB_GETUSERSHELL''@|$(GNULIB_GETUSERSHELL)|g' \ + -e 's|@''GNULIB_LCHOWN''@|$(GNULIB_LCHOWN)|g' \ + -e 's|@''GNULIB_LINK''@|$(GNULIB_LINK)|g' \ + -e 's|@''GNULIB_LSEEK''@|$(GNULIB_LSEEK)|g' \ -e 's|@''GNULIB_READLINK''@|$(GNULIB_READLINK)|g' \ + -e 's|@''GNULIB_SLEEP''@|$(GNULIB_SLEEP)|g' \ + -e 's|@''GNULIB_UNISTD_H_SIGPIPE''@|$(GNULIB_UNISTD_H_SIGPIPE)|g' \ + -e 's|@''GNULIB_WRITE''@|$(GNULIB_WRITE)|g' \ -e 's|@''HAVE_DUP2''@|$(HAVE_DUP2)|g' \ + -e 's|@''HAVE_EUIDACCESS''@|$(HAVE_EUIDACCESS)|g' \ + -e 's|@''HAVE_FSYNC''@|$(HAVE_FSYNC)|g' \ -e 's|@''HAVE_FTRUNCATE''@|$(HAVE_FTRUNCATE)|g' \ + -e 's|@''HAVE_GETDOMAINNAME''@|$(HAVE_GETDOMAINNAME)|g' \ + -e 's|@''HAVE_GETDTABLESIZE''@|$(HAVE_GETDTABLESIZE)|g' \ + -e 's|@''HAVE_GETHOSTNAME''@|$(HAVE_GETHOSTNAME)|g' \ + -e 's|@''HAVE_GETPAGESIZE''@|$(HAVE_GETPAGESIZE)|g' \ + -e 's|@''HAVE_GETUSERSHELL''@|$(HAVE_GETUSERSHELL)|g' \ + -e 's|@''HAVE_LINK''@|$(HAVE_LINK)|g' \ -e 's|@''HAVE_READLINK''@|$(HAVE_READLINK)|g' \ + -e 's|@''HAVE_SLEEP''@|$(HAVE_SLEEP)|g' \ + -e 's|@''HAVE_DECL_ENVIRON''@|$(HAVE_DECL_ENVIRON)|g' \ -e 's|@''HAVE_DECL_GETLOGIN_R''@|$(HAVE_DECL_GETLOGIN_R)|g' \ + -e 's|@''HAVE_OS_H''@|$(HAVE_OS_H)|g' \ + -e 's|@''HAVE_SYS_PARAM_H''@|$(HAVE_SYS_PARAM_H)|g' \ -e 's|@''REPLACE_CHOWN''@|$(REPLACE_CHOWN)|g' \ + -e 's|@''REPLACE_CLOSE''@|$(REPLACE_CLOSE)|g' \ -e 's|@''REPLACE_FCHDIR''@|$(REPLACE_FCHDIR)|g' \ -e 's|@''REPLACE_GETCWD''@|$(REPLACE_GETCWD)|g' \ - < $(srcdir)/unistd_.h; \ + -e 's|@''REPLACE_GETPAGESIZE''@|$(REPLACE_GETPAGESIZE)|g' \ + -e 's|@''REPLACE_LCHOWN''@|$(REPLACE_LCHOWN)|g' \ + -e 's|@''REPLACE_LSEEK''@|$(REPLACE_LSEEK)|g' \ + -e 's|@''REPLACE_WRITE''@|$(REPLACE_WRITE)|g' \ + -e 's|@''UNISTD_H_HAVE_WINSOCK2_H''@|$(UNISTD_H_HAVE_WINSOCK2_H)|g' \ + -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ + < $(srcdir)/unistd.in.h; \ } > $@-t mv $@-t $@ MOSTLYCLEANFILES += unistd.h unistd.h-t -EXTRA_DIST += unistd_.h +EXTRA_DIST += unistd.in.h ## end gnulib module unistd @@ -1996,6 +3147,41 @@ EXTRA_libcoreutils_a_SOURCES += dup-safer.c fd-safer.c pipe-safer.c ## end gnulib module unistd-safer +## begin gnulib module unistr/base + + +EXTRA_DIST += unistr.h + +## end gnulib module unistr/base + +## begin gnulib module unistr/u8-uctomb + +libcoreutils_a_SOURCES += unistr/u8-uctomb.c unistr/u8-uctomb-aux.c + +## end gnulib module unistr/u8-uctomb + +## begin gnulib module unitypes + + +EXTRA_DIST += unitypes.h + +## end gnulib module unitypes + +## begin gnulib module uniwidth/base + + +EXTRA_DIST += localcharset.h uniwidth.h + +## end gnulib module uniwidth/base + +## begin gnulib module uniwidth/width + +libcoreutils_a_SOURCES += uniwidth/width.c + +EXTRA_DIST += uniwidth/cjk.h + +## end gnulib module uniwidth/width + ## begin gnulib module unlinkdir @@ -2012,6 +3198,22 @@ EXTRA_DIST += unlocked-io.h ## end gnulib module unlocked-io +## begin gnulib module unsetenv + + +EXTRA_DIST += unsetenv.c + +EXTRA_libcoreutils_a_SOURCES += unsetenv.c + +## end gnulib module unsetenv + +## begin gnulib module useless-if-before-free + + +EXTRA_DIST += $(top_srcdir)/build-aux/useless-if-before-free + +## end gnulib module useless-if-before-free + ## begin gnulib module userspec @@ -2021,15 +3223,6 @@ EXTRA_libcoreutils_a_SOURCES += userspec.c ## end gnulib module userspec -## begin gnulib module utime - - -EXTRA_DIST += utime.c - -EXTRA_libcoreutils_a_SOURCES += utime.c - -## end gnulib module utime - ## begin gnulib module utimecmp @@ -2051,7 +3244,7 @@ EXTRA_libcoreutils_a_SOURCES += utimens.c ## begin gnulib module vasnprintf -EXTRA_DIST += asnprintf.c printf-args.c printf-args.h printf-parse.c printf-parse.h vasnprintf.c vasnprintf.h +EXTRA_DIST += asnprintf.c float+.h printf-args.c printf-args.h printf-parse.c printf-parse.h vasnprintf.c vasnprintf.h EXTRA_libcoreutils_a_SOURCES += asnprintf.c printf-args.c printf-parse.c vasnprintf.c @@ -2060,18 +3253,31 @@ EXTRA_libcoreutils_a_SOURCES += asnprintf.c printf-args.c printf-parse.c vasnpri ## begin gnulib module vasprintf -EXTRA_DIST += asprintf.c vasprintf.c vasprintf.h +EXTRA_DIST += asprintf.c vasprintf.c EXTRA_libcoreutils_a_SOURCES += asprintf.c vasprintf.c ## end gnulib module vasprintf +## begin gnulib module vc-list-files + + +EXTRA_DIST += $(top_srcdir)/build-aux/vc-list-files + +## end gnulib module vc-list-files + ## begin gnulib module verify libcoreutils_a_SOURCES += verify.h ## end gnulib module verify +## begin gnulib module verror + +libcoreutils_a_SOURCES += verror.h verror.c + +## end gnulib module verror + ## begin gnulib module version-etc libcoreutils_a_SOURCES += version-etc.h version-etc.c @@ -2084,53 +3290,143 @@ libcoreutils_a_SOURCES += version-etc-fsf.c ## end gnulib module version-etc-fsf +## begin gnulib module vfprintf-posix + + +EXTRA_DIST += vfprintf.c + +EXTRA_libcoreutils_a_SOURCES += vfprintf.c + +## end gnulib module vfprintf-posix + +## begin gnulib module vprintf-posix + + +EXTRA_DIST += vprintf.c + +EXTRA_libcoreutils_a_SOURCES += vprintf.c + +## end gnulib module vprintf-posix + ## begin gnulib module wchar BUILT_SOURCES += $(WCHAR_H) # We need the following in order to create when the system # version does not work standalone. -wchar.h: wchar_.h +wchar.h: wchar.in.h rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ - sed -e 's|@''ABSOLUTE_WCHAR_H''@|$(ABSOLUTE_WCHAR_H)|g' \ - < $(srcdir)/wchar_.h; \ + sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''NEXT_WCHAR_H''@|$(NEXT_WCHAR_H)|g' \ + -e 's|@''HAVE_WCHAR_H''@|$(HAVE_WCHAR_H)|g' \ + -e 's|@''GNULIB_BTOWC''@|$(GNULIB_BTOWC)|g' \ + -e 's|@''GNULIB_WCTOB''@|$(GNULIB_WCTOB)|g' \ + -e 's|@''GNULIB_MBSINIT''@|$(GNULIB_MBSINIT)|g' \ + -e 's|@''GNULIB_MBRTOWC''@|$(GNULIB_MBRTOWC)|g' \ + -e 's|@''GNULIB_MBRLEN''@|$(GNULIB_MBRLEN)|g' \ + -e 's|@''GNULIB_MBSRTOWCS''@|$(GNULIB_MBSRTOWCS)|g' \ + -e 's|@''GNULIB_MBSNRTOWCS''@|$(GNULIB_MBSNRTOWCS)|g' \ + -e 's|@''GNULIB_WCRTOMB''@|$(GNULIB_WCRTOMB)|g' \ + -e 's|@''GNULIB_WCSRTOMBS''@|$(GNULIB_WCSRTOMBS)|g' \ + -e 's|@''GNULIB_WCSNRTOMBS''@|$(GNULIB_WCSNRTOMBS)|g' \ + -e 's|@''GNULIB_WCWIDTH''@|$(GNULIB_WCWIDTH)|g' \ + -e 's|@''HAVE_WINT_T''@|$(HAVE_WINT_T)|g' \ + -e 's|@''HAVE_BTOWC''@|$(HAVE_BTOWC)|g' \ + -e 's|@''HAVE_MBSINIT''@|$(HAVE_MBSINIT)|g' \ + -e 's|@''HAVE_MBRTOWC''@|$(HAVE_MBRTOWC)|g' \ + -e 's|@''HAVE_MBRLEN''@|$(HAVE_MBRLEN)|g' \ + -e 's|@''HAVE_MBSRTOWCS''@|$(HAVE_MBSRTOWCS)|g' \ + -e 's|@''HAVE_MBSNRTOWCS''@|$(HAVE_MBSNRTOWCS)|g' \ + -e 's|@''HAVE_WCRTOMB''@|$(HAVE_WCRTOMB)|g' \ + -e 's|@''HAVE_WCSRTOMBS''@|$(HAVE_WCSRTOMBS)|g' \ + -e 's|@''HAVE_WCSNRTOMBS''@|$(HAVE_WCSNRTOMBS)|g' \ + -e 's|@''HAVE_DECL_WCTOB''@|$(HAVE_DECL_WCTOB)|g' \ + -e 's|@''HAVE_DECL_WCWIDTH''@|$(HAVE_DECL_WCWIDTH)|g' \ + -e 's|@''REPLACE_MBSTATE_T''@|$(REPLACE_MBSTATE_T)|g' \ + -e 's|@''REPLACE_BTOWC''@|$(REPLACE_BTOWC)|g' \ + -e 's|@''REPLACE_WCTOB''@|$(REPLACE_WCTOB)|g' \ + -e 's|@''REPLACE_MBSINIT''@|$(REPLACE_MBSINIT)|g' \ + -e 's|@''REPLACE_MBRTOWC''@|$(REPLACE_MBRTOWC)|g' \ + -e 's|@''REPLACE_MBRLEN''@|$(REPLACE_MBRLEN)|g' \ + -e 's|@''REPLACE_MBSRTOWCS''@|$(REPLACE_MBSRTOWCS)|g' \ + -e 's|@''REPLACE_MBSNRTOWCS''@|$(REPLACE_MBSNRTOWCS)|g' \ + -e 's|@''REPLACE_WCRTOMB''@|$(REPLACE_WCRTOMB)|g' \ + -e 's|@''REPLACE_WCSRTOMBS''@|$(REPLACE_WCSRTOMBS)|g' \ + -e 's|@''REPLACE_WCSNRTOMBS''@|$(REPLACE_WCSNRTOMBS)|g' \ + -e 's|@''REPLACE_WCWIDTH''@|$(REPLACE_WCWIDTH)|g' \ + -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ + < $(srcdir)/wchar.in.h; \ } > $@-t mv $@-t $@ MOSTLYCLEANFILES += wchar.h wchar.h-t -EXTRA_DIST += wchar_.h +EXTRA_DIST += wchar.in.h ## end gnulib module wchar +## begin gnulib module wcrtomb + + +EXTRA_DIST += wcrtomb.c + +EXTRA_libcoreutils_a_SOURCES += wcrtomb.c + +## end gnulib module wcrtomb + ## begin gnulib module wctype BUILT_SOURCES += $(WCTYPE_H) # We need the following in order to create when the system # doesn't have one that works with the given compiler. -wctype.h: wctype_.h +wctype.h: wctype.in.h rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ sed -e 's/@''HAVE_WCTYPE_H''@/$(HAVE_WCTYPE_H)/g' \ - -e 's|@''ABSOLUTE_WCTYPE_H''@|$(ABSOLUTE_WCTYPE_H)|g' \ - -e 's/@''HAVE_WCTYPE_CTMP_BUG''@/$(HAVE_WCTYPE_CTMP_BUG)/g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''NEXT_WCTYPE_H''@|$(NEXT_WCTYPE_H)|g' \ + -e 's/@''HAVE_ISWCNTRL''@/$(HAVE_ISWCNTRL)/g' \ -e 's/@''HAVE_WINT_T''@/$(HAVE_WINT_T)/g' \ - < $(srcdir)/wctype_.h; \ + -e 's/@''REPLACE_ISWCNTRL''@/$(REPLACE_ISWCNTRL)/g' \ + < $(srcdir)/wctype.in.h; \ } > $@-t mv $@-t $@ MOSTLYCLEANFILES += wctype.h wctype.h-t -EXTRA_DIST += wctype_.h +EXTRA_DIST += wctype.in.h ## end gnulib module wctype ## begin gnulib module wcwidth -libcoreutils_a_SOURCES += wcwidth.h + +EXTRA_DIST += wcwidth.c + +EXTRA_libcoreutils_a_SOURCES += wcwidth.c ## end gnulib module wcwidth +## begin gnulib module write + + +EXTRA_DIST += write.c + +EXTRA_libcoreutils_a_SOURCES += write.c + +## end gnulib module write + +## begin gnulib module write-any-file + + +EXTRA_DIST += write-any-file.c write-any-file.h + +EXTRA_libcoreutils_a_SOURCES += write-any-file.c + +## end gnulib module write-any-file + ## begin gnulib module xalloc @@ -2146,6 +3442,12 @@ libcoreutils_a_SOURCES += xalloc-die.c ## end gnulib module xalloc-die +## begin gnulib module xfreopen + +libcoreutils_a_SOURCES += xfreopen.c xfreopen.h + +## end gnulib module xfreopen + ## begin gnulib module xgetcwd @@ -2176,21 +3478,23 @@ EXTRA_libcoreutils_a_SOURCES += xnanosleep.c ## end gnulib module xnanosleep -## begin gnulib module xreadlink +## begin gnulib module xprintf -libcoreutils_a_SOURCES += xreadlink.c +libcoreutils_a_SOURCES += xprintf.h xprintf.c -EXTRA_DIST += xreadlink.h +## end gnulib module xprintf -## end gnulib module xreadlink +## begin gnulib module xsize -## begin gnulib module xreadlink-with-size +libcoreutils_a_SOURCES += xsize.h -libcoreutils_a_SOURCES += xreadlink-with-size.c +## end gnulib module xsize -EXTRA_DIST += xreadlink.h +## begin gnulib module xstriconv -## end gnulib module xreadlink-with-size +libcoreutils_a_SOURCES += xstriconv.h xstriconv.c + +## end gnulib module xstriconv ## begin gnulib module xstrndup @@ -2216,9 +3520,9 @@ libcoreutils_a_SOURCES += xstrtoimax.c ## begin gnulib module xstrtol -EXTRA_DIST += xstrtol.c xstrtol.h xstrtoul.c +EXTRA_DIST += xstrtol-error.c xstrtol.c xstrtol.h xstrtoul.c -EXTRA_libcoreutils_a_SOURCES += xstrtol.c xstrtoul.c +EXTRA_libcoreutils_a_SOURCES += xstrtol-error.c xstrtol.c xstrtoul.c ## end gnulib module xstrtol @@ -2237,6 +3541,14 @@ libcoreutils_a_SOURCES += xstrtoumax.c ## end gnulib module xstrtoumax +## begin gnulib module xvasprintf + +libcoreutils_a_SOURCES += xvasprintf.h xvasprintf.c xasprintf.c + +EXTRA_DIST += xalloc.h + +## end gnulib module xvasprintf + ## begin gnulib module yesno @@ -2252,4 +3564,5 @@ mostlyclean-local: mostlyclean-generic if test -n "$$dir" && test -d $$dir; then \ echo "rmdir $$dir"; rmdir $$dir; \ fi; \ - done + done; \ + : diff --git a/src/bin/coreutils/lib/group-member.c b/src/bin/coreutils/lib/group-member.c index 018702655e..a34efc04af 100644 --- a/src/bin/coreutils/lib/group-member.c +++ b/src/bin/coreutils/lib/group-member.c @@ -3,10 +3,10 @@ Copyright (C) 1994, 1997, 1998, 2003, 2005, 2006 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ #include diff --git a/src/bin/coreutils/lib/group-member.h b/src/bin/coreutils/lib/group-member.h index 30f85e9b35..5c87f7dc4a 100644 --- a/src/bin/coreutils/lib/group-member.h +++ b/src/bin/coreutils/lib/group-member.h @@ -2,10 +2,10 @@ Copyright (C) 1994, 1997, 2003 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ #ifndef GROUP_MEMBER_H_ # define GROUP_MEMBER_H_ 1 diff --git a/src/bin/coreutils/lib/hard-locale.c b/src/bin/coreutils/lib/hard-locale.c index dd2ba48439..25e66bce3a 100644 --- a/src/bin/coreutils/lib/hard-locale.c +++ b/src/bin/coreutils/lib/hard-locale.c @@ -3,10 +3,10 @@ Copyright (C) 1997, 1998, 1999, 2002, 2003, 2004, 2006, 2007 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ #include diff --git a/src/bin/coreutils/lib/hard-locale.h b/src/bin/coreutils/lib/hard-locale.h index c5cedc0259..816c31012a 100644 --- a/src/bin/coreutils/lib/hard-locale.h +++ b/src/bin/coreutils/lib/hard-locale.h @@ -2,10 +2,10 @@ Copyright (C) 1999, 2003, 2004 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ #ifndef HARD_LOCALE_H_ # define HARD_LOCALE_H_ 1 diff --git a/src/bin/coreutils/lib/hash-pjw.c b/src/bin/coreutils/lib/hash-pjw.c index bd94036c4c..42164f61d5 100644 --- a/src/bin/coreutils/lib/hash-pjw.c +++ b/src/bin/coreutils/lib/hash-pjw.c @@ -2,10 +2,10 @@ Copyright (C) 2001, 2003, 2006 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ #include diff --git a/src/bin/coreutils/lib/hash-pjw.h b/src/bin/coreutils/lib/hash-pjw.h index 44b5440ac2..1fddb202ff 100644 --- a/src/bin/coreutils/lib/hash-pjw.h +++ b/src/bin/coreutils/lib/hash-pjw.h @@ -1,10 +1,10 @@ /* hash-pjw.h -- declaration for a simple hash function Copyright (C) 2001, 2003 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,9 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. - If not, write to the Free Software Foundation, - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ #include diff --git a/src/bin/coreutils/lib/hash-triple.c b/src/bin/coreutils/lib/hash-triple.c new file mode 100644 index 0000000000..ef8e13848f --- /dev/null +++ b/src/bin/coreutils/lib/hash-triple.c @@ -0,0 +1,77 @@ +/* Hash functions for file-related triples: name, device, inode. + Copyright (C) 2007 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* written by Jim Meyering */ + +#include + +#include "hash-triple.h" + +#include +#include + +#include "hash-pjw.h" +#include "same.h" +#include "same-inode.h" + +#define STREQ(a, b) (strcmp ((a), (b)) == 0) + +/* Hash an F_triple, and *do* consider the file name. */ +size_t +triple_hash (void const *x, size_t table_size) +{ + struct F_triple const *p = x; + size_t tmp = hash_pjw (p->name, table_size); + + /* Ignoring the device number here should be fine. */ + return (tmp ^ p->st_ino) % table_size; +} + +/* Hash an F_triple, without considering the file name. */ +size_t +triple_hash_no_name (void const *x, size_t table_size) +{ + struct F_triple const *p = x; + + /* Ignoring the device number here should be fine. */ + return p->st_ino % table_size; +} + +/* Compare two F_triple structs. */ +bool +triple_compare (void const *x, void const *y) +{ + struct F_triple const *a = x; + struct F_triple const *b = y; + return (SAME_INODE (*a, *b) && same_name (a->name, b->name)) ? true : false; +} + +bool +triple_compare_ino_str (void const *x, void const *y) +{ + struct F_triple const *a = x; + struct F_triple const *b = y; + return (SAME_INODE (*a, *b) && STREQ (a->name, b->name)) ? true : false; +} + +/* Free an F_triple. */ +void +triple_free (void *x) +{ + struct F_triple *a = x; + free (a->name); + free (a); +} diff --git a/src/bin/coreutils/lib/hash-triple.h b/src/bin/coreutils/lib/hash-triple.h new file mode 100644 index 0000000000..51863c9dff --- /dev/null +++ b/src/bin/coreutils/lib/hash-triple.h @@ -0,0 +1,22 @@ +#ifndef HASH_TRIPLE_H +#define HASH_TRIPLE_H + +#include +#include +#include + +/* Describe a just-created or just-renamed destination file. */ +struct F_triple +{ + char *name; + ino_t st_ino; + dev_t st_dev; +}; + +extern size_t triple_hash (void const *x, size_t table_size); +extern size_t triple_hash_no_name (void const *x, size_t table_size); +extern bool triple_compare (void const *x, void const *y); +extern bool triple_compare_ino_str (void const *x, void const *y); +extern void triple_free (void *x); + +#endif diff --git a/src/bin/coreutils/lib/hash.c b/src/bin/coreutils/lib/hash.c index f4ab12f487..7d76d45f71 100644 --- a/src/bin/coreutils/lib/hash.c +++ b/src/bin/coreutils/lib/hash.c @@ -1,14 +1,14 @@ /* hash - hashing table processing. - Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2006 Free + Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2006, 2007 Free Software Foundation, Inc. Written by Jim Meyering, 1992. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -16,8 +16,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* A generic hash table package. */ @@ -576,6 +575,8 @@ hash_initialize (size_t candidate, const Hash_tuning *tuning, goto fail; table->bucket = calloc (table->n_buckets, sizeof *table->bucket); + if (table->bucket == NULL) + goto fail; table->bucket_limit = table->bucket + table->n_buckets; table->n_buckets_used = 0; table->n_entries = 0; diff --git a/src/bin/coreutils/lib/hash.h b/src/bin/coreutils/lib/hash.h index ab63a863fd..fc1af28a97 100644 --- a/src/bin/coreutils/lib/hash.h +++ b/src/bin/coreutils/lib/hash.h @@ -2,10 +2,10 @@ Copyright (C) 1998, 1999, 2001, 2003 Free Software Foundation, Inc. Written by Jim Meyering , 1998. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* A generic hash table package. */ diff --git a/src/bin/coreutils/lib/human.c b/src/bin/coreutils/lib/human.c index ecf4c97ce5..c7291b7324 100644 --- a/src/bin/coreutils/lib/human.c +++ b/src/bin/coreutils/lib/human.c @@ -1,12 +1,12 @@ /* human.c -- print human readable file size Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, - 2005, 2006 Free Software Foundation, Inc. + 2005, 2006, 2007 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Paul Eggert and Larry McVoy. */ @@ -28,13 +27,9 @@ #include #include -#include "gettext.h" -#define _(msgid) gettext (msgid) - #include #include #include -#include /* The maximum length of a suffix like "KiB". */ #define HUMAN_READABLE_SUFFIX_LENGTH_MAX 3 @@ -463,17 +458,14 @@ humblock (char const *spec, uintmax_t *block_size, int *options) return LONGINT_OK; } -int -human_options (char const *spec, bool report_errors, uintmax_t *block_size) +enum strtol_error +human_options (char const *spec, int *opts, uintmax_t *block_size) { - int opts; - strtol_error e = humblock (spec, block_size, &opts); + strtol_error e = humblock (spec, block_size, opts); if (*block_size == 0) { *block_size = default_block_size (); e = LONGINT_INVALID; } - if (e != LONGINT_OK && report_errors) - STRTOL_FATAL_ERROR (spec, _("block size"), e); - return opts; + return e; } diff --git a/src/bin/coreutils/lib/human.h b/src/bin/coreutils/lib/human.h index 44b8b36d57..11b1e0cee4 100644 --- a/src/bin/coreutils/lib/human.h +++ b/src/bin/coreutils/lib/human.h @@ -1,12 +1,12 @@ /* human.h -- print human readable file size Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, - 2005, 2006 Free Software Foundation, Inc. + 2005, 2006, 2007 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Paul Eggert and Larry McVoy. */ @@ -27,6 +26,8 @@ # include # include +# include + /* A conservative bound on the maximum length of a human-readable string. The output can be the square of the largest uintmax_t, so double its size before converting to a bound. @@ -78,6 +79,6 @@ enum char *human_readable (uintmax_t, char *, int, uintmax_t, uintmax_t); -int human_options (char const *, bool, uintmax_t *); +enum strtol_error human_options (char const *, int *, uintmax_t *); #endif /* HUMAN_H_ */ diff --git a/src/bin/coreutils/lib/i-ring.c b/src/bin/coreutils/lib/i-ring.c index 457b8381f9..aee1fb3d28 100644 --- a/src/bin/coreutils/lib/i-ring.c +++ b/src/bin/coreutils/lib/i-ring.c @@ -1,10 +1,10 @@ /* a simple ring buffer Copyright (C) 2006 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* written by Jim Meyering */ diff --git a/src/bin/coreutils/lib/i-ring.h b/src/bin/coreutils/lib/i-ring.h index fadfa2b78b..21bd249445 100644 --- a/src/bin/coreutils/lib/i-ring.h +++ b/src/bin/coreutils/lib/i-ring.h @@ -1,10 +1,10 @@ /* definitions for a simple ring buffer Copyright (C) 2006 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ #include #include "verify.h" diff --git a/src/bin/coreutils/lib/iconv.in.h b/src/bin/coreutils/lib/iconv.in.h new file mode 100644 index 0000000000..f2477858c5 --- /dev/null +++ b/src/bin/coreutils/lib/iconv.in.h @@ -0,0 +1,74 @@ +/* -*- buffer-read-only: t -*- vi: set ro: */ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 +/* A GNU-like . + + Copyright (C) 2007-2008 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + +#ifndef _GL_ICONV_H + +#if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +#endif + +/* The include_next requires a split double-inclusion guard. */ +#@INCLUDE_NEXT@ @NEXT_ICONV_H@ + +#ifndef _GL_ICONV_H +#define _GL_ICONV_H + +#ifdef __cplusplus +extern "C" { +#endif + + +#if @REPLACE_ICONV_OPEN@ +/* An iconv_open wrapper that supports the IANA standardized encoding names + ("ISO-8859-1" etc.) as far as possible. */ +# define iconv_open rpl_iconv_open +extern iconv_t iconv_open (const char *tocode, const char *fromcode); +#endif + +#if @REPLACE_ICONV_UTF@ +/* Special constants for supporting UTF-{16,32}{BE,LE} encodings. + Not public. */ +# define _ICONV_UTF8_UTF16BE (iconv_t)(-161) +# define _ICONV_UTF8_UTF16LE (iconv_t)(-162) +# define _ICONV_UTF8_UTF32BE (iconv_t)(-163) +# define _ICONV_UTF8_UTF32LE (iconv_t)(-164) +# define _ICONV_UTF16BE_UTF8 (iconv_t)(-165) +# define _ICONV_UTF16LE_UTF8 (iconv_t)(-166) +# define _ICONV_UTF32BE_UTF8 (iconv_t)(-167) +# define _ICONV_UTF32LE_UTF8 (iconv_t)(-168) +#endif + +#if @REPLACE_ICONV@ +# define iconv rpl_iconv +extern size_t iconv (iconv_t cd, + @ICONV_CONST@ char **inbuf, size_t *inbytesleft, + char **outbuf, size_t *outbytesleft); +# define iconv_close rpl_iconv_close +extern int iconv_close (iconv_t cd); +#endif + + +#ifdef __cplusplus +} +#endif + +#endif /* _GL_ICONV_H */ +#endif /* _GL_ICONV_H */ diff --git a/src/bin/coreutils/lib/iconv_open-aix.gperf b/src/bin/coreutils/lib/iconv_open-aix.gperf new file mode 100644 index 0000000000..6782b9956c --- /dev/null +++ b/src/bin/coreutils/lib/iconv_open-aix.gperf @@ -0,0 +1,44 @@ +struct mapping { int standard_name; const char vendor_name[10 + 1]; }; +%struct-type +%language=ANSI-C +%define slot-name standard_name +%define hash-function-name mapping_hash +%define lookup-function-name mapping_lookup +%readonly-tables +%global-table +%define word-array-name mappings +%pic +%% +# On AIX 5.1, look in /usr/lib/nls/loc/uconvTable. +ISO-8859-1, "ISO8859-1" +ISO-8859-2, "ISO8859-2" +ISO-8859-3, "ISO8859-3" +ISO-8859-4, "ISO8859-4" +ISO-8859-5, "ISO8859-5" +ISO-8859-6, "ISO8859-6" +ISO-8859-7, "ISO8859-7" +ISO-8859-8, "ISO8859-8" +ISO-8859-9, "ISO8859-9" +ISO-8859-15, "ISO8859-15" +CP437, "IBM-437" +CP850, "IBM-850" +CP852, "IBM-852" +CP856, "IBM-856" +CP857, "IBM-857" +CP861, "IBM-861" +CP865, "IBM-865" +CP869, "IBM-869" +ISO-8859-13, "IBM-921" +CP922, "IBM-922" +CP932, "IBM-932" +CP943, "IBM-943" +CP1046, "IBM-1046" +CP1124, "IBM-1124" +CP1125, "IBM-1125" +CP1129, "IBM-1129" +CP1252, "IBM-1252" +GB2312, "IBM-eucCN" +EUC-JP, "IBM-eucJP" +EUC-KR, "IBM-eucKR" +EUC-TW, "IBM-eucTW" +BIG5, "big5" diff --git a/src/bin/coreutils/lib/iconv_open-aix.h b/src/bin/coreutils/lib/iconv_open-aix.h new file mode 100644 index 0000000000..129e03084b --- /dev/null +++ b/src/bin/coreutils/lib/iconv_open-aix.h @@ -0,0 +1,256 @@ +/* ANSI-C code produced by gperf version 3.0.4 */ +/* Command-line: gperf -m 10 ./iconv_open-aix.gperf */ +/* Computed positions: -k'4,$' */ + +#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \ + && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \ + && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \ + && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \ + && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \ + && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \ + && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \ + && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \ + && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \ + && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \ + && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \ + && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \ + && ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \ + && ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \ + && ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \ + && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \ + && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \ + && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \ + && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \ + && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \ + && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \ + && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \ + && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126)) +/* The character set is not based on ISO-646. */ +#error "gperf generated tables don't work with this execution character set. Please report a bug to ." +#endif + +#line 1 "./iconv_open-aix.gperf" +struct mapping { int standard_name; const char vendor_name[10 + 1]; }; + +#define TOTAL_KEYWORDS 32 +#define MIN_WORD_LENGTH 4 +#define MAX_WORD_LENGTH 11 +#define MIN_HASH_VALUE 6 +#define MAX_HASH_VALUE 44 +/* maximum key range = 39, duplicates = 0 */ + +#ifdef __GNUC__ +__inline +#else +#ifdef __cplusplus +inline +#endif +#endif +static unsigned int +mapping_hash (register const char *str, register unsigned int len) +{ + static const unsigned char asso_values[] = + { + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 0, 4, 25, + 0, 11, 24, 9, 17, 3, 14, 21, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 3, 45, 1, 45, 45, 45, 45, 0, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45 + }; + return len + asso_values[(unsigned char)str[3]+2] + asso_values[(unsigned char)str[len - 1]]; +} + +struct stringpool_t + { + char stringpool_str6[sizeof("EUC-TW")]; + char stringpool_str7[sizeof("EUC-KR")]; + char stringpool_str8[sizeof("CP852")]; + char stringpool_str9[sizeof("EUC-JP")]; + char stringpool_str10[sizeof("ISO-8859-2")]; + char stringpool_str11[sizeof("CP857")]; + char stringpool_str12[sizeof("CP850")]; + char stringpool_str13[sizeof("ISO-8859-7")]; + char stringpool_str14[sizeof("CP932")]; + char stringpool_str15[sizeof("GB2312")]; + char stringpool_str16[sizeof("BIG5")]; + char stringpool_str17[sizeof("CP437")]; + char stringpool_str19[sizeof("ISO-8859-5")]; + char stringpool_str20[sizeof("ISO-8859-15")]; + char stringpool_str21[sizeof("ISO-8859-3")]; + char stringpool_str22[sizeof("ISO-8859-13")]; + char stringpool_str23[sizeof("CP1046")]; + char stringpool_str24[sizeof("ISO-8859-8")]; + char stringpool_str25[sizeof("CP856")]; + char stringpool_str26[sizeof("CP1125")]; + char stringpool_str27[sizeof("ISO-8859-6")]; + char stringpool_str28[sizeof("CP865")]; + char stringpool_str29[sizeof("CP922")]; + char stringpool_str30[sizeof("CP1252")]; + char stringpool_str31[sizeof("ISO-8859-9")]; + char stringpool_str33[sizeof("CP943")]; + char stringpool_str34[sizeof("ISO-8859-4")]; + char stringpool_str35[sizeof("ISO-8859-1")]; + char stringpool_str38[sizeof("CP1129")]; + char stringpool_str40[sizeof("CP869")]; + char stringpool_str41[sizeof("CP1124")]; + char stringpool_str44[sizeof("CP861")]; + }; +static const struct stringpool_t stringpool_contents = + { + "EUC-TW", + "EUC-KR", + "CP852", + "EUC-JP", + "ISO-8859-2", + "CP857", + "CP850", + "ISO-8859-7", + "CP932", + "GB2312", + "BIG5", + "CP437", + "ISO-8859-5", + "ISO-8859-15", + "ISO-8859-3", + "ISO-8859-13", + "CP1046", + "ISO-8859-8", + "CP856", + "CP1125", + "ISO-8859-6", + "CP865", + "CP922", + "CP1252", + "ISO-8859-9", + "CP943", + "ISO-8859-4", + "ISO-8859-1", + "CP1129", + "CP869", + "CP1124", + "CP861" + }; +#define stringpool ((const char *) &stringpool_contents) + +static const struct mapping mappings[] = + { + {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, +#line 43 "./iconv_open-aix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str6, "IBM-eucTW"}, +#line 42 "./iconv_open-aix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str7, "IBM-eucKR"}, +#line 25 "./iconv_open-aix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str8, "IBM-852"}, +#line 41 "./iconv_open-aix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str9, "IBM-eucJP"}, +#line 14 "./iconv_open-aix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str10, "ISO8859-2"}, +#line 27 "./iconv_open-aix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str11, "IBM-857"}, +#line 24 "./iconv_open-aix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str12, "IBM-850"}, +#line 19 "./iconv_open-aix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str13, "ISO8859-7"}, +#line 33 "./iconv_open-aix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str14, "IBM-932"}, +#line 40 "./iconv_open-aix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str15, "IBM-eucCN"}, +#line 44 "./iconv_open-aix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str16, "big5"}, +#line 23 "./iconv_open-aix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str17, "IBM-437"}, + {-1}, +#line 17 "./iconv_open-aix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str19, "ISO8859-5"}, +#line 22 "./iconv_open-aix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str20, "ISO8859-15"}, +#line 15 "./iconv_open-aix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str21, "ISO8859-3"}, +#line 31 "./iconv_open-aix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str22, "IBM-921"}, +#line 35 "./iconv_open-aix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str23, "IBM-1046"}, +#line 20 "./iconv_open-aix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str24, "ISO8859-8"}, +#line 26 "./iconv_open-aix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str25, "IBM-856"}, +#line 37 "./iconv_open-aix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str26, "IBM-1125"}, +#line 18 "./iconv_open-aix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str27, "ISO8859-6"}, +#line 29 "./iconv_open-aix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str28, "IBM-865"}, +#line 32 "./iconv_open-aix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str29, "IBM-922"}, +#line 39 "./iconv_open-aix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str30, "IBM-1252"}, +#line 21 "./iconv_open-aix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str31, "ISO8859-9"}, + {-1}, +#line 34 "./iconv_open-aix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str33, "IBM-943"}, +#line 16 "./iconv_open-aix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str34, "ISO8859-4"}, +#line 13 "./iconv_open-aix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str35, "ISO8859-1"}, + {-1}, {-1}, +#line 38 "./iconv_open-aix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str38, "IBM-1129"}, + {-1}, +#line 30 "./iconv_open-aix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str40, "IBM-869"}, +#line 36 "./iconv_open-aix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str41, "IBM-1124"}, + {-1}, {-1}, +#line 28 "./iconv_open-aix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str44, "IBM-861"} + }; + +#ifdef __GNUC__ +__inline +#if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__ +__attribute__ ((__gnu_inline__)) +#endif +#endif +const struct mapping * +mapping_lookup (register const char *str, register unsigned int len) +{ + if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) + { + register int key = mapping_hash (str, len); + + if (key <= MAX_HASH_VALUE && key >= 0) + { + register int o = mappings[key].standard_name; + if (o >= 0) + { + register const char *s = o + stringpool; + + if (*str == *s && !strcmp (str + 1, s + 1)) + return &mappings[key]; + } + } + } + return 0; +} diff --git a/src/bin/coreutils/lib/iconv_open-hpux.gperf b/src/bin/coreutils/lib/iconv_open-hpux.gperf new file mode 100644 index 0000000000..5a35c83e1e --- /dev/null +++ b/src/bin/coreutils/lib/iconv_open-hpux.gperf @@ -0,0 +1,56 @@ +struct mapping { int standard_name; const char vendor_name[9 + 1]; }; +%struct-type +%language=ANSI-C +%define slot-name standard_name +%define hash-function-name mapping_hash +%define lookup-function-name mapping_lookup +%readonly-tables +%global-table +%define word-array-name mappings +%pic +%% +# On HP-UX 11.11, look in /usr/lib/nls/iconv. +ISO-8859-1, "iso88591" +ISO-8859-2, "iso88592" +ISO-8859-5, "iso88595" +ISO-8859-6, "iso88596" +ISO-8859-7, "iso88597" +ISO-8859-8, "iso88598" +ISO-8859-9, "iso88599" +ISO-8859-15, "iso885915" +CP437, "cp437" +CP775, "cp775" +CP850, "cp850" +CP852, "cp852" +CP855, "cp855" +CP857, "cp857" +CP861, "cp861" +CP862, "cp862" +CP864, "cp864" +CP865, "cp865" +CP866, "cp866" +CP869, "cp869" +CP874, "cp874" +CP1250, "cp1250" +CP1251, "cp1251" +CP1252, "cp1252" +CP1253, "cp1253" +CP1254, "cp1254" +CP1255, "cp1255" +CP1256, "cp1256" +CP1257, "cp1257" +CP1258, "cp1258" +HP-ROMAN8, "roman8" +HP-ARABIC8, "arabic8" +HP-GREEK8, "greek8" +HP-HEBREW8, "hebrew8" +HP-TURKISH8, "turkish8" +HP-KANA8, "kana8" +TIS-620, "tis620" +GB2312, "hp15CN" +EUC-JP, "eucJP" +EUC-KR, "eucKR" +EUC-TW, "eucTW" +BIG5, "big5" +SHIFT_JIS, "sjis" +UTF-8, "utf8" diff --git a/src/bin/coreutils/lib/iconv_open-hpux.h b/src/bin/coreutils/lib/iconv_open-hpux.h new file mode 100644 index 0000000000..3bcff76a79 --- /dev/null +++ b/src/bin/coreutils/lib/iconv_open-hpux.h @@ -0,0 +1,299 @@ +/* ANSI-C code produced by gperf version 3.0.4 */ +/* Command-line: gperf -m 10 ./iconv_open-hpux.gperf */ +/* Computed positions: -k'4,$' */ + +#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \ + && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \ + && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \ + && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \ + && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \ + && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \ + && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \ + && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \ + && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \ + && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \ + && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \ + && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \ + && ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \ + && ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \ + && ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \ + && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \ + && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \ + && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \ + && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \ + && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \ + && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \ + && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \ + && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126)) +/* The character set is not based on ISO-646. */ +#error "gperf generated tables don't work with this execution character set. Please report a bug to ." +#endif + +#line 1 "./iconv_open-hpux.gperf" +struct mapping { int standard_name; const char vendor_name[9 + 1]; }; + +#define TOTAL_KEYWORDS 44 +#define MIN_WORD_LENGTH 4 +#define MAX_WORD_LENGTH 11 +#define MIN_HASH_VALUE 6 +#define MAX_HASH_VALUE 49 +/* maximum key range = 44, duplicates = 0 */ + +#ifdef __GNUC__ +__inline +#else +#ifdef __cplusplus +inline +#endif +#endif +static unsigned int +mapping_hash (register const char *str, register unsigned int len) +{ + static const unsigned char asso_values[] = + { + 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, 1, 2, + 24, 43, 5, 10, 0, 13, 32, 3, 19, 18, + 50, 50, 50, 50, 50, 50, 50, 50, 50, 5, + 50, 50, 50, 50, 14, 5, 0, 50, 50, 0, + 27, 50, 12, 14, 50, 50, 0, 5, 2, 50, + 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, 50, 50 + }; + return len + asso_values[(unsigned char)str[3]+4] + asso_values[(unsigned char)str[len - 1]]; +} + +struct stringpool_t + { + char stringpool_str6[sizeof("CP1256")]; + char stringpool_str7[sizeof("CP1250")]; + char stringpool_str8[sizeof("CP1251")]; + char stringpool_str9[sizeof("CP850")]; + char stringpool_str10[sizeof("TIS-620")]; + char stringpool_str11[sizeof("CP1254")]; + char stringpool_str12[sizeof("ISO-8859-6")]; + char stringpool_str13[sizeof("EUC-TW")]; + char stringpool_str14[sizeof("ISO-8859-1")]; + char stringpool_str15[sizeof("ISO-8859-9")]; + char stringpool_str16[sizeof("CP1255")]; + char stringpool_str17[sizeof("BIG5")]; + char stringpool_str18[sizeof("CP855")]; + char stringpool_str19[sizeof("CP1257")]; + char stringpool_str20[sizeof("EUC-KR")]; + char stringpool_str21[sizeof("CP857")]; + char stringpool_str22[sizeof("ISO-8859-5")]; + char stringpool_str23[sizeof("ISO-8859-15")]; + char stringpool_str24[sizeof("CP866")]; + char stringpool_str25[sizeof("ISO-8859-7")]; + char stringpool_str26[sizeof("CP861")]; + char stringpool_str27[sizeof("CP869")]; + char stringpool_str28[sizeof("CP874")]; + char stringpool_str29[sizeof("CP864")]; + char stringpool_str30[sizeof("CP1252")]; + char stringpool_str31[sizeof("CP437")]; + char stringpool_str32[sizeof("CP852")]; + char stringpool_str33[sizeof("CP775")]; + char stringpool_str34[sizeof("CP865")]; + char stringpool_str35[sizeof("EUC-JP")]; + char stringpool_str36[sizeof("ISO-8859-2")]; + char stringpool_str37[sizeof("SHIFT_JIS")]; + char stringpool_str38[sizeof("CP1258")]; + char stringpool_str39[sizeof("UTF-8")]; + char stringpool_str40[sizeof("HP-KANA8")]; + char stringpool_str41[sizeof("HP-ROMAN8")]; + char stringpool_str42[sizeof("HP-HEBREW8")]; + char stringpool_str43[sizeof("GB2312")]; + char stringpool_str44[sizeof("ISO-8859-8")]; + char stringpool_str45[sizeof("HP-TURKISH8")]; + char stringpool_str46[sizeof("HP-GREEK8")]; + char stringpool_str47[sizeof("HP-ARABIC8")]; + char stringpool_str48[sizeof("CP862")]; + char stringpool_str49[sizeof("CP1253")]; + }; +static const struct stringpool_t stringpool_contents = + { + "CP1256", + "CP1250", + "CP1251", + "CP850", + "TIS-620", + "CP1254", + "ISO-8859-6", + "EUC-TW", + "ISO-8859-1", + "ISO-8859-9", + "CP1255", + "BIG5", + "CP855", + "CP1257", + "EUC-KR", + "CP857", + "ISO-8859-5", + "ISO-8859-15", + "CP866", + "ISO-8859-7", + "CP861", + "CP869", + "CP874", + "CP864", + "CP1252", + "CP437", + "CP852", + "CP775", + "CP865", + "EUC-JP", + "ISO-8859-2", + "SHIFT_JIS", + "CP1258", + "UTF-8", + "HP-KANA8", + "HP-ROMAN8", + "HP-HEBREW8", + "GB2312", + "ISO-8859-8", + "HP-TURKISH8", + "HP-GREEK8", + "HP-ARABIC8", + "CP862", + "CP1253" + }; +#define stringpool ((const char *) &stringpool_contents) + +static const struct mapping mappings[] = + { + {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, +#line 40 "./iconv_open-hpux.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str6, "cp1256"}, +#line 34 "./iconv_open-hpux.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str7, "cp1250"}, +#line 35 "./iconv_open-hpux.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str8, "cp1251"}, +#line 23 "./iconv_open-hpux.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str9, "cp850"}, +#line 49 "./iconv_open-hpux.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str10, "tis620"}, +#line 38 "./iconv_open-hpux.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str11, "cp1254"}, +#line 16 "./iconv_open-hpux.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str12, "iso88596"}, +#line 53 "./iconv_open-hpux.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str13, "eucTW"}, +#line 13 "./iconv_open-hpux.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str14, "iso88591"}, +#line 19 "./iconv_open-hpux.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str15, "iso88599"}, +#line 39 "./iconv_open-hpux.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str16, "cp1255"}, +#line 54 "./iconv_open-hpux.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str17, "big5"}, +#line 25 "./iconv_open-hpux.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str18, "cp855"}, +#line 41 "./iconv_open-hpux.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str19, "cp1257"}, +#line 52 "./iconv_open-hpux.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str20, "eucKR"}, +#line 26 "./iconv_open-hpux.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str21, "cp857"}, +#line 15 "./iconv_open-hpux.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str22, "iso88595"}, +#line 20 "./iconv_open-hpux.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str23, "iso885915"}, +#line 31 "./iconv_open-hpux.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str24, "cp866"}, +#line 17 "./iconv_open-hpux.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str25, "iso88597"}, +#line 27 "./iconv_open-hpux.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str26, "cp861"}, +#line 32 "./iconv_open-hpux.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str27, "cp869"}, +#line 33 "./iconv_open-hpux.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str28, "cp874"}, +#line 29 "./iconv_open-hpux.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str29, "cp864"}, +#line 36 "./iconv_open-hpux.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str30, "cp1252"}, +#line 21 "./iconv_open-hpux.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str31, "cp437"}, +#line 24 "./iconv_open-hpux.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str32, "cp852"}, +#line 22 "./iconv_open-hpux.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str33, "cp775"}, +#line 30 "./iconv_open-hpux.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str34, "cp865"}, +#line 51 "./iconv_open-hpux.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str35, "eucJP"}, +#line 14 "./iconv_open-hpux.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str36, "iso88592"}, +#line 55 "./iconv_open-hpux.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str37, "sjis"}, +#line 42 "./iconv_open-hpux.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str38, "cp1258"}, +#line 56 "./iconv_open-hpux.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str39, "utf8"}, +#line 48 "./iconv_open-hpux.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str40, "kana8"}, +#line 43 "./iconv_open-hpux.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str41, "roman8"}, +#line 46 "./iconv_open-hpux.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str42, "hebrew8"}, +#line 50 "./iconv_open-hpux.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str43, "hp15CN"}, +#line 18 "./iconv_open-hpux.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str44, "iso88598"}, +#line 47 "./iconv_open-hpux.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str45, "turkish8"}, +#line 45 "./iconv_open-hpux.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str46, "greek8"}, +#line 44 "./iconv_open-hpux.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str47, "arabic8"}, +#line 28 "./iconv_open-hpux.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str48, "cp862"}, +#line 37 "./iconv_open-hpux.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str49, "cp1253"} + }; + +#ifdef __GNUC__ +__inline +#if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__ +__attribute__ ((__gnu_inline__)) +#endif +#endif +const struct mapping * +mapping_lookup (register const char *str, register unsigned int len) +{ + if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) + { + register int key = mapping_hash (str, len); + + if (key <= MAX_HASH_VALUE && key >= 0) + { + register int o = mappings[key].standard_name; + if (o >= 0) + { + register const char *s = o + stringpool; + + if (*str == *s && !strcmp (str + 1, s + 1)) + return &mappings[key]; + } + } + } + return 0; +} diff --git a/src/bin/coreutils/lib/iconv_open-irix.gperf b/src/bin/coreutils/lib/iconv_open-irix.gperf new file mode 100644 index 0000000000..3672a80137 --- /dev/null +++ b/src/bin/coreutils/lib/iconv_open-irix.gperf @@ -0,0 +1,31 @@ +struct mapping { int standard_name; const char vendor_name[10 + 1]; }; +%struct-type +%language=ANSI-C +%define slot-name standard_name +%define hash-function-name mapping_hash +%define lookup-function-name mapping_lookup +%readonly-tables +%global-table +%define word-array-name mappings +%pic +%% +# On IRIX 6.5, look in /usr/lib/iconv and /usr/lib/international/encodings. +ISO-8859-1, "ISO8859-1" +ISO-8859-2, "ISO8859-2" +ISO-8859-3, "ISO8859-3" +ISO-8859-4, "ISO8859-4" +ISO-8859-5, "ISO8859-5" +ISO-8859-6, "ISO8859-6" +ISO-8859-7, "ISO8859-7" +ISO-8859-8, "ISO8859-8" +ISO-8859-9, "ISO8859-9" +ISO-8859-15, "ISO8859-15" +KOI8-R, "KOI8" +CP855, "DOS855" +CP1251, "WIN1251" +GB2312, "eucCN" +EUC-JP, "eucJP" +EUC-KR, "eucKR" +EUC-TW, "eucTW" +SHIFT_JIS, "sjis" +TIS-620, "TIS620" diff --git a/src/bin/coreutils/lib/iconv_open-irix.h b/src/bin/coreutils/lib/iconv_open-irix.h new file mode 100644 index 0000000000..74ceb8f57a --- /dev/null +++ b/src/bin/coreutils/lib/iconv_open-irix.h @@ -0,0 +1,199 @@ +/* ANSI-C code produced by gperf version 3.0.4 */ +/* Command-line: gperf -m 10 ./iconv_open-irix.gperf */ +/* Computed positions: -k'1,$' */ + +#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \ + && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \ + && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \ + && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \ + && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \ + && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \ + && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \ + && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \ + && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \ + && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \ + && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \ + && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \ + && ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \ + && ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \ + && ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \ + && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \ + && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \ + && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \ + && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \ + && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \ + && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \ + && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \ + && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126)) +/* The character set is not based on ISO-646. */ +#error "gperf generated tables don't work with this execution character set. Please report a bug to ." +#endif + +#line 1 "./iconv_open-irix.gperf" +struct mapping { int standard_name; const char vendor_name[10 + 1]; }; + +#define TOTAL_KEYWORDS 19 +#define MIN_WORD_LENGTH 5 +#define MAX_WORD_LENGTH 11 +#define MIN_HASH_VALUE 5 +#define MAX_HASH_VALUE 23 +/* maximum key range = 19, duplicates = 0 */ + +#ifdef __GNUC__ +__inline +#else +#ifdef __cplusplus +inline +#endif +#endif +static unsigned int +mapping_hash (register const char *str, register unsigned int len) +{ + static const unsigned char asso_values[] = + { + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 8, 2, + 5, 12, 11, 0, 10, 9, 8, 7, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 0, 24, 0, + 24, 5, 24, 0, 24, 7, 24, 24, 24, 24, + 7, 24, 1, 0, 8, 24, 24, 0, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24 + }; + return len + asso_values[(unsigned char)str[len - 1]] + asso_values[(unsigned char)str[0]]; +} + +struct stringpool_t + { + char stringpool_str5[sizeof("CP855")]; + char stringpool_str6[sizeof("EUC-TW")]; + char stringpool_str7[sizeof("EUC-KR")]; + char stringpool_str8[sizeof("CP1251")]; + char stringpool_str9[sizeof("SHIFT_JIS")]; + char stringpool_str10[sizeof("ISO-8859-5")]; + char stringpool_str11[sizeof("ISO-8859-15")]; + char stringpool_str12[sizeof("ISO-8859-1")]; + char stringpool_str13[sizeof("EUC-JP")]; + char stringpool_str14[sizeof("KOI8-R")]; + char stringpool_str15[sizeof("ISO-8859-2")]; + char stringpool_str16[sizeof("GB2312")]; + char stringpool_str17[sizeof("ISO-8859-9")]; + char stringpool_str18[sizeof("ISO-8859-8")]; + char stringpool_str19[sizeof("ISO-8859-7")]; + char stringpool_str20[sizeof("ISO-8859-6")]; + char stringpool_str21[sizeof("ISO-8859-4")]; + char stringpool_str22[sizeof("ISO-8859-3")]; + char stringpool_str23[sizeof("TIS-620")]; + }; +static const struct stringpool_t stringpool_contents = + { + "CP855", + "EUC-TW", + "EUC-KR", + "CP1251", + "SHIFT_JIS", + "ISO-8859-5", + "ISO-8859-15", + "ISO-8859-1", + "EUC-JP", + "KOI8-R", + "ISO-8859-2", + "GB2312", + "ISO-8859-9", + "ISO-8859-8", + "ISO-8859-7", + "ISO-8859-6", + "ISO-8859-4", + "ISO-8859-3", + "TIS-620" + }; +#define stringpool ((const char *) &stringpool_contents) + +static const struct mapping mappings[] = + { + {-1}, {-1}, {-1}, {-1}, {-1}, +#line 24 "./iconv_open-irix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str5, "DOS855"}, +#line 29 "./iconv_open-irix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str6, "eucTW"}, +#line 28 "./iconv_open-irix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str7, "eucKR"}, +#line 25 "./iconv_open-irix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str8, "WIN1251"}, +#line 30 "./iconv_open-irix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str9, "sjis"}, +#line 17 "./iconv_open-irix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str10, "ISO8859-5"}, +#line 22 "./iconv_open-irix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str11, "ISO8859-15"}, +#line 13 "./iconv_open-irix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str12, "ISO8859-1"}, +#line 27 "./iconv_open-irix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str13, "eucJP"}, +#line 23 "./iconv_open-irix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str14, "KOI8"}, +#line 14 "./iconv_open-irix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str15, "ISO8859-2"}, +#line 26 "./iconv_open-irix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str16, "eucCN"}, +#line 21 "./iconv_open-irix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str17, "ISO8859-9"}, +#line 20 "./iconv_open-irix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str18, "ISO8859-8"}, +#line 19 "./iconv_open-irix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str19, "ISO8859-7"}, +#line 18 "./iconv_open-irix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str20, "ISO8859-6"}, +#line 16 "./iconv_open-irix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str21, "ISO8859-4"}, +#line 15 "./iconv_open-irix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str22, "ISO8859-3"}, +#line 31 "./iconv_open-irix.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str23, "TIS620"} + }; + +#ifdef __GNUC__ +__inline +#if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__ +__attribute__ ((__gnu_inline__)) +#endif +#endif +const struct mapping * +mapping_lookup (register const char *str, register unsigned int len) +{ + if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) + { + register int key = mapping_hash (str, len); + + if (key <= MAX_HASH_VALUE && key >= 0) + { + register int o = mappings[key].standard_name; + if (o >= 0) + { + register const char *s = o + stringpool; + + if (*str == *s && !strcmp (str + 1, s + 1)) + return &mappings[key]; + } + } + } + return 0; +} diff --git a/src/bin/coreutils/lib/iconv_open-osf.gperf b/src/bin/coreutils/lib/iconv_open-osf.gperf new file mode 100644 index 0000000000..f468ff6093 --- /dev/null +++ b/src/bin/coreutils/lib/iconv_open-osf.gperf @@ -0,0 +1,50 @@ +struct mapping { int standard_name; const char vendor_name[10 + 1]; }; +%struct-type +%language=ANSI-C +%define slot-name standard_name +%define hash-function-name mapping_hash +%define lookup-function-name mapping_lookup +%readonly-tables +%global-table +%define word-array-name mappings +%pic +%% +# On OSF/1 5.1, look in /usr/lib/nls/loc/iconv. +ISO-8859-1, "ISO8859-1" +ISO-8859-2, "ISO8859-2" +ISO-8859-3, "ISO8859-3" +ISO-8859-4, "ISO8859-4" +ISO-8859-5, "ISO8859-5" +ISO-8859-6, "ISO8859-6" +ISO-8859-7, "ISO8859-7" +ISO-8859-8, "ISO8859-8" +ISO-8859-9, "ISO8859-9" +ISO-8859-15, "ISO8859-15" +CP437, "cp437" +CP775, "cp775" +CP850, "cp850" +CP852, "cp852" +CP855, "cp855" +CP857, "cp857" +CP861, "cp861" +CP862, "cp862" +CP865, "cp865" +CP866, "cp866" +CP869, "cp869" +CP874, "cp874" +CP949, "KSC5601" +CP1250, "cp1250" +CP1251, "cp1251" +CP1252, "cp1252" +CP1253, "cp1253" +CP1254, "cp1254" +CP1255, "cp1255" +CP1256, "cp1256" +CP1257, "cp1257" +CP1258, "cp1258" +EUC-JP, "eucJP" +EUC-KR, "eucKR" +EUC-TW, "eucTW" +BIG5, "big5" +SHIFT_JIS, "SJIS" +TIS-620, "TACTIS" diff --git a/src/bin/coreutils/lib/iconv_open-osf.h b/src/bin/coreutils/lib/iconv_open-osf.h new file mode 100644 index 0000000000..4d35764952 --- /dev/null +++ b/src/bin/coreutils/lib/iconv_open-osf.h @@ -0,0 +1,278 @@ +/* ANSI-C code produced by gperf version 3.0.4 */ +/* Command-line: gperf -m 10 ./iconv_open-osf.gperf */ +/* Computed positions: -k'4,$' */ + +#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \ + && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \ + && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \ + && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \ + && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \ + && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \ + && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \ + && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \ + && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \ + && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \ + && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \ + && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \ + && ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \ + && ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \ + && ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \ + && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \ + && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \ + && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \ + && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \ + && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \ + && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \ + && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \ + && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126)) +/* The character set is not based on ISO-646. */ +#error "gperf generated tables don't work with this execution character set. Please report a bug to ." +#endif + +#line 1 "./iconv_open-osf.gperf" +struct mapping { int standard_name; const char vendor_name[10 + 1]; }; + +#define TOTAL_KEYWORDS 38 +#define MIN_WORD_LENGTH 4 +#define MAX_WORD_LENGTH 11 +#define MIN_HASH_VALUE 6 +#define MAX_HASH_VALUE 47 +/* maximum key range = 42, duplicates = 0 */ + +#ifdef __GNUC__ +__inline +#else +#ifdef __cplusplus +inline +#endif +#endif +static unsigned int +mapping_hash (register const char *str, register unsigned int len) +{ + static const unsigned char asso_values[] = + { + 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, + 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, + 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, + 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, + 48, 48, 48, 48, 48, 48, 48, 48, 2, 29, + 24, 34, 31, 0, 15, 14, 10, 13, 2, 48, + 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, + 48, 48, 48, 7, 48, 48, 48, 48, 48, 48, + 11, 48, 2, 7, 48, 48, 48, 1, 48, 48, + 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, + 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, + 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, + 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, + 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, + 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, + 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, + 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, + 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, + 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, + 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, + 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, + 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, + 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, + 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, + 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, + 48, 48, 48, 48, 48, 48, 48, 48, 48 + }; + return len + asso_values[(unsigned char)str[3]+3] + asso_values[(unsigned char)str[len - 1]]; +} + +struct stringpool_t + { + char stringpool_str6[sizeof("CP1255")]; + char stringpool_str7[sizeof("CP775")]; + char stringpool_str8[sizeof("CP1250")]; + char stringpool_str9[sizeof("EUC-TW")]; + char stringpool_str10[sizeof("EUC-KR")]; + char stringpool_str11[sizeof("TIS-620")]; + char stringpool_str12[sizeof("ISO-8859-5")]; + char stringpool_str13[sizeof("ISO-8859-15")]; + char stringpool_str14[sizeof("BIG5")]; + char stringpool_str15[sizeof("CP855")]; + char stringpool_str16[sizeof("CP1258")]; + char stringpool_str17[sizeof("CP850")]; + char stringpool_str18[sizeof("CP865")]; + char stringpool_str19[sizeof("EUC-JP")]; + char stringpool_str20[sizeof("CP1257")]; + char stringpool_str21[sizeof("CP1256")]; + char stringpool_str22[sizeof("ISO-8859-8")]; + char stringpool_str23[sizeof("SHIFT_JIS")]; + char stringpool_str25[sizeof("ISO-8859-9")]; + char stringpool_str26[sizeof("ISO-8859-7")]; + char stringpool_str27[sizeof("ISO-8859-6")]; + char stringpool_str29[sizeof("CP857")]; + char stringpool_str30[sizeof("CP1252")]; + char stringpool_str31[sizeof("CP869")]; + char stringpool_str32[sizeof("CP949")]; + char stringpool_str33[sizeof("CP866")]; + char stringpool_str34[sizeof("CP437")]; + char stringpool_str35[sizeof("CP1251")]; + char stringpool_str36[sizeof("ISO-8859-2")]; + char stringpool_str37[sizeof("CP1254")]; + char stringpool_str38[sizeof("CP874")]; + char stringpool_str39[sizeof("CP852")]; + char stringpool_str40[sizeof("CP1253")]; + char stringpool_str41[sizeof("ISO-8859-1")]; + char stringpool_str42[sizeof("CP862")]; + char stringpool_str43[sizeof("ISO-8859-4")]; + char stringpool_str46[sizeof("ISO-8859-3")]; + char stringpool_str47[sizeof("CP861")]; + }; +static const struct stringpool_t stringpool_contents = + { + "CP1255", + "CP775", + "CP1250", + "EUC-TW", + "EUC-KR", + "TIS-620", + "ISO-8859-5", + "ISO-8859-15", + "BIG5", + "CP855", + "CP1258", + "CP850", + "CP865", + "EUC-JP", + "CP1257", + "CP1256", + "ISO-8859-8", + "SHIFT_JIS", + "ISO-8859-9", + "ISO-8859-7", + "ISO-8859-6", + "CP857", + "CP1252", + "CP869", + "CP949", + "CP866", + "CP437", + "CP1251", + "ISO-8859-2", + "CP1254", + "CP874", + "CP852", + "CP1253", + "ISO-8859-1", + "CP862", + "ISO-8859-4", + "ISO-8859-3", + "CP861" + }; +#define stringpool ((const char *) &stringpool_contents) + +static const struct mapping mappings[] = + { + {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, +#line 41 "./iconv_open-osf.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str6, "cp1255"}, +#line 24 "./iconv_open-osf.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str7, "cp775"}, +#line 36 "./iconv_open-osf.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str8, "cp1250"}, +#line 47 "./iconv_open-osf.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str9, "eucTW"}, +#line 46 "./iconv_open-osf.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str10, "eucKR"}, +#line 50 "./iconv_open-osf.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str11, "TACTIS"}, +#line 17 "./iconv_open-osf.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str12, "ISO8859-5"}, +#line 22 "./iconv_open-osf.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str13, "ISO8859-15"}, +#line 48 "./iconv_open-osf.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str14, "big5"}, +#line 27 "./iconv_open-osf.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str15, "cp855"}, +#line 44 "./iconv_open-osf.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str16, "cp1258"}, +#line 25 "./iconv_open-osf.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str17, "cp850"}, +#line 31 "./iconv_open-osf.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str18, "cp865"}, +#line 45 "./iconv_open-osf.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str19, "eucJP"}, +#line 43 "./iconv_open-osf.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str20, "cp1257"}, +#line 42 "./iconv_open-osf.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str21, "cp1256"}, +#line 20 "./iconv_open-osf.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str22, "ISO8859-8"}, +#line 49 "./iconv_open-osf.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str23, "SJIS"}, + {-1}, +#line 21 "./iconv_open-osf.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str25, "ISO8859-9"}, +#line 19 "./iconv_open-osf.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str26, "ISO8859-7"}, +#line 18 "./iconv_open-osf.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str27, "ISO8859-6"}, + {-1}, +#line 28 "./iconv_open-osf.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str29, "cp857"}, +#line 38 "./iconv_open-osf.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str30, "cp1252"}, +#line 33 "./iconv_open-osf.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str31, "cp869"}, +#line 35 "./iconv_open-osf.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str32, "KSC5601"}, +#line 32 "./iconv_open-osf.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str33, "cp866"}, +#line 23 "./iconv_open-osf.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str34, "cp437"}, +#line 37 "./iconv_open-osf.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str35, "cp1251"}, +#line 14 "./iconv_open-osf.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str36, "ISO8859-2"}, +#line 40 "./iconv_open-osf.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str37, "cp1254"}, +#line 34 "./iconv_open-osf.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str38, "cp874"}, +#line 26 "./iconv_open-osf.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str39, "cp852"}, +#line 39 "./iconv_open-osf.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str40, "cp1253"}, +#line 13 "./iconv_open-osf.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str41, "ISO8859-1"}, +#line 30 "./iconv_open-osf.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str42, "cp862"}, +#line 16 "./iconv_open-osf.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str43, "ISO8859-4"}, + {-1}, {-1}, +#line 15 "./iconv_open-osf.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str46, "ISO8859-3"}, +#line 29 "./iconv_open-osf.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str47, "cp861"} + }; + +#ifdef __GNUC__ +__inline +#if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__ +__attribute__ ((__gnu_inline__)) +#endif +#endif +const struct mapping * +mapping_lookup (register const char *str, register unsigned int len) +{ + if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) + { + register int key = mapping_hash (str, len); + + if (key <= MAX_HASH_VALUE && key >= 0) + { + register int o = mappings[key].standard_name; + if (o >= 0) + { + register const char *s = o + stringpool; + + if (*str == *s && !strcmp (str + 1, s + 1)) + return &mappings[key]; + } + } + } + return 0; +} diff --git a/src/bin/coreutils/lib/iconv_open.c b/src/bin/coreutils/lib/iconv_open.c new file mode 100644 index 0000000000..e72b15b3a5 --- /dev/null +++ b/src/bin/coreutils/lib/iconv_open.c @@ -0,0 +1,175 @@ +/* -*- buffer-read-only: t -*- vi: set ro: */ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 +/* Character set conversion. + Copyright (C) 2007 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + +#include + +/* Specification. */ +#include + +#include +#include +#include "c-ctype.h" +#include "c-strcase.h" + +#define SIZEOF(a) (sizeof(a) / sizeof(a[0])) + +/* Namespace cleanliness. */ +#define mapping_lookup rpl_iconv_open_mapping_lookup + +/* The macro ICONV_FLAVOR is defined to one of these or undefined. */ + +#define ICONV_FLAVOR_AIX "iconv_open-aix.h" +#define ICONV_FLAVOR_HPUX "iconv_open-hpux.h" +#define ICONV_FLAVOR_IRIX "iconv_open-irix.h" +#define ICONV_FLAVOR_OSF "iconv_open-osf.h" + +#ifdef ICONV_FLAVOR +# include ICONV_FLAVOR +#endif + +iconv_t +rpl_iconv_open (const char *tocode, const char *fromcode) +#undef iconv_open +{ + char fromcode_upper[32]; + char tocode_upper[32]; + char *fromcode_upper_end; + char *tocode_upper_end; + +#if REPLACE_ICONV_UTF + /* Special handling of conversion between UTF-8 and UTF-{16,32}{BE,LE}. + Do this here, before calling the real iconv_open(), because OSF/1 5.1 + iconv() to these encoding inserts a BOM, which is wrong. + We do not need to handle conversion between arbitrary encodings and + UTF-{16,32}{BE,LE}, because the 'striconveh' module implements two-step + conversion throough UTF-8. + The _ICONV_* constants are chosen to be disjoint from any iconv_t + returned by the system's iconv_open() functions. Recall that iconv_t + is a scalar type. */ + if (c_toupper (fromcode[0]) == 'U' + && c_toupper (fromcode[1]) == 'T' + && c_toupper (fromcode[2]) == 'F' + && fromcode[3] == '-') + { + if (c_toupper (tocode[0]) == 'U' + && c_toupper (tocode[1]) == 'T' + && c_toupper (tocode[2]) == 'F' + && tocode[3] == '-') + { + if (strcmp (fromcode + 4, "8") == 0) + { + if (c_strcasecmp (tocode + 4, "16BE") == 0) + return _ICONV_UTF8_UTF16BE; + if (c_strcasecmp (tocode + 4, "16LE") == 0) + return _ICONV_UTF8_UTF16LE; + if (c_strcasecmp (tocode + 4, "32BE") == 0) + return _ICONV_UTF8_UTF32BE; + if (c_strcasecmp (tocode + 4, "32LE") == 0) + return _ICONV_UTF8_UTF32LE; + } + else if (strcmp (tocode + 4, "8") == 0) + { + if (c_strcasecmp (fromcode + 4, "16BE") == 0) + return _ICONV_UTF16BE_UTF8; + if (c_strcasecmp (fromcode + 4, "16LE") == 0) + return _ICONV_UTF16LE_UTF8; + if (c_strcasecmp (fromcode + 4, "32BE") == 0) + return _ICONV_UTF32BE_UTF8; + if (c_strcasecmp (fromcode + 4, "32LE") == 0) + return _ICONV_UTF32LE_UTF8; + } + } + } +#endif + + /* Do *not* add special support for 8-bit encodings like ASCII or ISO-8859-1 + here. This would lead to programs that work in some locales (such as the + "C" or "en_US" locales) but do not work in East Asian locales. It is + better if programmers make their programs depend on GNU libiconv (except + on glibc systems), e.g. by using the AM_ICONV macro and documenting the + dependency in an INSTALL or DEPENDENCIES file. */ + + /* Try with the original names first. + This covers the case when fromcode or tocode is a lowercase encoding name + that is understood by the system's iconv_open but not listed in our + mappings table. */ + { + iconv_t cd = iconv_open (tocode, fromcode); + if (cd != (iconv_t)(-1)) + return cd; + } + + /* Convert the encodings to upper case, because + 1. in the arguments of iconv_open() on AIX, HP-UX, and OSF/1 the case + matters, + 2. it makes searching in the table faster. */ + { + const char *p = fromcode; + char *q = fromcode_upper; + while ((*q = c_toupper (*p)) != '\0') + { + p++; + q++; + if (q == &fromcode_upper[SIZEOF (fromcode_upper)]) + { + errno = EINVAL; + return (iconv_t)(-1); + } + } + fromcode_upper_end = q; + } + + { + const char *p = tocode; + char *q = tocode_upper; + while ((*q = c_toupper (*p)) != '\0') + { + p++; + q++; + if (q == &tocode_upper[SIZEOF (tocode_upper)]) + { + errno = EINVAL; + return (iconv_t)(-1); + } + } + tocode_upper_end = q; + } + +#ifdef ICONV_FLAVOR + /* Apply the mappings. */ + { + const struct mapping *m = + mapping_lookup (fromcode_upper, fromcode_upper_end - fromcode_upper); + + fromcode = (m != NULL ? m->vendor_name : fromcode_upper); + } + { + const struct mapping *m = + mapping_lookup (tocode_upper, tocode_upper_end - tocode_upper); + + tocode = (m != NULL ? m->vendor_name : tocode_upper); + } +#else + fromcode = fromcode_upper; + tocode = tocode_upper; +#endif + + return iconv_open (tocode, fromcode); +} diff --git a/src/bin/coreutils/lib/idcache.c b/src/bin/coreutils/lib/idcache.c index 0706f007f5..4951873d1d 100644 --- a/src/bin/coreutils/lib/idcache.c +++ b/src/bin/coreutils/lib/idcache.c @@ -1,12 +1,12 @@ /* idcache.c -- map user and group IDs, cached for speed - Copyright (C) 1985, 1988, 1989, 1990, 1997, 1998, 2003, 2005, 2006 + Copyright (C) 1985, 1988, 1989, 1990, 1997, 1998, 2003, 2005-2007 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,15 +14,14 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ #include +#include "idcache.h" #include #include #include -#include #include #include @@ -45,11 +44,24 @@ struct userid char name[FLEXIBLE_ARRAY_MEMBER]; }; +/* FIXME: provide a function to free any malloc'd storage and reset lists, + so that an application can use code like this just before exiting: + #ifdef lint + idcache_clear (); + #endif +*/ + static struct userid *user_alist; /* Each entry on list is a user name for which the first lookup failed. */ static struct userid *nouser_alist; +/* Use the same struct as for userids. */ +static struct userid *group_alist; + +/* Each entry on list is a group name for which the first lookup failed. */ +static struct userid *nogroup_alist; + /* Translate UID to a login name, with cache, or NULL if unresolved. */ char * @@ -132,12 +144,6 @@ getuidbyname (const char *user) return NULL; } -/* Use the same struct as for userids. */ -static struct userid *group_alist; - -/* Each entry on list is a group name for which the first lookup failed. */ -static struct userid *nogroup_alist; - /* Translate GID to a group name, with cache, or NULL if unresolved. */ char * diff --git a/src/bin/coreutils/lib/idcache.h b/src/bin/coreutils/lib/idcache.h new file mode 100644 index 0000000000..e7573b83f7 --- /dev/null +++ b/src/bin/coreutils/lib/idcache.h @@ -0,0 +1,11 @@ +#ifndef IDCACHE_H +# define IDCACHE_H 1 + +# include + +extern char *getuser (uid_t uid); +extern char *getgroup (gid_t gid); +extern uid_t *getuidbyname (const char *user); +extern gid_t *getgidbyname (const char *group); + +#endif diff --git a/src/bin/coreutils/lib/ignore-value.h b/src/bin/coreutils/lib/ignore-value.h new file mode 100644 index 0000000000..5f97c91c3f --- /dev/null +++ b/src/bin/coreutils/lib/ignore-value.h @@ -0,0 +1,45 @@ +/* ignore a value to quiet a compiler warning + + Copyright (C) 2008 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* Written by Jim Meyering. */ + +#ifndef __attribute__ +# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8) +# define __attribute__(x) +# endif +#endif + +/* Use this function to avoid a warning when using a function declared with + gcc's warn_unused_result attribute, but for which you really do want to + ignore the result. Traditionally, people have used a "(void)" cast to + indicate that a function's return value is deliberately unused. However, + if the function is declared with __attribute__((warn_unused_result)), + gcc issues a warning even with the cast. + + Caution: most of the time, you really should heed gcc's warning, and + check the return value. However, in those exceptional cases in which + you're sure you know what you're doing, use this function. + + For the record, here's one of the ignorable warnings: + "copy.c:233: warning: ignoring return value of 'fchown', + declared with attribute warn_unused_result". */ + +static inline void +ignore_value (int i __attribute__ ((__unused__))) +{ + /* empty */ +} diff --git a/src/bin/coreutils/lib/inet_ntop.c b/src/bin/coreutils/lib/inet_ntop.c index 537b59fa5c..1328bedc9f 100644 --- a/src/bin/coreutils/lib/inet_ntop.c +++ b/src/bin/coreutils/lib/inet_ntop.c @@ -1,10 +1,13 @@ +/* -*- buffer-read-only: t -*- vi: set ro: */ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 /* inet_ntop.c -- convert IPv4 and IPv6 addresses from binary to text form - Copyright (C) 2005, 2006 Free Software Foundation, Inc. + Copyright (C) 2005, 2006, 2008 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) + the Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -36,7 +39,7 @@ #include /* Specification. */ -#include "inet_ntop.h" +#include #include #include diff --git a/src/bin/coreutils/lib/intprops.h b/src/bin/coreutils/lib/intprops.h index 34f971cbaa..002161ee57 100644 --- a/src/bin/coreutils/lib/intprops.h +++ b/src/bin/coreutils/lib/intprops.h @@ -2,10 +2,10 @@ Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Paul Eggert. */ diff --git a/src/bin/coreutils/lib/inttostr.c b/src/bin/coreutils/lib/inttostr.c index 246d658350..ed6a6933de 100644 --- a/src/bin/coreutils/lib/inttostr.c +++ b/src/bin/coreutils/lib/inttostr.c @@ -1,11 +1,11 @@ /* inttostr.c -- convert integers to printable strings - Copyright (C) 2001, 2006 Free Software Foundation, Inc. + Copyright (C) 2001, 2006, 2008 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,11 +13,15 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Paul Eggert */ +/* Tell gcc not to warn about the (i < 0) test, below. */ +#if (__GNUC__ == 4 && 3 <= __GNUC_MINOR__) || 4 < __GNUC__ +# pragma GCC diagnostic ignored "-Wtype-limits" +#endif + #include #include "inttostr.h" diff --git a/src/bin/coreutils/lib/inttostr.h b/src/bin/coreutils/lib/inttostr.h index 31258cad35..a103caf587 100644 --- a/src/bin/coreutils/lib/inttostr.h +++ b/src/bin/coreutils/lib/inttostr.h @@ -3,10 +3,10 @@ Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Paul Eggert */ @@ -24,7 +23,24 @@ #include "intprops.h" -char *offtostr (off_t, char *); -char *imaxtostr (intmax_t, char *); -char *umaxtostr (uintmax_t, char *); -char *uinttostr (unsigned int, char *); +#ifndef __GNUC_PREREQ +# if defined __GNUC__ && defined __GNUC_MINOR__ +# define __GNUC_PREREQ(maj, min) \ + ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min)) +# else +# define __GNUC_PREREQ(maj, min) 0 +# endif +#endif + +#if __GNUC_PREREQ (3,4) +# undef __attribute_warn_unused_result__ +# define __attribute_warn_unused_result__ \ + __attribute__ ((__warn_unused_result__)) +#else +# define __attribute_warn_unused_result__ /* empty */ +#endif + +char *offtostr (off_t, char *) __attribute_warn_unused_result__; +char *imaxtostr (intmax_t, char *) __attribute_warn_unused_result__; +char *umaxtostr (uintmax_t, char *) __attribute_warn_unused_result__; +char *uinttostr (unsigned int, char *) __attribute_warn_unused_result__; diff --git a/src/bin/coreutils/lib/inttypes_.h b/src/bin/coreutils/lib/inttypes.in.h similarity index 94% rename from src/bin/coreutils/lib/inttypes_.h rename to src/bin/coreutils/lib/inttypes.in.h index 3d3ead68aa..7022ebc354 100644 --- a/src/bin/coreutils/lib/inttypes_.h +++ b/src/bin/coreutils/lib/inttypes.in.h @@ -1,38 +1,41 @@ -/* Copyright (C) 2006-2007 Free Software Foundation, Inc. +/* Copyright (C) 2006-2009 Free Software Foundation, Inc. Written by Paul Eggert, Bruno Haible, Derek Price. This file is part of gnulib. - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation; either version 2.1, or (at your option) - any later version. + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - You should have received a copy of the GNU Lesser General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ - -/* Include the original if it exists, and if this file - has not been included yet or if this file includes gnulib stdint.h - which in turn includes this file. */ -#if ! defined INTTYPES_H || defined _GL_JUST_INCLUDE_ABSOLUTE_INTTYPES_H -# if @HAVE_INTTYPES_H@ -# include @ABSOLUTE_INTTYPES_H@ -# endif -#endif - -#if ! defined INTTYPES_H && ! defined _GL_JUST_INCLUDE_ABSOLUTE_INTTYPES_H -#define INTTYPES_H + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ /* * ISO C 99 for platforms that lack it. * */ +/* Include the original if it exists, and if this file + has not been included yet or if this file includes gnulib stdint.h + which in turn includes this file. + The include_next requires a split double-inclusion guard. */ +#if ! defined INTTYPES_H || defined _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H +# if @HAVE_INTTYPES_H@ +# if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +# endif +# @INCLUDE_NEXT@ @NEXT_INTTYPES_H@ +# endif +#endif + +#if ! defined INTTYPES_H && ! defined _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H +#define INTTYPES_H + /* Include or the gnulib replacement. */ #include /* Get CHAR_BIT. */ @@ -165,7 +168,7 @@ # endif # endif # ifdef INT64_MAX -# if INT64_MAX == LONG_MAX +# if (@APPLE_UNIVERSAL_BUILD@ ? defined _LP64 : @INT64_MAX_EQ_LONG_MAX@) # define _PRI64_PREFIX "l" # elif defined _MSC_VER || defined __MINGW32__ # define _PRI64_PREFIX "I64" @@ -182,7 +185,7 @@ # endif # endif # ifdef UINT64_MAX -# if UINT64_MAX == ULONG_MAX +# if (@APPLE_UNIVERSAL_BUILD@ ? defined _LP64 : @UINT64_MAX_EQ_ULONG_MAX@) # define _PRIu64_PREFIX "l" # elif defined _MSC_VER || defined __MINGW32__ # define _PRIu64_PREFIX "I64" @@ -483,7 +486,7 @@ # if !defined PRIdMAX || @PRI_MACROS_BROKEN@ # undef PRIdMAX -# if INTMAX_MAX > INT32_MAX +# if @INT32_MAX_LT_INTMAX_MAX@ # define PRIdMAX PRId64 # else # define PRIdMAX "ld" @@ -491,7 +494,7 @@ # endif # if !defined PRIiMAX || @PRI_MACROS_BROKEN@ # undef PRIiMAX -# if INTMAX_MAX > INT32_MAX +# if @INT32_MAX_LT_INTMAX_MAX@ # define PRIiMAX PRIi64 # else # define PRIiMAX "li" @@ -499,7 +502,7 @@ # endif # if !defined PRIoMAX || @PRI_MACROS_BROKEN@ # undef PRIoMAX -# if UINTMAX_MAX > UINT32_MAX +# if @UINT32_MAX_LT_UINTMAX_MAX@ # define PRIoMAX PRIo64 # else # define PRIoMAX "lo" @@ -507,7 +510,7 @@ # endif # if !defined PRIuMAX || @PRI_MACROS_BROKEN@ # undef PRIuMAX -# if UINTMAX_MAX > UINT32_MAX +# if @UINT32_MAX_LT_UINTMAX_MAX@ # define PRIuMAX PRIu64 # else # define PRIuMAX "lu" @@ -515,7 +518,7 @@ # endif # if !defined PRIxMAX || @PRI_MACROS_BROKEN@ # undef PRIxMAX -# if UINTMAX_MAX > UINT32_MAX +# if @UINT32_MAX_LT_UINTMAX_MAX@ # define PRIxMAX PRIx64 # else # define PRIxMAX "lx" @@ -523,7 +526,7 @@ # endif # if !defined PRIXMAX || @PRI_MACROS_BROKEN@ # undef PRIXMAX -# if UINTMAX_MAX > UINT32_MAX +# if @UINT32_MAX_LT_UINTMAX_MAX@ # define PRIXMAX PRIX64 # else # define PRIXMAX "lX" @@ -658,7 +661,7 @@ # endif # endif # ifdef INT64_MAX -# if INT64_MAX == LONG_MAX +# if (@APPLE_UNIVERSAL_BUILD@ ? defined _LP64 : @INT64_MAX_EQ_LONG_MAX@) # define _SCN64_PREFIX "l" # elif defined _MSC_VER || defined __MINGW32__ # define _SCN64_PREFIX "I64" @@ -675,7 +678,7 @@ # endif # endif # ifdef UINT64_MAX -# if UINT64_MAX == ULONG_MAX +# if (@APPLE_UNIVERSAL_BUILD@ ? defined _LP64 : @UINT64_MAX_EQ_ULONG_MAX@) # define _SCNu64_PREFIX "l" # elif defined _MSC_VER || defined __MINGW32__ # define _SCNu64_PREFIX "I64" @@ -958,7 +961,7 @@ # if !defined SCNdMAX || @PRI_MACROS_BROKEN@ # undef SCNdMAX -# if INTMAX_MAX > INT32_MAX +# if @INT32_MAX_LT_INTMAX_MAX@ # define SCNdMAX SCNd64 # else # define SCNdMAX "ld" @@ -966,7 +969,7 @@ # endif # if !defined SCNiMAX || @PRI_MACROS_BROKEN@ # undef SCNiMAX -# if INTMAX_MAX > INT32_MAX +# if @INT32_MAX_LT_INTMAX_MAX@ # define SCNiMAX SCNi64 # else # define SCNiMAX "li" @@ -974,7 +977,7 @@ # endif # if !defined SCNoMAX || @PRI_MACROS_BROKEN@ # undef SCNoMAX -# if UINTMAX_MAX > UINT32_MAX +# if @UINT32_MAX_LT_UINTMAX_MAX@ # define SCNoMAX SCNo64 # else # define SCNoMAX "lo" @@ -982,7 +985,7 @@ # endif # if !defined SCNuMAX || @PRI_MACROS_BROKEN@ # undef SCNuMAX -# if UINTMAX_MAX > UINT32_MAX +# if @UINT32_MAX_LT_UINTMAX_MAX@ # define SCNuMAX SCNu64 # else # define SCNuMAX "lu" @@ -990,7 +993,7 @@ # endif # if !defined SCNxMAX || @PRI_MACROS_BROKEN@ # undef SCNxMAX -# if UINTMAX_MAX > UINT32_MAX +# if @UINT32_MAX_LT_UINTMAX_MAX@ # define SCNxMAX SCNx64 # else # define SCNxMAX "lx" @@ -1092,4 +1095,4 @@ extern uintmax_t strtoumax (const char *, char **, int); } #endif -#endif /* INTTYPES_H */ +#endif /* !defined INTTYPES_H && !defined _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H */ diff --git a/src/bin/coreutils/lib/isapipe.c b/src/bin/coreutils/lib/isapipe.c index 83a9bf2cba..495cba6a6a 100644 --- a/src/bin/coreutils/lib/isapipe.c +++ b/src/bin/coreutils/lib/isapipe.c @@ -1,11 +1,11 @@ /* Test whether a file descriptor is a pipe. - Copyright (C) 2006 Free Software Foundation, Inc. + Copyright (C) 2006, 2008 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Paul Eggert. */ @@ -23,15 +22,42 @@ #include "isapipe.h" #include -#include -#include -#include -#include + +#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +/* Windows platforms. */ + +/* Get _get_osfhandle. */ +# include + +/* Get GetFileType. */ +# include + +int +isapipe (int fd) +{ + HANDLE h = (HANDLE) _get_osfhandle (fd); + + if (h == INVALID_HANDLE_VALUE) + { + errno = EBADF; + return -1; + } + + return (GetFileType (h) == FILE_TYPE_PIPE); +} + +#else +/* Unix platforms. */ + +# include +# include +# include +# include /* The maximum link count for pipes; (nlink_t) -1 if not known. */ -#ifndef PIPE_LINK_COUNT_MAX -# define PIPE_LINK_COUNT_MAX ((nlink_t) (-1)) -#endif +# ifndef PIPE_LINK_COUNT_MAX +# define PIPE_LINK_COUNT_MAX ((nlink_t) (-1)) +# endif /* Return 1 if FD is a pipe, 0 if not, -1 (setting errno) on error. @@ -89,3 +115,5 @@ isapipe (int fd) (st.st_nlink <= pipe_link_count_max && (check_for_fifo ? S_ISFIFO (st.st_mode) : S_ISSOCK (st.st_mode))); } + +#endif diff --git a/src/bin/coreutils/lib/isnan.c b/src/bin/coreutils/lib/isnan.c new file mode 100644 index 0000000000..a5ca38df41 --- /dev/null +++ b/src/bin/coreutils/lib/isnan.c @@ -0,0 +1,161 @@ +/* Test for NaN that does not need libm. + Copyright (C) 2007-2008 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* Written by Bruno Haible , 2007. */ + +#include + +#include +#include + +#include "float+.h" + +#ifdef USE_LONG_DOUBLE +# define FUNC rpl_isnanl +# define DOUBLE long double +# define MAX_EXP LDBL_MAX_EXP +# define MIN_EXP LDBL_MIN_EXP +# if defined LDBL_EXPBIT0_WORD && defined LDBL_EXPBIT0_BIT +# define KNOWN_EXPBIT0_LOCATION +# define EXPBIT0_WORD LDBL_EXPBIT0_WORD +# define EXPBIT0_BIT LDBL_EXPBIT0_BIT +# endif +# define SIZE SIZEOF_LDBL +# define L_(literal) literal##L +#elif ! defined USE_FLOAT +# define FUNC rpl_isnand +# define DOUBLE double +# define MAX_EXP DBL_MAX_EXP +# define MIN_EXP DBL_MIN_EXP +# if defined DBL_EXPBIT0_WORD && defined DBL_EXPBIT0_BIT +# define KNOWN_EXPBIT0_LOCATION +# define EXPBIT0_WORD DBL_EXPBIT0_WORD +# define EXPBIT0_BIT DBL_EXPBIT0_BIT +# endif +# define SIZE SIZEOF_DBL +# define L_(literal) literal +#else /* defined USE_FLOAT */ +# define FUNC rpl_isnanf +# define DOUBLE float +# define MAX_EXP FLT_MAX_EXP +# define MIN_EXP FLT_MIN_EXP +# if defined FLT_EXPBIT0_WORD && defined FLT_EXPBIT0_BIT +# define KNOWN_EXPBIT0_LOCATION +# define EXPBIT0_WORD FLT_EXPBIT0_WORD +# define EXPBIT0_BIT FLT_EXPBIT0_BIT +# endif +# define SIZE SIZEOF_FLT +# define L_(literal) literal##f +#endif + +#define EXP_MASK ((MAX_EXP - MIN_EXP) | 7) + +#define NWORDS \ + ((sizeof (DOUBLE) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) +typedef union { DOUBLE value; unsigned int word[NWORDS]; } memory_double; + +int +FUNC (DOUBLE x) +{ +#ifdef KNOWN_EXPBIT0_LOCATION +# if defined USE_LONG_DOUBLE && ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_)) + /* Special CPU dependent code is needed to treat bit patterns outside the + IEEE 754 specification (such as Pseudo-NaNs, Pseudo-Infinities, + Pseudo-Zeroes, Unnormalized Numbers, and Pseudo-Denormals) as NaNs. + These bit patterns are: + - exponent = 0x0001..0x7FFF, mantissa bit 63 = 0, + - exponent = 0x0000, mantissa bit 63 = 1. + The NaN bit pattern is: + - exponent = 0x7FFF, mantissa >= 0x8000000000000001. */ + memory_double m; + unsigned int exponent; + + m.value = x; + exponent = (m.word[EXPBIT0_WORD] >> EXPBIT0_BIT) & EXP_MASK; +# ifdef WORDS_BIGENDIAN + /* Big endian: EXPBIT0_WORD = 0, EXPBIT0_BIT = 16. */ + if (exponent == 0) + return 1 & (m.word[0] >> 15); + else if (exponent == EXP_MASK) + return (((m.word[0] ^ 0x8000U) << 16) | m.word[1] | (m.word[2] >> 16)) != 0; + else + return 1 & ~(m.word[0] >> 15); +# else + /* Little endian: EXPBIT0_WORD = 2, EXPBIT0_BIT = 0. */ + if (exponent == 0) + return (m.word[1] >> 31); + else if (exponent == EXP_MASK) + return ((m.word[1] ^ 0x80000000U) | m.word[0]) != 0; + else + return (m.word[1] >> 31) ^ 1; +# endif +# else + /* Be careful to not do any floating-point operation on x, such as x == x, + because x may be a signaling NaN. */ +# if defined __SUNPRO_C || defined __DECC || (defined __sgi && !defined __GNUC__) + /* The Sun C 5.0 compilers and the Compaq (ex-DEC) 6.4 compilers don't + recognize the initializers as constant expressions. The latter compiler + also fails when constant-folding 0.0 / 0.0 even when constant-folding is + not required. The SGI MIPSpro C compiler complains about "floating-point + operation result is out of range". */ + static DOUBLE zero = L_(0.0); + memory_double nan; + DOUBLE plus_inf = L_(1.0) / L_(0.0); + DOUBLE minus_inf = -L_(1.0) / L_(0.0); + nan.value = zero / zero; +# else + static memory_double nan = { L_(0.0) / L_(0.0) }; + static DOUBLE plus_inf = L_(1.0) / L_(0.0); + static DOUBLE minus_inf = -L_(1.0) / L_(0.0); +# endif + { + memory_double m; + + /* A NaN can be recognized through its exponent. But exclude +Infinity and + -Infinity, which have the same exponent. */ + m.value = x; + if (((m.word[EXPBIT0_WORD] ^ nan.word[EXPBIT0_WORD]) + & (EXP_MASK << EXPBIT0_BIT)) + == 0) + return (memcmp (&m.value, &plus_inf, SIZE) != 0 + && memcmp (&m.value, &minus_inf, SIZE) != 0); + else + return 0; + } +# endif +#else + /* The configuration did not find sufficient information. Give up about + the signaling NaNs, handle only the quiet NaNs. */ + if (x == x) + { +# if defined USE_LONG_DOUBLE && ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_)) + /* Detect any special bit patterns that pass ==; see comment above. */ + memory_double m1; + memory_double m2; + + memset (&m1.value, 0, SIZE); + memset (&m2.value, 0, SIZE); + m1.value = x; + m2.value = x + (x ? 0.0L : -0.0L); + if (memcmp (&m1.value, &m2.value, SIZE) != 0) + return 1; +# endif + return 0; + } + else + return 1; +#endif +} diff --git a/src/bin/coreutils/lib/isnand-nolibm.h b/src/bin/coreutils/lib/isnand-nolibm.h new file mode 100644 index 0000000000..d248b2f5ea --- /dev/null +++ b/src/bin/coreutils/lib/isnand-nolibm.h @@ -0,0 +1,33 @@ +/* Test for NaN that does not need libm. + Copyright (C) 2007-2008 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#if HAVE_ISNAND_IN_LIBC +/* Get declaration of isnan macro. */ +# include +# if __GNUC__ >= 4 + /* GCC 4.0 and newer provides three built-ins for isnan. */ +# undef isnand +# define isnand(x) __builtin_isnan ((double)(x)) +# else +# undef isnand +# define isnand(x) isnan ((double)(x)) +# endif +#else +/* Test whether X is a NaN. */ +# undef isnand +# define isnand rpl_isnand +extern int isnand (double x); +#endif diff --git a/src/bin/coreutils/lib/isnand.c b/src/bin/coreutils/lib/isnand.c new file mode 100644 index 0000000000..8e5bbb3999 --- /dev/null +++ b/src/bin/coreutils/lib/isnand.c @@ -0,0 +1,19 @@ +/* Test for NaN that does not need libm. + Copyright (C) 2008 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* Written by Bruno Haible , 2008. */ + +#include "isnan.c" diff --git a/src/bin/coreutils/lib/isnanf-nolibm.h b/src/bin/coreutils/lib/isnanf-nolibm.h new file mode 100644 index 0000000000..774942c728 --- /dev/null +++ b/src/bin/coreutils/lib/isnanf-nolibm.h @@ -0,0 +1,33 @@ +/* Test for NaN that does not need libm. + Copyright (C) 2007-2008 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#if HAVE_ISNANF_IN_LIBC +/* Get declaration of isnan macro or (older) isnanf function. */ +# include +# if __GNUC__ >= 4 + /* GCC 4.0 and newer provides three built-ins for isnan. */ +# undef isnanf +# define isnanf(x) __builtin_isnanf ((float)(x)) +# elif defined isnan +# undef isnanf +# define isnanf(x) isnan ((float)(x)) +# endif +#else +/* Test whether X is a NaN. */ +# undef isnanf +# define isnanf rpl_isnanf +extern int isnanf (float x); +#endif diff --git a/src/bin/coreutils/lib/isnanf.c b/src/bin/coreutils/lib/isnanf.c new file mode 100644 index 0000000000..8f70eb60d8 --- /dev/null +++ b/src/bin/coreutils/lib/isnanf.c @@ -0,0 +1,20 @@ +/* Test for NaN that does not need libm. + Copyright (C) 2007 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* Written by Bruno Haible , 2007. */ + +#define USE_FLOAT +#include "isnan.c" diff --git a/src/bin/coreutils/lib/isnanl-nolibm.h b/src/bin/coreutils/lib/isnanl-nolibm.h new file mode 100644 index 0000000000..fa29f54af7 --- /dev/null +++ b/src/bin/coreutils/lib/isnanl-nolibm.h @@ -0,0 +1,33 @@ +/* Test for NaN that does not need libm. + Copyright (C) 2007-2008 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#if HAVE_ISNANL_IN_LIBC +/* Get declaration of isnan macro or (older) isnanl function. */ +# include +# if __GNUC__ >= 4 + /* GCC 4.0 and newer provides three built-ins for isnan. */ +# undef isnanl +# define isnanl(x) __builtin_isnanl ((long double)(x)) +# elif defined isnan +# undef isnanl +# define isnanl(x) isnan ((long double)(x)) +# endif +#else +/* Test whether X is a NaN. */ +# undef isnanl +# define isnanl rpl_isnanl +extern int isnanl (long double x); +#endif diff --git a/src/bin/coreutils/lib/isnanl.c b/src/bin/coreutils/lib/isnanl.c new file mode 100644 index 0000000000..6af5a70bd6 --- /dev/null +++ b/src/bin/coreutils/lib/isnanl.c @@ -0,0 +1,20 @@ +/* Test for NaN that does not need libm. + Copyright (C) 2007 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* Written by Bruno Haible , 2007. */ + +#define USE_LONG_DOUBLE +#include "isnan.c" diff --git a/src/bin/coreutils/lib/lchmod.h b/src/bin/coreutils/lib/lchmod.h deleted file mode 100644 index d12f94abf4..0000000000 --- a/src/bin/coreutils/lib/lchmod.h +++ /dev/null @@ -1,35 +0,0 @@ -/* Provide a replacement for lchmod on hosts that lack it. - - Copyright (C) 2005 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ - -/* Written by Paul Eggert. */ - -#include -#include - -#ifndef HAVE_LCHMOD - -/* The lchmod replacement follows symbolic links. Callers should take - this into account; lchmod should be applied only to arguments that - are known to not be symbolic links. On hosts that lack lchmod, - this can lead to race conditions between the check and the - invocation of lchmod, but we know of no workarounds that are - reliable in general. You might try requesting support for lchmod - from your operating system supplier. */ - -# define lchmod chmod -#endif diff --git a/src/bin/coreutils/lib/lchown.c b/src/bin/coreutils/lib/lchown.c index fa0826edb9..07aef87394 100644 --- a/src/bin/coreutils/lib/lchown.c +++ b/src/bin/coreutils/lib/lchown.c @@ -1,12 +1,12 @@ /* Provide a stub lchown function for systems that lack it. - Copyright (C) 1998, 1999, 2002, 2004, 2006 Free Software + Copyright (C) 1998, 1999, 2002, 2004, 2006, 2007 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,17 +14,32 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* written by Jim Meyering */ #include -#include "lchown.h" +/* If the system chown does not follow symlinks, we don't want it + replaced by gnulib's chown, which does follow symlinks. */ +#if CHOWN_MODIFIES_SYMLINK +# define REPLACE_CHOWN 0 +#endif +#include +#include #include +/* Some systems don't have EOPNOTSUPP. */ +#ifndef EOPNOTSUPP +# ifdef ENOTSUP +# define EOPNOTSUPP ENOTSUP +# else +/* Some systems don't have ENOTSUP either. */ +# define EOPNOTSUPP EINVAL +# endif +#endif + /* Work just like chown, except when FILE is a symbolic link. In that case, set errno to EOPNOTSUPP and return -1. But if autoconf tests determined that chown modifies diff --git a/src/bin/coreutils/lib/lchown.h b/src/bin/coreutils/lib/lchown.h deleted file mode 100644 index 6816d1f129..0000000000 --- a/src/bin/coreutils/lib/lchown.h +++ /dev/null @@ -1,42 +0,0 @@ -/* Declare a replacement for lchown on hosts that lack it. - - Copyright (C) 2006 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ - -/* Written by Jim Meyering. */ - -#include -#include -#include - -#if HAVE_DECL_LCHOWN -# if ! HAVE_LCHOWN -# undef lchown -# define lchown rpl_chown -# endif -#else -int lchown (char const *, uid_t, gid_t); -#endif - -/* Some systems don't have EOPNOTSUPP. */ -#ifndef EOPNOTSUPP -# ifdef ENOTSUP -# define EOPNOTSUPP ENOTSUP -# else -/* Some systems don't have ENOTSUP either. */ -# define EOPNOTSUPP EINVAL -# endif -#endif diff --git a/src/bin/coreutils/lib/linebuffer.c b/src/bin/coreutils/lib/linebuffer.c index 3f1e45b285..90e4cca869 100644 --- a/src/bin/coreutils/lib/linebuffer.c +++ b/src/bin/coreutils/lib/linebuffer.c @@ -1,12 +1,12 @@ /* linebuffer.c -- read arbitrarily long lines - Copyright (C) 1986, 1991, 1998, 1999, 2001, 2003, 2004, 2006 Free - Software Foundation, Inc. + Copyright (C) 1986, 1991, 1998, 1999, 2001, 2003, 2004, 2006, 2007 + Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Richard Stallman. */ @@ -40,17 +39,25 @@ initbuffer (struct linebuffer *linebuffer) memset (linebuffer, 0, sizeof *linebuffer); } +struct linebuffer * +readlinebuffer (struct linebuffer *linebuffer, FILE *stream) +{ + return readlinebuffer_delim (linebuffer, stream, '\n'); +} + /* Read an arbitrarily long line of text from STREAM into LINEBUFFER. - Keep the newline; append a newline if it's the last line of a file - that ends in a non-newline character. Do not null terminate. + Consider lines to be terminated by DELIMITER. + Keep the delimiter; append DELIMITER if it's the last line of a file + that ends in a character other than DELIMITER. Do not NUL-terminate. Therefore the stream can contain NUL bytes, and the length - (including the newline) is returned in linebuffer->length. + (including the delimiter) is returned in linebuffer->length. Return NULL when stream is empty. Return NULL and set errno upon error; callers can distinguish this case from the empty case by invoking ferror (stream). Otherwise, return LINEBUFFER. */ struct linebuffer * -readlinebuffer (struct linebuffer *linebuffer, FILE *stream) +readlinebuffer_delim (struct linebuffer *linebuffer, FILE *stream, + char delimiter) { int c; char *buffer = linebuffer->buffer; @@ -67,9 +74,9 @@ readlinebuffer (struct linebuffer *linebuffer, FILE *stream) { if (p == buffer || ferror (stream)) return NULL; - if (p[-1] == '\n') + if (p[-1] == delimiter) break; - c = '\n'; + c = delimiter; } if (p == end) { @@ -81,7 +88,7 @@ readlinebuffer (struct linebuffer *linebuffer, FILE *stream) } *p++ = c; } - while (c != '\n'); + while (c != delimiter); linebuffer->length = p - buffer; return linebuffer; diff --git a/src/bin/coreutils/lib/linebuffer.h b/src/bin/coreutils/lib/linebuffer.h index 16b4b5afd1..db41103045 100644 --- a/src/bin/coreutils/lib/linebuffer.h +++ b/src/bin/coreutils/lib/linebuffer.h @@ -1,12 +1,12 @@ /* linebuffer.h -- declarations for reading arbitrarily long lines - Copyright (C) 1986, 1991, 1998, 1999, 2002, 2003 Free Software + Copyright (C) 1986, 1991, 1998, 1999, 2002, 2003, 2007 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ #if !defined LINEBUFFER_H # define LINEBUFFER_H @@ -34,10 +33,18 @@ struct linebuffer /* Initialize linebuffer LINEBUFFER for use. */ void initbuffer (struct linebuffer *linebuffer); +/* Read an arbitrarily long line of text from STREAM into LINEBUFFER. + Consider lines to be terminated by DELIMITER. + Keep the delimiter; append DELIMITER if we reach EOF and it wasn't + the last character in the file. Do not NUL-terminate. + Return LINEBUFFER, except at end of file return NULL. */ +struct linebuffer *readlinebuffer_delim (struct linebuffer *linebuffer, + FILE *stream, char delimiter); + /* Read an arbitrarily long line of text from STREAM into LINEBUFFER. Keep the newline; append a newline if it's the last line of a file - that ends in a non-newline character. Do not null terminate. - Return LINEBUFFER, except at end of file return 0. */ + that ends in a non-newline character. Do not NUL-terminate. + Return LINEBUFFER, except at end of file return NULL. */ struct linebuffer *readlinebuffer (struct linebuffer *linebuffer, FILE *stream); /* Free linebuffer LINEBUFFER and its data, all allocated with malloc. */ diff --git a/src/bin/coreutils/lib/localcharset.c b/src/bin/coreutils/lib/localcharset.c index 248faa0190..2044243cc4 100644 --- a/src/bin/coreutils/lib/localcharset.c +++ b/src/bin/coreutils/lib/localcharset.c @@ -1,10 +1,13 @@ +/* -*- buffer-read-only: t -*- vi: set ro: */ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 /* Determine a canonical name for the current locale's character encoding. - Copyright (C) 2000-2006 Free Software Foundation, Inc. + Copyright (C) 2000-2006, 2008-2009 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) + the Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -28,13 +31,19 @@ #include #include +#if defined __APPLE__ && defined __MACH__ && HAVE_LANGINFO_CODESET +# define DARWIN7 /* Darwin 7 or newer, i.e. MacOS X 10.3 or newer */ +#endif + #if defined _WIN32 || defined __WIN32__ # define WIN32_NATIVE #endif #if defined __EMX__ /* Assume EMX program runs on OS/2, even if compiled under DOS. */ -# define OS2 +# ifndef OS2 +# define OS2 +# endif #endif #if !defined WIN32_NATIVE @@ -110,7 +119,7 @@ get_charset_aliases (void) cp = charset_aliases; if (cp == NULL) { -#if !(defined VMS || defined WIN32_NATIVE || defined __CYGWIN__ || (defined(__BEOS__) || defined(__HAIKU__))) +#if !(defined DARWIN7 || defined VMS || defined WIN32_NATIVE || defined __CYGWIN__ || defined __BEOS__ || defined __HAIKU__) FILE *fp; const char *dir; const char *base = "charset.alias"; @@ -211,6 +220,39 @@ get_charset_aliases (void) #else +# if defined DARWIN7 + /* To avoid the trouble of installing a file that is shared by many + GNU packages -- many packaging systems have problems with this --, + simply inline the aliases here. */ + cp = "ISO8859-1" "\0" "ISO-8859-1" "\0" + "ISO8859-2" "\0" "ISO-8859-2" "\0" + "ISO8859-4" "\0" "ISO-8859-4" "\0" + "ISO8859-5" "\0" "ISO-8859-5" "\0" + "ISO8859-7" "\0" "ISO-8859-7" "\0" + "ISO8859-9" "\0" "ISO-8859-9" "\0" + "ISO8859-13" "\0" "ISO-8859-13" "\0" + "ISO8859-15" "\0" "ISO-8859-15" "\0" + "KOI8-R" "\0" "KOI8-R" "\0" + "KOI8-U" "\0" "KOI8-U" "\0" + "CP866" "\0" "CP866" "\0" + "CP949" "\0" "CP949" "\0" + "CP1131" "\0" "CP1131" "\0" + "CP1251" "\0" "CP1251" "\0" + "eucCN" "\0" "GB2312" "\0" + "GB2312" "\0" "GB2312" "\0" + "eucJP" "\0" "EUC-JP" "\0" + "eucKR" "\0" "EUC-KR" "\0" + "Big5" "\0" "BIG5" "\0" + "Big5HKSCS" "\0" "BIG5-HKSCS" "\0" + "GBK" "\0" "GBK" "\0" + "GB18030" "\0" "GB18030" "\0" + "SJIS" "\0" "SHIFT_JIS" "\0" + "ARMSCII-8" "\0" "ARMSCII-8" "\0" + "PT154" "\0" "PT154" "\0" + /*"ISCII-DEV" "\0" "?" "\0"*/ + "*" "\0" "UTF-8" "\0"; +# endif + # if defined VMS /* To avoid the troubles of an extra file charset.alias_vms in the sources of many GNU packages, simply inline the aliases here. */ @@ -265,6 +307,14 @@ get_charset_aliases (void) "CP54936" "\0" "GB18030" "\0" "CP65001" "\0" "UTF-8" "\0"; # endif + +# if defined __BEOS__ || defined __HAIKU__ + /* To avoid the troubles of installing a separate file in the same + directory as the DLL and of retrieving the DLL's directory at + runtime, simply inline the aliases here. */ + cp = "UTF-8" "\0"; +# endif + #endif charset_aliases = cp; diff --git a/src/bin/coreutils/lib/localcharset.h b/src/bin/coreutils/lib/localcharset.h index 5030210d11..19567efacf 100644 --- a/src/bin/coreutils/lib/localcharset.h +++ b/src/bin/coreutils/lib/localcharset.h @@ -1,10 +1,13 @@ +/* -*- buffer-read-only: t -*- vi: set ro: */ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 /* Determine a canonical name for the current locale's character encoding. Copyright (C) 2000-2003 Free Software Foundation, Inc. This file is part of the GNU CHARSET Library. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) + the Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/src/bin/coreutils/lib/long-options.c b/src/bin/coreutils/lib/long-options.c index fb61661aac..0286bdf98c 100644 --- a/src/bin/coreutils/lib/long-options.c +++ b/src/bin/coreutils/lib/long-options.c @@ -3,10 +3,10 @@ Copyright (C) 1993, 1994, 1998, 1999, 2000, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Jim Meyering. */ diff --git a/src/bin/coreutils/lib/long-options.h b/src/bin/coreutils/lib/long-options.h index 03106a8def..36ecb333c1 100644 --- a/src/bin/coreutils/lib/long-options.h +++ b/src/bin/coreutils/lib/long-options.h @@ -1,10 +1,10 @@ /* long-options.h -- declaration for --help- and --version-handling function. Copyright (C) 1993, 1994, 1998, 1999, 2003 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Jim Meyering. */ diff --git a/src/bin/coreutils/lib/lseek.c b/src/bin/coreutils/lib/lseek.c new file mode 100644 index 0000000000..a9178400dd --- /dev/null +++ b/src/bin/coreutils/lib/lseek.c @@ -0,0 +1,65 @@ +/* -*- buffer-read-only: t -*- vi: set ro: */ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 +/* An lseek() function that detects pipes. + Copyright (C) 2007 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + +#include + +/* Specification. */ +#include + +#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +/* Windows platforms. */ +/* Get GetFileType. */ +# include +#else +# include +#endif +#include + +#undef lseek + +off_t +rpl_lseek (int fd, off_t offset, int whence) +{ +#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ + /* mingw lseek mistakenly succeeds on pipes, sockets, and terminals. */ + HANDLE h = (HANDLE) _get_osfhandle (fd); + if (h == INVALID_HANDLE_VALUE) + { + errno = EBADF; + return -1; + } + if (GetFileType (h) != FILE_TYPE_DISK) + { + errno = ESPIPE; + return -1; + } +#else + /* BeOS lseek mistakenly succeeds on pipes... */ + struct stat statbuf; + if (fstat (fd, &statbuf) < 0) + return -1; + if (!S_ISREG (statbuf.st_mode)) + { + errno = ESPIPE; + return -1; + } +#endif + return lseek (fd, offset, whence); +} diff --git a/src/bin/coreutils/lib/lstat.c b/src/bin/coreutils/lib/lstat.c index 77dd22859c..3e07270801 100644 --- a/src/bin/coreutils/lib/lstat.c +++ b/src/bin/coreutils/lib/lstat.c @@ -1,12 +1,11 @@ /* Work around a bug of lstat on some systems - Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free - Software Foundation, Inc. + Copyright (C) 1997-1999, 2000-2006, 2008 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,20 +13,27 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* written by Jim Meyering */ #include -/* The specification of these functions is in sys_stat.h. But we cannot - include this include file here, because on some systems, a - "#define lstat lstat64" is being used, and sys_stat.h deletes this - definition. */ - +/* Get the original definition of open. It might be defined as a macro. */ +#define __need_system_sys_stat_h #include #include +#undef __need_system_sys_stat_h + +static inline int +orig_lstat (const char *filename, struct stat *buf) +{ + return lstat (filename, buf); +} + +/* Specification. */ +#include + #include #include @@ -48,7 +54,7 @@ int rpl_lstat (const char *file, struct stat *sbuf) { size_t len; - int lstat_result = lstat (file, sbuf); + int lstat_result = orig_lstat (file, sbuf); if (lstat_result != 0 || !S_ISLNK (sbuf->st_mode)) return lstat_result; diff --git a/src/bin/coreutils/lib/lstat.h b/src/bin/coreutils/lib/lstat.h deleted file mode 100644 index 6a83fbf8fe..0000000000 --- a/src/bin/coreutils/lib/lstat.h +++ /dev/null @@ -1,24 +0,0 @@ -/* Retrieving information about files. - Copyright (C) 2005 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ - -#include - -#if !LSTAT_FOLLOWS_SLASHED_SYMLINK -extern int rpl_lstat (const char *name, struct stat *buf); -# undef lstat -# define lstat rpl_lstat -#endif diff --git a/src/bin/coreutils/lib/malloc.c b/src/bin/coreutils/lib/malloc.c index d4dae3e182..2c10d78fbe 100644 --- a/src/bin/coreutils/lib/malloc.c +++ b/src/bin/coreutils/lib/malloc.c @@ -1,10 +1,13 @@ +/* -*- buffer-read-only: t -*- vi: set ro: */ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 /* malloc() function that is glibc compatible. - Copyright (C) 1997, 1998, 2006 Free Software Foundation, Inc. + Copyright (C) 1997, 1998, 2006, 2007 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) + the Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -16,20 +19,42 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -/* written by Jim Meyering */ +/* written by Jim Meyering and Bruno Haible */ #include -#undef malloc +/* Only the AC_FUNC_MALLOC macro defines 'malloc' already in config.h. */ +#ifdef malloc +# define NEED_MALLOC_GNU +# undef malloc +#endif +/* Specification. */ #include +#include + +/* Call the system's malloc below. */ +#undef malloc + /* Allocate an N-byte block of memory from the heap. If N is zero, allocate a 1-byte block. */ void * rpl_malloc (size_t n) { + void *result; + +#ifdef NEED_MALLOC_GNU if (n == 0) n = 1; - return malloc (n); +#endif + + result = malloc (n); + +#if !HAVE_MALLOC_POSIX + if (result == NULL) + errno = ENOMEM; +#endif + + return result; } diff --git a/src/bin/coreutils/lib/allocsa.c b/src/bin/coreutils/lib/malloca.c similarity index 73% rename from src/bin/coreutils/lib/allocsa.c rename to src/bin/coreutils/lib/malloca.c index 97652e6889..9a51538e08 100644 --- a/src/bin/coreutils/lib/allocsa.c +++ b/src/bin/coreutils/lib/malloca.c @@ -1,10 +1,13 @@ +/* -*- buffer-read-only: t -*- vi: set ro: */ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 /* Safe automatic memory allocation. - Copyright (C) 2003, 2006 Free Software Foundation, Inc. + Copyright (C) 2003, 2006-2007 Free Software Foundation, Inc. Written by Bruno Haible , 2003. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) + the Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -19,27 +22,27 @@ #include /* Specification. */ -#include "allocsa.h" +#include "malloca.h" -/* The speed critical point in this file is freesa() applied to an alloca() +/* The speed critical point in this file is freea() applied to an alloca() result: it must be fast, to match the speed of alloca(). The speed of - mallocsa() and freesa() in the other case are not critical, because they + mmalloca() and freea() in the other case are not critical, because they are only invoked for big memory sizes. */ #if HAVE_ALLOCA -/* Store the mallocsa() results in a hash table. This is needed to reliably - distinguish a mallocsa() result and an alloca() result. +/* Store the mmalloca() results in a hash table. This is needed to reliably + distinguish a mmalloca() result and an alloca() result. Although it is possible that the same pointer is returned by alloca() and - by mallocsa() at different times in the same application, it does not lead - to a bug in freesa(), because: + by mmalloca() at different times in the same application, it does not lead + to a bug in freea(), because: - Before a pointer returned by alloca() can point into malloc()ed memory, the function must return, and once this has happened the programmer must - not call freesa() on it anyway. - - Before a pointer returned by mallocsa() can point into the stack, it - must be freed. The only function that can free it is freesa(), and - when freesa() frees it, it also removes it from the hash table. */ + not call freea() on it anyway. + - Before a pointer returned by mmalloca() can point into the stack, it + must be freed. The only function that can free it is freea(), and + when freea() frees it, it also removes it from the hash table. */ #define MAGIC_NUMBER 0x1415fb4a #define MAGIC_SIZE sizeof (int) @@ -57,16 +60,16 @@ typedef int verify1[2 * (HEADER_SIZE == sizeof (struct header)) - 1]; table resizable, because when the hash table gets filled so much that the lookup becomes slow, it means that the application has memory leaks. */ #define HASH_TABLE_SIZE 257 -static void * mallocsa_results[HASH_TABLE_SIZE]; +static void * mmalloca_results[HASH_TABLE_SIZE]; #endif void * -mallocsa (size_t n) +mmalloca (size_t n) { #if HAVE_ALLOCA /* Allocate one more word, that serves as an indicator for malloc()ed - memory, so that freesa() of an alloca() result is fast. */ + memory, so that freea() of an alloca() result is fast. */ size_t nplus = n + HEADER_SIZE; if (nplus >= n) @@ -84,8 +87,8 @@ mallocsa (size_t n) /* Enter p into the hash table. */ slot = (unsigned long) p % HASH_TABLE_SIZE; - ((struct header *) (p - HEADER_SIZE))->next = mallocsa_results[slot]; - mallocsa_results[slot] = p; + ((struct header *) (p - HEADER_SIZE))->next = mmalloca_results[slot]; + mmalloca_results[slot] = p; return p; } @@ -103,21 +106,21 @@ mallocsa (size_t n) #if HAVE_ALLOCA void -freesa (void *p) +freea (void *p) { - /* mallocsa() may have returned NULL. */ + /* mmalloca() may have returned NULL. */ if (p != NULL) { - /* Attempt to quickly distinguish the mallocsa() result - which has + /* Attempt to quickly distinguish the mmalloca() result - which has a magic indicator word - and the alloca() result - which has an uninitialized indicator word. It is for this test that sa_increment additional bytes are allocated in the alloca() case. */ if (((int *) p)[-1] == MAGIC_NUMBER) { - /* Looks like a mallocsa() result. To see whether it really is one, + /* Looks like a mmalloca() result. To see whether it really is one, perform a lookup in the hash table. */ size_t slot = (unsigned long) p % HASH_TABLE_SIZE; - void **chain = &mallocsa_results[slot]; + void **chain = &mmalloca_results[slot]; for (; *chain != NULL;) { if (*chain == p) @@ -131,7 +134,7 @@ freesa (void *p) chain = &((struct header *) ((char *) *chain - HEADER_SIZE))->next; } } - /* At this point, we know it was not a mallocsa() result. */ + /* At this point, we know it was not a mmalloca() result. */ } } #endif diff --git a/src/bin/coreutils/lib/allocsa.h b/src/bin/coreutils/lib/malloca.h similarity index 75% rename from src/bin/coreutils/lib/allocsa.h rename to src/bin/coreutils/lib/malloca.h index 3337110eb6..6259405cf8 100644 --- a/src/bin/coreutils/lib/allocsa.h +++ b/src/bin/coreutils/lib/malloca.h @@ -1,10 +1,13 @@ +/* -*- buffer-read-only: t -*- vi: set ro: */ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 /* Safe automatic memory allocation. Copyright (C) 2003-2007 Free Software Foundation, Inc. Written by Bruno Haible , 2003. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) + the Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -16,8 +19,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#ifndef _ALLOCSA_H -#define _ALLOCSA_H +#ifndef _MALLOCA_H +#define _MALLOCA_H #include #include @@ -46,33 +49,43 @@ extern "C" { This must be a macro, not an inline function. */ # define safe_alloca(N) ((N) < 4032 ? alloca (N) : NULL) #else -# define safe_alloca(N) ((N), NULL) +# define safe_alloca(N) ((void) (N), NULL) #endif -/* allocsa(N) is a safe variant of alloca(N). It allocates N bytes of - memory allocated on the stack, that must be freed using freesa() before +/* malloca(N) is a safe variant of alloca(N). It allocates N bytes of + memory allocated on the stack, that must be freed using freea() before the function returns. Upon failure, it returns NULL. */ #if HAVE_ALLOCA -# define allocsa(N) \ +# define malloca(N) \ ((N) < 4032 - sa_increment \ ? (void *) ((char *) alloca ((N) + sa_increment) + sa_increment) \ - : mallocsa (N)) + : mmalloca (N)) #else -# define allocsa(N) \ - mallocsa (N) +# define malloca(N) \ + mmalloca (N) #endif -extern void * mallocsa (size_t n); +extern void * mmalloca (size_t n); -/* Free a block of memory allocated through allocsa(). */ +/* Free a block of memory allocated through malloca(). */ #if HAVE_ALLOCA -extern void freesa (void *p); +extern void freea (void *p); #else -# define freesa free +# define freea free #endif -/* Maybe we should also define a variant - nallocsa (size_t n, size_t s) - behaves like allocsa (n * s) - If this would be useful in your application. please speak up. */ +/* nmalloca(N,S) is an overflow-safe variant of malloca (N * S). + It allocates an array of N objects, each with S bytes of memory, + on the stack. S must be positive and N must be nonnegative. + The array must be freed using freea() before the function returns. */ +#if 1 +/* Cf. the definition of xalloc_oversized. */ +# define nmalloca(n, s) \ + ((n) > (size_t) (sizeof (ptrdiff_t) <= sizeof (size_t) ? -1 : -2) / (s) \ + ? NULL \ + : malloca ((n) * (s))) +#else +extern void * nmalloca (size_t n, size_t s); +#endif #ifdef __cplusplus @@ -109,20 +122,16 @@ enum #if HAVE_LONG_LONG_INT sa_alignment_longlong = sa_alignof (long long), #endif -#if HAVE_LONG_DOUBLE sa_alignment_longdouble = sa_alignof (long double), -#endif sa_alignment_max = ((sa_alignment_long - 1) | (sa_alignment_double - 1) #if HAVE_LONG_LONG_INT | (sa_alignment_longlong - 1) #endif -#if HAVE_LONG_DOUBLE | (sa_alignment_longdouble - 1) -#endif ) + 1, /* The increment that guarantees room for a magic word must be >= sizeof (int) and a multiple of sa_alignment_max. */ sa_increment = ((sizeof (int) + sa_alignment_max - 1) / sa_alignment_max) * sa_alignment_max }; -#endif /* _ALLOCSA_H */ +#endif /* _MALLOCA_H */ diff --git a/src/bin/coreutils/lib/allocsa.valgrind b/src/bin/coreutils/lib/malloca.valgrind similarity index 78% rename from src/bin/coreutils/lib/allocsa.valgrind rename to src/bin/coreutils/lib/malloca.valgrind index f4c77d6861..52f0a50f57 100644 --- a/src/bin/coreutils/lib/allocsa.valgrind +++ b/src/bin/coreutils/lib/malloca.valgrind @@ -1,7 +1,7 @@ -# Suppress a valgrind message about use of uninitialized memory in freesa(). +# Suppress a valgrind message about use of uninitialized memory in freea(). # This use is OK because it provides only a speedup. { - freesa + freea Memcheck:Cond - fun:freesa + fun:freea } diff --git a/src/bin/coreutils/lib/math.in.h b/src/bin/coreutils/lib/math.in.h new file mode 100644 index 0000000000..a0efefdacd --- /dev/null +++ b/src/bin/coreutils/lib/math.in.h @@ -0,0 +1,567 @@ +/* A GNU-like . + + Copyright (C) 2002-2003, 2007-2009 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#ifndef _GL_MATH_H + +#if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +#endif + +/* The include_next requires a split double-inclusion guard. */ +#@INCLUDE_NEXT_AS_FIRST_DIRECTIVE@ @NEXT_MATH_H@ + +#ifndef _GL_MATH_H +#define _GL_MATH_H + + +/* The definition of GL_LINK_WARNING is copied here. */ + + +#ifdef __cplusplus +extern "C" { +#endif + + +/* POSIX allows platforms that don't support NAN. But all major + machines in the past 15 years have supported something close to + IEEE NaN, so we define this unconditionally. We also must define + it on platforms like Solaris 10, where NAN is present but defined + as a function pointer rather than a floating point constant. */ +#if !defined NAN || @REPLACE_NAN@ +# undef NAN + /* The Compaq (ex-DEC) C 6.4 compiler chokes on the expression 0.0 / 0.0. */ +# ifdef __DECC +static float +_NaN () +{ + static float zero = 0.0f; + return zero / zero; +} +# define NAN (_NaN()) +# else +# define NAN (0.0f / 0.0f) +# endif +#endif + +/* Solaris 10 defines HUGE_VAL, but as a function pointer rather + than a floating point constant. */ +#if @REPLACE_HUGE_VAL@ +# undef HUGE_VAL +# define HUGE_VAL (1.0 / 0.0) +#endif + +/* Write x as + x = mantissa * 2^exp + where + If x finite and nonzero: 0.5 <= |mantissa| < 1.0. + If x is zero: mantissa = x, exp = 0. + If x is infinite or NaN: mantissa = x, exp unspecified. + Store exp in *EXPPTR and return mantissa. */ +#if @GNULIB_FREXP@ +# if @REPLACE_FREXP@ +# define frexp rpl_frexp +extern double frexp (double x, int *expptr); +# endif +#elif defined GNULIB_POSIXCHECK +# undef frexp +# define frexp(x,e) \ + (GL_LINK_WARNING ("frexp is unportable - " \ + "use gnulib module frexp for portability"), \ + frexp (x, e)) +#endif + + +#if @GNULIB_MATHL@ || !@HAVE_DECL_ACOSL@ +extern long double acosl (long double x); +#endif +#if !@GNULIB_MATHL@ && defined GNULIB_POSIXCHECK +# undef acosl +# define acosl(x) \ + (GL_LINK_WARNING ("acosl is unportable - " \ + "use gnulib module mathl for portability"), \ + acosl (x)) +#endif + + +#if @GNULIB_MATHL@ || !@HAVE_DECL_ASINL@ +extern long double asinl (long double x); +#endif +#if !@GNULIB_MATHL@ && defined GNULIB_POSIXCHECK +# undef asinl +# define asinl(x) \ + (GL_LINK_WARNING ("asinl is unportable - " \ + "use gnulib module mathl for portability"), \ + asinl (x)) +#endif + + +#if @GNULIB_MATHL@ || !@HAVE_DECL_ATANL@ +extern long double atanl (long double x); +#endif +#if !@GNULIB_MATHL@ && defined GNULIB_POSIXCHECK +# undef atanl +# define atanl(x) \ + (GL_LINK_WARNING ("atanl is unportable - " \ + "use gnulib module mathl for portability"), \ + atanl (x)) +#endif + + +#if @GNULIB_CEILF@ +# if @REPLACE_CEILF@ +# define ceilf rpl_ceilf +extern float ceilf (float x); +# endif +#elif defined GNULIB_POSIXCHECK +# undef ceilf +# define ceilf(x) \ + (GL_LINK_WARNING ("ceilf is unportable - " \ + "use gnulib module ceilf for portability"), \ + ceilf (x)) +#endif + +#if @GNULIB_CEILL@ +# if @REPLACE_CEILL@ +# define ceill rpl_ceill +extern long double ceill (long double x); +# endif +#elif defined GNULIB_POSIXCHECK +# undef ceill +# define ceill(x) \ + (GL_LINK_WARNING ("ceill is unportable - " \ + "use gnulib module ceill for portability"), \ + ceill (x)) +#endif + + +#if @GNULIB_MATHL@ || !@HAVE_DECL_COSL@ +extern long double cosl (long double x); +#endif +#if !@GNULIB_MATHL@ && defined GNULIB_POSIXCHECK +# undef cosl +# define cosl(x) \ + (GL_LINK_WARNING ("cosl is unportable - " \ + "use gnulib module mathl for portability"), \ + cosl (x)) +#endif + + +#if @GNULIB_MATHL@ || !@HAVE_DECL_EXPL@ +extern long double expl (long double x); +#endif +#if !@GNULIB_MATHL@ && defined GNULIB_POSIXCHECK +# undef expl +# define expl(x) \ + (GL_LINK_WARNING ("expl is unportable - " \ + "use gnulib module mathl for portability"), \ + expl (x)) +#endif + + +#if @GNULIB_FLOORF@ +# if @REPLACE_FLOORF@ +# define floorf rpl_floorf +extern float floorf (float x); +# endif +#elif defined GNULIB_POSIXCHECK +# undef floorf +# define floorf(x) \ + (GL_LINK_WARNING ("floorf is unportable - " \ + "use gnulib module floorf for portability"), \ + floorf (x)) +#endif + +#if @GNULIB_FLOORL@ +# if @REPLACE_FLOORL@ +# define floorl rpl_floorl +extern long double floorl (long double x); +# endif +#elif defined GNULIB_POSIXCHECK +# undef floorl +# define floorl(x) \ + (GL_LINK_WARNING ("floorl is unportable - " \ + "use gnulib module floorl for portability"), \ + floorl (x)) +#endif + + +/* Write x as + x = mantissa * 2^exp + where + If x finite and nonzero: 0.5 <= |mantissa| < 1.0. + If x is zero: mantissa = x, exp = 0. + If x is infinite or NaN: mantissa = x, exp unspecified. + Store exp in *EXPPTR and return mantissa. */ +#if @GNULIB_FREXPL@ && @REPLACE_FREXPL@ +# define frexpl rpl_frexpl +#endif +#if (@GNULIB_FREXPL@ && @REPLACE_FREXPL@) || !@HAVE_DECL_FREXPL@ +extern long double frexpl (long double x, int *expptr); +#endif +#if !@GNULIB_FREXPL@ && defined GNULIB_POSIXCHECK +# undef frexpl +# define frexpl(x,e) \ + (GL_LINK_WARNING ("frexpl is unportable - " \ + "use gnulib module frexpl for portability"), \ + frexpl (x, e)) +#endif + + +/* Return x * 2^exp. */ +#if @GNULIB_LDEXPL@ && @REPLACE_LDEXPL@ +# define ldexpl rpl_ldexpl +#endif +#if (@GNULIB_LDEXPL@ && @REPLACE_LDEXPL@) || !@HAVE_DECL_LDEXPL@ +extern long double ldexpl (long double x, int exp); +#endif +#if !@GNULIB_LDEXPL@ && defined GNULIB_POSIXCHECK +# undef ldexpl +# define ldexpl(x,e) \ + (GL_LINK_WARNING ("ldexpl is unportable - " \ + "use gnulib module ldexpl for portability"), \ + ldexpl (x, e)) +#endif + + +#if @GNULIB_MATHL@ || !@HAVE_DECL_LOGL@ +extern long double logl (long double x); +#endif +#if !@GNULIB_MATHL@ && defined GNULIB_POSIXCHECK +# undef logl +# define logl(x) \ + (GL_LINK_WARNING ("logl is unportable - " \ + "use gnulib module mathl for portability"), \ + logl (x)) +#endif + + +#if @GNULIB_ROUNDF@ +# if @REPLACE_ROUNDF@ +# undef roundf +# define roundf rpl_roundf +extern float roundf (float x); +# endif +#elif defined GNULIB_POSIXCHECK +# undef roundf +# define roundf(x) \ + (GL_LINK_WARNING ("roundf is unportable - " \ + "use gnulib module roundf for portability"), \ + roundf (x)) +#endif + +#if @GNULIB_ROUND@ +# if @REPLACE_ROUND@ +# undef round +# define round rpl_round +extern double round (double x); +# endif +#elif defined GNULIB_POSIXCHECK +# undef round +# define round(x) \ + (GL_LINK_WARNING ("round is unportable - " \ + "use gnulib module round for portability"), \ + round (x)) +#endif + +#if @GNULIB_ROUNDL@ +# if @REPLACE_ROUNDL@ +# undef roundl +# define roundl rpl_roundl +extern long double roundl (long double x); +# endif +#elif defined GNULIB_POSIXCHECK +# undef roundl +# define roundl(x) \ + (GL_LINK_WARNING ("roundl is unportable - " \ + "use gnulib module roundl for portability"), \ + roundl (x)) +#endif + + +#if @GNULIB_MATHL@ || !@HAVE_DECL_SINL@ +extern long double sinl (long double x); +#endif +#if !@GNULIB_MATHL@ && defined GNULIB_POSIXCHECK +# undef sinl +# define sinl(x) \ + (GL_LINK_WARNING ("sinl is unportable - " \ + "use gnulib module mathl for portability"), \ + sinl (x)) +#endif + + +#if @GNULIB_MATHL@ || !@HAVE_DECL_SQRTL@ +extern long double sqrtl (long double x); +#endif +#if !@GNULIB_MATHL@ && defined GNULIB_POSIXCHECK +# undef sqrtl +# define sqrtl(x) \ + (GL_LINK_WARNING ("sqrtl is unportable - " \ + "use gnulib module mathl for portability"), \ + sqrtl (x)) +#endif + + +#if @GNULIB_MATHL@ || !@HAVE_DECL_TANL@ +extern long double tanl (long double x); +#endif +#if !@GNULIB_MATHL@ && defined GNULIB_POSIXCHECK +# undef tanl +# define tanl(x) \ + (GL_LINK_WARNING ("tanl is unportable - " \ + "use gnulib module mathl for portability"), \ + tanl (x)) +#endif + + +#if @GNULIB_TRUNCF@ +# if !@HAVE_DECL_TRUNCF@ +# define truncf rpl_truncf +extern float truncf (float x); +# endif +#elif defined GNULIB_POSIXCHECK +# undef truncf +# define truncf(x) \ + (GL_LINK_WARNING ("truncf is unportable - " \ + "use gnulib module truncf for portability"), \ + truncf (x)) +#endif + +#if @GNULIB_TRUNC@ +# if !@HAVE_DECL_TRUNC@ +# define trunc rpl_trunc +extern double trunc (double x); +# endif +#elif defined GNULIB_POSIXCHECK +# undef trunc +# define trunc(x) \ + (GL_LINK_WARNING ("trunc is unportable - " \ + "use gnulib module trunc for portability"), \ + trunc (x)) +#endif + +#if @GNULIB_TRUNCL@ +# if @REPLACE_TRUNCL@ +# undef truncl +# define truncl rpl_truncl +extern long double truncl (long double x); +# endif +#elif defined GNULIB_POSIXCHECK +# undef truncl +# define truncl(x) \ + (GL_LINK_WARNING ("truncl is unportable - " \ + "use gnulib module truncl for portability"), \ + truncl (x)) +#endif + + +#if @GNULIB_ISFINITE@ +# if @REPLACE_ISFINITE@ +extern int gl_isfinitef (float x); +extern int gl_isfinited (double x); +extern int gl_isfinitel (long double x); +# undef isfinite +# define isfinite(x) \ + (sizeof (x) == sizeof (long double) ? gl_isfinitel (x) : \ + sizeof (x) == sizeof (double) ? gl_isfinited (x) : \ + gl_isfinitef (x)) +# endif +#elif defined GNULIB_POSIXCHECK + /* How to override a macro? */ +#endif + + +#if @GNULIB_ISINF@ +# if @REPLACE_ISINF@ +extern int gl_isinff (float x); +extern int gl_isinfd (double x); +extern int gl_isinfl (long double x); +# undef isinf +# define isinf(x) \ + (sizeof (x) == sizeof (long double) ? gl_isinfl (x) : \ + sizeof (x) == sizeof (double) ? gl_isinfd (x) : \ + gl_isinff (x)) +# endif +#elif defined GNULIB_POSIXCHECK + /* How to override a macro? */ +#endif + + +#if @GNULIB_ISNANF@ +/* Test for NaN for 'float' numbers. */ +# if @HAVE_ISNANF@ +/* The original included above provides a declaration of isnan macro + or (older) isnanf function. */ +# include +# if __GNUC__ >= 4 + /* GCC 4.0 and newer provides three built-ins for isnan. */ +# undef isnanf +# define isnanf(x) __builtin_isnanf ((float)(x)) +# elif defined isnan +# undef isnanf +# define isnanf(x) isnan ((float)(x)) +# endif +# else +/* Test whether X is a NaN. */ +# undef isnanf +# define isnanf rpl_isnanf +extern int isnanf (float x); +# endif +#endif + +#if @GNULIB_ISNAND@ +/* Test for NaN for 'double' numbers. + This function is a gnulib extension, unlike isnan() which applied only + to 'double' numbers earlier but now is a type-generic macro. */ +# if @HAVE_ISNAND@ +/* The original included above provides a declaration of isnan macro. */ +# include +# if __GNUC__ >= 4 + /* GCC 4.0 and newer provides three built-ins for isnan. */ +# undef isnand +# define isnand(x) __builtin_isnan ((double)(x)) +# else +# undef isnand +# define isnand(x) isnan ((double)(x)) +# endif +# else +/* Test whether X is a NaN. */ +# undef isnand +# define isnand rpl_isnand +extern int isnand (double x); +# endif +#endif + +#if @GNULIB_ISNANL@ +/* Test for NaN for 'long double' numbers. */ +# if @HAVE_ISNANL@ +/* The original included above provides a declaration of isnan macro or (older) isnanl function. */ +# include +# if __GNUC__ >= 4 + /* GCC 4.0 and newer provides three built-ins for isnan. */ +# undef isnanl +# define isnanl(x) __builtin_isnanl ((long double)(x)) +# elif defined isnan +# undef isnanl +# define isnanl(x) isnan ((long double)(x)) +# endif +# else +/* Test whether X is a NaN. */ +# undef isnanl +# define isnanl rpl_isnanl +extern int isnanl (long double x); +# endif +#endif + +/* This must come *after* the snippets for GNULIB_ISNANF and GNULIB_ISNANL! */ +#if @GNULIB_ISNAN@ +# if @REPLACE_ISNAN@ +/* We can't just use the isnanf macro (e.g.) as exposed by + isnanf.h (e.g.) here, because those may end up being macros + that recursively expand back to isnan. So use the gnulib + replacements for them directly. */ +# if @HAVE_ISNANF@ && __GNUC__ >= 4 +# define gl_isnan_f(x) __builtin_isnan ((float)(x)) +# else +extern int rpl_isnanf (float x); +# define gl_isnan_f(x) rpl_isnanf (x) +# endif +# if @HAVE_ISNAND@ && __GNUC__ >= 4 +# define gl_isnan_d(x) __builtin_isnan ((double)(x)) +# else +extern int rpl_isnand (double x); +# define gl_isnan_d(x) rpl_isnand (x) +# endif +# if @HAVE_ISNANL@ && __GNUC__ >= 4 +# define gl_isnan_l(x) __builtin_isnan ((long double)(x)) +# else +extern int rpl_isnanl (long double x); +# define gl_isnan_l(x) rpl_isnanl (x) +# endif +# undef isnan +# define isnan(x) \ + (sizeof (x) == sizeof (long double) ? gl_isnan_l (x) : \ + sizeof (x) == sizeof (double) ? gl_isnan_d (x) : \ + gl_isnan_f (x)) +# endif +#elif defined GNULIB_POSIXCHECK + /* How to override a macro? */ +#endif + + +#if @GNULIB_SIGNBIT@ +# if @REPLACE_SIGNBIT_USING_GCC@ +# undef signbit + /* GCC 4.0 and newer provides three built-ins for signbit. */ +# define signbit(x) \ + (sizeof (x) == sizeof (long double) ? __builtin_signbitl (x) : \ + sizeof (x) == sizeof (double) ? __builtin_signbit (x) : \ + __builtin_signbitf (x)) +# endif +# if @REPLACE_SIGNBIT@ +# undef signbit +extern int gl_signbitf (float arg); +extern int gl_signbitd (double arg); +extern int gl_signbitl (long double arg); +# if __GNUC__ >= 2 && !__STRICT_ANSI__ +# if defined FLT_SIGNBIT_WORD && defined FLT_SIGNBIT_BIT && !defined gl_signbitf +# define gl_signbitf_OPTIMIZED_MACRO +# define gl_signbitf(arg) \ + ({ union { float _value; \ + unsigned int _word[(sizeof (float) + sizeof (unsigned int) - 1) / sizeof (unsigned int)]; \ + } _m; \ + _m._value = (arg); \ + (_m._word[FLT_SIGNBIT_WORD] >> FLT_SIGNBIT_BIT) & 1; \ + }) +# endif +# if defined DBL_SIGNBIT_WORD && defined DBL_SIGNBIT_BIT && !defined gl_signbitd +# define gl_signbitd_OPTIMIZED_MACRO +# define gl_signbitd(arg) \ + ({ union { double _value; \ + unsigned int _word[(sizeof (double) + sizeof (unsigned int) - 1) / sizeof (unsigned int)]; \ + } _m; \ + _m._value = (arg); \ + (_m._word[DBL_SIGNBIT_WORD] >> DBL_SIGNBIT_BIT) & 1; \ + }) +# endif +# if defined LDBL_SIGNBIT_WORD && defined LDBL_SIGNBIT_BIT && !defined gl_signbitl +# define gl_signbitl_OPTIMIZED_MACRO +# define gl_signbitl(arg) \ + ({ union { long double _value; \ + unsigned int _word[(sizeof (long double) + sizeof (unsigned int) - 1) / sizeof (unsigned int)]; \ + } _m; \ + _m._value = (arg); \ + (_m._word[LDBL_SIGNBIT_WORD] >> LDBL_SIGNBIT_BIT) & 1; \ + }) +# endif +# endif +# define signbit(x) \ + (sizeof (x) == sizeof (long double) ? gl_signbitl (x) : \ + sizeof (x) == sizeof (double) ? gl_signbitd (x) : \ + gl_signbitf (x)) +# endif +#elif defined GNULIB_POSIXCHECK + /* How to override a macro? */ +#endif + + +#ifdef __cplusplus +} +#endif + +#endif /* _GL_MATH_H */ +#endif /* _GL_MATH_H */ diff --git a/src/bin/coreutils/lib/mbchar.c b/src/bin/coreutils/lib/mbchar.c index 95373f58ba..6fa14b09c0 100644 --- a/src/bin/coreutils/lib/mbchar.c +++ b/src/bin/coreutils/lib/mbchar.c @@ -1,9 +1,9 @@ /* Copyright (C) 2001, 2006 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -11,8 +11,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + along with this program. If not, see . */ #include diff --git a/src/bin/coreutils/lib/mbchar.h b/src/bin/coreutils/lib/mbchar.h index f3e28ef5ca..5d47a0a9c5 100644 --- a/src/bin/coreutils/lib/mbchar.h +++ b/src/bin/coreutils/lib/mbchar.h @@ -1,10 +1,10 @@ /* Multibyte character data type. - Copyright (C) 2001, 2005-2006 Free Software Foundation, Inc. + Copyright (C) 2001, 2005-2007 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + along with this program. If not, see . */ /* Written by Bruno Haible . */ @@ -157,8 +156,6 @@ #include #include -#include "wcwidth.h" - #define MBCHAR_BUF_SIZE 24 struct mbchar diff --git a/src/bin/coreutils/lib/mbiter.h b/src/bin/coreutils/lib/mbiter.h new file mode 100644 index 0000000000..b274da747e --- /dev/null +++ b/src/bin/coreutils/lib/mbiter.h @@ -0,0 +1,215 @@ +/* Iterating through multibyte strings: macros for multi-byte encodings. + Copyright (C) 2001, 2005, 2007 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* Written by Bruno Haible . */ + +/* The macros in this file implement forward iteration through a + multi-byte string. + + With these macros, an iteration loop that looks like + + char *iter; + for (iter = buf; iter < buf + buflen; iter++) + { + do_something (*iter); + } + + becomes + + mbi_iterator_t iter; + for (mbi_init (iter, buf, buflen); mbi_avail (iter); mbi_advance (iter)) + { + do_something (mbi_cur_ptr (iter), mb_len (mbi_cur (iter))); + } + + The benefit of these macros over plain use of mbrtowc is: + - Handling of invalid multibyte sequences is possible without + making the code more complicated, while still preserving the + invalid multibyte sequences. + + mbi_iterator_t + is a type usable for variable declarations. + + mbi_init (iter, startptr, length) + initializes the iterator, starting at startptr and crossing length bytes. + + mbi_avail (iter) + returns true if there are more multibyte chracters available before + the end of string is reached. In this case, mbi_cur (iter) is + initialized to the next multibyte chracter. + + mbi_advance (iter) + advances the iterator by one multibyte character. + + mbi_cur (iter) + returns the current multibyte character, of type mbchar_t. All the + macros defined in mbchar.h can be used on it. + + mbi_cur_ptr (iter) + return a pointer to the beginning of the current multibyte character. + + mbi_reloc (iter, ptrdiff) + relocates iterator when the string is moved by ptrdiff bytes. + + mbi_copy (&destiter, &srciter) + copies srciter to destiter. + + Here are the function prototypes of the macros. + + extern void mbi_init (mbi_iterator_t iter, + const char *startptr, size_t length); + extern bool mbi_avail (mbi_iterator_t iter); + extern void mbi_advance (mbi_iterator_t iter); + extern mbchar_t mbi_cur (mbi_iterator_t iter); + extern const char * mbi_cur_ptr (mbi_iterator_t iter); + extern void mbi_reloc (mbi_iterator_t iter, ptrdiff_t ptrdiff); + extern void mbi_copy (mbi_iterator_t *new, const mbi_iterator_t *old); + */ + +#ifndef _MBITER_H +#define _MBITER_H 1 + +#include +#include +#include +#include + +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.1 has a bug: and must be included before + . */ +#include +#include +#include + +#include "mbchar.h" + +struct mbiter_multi +{ + const char *limit; /* pointer to end of string */ + bool in_shift; /* true if next byte may not be interpreted as ASCII */ + mbstate_t state; /* if in_shift: current shift state */ + bool next_done; /* true if mbi_avail has already filled the following */ + struct mbchar cur; /* the current character: + const char *cur.ptr pointer to current character + The following are only valid after mbi_avail. + size_t cur.bytes number of bytes of current character + bool cur.wc_valid true if wc is a valid wide character + wchar_t cur.wc if wc_valid: the current character + */ +}; + +static inline void +mbiter_multi_next (struct mbiter_multi *iter) +{ + if (iter->next_done) + return; + if (iter->in_shift) + goto with_shift; + /* Handle most ASCII characters quickly, without calling mbrtowc(). */ + if (is_basic (*iter->cur.ptr)) + { + /* These characters are part of the basic character set. ISO C 99 + guarantees that their wide character code is identical to their + char code. */ + iter->cur.bytes = 1; + iter->cur.wc = *iter->cur.ptr; + iter->cur.wc_valid = true; + } + else + { + assert (mbsinit (&iter->state)); + iter->in_shift = true; + with_shift: + iter->cur.bytes = mbrtowc (&iter->cur.wc, iter->cur.ptr, + iter->limit - iter->cur.ptr, &iter->state); + if (iter->cur.bytes == (size_t) -1) + { + /* An invalid multibyte sequence was encountered. */ + iter->cur.bytes = 1; + iter->cur.wc_valid = false; + /* Whether to set iter->in_shift = false and reset iter->state + or not is not very important; the string is bogus anyway. */ + } + else if (iter->cur.bytes == (size_t) -2) + { + /* An incomplete multibyte character at the end. */ + iter->cur.bytes = iter->limit - iter->cur.ptr; + iter->cur.wc_valid = false; + /* Whether to set iter->in_shift = false and reset iter->state + or not is not important; the string end is reached anyway. */ + } + else + { + if (iter->cur.bytes == 0) + { + /* A null wide character was encountered. */ + iter->cur.bytes = 1; + assert (*iter->cur.ptr == '\0'); + assert (iter->cur.wc == 0); + } + iter->cur.wc_valid = true; + + /* When in the initial state, we can go back treating ASCII + characters more quickly. */ + if (mbsinit (&iter->state)) + iter->in_shift = false; + } + } + iter->next_done = true; +} + +static inline void +mbiter_multi_reloc (struct mbiter_multi *iter, ptrdiff_t ptrdiff) +{ + iter->cur.ptr += ptrdiff; + iter->limit += ptrdiff; +} + +static inline void +mbiter_multi_copy (struct mbiter_multi *new_iter, const struct mbiter_multi *old_iter) +{ + new_iter->limit = old_iter->limit; + if ((new_iter->in_shift = old_iter->in_shift)) + memcpy (&new_iter->state, &old_iter->state, sizeof (mbstate_t)); + else + memset (&new_iter->state, 0, sizeof (mbstate_t)); + new_iter->next_done = old_iter->next_done; + mb_copy (&new_iter->cur, &old_iter->cur); +} + +/* Iteration macros. */ +typedef struct mbiter_multi mbi_iterator_t; +#define mbi_init(iter, startptr, length) \ + ((iter).cur.ptr = (startptr), (iter).limit = (iter).cur.ptr + (length), \ + (iter).in_shift = false, memset (&(iter).state, '\0', sizeof (mbstate_t)), \ + (iter).next_done = false) +#define mbi_avail(iter) \ + ((iter).cur.ptr < (iter).limit && (mbiter_multi_next (&(iter)), true)) +#define mbi_advance(iter) \ + ((iter).cur.ptr += (iter).cur.bytes, (iter).next_done = false) + +/* Access to the current character. */ +#define mbi_cur(iter) (iter).cur +#define mbi_cur_ptr(iter) (iter).cur.ptr + +/* Relocation. */ +#define mbi_reloc(iter, ptrdiff) mbiter_multi_reloc (&iter, ptrdiff) + +/* Copying an iterator. */ +#define mbi_copy mbiter_multi_copy + +#endif /* _MBITER_H */ diff --git a/src/bin/coreutils/lib/mbrlen.c b/src/bin/coreutils/lib/mbrlen.c new file mode 100644 index 0000000000..32a0c8195c --- /dev/null +++ b/src/bin/coreutils/lib/mbrlen.c @@ -0,0 +1,32 @@ +/* Recognize multibyte character. + Copyright (C) 1999-2000, 2008 Free Software Foundation, Inc. + Written by Bruno Haible , 2008. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#include + +/* Specification. */ +#include + + +static mbstate_t internal_state; + +size_t +mbrlen (const char *s, size_t n, mbstate_t *ps) +{ + if (ps == NULL) + ps = &internal_state; + return mbrtowc (NULL, s, n, ps); +} diff --git a/src/bin/coreutils/lib/mbrtowc.c b/src/bin/coreutils/lib/mbrtowc.c new file mode 100644 index 0000000000..0fec5f1c9f --- /dev/null +++ b/src/bin/coreutils/lib/mbrtowc.c @@ -0,0 +1,386 @@ +/* Convert multibyte character to wide character. + Copyright (C) 1999-2002, 2005-2009 Free Software Foundation, Inc. + Written by Bruno Haible , 2008. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#include + +/* Specification. */ +#include + +#if GNULIB_defined_mbstate_t +/* Implement mbrtowc() on top of mbtowc(). */ + +# include +# include + +# include "localcharset.h" +# include "streq.h" +# include "verify.h" + + +verify (sizeof (mbstate_t) >= 4); + +static char internal_state[4]; + +size_t +mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps) +{ + char *pstate = (char *)ps; + + if (pstate == NULL) + pstate = internal_state; + + if (s == NULL) + { + pwc = NULL; + s = ""; + n = 1; + } + + if (n == 0) + return (size_t)(-2); + + /* Here n > 0. */ + { + size_t nstate = pstate[0]; + char buf[4]; + const char *p; + size_t m; + + switch (nstate) + { + case 0: + p = s; + m = n; + break; + case 3: + buf[2] = pstate[3]; + /*FALLTHROUGH*/ + case 2: + buf[1] = pstate[2]; + /*FALLTHROUGH*/ + case 1: + buf[0] = pstate[1]; + p = buf; + m = nstate; + buf[m++] = s[0]; + if (n >= 2 && m < 4) + { + buf[m++] = s[1]; + if (n >= 3 && m < 4) + buf[m++] = s[2]; + } + break; + default: + errno = EINVAL; + return (size_t)(-1); + } + + /* Here m > 0. */ + +# if __GLIBC__ + /* Work around bug */ + mbtowc (NULL, NULL, 0); +# endif + { + int res = mbtowc (pwc, p, m); + + if (res >= 0) + { + if (pwc != NULL && ((*pwc == 0) != (res == 0))) + abort (); + if (nstate >= (res > 0 ? res : 1)) + abort (); + res -= nstate; + pstate[0] = 0; + return res; + } + + /* mbtowc does not distinguish between invalid and incomplete multibyte + sequences. But mbrtowc needs to make this distinction. + There are two possible approaches: + - Use iconv() and its return value. + - Use built-in knowledge about the possible encodings. + Given the low quality of implementation of iconv() on the systems that + lack mbrtowc(), we use the second approach. + The possible encodings are: + - 8-bit encodings, + - EUC-JP, EUC-KR, GB2312, EUC-TW, BIG5, GB18030, SJIS, + - UTF-8. + Use specialized code for each. */ + if (m >= 4 || m >= MB_CUR_MAX) + goto invalid; + /* Here MB_CUR_MAX > 1 and 0 < m < 4. */ + { + const char *encoding = locale_charset (); + + if (STREQ (encoding, "UTF-8", 'U', 'T', 'F', '-', '8', 0, 0, 0, 0)) + { + /* Cf. unistr/u8-mblen.c. */ + unsigned char c = (unsigned char) p[0]; + + if (c >= 0xc2) + { + if (c < 0xe0) + { + if (m == 1) + goto incomplete; + } + else if (c < 0xf0) + { + if (m == 1) + goto incomplete; + if (m == 2) + { + unsigned char c2 = (unsigned char) p[1]; + + if ((c2 ^ 0x80) < 0x40 + && (c >= 0xe1 || c2 >= 0xa0) + && (c != 0xed || c2 < 0xa0)) + goto incomplete; + } + } + else if (c <= 0xf4) + { + if (m == 1) + goto incomplete; + else /* m == 2 || m == 3 */ + { + unsigned char c2 = (unsigned char) p[1]; + + if ((c2 ^ 0x80) < 0x40 + && (c >= 0xf1 || c2 >= 0x90) + && (c < 0xf4 || (c == 0xf4 && c2 < 0x90))) + { + if (m == 2) + goto incomplete; + else /* m == 3 */ + { + unsigned char c3 = (unsigned char) p[2]; + + if ((c3 ^ 0x80) < 0x40) + goto incomplete; + } + } + } + } + } + goto invalid; + } + + /* As a reference for this code, you can use the GNU libiconv + implementation. Look for uses of the RET_TOOFEW macro. */ + + if (STREQ (encoding, "EUC-JP", 'E', 'U', 'C', '-', 'J', 'P', 0, 0, 0)) + { + if (m == 1) + { + unsigned char c = (unsigned char) p[0]; + + if ((c >= 0xa1 && c < 0xff) || c == 0x8e || c == 0x8f) + goto incomplete; + } + if (m == 2) + { + unsigned char c = (unsigned char) p[0]; + + if (c == 0x8f) + { + unsigned char c2 = (unsigned char) p[1]; + + if (c2 >= 0xa1 && c2 < 0xff) + goto incomplete; + } + } + goto invalid; + } + if (STREQ (encoding, "EUC-KR", 'E', 'U', 'C', '-', 'K', 'R', 0, 0, 0) + || STREQ (encoding, "GB2312", 'G', 'B', '2', '3', '1', '2', 0, 0, 0) + || STREQ (encoding, "BIG5", 'B', 'I', 'G', '5', 0, 0, 0, 0, 0)) + { + if (m == 1) + { + unsigned char c = (unsigned char) p[0]; + + if (c >= 0xa1 && c < 0xff) + goto incomplete; + } + goto invalid; + } + if (STREQ (encoding, "EUC-TW", 'E', 'U', 'C', '-', 'T', 'W', 0, 0, 0)) + { + if (m == 1) + { + unsigned char c = (unsigned char) p[0]; + + if ((c >= 0xa1 && c < 0xff) || c == 0x8e) + goto incomplete; + } + else /* m == 2 || m == 3 */ + { + unsigned char c = (unsigned char) p[0]; + + if (c == 0x8e) + goto incomplete; + } + goto invalid; + } + if (STREQ (encoding, "GB18030", 'G', 'B', '1', '8', '0', '3', '0', 0, 0)) + { + if (m == 1) + { + unsigned char c = (unsigned char) p[0]; + + if ((c >= 0x90 && c <= 0xe3) || (c >= 0xf8 && c <= 0xfe)) + goto incomplete; + } + else /* m == 2 || m == 3 */ + { + unsigned char c = (unsigned char) p[0]; + + if (c >= 0x90 && c <= 0xe3) + { + unsigned char c2 = (unsigned char) p[1]; + + if (c2 >= 0x30 && c2 <= 0x39) + { + if (m == 2) + goto incomplete; + else /* m == 3 */ + { + unsigned char c3 = (unsigned char) p[2]; + + if (c3 >= 0x81 && c3 <= 0xfe) + goto incomplete; + } + } + } + } + goto invalid; + } + if (STREQ (encoding, "SJIS", 'S', 'J', 'I', 'S', 0, 0, 0, 0, 0)) + { + if (m == 1) + { + unsigned char c = (unsigned char) p[0]; + + if ((c >= 0x81 && c <= 0x9f) || (c >= 0xe0 && c <= 0xea) + || (c >= 0xf0 && c <= 0xf9)) + goto incomplete; + } + goto invalid; + } + + /* An unknown multibyte encoding. */ + goto incomplete; + } + + incomplete: + { + size_t k = nstate; + /* Here 0 <= k < m < 4. */ + pstate[++k] = s[0]; + if (k < m) + { + pstate[++k] = s[1]; + if (k < m) + pstate[++k] = s[2]; + } + if (k != m) + abort (); + } + pstate[0] = m; + return (size_t)(-2); + + invalid: + errno = EILSEQ; + /* The conversion state is undefined, says POSIX. */ + return (size_t)(-1); + } + } +} + +#else +/* Override the system's mbrtowc() function. */ + +# undef mbrtowc + +size_t +rpl_mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps) +{ +# if MBRTOWC_NULL_ARG_BUG || MBRTOWC_RETVAL_BUG + if (s == NULL) + { + pwc = NULL; + s = ""; + n = 1; + } +# endif + +# if MBRTOWC_RETVAL_BUG + { + static mbstate_t internal_state; + + /* Override mbrtowc's internal state. We can not call mbsinit() on the + hidden internal state, but we can call it on our variable. */ + if (ps == NULL) + ps = &internal_state; + + if (!mbsinit (ps)) + { + /* Parse the rest of the multibyte character byte for byte. */ + size_t count = 0; + for (; n > 0; s++, n--) + { + wchar_t wc; + size_t ret = mbrtowc (&wc, s, 1, ps); + + if (ret == (size_t)(-1)) + return (size_t)(-1); + count++; + if (ret != (size_t)(-2)) + { + /* The multibyte character has been completed. */ + if (pwc != NULL) + *pwc = wc; + return (wc == 0 ? 0 : count); + } + } + return (size_t)(-2); + } + } +# endif + +# if MBRTOWC_NUL_RETVAL_BUG + { + wchar_t wc; + size_t ret = mbrtowc (&wc, s, n, ps); + + if (ret != (size_t)(-1) && ret != (size_t)(-2)) + { + if (pwc != NULL) + *pwc = wc; + if (wc == 0) + ret = 0; + } + return ret; + } +# else + return mbrtowc (pwc, s, n, ps); +# endif +} + +#endif diff --git a/src/bin/coreutils/lib/mbsalign.c b/src/bin/coreutils/lib/mbsalign.c new file mode 100644 index 0000000000..bf90e05693 --- /dev/null +++ b/src/bin/coreutils/lib/mbsalign.c @@ -0,0 +1,236 @@ +/* Align/Truncate a string in a given screen width + Copyright (C) 2009 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* Written by Pádraig Brady. */ + +#include +#include "mbsalign.h" + +#include +#include +#include +#include +#include +#include +#include + +#ifndef MIN +# define MIN(a, b) ((a) < (b) ? (a) : (b)) +#endif + +/* Replace non printable chars. + Return 1 if replacement made, 0 otherwise. */ + +static bool +wc_ensure_printable (wchar_t *wchars) +{ + bool replaced = false; + wchar_t *wc = wchars; + while (*wc) + { + if (!iswprint ((wint_t) *wc)) + { + *wc = 0xFFFD; /* L'\uFFFD' (replacement char) */ + replaced = true; + } + wc++; + } + return replaced; +} + +/* Truncate wchar string to width cells. + * Returns number of cells used. */ + +static size_t +wc_truncate (wchar_t *wc, size_t width) +{ + size_t cells = 0; + int next_cells = 0; + + while (*wc) + { + next_cells = wcwidth (*wc); + if (next_cells == -1) /* non printable */ + { + *wc = 0xFFFD; /* L'\uFFFD' (replacement char) */ + next_cells = 1; + } + if (cells + next_cells > width) + break; + cells += next_cells; + wc++; + } + *wc = L'\0'; + return cells; +} + +/* FIXME: move this function to gnulib as it's missing on: + OpenBSD 3.8, IRIX 5.3, Solaris 2.5.1, mingw, BeOS */ + +static int +rpl_wcswidth (const wchar_t *s, size_t n) +{ + int ret = 0; + + while (n-- > 0 && *s != L'\0') + { + int nwidth = wcwidth (*s++); + if (nwidth == -1) /* non printable */ + return -1; + if (ret > (INT_MAX - nwidth)) /* overflow */ + return -1; + ret += nwidth; + } + + return ret; +} + +/* Write N_SPACES space characters to DEST while ensuring + nothing is written beyond DEST_END. A terminating NUL + is always added to DEST. + A pointer to the terminating NUL is returned. */ + +static char* +mbs_align_pad (char *dest, const char* dest_end, size_t n_spaces) +{ + /* FIXME: Should we pad with "figure space" (\u2007) + if non ascii data present? */ + while (n_spaces-- && (dest < dest_end)) + *dest++ = ' '; + *dest = '\0'; + return dest; +} + +/* Align a string, SRC, in a field of *WIDTH columns, handling multi-byte + characters; write the result into the DEST_SIZE-byte buffer, DEST. + ALIGNMENT specifies whether to left- or right-justify or to center. + If SRC requires more than *WIDTH columns, truncate it to fit. + When centering, the number of trailing spaces may be one less than the + number of leading spaces. The FLAGS parameter is unused at present. + Return the length in bytes required for the final result, not counting + the trailing NUL. A return value of DEST_SIZE or larger means there + wasn't enough space. DEST will be NUL terminated in any case. + Return (size_t) -1 upon error (invalid multi-byte sequence in SRC, + or malloc failure). + Update *WIDTH to indicate how many columns were used before padding. */ + +size_t +mbsalign (const char *src, char *dest, size_t dest_size, + size_t *width, mbs_align_t align, int flags) +{ + size_t ret = -1; + size_t src_size = strlen (src) + 1; + char *newstr = NULL; + wchar_t *str_wc = NULL; + const char *str_to_print = src; + size_t n_cols = src_size - 1; + size_t n_used_bytes = n_cols; /* Not including NUL */ + size_t n_spaces = 0; + bool conversion = false; + bool wc_enabled = false; + + /* In multi-byte locales convert to wide characters + to allow easy truncation. Also determine number + of screen columns used. */ + if (MB_CUR_MAX > 1) + { + size_t src_chars = mbstowcs (NULL, src, 0); + if (src_chars == (size_t) -1) + goto mbsalign_cleanup; + src_chars += 1; /* make space for NUL */ + str_wc = malloc (src_chars * sizeof (wchar_t)); + if (str_wc == NULL) + goto mbsalign_cleanup; + if (mbstowcs (str_wc, src, src_chars) > 0) + { + str_wc[src_chars - 1] = L'\0'; + wc_enabled = true; + conversion = wc_ensure_printable (str_wc); + n_cols = rpl_wcswidth (str_wc, src_chars); + } + } + + /* If we transformed or need to truncate the source string + then create a modified copy of it. */ + if (conversion || (n_cols > *width)) + { + newstr = malloc (src_size); + if (newstr == NULL) + goto mbsalign_cleanup; + str_to_print = newstr; + if (wc_enabled) + { + n_cols = wc_truncate (str_wc, *width); + n_used_bytes = wcstombs (newstr, str_wc, src_size); + } + else + { + n_cols = *width; + n_used_bytes = n_cols; + memcpy (newstr, src, n_cols); + newstr[n_cols] = '\0'; + } + } + + if (*width > n_cols) + n_spaces = *width - n_cols; + + /* indicate to caller how many cells needed (not including padding). */ + *width = n_cols; + + /* indicate to caller how many bytes needed (not including NUL). */ + ret = n_used_bytes + (n_spaces * 1); + + /* Write as much NUL terminated output to DEST as possible. */ + if (dest_size != 0) + { + char *dest_end = dest + dest_size - 1; + size_t start_spaces = n_spaces / 2 + n_spaces % 2; + size_t end_spaces = n_spaces / 2; + + switch (align) + { + case MBS_ALIGN_CENTER: + start_spaces = n_spaces / 2 + n_spaces % 2; + end_spaces = n_spaces / 2; + break; + case MBS_ALIGN_LEFT: + start_spaces = 0; + end_spaces = n_spaces; + break; + case MBS_ALIGN_RIGHT: + start_spaces = n_spaces; + end_spaces = 0; + break; + } + + dest = mbs_align_pad (dest, dest_end, start_spaces); + dest = mempcpy(dest, str_to_print, MIN (n_used_bytes, dest_end - dest)); + dest = mbs_align_pad (dest, dest_end, end_spaces); + } + +mbsalign_cleanup: + + free (str_wc); + free (newstr); + + return ret; +} +/* + * Local variables: + * indent-tabs-mode: nil + * End: + */ diff --git a/src/bin/coreutils/lib/mbsalign.h b/src/bin/coreutils/lib/mbsalign.h new file mode 100644 index 0000000000..3d92daee1d --- /dev/null +++ b/src/bin/coreutils/lib/mbsalign.h @@ -0,0 +1,23 @@ +/* Align/Truncate a string in a given screen width + Copyright (C) 2009 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#include + +typedef enum { MBS_ALIGN_LEFT, MBS_ALIGN_RIGHT, MBS_ALIGN_CENTER } mbs_align_t; + +size_t +mbsalign (const char *src, char *dest, size_t dest_size, + size_t *width, mbs_align_t align, int flags); diff --git a/src/bin/coreutils/lib/mbscasecmp.c b/src/bin/coreutils/lib/mbscasecmp.c index 8a2f434b1d..7fdfdeb3d6 100644 --- a/src/bin/coreutils/lib/mbscasecmp.c +++ b/src/bin/coreutils/lib/mbscasecmp.c @@ -1,12 +1,12 @@ /* Case-insensitive string comparison function. - Copyright (C) 1998-1999, 2005-2007 Free Software Foundation, Inc. + Copyright (C) 1998-1999, 2005-2008 Free Software Foundation, Inc. Written by Bruno Haible , 2005, based on earlier glibc code. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ #include @@ -25,9 +24,7 @@ #include #include -#if HAVE_MBRTOWC -# include "mbuiter.h" -#endif +#include "mbuiter.h" #define TOLOWER(Ch) (isupper (Ch) ? tolower (Ch) : (Ch)) @@ -45,7 +42,6 @@ mbscasecmp (const char *s1, const char *s2) /* Be careful not to look at the entire extent of s1 or s2 until needed. This is useful because when two strings differ, the difference is most often already in the very few first characters. */ -#if HAVE_MBRTOWC if (MB_CUR_MAX > 1) { mbui_iterator_t iter1; @@ -73,7 +69,6 @@ mbscasecmp (const char *s1, const char *s2) return 0; } else -#endif { const unsigned char *p1 = (const unsigned char *) s1; const unsigned char *p2 = (const unsigned char *) s2; diff --git a/src/bin/coreutils/lib/mbsinit.c b/src/bin/coreutils/lib/mbsinit.c new file mode 100644 index 0000000000..81fed5a12b --- /dev/null +++ b/src/bin/coreutils/lib/mbsinit.c @@ -0,0 +1,47 @@ +/* Test for initial conversion state. + Copyright (C) 2008 Free Software Foundation, Inc. + Written by Bruno Haible , 2008. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#include + +/* Specification. */ +#include + +#include "verify.h" + +/* Platforms that lack mbsinit() also lack mbrlen(), mbrtowc(), mbsrtowcs() + and wcrtomb(), wcsrtombs(). + We assume that + - sizeof (mbstate_t) >= 4, + - only stateless encodings are supported (such as UTF-8 and EUC-JP, but + not ISO-2022 variants), + - for each encoding, the number of bytes for a wide character is <= 4. + (This maximum is attained for UTF-8, GB18030, EUC-TW.) + We define the meaning of mbstate_t as follows: + - In mb -> wc direction, mbstate_t's first byte contains the number of + buffered bytes (in the range 0..3), followed by up to 3 buffered bytes. + - In wc -> mb direction, mbstate_t contains no information. In other + words, it is always in the initial state. */ + +verify (sizeof (mbstate_t) >= 4); + +int +mbsinit (const mbstate_t *ps) +{ + const char *pstate = (const char *)ps; + + return pstate[0] == 0; +} diff --git a/src/bin/coreutils/lib/mbslen.c b/src/bin/coreutils/lib/mbslen.c new file mode 100644 index 0000000000..2dd6ea8bb6 --- /dev/null +++ b/src/bin/coreutils/lib/mbslen.c @@ -0,0 +1,44 @@ +/* Counting the multibyte characters in a string. + Copyright (C) 2007-2008 Free Software Foundation, Inc. + Written by Bruno Haible , 2007. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#include + +/* Specification. */ +#include + +#include + +#include "mbuiter.h" + +/* Return the number of multibyte characters in the character string STRING. */ +size_t +mbslen (const char *string) +{ + if (MB_CUR_MAX > 1) + { + size_t count; + mbui_iterator_t iter; + + count = 0; + for (mbui_init (iter, string); mbui_avail (iter); mbui_advance (iter)) + count++; + + return count; + } + else + return strlen (string); +} diff --git a/src/bin/coreutils/lib/mbsrtowcs-state.c b/src/bin/coreutils/lib/mbsrtowcs-state.c new file mode 100644 index 0000000000..89011183fd --- /dev/null +++ b/src/bin/coreutils/lib/mbsrtowcs-state.c @@ -0,0 +1,37 @@ +/* Convert string to wide string. + Copyright (C) 2008-2009 Free Software Foundation, Inc. + Written by Bruno Haible , 2008. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#include + +#include + +/* Internal state used by the functions mbsrtowcs() and mbsnrtowcs(). */ +mbstate_t _gl_mbsrtowcs_state +/* The state must initially be in the "initial state"; so, zero-initialize it. + On most systems, putting it into BSS is sufficient. Not so on MacOS X 10.3, + see . + When it needs an initializer, use 0 or {0} as initializer? 0 only works + when mbstate_t is a scalar type (such as when gnulib defines it, or on + AIX, IRIX, mingw). {0} works as an initializer in all cases: for a struct + or union type, but also for a scalar type (ISO C 99, 6.7.8.(11)). */ +#if defined __ELF__ + /* On ELF systems, variables in BSS behave well. */ +#else + /* Use braces, to be on the safe side. */ + = { 0 } +#endif + ; diff --git a/src/bin/coreutils/lib/mbsrtowcs.c b/src/bin/coreutils/lib/mbsrtowcs.c new file mode 100644 index 0000000000..ea6a018721 --- /dev/null +++ b/src/bin/coreutils/lib/mbsrtowcs.c @@ -0,0 +1,136 @@ +/* Convert string to wide string. + Copyright (C) 2008 Free Software Foundation, Inc. + Written by Bruno Haible , 2008. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#include + +/* Specification. */ +#include + +#include +#include +#include + +#include "strnlen1.h" + + +extern mbstate_t _gl_mbsrtowcs_state; + +size_t +mbsrtowcs (wchar_t *dest, const char **srcp, size_t len, mbstate_t *ps) +{ + if (ps == NULL) + ps = &_gl_mbsrtowcs_state; + { + const char *src = *srcp; + + if (dest != NULL) + { + wchar_t *destptr = dest; + + for (; len > 0; destptr++, len--) + { + size_t src_avail; + size_t ret; + + /* An optimized variant of + src_avail = strnlen1 (src, MB_LEN_MAX); */ + if (src[0] == '\0') + src_avail = 1; + else if (src[1] == '\0') + src_avail = 2; + else if (src[2] == '\0') + src_avail = 3; + else if (MB_LEN_MAX <= 4 || src[3] == '\0') + src_avail = 4; + else + src_avail = 4 + strnlen1 (src + 4, MB_LEN_MAX - 4); + + /* Parse the next multibyte character. */ + ret = mbrtowc (destptr, src, src_avail, ps); + + if (ret == (size_t)(-2)) + /* Encountered a multibyte character that extends past a '\0' byte + or that is longer than MB_LEN_MAX bytes. Cannot happen. */ + abort (); + + if (ret == (size_t)(-1)) + goto bad_input; + if (ret == 0) + { + src = NULL; + /* Here mbsinit (ps). */ + break; + } + src += ret; + } + + *srcp = src; + return destptr - dest; + } + else + { + /* Ignore dest and len, don't store *srcp at the end, and + don't clobber *ps. */ + mbstate_t state = *ps; + size_t totalcount = 0; + + for (;; totalcount++) + { + size_t src_avail; + size_t ret; + + /* An optimized variant of + src_avail = strnlen1 (src, MB_LEN_MAX); */ + if (src[0] == '\0') + src_avail = 1; + else if (src[1] == '\0') + src_avail = 2; + else if (src[2] == '\0') + src_avail = 3; + else if (MB_LEN_MAX <= 4 || src[3] == '\0') + src_avail = 4; + else + src_avail = 4 + strnlen1 (src + 4, MB_LEN_MAX - 4); + + /* Parse the next multibyte character. */ + ret = mbrtowc (NULL, src, src_avail, &state); + + if (ret == (size_t)(-2)) + /* Encountered a multibyte character that extends past a '\0' byte + or that is longer than MB_LEN_MAX bytes. Cannot happen. */ + abort (); + + if (ret == (size_t)(-1)) + goto bad_input2; + if (ret == 0) + { + /* Here mbsinit (&state). */ + break; + } + src += ret; + } + + return totalcount; + } + + bad_input: + *srcp = src; + bad_input2: + errno = EILSEQ; + return (size_t)(-1); + } +} diff --git a/src/bin/coreutils/lib/mbsstr.c b/src/bin/coreutils/lib/mbsstr.c new file mode 100644 index 0000000000..c84946b630 --- /dev/null +++ b/src/bin/coreutils/lib/mbsstr.c @@ -0,0 +1,379 @@ +/* Searching in a string. + Copyright (C) 2005-2008 Free Software Foundation, Inc. + Written by Bruno Haible , 2005. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#include + +/* Specification. */ +#include + +#include +#include /* for NULL, in case a nonstandard string.h lacks it */ + +#include "malloca.h" +#include "mbuiter.h" + +/* Knuth-Morris-Pratt algorithm. */ +#define CANON_ELEMENT(c) c +#include "str-kmp.h" + +/* Knuth-Morris-Pratt algorithm. + See http://en.wikipedia.org/wiki/Knuth-Morris-Pratt_algorithm + Return a boolean indicating success: + Return true and set *RESULTP if the search was completed. + Return false if it was aborted because not enough memory was available. */ +static bool +knuth_morris_pratt_multibyte (const char *haystack, const char *needle, + const char **resultp) +{ + size_t m = mbslen (needle); + mbchar_t *needle_mbchars; + size_t *table; + + /* Allocate room for needle_mbchars and the table. */ + char *memory = (char *) nmalloca (m, sizeof (mbchar_t) + sizeof (size_t)); + if (memory == NULL) + return false; + needle_mbchars = (mbchar_t *) memory; + table = (size_t *) (memory + m * sizeof (mbchar_t)); + + /* Fill needle_mbchars. */ + { + mbui_iterator_t iter; + size_t j; + + j = 0; + for (mbui_init (iter, needle); mbui_avail (iter); mbui_advance (iter), j++) + mb_copy (&needle_mbchars[j], &mbui_cur (iter)); + } + + /* Fill the table. + For 0 < i < m: + 0 < table[i] <= i is defined such that + forall 0 < x < table[i]: needle[x..i-1] != needle[0..i-1-x], + and table[i] is as large as possible with this property. + This implies: + 1) For 0 < i < m: + If table[i] < i, + needle[table[i]..i-1] = needle[0..i-1-table[i]]. + 2) For 0 < i < m: + rhaystack[0..i-1] == needle[0..i-1] + and exists h, i <= h < m: rhaystack[h] != needle[h] + implies + forall 0 <= x < table[i]: rhaystack[x..x+m-1] != needle[0..m-1]. + table[0] remains uninitialized. */ + { + size_t i, j; + + /* i = 1: Nothing to verify for x = 0. */ + table[1] = 1; + j = 0; + + for (i = 2; i < m; i++) + { + /* Here: j = i-1 - table[i-1]. + The inequality needle[x..i-1] != needle[0..i-1-x] is known to hold + for x < table[i-1], by induction. + Furthermore, if j>0: needle[i-1-j..i-2] = needle[0..j-1]. */ + mbchar_t *b = &needle_mbchars[i - 1]; + + for (;;) + { + /* Invariants: The inequality needle[x..i-1] != needle[0..i-1-x] + is known to hold for x < i-1-j. + Furthermore, if j>0: needle[i-1-j..i-2] = needle[0..j-1]. */ + if (mb_equal (*b, needle_mbchars[j])) + { + /* Set table[i] := i-1-j. */ + table[i] = i - ++j; + break; + } + /* The inequality needle[x..i-1] != needle[0..i-1-x] also holds + for x = i-1-j, because + needle[i-1] != needle[j] = needle[i-1-x]. */ + if (j == 0) + { + /* The inequality holds for all possible x. */ + table[i] = i; + break; + } + /* The inequality needle[x..i-1] != needle[0..i-1-x] also holds + for i-1-j < x < i-1-j+table[j], because for these x: + needle[x..i-2] + = needle[x-(i-1-j)..j-1] + != needle[0..j-1-(x-(i-1-j))] (by definition of table[j]) + = needle[0..i-2-x], + hence needle[x..i-1] != needle[0..i-1-x]. + Furthermore + needle[i-1-j+table[j]..i-2] + = needle[table[j]..j-1] + = needle[0..j-1-table[j]] (by definition of table[j]). */ + j = j - table[j]; + } + /* Here: j = i - table[i]. */ + } + } + + /* Search, using the table to accelerate the processing. */ + { + size_t j; + mbui_iterator_t rhaystack; + mbui_iterator_t phaystack; + + *resultp = NULL; + j = 0; + mbui_init (rhaystack, haystack); + mbui_init (phaystack, haystack); + /* Invariant: phaystack = rhaystack + j. */ + while (mbui_avail (phaystack)) + if (mb_equal (needle_mbchars[j], mbui_cur (phaystack))) + { + j++; + mbui_advance (phaystack); + if (j == m) + { + /* The entire needle has been found. */ + *resultp = mbui_cur_ptr (rhaystack); + break; + } + } + else if (j > 0) + { + /* Found a match of needle[0..j-1], mismatch at needle[j]. */ + size_t count = table[j]; + j -= count; + for (; count > 0; count--) + { + if (!mbui_avail (rhaystack)) + abort (); + mbui_advance (rhaystack); + } + } + else + { + /* Found a mismatch at needle[0] already. */ + if (!mbui_avail (rhaystack)) + abort (); + mbui_advance (rhaystack); + mbui_advance (phaystack); + } + } + + freea (memory); + return true; +} + +/* Find the first occurrence of the character string NEEDLE in the character + string HAYSTACK. Return NULL if NEEDLE is not found in HAYSTACK. */ +char * +mbsstr (const char *haystack, const char *needle) +{ + /* Be careful not to look at the entire extent of haystack or needle + until needed. This is useful because of these two cases: + - haystack may be very long, and a match of needle found early, + - needle may be very long, and not even a short initial segment of + needle may be found in haystack. */ + if (MB_CUR_MAX > 1) + { + mbui_iterator_t iter_needle; + + mbui_init (iter_needle, needle); + if (mbui_avail (iter_needle)) + { + /* Minimizing the worst-case complexity: + Let n = mbslen(haystack), m = mbslen(needle). + The naïve algorithm is O(n*m) worst-case. + The Knuth-Morris-Pratt algorithm is O(n) worst-case but it needs a + memory allocation. + To achieve linear complexity and yet amortize the cost of the + memory allocation, we activate the Knuth-Morris-Pratt algorithm + only once the naïve algorithm has already run for some time; more + precisely, when + - the outer loop count is >= 10, + - the average number of comparisons per outer loop is >= 5, + - the total number of comparisons is >= m. + But we try it only once. If the memory allocation attempt failed, + we don't retry it. */ + bool try_kmp = true; + size_t outer_loop_count = 0; + size_t comparison_count = 0; + size_t last_ccount = 0; /* last comparison count */ + mbui_iterator_t iter_needle_last_ccount; /* = needle + last_ccount */ + + mbui_iterator_t iter_haystack; + + mbui_init (iter_needle_last_ccount, needle); + mbui_init (iter_haystack, haystack); + for (;; mbui_advance (iter_haystack)) + { + if (!mbui_avail (iter_haystack)) + /* No match. */ + return NULL; + + /* See whether it's advisable to use an asymptotically faster + algorithm. */ + if (try_kmp + && outer_loop_count >= 10 + && comparison_count >= 5 * outer_loop_count) + { + /* See if needle + comparison_count now reaches the end of + needle. */ + size_t count = comparison_count - last_ccount; + for (; + count > 0 && mbui_avail (iter_needle_last_ccount); + count--) + mbui_advance (iter_needle_last_ccount); + last_ccount = comparison_count; + if (!mbui_avail (iter_needle_last_ccount)) + { + /* Try the Knuth-Morris-Pratt algorithm. */ + const char *result; + bool success = + knuth_morris_pratt_multibyte (haystack, needle, + &result); + if (success) + return (char *) result; + try_kmp = false; + } + } + + outer_loop_count++; + comparison_count++; + if (mb_equal (mbui_cur (iter_haystack), mbui_cur (iter_needle))) + /* The first character matches. */ + { + mbui_iterator_t rhaystack; + mbui_iterator_t rneedle; + + memcpy (&rhaystack, &iter_haystack, sizeof (mbui_iterator_t)); + mbui_advance (rhaystack); + + mbui_init (rneedle, needle); + if (!mbui_avail (rneedle)) + abort (); + mbui_advance (rneedle); + + for (;; mbui_advance (rhaystack), mbui_advance (rneedle)) + { + if (!mbui_avail (rneedle)) + /* Found a match. */ + return (char *) mbui_cur_ptr (iter_haystack); + if (!mbui_avail (rhaystack)) + /* No match. */ + return NULL; + comparison_count++; + if (!mb_equal (mbui_cur (rhaystack), mbui_cur (rneedle))) + /* Nothing in this round. */ + break; + } + } + } + } + else + return (char *) haystack; + } + else + { + if (*needle != '\0') + { + /* Minimizing the worst-case complexity: + Let n = strlen(haystack), m = strlen(needle). + The naïve algorithm is O(n*m) worst-case. + The Knuth-Morris-Pratt algorithm is O(n) worst-case but it needs a + memory allocation. + To achieve linear complexity and yet amortize the cost of the + memory allocation, we activate the Knuth-Morris-Pratt algorithm + only once the naïve algorithm has already run for some time; more + precisely, when + - the outer loop count is >= 10, + - the average number of comparisons per outer loop is >= 5, + - the total number of comparisons is >= m. + But we try it only once. If the memory allocation attempt failed, + we don't retry it. */ + bool try_kmp = true; + size_t outer_loop_count = 0; + size_t comparison_count = 0; + size_t last_ccount = 0; /* last comparison count */ + const char *needle_last_ccount = needle; /* = needle + last_ccount */ + + /* Speed up the following searches of needle by caching its first + character. */ + char b = *needle++; + + for (;; haystack++) + { + if (*haystack == '\0') + /* No match. */ + return NULL; + + /* See whether it's advisable to use an asymptotically faster + algorithm. */ + if (try_kmp + && outer_loop_count >= 10 + && comparison_count >= 5 * outer_loop_count) + { + /* See if needle + comparison_count now reaches the end of + needle. */ + if (needle_last_ccount != NULL) + { + needle_last_ccount += + strnlen (needle_last_ccount, + comparison_count - last_ccount); + if (*needle_last_ccount == '\0') + needle_last_ccount = NULL; + last_ccount = comparison_count; + } + if (needle_last_ccount == NULL) + { + /* Try the Knuth-Morris-Pratt algorithm. */ + const char *result; + bool success = + knuth_morris_pratt_unibyte (haystack, needle - 1, + &result); + if (success) + return (char *) result; + try_kmp = false; + } + } + + outer_loop_count++; + comparison_count++; + if (*haystack == b) + /* The first character matches. */ + { + const char *rhaystack = haystack + 1; + const char *rneedle = needle; + + for (;; rhaystack++, rneedle++) + { + if (*rneedle == '\0') + /* Found a match. */ + return (char *) haystack; + if (*rhaystack == '\0') + /* No match. */ + return NULL; + comparison_count++; + if (*rhaystack != *rneedle) + /* Nothing in this round. */ + break; + } + } + } + } + else + return (char *) haystack; + } +} diff --git a/src/bin/coreutils/lib/mbswidth.c b/src/bin/coreutils/lib/mbswidth.c index 0bc1a682c1..0f380a9dcc 100644 --- a/src/bin/coreutils/lib/mbswidth.c +++ b/src/bin/coreutils/lib/mbswidth.c @@ -1,10 +1,10 @@ /* Determine the number of screen columns needed for a string. - Copyright (C) 2000-2007 Free Software Foundation, Inc. + Copyright (C) 2000-2008 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Bruno Haible . */ @@ -30,21 +29,12 @@ /* Get isprint(). */ #include -/* Get mbstate_t, mbrtowc(), mbsinit(). */ +/* Get mbstate_t, mbrtowc(), mbsinit(), wcwidth(). */ #include -/* Get wcwidth(). */ -#include "wcwidth.h" - /* Get iswcntrl(). */ #include -#ifndef mbsinit -# if !HAVE_MBSINIT -# define mbsinit(ps) 1 -# endif -#endif - /* Returns the number of columns needed to represent the multibyte character string pointed to by STRING. If a non-printable character occurs, and MBSW_REJECT_UNPRINTABLE is specified, -1 is returned. @@ -70,7 +60,6 @@ mbsnwidth (const char *string, size_t nbytes, int flags) int width; width = 0; -#if HAVE_MBRTOWC if (MB_CUR_MAX > 1) { while (p < plimit) @@ -162,7 +151,6 @@ mbsnwidth (const char *string, size_t nbytes, int flags) } return width; } -#endif while (p < plimit) { diff --git a/src/bin/coreutils/lib/mbswidth.h b/src/bin/coreutils/lib/mbswidth.h index eec4ff6c5e..15da406dce 100644 --- a/src/bin/coreutils/lib/mbswidth.h +++ b/src/bin/coreutils/lib/mbswidth.h @@ -1,10 +1,10 @@ /* Determine the number of screen columns needed for a string. Copyright (C) 2000-2004, 2007 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ #include diff --git a/src/bin/coreutils/lib/mbuiter.h b/src/bin/coreutils/lib/mbuiter.h index e6ad4887e8..213e710307 100644 --- a/src/bin/coreutils/lib/mbuiter.h +++ b/src/bin/coreutils/lib/mbuiter.h @@ -1,10 +1,10 @@ /* Iterating through multibyte strings: macros for multi-byte encodings. Copyright (C) 2001, 2005, 2007 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + along with this program. If not, see . */ /* Written by Bruno Haible . */ @@ -92,6 +91,7 @@ #include #include +#include #include #include diff --git a/src/bin/coreutils/lib/md5.c b/src/bin/coreutils/lib/md5.c index 917a899a7b..1e5f3c6346 100644 --- a/src/bin/coreutils/lib/md5.c +++ b/src/bin/coreutils/lib/md5.c @@ -1,12 +1,15 @@ +/* -*- buffer-read-only: t -*- vi: set ro: */ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 /* Functions to compute MD5 message digest of files or memory blocks. according to the definition of MD5 in RFC 1321 from April 1992. - Copyright (C) 1995,1996,1997,1999,2000,2001,2005,2006 + Copyright (C) 1995,1996,1997,1999,2000,2001,2005,2006,2008 Free Software Foundation, Inc. This file is part of the GNU C Library. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2, or (at your option) any + Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -80,27 +83,31 @@ md5_init_ctx (struct md5_ctx *ctx) ctx->buflen = 0; } -/* Put result from CTX in first 16 bytes following RESBUF. The result - must be in little endian byte order. +/* Copy the 4 byte value from v into the memory location pointed to by *cp, + If your architecture allows unaligned access this is equivalent to + * (uint32_t *) cp = v */ +static inline void +set_uint32 (char *cp, uint32_t v) +{ + memcpy (cp, &v, sizeof v); +} - IMPORTANT: On some systems it is required that RESBUF is correctly - aligned for a 32-bit value. */ +/* Put result from CTX in first 16 bytes following RESBUF. The result + must be in little endian byte order. */ void * md5_read_ctx (const struct md5_ctx *ctx, void *resbuf) { - ((uint32_t *) resbuf)[0] = SWAP (ctx->A); - ((uint32_t *) resbuf)[1] = SWAP (ctx->B); - ((uint32_t *) resbuf)[2] = SWAP (ctx->C); - ((uint32_t *) resbuf)[3] = SWAP (ctx->D); + char *r = resbuf; + set_uint32 (r + 0 * sizeof ctx->A, SWAP (ctx->A)); + set_uint32 (r + 1 * sizeof ctx->B, SWAP (ctx->B)); + set_uint32 (r + 2 * sizeof ctx->C, SWAP (ctx->C)); + set_uint32 (r + 3 * sizeof ctx->D, SWAP (ctx->D)); return resbuf; } /* Process the remaining bytes in the internal buffer and the usual - prolog according to the standard and write the result to RESBUF. - - IMPORTANT: On some systems it is required that RESBUF is correctly - aligned for a 32-bit value. */ + prolog according to the standard and write the result to RESBUF. */ void * md5_finish_ctx (struct md5_ctx *ctx, void *resbuf) { diff --git a/src/bin/coreutils/lib/md5.h b/src/bin/coreutils/lib/md5.h index c737040e11..685986fff9 100644 --- a/src/bin/coreutils/lib/md5.h +++ b/src/bin/coreutils/lib/md5.h @@ -1,12 +1,15 @@ +/* -*- buffer-read-only: t -*- vi: set ro: */ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 /* Declaration of functions and data types used for MD5 sum computing library functions. - Copyright (C) 1995-1997,1999,2000,2001,2004,2005,2006 + Copyright (C) 1995-1997,1999,2000,2001,2004,2005,2006,2008 Free Software Foundation, Inc. This file is part of the GNU C Library. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2, or (at your option) any + Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -93,19 +96,13 @@ extern void __md5_process_bytes (const void *buffer, size_t len, /* Process the remaining bytes in the buffer and put result from CTX in first 16 bytes following RESBUF. The result is always in little endian byte order, so that a byte-wise output yields to the wanted - ASCII representation of the message digest. - - IMPORTANT: On some systems, RESBUF must be aligned to a 32-bit - boundary. */ + ASCII representation of the message digest. */ extern void *__md5_finish_ctx (struct md5_ctx *ctx, void *resbuf) __THROW; /* Put result from CTX in first 16 bytes following RESBUF. The result is always in little endian byte order, so that a byte-wise output yields - to the wanted ASCII representation of the message digest. - - IMPORTANT: On some systems, RESBUF must be aligned to a 32-bit - boundary. */ + to the wanted ASCII representation of the message digest. */ extern void *__md5_read_ctx (const struct md5_ctx *ctx, void *resbuf) __THROW; diff --git a/src/bin/coreutils/lib/memcasecmp.c b/src/bin/coreutils/lib/memcasecmp.c index cddf76aed6..4873651b3f 100644 --- a/src/bin/coreutils/lib/memcasecmp.c +++ b/src/bin/coreutils/lib/memcasecmp.c @@ -1,10 +1,10 @@ /* Case-insensitive buffer comparator. Copyright (C) 1996, 1997, 2000, 2003, 2006 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Jim Meyering. */ diff --git a/src/bin/coreutils/lib/memcasecmp.h b/src/bin/coreutils/lib/memcasecmp.h index 5c8b1f1f2e..1eedecbd76 100644 --- a/src/bin/coreutils/lib/memcasecmp.h +++ b/src/bin/coreutils/lib/memcasecmp.h @@ -2,10 +2,10 @@ Copyright (C) 1996, 1998, 2003 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Jim Meyering. */ diff --git a/src/bin/coreutils/lib/memchr.c b/src/bin/coreutils/lib/memchr.c index d44ad6deb5..2253d2d651 100644 --- a/src/bin/coreutils/lib/memchr.c +++ b/src/bin/coreutils/lib/memchr.c @@ -1,5 +1,5 @@ -/* Copyright (C) 1991, 1993, 1996, 1997, 1999, 2000, 2003, 2004, 2006 Free - Software Foundation, Inc. +/* Copyright (C) 1991, 1993, 1996, 1997, 1999, 2000, 2003, 2004, 2006, 2008 + Free Software Foundation, Inc. Based on strlen implementation by Torbjorn Granlund (tege@sics.se), with help from Dan Sahlin (dan@sics.se) and @@ -10,9 +10,9 @@ NOTE: The canonical source of this file is maintained with the GNU C Library. Bugs can be reported to bug-glibc@prep.ai.mit.edu. -This program is free software; you can redistribute it and/or modify it +This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the -Free Software Foundation; either version 2, or (at your option) any +Free Software Foundation; either version 3 of the License, or any later version. This program is distributed in the hope that it will be useful, @@ -21,8 +21,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software Foundation, -Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +along with this program. If not, see . */ #ifndef _LIBC # include @@ -46,155 +45,127 @@ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ # define BP_SYM(sym) sym #endif -#undef memchr #undef __memchr +#ifdef _LIBC +# undef memchr +#endif + +#ifndef weak_alias +# define __memchr memchr +#endif /* Search no more than N bytes of S for C. */ void * __memchr (void const *s, int c_in, size_t n) { + /* On 32-bit hardware, choosing longword to be a 32-bit unsigned + long instead of a 64-bit uintmax_t tends to give better + performance. On 64-bit hardware, unsigned long is generally 64 + bits already. Change this typedef to experiment with + performance. */ + typedef unsigned long int longword; + const unsigned char *char_ptr; - const unsigned long int *longword_ptr; - unsigned long int longword, magic_bits, charmask; + const longword *longword_ptr; + longword repeated_one; + longword repeated_c; unsigned reg_char c; - int i; c = (unsigned char) c_in; - /* Handle the first few characters by reading one character at a time. + /* Handle the first few bytes by reading one byte at a time. Do this until CHAR_PTR is aligned on a longword boundary. */ for (char_ptr = (const unsigned char *) s; - n > 0 && (size_t) char_ptr % sizeof longword != 0; + n > 0 && (size_t) char_ptr % sizeof (longword) != 0; --n, ++char_ptr) if (*char_ptr == c) return (void *) char_ptr; + longword_ptr = (const longword *) char_ptr; + /* All these elucidatory comments refer to 4-byte longwords, but the theory applies equally well to any size longwords. */ - longword_ptr = (const unsigned long int *) char_ptr; - - /* Bits 31, 24, 16, and 8 of this number are zero. Call these bits - the "holes." Note that there is a hole just to the left of - each byte, with an extra at the end: - - bits: 01111110 11111110 11111110 11111111 - bytes: AAAAAAAA BBBBBBBB CCCCCCCC DDDDDDDD - - The 1-bits make sure that carries propagate to the next 0-bit. - The 0-bits provide holes for carries to fall into. */ - - /* Set MAGIC_BITS to be this pattern of 1 and 0 bits. - Set CHARMASK to be a longword, each of whose bytes is C. */ - - magic_bits = 0xfefefefe; - charmask = c | (c << 8); - charmask |= charmask << 16; -#if 0xffffffffU < ULONG_MAX - magic_bits |= magic_bits << 32; - charmask |= charmask << 32; - if (8 < sizeof longword) - for (i = 64; i < sizeof longword * 8; i *= 2) - { - magic_bits |= magic_bits << i; - charmask |= charmask << i; - } -#endif - magic_bits = (ULONG_MAX >> 1) & (magic_bits | 1); - - /* Instead of the traditional loop which tests each character, - we will test a longword at a time. The tricky part is testing - if *any of the four* bytes in the longword in question are zero. */ - while (n >= sizeof longword) + /* Compute auxiliary longword values: + repeated_one is a value which has a 1 in every byte. + repeated_c has c in every byte. */ + repeated_one = 0x01010101; + repeated_c = c | (c << 8); + repeated_c |= repeated_c << 16; + if (0xffffffffU < (longword) -1) { - /* We tentatively exit the loop if adding MAGIC_BITS to - LONGWORD fails to change any of the hole bits of LONGWORD. - - 1) Is this safe? Will it catch all the zero bytes? - Suppose there is a byte with all zeros. Any carry bits - propagating from its left will fall into the hole at its - least significant bit and stop. Since there will be no - carry from its most significant bit, the LSB of the - byte to the left will be unchanged, and the zero will be - detected. - - 2) Is this worthwhile? Will it ignore everything except - zero bytes? Suppose every byte of LONGWORD has a bit set - somewhere. There will be a carry into bit 8. If bit 8 - is set, this will carry into bit 16. If bit 8 is clear, - one of bits 9-15 must be set, so there will be a carry - into bit 16. Similarly, there will be a carry into bit - 24. If one of bits 24-30 is set, there will be a carry - into bit 31, so all of the hole bits will be changed. - - The one misfire occurs when bits 24-30 are clear and bit - 31 is set; in this case, the hole at bit 31 is not - changed. If we had access to the processor carry flag, - we could close this loophole by putting the fourth hole - at bit 32! - - So it ignores everything except 128's, when they're aligned - properly. - - 3) But wait! Aren't we looking for C, not zero? - Good point. So what we do is XOR LONGWORD with a longword, - each of whose bytes is C. This turns each byte that is C - into a zero. */ - - longword = *longword_ptr++ ^ charmask; - - /* Add MAGIC_BITS to LONGWORD. */ - if ((((longword + magic_bits) - - /* Set those bits that were unchanged by the addition. */ - ^ ~longword) - - /* Look at only the hole bits. If any of the hole bits - are unchanged, most likely one of the bytes was a - zero. */ - & ~magic_bits) != 0) + repeated_one |= repeated_one << 31 << 1; + repeated_c |= repeated_c << 31 << 1; + if (8 < sizeof (longword)) { - /* Which of the bytes was C? If none of them were, it was - a misfire; continue the search. */ + size_t i; - const unsigned char *cp = (const unsigned char *) (longword_ptr - 1); - - if (cp[0] == c) - return (void *) cp; - if (cp[1] == c) - return (void *) &cp[1]; - if (cp[2] == c) - return (void *) &cp[2]; - if (cp[3] == c) - return (void *) &cp[3]; - if (4 < sizeof longword && cp[4] == c) - return (void *) &cp[4]; - if (5 < sizeof longword && cp[5] == c) - return (void *) &cp[5]; - if (6 < sizeof longword && cp[6] == c) - return (void *) &cp[6]; - if (7 < sizeof longword && cp[7] == c) - return (void *) &cp[7]; - if (8 < sizeof longword) - for (i = 8; i < sizeof longword; i++) - if (cp[i] == c) - return (void *) &cp[i]; + for (i = 64; i < sizeof (longword) * 8; i *= 2) + { + repeated_one |= repeated_one << i; + repeated_c |= repeated_c << i; + } } + } - n -= sizeof longword; + /* Instead of the traditional loop which tests each byte, we will test a + longword at a time. The tricky part is testing if *any of the four* + bytes in the longword in question are equal to c. We first use an xor + with repeated_c. This reduces the task to testing whether *any of the + four* bytes in longword1 is zero. + + We compute tmp = + ((longword1 - repeated_one) & ~longword1) & (repeated_one << 7). + That is, we perform the following operations: + 1. Subtract repeated_one. + 2. & ~longword1. + 3. & a mask consisting of 0x80 in every byte. + Consider what happens in each byte: + - If a byte of longword1 is zero, step 1 and 2 transform it into 0xff, + and step 3 transforms it into 0x80. A carry can also be propagated + to more significant bytes. + - If a byte of longword1 is nonzero, let its lowest 1 bit be at + position k (0 <= k <= 7); so the lowest k bits are 0. After step 1, + the byte ends in a single bit of value 0 and k bits of value 1. + After step 2, the result is just k bits of value 1: 2^k - 1. After + step 3, the result is 0. And no carry is produced. + So, if longword1 has only non-zero bytes, tmp is zero. + Whereas if longword1 has a zero byte, call j the position of the least + significant zero byte. Then the result has a zero at positions 0, ..., + j-1 and a 0x80 at position j. We cannot predict the result at the more + significant bytes (positions j+1..3), but it does not matter since we + already have a non-zero bit at position 8*j+7. + + So, the test whether any byte in longword1 is zero is equivalent to + testing whether tmp is nonzero. */ + + while (n >= sizeof (longword)) + { + longword longword1 = *longword_ptr ^ repeated_c; + + if ((((longword1 - repeated_one) & ~longword1) + & (repeated_one << 7)) != 0) + break; + longword_ptr++; + n -= sizeof (longword); } char_ptr = (const unsigned char *) longword_ptr; - while (n-- > 0) + /* At this point, we know that either n < sizeof (longword), or one of the + sizeof (longword) bytes starting at char_ptr is == c. On little-endian + machines, we could determine the first such byte without any further + memory accesses, just by looking at the tmp result from the last loop + iteration. But this does not work on big-endian machines. Choose code + that works in both cases. */ + + for (; n > 0; --n, ++char_ptr) { if (*char_ptr == c) return (void *) char_ptr; - else - ++char_ptr; } - return 0; + return NULL; } #ifdef weak_alias weak_alias (__memchr, BP_SYM (memchr)) diff --git a/src/bin/coreutils/lib/memchr2.c b/src/bin/coreutils/lib/memchr2.c new file mode 100644 index 0000000000..ad78195ee3 --- /dev/null +++ b/src/bin/coreutils/lib/memchr2.c @@ -0,0 +1,164 @@ +/* Copyright (C) 1991, 1993, 1996, 1997, 1999, 2000, 2003, 2004, 2006, + 2008 Free Software Foundation, Inc. + + Based on strlen implementation by Torbjorn Granlund (tege@sics.se), + with help from Dan Sahlin (dan@sics.se) and + commentary by Jim Blandy (jimb@ai.mit.edu); + adaptation to memchr suggested by Dick Karpinski (dick@cca.ucsf.edu), + and implemented in glibc by Roland McGrath (roland@ai.mit.edu). + Extension to memchr2 implemented by Eric Blake (ebb9@byu.net). + +This program is free software: you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 3 of the License, or any +later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . */ + +#include + +#include "memchr2.h" + +#include +#include +#include + +/* Return the first address of either C1 or C2 (treated as unsigned + char) that occurs within N bytes of the memory region S. If + neither byte appears, return NULL. */ +void * +memchr2 (void const *s, int c1_in, int c2_in, size_t n) +{ + /* On 32-bit hardware, choosing longword to be a 32-bit unsigned + long instead of a 64-bit uintmax_t tends to give better + performance. On 64-bit hardware, unsigned long is generally 64 + bits already. Change this typedef to experiment with + performance. */ + typedef unsigned long int longword; + + const unsigned char *char_ptr; + const longword *longword_ptr; + longword repeated_one; + longword repeated_c1; + longword repeated_c2; + unsigned char c1; + unsigned char c2; + + c1 = (unsigned char) c1_in; + c2 = (unsigned char) c2_in; + + if (c1 == c2) + return memchr (s, c1, n); + + /* Handle the first few bytes by reading one byte at a time. + Do this until CHAR_PTR is aligned on a longword boundary. */ + for (char_ptr = (const unsigned char *) s; + n > 0 && (size_t) char_ptr % sizeof (longword) != 0; + --n, ++char_ptr) + if (*char_ptr == c1 || *char_ptr == c2) + return (void *) char_ptr; + + longword_ptr = (const longword *) char_ptr; + + /* All these elucidatory comments refer to 4-byte longwords, + but the theory applies equally well to any size longwords. */ + + /* Compute auxiliary longword values: + repeated_one is a value which has a 1 in every byte. + repeated_c1 has c1 in every byte. + repeated_c2 has c2 in every byte. */ + repeated_one = 0x01010101; + repeated_c1 = c1 | (c1 << 8); + repeated_c2 = c2 | (c2 << 8); + repeated_c1 |= repeated_c1 << 16; + repeated_c2 |= repeated_c2 << 16; + if (0xffffffffU < (longword) -1) + { + repeated_one |= repeated_one << 31 << 1; + repeated_c1 |= repeated_c1 << 31 << 1; + repeated_c2 |= repeated_c2 << 31 << 1; + if (8 < sizeof (longword)) + { + size_t i; + + for (i = 64; i < sizeof (longword) * 8; i *= 2) + { + repeated_one |= repeated_one << i; + repeated_c1 |= repeated_c1 << i; + repeated_c2 |= repeated_c2 << i; + } + } + } + + /* Instead of the traditional loop which tests each byte, we will test a + longword at a time. The tricky part is testing if *any of the four* + bytes in the longword in question are equal to c1 or c2. We first use + an xor with repeated_c1 and repeated_c2, respectively. This reduces + the task to testing whether *any of the four* bytes in longword1 or + longword2 is zero. + + Let's consider longword1. We compute tmp1 = + ((longword1 - repeated_one) & ~longword1) & (repeated_one << 7). + That is, we perform the following operations: + 1. Subtract repeated_one. + 2. & ~longword1. + 3. & a mask consisting of 0x80 in every byte. + Consider what happens in each byte: + - If a byte of longword1 is zero, step 1 and 2 transform it into 0xff, + and step 3 transforms it into 0x80. A carry can also be propagated + to more significant bytes. + - If a byte of longword1 is nonzero, let its lowest 1 bit be at + position k (0 <= k <= 7); so the lowest k bits are 0. After step 1, + the byte ends in a single bit of value 0 and k bits of value 1. + After step 2, the result is just k bits of value 1: 2^k - 1. After + step 3, the result is 0. And no carry is produced. + So, if longword1 has only non-zero bytes, tmp1 is zero. + Whereas if longword1 has a zero byte, call j the position of the least + significant zero byte. Then the result has a zero at positions 0, ..., + j-1 and a 0x80 at position j. We cannot predict the result at the more + significant bytes (positions j+1..3), but it does not matter since we + already have a non-zero bit at position 8*j+7. + + Similary, we compute tmp2 = + ((longword2 - repeated_one) & ~longword2) & (repeated_one << 7). + + The test whether any byte in longword1 or longword2 is zero is equivalent + to testing whether tmp1 is nonzero or tmp2 is nonzero. We can combine + this into a single test, whether (tmp1 | tmp2) is nonzero. */ + + while (n >= sizeof (longword)) + { + longword longword1 = *longword_ptr ^ repeated_c1; + longword longword2 = *longword_ptr ^ repeated_c2; + + if (((((longword1 - repeated_one) & ~longword1) + | ((longword2 - repeated_one) & ~longword2)) + & (repeated_one << 7)) != 0) + break; + longword_ptr++; + n -= sizeof (longword); + } + + char_ptr = (const unsigned char *) longword_ptr; + + /* At this point, we know that either n < sizeof (longword), or one of the + sizeof (longword) bytes starting at char_ptr is == c1 or == c2. On + little-endian machines, we could determine the first such byte without + any further memory accesses, just by looking at the (tmp1 | tmp2) result + from the last loop iteration. But this does not work on big-endian + machines. Choose code that works in both cases. */ + + for (; n > 0; --n, ++char_ptr) + { + if (*char_ptr == c1 || *char_ptr == c2) + return (void *) char_ptr; + } + + return NULL; +} diff --git a/src/bin/coreutils/lib/memchr2.h b/src/bin/coreutils/lib/memchr2.h new file mode 100644 index 0000000000..e35b475eca --- /dev/null +++ b/src/bin/coreutils/lib/memchr2.h @@ -0,0 +1,31 @@ +/* Scan memory for the first of two bytes. + Copyright (C) 2008 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Return the first address of either C1 or C2 (treated as unsigned + char) that occurs within N bytes of the memory region S. If + neither byte appears, return NULL. */ + +extern void *memchr2 (void const *s, int c1, int c2, size_t n); + +#ifdef __cplusplus +} +#endif diff --git a/src/bin/coreutils/lib/memcmp.c b/src/bin/coreutils/lib/memcmp.c index cf98bfab16..01810715b0 100644 --- a/src/bin/coreutils/lib/memcmp.c +++ b/src/bin/coreutils/lib/memcmp.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1993, 1995, 1997, 1998, 2003, 2006 Free Software +/* Copyright (C) 1991, 1993, 1995, 1997, 1998, 2003, 2006, 2009 Free Software Foundation, Inc. Contributed by Torbjorn Granlund (tege@sics.se). @@ -6,9 +6,9 @@ NOTE: The canonical source of this file is maintained with the GNU C Library. Bugs can be reported to bug-glibc@prep.ai.mit.edu. - This program is free software; you can redistribute it and/or modify it + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2, or (at your option) any + Free Software Foundation; either version 3 of the License, or any later version. This program is distributed in the hope that it will be useful, @@ -17,9 +17,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - USA. */ + along with this program. If not, see . */ #ifndef _LIBC # include @@ -27,6 +25,8 @@ #include +#include + #undef memcmp #ifdef _LIBC @@ -90,16 +90,16 @@ typedef unsigned char byte; __inline # endif static int -memcmp_bytes (long unsigned int a, long unsigned int b) +memcmp_bytes (op_t a, op_t b) { - long int srcp1 = (long int) &a; - long int srcp2 = (long int) &b; + const byte *srcp1 = (const byte *) &a; + const byte *srcp2 = (const byte *) &b; op_t a0, b0; do { - a0 = ((byte *) srcp1)[0]; - b0 = ((byte *) srcp2)[0]; + a0 = srcp1[0]; + b0 = srcp2[0]; srcp1 += 1; srcp2 += 1; } @@ -115,7 +115,7 @@ memcmp_bytes (long unsigned int a, long unsigned int b) __inline #endif static int -memcmp_common_alignment (long int srcp1, long int srcp2, size_t len) +memcmp_common_alignment (uintptr_t srcp1, uintptr_t srcp2, size_t len) { op_t a0, a1; op_t b0, b1; @@ -200,7 +200,7 @@ memcmp_common_alignment (long int srcp1, long int srcp2, size_t len) __inline #endif static int -memcmp_not_common_alignment (long int srcp1, long int srcp2, size_t len) +memcmp_not_common_alignment (uintptr_t srcp1, uintptr_t srcp2, size_t len) { op_t a0, a1, a2, a3; op_t b0, b1, b2, b3; @@ -304,8 +304,8 @@ rpl_memcmp (const void *s1, const void *s2, size_t len) { op_t a0; op_t b0; - long int srcp1 = (long int) s1; - long int srcp2 = (long int) s2; + uintptr_t srcp1 = (uintptr_t) s1; + uintptr_t srcp2 = (uintptr_t) s2; op_t res; if (len >= OP_T_THRES) diff --git a/src/bin/coreutils/lib/memcmp2.c b/src/bin/coreutils/lib/memcmp2.c new file mode 100644 index 0000000000..dd04cae132 --- /dev/null +++ b/src/bin/coreutils/lib/memcmp2.c @@ -0,0 +1,39 @@ +/* -*- buffer-read-only: t -*- vi: set ro: */ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 +/* Compare two memory areas with possibly different lengths. + Copyright (C) 2009 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published + by the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#include + +/* Specification. */ +#include "memcmp2.h" + +#include + +int +memcmp2 (const char *s1, size_t n1, const char *s2, size_t n2) +{ + int cmp = memcmp (s1, s2, n1 <= n2 ? n1 : n2); + if (cmp == 0) + { + if (n1 < n2) + cmp = -1; + else if (n1 > n2) + cmp = 1; + } + return cmp; +} diff --git a/src/bin/coreutils/lib/memcmp2.h b/src/bin/coreutils/lib/memcmp2.h new file mode 100644 index 0000000000..7b8d7a40eb --- /dev/null +++ b/src/bin/coreutils/lib/memcmp2.h @@ -0,0 +1,42 @@ +/* -*- buffer-read-only: t -*- vi: set ro: */ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 +/* Compare two memory areas with possibly different lengths. + Copyright (C) 2009 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published + by the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#ifndef MEMCMP2_H +#define MEMCMP2_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + + +/* Compare the memory regions S1 = [s1..s1+N1-1], S2 = [s2..s2+n2-1], + lexicographically. + This function's result is locale independent, unlike memcoll()'s. + Return a negative number if S1 < S2, a positive number if S1 > S2, or + 0 if S1 and S2 have the same contents. */ +extern int memcmp2 (const char *s1, size_t n1, const char *s2, size_t n2); + + +#ifdef __cplusplus +} +#endif + +#endif /* MEMCMP2_H */ diff --git a/src/bin/coreutils/lib/memcoll.c b/src/bin/coreutils/lib/memcoll.c index e5ef36397b..9d0c434c22 100644 --- a/src/bin/coreutils/lib/memcoll.c +++ b/src/bin/coreutils/lib/memcoll.c @@ -2,10 +2,10 @@ Copyright (C) 1999, 2002, 2003, 2004, 2006 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Contributed by Paul Eggert . */ diff --git a/src/bin/coreutils/lib/memcoll.h b/src/bin/coreutils/lib/memcoll.h index 9b61ce9393..853d55983c 100644 --- a/src/bin/coreutils/lib/memcoll.h +++ b/src/bin/coreutils/lib/memcoll.h @@ -2,10 +2,10 @@ Copyright (C) 1999, 2003 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Contributed by Paul Eggert . */ diff --git a/src/bin/coreutils/lib/memcpy.c b/src/bin/coreutils/lib/memcpy.c index d1e49c6fc7..1da71dd01d 100644 --- a/src/bin/coreutils/lib/memcpy.c +++ b/src/bin/coreutils/lib/memcpy.c @@ -1,9 +1,9 @@ /* Copyright (C) 1995, 1997, 2000, 2003, 2006 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -11,8 +11,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Jim Meyering . */ diff --git a/src/bin/coreutils/lib/mempcpy.c b/src/bin/coreutils/lib/mempcpy.c index 1c702c7f4c..1a6e53ece4 100644 --- a/src/bin/coreutils/lib/mempcpy.c +++ b/src/bin/coreutils/lib/mempcpy.c @@ -1,9 +1,12 @@ +/* -*- buffer-read-only: t -*- vi: set ro: */ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 /* Copy memory area and return pointer after last written byte. Copyright (C) 2003, 2007 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) + the Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/src/bin/coreutils/lib/memrchr.c b/src/bin/coreutils/lib/memrchr.c index 29fd531016..da93ca0ba5 100644 --- a/src/bin/coreutils/lib/memrchr.c +++ b/src/bin/coreutils/lib/memrchr.c @@ -1,7 +1,7 @@ /* memrchr -- find the last occurrence of a byte in a memory block Copyright (C) 1991, 1993, 1996, 1997, 1999, 2000, 2003, 2004, 2005, - 2006, 2007 Free Software Foundation, Inc. + 2006, 2007, 2008 Free Software Foundation, Inc. Based on strlen implementation by Torbjorn Granlund (tege@sics.se), with help from Dan Sahlin (dan@sics.se) and @@ -9,19 +9,18 @@ adaptation to memchr suggested by Dick Karpinski (dick@cca.ucsf.edu), and implemented by Roland McGrath (roland@ai.mit.edu). - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ #if defined _LIBC # include @@ -34,7 +33,9 @@ #include #undef __memrchr -#undef memrchr +#ifdef _LIBC +# undef memrchr +#endif #ifndef weak_alias # define __memrchr memrchr @@ -44,146 +45,116 @@ void * __memrchr (void const *s, int c_in, size_t n) { + /* On 32-bit hardware, choosing longword to be a 32-bit unsigned + long instead of a 64-bit uintmax_t tends to give better + performance. On 64-bit hardware, unsigned long is generally 64 + bits already. Change this typedef to experiment with + performance. */ + typedef unsigned long int longword; + const unsigned char *char_ptr; - const unsigned long int *longword_ptr; - unsigned long int longword, magic_bits, charmask; + const longword *longword_ptr; + longword repeated_one; + longword repeated_c; unsigned reg_char c; - int i; c = (unsigned char) c_in; - /* Handle the last few characters by reading one character at a time. + /* Handle the last few bytes by reading one byte at a time. Do this until CHAR_PTR is aligned on a longword boundary. */ for (char_ptr = (const unsigned char *) s + n; - n > 0 && (size_t) char_ptr % sizeof longword != 0; + n > 0 && (size_t) char_ptr % sizeof (longword) != 0; --n) if (*--char_ptr == c) return (void *) char_ptr; + longword_ptr = (const longword *) char_ptr; + /* All these elucidatory comments refer to 4-byte longwords, but the theory applies equally well to any size longwords. */ - longword_ptr = (const unsigned long int *) char_ptr; - - /* Bits 31, 24, 16, and 8 of this number are zero. Call these bits - the "holes." Note that there is a hole just to the left of - each byte, with an extra at the end: - - bits: 01111110 11111110 11111110 11111111 - bytes: AAAAAAAA BBBBBBBB CCCCCCCC DDDDDDDD - - The 1-bits make sure that carries propagate to the next 0-bit. - The 0-bits provide holes for carries to fall into. */ - - /* Set MAGIC_BITS to be this pattern of 1 and 0 bits. - Set CHARMASK to be a longword, each of whose bytes is C. */ - - magic_bits = 0xfefefefe; - charmask = c | (c << 8); - charmask |= charmask << 16; -#if 0xffffffffU < ULONG_MAX - magic_bits |= magic_bits << 32; - charmask |= charmask << 32; - if (8 < sizeof longword) - for (i = 64; i < sizeof longword * 8; i *= 2) - { - magic_bits |= magic_bits << i; - charmask |= charmask << i; - } -#endif - magic_bits = (ULONG_MAX >> 1) & (magic_bits | 1); - - /* Instead of the traditional loop which tests each character, - we will test a longword at a time. The tricky part is testing - if *any of the four* bytes in the longword in question are zero. */ - while (n >= sizeof longword) + /* Compute auxiliary longword values: + repeated_one is a value which has a 1 in every byte. + repeated_c has c in every byte. */ + repeated_one = 0x01010101; + repeated_c = c | (c << 8); + repeated_c |= repeated_c << 16; + if (0xffffffffU < (longword) -1) { - /* We tentatively exit the loop if adding MAGIC_BITS to - LONGWORD fails to change any of the hole bits of LONGWORD. - - 1) Is this safe? Will it catch all the zero bytes? - Suppose there is a byte with all zeros. Any carry bits - propagating from its left will fall into the hole at its - least significant bit and stop. Since there will be no - carry from its most significant bit, the LSB of the - byte to the left will be unchanged, and the zero will be - detected. - - 2) Is this worthwhile? Will it ignore everything except - zero bytes? Suppose every byte of LONGWORD has a bit set - somewhere. There will be a carry into bit 8. If bit 8 - is set, this will carry into bit 16. If bit 8 is clear, - one of bits 9-15 must be set, so there will be a carry - into bit 16. Similarly, there will be a carry into bit - 24. If one of bits 24-30 is set, there will be a carry - into bit 31, so all of the hole bits will be changed. - - The one misfire occurs when bits 24-30 are clear and bit - 31 is set; in this case, the hole at bit 31 is not - changed. If we had access to the processor carry flag, - we could close this loophole by putting the fourth hole - at bit 32! - - So it ignores everything except 128's, when they're aligned - properly. - - 3) But wait! Aren't we looking for C, not zero? - Good point. So what we do is XOR LONGWORD with a longword, - each of whose bytes is C. This turns each byte that is C - into a zero. */ - - longword = *--longword_ptr ^ charmask; - - /* Add MAGIC_BITS to LONGWORD. */ - if ((((longword + magic_bits) - - /* Set those bits that were unchanged by the addition. */ - ^ ~longword) - - /* Look at only the hole bits. If any of the hole bits - are unchanged, most likely one of the bytes was a - zero. */ - & ~magic_bits) != 0) + repeated_one |= repeated_one << 31 << 1; + repeated_c |= repeated_c << 31 << 1; + if (8 < sizeof (longword)) { - /* Which of the bytes was C? If none of them were, it was - a misfire; continue the search. */ + size_t i; - const unsigned char *cp = (const unsigned char *) longword_ptr; - - if (8 < sizeof longword) - for (i = sizeof longword - 1; 8 <= i; i--) - if (cp[i] == c) - return (void *) &cp[i]; - if (7 < sizeof longword && cp[7] == c) - return (void *) &cp[7]; - if (6 < sizeof longword && cp[6] == c) - return (void *) &cp[6]; - if (5 < sizeof longword && cp[5] == c) - return (void *) &cp[5]; - if (4 < sizeof longword && cp[4] == c) - return (void *) &cp[4]; - if (cp[3] == c) - return (void *) &cp[3]; - if (cp[2] == c) - return (void *) &cp[2]; - if (cp[1] == c) - return (void *) &cp[1]; - if (cp[0] == c) - return (void *) cp; + for (i = 64; i < sizeof (longword) * 8; i *= 2) + { + repeated_one |= repeated_one << i; + repeated_c |= repeated_c << i; + } } + } - n -= sizeof longword; + /* Instead of the traditional loop which tests each byte, we will test a + longword at a time. The tricky part is testing if *any of the four* + bytes in the longword in question are equal to c. We first use an xor + with repeated_c. This reduces the task to testing whether *any of the + four* bytes in longword1 is zero. + + We compute tmp = + ((longword1 - repeated_one) & ~longword1) & (repeated_one << 7). + That is, we perform the following operations: + 1. Subtract repeated_one. + 2. & ~longword1. + 3. & a mask consisting of 0x80 in every byte. + Consider what happens in each byte: + - If a byte of longword1 is zero, step 1 and 2 transform it into 0xff, + and step 3 transforms it into 0x80. A carry can also be propagated + to more significant bytes. + - If a byte of longword1 is nonzero, let its lowest 1 bit be at + position k (0 <= k <= 7); so the lowest k bits are 0. After step 1, + the byte ends in a single bit of value 0 and k bits of value 1. + After step 2, the result is just k bits of value 1: 2^k - 1. After + step 3, the result is 0. And no carry is produced. + So, if longword1 has only non-zero bytes, tmp is zero. + Whereas if longword1 has a zero byte, call j the position of the least + significant zero byte. Then the result has a zero at positions 0, ..., + j-1 and a 0x80 at position j. We cannot predict the result at the more + significant bytes (positions j+1..3), but it does not matter since we + already have a non-zero bit at position 8*j+7. + + So, the test whether any byte in longword1 is zero is equivalent to + testing whether tmp is nonzero. */ + + while (n >= sizeof (longword)) + { + longword longword1 = *--longword_ptr ^ repeated_c; + + if ((((longword1 - repeated_one) & ~longword1) + & (repeated_one << 7)) != 0) + { + longword_ptr++; + break; + } + n -= sizeof (longword); } char_ptr = (const unsigned char *) longword_ptr; + /* At this point, we know that either n < sizeof (longword), or one of the + sizeof (longword) bytes starting at char_ptr is == c. On little-endian + machines, we could determine the first such byte without any further + memory accesses, just by looking at the tmp result from the last loop + iteration. But this does not work on big-endian machines. Choose code + that works in both cases. */ + while (n-- > 0) { if (*--char_ptr == c) return (void *) char_ptr; } - return 0; + return NULL; } #ifdef weak_alias weak_alias (__memrchr, memrchr) diff --git a/src/bin/coreutils/lib/memset.c b/src/bin/coreutils/lib/memset.c index 890cbf12d0..b5fb7a535f 100644 --- a/src/bin/coreutils/lib/memset.c +++ b/src/bin/coreutils/lib/memset.c @@ -1,9 +1,12 @@ +/* -*- buffer-read-only: t -*- vi: set ro: */ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 /* memset.c -- set an area of memory to a given value Copyright (C) 1991, 2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) + the Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/src/bin/coreutils/lib/memxfrm.c b/src/bin/coreutils/lib/memxfrm.c index 09bb5f4ad0..7800724619 100644 --- a/src/bin/coreutils/lib/memxfrm.c +++ b/src/bin/coreutils/lib/memxfrm.c @@ -2,10 +2,10 @@ Copyright (C) 2006 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Paul Eggert . */ diff --git a/src/bin/coreutils/lib/mgetgroups.c b/src/bin/coreutils/lib/mgetgroups.c new file mode 100644 index 0000000000..736dd87f38 --- /dev/null +++ b/src/bin/coreutils/lib/mgetgroups.c @@ -0,0 +1,142 @@ +/* mgetgroups.c -- return a list of the groups a user is in + + Copyright (C) 2007-2009 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* Extracted from coreutils' src/id.c. */ + +#include + +#include "mgetgroups.h" + +#include +#include +#include +#include +#include +#if HAVE_GETGROUPLIST +# include +#endif +#include "getugroups.h" +#include "xalloc.h" + + +static GETGROUPS_T * +realloc_groupbuf (GETGROUPS_T *g, size_t num) +{ + if (xalloc_oversized (num, sizeof (*g))) + { + errno = ENOMEM; + return NULL; + } + + return realloc (g, num * sizeof (*g)); +} + +/* Like getugroups, but store the result in malloc'd storage. + Set *GROUPS to the malloc'd list of all group IDs of which USERNAME + is a member. If GID is not -1, store it first. GID should be the + group ID (pw_gid) obtained from getpwuid, in case USERNAME is not + listed in the groups database (e.g., /etc/groups). Upon failure, + don't modify *GROUPS, set errno, and return -1. Otherwise, return + the number of groups. */ + +int +mgetgroups (char const *username, gid_t gid, GETGROUPS_T **groups) +{ + int max_n_groups; + int ng; + GETGROUPS_T *g; + +#if HAVE_GETGROUPLIST + /* We prefer to use getgrouplist if available, because it has better + performance characteristics. + + In glibc 2.3.2, getgrouplist is buggy. If you pass a zero as the + length of the output buffer, getgrouplist will still write to the + buffer. Contrary to what some versions of the getgrouplist + manpage say, this doesn't happen with nonzero buffer sizes. + Therefore our usage here just avoids a zero sized buffer. */ + if (username) + { + enum { N_GROUPS_INIT = 10 }; + max_n_groups = N_GROUPS_INIT; + + g = realloc_groupbuf (NULL, max_n_groups); + if (g == NULL) + return -1; + + while (1) + { + GETGROUPS_T *h; + int last_n_groups = max_n_groups; + + /* getgrouplist updates max_n_groups to num required. */ + ng = getgrouplist (username, gid, g, &max_n_groups); + + /* Some systems (like Darwin) have a bug where they + never increase max_n_groups. */ + if (ng < 0 && last_n_groups == max_n_groups) + max_n_groups *= 2; + + if ((h = realloc_groupbuf (g, max_n_groups)) == NULL) + { + int saved_errno = errno; + free (g); + errno = saved_errno; + return -1; + } + g = h; + + if (0 <= ng) + { + *groups = g; + /* On success some systems just return 0 from getgrouplist, + so return max_n_groups rather than ng. */ + return max_n_groups; + } + } + } + /* else no username, so fall through and use getgroups. */ +#endif + + max_n_groups = (username + ? getugroups (0, NULL, username, gid) + : getgroups (0, NULL)); + + /* If we failed to count groups with NULL for a buffer, + try again with a non-NULL one, just in case. */ + if (max_n_groups < 0) + max_n_groups = 5; + + g = realloc_groupbuf (NULL, max_n_groups); + if (g == NULL) + return -1; + + ng = (username + ? getugroups (max_n_groups, g, username, gid) + : getgroups (max_n_groups, g)); + + if (ng < 0) + { + int saved_errno = errno; + free (g); + errno = saved_errno; + return -1; + } + + *groups = g; + return ng; +} diff --git a/src/bin/coreutils/lib/mgetgroups.h b/src/bin/coreutils/lib/mgetgroups.h new file mode 100644 index 0000000000..1b382d1c37 --- /dev/null +++ b/src/bin/coreutils/lib/mgetgroups.h @@ -0,0 +1,19 @@ +/* Get a list of all group IDs associated with a specified user ID. + Copyright (C) 2007 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#include + +int mgetgroups (const char *username, gid_t gid, GETGROUPS_T **groups); diff --git a/src/bin/coreutils/lib/mkancesdirs.c b/src/bin/coreutils/lib/mkancesdirs.c index 19f7dca5bc..e44cf3e059 100644 --- a/src/bin/coreutils/lib/mkancesdirs.c +++ b/src/bin/coreutils/lib/mkancesdirs.c @@ -2,10 +2,10 @@ Copyright (C) 2006 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Paul Eggert. */ diff --git a/src/bin/coreutils/lib/mkdir-p.c b/src/bin/coreutils/lib/mkdir-p.c index 6f71ec84d5..f38dbc71f8 100644 --- a/src/bin/coreutils/lib/mkdir-p.c +++ b/src/bin/coreutils/lib/mkdir-p.c @@ -3,10 +3,10 @@ Copyright (C) 1990, 1997, 1998, 1999, 2000, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Paul Eggert, David MacKenzie, and Jim Meyering. */ diff --git a/src/bin/coreutils/lib/mkdir-p.h b/src/bin/coreutils/lib/mkdir-p.h index 7353182c49..487e6ebebf 100644 --- a/src/bin/coreutils/lib/mkdir-p.h +++ b/src/bin/coreutils/lib/mkdir-p.h @@ -3,10 +3,10 @@ Copyright (C) 1994, 1995, 1996, 1997, 2000, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Paul Eggert, David MacKenzie, and Jim Meyering. */ diff --git a/src/bin/coreutils/lib/mkdir.c b/src/bin/coreutils/lib/mkdir.c index 5a0c4b0334..5f4d235e3b 100644 --- a/src/bin/coreutils/lib/mkdir.c +++ b/src/bin/coreutils/lib/mkdir.c @@ -1,12 +1,12 @@ /* On some systems, mkdir ("foo/", 0700) fails because of the trailing slash. On those systems, this wrapper removes the trailing slash. - Copyright (C) 2001, 2003, 2006 Free Software Foundation, Inc. + Copyright (C) 2001, 2003, 2006, 2008 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,20 +14,16 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* written by Jim Meyering */ #include -/* Disable the definition of mkdir to rpl_mkdir (from config.h) in this - file. Otherwise, we'd get conflicting prototypes for rpl_mkdir on - most systems. */ -#undef mkdir - +/* Specification. */ #include #include + #include #include #include @@ -35,10 +31,24 @@ #include "dirname.h" #include "xalloc.h" +/* Disable the definition of mkdir to rpl_mkdir (from the + substitute) in this file. Otherwise, we'd get an endless recursion. */ +#undef mkdir + +/* mingw's _mkdir() function has 1 argument, but we pass 2 arguments. + Additionally, it declares _mkdir (and depending on compile flags, an + alias mkdir), only in the nonstandard io.h. */ +#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +# define mkdir(name,mode) _mkdir (name) +# define maybe_unused _UNUSED_PARAMETER_ +#else +# define maybe_unused /* empty */ +#endif + /* This function is required at least for NetBSD 1.5.2. */ int -rpl_mkdir (char const *dir, mode_t mode) +rpl_mkdir (char const *dir, mode_t mode maybe_unused) { int ret_val; char *tmp_dir; diff --git a/src/bin/coreutils/lib/mkdirat.c b/src/bin/coreutils/lib/mkdirat.c index da0b262bf6..6b6278b115 100644 --- a/src/bin/coreutils/lib/mkdirat.c +++ b/src/bin/coreutils/lib/mkdirat.c @@ -1,10 +1,10 @@ /* fd-relative mkdir Copyright (C) 2005, 2006 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* written by Jim Meyering */ diff --git a/src/bin/coreutils/lib/mkstemp-safer.c b/src/bin/coreutils/lib/mkstemp-safer.c index ff1c0d484a..4ba97c3790 100644 --- a/src/bin/coreutils/lib/mkstemp-safer.c +++ b/src/bin/coreutils/lib/mkstemp-safer.c @@ -2,10 +2,10 @@ Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Paul Eggert. */ diff --git a/src/bin/coreutils/lib/mkstemp.c b/src/bin/coreutils/lib/mkstemp.c index 57ee228e85..1b052f9b7f 100644 --- a/src/bin/coreutils/lib/mkstemp.c +++ b/src/bin/coreutils/lib/mkstemp.c @@ -1,19 +1,18 @@ /* Copyright (C) 1998, 1999, 2001, 2005, 2006, 2007 Free Software Foundation, Inc. This file is derived from the one in the GNU C Library. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ #if !_LIBC # include diff --git a/src/bin/coreutils/lib/mktime.c b/src/bin/coreutils/lib/mktime.c index a91fb20e68..d3e7a3852c 100644 --- a/src/bin/coreutils/lib/mktime.c +++ b/src/bin/coreutils/lib/mktime.c @@ -1,3 +1,6 @@ +/* -*- buffer-read-only: t -*- vi: set ro: */ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 /* Convert a `struct tm' to a time_t value. Copyright (C) 1993-1999, 2002-2005, 2006, 2007 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -5,7 +8,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) + the Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -290,7 +293,9 @@ __mktime_internal (struct tm *tp, int mday = tp->tm_mday; int mon = tp->tm_mon; int year_requested = tp->tm_year; - int isdst = tp->tm_isdst; + /* Normalize the value. */ + int isdst = ((tp->tm_isdst >> (8 * sizeof (tp->tm_isdst) - 1)) + | (tp->tm_isdst != 0)); /* 1 if the previous probe was DST. */ int dst2; diff --git a/src/bin/coreutils/lib/modechange.c b/src/bin/coreutils/lib/modechange.c index e1f7ceb77c..1296717c5f 100644 --- a/src/bin/coreutils/lib/modechange.c +++ b/src/bin/coreutils/lib/modechange.c @@ -3,10 +3,10 @@ Copyright (C) 1989, 1990, 1997, 1998, 1999, 2001, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by David MacKenzie */ diff --git a/src/bin/coreutils/lib/modechange.h b/src/bin/coreutils/lib/modechange.h index 76e0178de2..f6f8e744d6 100644 --- a/src/bin/coreutils/lib/modechange.h +++ b/src/bin/coreutils/lib/modechange.h @@ -3,10 +3,10 @@ Copyright (C) 1989, 1990, 1997, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ #if ! defined MODECHANGE_H_ # define MODECHANGE_H_ diff --git a/src/bin/coreutils/lib/mountlist.c b/src/bin/coreutils/lib/mountlist.c index a50828e395..50e90eed47 100644 --- a/src/bin/coreutils/lib/mountlist.c +++ b/src/bin/coreutils/lib/mountlist.c @@ -1,12 +1,11 @@ /* mountlist.c -- return a list of mounted file systems - Copyright (C) 1991, 1992, 1997, 1998, 1999, 2000, 2001, 2002, 2003, - 2004, 2005, 2006, 2007 Free Software Foundation, Inc. + Copyright (C) 1991, 1992, 1997-2009 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ #include @@ -25,6 +23,7 @@ #include #include #include +#include #include "xalloc.h" @@ -135,10 +134,6 @@ # include "unlocked-io.h" #endif -#ifndef SIZE_MAX -# define SIZE_MAX ((size_t) -1) -#endif - /* The results of open() in this file are not used with fchdir, therefore save some unnecessary work in fchdir.c. */ #undef open @@ -301,7 +296,6 @@ fstype_to_string (int t) /* Return the device number from MOUNT_OPTIONS, if possible. Otherwise return (dev_t) -1. */ - static dev_t dev_from_mount_options (char const *mount_options) { @@ -328,7 +322,7 @@ dev_from_mount_options (char const *mount_options) } # endif - + (void) mount_options; return -1; } @@ -345,6 +339,7 @@ read_file_system_list (bool need_fs_type) struct mount_entry *mount_list; struct mount_entry *me; struct mount_entry **mtail = &mount_list; + (void) need_fs_type; #ifdef MOUNTED_LISTMNTENT { @@ -379,7 +374,7 @@ read_file_system_list (bool need_fs_type) #ifdef MOUNTED_GETMNTENT1 /* GNU/Linux, 4.3BSD, SunOS, HP-UX, Dynix, Irix. */ { struct mntent *mnt; - char *table = MOUNTED; + char const *table = MOUNTED; FILE *fp; fp = setmntent (table, "r"); diff --git a/src/bin/coreutils/lib/mountlist.h b/src/bin/coreutils/lib/mountlist.h index 7f5a6f77ab..e54bb49ef8 100644 --- a/src/bin/coreutils/lib/mountlist.h +++ b/src/bin/coreutils/lib/mountlist.h @@ -3,10 +3,10 @@ Copyright (C) 1991, 1992, 1998, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ #ifndef MOUNTLIST_H_ # define MOUNTLIST_H_ diff --git a/src/bin/coreutils/lib/mpsort.c b/src/bin/coreutils/lib/mpsort.c index d6b1e0e4ee..43b25b6be4 100644 --- a/src/bin/coreutils/lib/mpsort.c +++ b/src/bin/coreutils/lib/mpsort.c @@ -2,19 +2,18 @@ Copyright (C) 2007 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ /* Written by Paul Eggert. */ diff --git a/src/bin/coreutils/lib/nanosleep.c b/src/bin/coreutils/lib/nanosleep.c index 89c5512428..7a7cc02fd9 100644 --- a/src/bin/coreutils/lib/nanosleep.c +++ b/src/bin/coreutils/lib/nanosleep.c @@ -1,12 +1,12 @@ /* Provide a replacement for the POSIX nanosleep function. - Copyright (C) 1999, 2000, 2002, 2004, 2005, 2006, 2007 Free + Copyright (C) 1999, 2000, 2002, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* written by Jim Meyering */ @@ -23,14 +22,13 @@ #include +#include "sig-handler.h" #include "timespec.h" #include #include #include -#if HAVE_SYS_SELECT_H -# include -#endif +#include #include #include @@ -44,7 +42,7 @@ enum { BILLION = 1000 * 1000 * 1000 }; #if HAVE_BUG_BIG_NANOSLEEP -void +static void getnow (struct timespec *t) { # if defined CLOCK_MONOTONIC && HAVE_CLOCK_GETTIME @@ -105,10 +103,6 @@ rpl_nanosleep (const struct timespec *requested_delay, # define SIGCONT SIGTERM # endif -# if ! HAVE_SIGINTERRUPT -# define siginterrupt(sig, flag) /* empty */ -# endif - static sig_atomic_t volatile suspended; /* Handle SIGCONT. */ @@ -153,22 +147,18 @@ rpl_nanosleep (const struct timespec *requested_delay, /* set up sig handler */ if (! initialized) { -# ifdef SA_NOCLDSTOP - struct sigaction oldact, newact; - newact.sa_handler = sighandler; - sigemptyset (&newact.sa_mask); - newact.sa_flags = 0; + struct sigaction oldact; sigaction (SIGCONT, NULL, &oldact); - if (oldact.sa_handler != SIG_IGN) - sigaction (SIGCONT, &newact, NULL); -# else - if (signal (SIGCONT, SIG_IGN) != SIG_IGN) + if (get_handler (&oldact) != SIG_IGN) { - signal (SIGCONT, sighandler); - siginterrupt (SIGCONT, 1); + struct sigaction newact; + + newact.sa_handler = sighandler; + sigemptyset (&newact.sa_mask); + newact.sa_flags = 0; + sigaction (SIGCONT, &newact, NULL); } -# endif initialized = true; } diff --git a/src/bin/coreutils/lib/netdb.in.h b/src/bin/coreutils/lib/netdb.in.h new file mode 100644 index 0000000000..0466977859 --- /dev/null +++ b/src/bin/coreutils/lib/netdb.in.h @@ -0,0 +1,185 @@ +/* -*- buffer-read-only: t -*- vi: set ro: */ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 +/* Provide a netdb.h header file for systems lacking it (read: MinGW). + Copyright (C) 2008 Free Software Foundation, Inc. + Written by Simon Josefsson. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + +/* This file is supposed to be used on platforms that lack . + It is intended to provide definitions and prototypes needed by an + application. */ + +#ifndef _GL_NETDB_H + +#if @HAVE_NETDB_H@ + +# if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +# endif + +/* The include_next requires a split double-inclusion guard. */ +# @INCLUDE_NEXT@ @NEXT_NETDB_H@ + +#endif + +#ifndef _GL_NETDB_H +#define _GL_NETDB_H + +/* Get netdb.h definitions such as struct hostent for MinGW. */ +#include + +/* Declarations for a platform that lacks , or where it is + incomplete. */ + +#if @GNULIB_GETADDRINFO@ + +# if !@HAVE_STRUCT_ADDRINFO@ + +/* Structure to contain information about address of a service provider. */ +struct addrinfo +{ + int ai_flags; /* Input flags. */ + int ai_family; /* Protocol family for socket. */ + int ai_socktype; /* Socket type. */ + int ai_protocol; /* Protocol for socket. */ + socklen_t ai_addrlen; /* Length of socket address. */ + struct sockaddr *ai_addr; /* Socket address for socket. */ + char *ai_canonname; /* Canonical name for service location. */ + struct addrinfo *ai_next; /* Pointer to next in list. */ +}; +# endif + +/* Possible values for `ai_flags' field in `addrinfo' structure. */ +# ifndef AI_PASSIVE +# define AI_PASSIVE 0x0001 /* Socket address is intended for `bind'. */ +# endif +# ifndef AI_CANONNAME +# define AI_CANONNAME 0x0002 /* Request for canonical name. */ +# endif +# ifndef AI_NUMERICSERV +# define AI_NUMERICSERV 0x0400 /* Don't use name resolution. */ +# endif + +# if 0 +/* The commented out definitions below are not yet implemented in the + GNULIB getaddrinfo() replacement, so are not yet needed and may, in fact, + cause conflicts on systems with a getaddrinfo() function which does not + define them. + + If they are restored, be sure to protect the definitions with #ifndef. */ +# define AI_NUMERICHOST 0x0004 /* Don't use name resolution. */ +# define AI_V4MAPPED 0x0008 /* IPv4 mapped addresses are acceptable. */ +# define AI_ALL 0x0010 /* Return IPv4 mapped and IPv6 addresses. */ +# define AI_ADDRCONFIG 0x0020 /* Use configuration of this host to choose + returned address type.. */ +# endif /* 0 */ + +/* Error values for `getaddrinfo' function. */ +# ifndef EAI_BADFLAGS +# define EAI_BADFLAGS -1 /* Invalid value for `ai_flags' field. */ +# define EAI_NONAME -2 /* NAME or SERVICE is unknown. */ +# define EAI_AGAIN -3 /* Temporary failure in name resolution. */ +# define EAI_FAIL -4 /* Non-recoverable failure in name res. */ +# define EAI_NODATA -5 /* No address associated with NAME. */ +# define EAI_FAMILY -6 /* `ai_family' not supported. */ +# define EAI_SOCKTYPE -7 /* `ai_socktype' not supported. */ +# define EAI_SERVICE -8 /* SERVICE not supported for `ai_socktype'. */ +# define EAI_MEMORY -10 /* Memory allocation failure. */ +# endif + +/* Since EAI_NODATA is deprecated by RFC3493, some systems (at least + FreeBSD, which does define EAI_BADFLAGS) have removed the definition + in favor of EAI_NONAME. */ +# if !defined EAI_NODATA && defined EAI_NONAME +# define EAI_NODATA EAI_NONAME +# endif + +# ifndef EAI_OVERFLOW +/* Not defined on mingw32 and Haiku. */ +# define EAI_OVERFLOW -12 /* Argument buffer overflow. */ +# endif +# ifndef EAI_ADDRFAMILY +/* Not defined on mingw32. */ +# define EAI_ADDRFAMILY -9 /* Address family for NAME not supported. */ +# endif +# ifndef EAI_SYSTEM +/* Not defined on mingw32. */ +# define EAI_SYSTEM -11 /* System error returned in `errno'. */ +# endif + +# if 0 +/* The commented out definitions below are not yet implemented in the + GNULIB getaddrinfo() replacement, so are not yet needed. + + If they are restored, be sure to protect the definitions with #ifndef. */ +# ifndef EAI_INPROGRESS +# define EAI_INPROGRESS -100 /* Processing request in progress. */ +# define EAI_CANCELED -101 /* Request canceled. */ +# define EAI_NOTCANCELED -102 /* Request not canceled. */ +# define EAI_ALLDONE -103 /* All requests done. */ +# define EAI_INTR -104 /* Interrupted by a signal. */ +# define EAI_IDN_ENCODE -105 /* IDN encoding failed. */ +# endif +# endif + +# if !@HAVE_DECL_GETADDRINFO@ +/* Translate name of a service location and/or a service name to set of + socket addresses. + For more details, see the POSIX:2001 specification + . */ +extern int getaddrinfo (const char *restrict nodename, + const char *restrict servname, + const struct addrinfo *restrict hints, + struct addrinfo **restrict res); +# endif + +# if !@HAVE_DECL_FREEADDRINFO@ +/* Free `addrinfo' structure AI including associated storage. + For more details, see the POSIX:2001 specification + . */ +extern void freeaddrinfo (struct addrinfo *ai); +# endif + +# if !@HAVE_DECL_GAI_STRERROR@ +/* Convert error return from getaddrinfo() to a string. + For more details, see the POSIX:2001 specification + . */ +extern const char *gai_strerror (int ecode); +# endif + +# if !@HAVE_DECL_GETNAMEINFO@ +/* Convert socket address to printable node and service names. + For more details, see the POSIX:2001 specification + . */ +extern int getnameinfo(const struct sockaddr *restrict sa, socklen_t salen, + char *restrict node, socklen_t nodelen, + char *restrict service, socklen_t servicelen, + int flags); +# endif + +/* Possible flags for getnameinfo. */ +# ifndef NI_NUMERICHOST +# define NI_NUMERICHOST 1 +# endif +# ifndef NI_NUMERICSERV +# define NI_NUMERICSERV 2 +# endif + +#endif /* @GNULIB_GETADDRINFO@ */ + +#endif /* _GL_NETDB_H */ +#endif /* _GL_NETDB_H */ diff --git a/src/bin/coreutils/lib/netinet_in_.h b/src/bin/coreutils/lib/netinet_in.in.h similarity index 67% rename from src/bin/coreutils/lib/netinet_in_.h rename to src/bin/coreutils/lib/netinet_in.in.h index 4a53605f5d..cd59d716a8 100644 --- a/src/bin/coreutils/lib/netinet_in_.h +++ b/src/bin/coreutils/lib/netinet_in.in.h @@ -1,9 +1,12 @@ +/* -*- buffer-read-only: t -*- vi: set ro: */ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 /* Substitute for . - Copyright (C) 2007 Free Software Foundation, Inc. + Copyright (C) 2007-2008 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) + the Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -16,17 +19,26 @@ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GL_NETINET_IN_H -#define _GL_NETINET_IN_H #if @HAVE_NETINET_IN_H@ +# if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +# endif + /* On many platforms, assumes prior inclusion of . */ - # include -# include @ABSOLUTE_NETINET_IN_H@ -#else +/* The include_next requires a split double-inclusion guard. */ +# @INCLUDE_NEXT@ @NEXT_NETINET_IN_H@ + +#endif + +#ifndef _GL_NETINET_IN_H +#define _GL_NETINET_IN_H + +#if !@HAVE_NETINET_IN_H@ /* A platform that lacks . */ @@ -35,3 +47,4 @@ #endif #endif /* _GL_NETINET_IN_H */ +#endif /* _GL_NETINET_IN_H */ diff --git a/src/bin/coreutils/lib/obstack.c b/src/bin/coreutils/lib/obstack.c index 5cd0b7a6d0..5b87466d88 100644 --- a/src/bin/coreutils/lib/obstack.c +++ b/src/bin/coreutils/lib/obstack.c @@ -4,19 +4,18 @@ 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ #ifdef _LIBC # include diff --git a/src/bin/coreutils/lib/obstack.h b/src/bin/coreutils/lib/obstack.h index 3315dfe617..1bf4b2f1a6 100644 --- a/src/bin/coreutils/lib/obstack.h +++ b/src/bin/coreutils/lib/obstack.h @@ -3,19 +3,18 @@ Free Software Foundation, Inc. This file is part of the GNU C Library. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ /* Summary: diff --git a/src/bin/coreutils/lib/open-safer.c b/src/bin/coreutils/lib/open-safer.c index 04a72eb7b6..15bf6a65d0 100644 --- a/src/bin/coreutils/lib/open-safer.c +++ b/src/bin/coreutils/lib/open-safer.c @@ -1,11 +1,11 @@ /* Invoke open, but avoid some glitches. - Copyright (C) 2005, 2006 Free Software Foundation, Inc. + Copyright (C) 2005, 2006, 2008 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Paul Eggert. */ @@ -39,9 +38,10 @@ open_safer (char const *file, int flags, ...) /* Assume mode_t promotes to int if and only if it is smaller. This assumption isn't guaranteed by the C standard, but we don't know of any real-world counterexamples. */ - mode = (sizeof (mode_t) < sizeof (int) - ? va_arg (ap, int) - : va_arg (ap, mode_t)); + if (sizeof (mode_t) < sizeof (int)) + mode = va_arg (ap, int); + else + mode = va_arg (ap, mode_t); va_end (ap); } diff --git a/src/bin/coreutils/lib/open.c b/src/bin/coreutils/lib/open.c new file mode 100644 index 0000000000..13af274602 --- /dev/null +++ b/src/bin/coreutils/lib/open.c @@ -0,0 +1,140 @@ +/* Open a descriptor to a file. + Copyright (C) 2007-2008 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* Written by Bruno Haible , 2007. */ + +#include + +/* Get the original definition of open. It might be defined as a macro. */ +#define __need_system_fcntl_h +#include +#undef __need_system_fcntl_h +#include + +static inline int +orig_open (const char *filename, int flags, mode_t mode) +{ + return open (filename, flags, mode); +} + +/* Specification. */ +#include + +#include +#include +#include +#include +#include + +int +open (const char *filename, int flags, ...) +{ + mode_t mode; + int fd; + + mode = 0; + if (flags & O_CREAT) + { + va_list arg; + va_start (arg, flags); + + /* If mode_t is narrower than int, use the promoted type (int), + not mode_t. Use sizeof to guess whether mode_t is narrower; + we don't know of any practical counterexamples. */ + mode = (sizeof (mode_t) < sizeof (int) + ? va_arg (arg, int) + : va_arg (arg, mode_t)); + + va_end (arg); + } + +#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ + if (strcmp (filename, "/dev/null") == 0) + filename = "NUL"; +#endif + +#if OPEN_TRAILING_SLASH_BUG + /* If the filename ends in a slash and one of O_CREAT, O_WRONLY, O_RDWR + is specified, then fail. + Rationale: POSIX + says that + "A pathname that contains at least one non-slash character and that + ends with one or more trailing slashes shall be resolved as if a + single dot character ( '.' ) were appended to the pathname." + and + "The special filename dot shall refer to the directory specified by + its predecessor." + If the named file already exists as a directory, then + - if O_CREAT is specified, open() must fail because of the semantics + of O_CREAT, + - if O_WRONLY or O_RDWR is specified, open() must fail because POSIX + says that it + fails with errno = EISDIR in this case. + If the named file does not exist or does not name a directory, then + - if O_CREAT is specified, open() must fail since open() cannot create + directories, + - if O_WRONLY or O_RDWR is specified, open() must fail because the + file does not contain a '.' directory. */ + if (flags & (O_CREAT | O_WRONLY | O_RDWR)) + { + size_t len = strlen (filename); + if (len > 0 && filename[len - 1] == '/') + { + errno = EISDIR; + return -1; + } + } +#endif + + fd = orig_open (filename, flags, mode); + +#if OPEN_TRAILING_SLASH_BUG + /* If the filename ends in a slash and fd does not refer to a directory, + then fail. + Rationale: POSIX + says that + "A pathname that contains at least one non-slash character and that + ends with one or more trailing slashes shall be resolved as if a + single dot character ( '.' ) were appended to the pathname." + and + "The special filename dot shall refer to the directory specified by + its predecessor." + If the named file without the slash is not a directory, open() must fail + with ENOTDIR. */ + if (fd >= 0) + { + size_t len = strlen (filename); + if (len > 0 && filename[len - 1] == '/') + { + struct stat statbuf; + + if (fstat (fd, &statbuf) >= 0 && !S_ISDIR (statbuf.st_mode)) + { + close (fd); + errno = ENOTDIR; + return -1; + } + } + } +#endif + +#ifdef FCHDIR_REPLACEMENT + if (fd >= 0) + _gl_register_fd (fd, filename); +#endif + + return fd; +} diff --git a/src/bin/coreutils/lib/openat-die.c b/src/bin/coreutils/lib/openat-die.c index 7a285700d5..677f3e02cb 100644 --- a/src/bin/coreutils/lib/openat-die.c +++ b/src/bin/coreutils/lib/openat-die.c @@ -1,11 +1,11 @@ /* Report a save- or restore-cwd failure in our openat replacement and then exit. - Copyright (C) 2005, 2006 Free Software Foundation, Inc. + Copyright (C) 2005, 2006, 2008-2009 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,11 +13,12 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ #include +#include "openat.h" + #include #include "error.h" @@ -25,12 +26,11 @@ #include "gettext.h" #define _(msgid) gettext (msgid) -#define N_(msgid) msgid void -openat_save_fail (int errno) +openat_save_fail (int errnum) { - error (exit_failure, errno, + error (exit_failure, errnum, _("unable to record current working directory")); /* The `noreturn' attribute cannot be applied to error, since it returns @@ -41,9 +41,9 @@ openat_save_fail (int errno) } void -openat_restore_fail (int errno) +openat_restore_fail (int errnum) { - error (exit_failure, errno, + error (exit_failure, errnum, _("failed to return to initial working directory")); /* As above. */ diff --git a/src/bin/coreutils/lib/openat-priv.h b/src/bin/coreutils/lib/openat-priv.h index 2d98821f55..9254f6bbad 100644 --- a/src/bin/coreutils/lib/openat-priv.h +++ b/src/bin/coreutils/lib/openat-priv.h @@ -2,10 +2,10 @@ Copyright (C) 2005, 2006 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* written by Jim Meyering */ diff --git a/src/bin/coreutils/lib/openat-proc.c b/src/bin/coreutils/lib/openat-proc.c index ff2fff0033..e84dc454fb 100644 --- a/src/bin/coreutils/lib/openat-proc.c +++ b/src/bin/coreutils/lib/openat-proc.c @@ -2,10 +2,10 @@ Copyright (C) 2006 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Paul Eggert. */ diff --git a/src/bin/coreutils/lib/openat.c b/src/bin/coreutils/lib/openat.c index cd496540e7..0c32672215 100644 --- a/src/bin/coreutils/lib/openat.c +++ b/src/bin/coreutils/lib/openat.c @@ -1,10 +1,10 @@ /* provide a replacement openat function - Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc. + Copyright (C) 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* written by Jim Meyering */ @@ -23,11 +22,10 @@ #include #include +#include #include "dirname.h" /* solely for definition of IS_ABSOLUTE_FILE_NAME */ #include "fcntl--.h" -#include "lchown.h" -#include "lstat.h" #include "openat-priv.h" #include "save-cwd.h" diff --git a/src/bin/coreutils/lib/openat.h b/src/bin/coreutils/lib/openat.h index f8333f0843..68c7df0b7d 100644 --- a/src/bin/coreutils/lib/openat.h +++ b/src/bin/coreutils/lib/openat.h @@ -1,10 +1,10 @@ /* provide a replacement openat function - Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc. + Copyright (C) 2004, 2005, 2006, 2008 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* written by Jim Meyering */ @@ -26,7 +25,7 @@ #include #ifndef __attribute__ -# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8) || __STRICT_ANSI__ +# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8) # define __attribute__(x) /* empty */ # endif #endif diff --git a/src/bin/coreutils/lib/pathmax.h b/src/bin/coreutils/lib/pathmax.h index 6941e457e3..c542c4ba91 100644 --- a/src/bin/coreutils/lib/pathmax.h +++ b/src/bin/coreutils/lib/pathmax.h @@ -1,9 +1,12 @@ +/* -*- buffer-read-only: t -*- vi: set ro: */ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 /* Define PATH_MAX somehow. Requires sys/types.h. - Copyright (C) 1992, 1999, 2001, 2003, 2005 Free Software Foundation, Inc. + Copyright (C) 1992, 1999, 2001, 2003, 2005, 2009 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) + the Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -26,7 +29,7 @@ # define _POSIX_PATH_MAX 256 # endif -# if !defined PATH_MAX && defined _PC_PATH_MAX +# if !defined PATH_MAX && defined _PC_PATH_MAX && defined HAVE_PATHCONF # define PATH_MAX (pathconf ("/", _PC_PATH_MAX) < 1 ? 1024 \ : pathconf ("/", _PC_PATH_MAX)) # endif diff --git a/src/bin/coreutils/lib/physmem.c b/src/bin/coreutils/lib/physmem.c index 207535bb07..e168717060 100644 --- a/src/bin/coreutils/lib/physmem.c +++ b/src/bin/coreutils/lib/physmem.c @@ -3,10 +3,10 @@ Copyright (C) 2000, 2001, 2003, 2005, 2006 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Paul Eggert. */ #undef DEBUG diff --git a/src/bin/coreutils/lib/physmem.h b/src/bin/coreutils/lib/physmem.h index 931aede2a3..95375d797a 100644 --- a/src/bin/coreutils/lib/physmem.h +++ b/src/bin/coreutils/lib/physmem.h @@ -2,10 +2,10 @@ Copyright (C) 2000, 2003 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Paul Eggert. */ diff --git a/src/bin/coreutils/lib/pipe-safer.c b/src/bin/coreutils/lib/pipe-safer.c index e4431b33a4..0fc685054b 100644 --- a/src/bin/coreutils/lib/pipe-safer.c +++ b/src/bin/coreutils/lib/pipe-safer.c @@ -1,10 +1,10 @@ /* Invoke pipe, but avoid some glitches. Copyright (C) 2005, 2006 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Jim Meyering. */ diff --git a/src/bin/coreutils/lib/posixtm.c b/src/bin/coreutils/lib/posixtm.c index 5514ba4fe2..4d044a30bf 100644 --- a/src/bin/coreutils/lib/posixtm.c +++ b/src/bin/coreutils/lib/posixtm.c @@ -3,10 +3,10 @@ Copyright (C) 1989, 1990, 1991, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Yacc-based version written by Jim Kingdon and David MacKenzie. Rewritten by Jim Meyering. */ @@ -42,8 +41,6 @@ of `digit' even when the host does not conform to POSIX. */ #define ISDIGIT(c) ((unsigned int) (c) - '0' <= 9) -time_t mktime (); - /* POSIX requires: @@ -187,15 +184,7 @@ posix_time_parse (struct tm *tm, const char *s, unsigned int syntax_bits) bool posixtime (time_t *p, const char *s, unsigned int syntax_bits) { - struct tm tm0 -#ifdef lint - /* Placate gcc-4's -Wuninitialized. - posix_time_parse fails to set all of tm0 only when it returns - nonzero (due to year() returning nonzero), and in that case, - this code doesn't use the tm0 at all. */ - = { 0, } -#endif - ; + struct tm tm0; struct tm tm1; struct tm const *tm; time_t t; diff --git a/src/bin/coreutils/lib/posixtm.h b/src/bin/coreutils/lib/posixtm.h index e91749d736..e42573e2d7 100644 --- a/src/bin/coreutils/lib/posixtm.h +++ b/src/bin/coreutils/lib/posixtm.h @@ -2,10 +2,10 @@ Copyright (C) 1998, 2003, 2005, 2007 Free Software Foundation Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Yacc-based version written by Jim Kingdon and David MacKenzie. Rewritten by Jim Meyering. */ diff --git a/src/bin/coreutils/lib/posixver.c b/src/bin/coreutils/lib/posixver.c index e7b4699783..73a6482566 100644 --- a/src/bin/coreutils/lib/posixver.c +++ b/src/bin/coreutils/lib/posixver.c @@ -3,19 +3,18 @@ Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ /* Written by Paul Eggert. */ diff --git a/src/bin/coreutils/lib/printf-args.c b/src/bin/coreutils/lib/printf-args.c index 2259d53e5e..15d3c56910 100644 --- a/src/bin/coreutils/lib/printf-args.c +++ b/src/bin/coreutils/lib/printf-args.c @@ -1,9 +1,12 @@ +/* -*- buffer-read-only: t -*- vi: set ro: */ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 /* Decomposed printf argument list. Copyright (C) 1999, 2002-2003, 2005-2007 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) + the Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -15,16 +18,25 @@ with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include +/* This file can be parametrized with the following macros: + ENABLE_UNISTDIO Set to 1 to enable the unistdio extensions. + PRINTF_FETCHARGS Name of the function to be defined. + STATIC Set to 'static' to declare the function static. */ + +#ifndef PRINTF_FETCHARGS +# include +#endif /* Specification. */ -#include "printf-args.h" +#ifndef PRINTF_FETCHARGS +# include "printf-args.h" +#endif #ifdef STATIC STATIC #endif int -printf_fetchargs (va_list args, arguments *a) +PRINTF_FETCHARGS (va_list args, arguments *a) { size_t i; argument *ap; @@ -67,11 +79,9 @@ printf_fetchargs (va_list args, arguments *a) case TYPE_DOUBLE: ap->a.a_double = va_arg (args, double); break; -#if HAVE_LONG_DOUBLE case TYPE_LONGDOUBLE: ap->a.a_longdouble = va_arg (args, long double); break; -#endif case TYPE_CHAR: ap->a.a_char = va_arg (args, int); break; @@ -132,6 +142,45 @@ printf_fetchargs (va_list args, arguments *a) case TYPE_COUNT_LONGLONGINT_POINTER: ap->a.a_count_longlongint_pointer = va_arg (args, long long int *); break; +#endif +#if ENABLE_UNISTDIO + /* The unistdio extensions. */ + case TYPE_U8_STRING: + ap->a.a_u8_string = va_arg (args, const uint8_t *); + /* A null pointer is an invalid argument for "%U", but in practice + it occurs quite frequently in printf statements that produce + debug output. Use a fallback in this case. */ + if (ap->a.a_u8_string == NULL) + { + static const uint8_t u8_null_string[] = + { '(', 'N', 'U', 'L', 'L', ')', 0 }; + ap->a.a_u8_string = u8_null_string; + } + break; + case TYPE_U16_STRING: + ap->a.a_u16_string = va_arg (args, const uint16_t *); + /* A null pointer is an invalid argument for "%lU", but in practice + it occurs quite frequently in printf statements that produce + debug output. Use a fallback in this case. */ + if (ap->a.a_u16_string == NULL) + { + static const uint16_t u16_null_string[] = + { '(', 'N', 'U', 'L', 'L', ')', 0 }; + ap->a.a_u16_string = u16_null_string; + } + break; + case TYPE_U32_STRING: + ap->a.a_u32_string = va_arg (args, const uint32_t *); + /* A null pointer is an invalid argument for "%llU", but in practice + it occurs quite frequently in printf statements that produce + debug output. Use a fallback in this case. */ + if (ap->a.a_u32_string == NULL) + { + static const uint32_t u32_null_string[] = + { '(', 'N', 'U', 'L', 'L', ')', 0 }; + ap->a.a_u32_string = u32_null_string; + } + break; #endif default: /* Unknown type. */ diff --git a/src/bin/coreutils/lib/printf-args.h b/src/bin/coreutils/lib/printf-args.h index 74a18d9bf3..1b0d869ae0 100644 --- a/src/bin/coreutils/lib/printf-args.h +++ b/src/bin/coreutils/lib/printf-args.h @@ -1,9 +1,12 @@ +/* -*- buffer-read-only: t -*- vi: set ro: */ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 /* Decomposed printf argument list. Copyright (C) 1999, 2002-2003, 2006-2007 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) + the Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -18,6 +21,16 @@ #ifndef _PRINTF_ARGS_H #define _PRINTF_ARGS_H +/* This file can be parametrized with the following macros: + ENABLE_UNISTDIO Set to 1 to enable the unistdio extensions. + PRINTF_FETCHARGS Name of the function to be declared. + STATIC Set to 'static' to declare the function static. */ + +/* Default parameters. */ +#ifndef PRINTF_FETCHARGS +# define PRINTF_FETCHARGS printf_fetchargs +#endif + /* Get size_t. */ #include @@ -52,9 +65,7 @@ typedef enum TYPE_ULONGLONGINT, #endif TYPE_DOUBLE, -#if HAVE_LONG_DOUBLE TYPE_LONGDOUBLE, -#endif TYPE_CHAR, #if HAVE_WINT_T TYPE_WIDE_CHAR, @@ -71,6 +82,12 @@ typedef enum #if HAVE_LONG_LONG_INT , TYPE_COUNT_LONGLONGINT_POINTER #endif +#if ENABLE_UNISTDIO + /* The unistdio extensions. */ +, TYPE_U8_STRING +, TYPE_U16_STRING +, TYPE_U32_STRING +#endif } arg_type; /* Polymorphic argument */ @@ -93,9 +110,7 @@ typedef struct #endif float a_float; double a_double; -#if HAVE_LONG_DOUBLE long double a_longdouble; -#endif int a_char; #if HAVE_WINT_T wint_t a_wide_char; @@ -111,6 +126,12 @@ typedef struct long int * a_count_longint_pointer; #if HAVE_LONG_LONG_INT long long int * a_count_longlongint_pointer; +#endif +#if ENABLE_UNISTDIO + /* The unistdio extensions. */ + const uint8_t * a_u8_string; + const uint16_t * a_u16_string; + const uint32_t * a_u32_string; #endif } a; @@ -131,6 +152,6 @@ STATIC #else extern #endif -int printf_fetchargs (va_list args, arguments *a); +int PRINTF_FETCHARGS (va_list args, arguments *a); #endif /* _PRINTF_ARGS_H */ diff --git a/src/bin/coreutils/lib/printf-frexp.c b/src/bin/coreutils/lib/printf-frexp.c new file mode 100644 index 0000000000..da5c9c3a45 --- /dev/null +++ b/src/bin/coreutils/lib/printf-frexp.c @@ -0,0 +1,188 @@ +/* Split a double into fraction and mantissa, for hexadecimal printf. + Copyright (C) 2007 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#include + +/* Specification. */ +#ifdef USE_LONG_DOUBLE +# include "printf-frexpl.h" +#else +# include "printf-frexp.h" +#endif + +#include +#include +#ifdef USE_LONG_DOUBLE +# include "fpucw.h" +#endif + +/* This file assumes FLT_RADIX = 2. If FLT_RADIX is a power of 2 greater + than 2, or not even a power of 2, some rounding errors can occur, so that + then the returned mantissa is only guaranteed to be <= 2.0, not < 2.0. */ + +#ifdef USE_LONG_DOUBLE +# define FUNC printf_frexpl +# define DOUBLE long double +# define MIN_EXP LDBL_MIN_EXP +# if HAVE_FREXPL_IN_LIBC && HAVE_LDEXPL_IN_LIBC +# define USE_FREXP_LDEXP +# define FREXP frexpl +# define LDEXP ldexpl +# endif +# define DECL_ROUNDING DECL_LONG_DOUBLE_ROUNDING +# define BEGIN_ROUNDING() BEGIN_LONG_DOUBLE_ROUNDING () +# define END_ROUNDING() END_LONG_DOUBLE_ROUNDING () +# define L_(literal) literal##L +#else +# define FUNC printf_frexp +# define DOUBLE double +# define MIN_EXP DBL_MIN_EXP +# if HAVE_FREXP_IN_LIBC && HAVE_LDEXP_IN_LIBC +# define USE_FREXP_LDEXP +# define FREXP frexp +# define LDEXP ldexp +# endif +# define DECL_ROUNDING +# define BEGIN_ROUNDING() +# define END_ROUNDING() +# define L_(literal) literal +#endif + +DOUBLE +FUNC (DOUBLE x, int *expptr) +{ + int exponent; + DECL_ROUNDING + + BEGIN_ROUNDING (); + +#ifdef USE_FREXP_LDEXP + /* frexp and ldexp are usually faster than the loop below. */ + x = FREXP (x, &exponent); + + x = x + x; + exponent -= 1; + + if (exponent < MIN_EXP - 1) + { + x = LDEXP (x, exponent - (MIN_EXP - 1)); + exponent = MIN_EXP - 1; + } +#else + { + /* Since the exponent is an 'int', it fits in 64 bits. Therefore the + loops are executed no more than 64 times. */ + DOUBLE pow2[64]; /* pow2[i] = 2^2^i */ + DOUBLE powh[64]; /* powh[i] = 2^-2^i */ + int i; + + exponent = 0; + if (x >= L_(1.0)) + { + /* A nonnegative exponent. */ + { + DOUBLE pow2_i; /* = pow2[i] */ + DOUBLE powh_i; /* = powh[i] */ + + /* Invariants: pow2_i = 2^2^i, powh_i = 2^-2^i, + x * 2^exponent = argument, x >= 1.0. */ + for (i = 0, pow2_i = L_(2.0), powh_i = L_(0.5); + ; + i++, pow2_i = pow2_i * pow2_i, powh_i = powh_i * powh_i) + { + if (x >= pow2_i) + { + exponent += (1 << i); + x *= powh_i; + } + else + break; + + pow2[i] = pow2_i; + powh[i] = powh_i; + } + } + /* Here 1.0 <= x < 2^2^i. */ + } + else + { + /* A negative exponent. */ + { + DOUBLE pow2_i; /* = pow2[i] */ + DOUBLE powh_i; /* = powh[i] */ + + /* Invariants: pow2_i = 2^2^i, powh_i = 2^-2^i, + x * 2^exponent = argument, x < 1.0, exponent >= MIN_EXP - 1. */ + for (i = 0, pow2_i = L_(2.0), powh_i = L_(0.5); + ; + i++, pow2_i = pow2_i * pow2_i, powh_i = powh_i * powh_i) + { + if (exponent - (1 << i) < MIN_EXP - 1) + break; + + exponent -= (1 << i); + x *= pow2_i; + if (x >= L_(1.0)) + break; + + pow2[i] = pow2_i; + powh[i] = powh_i; + } + } + /* Here either x < 1.0 and exponent - 2^i < MIN_EXP - 1 <= exponent, + or 1.0 <= x < 2^2^i and exponent >= MIN_EXP - 1. */ + + if (x < L_(1.0)) + /* Invariants: x * 2^exponent = argument, x < 1.0 and + exponent - 2^i < MIN_EXP - 1 <= exponent. */ + while (i > 0) + { + i--; + if (exponent - (1 << i) >= MIN_EXP - 1) + { + exponent -= (1 << i); + x *= pow2[i]; + if (x >= L_(1.0)) + break; + } + } + + /* Here either x < 1.0 and exponent = MIN_EXP - 1, + or 1.0 <= x < 2^2^i and exponent >= MIN_EXP - 1. */ + } + + /* Invariants: x * 2^exponent = argument, and + either x < 1.0 and exponent = MIN_EXP - 1, + or 1.0 <= x < 2^2^i and exponent >= MIN_EXP - 1. */ + while (i > 0) + { + i--; + if (x >= pow2[i]) + { + exponent += (1 << i); + x *= powh[i]; + } + } + /* Here either x < 1.0 and exponent = MIN_EXP - 1, + or 1.0 <= x < 2.0 and exponent >= MIN_EXP - 1. */ + } +#endif + + END_ROUNDING (); + + *expptr = exponent; + return x; +} diff --git a/src/bin/coreutils/lib/printf-frexp.h b/src/bin/coreutils/lib/printf-frexp.h new file mode 100644 index 0000000000..46c32765dd --- /dev/null +++ b/src/bin/coreutils/lib/printf-frexp.h @@ -0,0 +1,23 @@ +/* Split a double into fraction and mantissa, for hexadecimal printf. + Copyright (C) 2007 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* Write a finite, positive number x as + x = mantissa * 2^exp + where exp >= DBL_MIN_EXP - 1, + mantissa < 2.0, + if x is not a denormalized number then mantissa >= 1.0. + Store exp in *EXPPTR and return mantissa. */ +extern double printf_frexp (double x, int *expptr); diff --git a/src/bin/coreutils/lib/printf-frexpl.c b/src/bin/coreutils/lib/printf-frexpl.c new file mode 100644 index 0000000000..460b609b40 --- /dev/null +++ b/src/bin/coreutils/lib/printf-frexpl.c @@ -0,0 +1,18 @@ +/* Split a 'long double' into fraction and mantissa, for hexadecimal printf. + Copyright (C) 2007 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#define USE_LONG_DOUBLE +#include "printf-frexp.c" diff --git a/src/bin/coreutils/lib/printf-frexpl.h b/src/bin/coreutils/lib/printf-frexpl.h new file mode 100644 index 0000000000..6c2d214b6d --- /dev/null +++ b/src/bin/coreutils/lib/printf-frexpl.h @@ -0,0 +1,23 @@ +/* Split a 'long double' into fraction and mantissa, for hexadecimal printf. + Copyright (C) 2007 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* Write a finite, positive number x as + x = mantissa * 2^exp + where exp >= LDBL_MIN_EXP - 1, + mantissa < 2.0, + if x is not a denormalized number then mantissa >= 1.0. + Store exp in *EXPPTR and return mantissa. */ +extern long double printf_frexpl (long double x, int *expptr); diff --git a/src/bin/coreutils/lib/printf-parse.c b/src/bin/coreutils/lib/printf-parse.c index 9493403ebb..04d21c04c8 100644 --- a/src/bin/coreutils/lib/printf-parse.c +++ b/src/bin/coreutils/lib/printf-parse.c @@ -1,12 +1,12 @@ +/* -*- buffer-read-only: t -*- vi: set ro: */ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 /* Formatted output to strings. - This file is intended to provide exactly the same functionality - as the version in gnulib, but without the need for the xsize module. - - Copyright (C) 1999-2000, 2002-2003, 2006-2007 Free Software Foundation, Inc. + Copyright (C) 1999-2000, 2002-2003, 2006-2008 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) + the Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -18,34 +18,63 @@ with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include +/* This file can be parametrized with the following macros: + CHAR_T The element type of the format string. + CHAR_T_ONLY_ASCII Set to 1 to enable verification that all characters + in the format string are ASCII. + DIRECTIVE Structure denoting a format directive. + Depends on CHAR_T. + DIRECTIVES Structure denoting the set of format directives of a + format string. Depends on CHAR_T. + PRINTF_PARSE Function that parses a format string. + Depends on CHAR_T. + STATIC Set to 'static' to declare the function static. + ENABLE_UNISTDIO Set to 1 to enable the unistdio extensions. */ + +#ifndef PRINTF_PARSE +# include +#endif /* Specification. */ -#if WIDE_CHAR_VERSION -# include "wprintf-parse.h" -#else +#ifndef PRINTF_PARSE # include "printf-parse.h" #endif +/* Default parameters. */ +#ifndef PRINTF_PARSE +# define PRINTF_PARSE printf_parse +# define CHAR_T char +# define DIRECTIVE char_directive +# define DIRECTIVES char_directives +#endif + /* Get size_t, NULL. */ #include -/* Get intmax_t, SIZE_MAX. */ -#include +/* Get intmax_t. */ +#if defined IN_LIBINTL || defined IN_LIBASPRINTF +# if HAVE_STDINT_H_WITH_UINTMAX +# include +# endif +# if HAVE_INTTYPES_H_WITH_UINTMAX +# include +# endif +#else +# include +#endif /* malloc(), realloc(), free(). */ #include -#if WIDE_CHAR_VERSION -# define PRINTF_PARSE wprintf_parse -# define CHAR_T wchar_t -# define DIRECTIVE wchar_t_directive -# define DIRECTIVES wchar_t_directives -#else -# define PRINTF_PARSE printf_parse -# define CHAR_T char -# define DIRECTIVE char_directive -# define DIRECTIVES char_directives +/* errno. */ +#include + +/* Checked size_t computations. */ +#include "xsize.h" + +#if CHAR_T_ONLY_ASCII +/* c_isascii(). */ +# include "c-ctype.h" #endif #ifdef STATIC @@ -63,10 +92,10 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a) d->count = 0; d_allocated = 1; - d->dir = malloc (d_allocated * sizeof (DIRECTIVE)); + d->dir = (DIRECTIVE *) malloc (d_allocated * sizeof (DIRECTIVE)); if (d->dir == NULL) /* Out of memory. */ - return -1; + goto out_of_memory_1; a->count = 0; a_allocated = 0; @@ -80,19 +109,19 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a) size_t memory_size; \ argument *memory; \ \ - a_allocated *= 2; \ + a_allocated = xtimes (a_allocated, 2); \ if (a_allocated <= n) \ - a_allocated = n + 1; \ - if (SIZE_MAX / sizeof (argument) < a_allocated) \ + a_allocated = xsum (n, 1); \ + memory_size = xtimes (a_allocated, sizeof (argument)); \ + if (size_overflow_p (memory_size)) \ /* Overflow, would lead to out of memory. */ \ - goto error; \ - memory_size = a_allocated * sizeof (argument); \ - memory = (a->arg \ - ? realloc (a->arg, memory_size) \ - : malloc (memory_size)); \ + goto out_of_memory; \ + memory = (argument *) (a->arg \ + ? realloc (a->arg, memory_size) \ + : malloc (memory_size)); \ if (memory == NULL) \ /* Out of memory. */ \ - goto error; \ + goto out_of_memory; \ a->arg = memory; \ } \ while (a->count <= n) \ @@ -110,7 +139,7 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a) if (c == '%') { size_t arg_index = ARG_NONE; - DIRECTIVE *dp = &d->dir[d->count];/* pointer to next directive */ + DIRECTIVE *dp = &d->dir[d->count]; /* pointer to next directive */ /* Initialize the next directive. */ dp->dir_start = cp - 1; @@ -135,14 +164,13 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a) size_t n = 0; for (np = cp; *np >= '0' && *np <= '9'; np++) - if (n < SIZE_MAX / 10) - n = 10 * n + (*np - '0'); - else - /* n too large for memory. */ - goto error; + n = xsum (xtimes (n, 10), *np - '0'); if (n == 0) /* Positional argument 0. */ goto error; + if (size_overflow_p (n)) + /* n too large, would lead to out of memory later. */ + goto error; arg_index = n - 1; cp = np + 1; } @@ -206,14 +234,13 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a) size_t n = 0; for (np = cp; *np >= '0' && *np <= '9'; np++) - if (n < SIZE_MAX / 10) - n = 10 * n + (*np - '0'); - else - /* n too large for memory. */ - goto error; + n = xsum (xtimes (n, 10), *np - '0'); if (n == 0) /* Positional argument 0. */ goto error; + if (size_overflow_p (n)) + /* n too large, would lead to out of memory later. */ + goto error; dp->width_arg_index = n - 1; cp = np + 1; } @@ -264,14 +291,14 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a) size_t n = 0; for (np = cp; *np >= '0' && *np <= '9'; np++) - if (n < SIZE_MAX / 10) - n = 10 * n + (*np - '0'); - else - /* n too large for memory. */ - goto error; + n = xsum (xtimes (n, 10), *np - '0'); if (n == 0) /* Positional argument 0. */ goto error; + if (size_overflow_p (n)) + /* n too large, would lead to out of memory + later. */ + goto error; dp->precision_arg_index = n - 1; cp = np + 1; } @@ -323,7 +350,6 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a) flags += 8; cp++; } -#if HAVE_INTMAX_T else if (*cp == 'j') { if (sizeof (intmax_t) > sizeof (long)) @@ -338,7 +364,6 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a) } cp++; } -#endif else if (*cp == 'z' || *cp == 'Z') { /* 'z' is standardized in ISO C 99, but glibc uses 'Z' @@ -370,6 +395,44 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a) } cp++; } +#if defined __APPLE__ && defined __MACH__ + /* On MacOS X 10.3, PRIdMAX is defined as "qd". + We cannot change it to "lld" because PRIdMAX must also + be understood by the system's printf routines. */ + else if (*cp == 'q') + { + if (64 / 8 > sizeof (long)) + { + /* int64_t = long long */ + flags += 16; + } + else + { + /* int64_t = long */ + flags += 8; + } + cp++; + } +#endif +#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ + /* On native Win32, PRIdMAX is defined as "I64d". + We cannot change it to "lld" because PRIdMAX must also + be understood by the system's printf routines. */ + else if (*cp == 'I' && cp[1] == '6' && cp[2] == '4') + { + if (64 / 8 > sizeof (long)) + { + /* __int64 = long long */ + flags += 16; + } + else + { + /* __int64 = long */ + flags += 8; + } + cp += 3; + } +#endif else break; } @@ -416,12 +479,10 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a) break; case 'f': case 'F': case 'e': case 'E': case 'g': case 'G': case 'a': case 'A': -#if HAVE_LONG_DOUBLE if (flags >= 16 || (flags & 4)) type = TYPE_LONGDOUBLE; else -#endif - type = TYPE_DOUBLE; + type = TYPE_DOUBLE; break; case 'c': if (flags >= 8) @@ -476,6 +537,17 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a) else type = TYPE_COUNT_INT_POINTER; break; +#if ENABLE_UNISTDIO + /* The unistdio extensions. */ + case 'U': + if (flags >= 16) + type = TYPE_U32_STRING; + else if (flags >= 8) + type = TYPE_U16_STRING; + else + type = TYPE_U8_STRING; + break; +#endif case '%': type = TYPE_NONE; break; @@ -504,19 +576,28 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a) d->count++; if (d->count >= d_allocated) { + size_t memory_size; DIRECTIVE *memory; - if (SIZE_MAX / (2 * sizeof (DIRECTIVE)) < d_allocated) + d_allocated = xtimes (d_allocated, 2); + memory_size = xtimes (d_allocated, sizeof (DIRECTIVE)); + if (size_overflow_p (memory_size)) /* Overflow, would lead to out of memory. */ - goto error; - d_allocated *= 2; - memory = realloc (d->dir, d_allocated * sizeof (DIRECTIVE)); + goto out_of_memory; + memory = (DIRECTIVE *) realloc (d->dir, memory_size); if (memory == NULL) /* Out of memory. */ - goto error; + goto out_of_memory; d->dir = memory; } } +#if CHAR_T_ONLY_ASCII + else if (!c_isascii (c)) + { + /* Non-ASCII character. Not supported. */ + goto error; + } +#endif } d->dir[d->count].dir_start = cp; @@ -529,10 +610,21 @@ error: free (a->arg); if (d->dir) free (d->dir); + errno = EINVAL; + return -1; + +out_of_memory: + if (a->arg) + free (a->arg); + if (d->dir) + free (d->dir); +out_of_memory_1: + errno = ENOMEM; return -1; } +#undef PRINTF_PARSE #undef DIRECTIVES #undef DIRECTIVE +#undef CHAR_T_ONLY_ASCII #undef CHAR_T -#undef PRINTF_PARSE diff --git a/src/bin/coreutils/lib/printf-parse.h b/src/bin/coreutils/lib/printf-parse.h index 82a0d37cd7..82b189ca2c 100644 --- a/src/bin/coreutils/lib/printf-parse.h +++ b/src/bin/coreutils/lib/printf-parse.h @@ -1,9 +1,12 @@ +/* -*- buffer-read-only: t -*- vi: set ro: */ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 /* Parse printf format string. - Copyright (C) 1999, 2002-2003 Free Software Foundation, Inc. + Copyright (C) 1999, 2002-2003, 2005, 2007 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) + the Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -18,6 +21,10 @@ #ifndef _PRINTF_PARSE_H #define _PRINTF_PARSE_H +/* This file can be parametrized with the following macros: + ENABLE_UNISTDIO Set to 1 to enable the unistdio extensions. + STATIC Set to 'static' to declare the function static. */ + #include "printf-args.h" @@ -32,6 +39,9 @@ /* arg_index value indicating that no argument is consumed. */ #define ARG_NONE (~(size_t)0) +/* xxx_directive: A parsed directive. + xxx_directives: A parsed format string. */ + /* A parsed directive. */ typedef struct { @@ -44,7 +54,7 @@ typedef struct const char* precision_start; const char* precision_end; size_t precision_arg_index; - char conversion; /* d i o u x X f e E g G c s p n U % but not C S */ + char conversion; /* d i o u x X f F e E g G a A c s p n U % but not C S */ size_t arg_index; } char_directive; @@ -59,16 +69,114 @@ typedef struct } char_directives; +#if ENABLE_UNISTDIO + +/* A parsed directive. */ +typedef struct +{ + const uint8_t* dir_start; + const uint8_t* dir_end; + int flags; + const uint8_t* width_start; + const uint8_t* width_end; + size_t width_arg_index; + const uint8_t* precision_start; + const uint8_t* precision_end; + size_t precision_arg_index; + uint8_t conversion; /* d i o u x X f F e E g G a A c s p n U % but not C S */ + size_t arg_index; +} +u8_directive; + +/* A parsed format string. */ +typedef struct +{ + size_t count; + u8_directive *dir; + size_t max_width_length; + size_t max_precision_length; +} +u8_directives; + +/* A parsed directive. */ +typedef struct +{ + const uint16_t* dir_start; + const uint16_t* dir_end; + int flags; + const uint16_t* width_start; + const uint16_t* width_end; + size_t width_arg_index; + const uint16_t* precision_start; + const uint16_t* precision_end; + size_t precision_arg_index; + uint16_t conversion; /* d i o u x X f F e E g G a A c s p n U % but not C S */ + size_t arg_index; +} +u16_directive; + +/* A parsed format string. */ +typedef struct +{ + size_t count; + u16_directive *dir; + size_t max_width_length; + size_t max_precision_length; +} +u16_directives; + +/* A parsed directive. */ +typedef struct +{ + const uint32_t* dir_start; + const uint32_t* dir_end; + int flags; + const uint32_t* width_start; + const uint32_t* width_end; + size_t width_arg_index; + const uint32_t* precision_start; + const uint32_t* precision_end; + size_t precision_arg_index; + uint32_t conversion; /* d i o u x X f F e E g G a A c s p n U % but not C S */ + size_t arg_index; +} +u32_directive; + +/* A parsed format string. */ +typedef struct +{ + size_t count; + u32_directive *dir; + size_t max_width_length; + size_t max_precision_length; +} +u32_directives; + +#endif + /* Parses the format string. Fills in the number N of directives, and fills in directives[0], ..., directives[N-1], and sets directives[N].dir_start to the end of the format string. Also fills in the arg_type fields of the arguments and the needed count of arguments. */ -#ifdef STATIC -STATIC +#if ENABLE_UNISTDIO +extern int + ulc_printf_parse (const char *format, char_directives *d, arguments *a); +extern int + u8_printf_parse (const uint8_t *format, u8_directives *d, arguments *a); +extern int + u16_printf_parse (const uint16_t *format, u16_directives *d, + arguments *a); +extern int + u32_printf_parse (const uint32_t *format, u32_directives *d, + arguments *a); #else +# ifdef STATIC +STATIC +# else extern -#endif +# endif int printf_parse (const char *format, char_directives *d, arguments *a); +#endif #endif /* _PRINTF_PARSE_H */ diff --git a/src/bin/coreutils/lib/priv-set.c b/src/bin/coreutils/lib/priv-set.c new file mode 100644 index 0000000000..0051ce6708 --- /dev/null +++ b/src/bin/coreutils/lib/priv-set.c @@ -0,0 +1,143 @@ +/* Query, remove, or restore a Solaris privilege. + + Copyright (C) 2009 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + + Written by David Bartley. */ + +#include +#include "priv-set.h" + +#if HAVE_GETPPRIV + +# include +# include +# include + +/* Holds a (cached) copy of the effective set. */ +static priv_set_t *eff_set; + +/* Holds a set of privileges that we have removed. */ +static priv_set_t *rem_set; + +static bool initialized; + +static int +priv_set_initialize (void) +{ + if (! initialized) + { + eff_set = priv_allocset (); + if (!eff_set) + { + return -1; + } + rem_set = priv_allocset (); + if (!rem_set) + { + priv_freeset (eff_set); + return -1; + } + if (getppriv (PRIV_EFFECTIVE, eff_set) != 0) + { + priv_freeset (eff_set); + priv_freeset (rem_set); + return -1; + } + priv_emptyset (rem_set); + initialized = true; + } + + return 0; +} + + +/* Check if priv is in the effective set. + Returns 1 if priv is a member and 0 if not. + Returns -1 on error with errno set appropriately. */ +int +priv_set_ismember (const char *priv) +{ + if (! initialized && priv_set_initialize () != 0) + return -1; + + return priv_ismember (eff_set, priv); +} + + +/* Try to remove priv from the effective set. + Returns 0 if priv was removed from or was not present in the effective set. + Returns -1 on error with errno set appropriately. */ +int +priv_set_remove (const char *priv) +{ + if (! initialized && priv_set_initialize () != 0) + return -1; + + if (priv_ismember (eff_set, priv)) + { + /* priv_addset/priv_delset can only fail if priv is invalid, which is + checked above by the priv_ismember call. */ + priv_delset (eff_set, priv); + if (setppriv (PRIV_SET, PRIV_EFFECTIVE, eff_set) != 0) + { + priv_addset (eff_set, priv); + return -1; + } + priv_addset (rem_set, priv); + } + else + { + errno = EINVAL; + return -1; + } + + return 0; +} + + +/* Try to restore priv to the effective set. + Returns 0 if priv was re-added to the effective set (after being prviously + removed by a call to priv_set_remove) or if priv was already in the + effective set. + Returns -1 on error with errno set appropriately. */ +int +priv_set_restore (const char *priv) +{ + if (! initialized && priv_set_initialize () != 0) + return -1; + + if (priv_ismember (rem_set, priv)) + { + /* priv_addset/priv_delset can only fail if priv is invalid, which is + checked above by the priv_ismember call. */ + priv_addset (eff_set, priv); + if (setppriv (PRIV_SET, PRIV_EFFECTIVE, eff_set) != 0) + { + priv_delset (eff_set, priv); + return -1; + } + priv_delset (rem_set, priv); + } + else + { + errno = EINVAL; + return -1; + } + + return 0; +} + +#endif diff --git a/src/bin/coreutils/lib/priv-set.h b/src/bin/coreutils/lib/priv-set.h new file mode 100644 index 0000000000..c461c42723 --- /dev/null +++ b/src/bin/coreutils/lib/priv-set.h @@ -0,0 +1,50 @@ +/* Query, remove, or restore a Solaris privilege. + + Copyright (C) 2009 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + + Written by David Bartley. */ + +#if HAVE_GETPPRIV + +# include + +int priv_set_ismember (const char *priv); +int priv_set_remove (const char *priv); +int priv_set_restore (const char *priv); + +static inline int priv_set_remove_linkdir (void) +{ + return priv_set_remove (PRIV_SYS_LINKDIR); +} + +static inline int priv_set_restore_linkdir (void) +{ + return priv_set_restore (PRIV_SYS_LINKDIR); +} + +#else + +static inline int priv_set_remove_linkdir (void) +{ + return -1; +} + +static inline int priv_set_restore_linkdir (void) +{ + return -1; +} + +#endif diff --git a/src/bin/coreutils/lib/progname.c b/src/bin/coreutils/lib/progname.c new file mode 100644 index 0000000000..9854b5e7cc --- /dev/null +++ b/src/bin/coreutils/lib/progname.c @@ -0,0 +1,63 @@ +/* Program name management. + Copyright (C) 2001-2003, 2005-2009 Free Software Foundation, Inc. + Written by Bruno Haible , 2001. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + + +#include + +/* Specification. */ +#undef ENABLE_RELOCATABLE /* avoid defining set_program_name as a macro */ +#include "progname.h" + +#include + + +/* String containing name the program is called with. + To be initialized by main(). */ +const char *program_name = NULL; + +/* Set program_name, based on argv[0]. */ +void +set_program_name (const char *argv0) +{ + /* libtool creates a temporary executable whose name is sometimes prefixed + with "lt-" (depends on the platform). It also makes argv[0] absolute. + But the name of the temporary executable is a detail that should not be + visible to the end user and to the test suite. + Remove this "/.libs/" or "/.libs/lt-" prefix here. */ + const char *slash; + const char *base; + + slash = strrchr (argv0, '/'); + base = (slash != NULL ? slash + 1 : argv0); + if (base - argv0 >= 7 && strncmp (base - 7, "/.libs/", 7) == 0) + { + argv0 = base; + if (strncmp (base, "lt-", 3) == 0) + argv0 = base + 3; + } + + /* But don't strip off a leading / in general, because when the user + runs + /some/hidden/place/bin/cp foo foo + he should get the error message + /some/hidden/place/bin/cp: `foo' and `foo' are the same file + not + cp: `foo' and `foo' are the same file + */ + + program_name = argv0; +} diff --git a/src/bin/coreutils/lib/progname.h b/src/bin/coreutils/lib/progname.h new file mode 100644 index 0000000000..82615c6bc0 --- /dev/null +++ b/src/bin/coreutils/lib/progname.h @@ -0,0 +1,60 @@ +/* Program name management. + Copyright (C) 2001-2004, 2006 Free Software Foundation, Inc. + Written by Bruno Haible , 2001. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#ifndef _PROGNAME_H +#define _PROGNAME_H + +/* Programs using this file should do the following in main(): + set_program_name (argv[0]); + */ + + +#ifdef __cplusplus +extern "C" { +#endif + + +/* String containing name the program is called with. */ +extern const char *program_name; + +/* Set program_name, based on argv[0]. */ +extern void set_program_name (const char *argv0); + +#if ENABLE_RELOCATABLE + +/* Set program_name, based on argv[0], and original installation prefix and + directory, for relocatability. */ +extern void set_program_name_and_installdir (const char *argv0, + const char *orig_installprefix, + const char *orig_installdir); +#undef set_program_name +#define set_program_name(ARG0) \ + set_program_name_and_installdir (ARG0, INSTALLPREFIX, INSTALLDIR) + +/* Return the full pathname of the current executable, based on the earlier + call to set_program_name_and_installdir. Return NULL if unknown. */ +extern char *get_full_program_name (void); + +#endif + + +#ifdef __cplusplus +} +#endif + + +#endif /* _PROGNAME_H */ diff --git a/src/bin/coreutils/lib/propername.c b/src/bin/coreutils/lib/propername.c new file mode 100644 index 0000000000..381a7a72cb --- /dev/null +++ b/src/bin/coreutils/lib/propername.c @@ -0,0 +1,311 @@ +/* Localization of proper names. + Copyright (C) 2006-2009 Free Software Foundation, Inc. + Written by Bruno Haible , 2006. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#include + +/* Specification. */ +#include "propername.h" + +#include +#include +#include +#include +#include +#if HAVE_ICONV +# include +#endif + +#include "trim.h" +#include "mbchar.h" +#include "mbuiter.h" +#include "localcharset.h" +#include "c-strcase.h" +#include "xstriconv.h" +#include "xalloc.h" +#include "gettext.h" + + +/* Tests whether STRING contains trim (SUB), starting and ending at word + boundaries. + Here, instead of implementing Unicode Standard Annex #29 for determining + word boundaries, we assume that trim (SUB) starts and ends with words and + only test whether the part before it ends with a non-word and the part + after it starts with a non-word. */ +static bool +mbsstr_trimmed_wordbounded (const char *string, const char *sub) +{ + char *tsub = trim (sub); + bool found = false; + + for (; *string != '\0';) + { + const char *tsub_in_string = mbsstr (string, tsub); + if (tsub_in_string == NULL) + break; + else + { + if (MB_CUR_MAX > 1) + { + mbui_iterator_t string_iter; + bool word_boundary_before; + bool word_boundary_after; + + mbui_init (string_iter, string); + word_boundary_before = true; + if (mbui_cur_ptr (string_iter) < tsub_in_string) + { + mbchar_t last_char_before_tsub; + do + { + if (!mbui_avail (string_iter)) + abort (); + last_char_before_tsub = mbui_cur (string_iter); + mbui_advance (string_iter); + } + while (mbui_cur_ptr (string_iter) < tsub_in_string); + if (mb_isalnum (last_char_before_tsub)) + word_boundary_before = false; + } + + mbui_init (string_iter, tsub_in_string); + { + mbui_iterator_t tsub_iter; + + for (mbui_init (tsub_iter, tsub); + mbui_avail (tsub_iter); + mbui_advance (tsub_iter)) + { + if (!mbui_avail (string_iter)) + abort (); + mbui_advance (string_iter); + } + } + word_boundary_after = true; + if (mbui_avail (string_iter)) + { + mbchar_t first_char_after_tsub = mbui_cur (string_iter); + if (mb_isalnum (first_char_after_tsub)) + word_boundary_after = false; + } + + if (word_boundary_before && word_boundary_after) + { + found = true; + break; + } + + mbui_init (string_iter, tsub_in_string); + if (!mbui_avail (string_iter)) + break; + string = tsub_in_string + mb_len (mbui_cur (string_iter)); + } + else + { + bool word_boundary_before; + const char *p; + bool word_boundary_after; + + word_boundary_before = true; + if (string < tsub_in_string) + if (isalnum ((unsigned char) tsub_in_string[-1])) + word_boundary_before = false; + + p = tsub_in_string + strlen (tsub); + word_boundary_after = true; + if (*p != '\0') + if (isalnum ((unsigned char) *p)) + word_boundary_after = false; + + if (word_boundary_before && word_boundary_after) + { + found = true; + break; + } + + if (*tsub_in_string == '\0') + break; + string = tsub_in_string + 1; + } + } + } + free (tsub); + return found; +} + +/* Return the localization of NAME. NAME is written in ASCII. */ + +const char * +proper_name (const char *name) +{ + /* See whether there is a translation. */ + const char *translation = gettext (name); + + if (translation != name) + { + /* See whether the translation contains the original name. */ + if (mbsstr_trimmed_wordbounded (translation, name)) + return translation; + else + { + /* Return "TRANSLATION (NAME)". */ + char *result = + XNMALLOC (strlen (translation) + 2 + strlen (name) + 1 + 1, char); + + sprintf (result, "%s (%s)", translation, name); + return result; + } + } + else + return name; +} + +/* Return the localization of a name whose original writing is not ASCII. + NAME_UTF8 is the real name, written in UTF-8 with octal or hexadecimal + escape sequences. NAME_ASCII is a fallback written only with ASCII + characters. */ + +const char * +proper_name_utf8 (const char *name_ascii, const char *name_utf8) +{ + /* See whether there is a translation. */ + const char *translation = gettext (name_ascii); + + /* Try to convert NAME_UTF8 to the locale encoding. */ + const char *locale_code = locale_charset (); + char *alloc_name_converted = NULL; + char *alloc_name_converted_translit = NULL; + const char *name_converted = NULL; + const char *name_converted_translit = NULL; + const char *name; + + if (c_strcasecmp (locale_code, "UTF-8") != 0) + { +#if HAVE_ICONV + name_converted = alloc_name_converted = + xstr_iconv (name_utf8, "UTF-8", locale_code); + +# if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2) || __GLIBC__ > 2 \ + || _LIBICONV_VERSION >= 0x0105 + { + char *converted_translit; + + size_t len = strlen (locale_code); + char *locale_code_translit = XNMALLOC (len + 10 + 1, char); + memcpy (locale_code_translit, locale_code, len); + memcpy (locale_code_translit + len, "//TRANSLIT", 10 + 1); + + converted_translit = + xstr_iconv (name_utf8, "UTF-8", locale_code_translit); + + free (locale_code_translit); + + if (converted_translit != NULL) + { +# if !_LIBICONV_VERSION + /* Don't use the transliteration if it added question marks. + glibc's transliteration falls back to question marks; libiconv's + transliteration does not. + mbschr is equivalent to strchr in this case. */ + if (strchr (converted_translit, '?') != NULL) + free (converted_translit); + else +# endif + name_converted_translit = alloc_name_converted_translit = + converted_translit; + } + } +# endif +#endif + } + else + { + name_converted = name_utf8; + name_converted_translit = name_utf8; + } + + /* The name in locale encoding. */ + name = (name_converted != NULL ? name_converted : + name_converted_translit != NULL ? name_converted_translit : + name_ascii); + + /* See whether we have a translation. Some translators have not understood + that they should use the UTF-8 form of the name, if possible. So if the + translator provided a no-op translation, we ignore it. */ + if (strcmp (translation, name_ascii) != 0) + { + /* See whether the translation contains the original name. */ + if (mbsstr_trimmed_wordbounded (translation, name_ascii) + || (name_converted != NULL + && mbsstr_trimmed_wordbounded (translation, name_converted)) + || (name_converted_translit != NULL + && mbsstr_trimmed_wordbounded (translation, name_converted_translit))) + { + if (alloc_name_converted != NULL) + free (alloc_name_converted); + if (alloc_name_converted_translit != NULL) + free (alloc_name_converted_translit); + return translation; + } + else + { + /* Return "TRANSLATION (NAME)". */ + char *result = + XNMALLOC (strlen (translation) + 2 + strlen (name) + 1 + 1, char); + + sprintf (result, "%s (%s)", translation, name); + + if (alloc_name_converted != NULL) + free (alloc_name_converted); + if (alloc_name_converted_translit != NULL) + free (alloc_name_converted_translit); + return result; + } + } + else + { + if (alloc_name_converted != NULL && alloc_name_converted != name) + free (alloc_name_converted); + if (alloc_name_converted_translit != NULL + && alloc_name_converted_translit != name) + free (alloc_name_converted_translit); + return name; + } +} + +#ifdef TEST1 +# include +int +main (int argc, char *argv[]) +{ + setlocale (LC_ALL, ""); + if (mbsstr_trimmed_wordbounded (argv[1], argv[2])) + printf("found\n"); + return 0; +} +#endif + +#ifdef TEST2 +# include +# include +int +main (int argc, char *argv[]) +{ + setlocale (LC_ALL, ""); + printf ("%s\n", proper_name_utf8 ("Franc,ois Pinard", "Fran\303\247ois Pinard")); + return 0; +} +#endif diff --git a/src/bin/coreutils/lib/propername.h b/src/bin/coreutils/lib/propername.h new file mode 100644 index 0000000000..d603b1ae08 --- /dev/null +++ b/src/bin/coreutils/lib/propername.h @@ -0,0 +1,106 @@ +/* Localization of proper names. + Copyright (C) 2006, 2008 Free Software Foundation, Inc. + Written by Bruno Haible , 2006. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* INTRODUCTION + + What do + + Torbjörn Granlund (coreutils) + François Pinard (coreutils) + Danilo Å egan (gettext) + + have in common? + + A non-ASCII name. This causes trouble in the --version output. The simple + "solution", unfortunately mutilates the name. + + $ du --version| grep Granlund + Écrit par Torbjorn Granlund, David MacKenzie, Paul Eggert et Jim Meyering. + + $ ptx --version| grep Pinard + Écrit par F. Pinard. + + What is desirable, is to print the full name if the output character set + allows it, and the ASCIIfied name only as a fallback. + + $ recode-sr-latin --version + ... + Written by Danilo Å egan and Bruno Haible. + + $ LC_ALL=C recode-sr-latin --version + ... + Written by Danilo Segan and Bruno Haible. + + The 'propername' module does exactly this. Plus, for languages that use + a different writing system than the Latin alphabet, it allows a translator + to write the name using that different writing system. In that case the + output will look like this: + () + + To use the 'propername' module is done in three simple steps: + + 1) Add it to the list of gnulib modules to import, + + 2) Change the arguments of version_etc, from + + from "Paul Eggert" + to proper_name ("Paul Eggert") + + from "Torbjorn Granlund" + to proper_name_utf8 ("Torbjorn Granlund", "Torbj\303\266rn Granlund") + + from "F. Pinard" + to proper_name_utf8 ("Franc,ois Pinard", "Fran\303\247ois Pinard") + + (Optionally, here you can also add / * TRANSLATORS: ... * / comments + explaining how the name is written or pronounced.) + + 3) If you are using GNU gettext version 0.16.1 or older, in po/Makevars, + in the definition of the XGETTEXT_OPTIONS variable, add: + + --keyword='proper_name:1,"This is a proper name. See the gettext manual, section Names."' + --keyword='proper_name_utf8:1,"This is a proper name. See the gettext manual, section Names."' + + This specifies automatic comments for the translator. (Requires + xgettext >= 0.15. The double-quotes inside the quoted string are on + purpose: they are part of the --keyword argument syntax.) + */ + +#ifndef _PROPERNAME_H +#define _PROPERNAME_H + + +#ifdef __cplusplus +extern "C" { +#endif + +/* Return the localization of NAME. NAME is written in ASCII. */ +extern const char * proper_name (const char *name); + +/* Return the localization of a name whose original writing is not ASCII. + NAME_UTF8 is the real name, written in UTF-8 with octal or hexadecimal + escape sequences. NAME_ASCII is a fallback written only with ASCII + characters. */ +extern const char * proper_name_utf8 (const char *name_ascii, + const char *name_utf8); + +#ifdef __cplusplus +} +#endif + + +#endif /* _PROPERNAME_H */ diff --git a/src/bin/coreutils/lib/putenv.c b/src/bin/coreutils/lib/putenv.c index 0602e44e32..cc14b93895 100644 --- a/src/bin/coreutils/lib/putenv.c +++ b/src/bin/coreutils/lib/putenv.c @@ -1,12 +1,12 @@ -/* Copyright (C) 1991, 1994, 1997, 1998, 2000, 2003, 2004, 2005, 2006, 2007 +/* Copyright (C) 1991, 1994, 1997-1998, 2000, 2003-2008 Free Software Foundation, Inc. NOTE: The canonical source of this file is maintained with the GNU C Library. Bugs can be reported to bug-glibc@prep.ai.mit.edu. - This program is free software; you can redistribute it and/or modify it + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2, or (at your option) any + Free Software Foundation; either version 3 of the License, or any later version. This program is distributed in the hope that it will be useful, @@ -15,16 +15,12 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ #include -/* undef putenv here, because some (e.g., Solaris 10) declare putenv in - with a non-const argument. That would conflict with the declaration of - rpl_putenv below (due to the #define putenv rpl_putenv from config.h). */ -#undef putenv -int rpl_putenv (char const *); +/* Specification. */ +#include #include @@ -35,7 +31,6 @@ int rpl_putenv (char const *); # define __set_errno(ev) ((errno) = (ev)) #endif -#include #include #include @@ -96,7 +91,7 @@ _unsetenv (const char *name) /* Put STRING, which is of the form "NAME=VALUE", in the environment. If STRING contains no `=', then remove STRING from the environment. */ int -rpl_putenv (const char *string) +putenv (char *string) { const char *const name_end = strchr (string, '='); register size_t size; @@ -126,13 +121,12 @@ rpl_putenv (const char *string) size * sizeof (char *)); new_environ[size] = (char *) string; new_environ[size + 1] = NULL; - if (last_environ != NULL) - free (last_environ); + free (last_environ); last_environ = new_environ; environ = new_environ; } else - *ep = (char *) string; + *ep = string; return 0; } diff --git a/src/bin/coreutils/lib/quote.c b/src/bin/coreutils/lib/quote.c index 119be72ae0..5e8b764711 100644 --- a/src/bin/coreutils/lib/quote.c +++ b/src/bin/coreutils/lib/quote.c @@ -3,10 +3,10 @@ Copyright (C) 1998, 1999, 2000, 2001, 2003, 2005, 2006 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Paul Eggert */ diff --git a/src/bin/coreutils/lib/quote.h b/src/bin/coreutils/lib/quote.h index 5400eadb65..c3660b1963 100644 --- a/src/bin/coreutils/lib/quote.h +++ b/src/bin/coreutils/lib/quote.h @@ -3,10 +3,10 @@ Copyright (C) 1998, 1999, 2000, 2001, 2003 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ char const *quote_n (int n, char const *name); diff --git a/src/bin/coreutils/lib/quotearg.c b/src/bin/coreutils/lib/quotearg.c index f7f326ac50..339bf34942 100644 --- a/src/bin/coreutils/lib/quotearg.c +++ b/src/bin/coreutils/lib/quotearg.c @@ -1,12 +1,12 @@ /* quotearg.c - quote arguments for output - Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004, 2005, 2006, 2007 Free - Software Foundation, Inc. + Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004, 2005, 2006, 2007, + 2008 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Paul Eggert */ @@ -38,23 +37,6 @@ #define _(msgid) gettext (msgid) #define N_(msgid) msgid -#if !HAVE_MBRTOWC -/* Disable multibyte processing entirely. Since MB_CUR_MAX is 1, the - other macros are defined only for documentation and to satisfy C - syntax. */ -# undef MB_CUR_MAX -# define MB_CUR_MAX 1 -# undef mbstate_t -# define mbstate_t int -# define mbrtowc(pwc, s, n, ps) ((*(pwc) = *(s)) != 0) -# define iswprint(wc) isprint ((unsigned char) (wc)) -# undef HAVE_MBSINIT -#endif - -#if !defined mbsinit && !HAVE_MBSINIT -# define mbsinit(ps) 1 -#endif - #ifndef SIZE_MAX # define SIZE_MAX ((size_t) -1) #endif @@ -66,6 +48,9 @@ struct quoting_options /* Basic quoting style. */ enum quoting_style style; + /* Additional flags. Bitwise combination of enum quoting_flags. */ + int flags; + /* Quote the characters indicated by this bit vector even if the quoting style would not normally require them to be quoted. */ unsigned int quote_these_too[(UCHAR_MAX / INT_BITS) + 1]; @@ -78,6 +63,7 @@ char const *const quoting_style_args[] = "shell", "shell-always", "c", + "c-maybe", "escape", "locale", "clocale", @@ -91,6 +77,7 @@ enum quoting_style const quoting_style_vals[] = shell_quoting_style, shell_always_quoting_style, c_quoting_style, + c_maybe_quoting_style, escape_quoting_style, locale_quoting_style, clocale_quoting_style @@ -144,6 +131,32 @@ set_char_quoting (struct quoting_options *o, char c, int i) return r; } +/* In O (or in the default if O is null), + set the value of the quoting options flag to I, which can be a + bitwise combination of enum quoting_flags, or 0 for default + behavior. Return the old value. */ +int +set_quoting_flags (struct quoting_options *o, int i) +{ + int r; + if (!o) + o = &default_quoting_options; + r = o->flags; + o->flags = i; + return r; +} + +/* Return quoting options for STYLE, with no extra quoting. */ +static struct quoting_options +quoting_options_from_style (enum quoting_style style) +{ + struct quoting_options o; + o.style = style; + o.flags = 0; + memset (o.quote_these_too, 0, sizeof o.quote_these_too); + return o; +} + /* MSGID approximates a quotation mark. Return its translation if it has one; otherwise, return either it or "\"", depending on S. */ static char const * @@ -156,8 +169,8 @@ gettext_quote (char const *msgid, enum quoting_style s) } /* Place into buffer BUFFER (of size BUFFERSIZE) a quoted version of - argument ARG (of size ARGSIZE), using QUOTING_STYLE and the - non-quoting-style part of O to control quoting. + argument ARG (of size ARGSIZE), using QUOTING_STYLE, FLAGS, and + QUOTE_THESE_TOO to control quoting. Terminate the output with a null character, and return the written size of the output, not counting the terminating null. If BUFFERSIZE is too small to store the output string, return the @@ -165,14 +178,14 @@ gettext_quote (char const *msgid, enum quoting_style s) If ARGSIZE is SIZE_MAX, use the string length of the argument for ARGSIZE. This function acts like quotearg_buffer (BUFFER, BUFFERSIZE, ARG, - ARGSIZE, O), except it uses QUOTING_STYLE instead of the quoting - style specified by O, and O may not be null. */ + ARGSIZE, O), except it breaks O into its component pieces and is + not careful about errno. */ static size_t quotearg_buffer_restyled (char *buffer, size_t buffersize, char const *arg, size_t argsize, - enum quoting_style quoting_style, - struct quoting_options const *o) + enum quoting_style quoting_style, int flags, + unsigned int const *quote_these_too) { size_t i; size_t len = 0; @@ -180,6 +193,7 @@ quotearg_buffer_restyled (char *buffer, size_t buffersize, size_t quote_string_len = 0; bool backslash_escapes = false; bool unibyte_locale = MB_CUR_MAX == 1; + bool elide_outer_quotes = (flags & QA_ELIDE_OUTER_QUOTES) != 0; #define STORE(c) \ do \ @@ -192,8 +206,13 @@ quotearg_buffer_restyled (char *buffer, size_t buffersize, switch (quoting_style) { + case c_maybe_quoting_style: + quoting_style = c_quoting_style; + elide_outer_quotes = true; + /* Fall through. */ case c_quoting_style: - STORE ('"'); + if (!elide_outer_quotes) + STORE ('"'); backslash_escapes = true; quote_string = "\""; quote_string_len = 1; @@ -201,6 +220,7 @@ quotearg_buffer_restyled (char *buffer, size_t buffersize, case escape_quoting_style: backslash_escapes = true; + elide_outer_quotes = false; break; case locale_quoting_style: @@ -228,22 +248,32 @@ quotearg_buffer_restyled (char *buffer, size_t buffersize, char const *left = gettext_quote (N_("`"), quoting_style); char const *right = gettext_quote (N_("'"), quoting_style); - for (quote_string = left; *quote_string; quote_string++) - STORE (*quote_string); + if (!elide_outer_quotes) + for (quote_string = left; *quote_string; quote_string++) + STORE (*quote_string); backslash_escapes = true; quote_string = right; quote_string_len = strlen (quote_string); } break; + case shell_quoting_style: + quoting_style = shell_always_quoting_style; + elide_outer_quotes = true; + /* Fall through. */ case shell_always_quoting_style: - STORE ('\''); + if (!elide_outer_quotes) + STORE ('\''); quote_string = "'"; quote_string_len = 1; break; - default: + case literal_quoting_style: + elide_outer_quotes = false; break; + + default: + abort (); } for (i = 0; ! (argsize == SIZE_MAX ? arg[i] == '\0' : i == argsize); i++) @@ -255,7 +285,11 @@ quotearg_buffer_restyled (char *buffer, size_t buffersize, && quote_string_len && i + quote_string_len <= argsize && memcmp (arg + i, quote_string, quote_string_len) == 0) - STORE ('\\'); + { + if (elide_outer_quotes) + goto force_outer_quoting_style; + STORE ('\\'); + } c = arg[i]; switch (c) @@ -263,21 +297,31 @@ quotearg_buffer_restyled (char *buffer, size_t buffersize, case '\0': if (backslash_escapes) { + if (elide_outer_quotes) + goto force_outer_quoting_style; STORE ('\\'); - STORE ('0'); - STORE ('0'); + if (i + 1 < argsize && '0' <= arg[i + 1] && arg[i + 1] <= '9') + { + STORE ('0'); + STORE ('0'); + } c = '0'; } + else if (flags & QA_ELIDE_NULL_BYTES) + continue; break; case '?': switch (quoting_style) { - case shell_quoting_style: - goto use_shell_always_quoting_style; + case shell_always_quoting_style: + if (elide_outer_quotes) + goto force_outer_quoting_style; + break; case c_quoting_style: - if (i + 2 < argsize && arg[i + 1] == '?') + if ((flags & QA_SPLIT_TRIGRAPHS) + && i + 2 < argsize && arg[i + 1] == '?') switch (arg[i + 2]) { case '!': case '\'': @@ -285,10 +329,13 @@ quotearg_buffer_restyled (char *buffer, size_t buffersize, case '<': case '=': case '>': /* Escape the second '?' in what would otherwise be a trigraph. */ + if (elide_outer_quotes) + goto force_outer_quoting_style; c = arg[i + 2]; i += 2; STORE ('?'); - STORE ('\\'); + STORE ('"'); + STORE ('"'); STORE ('?'); break; @@ -309,11 +356,17 @@ quotearg_buffer_restyled (char *buffer, size_t buffersize, case '\r': esc = 'r'; goto c_and_shell_escape; case '\t': esc = 't'; goto c_and_shell_escape; case '\v': esc = 'v'; goto c_escape; - case '\\': esc = c; goto c_and_shell_escape; + case '\\': esc = c; + /* No need to escape the escape if we are trying to elide + outer quotes and nothing else is problematic. */ + if (backslash_escapes && elide_outer_quotes && quote_string_len) + goto store_c; c_and_shell_escape: - if (quoting_style == shell_quoting_style) - goto use_shell_always_quoting_style; + if (quoting_style == shell_always_quoting_style + && elide_outer_quotes) + goto force_outer_quoting_style; + /* Fall through. */ c_escape: if (backslash_escapes) { @@ -343,24 +396,19 @@ quotearg_buffer_restyled (char *buffer, size_t buffersize, be the first bytes of multibyte characters, which means we should check them with mbrtowc, but in practice this doesn't happen so it's not worth worrying about. */ - if (quoting_style == shell_quoting_style) - goto use_shell_always_quoting_style; + if (quoting_style == shell_always_quoting_style + && elide_outer_quotes) + goto force_outer_quoting_style; break; case '\'': - switch (quoting_style) + if (quoting_style == shell_always_quoting_style) { - case shell_quoting_style: - goto use_shell_always_quoting_style; - - case shell_always_quoting_style: + if (elide_outer_quotes) + goto force_outer_quoting_style; STORE ('\''); STORE ('\\'); STORE ('\''); - break; - - default: - break; } break; @@ -432,7 +480,8 @@ quotearg_buffer_restyled (char *buffer, size_t buffersize, that is really the 2nd byte of a multibyte character. In practice the problem is limited to ASCII chars >= '@' that are shell special chars. */ - if ('[' == 0x5b && quoting_style == shell_quoting_style) + if ('[' == 0x5b && elide_outer_quotes + && quoting_style == shell_always_quoting_style) { size_t j; for (j = 1; j < bytes; j++) @@ -440,7 +489,7 @@ quotearg_buffer_restyled (char *buffer, size_t buffersize, { case '[': case '\\': case '^': case '`': case '|': - goto use_shell_always_quoting_style; + goto force_outer_quoting_style; default: break; @@ -465,6 +514,8 @@ quotearg_buffer_restyled (char *buffer, size_t buffersize, { if (backslash_escapes && ! printable) { + if (elide_outer_quotes) + goto force_outer_quoting_style; STORE ('\\'); STORE ('0' + (c >> 6)); STORE ('0' + ((c >> 3) & 7)); @@ -481,21 +532,25 @@ quotearg_buffer_restyled (char *buffer, size_t buffersize, } } - if (! (backslash_escapes - && o->quote_these_too[c / INT_BITS] & (1 << (c % INT_BITS)))) + if (! ((backslash_escapes || elide_outer_quotes) + && quote_these_too + && quote_these_too[c / INT_BITS] & (1 << (c % INT_BITS)))) goto store_c; store_escape: + if (elide_outer_quotes) + goto force_outer_quoting_style; STORE ('\\'); store_c: STORE (c); } - if (i == 0 && quoting_style == shell_quoting_style) - goto use_shell_always_quoting_style; + if (len == 0 && quoting_style == shell_always_quoting_style + && elide_outer_quotes) + goto force_outer_quoting_style; - if (quote_string) + if (quote_string && !elide_outer_quotes) for (; *quote_string; quote_string++) STORE (*quote_string); @@ -503,9 +558,12 @@ quotearg_buffer_restyled (char *buffer, size_t buffersize, buffer[len] = '\0'; return len; - use_shell_always_quoting_style: + force_outer_quoting_style: + /* Don't reuse quote_these_too, since the addition of outer quotes + sufficiently quotes the specified characters. */ return quotearg_buffer_restyled (buffer, buffersize, arg, argsize, - shell_always_quoting_style, o); + quoting_style, + flags & ~QA_ELIDE_OUTER_QUOTES, NULL); } /* Place into buffer BUFFER (of size BUFFERSIZE) a quoted version of @@ -525,22 +583,41 @@ quotearg_buffer (char *buffer, size_t buffersize, struct quoting_options const *p = o ? o : &default_quoting_options; int e = errno; size_t r = quotearg_buffer_restyled (buffer, buffersize, arg, argsize, - p->style, p); + p->style, p->flags, p->quote_these_too); errno = e; return r; } -/* Like quotearg_buffer (..., ARG, ARGSIZE, O), except return newly - allocated storage containing the quoted string. */ +/* Equivalent to quotearg_alloc (ARG, ARGSIZE, NULL, O). */ char * quotearg_alloc (char const *arg, size_t argsize, struct quoting_options const *o) { + return quotearg_alloc_mem (arg, argsize, NULL, o); +} + +/* Like quotearg_buffer (..., ARG, ARGSIZE, O), except return newly + allocated storage containing the quoted string, and store the + resulting size into *SIZE, if non-NULL. The result can contain + embedded null bytes only if ARGSIZE is not SIZE_MAX, SIZE is not + NULL, and set_quoting_flags has not set the null byte elision + flag. */ +char * +quotearg_alloc_mem (char const *arg, size_t argsize, size_t *size, + struct quoting_options const *o) +{ + struct quoting_options const *p = o ? o : &default_quoting_options; int e = errno; - size_t bufsize = quotearg_buffer (0, 0, arg, argsize, o) + 1; + /* Elide embedded null bytes if we can't return a size. */ + int flags = p->flags | (size ? 0 : QA_ELIDE_NULL_BYTES); + size_t bufsize = quotearg_buffer_restyled (0, 0, arg, argsize, p->style, + flags, p->quote_these_too) + 1; char *buf = xcharalloc (bufsize); - quotearg_buffer (buf, bufsize, arg, argsize, o); + quotearg_buffer_restyled (buf, bufsize, arg, argsize, p->style, flags, + p->quote_these_too); errno = e; + if (size) + *size = bufsize - 1; return buf; } @@ -622,7 +699,11 @@ quotearg_n_options (int n, char const *arg, size_t argsize, { size_t size = sv[n].size; char *val = sv[n].val; - size_t qsize = quotearg_buffer (val, size, arg, argsize, options); + /* Elide embedded null bytes since we don't return a size. */ + int flags = options->flags | QA_ELIDE_NULL_BYTES; + size_t qsize = quotearg_buffer_restyled (val, size, arg, argsize, + options->style, flags, + options->quote_these_too); if (size <= qsize) { @@ -630,7 +711,8 @@ quotearg_n_options (int n, char const *arg, size_t argsize, if (val != slot0) free (val); sv[n].val = val = xcharalloc (size); - quotearg_buffer (val, size, arg, argsize, options); + quotearg_buffer_restyled (val, size, arg, argsize, options->style, + flags, options->quote_these_too); } errno = e; @@ -644,20 +726,22 @@ quotearg_n (int n, char const *arg) return quotearg_n_options (n, arg, SIZE_MAX, &default_quoting_options); } +char * +quotearg_n_mem (int n, char const *arg, size_t argsize) +{ + return quotearg_n_options (n, arg, argsize, &default_quoting_options); +} + char * quotearg (char const *arg) { return quotearg_n (0, arg); } -/* Return quoting options for STYLE, with no extra quoting. */ -static struct quoting_options -quoting_options_from_style (enum quoting_style style) +char * +quotearg_mem (char const *arg, size_t argsize) { - struct quoting_options o; - o.style = style; - memset (o.quote_these_too, 0, sizeof o.quote_these_too); - return o; + return quotearg_n_mem (0, arg, argsize); } char * @@ -682,12 +766,24 @@ quotearg_style (enum quoting_style s, char const *arg) } char * -quotearg_char (char const *arg, char ch) +quotearg_style_mem (enum quoting_style s, char const *arg, size_t argsize) +{ + return quotearg_n_style_mem (0, s, arg, argsize); +} + +char * +quotearg_char_mem (char const *arg, size_t argsize, char ch) { struct quoting_options options; options = default_quoting_options; set_char_quoting (&options, ch, 1); - return quotearg_n_options (0, arg, SIZE_MAX, &options); + return quotearg_n_options (0, arg, argsize, &options); +} + +char * +quotearg_char (char const *arg, char ch) +{ + return quotearg_char_mem (arg, SIZE_MAX, ch); } char * @@ -695,3 +791,9 @@ quotearg_colon (char const *arg) { return quotearg_char (arg, ':'); } + +char * +quotearg_colon_mem (char const *arg, size_t argsize) +{ + return quotearg_char_mem (arg, argsize, ':'); +} diff --git a/src/bin/coreutils/lib/quotearg.h b/src/bin/coreutils/lib/quotearg.h index 4887df3b6d..7700107001 100644 --- a/src/bin/coreutils/lib/quotearg.h +++ b/src/bin/coreutils/lib/quotearg.h @@ -1,12 +1,12 @@ /* quotearg.h - quote arguments for output - Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004, 2006 Free + Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004, 2006, 2008 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Paul Eggert */ @@ -24,36 +23,163 @@ # include -/* Basic quoting styles. */ +/* Basic quoting styles. For each style, an example is given on the + input strings "simple", "\0 \t\n'\"\033?""?/\\", and "a:b", using + quotearg_buffer, quotearg_mem, and quotearg_colon_mem with that + style and the default flags and quoted characters. Note that the + examples are shown here as valid C strings rather than what + displays on a terminal (with "??/" as a trigraph for "\\"). */ enum quoting_style { - /* Output names as-is (ls --quoting-style=literal). */ + /* Output names as-is (ls --quoting-style=literal). Can result in + embedded null bytes if QA_ELIDE_NULL_BYTES is not in + effect. + + quotearg_buffer: + "simple", "\0 \t\n'\"\033??/\\", "a:b" + quotearg: + "simple", " \t\n'\"\033??/\\", "a:b" + quotearg_colon: + "simple", " \t\n'\"\033??/\\", "a:b" + */ literal_quoting_style, /* Quote names for the shell if they contain shell metacharacters - or would cause ambiguous output (ls --quoting-style=shell). */ + or would cause ambiguous output (ls --quoting-style=shell). + Can result in embedded null bytes if QA_ELIDE_NULL_BYTES is not + in effect. + + quotearg_buffer: + "simple", "'\0 \t\n'\\''\"\033??/\\'", "a:b" + quotearg: + "simple", "' \t\n'\\''\"\033??/\\'", "a:b" + quotearg_colon: + "simple", "' \t\n'\\''\"\033??/\\'", "'a:b'" + */ shell_quoting_style, /* Quote names for the shell, even if they would normally not - require quoting (ls --quoting-style=shell-always). */ + require quoting (ls --quoting-style=shell-always). Can result + in embedded null bytes if QA_ELIDE_NULL_BYTES is not in effect. + Behaves like shell_quoting_style if QA_ELIDE_OUTER_QUOTES is in + effect. + + quotearg_buffer: + "'simple'", "'\0 \t\n'\\''\"\033??/\\'", "'a:b'" + quotearg: + "'simple'", "' \t\n'\\''\"\033??/\\'", "'a:b'" + quotearg_colon: + "'simple'", "' \t\n'\\''\"\033??/\\'", "'a:b'" + */ shell_always_quoting_style, - /* Quote names as for a C language string (ls --quoting-style=c). */ + /* Quote names as for a C language string (ls --quoting-style=c). + Behaves like c_maybe_quoting_style if QA_ELIDE_OUTER_QUOTES is + in effect. Split into consecutive strings if + QA_SPLIT_TRIGRAPHS. + + quotearg_buffer: + "\"simple\"", "\"\\0 \\t\\n'\\\"\\033??/\\\\\"", "\"a:b\"" + quotearg: + "\"simple\"", "\"\\0 \\t\\n'\\\"\\033??/\\\\\"", "\"a:b\"" + quotearg_colon: + "\"simple\"", "\"\\0 \\t\\n'\\\"\\033??/\\\\\"", "\"a\\:b\"" + */ c_quoting_style, /* Like c_quoting_style except omit the surrounding double-quote - characters (ls --quoting-style=escape). */ + characters if no quoted characters are encountered. + + quotearg_buffer: + "simple", "\"\\0 \\t\\n'\\\"\\033??/\\\\\"", "a:b" + quotearg: + "simple", "\"\\0 \\t\\n'\\\"\\033??/\\\\\"", "a:b" + quotearg_colon: + "simple", "\"\\0 \\t\\n'\\\"\\033??/\\\\\"", "\"a:b\"" + */ + c_maybe_quoting_style, + + /* Like c_quoting_style except always omit the surrounding + double-quote characters (ls --quoting-style=escape). + + quotearg_buffer: + "simple", "\\0 \\t\\n'\"\\033??/\\\\", "a:b" + quotearg: + "simple", "\\0 \\t\\n'\"\\033??/\\\\", "a:b" + quotearg_colon: + "simple", "\\0 \\t\\n'\"\\033??/\\\\", "a\\:b" + */ escape_quoting_style, /* Like clocale_quoting_style, but quote `like this' instead of - "like this" in the default C locale (ls --quoting-style=locale). */ + "like this" in the default C locale (ls --quoting-style=locale). + + LC_MESSAGES=C + quotearg_buffer: + "`simple'", "`\\0 \\t\\n\\'\"\\033??/\\\\'", "`a:b'" + quotearg: + "`simple'", "`\\0 \\t\\n\\'\"\\033??/\\\\'", "`a:b'" + quotearg_colon: + "`simple'", "`\\0 \\t\\n\\'\"\\033??/\\\\'", "`a\\:b'" + + LC_MESSAGES=pt_PT.utf8 + quotearg_buffer: + "\302\253simple\302\273", + "\302\253\\0 \\t\\n'\"\\033??/\\\\\302\253", "\302\253a:b\302\273" + quotearg: + "\302\253simple\302\273", + "\302\253\\0 \\t\\n'\"\\033??/\\\\\302\253", "\302\253a:b\302\273" + quotearg_colon: + "\302\253simple\302\273", + "\302\253\\0 \\t\\n'\"\\033??/\\\\\302\253", "\302\253a\\:b\302\273" + */ locale_quoting_style, /* Like c_quoting_style except use quotation marks appropriate for - the locale (ls --quoting-style=clocale). */ + the locale (ls --quoting-style=clocale). + + LC_MESSAGES=C + quotearg_buffer: + "\"simple\"", "\"\\0 \\t\\n'\\\"\\033??/\\\\\"", "\"a:b\"" + quotearg: + "\"simple\"", "\"\\0 \\t\\n'\\\"\\033??/\\\\\"", "\"a:b\"" + quotearg_colon: + "\"simple\"", "\"\\0 \\t\\n'\\\"\\033??/\\\\\"", "\"a\\:b\"" + + LC_MESSAGES=pt_PT.utf8 + quotearg_buffer: + "\302\253simple\302\273", + "\302\253\\0 \\t\\n'\"\\033??/\\\\\302\253", "\302\253a:b\302\273" + quotearg: + "\302\253simple\302\273", + "\302\253\\0 \\t\\n'\"\\033??/\\\\\302\253", "\302\253a:b\302\273" + quotearg_colon: + "\302\253simple\302\273", + "\302\253\\0 \\t\\n'\"\\033??/\\\\\302\253", "\302\253a\\:b\302\273" + */ clocale_quoting_style }; +/* Flags for use in set_quoting_flags. */ +enum quoting_flags + { + /* Always elide null bytes from styles that do not quote them, + even when the length of the result is available to the + caller. */ + QA_ELIDE_NULL_BYTES = 0x01, + + /* Omit the surrounding quote characters if no escaped characters + are encountered. Note that if no other character needs + escaping, then neither does the escape character. */ + QA_ELIDE_OUTER_QUOTES = 0x02, + + /* In the c_quoting_style and c_maybe_quoting_style, split ANSI + trigraph sequences into concatenated strings (for example, + "?""?/" rather than "??/", which could be confused with + "\\"). */ + QA_SPLIT_TRIGRAPHS = 0x04 + }; + /* For now, --quoting-style=literal is the default, but this may change. */ # ifndef DEFAULT_QUOTING_STYLE # define DEFAULT_QUOTING_STYLE literal_quoting_style @@ -87,6 +213,12 @@ void set_quoting_style (struct quoting_options *o, enum quoting_style s); it would not otherwise be quoted). */ int set_char_quoting (struct quoting_options *o, char c, int i); +/* In O (or in the default if O is null), + set the value of the quoting options flag to I, which can be a + bitwise combination of enum quoting_flags, or 0 for default + behavior. Return the old value. */ +int set_quoting_flags (struct quoting_options *o, int i); + /* Place into buffer BUFFER (of size BUFFERSIZE) a quoted version of argument ARG (of size ARGSIZE), using O to control quoting. If O is null, use the default. @@ -94,26 +226,49 @@ int set_char_quoting (struct quoting_options *o, char c, int i); size of the output, not counting the terminating null. If BUFFERSIZE is too small to store the output string, return the value that would have been returned had BUFFERSIZE been large enough. - If ARGSIZE is -1, use the string length of the argument for ARGSIZE. */ + If ARGSIZE is -1, use the string length of the argument for ARGSIZE. + On output, BUFFER might contain embedded null bytes if ARGSIZE was + not -1, the style of O does not use backslash escapes, and the + flags of O do not request elision of null bytes.*/ size_t quotearg_buffer (char *buffer, size_t buffersize, char const *arg, size_t argsize, struct quoting_options const *o); /* Like quotearg_buffer, except return the result in a newly allocated - buffer. It is the caller's responsibility to free the result. */ + buffer. It is the caller's responsibility to free the result. The + result will not contain embedded null bytes. */ char *quotearg_alloc (char const *arg, size_t argsize, struct quoting_options const *o); +/* Like quotearg_alloc, except that the length of the result, + excluding the terminating null byte, is stored into SIZE if it is + non-NULL. The result might contain embedded null bytes if ARGSIZE + was not -1, SIZE was not NULL, the style of O does not use + backslash escapes, and the flags of O do not request elision of + null bytes.*/ +char *quotearg_alloc_mem (char const *arg, size_t argsize, + size_t *size, struct quoting_options const *o); + /* Use storage slot N to return a quoted version of the string ARG. Use the default quoting options. The returned value points to static storage that can be reused by the next call to this function with the same value of N. - N must be nonnegative. */ + N must be nonnegative. The output of all functions in the + quotearg_n family are guaranteed to not contain embedded null + bytes.*/ char *quotearg_n (int n, char const *arg); /* Equivalent to quotearg_n (0, ARG). */ char *quotearg (char const *arg); +/* Use storage slot N to return a quoted version of the argument ARG + of size ARGSIZE. This is like quotearg_n (N, ARG), except it can + quote null bytes. */ +char *quotearg_n_mem (int n, char const *arg, size_t argsize); + +/* Equivalent to quotearg_n_mem (0, ARG, ARGSIZE). */ +char *quotearg_mem (char const *arg, size_t argsize); + /* Use style S and storage slot N to return a quoted version of the string ARG. This is like quotearg_n (N, ARG), except that it uses S with no other options to specify the quoting method. */ @@ -128,12 +283,22 @@ char *quotearg_n_style_mem (int n, enum quoting_style s, /* Equivalent to quotearg_n_style (0, S, ARG). */ char *quotearg_style (enum quoting_style s, char const *arg); +/* Equivalent to quotearg_n_style_mem (0, S, ARG, ARGSIZE). */ +char *quotearg_style_mem (enum quoting_style s, + char const *arg, size_t argsize); + /* Like quotearg (ARG), except also quote any instances of CH. */ char *quotearg_char (char const *arg, char ch); +/* Like quotearg_char (ARG, CH), except it can quote null bytes. */ +char *quotearg_char_mem (char const *arg, size_t argsize, char ch); + /* Equivalent to quotearg_char (ARG, ':'). */ char *quotearg_colon (char const *arg); +/* Like quotearg_colon (ARG), except it can quote null bytes. */ +char *quotearg_colon_mem (char const *arg, size_t argsize); + /* Free any dynamically allocated memory. */ void quotearg_free (void); diff --git a/src/bin/coreutils/lib/raise.c b/src/bin/coreutils/lib/raise.c index 98a97da6de..3064889be8 100644 --- a/src/bin/coreutils/lib/raise.c +++ b/src/bin/coreutils/lib/raise.c @@ -2,10 +2,10 @@ Copyright (C) 2002, 2003, 2005, 2006 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* written by Jim Meyering */ diff --git a/src/bin/coreutils/lib/rand-isaac.c b/src/bin/coreutils/lib/rand-isaac.c index cfdc643f60..cd69fbfded 100644 --- a/src/bin/coreutils/lib/rand-isaac.c +++ b/src/bin/coreutils/lib/rand-isaac.c @@ -3,10 +3,10 @@ Copyright (C) 1999-2006 Free Software Foundation, Inc. Copyright (C) 1997, 1998, 1999 Colin Plumb. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + along with this program. If not, see . Written by Colin Plumb. */ diff --git a/src/bin/coreutils/lib/rand-isaac.h b/src/bin/coreutils/lib/rand-isaac.h index f8daee03dd..94ca74f53f 100644 --- a/src/bin/coreutils/lib/rand-isaac.h +++ b/src/bin/coreutils/lib/rand-isaac.h @@ -3,10 +3,10 @@ Copyright (C) 1999-2005 Free Software Foundation, Inc. Copyright (C) 1997, 1998, 1999 Colin Plumb. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + along with this program. If not, see . Written by Colin Plumb. */ diff --git a/src/bin/coreutils/lib/randint.c b/src/bin/coreutils/lib/randint.c index 5ee738a506..df1a69d5c6 100644 --- a/src/bin/coreutils/lib/randint.c +++ b/src/bin/coreutils/lib/randint.c @@ -2,10 +2,10 @@ Copyright (C) 2006 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + along with this program. If not, see . */ /* Written by Paul Eggert. */ @@ -51,10 +50,6 @@ main (int argc, char **argv) #include "xalloc.h" -#ifndef MAX -# define MAX(a,b) ((a) < (b) ? (b) : (a)) -#endif - /* A source of random data for generating random integers. */ struct randint_source { diff --git a/src/bin/coreutils/lib/randint.h b/src/bin/coreutils/lib/randint.h index 4245a6d3ff..1e96ccb507 100644 --- a/src/bin/coreutils/lib/randint.h +++ b/src/bin/coreutils/lib/randint.h @@ -2,10 +2,10 @@ Copyright (C) 2006 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + along with this program. If not, see . */ /* Written by Paul Eggert. */ diff --git a/src/bin/coreutils/lib/randperm.c b/src/bin/coreutils/lib/randperm.c index c4438ddfba..0aaa5e2ff1 100644 --- a/src/bin/coreutils/lib/randperm.c +++ b/src/bin/coreutils/lib/randperm.c @@ -2,10 +2,10 @@ Copyright (C) 2006, 2007 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + along with this program. If not, see . */ /* Written by Paul Eggert. */ diff --git a/src/bin/coreutils/lib/randread.c b/src/bin/coreutils/lib/randread.c index 5462d446c9..48ce92e9ab 100644 --- a/src/bin/coreutils/lib/randread.c +++ b/src/bin/coreutils/lib/randread.c @@ -1,11 +1,11 @@ /* Generate buffers of random data. - Copyright (C) 2006 Free Software Foundation, Inc. + Copyright (C) 2006, 2008-2009 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + along with this program. If not, see . */ /* Written by Paul Eggert. */ @@ -40,18 +39,18 @@ #include "unlocked-io.h" #include "xalloc.h" -#ifndef MIN -# define MIN(a, b) ((a) < (b) ? (a) : (b)) -#endif - #ifndef __attribute__ -# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8) || __STRICT_ANSI__ -# define __attribute__(x) +# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8) +# define __attribute__(x) /* empty */ # endif #endif -#ifndef ATTRIBUTE_UNUSED -# define ATTRIBUTE_UNUSED __attribute__ ((__unused__)) +#ifndef ATTRIBUTE_NORETURN +# define ATTRIBUTE_NORETURN __attribute__ ((__noreturn__)) +#endif + +#ifndef MIN +# define MIN(a, b) ((a) < (b) ? (a) : (b)) #endif #if _STRING_ARCH_unaligned @@ -61,10 +60,6 @@ # define ALIGNED_POINTER(ptr, type) ((size_t) (ptr) % alignof (type) == 0) #endif -#ifndef DEFAULT_RANDOM_FILE -# define DEFAULT_RANDOM_FILE "/dev/urandom" -#endif - /* The maximum buffer size used for reads of random data. Using the value 2 * ISAAC_BYTES makes this the largest power of two that would not otherwise cause struct randread_source to grow. */ @@ -73,10 +68,8 @@ /* A source of random data for generating random buffers. */ struct randread_source { - /* Stream to read random bytes from. If null, the behavior is - undefined; the current implementation uses ISAAC in this case, - but this is for old-fashioned implementations that lack - /dev/urandom and callers should not rely on this. */ + /* Stream to read random bytes from. If null, the current + implementation uses an internal PRNG (ISAAC). */ FILE *source; /* Function to call, and its argument, if there is an input error or @@ -117,7 +110,7 @@ struct randread_source /* The default error handler. */ -static void +static void ATTRIBUTE_NORETURN randread_error (void const *file_name) { if (file_name) @@ -158,18 +151,14 @@ randread_new (char const *name, size_t bytes_bound) return simple_new (NULL, NULL); else { - char const *file_name = (name ? name : DEFAULT_RANDOM_FILE); - FILE *source = fopen_safer (file_name, "rb"); + FILE *source = NULL; struct randread_source *s; - if (! source) - { - if (name) - return NULL; - file_name = NULL; - } + if (name) + if (! (source = fopen_safer (name, "rb"))) + return NULL; - s = simple_new (source, file_name); + s = simple_new (source, name); if (source) setvbuf (source, s->buf.c, _IOFBF, MIN (sizeof s->buf.c, bytes_bound)); diff --git a/src/bin/coreutils/lib/randread.h b/src/bin/coreutils/lib/randread.h index 8e34334a7e..5f044bd30f 100644 --- a/src/bin/coreutils/lib/randread.h +++ b/src/bin/coreutils/lib/randread.h @@ -2,10 +2,10 @@ Copyright (C) 2006 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + along with this program. If not, see . */ /* Written by Paul Eggert. */ diff --git a/src/bin/coreutils/lib/readlink.c b/src/bin/coreutils/lib/readlink.c index 3cbdc1c2fd..5cccdc962a 100644 --- a/src/bin/coreutils/lib/readlink.c +++ b/src/bin/coreutils/lib/readlink.c @@ -1,10 +1,10 @@ /* Stub for readlink(). Copyright (C) 2003-2007 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ #include diff --git a/src/bin/coreutils/lib/readtokens.c b/src/bin/coreutils/lib/readtokens.c index 28aafa9620..01750989cc 100644 --- a/src/bin/coreutils/lib/readtokens.c +++ b/src/bin/coreutils/lib/readtokens.c @@ -1,11 +1,11 @@ /* readtokens.c -- Functions for reading tokens from an input stream. - Copyright (C) 1990-1991, 1999-2004, 2006 Free Software Foundation, Inc. + Copyright (C) 1990-1991, 1999-2004, 2006, 2009 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + along with this program. If not, see . Written by Jim Meyering. */ @@ -37,9 +36,6 @@ # include "unlocked-io.h" #endif -#define STREQ(a,b) ((a) == (b) || ((a) && (b) && *(a) == *(b) \ - && strcmp(a, b) == 0)) - /* Initialize a tokenbuffer. */ void diff --git a/src/bin/coreutils/lib/readtokens.h b/src/bin/coreutils/lib/readtokens.h index 45a0c4874d..1c3cafeb1e 100644 --- a/src/bin/coreutils/lib/readtokens.h +++ b/src/bin/coreutils/lib/readtokens.h @@ -2,10 +2,10 @@ Copyright (C) 1990, 1991, 1999, 2001-2004 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + along with this program. If not, see . Written by Jim Meyering. */ diff --git a/src/bin/coreutils/lib/readtokens0.c b/src/bin/coreutils/lib/readtokens0.c index b60fd5a447..ccd2860c07 100644 --- a/src/bin/coreutils/lib/readtokens0.c +++ b/src/bin/coreutils/lib/readtokens0.c @@ -2,10 +2,10 @@ Copyright (C) 2004, 2006 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + along with this program. If not, see . Written by Jim Meyering. */ diff --git a/src/bin/coreutils/lib/readtokens0.h b/src/bin/coreutils/lib/readtokens0.h index 94c9a4914e..4f04b68643 100644 --- a/src/bin/coreutils/lib/readtokens0.h +++ b/src/bin/coreutils/lib/readtokens0.h @@ -2,10 +2,10 @@ Copyright (C) 2004 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + along with this program. If not, see . Written by Jim Meyering. */ diff --git a/src/bin/coreutils/lib/readutmp.c b/src/bin/coreutils/lib/readutmp.c index 73c7b53084..aeec205723 100644 --- a/src/bin/coreutils/lib/readutmp.c +++ b/src/bin/coreutils/lib/readutmp.c @@ -3,10 +3,10 @@ Copyright (C) 1992-2001, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by jla; revised by djm */ @@ -32,6 +31,7 @@ #include #include #include +#include #include "xalloc.h" @@ -39,10 +39,6 @@ # include "unlocked-io.h" #endif -#ifndef SIZE_MAX -# define SIZE_MAX ((size_t) -1) -#endif - /* Copy UT->ut_name into storage obtained from malloc. Then remove any trailing spaces from the copy, NUL terminate it, and return the copy. */ diff --git a/src/bin/coreutils/lib/readutmp.h b/src/bin/coreutils/lib/readutmp.h index 84cf117924..1e43a31e84 100644 --- a/src/bin/coreutils/lib/readutmp.h +++ b/src/bin/coreutils/lib/readutmp.h @@ -2,10 +2,10 @@ Copyright (C) 1992-2007 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by jla; revised by djm */ diff --git a/src/bin/coreutils/lib/realloc.c b/src/bin/coreutils/lib/realloc.c index c1fe9e5a18..b61c2ca829 100644 --- a/src/bin/coreutils/lib/realloc.c +++ b/src/bin/coreutils/lib/realloc.c @@ -1,11 +1,11 @@ /* realloc() function that is glibc compatible. - Copyright (C) 1997, 2003, 2004, 2006 Free Software Foundation, Inc. + Copyright (C) 1997, 2003, 2004, 2006, 2007 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,16 +13,40 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ -/* written by Jim Meyering */ +/* written by Jim Meyering and Bruno Haible */ #include + +/* Only the AC_FUNC_REALLOC macro defines 'realloc' already in config.h. */ +#ifdef realloc +# define NEED_REALLOC_GNU 1 +#endif + +/* Infer the properties of the system's malloc function. + Only the AC_FUNC_MALLOC macro defines 'malloc' already in config.h. */ +#if GNULIB_MALLOC_GNU && !defined malloc +# define SYSTEM_MALLOC_GLIBC_COMPATIBLE 1 +#endif + +/* Below we want to call the system's malloc and realloc. + Undefine the symbols here so that including provides a + declaration of malloc(), not of rpl_malloc(), and likewise for realloc. */ +#undef malloc #undef realloc +/* Specification. */ #include +#include + +/* Below we want to call the system's malloc and realloc. + Undefine the symbols, if they were defined by gnulib's + replacement. */ +#undef malloc +#undef realloc + /* Change the size of an allocated block of memory P to N bytes, with error checking. If N is zero, change it to 1. If P is NULL, use malloc. */ @@ -30,6 +54,9 @@ void * rpl_realloc (void *p, size_t n) { + void *result; + +#if NEED_REALLOC_GNU if (n == 0) { n = 1; @@ -38,8 +65,23 @@ rpl_realloc (void *p, size_t n) free (p); p = NULL; } +#endif if (p == NULL) - return malloc (n); - return realloc (p, n); + { +#if GNULIB_REALLOC_GNU && !NEED_REALLOC_GNU && !SYSTEM_MALLOC_GLIBC_COMPATIBLE + if (n == 0) + n = 1; +#endif + result = malloc (n); + } + else + result = realloc (p, n); + +#if !HAVE_REALLOC_POSIX + if (result == NULL) + errno = ENOMEM; +#endif + + return result; } diff --git a/src/bin/coreutils/lib/ref-add.sin b/src/bin/coreutils/lib/ref-add.sin index bc5cc7976f..222d752951 100644 --- a/src/bin/coreutils/lib/ref-add.sin +++ b/src/bin/coreutils/lib/ref-add.sin @@ -4,7 +4,7 @@ # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) +# the Free Software Foundation; either version 3, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, diff --git a/src/bin/coreutils/lib/ref-del.sin b/src/bin/coreutils/lib/ref-del.sin index e9301bf2ea..1bf073e15e 100644 --- a/src/bin/coreutils/lib/ref-del.sin +++ b/src/bin/coreutils/lib/ref-del.sin @@ -4,7 +4,7 @@ # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) +# the Free Software Foundation; either version 3, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, diff --git a/src/bin/coreutils/lib/regcomp.c b/src/bin/coreutils/lib/regcomp.c index fe4d243d54..20904f094e 100644 --- a/src/bin/coreutils/lib/regcomp.c +++ b/src/bin/coreutils/lib/regcomp.c @@ -1,11 +1,15 @@ +/* -*- buffer-read-only: t -*- vi: set ro: */ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 /* Extended regular expression matching and search library. - Copyright (C) 2002,2003,2004,2005,2006,2007 Free Software Foundation, Inc. + Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009 + Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Isamu Hasegawa . This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) + the Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -333,8 +337,8 @@ re_compile_fastmap_iter (regex_t *bufp, const re_dfastate_t *init_state, && dfa->nodes[node].mb_partial) *p++ = dfa->nodes[node].opr.c; memset (&state, '\0', sizeof (state)); - if (mbrtowc (&wc, (const char *) buf, p - buf, - &state) == p - buf + if (__mbrtowc (&wc, (const char *) buf, p - buf, + &state) == p - buf && (__wcrtomb ((char *) buf, towlower (wc), &state) != (size_t) -1)) re_set_fastmap (fastmap, false, buf[0]); @@ -356,45 +360,65 @@ re_compile_fastmap_iter (regex_t *bufp, const re_dfastate_t *init_state, #ifdef RE_ENABLE_I18N else if (type == COMPLEX_BRACKET) { - Idx i; re_charset_t *cset = dfa->nodes[node].opr.mbcset; - if (cset->non_match || cset->ncoll_syms || cset->nequiv_classes - || cset->nranges || cset->nchar_classes) - { + Idx i; + # ifdef _LIBC - if (_NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES) != 0) + /* See if we have to try all bytes which start multiple collation + elements. + e.g. In da_DK, we want to catch 'a' since "aa" is a valid + collation element, and don't catch 'b' since 'b' is + the only collation element which starts from 'b' (and + it is caught by SIMPLE_BRACKET). */ + if (_NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES) != 0 + && (cset->ncoll_syms || cset->nranges)) { - /* In this case we want to catch the bytes which are - the first byte of any collation elements. - e.g. In da_DK, we want to catch 'a' since "aa" - is a valid collation element, and don't catch - 'b' since 'b' is the only collation element - which starts from 'b'. */ const int32_t *table = (const int32_t *) _NL_CURRENT (LC_COLLATE, _NL_COLLATE_TABLEMB); for (i = 0; i < SBC_MAX; ++i) if (table[i] < 0) re_set_fastmap (fastmap, icase, i); } -# else - if (dfa->mb_cur_max > 1) - for (i = 0; i < SBC_MAX; ++i) - if (__btowc (i) == WEOF) - re_set_fastmap (fastmap, icase, i); -# endif /* not _LIBC */ - } - for (i = 0; i < cset->nmbchars; ++i) +# endif /* _LIBC */ + + /* See if we have to start the match at all multibyte characters, + i.e. where we would not find an invalid sequence. This only + applies to multibyte character sets; for single byte character + sets, the SIMPLE_BRACKET again suffices. */ + if (dfa->mb_cur_max > 1 + && (cset->nchar_classes || cset->non_match +# ifdef _LIBC + || cset->nequiv_classes +# endif /* _LIBC */ + )) { - char buf[256]; - mbstate_t state; - memset (&state, '\0', sizeof (state)); - if (__wcrtomb (buf, cset->mbchars[i], &state) != (size_t) -1) - re_set_fastmap (fastmap, icase, *(unsigned char *) buf); - if ((bufp->syntax & RE_ICASE) && dfa->mb_cur_max > 1) + unsigned char c = 0; + do { - if (__wcrtomb (buf, towlower (cset->mbchars[i]), &state) - != (size_t) -1) - re_set_fastmap (fastmap, false, *(unsigned char *) buf); + mbstate_t mbs; + memset (&mbs, 0, sizeof (mbs)); + if (__mbrtowc (NULL, (char *) &c, 1, &mbs) == (size_t) -2) + re_set_fastmap (fastmap, false, (int) c); + } + while (++c != 0); + } + + else + { + /* ... Else catch all bytes which can start the mbchars. */ + for (i = 0; i < cset->nmbchars; ++i) + { + char buf[256]; + mbstate_t state; + memset (&state, '\0', sizeof (state)); + if (__wcrtomb (buf, cset->mbchars[i], &state) != (size_t) -1) + re_set_fastmap (fastmap, icase, *(unsigned char *) buf); + if ((bufp->syntax & RE_ICASE) && dfa->mb_cur_max > 1) + { + if (__wcrtomb (buf, towlower (cset->mbchars[i]), &state) + != (size_t) -1) + re_set_fastmap (fastmap, false, *(unsigned char *) buf); + } } } } @@ -776,7 +800,7 @@ re_compile_internal (regex_t *preg, const char * pattern, size_t length, __libc_lock_init (dfa->lock); err = re_string_construct (®exp, pattern, length, preg->translate, - syntax & RE_ICASE, dfa); + (syntax & RE_ICASE) != 0, dfa); if (BE (err != REG_NOERROR, 0)) { re_compile_internal_free_return: @@ -1049,7 +1073,7 @@ optimize_utf8 (re_dfa_t *dfa) mb_chars = true; break; case ANCHOR: - switch (dfa->nodes[node].opr.idx) + switch (dfa->nodes[node].opr.ctx_type) { case LINE_FIRST: case LINE_LAST: @@ -1057,7 +1081,9 @@ optimize_utf8 (re_dfa_t *dfa) case BUF_LAST: break; default: - /* Word anchors etc. cannot be handled. */ + /* Word anchors etc. cannot be handled. It's okay to test + opr.ctx_type since constraints (for all DFA nodes) are + created by ORing one or more opr.ctx_type values. */ return; } break; @@ -1344,6 +1370,8 @@ calc_first (void *extra, bin_tree_t *node) node->node_idx = re_dfa_add_node (dfa, node->token); if (BE (node->node_idx == REG_MISSING, 0)) return REG_ESPACE; + if (node->token.type == ANCHOR) + dfa->nodes[node->node_idx].constraint = node->token.opr.ctx_type; } return REG_NOERROR; } @@ -1473,21 +1501,18 @@ duplicate_node_closure (re_dfa_t *dfa, Idx top_org_node, Idx top_clone_node, destination. */ org_dest = dfa->edests[org_node].elems[0]; re_node_set_empty (dfa->edests + clone_node); - if (dfa->nodes[org_node].type == ANCHOR) + clone_dest = search_duplicated_node (dfa, org_dest, constraint); + /* If the node is root_node itself, it means the epsilon closure + has a loop. Then tie it to the destination of the root_node. */ + if (org_node == root_node && clone_node != org_node) { - /* In case of the node has another constraint, append it. */ - if (org_node == root_node && clone_node != org_node) - { - /* ...but if the node is root_node itself, it means the - epsilon closure have a loop, then tie it to the - destination of the root_node. */ - ok = re_node_set_insert (dfa->edests + clone_node, org_dest); - if (BE (! ok, 0)) - return REG_ESPACE; - break; - } - constraint |= dfa->nodes[org_node].opr.ctx_type; + ok = re_node_set_insert (dfa->edests + clone_node, org_dest); + if (BE (! ok, 0)) + return REG_ESPACE; + break; } + /* In case the node has another constraint, append it. */ + constraint |= dfa->nodes[org_node].constraint; clone_dest = duplicate_node (dfa, org_dest, constraint); if (BE (clone_dest == REG_MISSING, 0)) return REG_ESPACE; @@ -1505,7 +1530,7 @@ duplicate_node_closure (re_dfa_t *dfa, Idx top_org_node, Idx top_clone_node, clone_dest = search_duplicated_node (dfa, org_dest, constraint); if (clone_dest == REG_MISSING) { - /* There are no such a duplicated node, create a new one. */ + /* There is no such duplicated node, create a new one. */ reg_errcode_t err; clone_dest = duplicate_node (dfa, org_dest, constraint); if (BE (clone_dest == REG_MISSING, 0)) @@ -1520,7 +1545,7 @@ duplicate_node_closure (re_dfa_t *dfa, Idx top_org_node, Idx top_clone_node, } else { - /* There are a duplicated node which satisfy the constraint, + /* There is a duplicated node which satisfy the constraint, use it to avoid infinite loop. */ ok = re_node_set_insert (dfa->edests + clone_node, clone_dest); if (BE (! ok, 0)) @@ -1569,8 +1594,7 @@ duplicate_node (re_dfa_t *dfa, Idx org_idx, unsigned int constraint) if (BE (dup_idx != REG_MISSING, 1)) { dfa->nodes[dup_idx].constraint = constraint; - if (dfa->nodes[org_idx].type == ANCHOR) - dfa->nodes[dup_idx].constraint |= dfa->nodes[org_idx].opr.ctx_type; + dfa->nodes[dup_idx].constraint |= dfa->nodes[org_idx].constraint; dfa->nodes[dup_idx].duplicated = 1; /* Store the index of the original node. */ @@ -1652,7 +1676,6 @@ static reg_errcode_t calc_eclosure_iter (re_node_set *new_set, re_dfa_t *dfa, Idx node, bool root) { reg_errcode_t err; - unsigned int constraint; Idx i; bool incomplete; bool ok; @@ -1666,15 +1689,14 @@ calc_eclosure_iter (re_node_set *new_set, re_dfa_t *dfa, Idx node, bool root) We reference this value to avoid infinite loop. */ dfa->eclosures[node].nelem = REG_MISSING; - constraint = ((dfa->nodes[node].type == ANCHOR) - ? dfa->nodes[node].opr.ctx_type : 0); - /* If the current node has constraints, duplicate all nodes. - Since they must inherit the constraints. */ - if (constraint + /* If the current node has constraints, duplicate all nodes + since they must inherit the constraints. */ + if (dfa->nodes[node].constraint && dfa->edests[node].nelem && !dfa->nodes[dfa->edests[node].elems[0]].duplicated) { - err = duplicate_node_closure (dfa, node, node, node, constraint); + err = duplicate_node_closure (dfa, node, node, node, + dfa->nodes[node].constraint); if (BE (err != REG_NOERROR, 0)) return err; } diff --git a/src/bin/coreutils/lib/regex.c b/src/bin/coreutils/lib/regex.c index d4eb726b29..822b925338 100644 --- a/src/bin/coreutils/lib/regex.c +++ b/src/bin/coreutils/lib/regex.c @@ -1,3 +1,6 @@ +/* -*- buffer-read-only: t -*- vi: set ro: */ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 /* Extended regular expression matching and search library. Copyright (C) 2002, 2003, 2005, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -5,7 +8,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) + the Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/src/bin/coreutils/lib/regex.h b/src/bin/coreutils/lib/regex.h index 7a79ca3724..40de1ff40a 100644 --- a/src/bin/coreutils/lib/regex.h +++ b/src/bin/coreutils/lib/regex.h @@ -1,3 +1,6 @@ +/* -*- buffer-read-only: t -*- vi: set ro: */ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 /* Definitions for data structures and routines for the regular expression library. Copyright (C) 1985,1989-93,1995-98,2000,2001,2002,2003,2005,2006 @@ -6,7 +9,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) + the Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/src/bin/coreutils/lib/regex_internal.c b/src/bin/coreutils/lib/regex_internal.c index 21298889a3..5b96537168 100644 --- a/src/bin/coreutils/lib/regex_internal.c +++ b/src/bin/coreutils/lib/regex_internal.c @@ -1,12 +1,15 @@ +/* -*- buffer-read-only: t -*- vi: set ro: */ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 /* Extended regular expression matching and search library. - Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Free Software - Foundation, Inc. + Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 + Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Isamu Hasegawa . This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) + the Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -236,7 +239,7 @@ build_wcs_buffer (re_string_t *pstr) } else p = (const char *) pstr->raw_mbs + pstr->raw_mbs_idx + byte_idx; - mbclen = mbrtowc (&wc, p, remain_len, &pstr->cur_state); + mbclen = __mbrtowc (&wc, p, remain_len, &pstr->cur_state); if (BE (mbclen == (size_t) -2, 0)) { /* The buffer doesn't have enough space, finish to build. */ @@ -306,9 +309,9 @@ build_wcs_upper_buffer (re_string_t *pstr) remain_len = end_idx - byte_idx; prev_st = pstr->cur_state; - mbclen = mbrtowc (&wc, - ((const char *) pstr->raw_mbs + pstr->raw_mbs_idx - + byte_idx), remain_len, &pstr->cur_state); + mbclen = __mbrtowc (&wc, + ((const char *) pstr->raw_mbs + pstr->raw_mbs_idx + + byte_idx), remain_len, &pstr->cur_state); if (BE (mbclen < (size_t) -2, 1)) { wchar_t wcu = wc; @@ -376,7 +379,7 @@ build_wcs_upper_buffer (re_string_t *pstr) } else p = (const char *) pstr->raw_mbs + pstr->raw_mbs_idx + src_idx; - mbclen = mbrtowc (&wc, p, remain_len, &pstr->cur_state); + mbclen = __mbrtowc (&wc, p, remain_len, &pstr->cur_state); if (BE (mbclen < (size_t) -2, 1)) { wchar_t wcu = wc; @@ -499,8 +502,8 @@ re_string_skip_chars (re_string_t *pstr, Idx new_raw_idx, wint_t *last_wc) Idx remain_len; remain_len = pstr->len - rawbuf_idx; prev_st = pstr->cur_state; - mbclen = mbrtowc (&wc2, (const char *) pstr->raw_mbs + rawbuf_idx, - remain_len, &pstr->cur_state); + mbclen = __mbrtowc (&wc2, (const char *) pstr->raw_mbs + rawbuf_idx, + remain_len, &pstr->cur_state); if (BE (mbclen == (size_t) -2 || mbclen == (size_t) -1 || mbclen == 0, 0)) { /* We treat these cases as a single byte character. */ @@ -687,10 +690,10 @@ re_string_reconstruct (re_string_t *pstr, Idx idx, int eflags) } else { +#ifdef RE_ENABLE_I18N /* No, skip all characters until IDX. */ Idx prev_valid_len = pstr->valid_len; -#ifdef RE_ENABLE_I18N if (BE (pstr->offsets_needed, 0)) { pstr->len = pstr->raw_len - idx + offset; @@ -745,8 +748,8 @@ re_string_reconstruct (re_string_t *pstr, Idx idx, int eflags) /* XXX Don't use mbrtowc, we know which conversion to use (UTF-8 -> UCS4). */ memset (&cur_state, 0, sizeof (cur_state)); - mbclen = mbrtowc (&wc2, (const char *) p, mlen, - &cur_state); + mbclen = __mbrtowc (&wc2, (const char *) p, mlen, + &cur_state); if (raw + offset - p <= mbclen && mbclen < (size_t) -2) { @@ -1689,11 +1692,9 @@ create_cd_newstate (const re_dfa_t *dfa, const re_node_set *nodes, for (i = 0 ; i < nodes->nelem ; i++) { - unsigned int constraint = 0; re_token_t *node = dfa->nodes + nodes->elems[i]; re_token_type_t type = node->type; - if (node->constraint) - constraint = node->constraint; + unsigned int constraint = node->constraint; if (type == CHARACTER && !constraint) continue; @@ -1706,8 +1707,6 @@ create_cd_newstate (const re_dfa_t *dfa, const re_node_set *nodes, newstate->halt = 1; else if (type == OP_BACK_REF) newstate->has_backref = 1; - else if (type == ANCHOR) - constraint = node->opr.ctx_type; if (constraint) { diff --git a/src/bin/coreutils/lib/regex_internal.h b/src/bin/coreutils/lib/regex_internal.h index 9bbc6ac3b9..397f4e4fbf 100644 --- a/src/bin/coreutils/lib/regex_internal.h +++ b/src/bin/coreutils/lib/regex_internal.h @@ -1,11 +1,15 @@ +/* -*- buffer-read-only: t -*- vi: set ro: */ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 /* Extended regular expression matching and search library. - Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. + Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 + Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Isamu Hasegawa . This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) + the Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -48,7 +52,7 @@ #endif /* In case that the system doesn't have isblank(). */ -#if !defined _LIBC && !HAVE_DECL_ISBLANK && !defined isblank +#if !defined _LIBC && ! (defined isblank || (HAVE_ISBLANK && HAVE_DECL_ISBLANK)) # define isblank(ch) ((ch) == ' ' || (ch) == '\t') #endif @@ -84,7 +88,7 @@ # define SIZE_MAX ((size_t) -1) #endif -#if (defined MB_CUR_MAX && HAVE_LOCALE_H && HAVE_WCTYPE_H && HAVE_ISWCTYPE && HAVE_WCRTOMB && HAVE_MBRTOWC && HAVE_WCSCOLL) || _LIBC +#if (defined MB_CUR_MAX && HAVE_LOCALE_H && HAVE_WCTYPE_H && HAVE_ISWCTYPE && HAVE_WCSCOLL) || _LIBC # define RE_ENABLE_I18N #endif @@ -115,6 +119,7 @@ # define __iswctype iswctype # define __btowc btowc # define __wcrtomb wcrtomb +# define __mbrtowc mbrtowc # define __regfree regfree # define attribute_hidden #endif /* not _LIBC */ @@ -161,9 +166,9 @@ typedef unsigned long int bitset_word_t; instead, deduce it directly from BITSET_WORD_MAX. Avoid greater-than-32-bit integers and unconditional shifts by more than 31 bits, as they're not portable. */ -#if BITSET_WORD_MAX == 0xffffffff +#if BITSET_WORD_MAX == 0xffffffffUL # define BITSET_WORD_BITS 32 -#elif BITSET_WORD_MAX >> 31 >> 5 == 1 +#elif BITSET_WORD_MAX >> 31 >> 4 == 1 # define BITSET_WORD_BITS 36 #elif BITSET_WORD_MAX >> 31 >> 16 == 1 # define BITSET_WORD_BITS 48 @@ -182,10 +187,6 @@ typedef unsigned long int bitset_word_t; # if BITSET_WORD_BITS <= SBC_MAX # error "Invalid SBC_MAX" # endif -#elif BITSET_WORD_MAX == (0xffffffff + 2) * 0xffffffff -/* Work around a bug in 64-bit PGC (before version 6.1-2), where the - preprocessor mishandles large unsigned values as if they were signed. */ -# define BITSET_WORD_BITS 64 #else # error "Add case for new bitset_word_t size" #endif @@ -421,7 +422,7 @@ struct re_dfa_t; typedef struct re_dfa_t re_dfa_t; #ifndef _LIBC -# ifdef __i386__ +# if defined __i386__ && !defined __EMX__ # define internal_function __attribute ((regparm (3), stdcall)) # else # define internal_function diff --git a/src/bin/coreutils/lib/regexec.c b/src/bin/coreutils/lib/regexec.c index cba5ea20e3..bc11bab41f 100644 --- a/src/bin/coreutils/lib/regexec.c +++ b/src/bin/coreutils/lib/regexec.c @@ -1,11 +1,15 @@ +/* -*- buffer-read-only: t -*- vi: set ro: */ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 /* Extended regular expression matching and search library. - Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. + Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 + Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Isamu Hasegawa . This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) + the Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -700,7 +704,8 @@ re_search_internal (const regex_t *preg, fl_longest_match = (nmatch != 0 || dfa->nbackref); err = re_string_allocate (&mctx.input, string, length, dfa->nodes_len + 1, - preg->translate, preg->syntax & RE_ICASE, dfa); + preg->translate, (preg->syntax & RE_ICASE) != 0, + dfa); if (BE (err != REG_NOERROR, 0)) goto free_return; mctx.input.stop = stop; @@ -1043,6 +1048,11 @@ prune_impossible_nodes (re_match_context_t *mctx) re_node_set_free (&sctx.limits); if (BE (ret != REG_NOERROR, 0)) goto free_return; + if (sifted_states[0] == NULL) + { + ret = REG_NOMATCH; + goto free_return; + } } re_free (mctx->state_log); mctx->state_log = sifted_states; @@ -2338,7 +2348,7 @@ transit_state (reg_errcode_t *err, re_match_context_t *mctx, } /* Update the state_log if we need */ -re_dfastate_t * +static re_dfastate_t * internal_function merge_state_with_log (reg_errcode_t *err, re_match_context_t *mctx, re_dfastate_t *next_state) @@ -3077,7 +3087,9 @@ check_arrival_add_next_nodes (re_match_context_t *mctx, Idx str_idx, const re_dfa_t *const dfa = mctx->dfa; bool ok; Idx cur_idx; +#ifdef RE_ENABLE_I18N reg_errcode_t err = REG_NOERROR; +#endif re_node_set union_set; re_node_set_init_empty (&union_set); for (cur_idx = 0; cur_idx < cur_nodes->nelem; ++cur_idx) @@ -3466,7 +3478,7 @@ out_free: CONTEXT_NEWLINE); if (BE (dest_states_nl[i] == NULL && err != REG_NOERROR, 0)) goto out_free; - } + } else { dest_states_word[i] = dest_states[i]; diff --git a/src/bin/coreutils/lib/rename-dest-slash.c b/src/bin/coreutils/lib/rename-dest-slash.c index e07ff9c913..80660768a1 100644 --- a/src/bin/coreutils/lib/rename-dest-slash.c +++ b/src/bin/coreutils/lib/rename-dest-slash.c @@ -8,10 +8,10 @@ Copyright (C) 2006 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -19,8 +19,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* written by Jim Meyering */ diff --git a/src/bin/coreutils/lib/rename.c b/src/bin/coreutils/lib/rename.c index 32d2b01317..b27fd9100d 100644 --- a/src/bin/coreutils/lib/rename.c +++ b/src/bin/coreutils/lib/rename.c @@ -1,13 +1,14 @@ -/* Work around the bug in some systems whereby rename fails when the source - file has a trailing slash. The rename functions of SunOS 4.1.1_U1 and - mips-dec-ultrix4.4 have this bug. +/* Work around rename bugs in some systems. On SunOS 4.1.1_U1 + and mips-dec-ultrix4.4, rename fails when the source file has + a trailing slash. On mingw, rename fails when the destination + exists. - Copyright (C) 2001, 2002, 2003, 2005, 2006 Free Software Foundation, Inc. + Copyright (C) 2001, 2002, 2003, 2005, 2006, 2009 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -15,14 +16,120 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* written by Volker Borchert */ #include #undef rename +#if RENAME_DEST_EXISTS_BUG +/* This replacement must come first, otherwise when cross + * compiling to Windows we will guess that it has the trailing + * slash bug and entirely miss this one. */ +#include + +#define WIN32_LEAN_AND_MEAN +#include + +/* Rename the file SRC to DST. This replacement is necessary on + Windows, on which the system rename function will not replace + an existing DST. */ +int +rpl_rename (char const *src, char const *dst) +{ + int error; + + /* MoveFileEx works if SRC is a directory without any flags, + but fails with MOVEFILE_REPLACE_EXISTING, so try without + flags first. */ + if (MoveFileEx (src, dst, 0)) + return 0; + + /* Retry with MOVEFILE_REPLACE_EXISTING if the move failed + * due to the destination already existing. */ + error = GetLastError (); + if (error == ERROR_FILE_EXISTS || error == ERROR_ALREADY_EXISTS) + { + if (MoveFileEx (src, dst, MOVEFILE_REPLACE_EXISTING)) + return 0; + + error = GetLastError (); + } + + switch (error) + { + case ERROR_FILE_NOT_FOUND: + case ERROR_PATH_NOT_FOUND: + case ERROR_BAD_PATHNAME: + case ERROR_DIRECTORY: + errno = ENOENT; + break; + + case ERROR_ACCESS_DENIED: + case ERROR_SHARING_VIOLATION: + errno = EACCES; + break; + + case ERROR_OUTOFMEMORY: + errno = ENOMEM; + break; + + case ERROR_CURRENT_DIRECTORY: + errno = EBUSY; + break; + + case ERROR_NOT_SAME_DEVICE: + errno = EXDEV; + break; + + case ERROR_WRITE_PROTECT: + errno = EROFS; + break; + + case ERROR_WRITE_FAULT: + case ERROR_READ_FAULT: + case ERROR_GEN_FAILURE: + errno = EIO; + break; + + case ERROR_HANDLE_DISK_FULL: + case ERROR_DISK_FULL: + case ERROR_DISK_TOO_FRAGMENTED: + errno = ENOSPC; + break; + + case ERROR_FILE_EXISTS: + case ERROR_ALREADY_EXISTS: + errno = EEXIST; + break; + + case ERROR_BUFFER_OVERFLOW: + case ERROR_FILENAME_EXCED_RANGE: + errno = ENAMETOOLONG; + break; + + case ERROR_INVALID_NAME: + case ERROR_DELETE_PENDING: + errno = EPERM; /* ? */ + break; + +#ifndef ERROR_FILE_TOO_LARGE +/* This value is documented but not defined in all versions of windows.h. */ +#define ERROR_FILE_TOO_LARGE 223 +#endif + case ERROR_FILE_TOO_LARGE: + errno = EFBIG; + break; + + default: + errno = EINVAL; + break; + } + + return -1; +} +#elif RENAME_TRAILING_SLASH_BUG #include #include #include @@ -55,3 +162,4 @@ rpl_rename (char const *src, char const *dst) return ret_val; } +#endif /* RENAME_TRAILING_SLASH_BUG */ diff --git a/src/bin/coreutils/lib/rmdir.c b/src/bin/coreutils/lib/rmdir.c index 1221f4fef4..113d13c714 100644 --- a/src/bin/coreutils/lib/rmdir.c +++ b/src/bin/coreutils/lib/rmdir.c @@ -3,10 +3,10 @@ Copyright (C) 1988, 1990, 1999, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ #include diff --git a/src/bin/coreutils/lib/root-dev-ino.c b/src/bin/coreutils/lib/root-dev-ino.c index 4c35d2f871..fc3ddffebd 100644 --- a/src/bin/coreutils/lib/root-dev-ino.c +++ b/src/bin/coreutils/lib/root-dev-ino.c @@ -1,12 +1,10 @@ -/* -*- buffer-read-only: t -*- vi: set ro: */ -/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ /* root-dev-ino.c -- get the device and inode numbers for `/'. Copyright (C) 2003, 2005, 2006 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Jim Meyering. */ diff --git a/src/bin/coreutils/lib/root-dev-ino.h b/src/bin/coreutils/lib/root-dev-ino.h index 3f9a407d3a..e1512f6822 100644 --- a/src/bin/coreutils/lib/root-dev-ino.h +++ b/src/bin/coreutils/lib/root-dev-ino.h @@ -1,13 +1,11 @@ -/* -*- buffer-read-only: t -*- vi: set ro: */ -/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ /* Root device and inode number checking. Copyright (C) 2003, 2006 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -15,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ #ifndef ROOT_DEV_INO_H # define ROOT_DEV_INO_H 1 diff --git a/src/bin/coreutils/lib/rpmatch.c b/src/bin/coreutils/lib/rpmatch.c index e5f79f8228..217e1710a2 100644 --- a/src/bin/coreutils/lib/rpmatch.c +++ b/src/bin/coreutils/lib/rpmatch.c @@ -1,13 +1,13 @@ /* Determine whether string value is affirmation or negative response according to current locale's data. - Copyright (C) 1996, 1998, 2000, 2002, 2003, 2006 Free Software + Copyright (C) 1996, 1998, 2000, 2002, 2003, 2006-2008 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -15,42 +15,107 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ #include -#include +/* Specification. */ #include +#include +#include + #if ENABLE_NLS # include # include +# include +# if HAVE_LANGINFO_YESEXPR +# include +# endif # include # include "gettext.h" # define _(msgid) gettext (msgid) +# define N_(msgid) gettext_noop (msgid) + +# if HAVE_LANGINFO_YESEXPR +/* Return the localized regular expression pattern corresponding to + ENGLISH_PATTERN. NL_INDEX can be used with nl_langinfo. + The resulting string may only be used until the next nl_langinfo call. */ +static const char * +localized_pattern (const char *english_pattern, nl_item nl_index, + bool posixly_correct) +{ + const char *translated_pattern; + + /* We prefer to get the patterns from a PO file. It would be possible to + always use nl_langinfo (YESEXPR) instead of _("^[yY]"), and + nl_langinfo (NOEXPR) instead of _("^[nN]"), if we could assume that the + system's locale support is good. But this is not the case e.g. on Cygwin. + The localizations of gnulib.pot are of better quality in general. + Also, if we use locale info from non-free systems that don't have a + 'localedef' command, we deprive the users of the freedom to localize + this pattern for their preferred language. + But some programs, such as 'cp', 'mv', 'rm', 'find', 'xargs', are + specified by POSIX to use nl_langinfo (YESEXPR). We implement this + behaviour if POSIXLY_CORRECT is set, for the sake of these programs. */ + + /* If the user wants strict POSIX compliance, use nl_langinfo. */ + if (posixly_correct) + { + translated_pattern = nl_langinfo (nl_index); + /* Check against a broken system return value. */ + if (translated_pattern != NULL && translated_pattern[0] != '\0') + return translated_pattern; + } + + /* Look in the gnulib message catalog. */ + translated_pattern = _(english_pattern); + if (translated_pattern == english_pattern) + { + /* The gnulib message catalog provides no translation. + Try the system's message catalog. */ + translated_pattern = nl_langinfo (nl_index); + /* Check against a broken system return value. */ + if (translated_pattern != NULL && translated_pattern[0] != '\0') + return translated_pattern; + /* Fall back to English. */ + translated_pattern = english_pattern; + } + return translated_pattern; +} +# else +# define localized_pattern(english_pattern,nl_index,posixly_correct) \ + _(english_pattern) +# endif static int -try (const char *response, const char *pattern, const int match, - const int nomatch, const char **lastp, regex_t *re) +try (const char *response, const char *pattern, char **lastp, regex_t *re) { - if (pattern != *lastp) + if (*lastp == NULL || strcmp (pattern, *lastp) != 0) { + char *safe_pattern; + /* The pattern has changed. */ - if (*lastp) + if (*lastp != NULL) { /* Free the old compiled pattern. */ regfree (re); + free (*lastp); *lastp = NULL; } - /* Compile the pattern and cache it for future runs. */ - if (regcomp (re, pattern, REG_EXTENDED) != 0) + /* Put the PATTERN into safe memory before calling regcomp. + (regcomp may call nl_langinfo, overwriting PATTERN's storage. */ + safe_pattern = strdup (pattern); + if (safe_pattern == NULL) return -1; - *lastp = pattern; + /* Compile the pattern and cache it for future runs. */ + if (regcomp (re, safe_pattern, REG_EXTENDED) != 0) + return -1; + *lastp = safe_pattern; } /* See if the regular expression matches RESPONSE. */ - return regexec (re, response, 0, NULL, 0) == 0 ? match : nomatch; + return regexec (re, response, 0, NULL, 0) == 0; } #endif @@ -63,14 +128,43 @@ rpmatch (const char *response) first if necessary. */ /* We cache the response patterns and compiled regexps here. */ - static const char *yesexpr, *noexpr; - static regex_t yesre, nore; + static char *last_yesexpr, *last_noexpr; + static regex_t cached_yesre, cached_nore; + +# if HAVE_LANGINFO_YESEXPR + bool posixly_correct = (getenv ("POSIXLY_CORRECT") != NULL); +# endif + + const char *yesexpr, *noexpr; int result; - return ((result = try (response, _("^[yY]"), 1, 0, - &yesexpr, &yesre)) - ? result - : try (response, _("^[nN]"), 0, -1, &noexpr, &nore)); + /* TRANSLATORS: A regular expression testing for an affirmative answer + (english: "yes"). Testing the first character may be sufficient. + Take care to consider upper and lower case. + To enquire the regular expression that your system uses for this + purpose, you can use the command + locale -k LC_MESSAGES | grep '^yesexpr=' */ + yesexpr = localized_pattern (N_("^[yY]"), YESEXPR, posixly_correct); + result = try (response, yesexpr, &last_yesexpr, &cached_yesre); + if (result < 0) + return -1; + if (result) + return 1; + + /* TRANSLATORS: A regular expression testing for a negative answer + (english: "no"). Testing the first character may be sufficient. + Take care to consider upper and lower case. + To enquire the regular expression that your system uses for this + purpose, you can use the command + locale -k LC_MESSAGES | grep '^noexpr=' */ + noexpr = localized_pattern (N_("^[nN]"), NOEXPR, posixly_correct); + result = try (response, noexpr, &last_noexpr, &cached_nore); + if (result < 0) + return -1; + if (result) + return 0; + + return -1; #else /* Test against "^[yY]" and "^[nN]", hardcoded to avoid requiring regex */ return (*response == 'y' || *response == 'Y' ? 1 diff --git a/src/bin/coreutils/lib/safe-read.c b/src/bin/coreutils/lib/safe-read.c index b7bf1d5cd6..0cb1edee8b 100644 --- a/src/bin/coreutils/lib/safe-read.c +++ b/src/bin/coreutils/lib/safe-read.c @@ -3,10 +3,10 @@ Copyright (C) 1993, 1994, 1998, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ #include diff --git a/src/bin/coreutils/lib/safe-read.h b/src/bin/coreutils/lib/safe-read.h index 3451955ad4..ba191713b6 100644 --- a/src/bin/coreutils/lib/safe-read.h +++ b/src/bin/coreutils/lib/safe-read.h @@ -1,10 +1,10 @@ /* An interface to read() that retries after interrupts. Copyright (C) 2002, 2006 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ #include diff --git a/src/bin/coreutils/lib/safe-write.c b/src/bin/coreutils/lib/safe-write.c index 4c375a6ca1..b644f7cff3 100644 --- a/src/bin/coreutils/lib/safe-write.c +++ b/src/bin/coreutils/lib/safe-write.c @@ -1,10 +1,10 @@ /* An interface to write that retries after interrupts. Copyright (C) 2002 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ #define SAFE_WRITE #include "safe-read.c" diff --git a/src/bin/coreutils/lib/safe-write.h b/src/bin/coreutils/lib/safe-write.h index c194636209..da036a97a1 100644 --- a/src/bin/coreutils/lib/safe-write.h +++ b/src/bin/coreutils/lib/safe-write.h @@ -1,10 +1,10 @@ /* An interface to write() that retries after interrupts. Copyright (C) 2002 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ #include diff --git a/src/bin/coreutils/lib/same-inode.h b/src/bin/coreutils/lib/same-inode.h index deca87b03b..063271174c 100644 --- a/src/bin/coreutils/lib/same-inode.h +++ b/src/bin/coreutils/lib/same-inode.h @@ -2,10 +2,10 @@ Copyright (C) 2006 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ #ifndef SAME_INODE_H # define SAME_INODE_H 1 diff --git a/src/bin/coreutils/lib/same.c b/src/bin/coreutils/lib/same.c index 11590c6832..af3a95efb7 100644 --- a/src/bin/coreutils/lib/same.c +++ b/src/bin/coreutils/lib/same.c @@ -3,10 +3,10 @@ Copyright (C) 1997, 1998, 1999, 2000, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* written by Jim Meyering */ diff --git a/src/bin/coreutils/lib/same.h b/src/bin/coreutils/lib/same.h index 9fc057957f..56e51cffc1 100644 --- a/src/bin/coreutils/lib/same.h +++ b/src/bin/coreutils/lib/same.h @@ -3,10 +3,10 @@ Copyright (C) 1997, 1998, 1999, 2000, 2003, 2004 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ #ifndef SAME_H_ # define SAME_H_ 1 diff --git a/src/bin/coreutils/lib/save-cwd.c b/src/bin/coreutils/lib/save-cwd.c index f07973a3ab..e158e8b6b2 100644 --- a/src/bin/coreutils/lib/save-cwd.c +++ b/src/bin/coreutils/lib/save-cwd.c @@ -3,10 +3,10 @@ Copyright (C) 1995, 1997, 1998, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Jim Meyering. */ @@ -98,6 +97,5 @@ free_cwd (struct saved_cwd *cwd) { if (cwd->desc >= 0) close (cwd->desc); - if (cwd->name) - free (cwd->name); + free (cwd->name); } diff --git a/src/bin/coreutils/lib/save-cwd.h b/src/bin/coreutils/lib/save-cwd.h index d646b5540b..e23eb725fd 100644 --- a/src/bin/coreutils/lib/save-cwd.h +++ b/src/bin/coreutils/lib/save-cwd.h @@ -2,10 +2,10 @@ Copyright (C) 1995, 1997, 1998, 2003 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Jim Meyering. */ diff --git a/src/bin/coreutils/lib/savedir.c b/src/bin/coreutils/lib/savedir.c index d930fb4af2..b837414335 100644 --- a/src/bin/coreutils/lib/savedir.c +++ b/src/bin/coreutils/lib/savedir.c @@ -3,10 +3,10 @@ Copyright (C) 1990, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by David MacKenzie . */ diff --git a/src/bin/coreutils/lib/savedir.h b/src/bin/coreutils/lib/savedir.h index 5b7bef9713..0c696415b8 100644 --- a/src/bin/coreutils/lib/savedir.h +++ b/src/bin/coreutils/lib/savedir.h @@ -2,10 +2,10 @@ Copyright (C) 1997, 1999, 2001, 2003, 2005 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by David MacKenzie . */ diff --git a/src/bin/coreutils/lib/savewd.c b/src/bin/coreutils/lib/savewd.c index 9af3085c97..c4893ef6f1 100644 --- a/src/bin/coreutils/lib/savewd.c +++ b/src/bin/coreutils/lib/savewd.c @@ -2,10 +2,10 @@ Copyright (C) 2006, 2007 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Paul Eggert. */ @@ -35,6 +34,9 @@ #include "dirname.h" #include "fcntl-safer.h" +#ifndef ESTALE +# define ESTALE -1 +#endif /* Save the working directory into *WD, if it hasn't been saved already. Return true if a child has been forked to do the real diff --git a/src/bin/coreutils/lib/savewd.h b/src/bin/coreutils/lib/savewd.h index 880b8f1770..0d293c941e 100644 --- a/src/bin/coreutils/lib/savewd.h +++ b/src/bin/coreutils/lib/savewd.h @@ -2,10 +2,10 @@ Copyright (C) 2006 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Paul Eggert. */ diff --git a/src/bin/coreutils/lib/se-context.in.h b/src/bin/coreutils/lib/se-context.in.h new file mode 100644 index 0000000000..5eb95af22c --- /dev/null +++ b/src/bin/coreutils/lib/se-context.in.h @@ -0,0 +1,26 @@ +#ifndef SELINUX_CONTEXT_H +# define SELINUX_CONTEXT_H + +# include + +typedef int context_t; +static inline context_t context_new (char const *s _UNUSED_PARAMETER_) + { errno = ENOTSUP; return 0; } +static inline char *context_str (context_t con _UNUSED_PARAMETER_) + { errno = ENOTSUP; return (void *) 0; } +static inline void context_free (context_t c _UNUSED_PARAMETER_) {} + +static inline int context_user_set (context_t sc _UNUSED_PARAMETER_, + char const *s _UNUSED_PARAMETER_) + { errno = ENOTSUP; return -1; } +static inline int context_role_set (context_t sc _UNUSED_PARAMETER_, + char const *s _UNUSED_PARAMETER_) + { errno = ENOTSUP; return -1; } +static inline int context_range_set (context_t sc _UNUSED_PARAMETER_, + char const *s _UNUSED_PARAMETER_) + { errno = ENOTSUP; return -1; } +static inline int context_type_set (context_t sc _UNUSED_PARAMETER_, + char const *s _UNUSED_PARAMETER_) + { errno = ENOTSUP; return -1; } + +#endif diff --git a/src/bin/coreutils/lib/se-selinux.in.h b/src/bin/coreutils/lib/se-selinux.in.h new file mode 100644 index 0000000000..25cbaaef7f --- /dev/null +++ b/src/bin/coreutils/lib/se-selinux.in.h @@ -0,0 +1,58 @@ +#ifndef SELINUX_SELINUX_H +# define SELINUX_SELINUX_H + +# include +# include + +typedef unsigned short security_class_t; +# define security_context_t char* +# define is_selinux_enabled() 0 + +static inline int getcon (security_context_t *con _UNUSED_PARAMETER_) + { errno = ENOTSUP; return -1; } +static inline void freecon (security_context_t con _UNUSED_PARAMETER_) {} + + +static inline int getfscreatecon (security_context_t *con _UNUSED_PARAMETER_) + { errno = ENOTSUP; return -1; } +static inline int setfscreatecon (security_context_t con _UNUSED_PARAMETER_) + { errno = ENOTSUP; return -1; } +static inline int matchpathcon (char const *s _UNUSED_PARAMETER_, + mode_t m _UNUSED_PARAMETER_, + security_context_t *con _UNUSED_PARAMETER_) + { errno = ENOTSUP; return -1; } +static inline int getfilecon (char const *s _UNUSED_PARAMETER_, + security_context_t *con _UNUSED_PARAMETER_) + { errno = ENOTSUP; return -1; } +static inline int lgetfilecon (char const *s _UNUSED_PARAMETER_, + security_context_t *con _UNUSED_PARAMETER_) + { errno = ENOTSUP; return -1; } +static inline int setfilecon (char const *s _UNUSED_PARAMETER_, + security_context_t con _UNUSED_PARAMETER_) + { errno = ENOTSUP; return -1; } +static inline int lsetfilecon (char const *s _UNUSED_PARAMETER_, + security_context_t con _UNUSED_PARAMETER_) + { errno = ENOTSUP; return -1; } +static inline int fsetfilecon (int fd _UNUSED_PARAMETER_, + security_context_t con _UNUSED_PARAMETER_) + { errno = ENOTSUP; return -1; } + +static inline int security_check_context + (security_context_t con _UNUSED_PARAMETER_) + { errno = ENOTSUP; return -1; } +static inline int security_check_context_raw + (security_context_t con _UNUSED_PARAMETER_) + { errno = ENOTSUP; return -1; } +static inline int setexeccon (security_context_t con _UNUSED_PARAMETER_) + { errno = ENOTSUP; return -1; } +static inline int security_compute_create + (security_context_t scon _UNUSED_PARAMETER_, + security_context_t tcon _UNUSED_PARAMETER_, + security_class_t tclass _UNUSED_PARAMETER_, + security_context_t *newcon _UNUSED_PARAMETER_) + { errno = ENOTSUP; return -1; } +static inline int matchpathcon_init_prefix + (char const *path _UNUSED_PARAMETER_, + char const *prefix _UNUSED_PARAMETER_) + { errno = ENOTSUP; return -1; } +#endif diff --git a/src/bin/coreutils/lib/select.c b/src/bin/coreutils/lib/select.c new file mode 100644 index 0000000000..8f30f9d231 --- /dev/null +++ b/src/bin/coreutils/lib/select.c @@ -0,0 +1,449 @@ +/* -*- buffer-read-only: t -*- vi: set ro: */ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 +/* Emulation for select(2) + Contributed by Paolo Bonzini. + + Copyright 2008-2009 Free Software Foundation, Inc. + + This file is part of gnulib. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + +#include +#include + +#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +/* Native Win32. */ + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +struct bitset { + unsigned char in[FD_SETSIZE / CHAR_BIT]; + unsigned char out[FD_SETSIZE / CHAR_BIT]; +}; + +/* Declare data structures for ntdll functions. */ +typedef struct _FILE_PIPE_LOCAL_INFORMATION { + ULONG NamedPipeType; + ULONG NamedPipeConfiguration; + ULONG MaximumInstances; + ULONG CurrentInstances; + ULONG InboundQuota; + ULONG ReadDataAvailable; + ULONG OutboundQuota; + ULONG WriteQuotaAvailable; + ULONG NamedPipeState; + ULONG NamedPipeEnd; +} FILE_PIPE_LOCAL_INFORMATION, *PFILE_PIPE_LOCAL_INFORMATION; + +typedef struct _IO_STATUS_BLOCK +{ + union { + DWORD Status; + PVOID Pointer; + } u; + ULONG_PTR Information; +} IO_STATUS_BLOCK, *PIO_STATUS_BLOCK; + +typedef enum _FILE_INFORMATION_CLASS { + FilePipeLocalInformation = 24 +} FILE_INFORMATION_CLASS, *PFILE_INFORMATION_CLASS; + +typedef DWORD (WINAPI *PNtQueryInformationFile) + (HANDLE, IO_STATUS_BLOCK *, VOID *, ULONG, FILE_INFORMATION_CLASS); + +#ifndef PIPE_BUF +#define PIPE_BUF 512 +#endif + +/* Compute output fd_sets for libc descriptor FD (whose Win32 handle is H). */ + +static int +win32_poll_handle (HANDLE h, int fd, struct bitset *rbits, struct bitset *wbits, + struct bitset *xbits) +{ + BOOL read, write, except; + int i, ret; + INPUT_RECORD *irbuffer; + DWORD avail, nbuffer; + BOOL bRet; + IO_STATUS_BLOCK iosb; + FILE_PIPE_LOCAL_INFORMATION fpli; + static PNtQueryInformationFile NtQueryInformationFile; + static BOOL once_only; + + read = write = except = FALSE; + switch (GetFileType (h)) + { + case FILE_TYPE_DISK: + read = TRUE; + write = TRUE; + break; + + case FILE_TYPE_PIPE: + if (!once_only) + { + NtQueryInformationFile = (PNtQueryInformationFile) + GetProcAddress (GetModuleHandle ("ntdll.dll"), + "NtQueryInformationFile"); + once_only = TRUE; + } + + if (PeekNamedPipe (h, NULL, 0, NULL, &avail, NULL) != 0) + { + if (avail) + read = TRUE; + } + + else + { + /* It was the write-end of the pipe. Check if it is writable. + If NtQueryInformationFile fails, optimistically assume the pipe is + writable. This could happen on Win9x, where NtQueryInformationFile + is not available, or if we inherit a pipe that doesn't permit + FILE_READ_ATTRIBUTES access on the write end (I think this should + not happen since WinXP SP2; WINE seems fine too). Otherwise, + ensure that enough space is available for atomic writes. */ + memset (&iosb, 0, sizeof (iosb)); + memset (&fpli, 0, sizeof (fpli)); + + if (!NtQueryInformationFile + || NtQueryInformationFile (h, &iosb, &fpli, sizeof (fpli), + FilePipeLocalInformation) + || fpli.WriteQuotaAvailable >= PIPE_BUF + || (fpli.OutboundQuota < PIPE_BUF && + fpli.WriteQuotaAvailable == fpli.OutboundQuota)) + write = TRUE; + } + break; + + case FILE_TYPE_CHAR: + ret = WaitForSingleObject (h, 0); + write = TRUE; + if (ret == WAIT_OBJECT_0) + { + nbuffer = avail = 0; + bRet = GetNumberOfConsoleInputEvents (h, &nbuffer); + if (!bRet || nbuffer == 0) + except = TRUE; + + irbuffer = (INPUT_RECORD *) alloca (nbuffer * sizeof (INPUT_RECORD)); + bRet = PeekConsoleInput (h, irbuffer, nbuffer, &avail); + if (!bRet || avail == 0) + except = TRUE; + + for (i = 0; i < avail; i++) + if (irbuffer[i].EventType == KEY_EVENT) + read = TRUE; + } + break; + + default: + ret = WaitForSingleObject (h, 0); + write = TRUE; + if (ret == WAIT_OBJECT_0) + read = TRUE; + + break; + } + + ret = 0; + if (read && (rbits->in[fd / CHAR_BIT] & (1 << (fd & (CHAR_BIT - 1))))) + { + rbits->out[fd / CHAR_BIT] |= (1 << (fd & (CHAR_BIT - 1))); + ret++; + } + + if (write && (wbits->in[fd / CHAR_BIT] & (1 << (fd & (CHAR_BIT - 1))))) + { + wbits->out[fd / CHAR_BIT] |= (1 << (fd & (CHAR_BIT - 1))); + ret++; + } + + if (except && (xbits->in[fd / CHAR_BIT] & (1 << (fd & (CHAR_BIT - 1))))) + { + xbits->out[fd / CHAR_BIT] |= (1 << (fd & (CHAR_BIT - 1))); + ret++; + } + + return ret; +} + +int +rpl_select (int nfds, fd_set *rfds, fd_set *wfds, fd_set *xfds, + struct timeval *timeout) +{ + static struct timeval tv0; + static HANDLE hEvent; + HANDLE h, handle_array[FD_SETSIZE + 2]; + fd_set handle_rfds, handle_wfds, handle_xfds; + struct bitset rbits, wbits, xbits; + unsigned char anyfds_in[FD_SETSIZE / CHAR_BIT]; + DWORD ret, wait_timeout, nhandles, nsock; + MSG msg; + int i, fd, rc; + + if (nfds > FD_SETSIZE) + nfds = FD_SETSIZE; + + if (!timeout) + wait_timeout = INFINITE; + else + { + wait_timeout = timeout->tv_sec + timeout->tv_usec / 1000; + + /* select is also used as a portable usleep. */ + if (!rfds && !wfds && !xfds) + { + Sleep (wait_timeout); + return 0; + } + } + + if (!hEvent) + hEvent = CreateEvent (NULL, FALSE, FALSE, NULL); + + handle_array[0] = hEvent; + nhandles = 1; + nsock = 0; + + /* Copy descriptors to bitsets. */ + memset (&rbits, 0, sizeof (rbits)); + memset (&wbits, 0, sizeof (wbits)); + memset (&xbits, 0, sizeof (xbits)); + memset (anyfds_in, 0, sizeof (anyfds_in)); + if (rfds) + for (i = 0; i < rfds->fd_count; i++) + { + fd = rfds->fd_array[i]; + rbits.in[fd / CHAR_BIT] |= 1 << (fd & (CHAR_BIT - 1)); + anyfds_in[fd / CHAR_BIT] |= 1 << (fd & (CHAR_BIT - 1)); + } + else + rfds = (fd_set *) alloca (sizeof (fd_set)); + + if (wfds) + for (i = 0; i < wfds->fd_count; i++) + { + fd = wfds->fd_array[i]; + wbits.in[fd / CHAR_BIT] |= 1 << (fd & (CHAR_BIT - 1)); + anyfds_in[fd / CHAR_BIT] |= 1 << (fd & (CHAR_BIT - 1)); + } + else + wfds = (fd_set *) alloca (sizeof (fd_set)); + + if (xfds) + for (i = 0; i < xfds->fd_count; i++) + { + fd = xfds->fd_array[i]; + xbits.in[fd / CHAR_BIT] |= 1 << (fd & (CHAR_BIT - 1)); + anyfds_in[fd / CHAR_BIT] |= 1 << (fd & (CHAR_BIT - 1)); + } + else + xfds = (fd_set *) alloca (sizeof (fd_set)); + + /* Zero all the fd_sets, including the application's. */ + FD_ZERO (rfds); + FD_ZERO (wfds); + FD_ZERO (xfds); + FD_ZERO (&handle_rfds); + FD_ZERO (&handle_wfds); + FD_ZERO (&handle_xfds); + + /* Classify handles. Create fd sets for sockets, poll the others. */ + for (i = 0; i < nfds; i++) + { + WSANETWORKEVENTS ev; + + if ((anyfds_in[i / CHAR_BIT] & (1 << (i & (CHAR_BIT - 1)))) == 0) + continue; + + h = (HANDLE) _get_osfhandle (i); + if (!h) + { + errno = EBADF; + return -1; + } + + /* Under Wine, it seems that getsockopt returns 0 for pipes too. + WSAEnumNetworkEvents instead distinguishes the two correctly. */ + ev.lNetworkEvents = 0xDEADBEEF; + WSAEnumNetworkEvents ((SOCKET) h, NULL, &ev); + if (ev.lNetworkEvents != 0xDEADBEEF) + { + int requested = FD_CLOSE; + + /* See above; socket handles are mapped onto select, but we + need to map descriptors to handles. */ + if (rbits.in[i / CHAR_BIT] & (1 << (i & (CHAR_BIT - 1)))) + { + requested |= FD_READ | FD_ACCEPT; + FD_SET ((SOCKET) h, rfds); + FD_SET ((SOCKET) h, &handle_rfds); + } + if (wbits.in[i / CHAR_BIT] & (1 << (i & (CHAR_BIT - 1)))) + { + requested |= FD_WRITE | FD_CONNECT; + FD_SET ((SOCKET) h, wfds); + FD_SET ((SOCKET) h, &handle_wfds); + } + if (xbits.in[i / CHAR_BIT] & (1 << (i & (CHAR_BIT - 1)))) + { + requested |= FD_OOB; + FD_SET ((SOCKET) h, xfds); + FD_SET ((SOCKET) h, &handle_xfds); + } + + WSAEventSelect ((SOCKET) h, hEvent, requested); + nsock++; + } + else + { + handle_array[nhandles++] = h; + + /* Poll now. If we get an event, do not wait below. */ + if (wait_timeout != 0 + && win32_poll_handle (h, i, &rbits, &wbits, &xbits)) + wait_timeout = 0; + } + } + + if (wait_timeout == 0 || nsock == 0) + rc = 0; + else + { + /* See if we need to wait in the loop below. If any select is ready, + do MsgWaitForMultipleObjects anyway to dispatch messages, but + no need to call select again. */ + rc = select (0, &handle_rfds, &handle_wfds, &handle_xfds, &tv0); + if (rc == 0) + { + /* Restore the fd_sets for the other select we do below. */ + memcpy (&handle_rfds, rfds, sizeof (fd_set)); + memcpy (&handle_wfds, wfds, sizeof (fd_set)); + memcpy (&handle_xfds, xfds, sizeof (fd_set)); + } + else + wait_timeout = 0; + } + + for (;;) + { + ret = MsgWaitForMultipleObjects (nhandles, handle_array, FALSE, + wait_timeout, QS_ALLINPUT); + + if (ret == WAIT_OBJECT_0 + nhandles) + { + /* new input of some other kind */ + BOOL bRet; + while ((bRet = PeekMessage (&msg, NULL, 0, 0, PM_REMOVE)) != 0) + { + TranslateMessage (&msg); + DispatchMessage (&msg); + } + } + else + break; + } + + /* If we haven't done it yet, check the status of the sockets. */ + if (rc == 0 && nsock > 0) + rc = select (0, &handle_rfds, &handle_wfds, &handle_xfds, &tv0); + + /* Now fill in the results. */ + FD_ZERO (rfds); + FD_ZERO (wfds); + FD_ZERO (xfds); + + /* Place a sentinel at the end of the array. */ + handle_array[nhandles] = NULL; + nhandles = 1; + for (i = 0; i < nfds; i++) + { + if ((anyfds_in[i / CHAR_BIT] & (1 << (i & (CHAR_BIT - 1)))) == 0) + continue; + + h = (HANDLE) _get_osfhandle (i); + if (h != handle_array[nhandles]) + { + /* Perform handle->descriptor mapping. Don't update rc, as these + results are counted in the return value of Winsock's select. */ + WSAEventSelect ((SOCKET) h, NULL, 0); + if (FD_ISSET (h, &handle_rfds)) + FD_SET (i, rfds); + if (FD_ISSET (h, &handle_wfds)) + FD_SET (i, wfds); + if (FD_ISSET (h, &handle_xfds)) + FD_SET (i, xfds); + } + else + { + /* Not a socket. */ + nhandles++; + win32_poll_handle (h, i, &rbits, &wbits, &xbits); + if (rbits.out[i / CHAR_BIT] & (1 << (i & (CHAR_BIT - 1)))) + { + rc++; + FD_SET (i, rfds); + } + if (wbits.out[i / CHAR_BIT] & (1 << (i & (CHAR_BIT - 1)))) + { + rc++; + FD_SET (i, wfds); + } + if (xbits.out[i / CHAR_BIT] & (1 << (i & (CHAR_BIT - 1)))) + { + rc++; + FD_SET (i, xfds); + } + } + } + + return rc; +} + +#else /* ! Native Win32. */ + +#include + +#undef select + +int +rpl_select (int nfds, fd_set *rfds, fd_set *wfds, fd_set *xfds, + struct timeval *timeout) +{ + /* Interix 3.5 has a bug: it does not support nfds == 0. */ + if (nfds == 0) + { + nfds = 1; + rfds = NULL; + wfds = NULL; + xfds = NULL; + } + return select (nfds, rfds, wfds, xfds, timeout); +} + +#endif diff --git a/src/bin/coreutils/lib/selinux-at.c b/src/bin/coreutils/lib/selinux-at.c new file mode 100644 index 0000000000..18e6b0f40e --- /dev/null +++ b/src/bin/coreutils/lib/selinux-at.c @@ -0,0 +1,88 @@ +/* openat-style fd-relative functions for SE Linux + Copyright (C) 2007, 2009 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* written by Jim Meyering */ + +#include + +#include "selinux-at.h" +#include "openat.h" + +#include +#include +#include +#include + +#include "dirname.h" /* solely for definition of IS_ABSOLUTE_FILE_NAME */ +#include "save-cwd.h" + +#include "openat-priv.h" + +#define AT_FUNC_NAME getfileconat +#define AT_FUNC_F1 getfilecon +#define AT_FUNC_F2 getfilecon +#define AT_FUNC_USE_F1_COND 1 +#define AT_FUNC_POST_FILE_PARAM_DECLS , security_context_t *con +#define AT_FUNC_POST_FILE_ARGS , con +#include "at-func.c" +#undef AT_FUNC_NAME +#undef AT_FUNC_F1 +#undef AT_FUNC_F2 +#undef AT_FUNC_USE_F1_COND +#undef AT_FUNC_POST_FILE_PARAM_DECLS +#undef AT_FUNC_POST_FILE_ARGS + +#define AT_FUNC_NAME lgetfileconat +#define AT_FUNC_F1 lgetfilecon +#define AT_FUNC_F2 lgetfilecon +#define AT_FUNC_USE_F1_COND 1 +#define AT_FUNC_POST_FILE_PARAM_DECLS , security_context_t *con +#define AT_FUNC_POST_FILE_ARGS , con +#include "at-func.c" +#undef AT_FUNC_NAME +#undef AT_FUNC_F1 +#undef AT_FUNC_F2 +#undef AT_FUNC_USE_F1_COND +#undef AT_FUNC_POST_FILE_PARAM_DECLS +#undef AT_FUNC_POST_FILE_ARGS + +#define AT_FUNC_NAME setfileconat +#define AT_FUNC_F1 setfilecon +#define AT_FUNC_F2 setfilecon +#define AT_FUNC_USE_F1_COND 1 +#define AT_FUNC_POST_FILE_PARAM_DECLS , security_context_t con +#define AT_FUNC_POST_FILE_ARGS , con +#include "at-func.c" +#undef AT_FUNC_NAME +#undef AT_FUNC_F1 +#undef AT_FUNC_F2 +#undef AT_FUNC_USE_F1_COND +#undef AT_FUNC_POST_FILE_PARAM_DECLS +#undef AT_FUNC_POST_FILE_ARGS + +#define AT_FUNC_NAME lsetfileconat +#define AT_FUNC_F1 lsetfilecon +#define AT_FUNC_F2 lsetfilecon +#define AT_FUNC_USE_F1_COND 1 +#define AT_FUNC_POST_FILE_PARAM_DECLS , security_context_t con +#define AT_FUNC_POST_FILE_ARGS , con +#include "at-func.c" +#undef AT_FUNC_NAME +#undef AT_FUNC_F1 +#undef AT_FUNC_F2 +#undef AT_FUNC_USE_F1_COND +#undef AT_FUNC_POST_FILE_PARAM_DECLS +#undef AT_FUNC_POST_FILE_ARGS diff --git a/src/bin/coreutils/lib/selinux-at.h b/src/bin/coreutils/lib/selinux-at.h new file mode 100644 index 0000000000..15dd19271d --- /dev/null +++ b/src/bin/coreutils/lib/selinux-at.h @@ -0,0 +1,23 @@ +/* Prototypes for openat-style fd-relative SELinux functions + Copyright (C) 2007 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#include +#include + +int getfileconat (int fd, char const *file, security_context_t *con); +int lgetfileconat (int fd, char const *file, security_context_t *con); +int setfileconat (int fd, char const *file, security_context_t con); +int lsetfileconat (int fd, char const *file, security_context_t con); diff --git a/src/bin/coreutils/lib/selinux/selinux.h b/src/bin/coreutils/lib/selinux/selinux.h new file mode 100644 index 0000000000..25cbaaef7f --- /dev/null +++ b/src/bin/coreutils/lib/selinux/selinux.h @@ -0,0 +1,58 @@ +#ifndef SELINUX_SELINUX_H +# define SELINUX_SELINUX_H + +# include +# include + +typedef unsigned short security_class_t; +# define security_context_t char* +# define is_selinux_enabled() 0 + +static inline int getcon (security_context_t *con _UNUSED_PARAMETER_) + { errno = ENOTSUP; return -1; } +static inline void freecon (security_context_t con _UNUSED_PARAMETER_) {} + + +static inline int getfscreatecon (security_context_t *con _UNUSED_PARAMETER_) + { errno = ENOTSUP; return -1; } +static inline int setfscreatecon (security_context_t con _UNUSED_PARAMETER_) + { errno = ENOTSUP; return -1; } +static inline int matchpathcon (char const *s _UNUSED_PARAMETER_, + mode_t m _UNUSED_PARAMETER_, + security_context_t *con _UNUSED_PARAMETER_) + { errno = ENOTSUP; return -1; } +static inline int getfilecon (char const *s _UNUSED_PARAMETER_, + security_context_t *con _UNUSED_PARAMETER_) + { errno = ENOTSUP; return -1; } +static inline int lgetfilecon (char const *s _UNUSED_PARAMETER_, + security_context_t *con _UNUSED_PARAMETER_) + { errno = ENOTSUP; return -1; } +static inline int setfilecon (char const *s _UNUSED_PARAMETER_, + security_context_t con _UNUSED_PARAMETER_) + { errno = ENOTSUP; return -1; } +static inline int lsetfilecon (char const *s _UNUSED_PARAMETER_, + security_context_t con _UNUSED_PARAMETER_) + { errno = ENOTSUP; return -1; } +static inline int fsetfilecon (int fd _UNUSED_PARAMETER_, + security_context_t con _UNUSED_PARAMETER_) + { errno = ENOTSUP; return -1; } + +static inline int security_check_context + (security_context_t con _UNUSED_PARAMETER_) + { errno = ENOTSUP; return -1; } +static inline int security_check_context_raw + (security_context_t con _UNUSED_PARAMETER_) + { errno = ENOTSUP; return -1; } +static inline int setexeccon (security_context_t con _UNUSED_PARAMETER_) + { errno = ENOTSUP; return -1; } +static inline int security_compute_create + (security_context_t scon _UNUSED_PARAMETER_, + security_context_t tcon _UNUSED_PARAMETER_, + security_class_t tclass _UNUSED_PARAMETER_, + security_context_t *newcon _UNUSED_PARAMETER_) + { errno = ENOTSUP; return -1; } +static inline int matchpathcon_init_prefix + (char const *path _UNUSED_PARAMETER_, + char const *prefix _UNUSED_PARAMETER_) + { errno = ENOTSUP; return -1; } +#endif diff --git a/src/bin/coreutils/lib/set-mode-acl.c b/src/bin/coreutils/lib/set-mode-acl.c new file mode 100644 index 0000000000..a24b9f348c --- /dev/null +++ b/src/bin/coreutils/lib/set-mode-acl.c @@ -0,0 +1,490 @@ +/* set-mode-acl.c - set access control list equivalent to a mode + + Copyright (C) 2002-2003, 2005-2009 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + + Written by Paul Eggert and Andreas Gruenbacher, and Bruno Haible. */ + +#include + +#include "acl.h" + +#include "acl-internal.h" + +#include "gettext.h" +#define _(msgid) gettext (msgid) + + +/* If DESC is a valid file descriptor use fchmod to change the + file's mode to MODE on systems that have fchown. On systems + that don't have fchown and if DESC is invalid, use chown on + NAME instead. + Return 0 if successful. Return -1 and set errno upon failure. */ + +int +chmod_or_fchmod (const char *name, int desc, mode_t mode) +{ + if (HAVE_FCHMOD && desc != -1) + return fchmod (desc, mode); + else + return chmod (name, mode); +} + +/* Set the access control lists of a file. If DESC is a valid file + descriptor, use file descriptor operations where available, else use + filename based operations on NAME. If access control lists are not + available, fchmod the target file to MODE. Also sets the + non-permission bits of the destination file (S_ISUID, S_ISGID, S_ISVTX) + to those from MODE if any are set. + Return 0 if successful. Return -1 and set errno upon failure. */ + +int +qset_acl (char const *name, int desc, mode_t mode) +{ +#if USE_ACL +# if HAVE_ACL_GET_FILE + /* POSIX 1003.1e draft 17 (abandoned) specific version. */ + /* Linux, FreeBSD, MacOS X, IRIX, Tru64 */ +# if MODE_INSIDE_ACL + /* Linux, FreeBSD, IRIX, Tru64 */ + + /* We must also have acl_from_text and acl_delete_def_file. + (acl_delete_def_file could be emulated with acl_init followed + by acl_set_file, but acl_set_file with an empty acl is + unspecified.) */ + +# ifndef HAVE_ACL_FROM_TEXT +# error Must have acl_from_text (see POSIX 1003.1e draft 17). +# endif +# ifndef HAVE_ACL_DELETE_DEF_FILE +# error Must have acl_delete_def_file (see POSIX 1003.1e draft 17). +# endif + + acl_t acl; + int ret; + + if (HAVE_ACL_FROM_MODE) /* Linux */ + { + acl = acl_from_mode (mode); + if (!acl) + return -1; + } + else /* FreeBSD, IRIX, Tru64 */ + { + /* If we were to create the ACL using the functions acl_init(), + acl_create_entry(), acl_set_tag_type(), acl_set_qualifier(), + acl_get_permset(), acl_clear_perm[s](), acl_add_perm(), we + would need to create a qualifier. I don't know how to do this. + So create it using acl_from_text(). */ + +# if HAVE_ACL_FREE_TEXT /* Tru64 */ + char acl_text[] = "u::---,g::---,o::---,"; +# else /* FreeBSD, IRIX */ + char acl_text[] = "u::---,g::---,o::---"; +# endif + + if (mode & S_IRUSR) acl_text[ 3] = 'r'; + if (mode & S_IWUSR) acl_text[ 4] = 'w'; + if (mode & S_IXUSR) acl_text[ 5] = 'x'; + if (mode & S_IRGRP) acl_text[10] = 'r'; + if (mode & S_IWGRP) acl_text[11] = 'w'; + if (mode & S_IXGRP) acl_text[12] = 'x'; + if (mode & S_IROTH) acl_text[17] = 'r'; + if (mode & S_IWOTH) acl_text[18] = 'w'; + if (mode & S_IXOTH) acl_text[19] = 'x'; + + acl = acl_from_text (acl_text); + if (!acl) + return -1; + } + if (HAVE_ACL_SET_FD && desc != -1) + ret = acl_set_fd (desc, acl); + else + ret = acl_set_file (name, ACL_TYPE_ACCESS, acl); + if (ret != 0) + { + int saved_errno = errno; + acl_free (acl); + + if (ACL_NOT_WELL_SUPPORTED (errno)) + return chmod_or_fchmod (name, desc, mode); + else + { + errno = saved_errno; + return -1; + } + } + else + acl_free (acl); + + if (S_ISDIR (mode) && acl_delete_def_file (name)) + return -1; + + if (mode & (S_ISUID | S_ISGID | S_ISVTX)) + { + /* We did not call chmod so far, so the special bits have not yet + been set. */ + return chmod_or_fchmod (name, desc, mode); + } + return 0; + +# else /* !MODE_INSIDE_ACL */ + /* MacOS X */ + +# if !HAVE_ACL_TYPE_EXTENDED +# error Must have ACL_TYPE_EXTENDED +# endif + + /* On MacOS X, acl_get_file (name, ACL_TYPE_ACCESS) + and acl_get_file (name, ACL_TYPE_DEFAULT) + always return NULL / EINVAL. You have to use + acl_get_file (name, ACL_TYPE_EXTENDED) + or acl_get_fd (open (name, ...)) + to retrieve an ACL. + On the other hand, + acl_set_file (name, ACL_TYPE_ACCESS, acl) + and acl_set_file (name, ACL_TYPE_DEFAULT, acl) + have the same effect as + acl_set_file (name, ACL_TYPE_EXTENDED, acl): + Each of these calls sets the file's ACL. */ + + acl_t acl; + int ret; + + /* Remove the ACL if the file has ACLs. */ + if (HAVE_ACL_GET_FD && desc != -1) + acl = acl_get_fd (desc); + else + acl = acl_get_file (name, ACL_TYPE_EXTENDED); + if (acl) + { + acl_free (acl); + + acl = acl_init (0); + if (acl) + { + if (HAVE_ACL_SET_FD && desc != -1) + ret = acl_set_fd (desc, acl); + else + ret = acl_set_file (name, ACL_TYPE_EXTENDED, acl); + if (ret != 0) + { + int saved_errno = errno; + + acl_free (acl); + + if (ACL_NOT_WELL_SUPPORTED (saved_errno)) + return chmod_or_fchmod (name, desc, mode); + else + { + errno = saved_errno; + return -1; + } + } + acl_free (acl); + } + } + + /* Since !MODE_INSIDE_ACL, we have to call chmod explicitly. */ + return chmod_or_fchmod (name, desc, mode); +# endif + +# elif HAVE_ACL && defined GETACLCNT /* Solaris, Cygwin, not HP-UX */ + +# if defined ACL_NO_TRIVIAL + /* Solaris 10 (newer version), which has additional API declared in + (acl_t) and implemented in libsec (acl_set, acl_trivial, + acl_fromtext, ...). */ + + acl_t *aclp; + char acl_text[] = "user::---,group::---,mask:---,other:---"; + int ret; + int saved_errno; + + if (mode & S_IRUSR) acl_text[ 6] = 'r'; + if (mode & S_IWUSR) acl_text[ 7] = 'w'; + if (mode & S_IXUSR) acl_text[ 8] = 'x'; + if (mode & S_IRGRP) acl_text[17] = acl_text[26] = 'r'; + if (mode & S_IWGRP) acl_text[18] = acl_text[27] = 'w'; + if (mode & S_IXGRP) acl_text[19] = acl_text[28] = 'x'; + if (mode & S_IROTH) acl_text[36] = 'r'; + if (mode & S_IWOTH) acl_text[37] = 'w'; + if (mode & S_IXOTH) acl_text[38] = 'x'; + + if (acl_fromtext (acl_text, &aclp) != 0) + { + errno = ENOMEM; + return -1; + } + + ret = (desc < 0 ? acl_set (name, aclp) : facl_set (desc, aclp)); + saved_errno = errno; + acl_free (aclp); + if (ret < 0) + { + if (saved_errno == ENOSYS) + return chmod_or_fchmod (name, desc, mode); + errno = saved_errno; + return -1; + } + + if (mode & (S_ISUID | S_ISGID | S_ISVTX)) + { + /* We did not call chmod so far, so the special bits have not yet + been set. */ + return chmod_or_fchmod (name, desc, mode); + } + return 0; + +# else /* Solaris, Cygwin, general case */ + +# ifdef ACE_GETACL + /* Solaris also has a different variant of ACLs, used in ZFS and NFSv4 + file systems (whereas the other ones are used in UFS file systems). */ + + /* The flags in the ace_t structure changed in a binary incompatible way + when ACL_NO_TRIVIAL etc. were introduced in version 1.15. + How to distinguish the two conventions at runtime? + We fetch the existing ACL. In the old convention, usually three ACEs have + a_flags = ACE_OWNER / ACE_GROUP / ACE_OTHER, in the range 0x0100..0x0400. + In the new convention, these values are not used. */ + int convention; + + { + int count; + ace_t *entries; + + for (;;) + { + if (desc != -1) + count = facl (desc, ACE_GETACLCNT, 0, NULL); + else + count = acl (name, ACE_GETACLCNT, 0, NULL); + if (count <= 0) + { + convention = -1; + break; + } + entries = (ace_t *) malloc (count * sizeof (ace_t)); + if (entries == NULL) + { + errno = ENOMEM; + return -1; + } + if ((desc != -1 + ? facl (desc, ACE_GETACL, count, entries) + : acl (name, ACE_GETACL, count, entries)) + == count) + { + int i; + + convention = 0; + for (i = 0; i < count; i++) + if (entries[i].a_flags & (ACE_OWNER | ACE_GROUP | ACE_OTHER)) + { + convention = 1; + break; + } + free (entries); + break; + } + /* Huh? The number of ACL entries changed since the last call. + Repeat. */ + free (entries); + } + } + + if (convention >= 0) + { + ace_t entries[3]; + int ret; + + if (convention) + { + /* Running on Solaris 10. */ + entries[0].a_type = ALLOW; + entries[0].a_flags = ACE_OWNER; + entries[0].a_who = 0; /* irrelevant */ + entries[0].a_access_mask = (mode >> 6) & 7; + entries[1].a_type = ALLOW; + entries[1].a_flags = ACE_GROUP; + entries[1].a_who = 0; /* irrelevant */ + entries[1].a_access_mask = (mode >> 3) & 7; + entries[2].a_type = ALLOW; + entries[2].a_flags = ACE_OTHER; + entries[2].a_who = 0; + entries[2].a_access_mask = mode & 7; + } + else + { + /* Running on Solaris 10 (newer version) or Solaris 11. */ + entries[0].a_type = ACE_ACCESS_ALLOWED_ACE_TYPE; + entries[0].a_flags = NEW_ACE_OWNER; + entries[0].a_who = 0; /* irrelevant */ + entries[0].a_access_mask = + (mode & 0400 ? NEW_ACE_READ_DATA : 0) + | (mode & 0200 ? NEW_ACE_WRITE_DATA : 0) + | (mode & 0100 ? NEW_ACE_EXECUTE : 0); + entries[1].a_type = ACE_ACCESS_ALLOWED_ACE_TYPE; + entries[1].a_flags = NEW_ACE_GROUP | NEW_ACE_IDENTIFIER_GROUP; + entries[1].a_who = 0; /* irrelevant */ + entries[1].a_access_mask = + (mode & 0040 ? NEW_ACE_READ_DATA : 0) + | (mode & 0020 ? NEW_ACE_WRITE_DATA : 0) + | (mode & 0010 ? NEW_ACE_EXECUTE : 0); + entries[2].a_type = ACE_ACCESS_ALLOWED_ACE_TYPE; + entries[2].a_flags = ACE_EVERYONE; + entries[2].a_who = 0; + entries[2].a_access_mask = + (mode & 0004 ? NEW_ACE_READ_DATA : 0) + | (mode & 0002 ? NEW_ACE_WRITE_DATA : 0) + | (mode & 0001 ? NEW_ACE_EXECUTE : 0); + } + if (desc != -1) + ret = facl (desc, ACE_SETACL, + sizeof (entries) / sizeof (ace_t), entries); + else + ret = acl (name, ACE_SETACL, + sizeof (entries) / sizeof (ace_t), entries); + if (ret < 0 && errno != EINVAL && errno != ENOTSUP) + { + if (errno == ENOSYS) + return chmod_or_fchmod (name, desc, mode); + return -1; + } + } +# endif + + { + aclent_t entries[3]; + int ret; + + entries[0].a_type = USER_OBJ; + entries[0].a_id = 0; /* irrelevant */ + entries[0].a_perm = (mode >> 6) & 7; + entries[1].a_type = GROUP_OBJ; + entries[1].a_id = 0; /* irrelevant */ + entries[1].a_perm = (mode >> 3) & 7; + entries[2].a_type = OTHER_OBJ; + entries[2].a_id = 0; + entries[2].a_perm = mode & 7; + + if (desc != -1) + ret = facl (desc, SETACL, sizeof (entries) / sizeof (aclent_t), entries); + else + ret = acl (name, SETACL, sizeof (entries) / sizeof (aclent_t), entries); + if (ret < 0) + { + if (errno == ENOSYS) + return chmod_or_fchmod (name, desc, mode); + return -1; + } + } + + if (!MODE_INSIDE_ACL || (mode & (S_ISUID | S_ISGID | S_ISVTX))) + { + /* We did not call chmod so far, so the special bits have not yet + been set. */ + return chmod_or_fchmod (name, desc, mode); + } + return 0; + +# endif + +# elif HAVE_GETACL /* HP-UX */ + + struct stat statbuf; + struct acl_entry entries[3]; + int ret; + + if (desc != -1) + ret = fstat (desc, &statbuf); + else + ret = stat (name, &statbuf); + if (ret < 0) + return -1; + + entries[0].uid = statbuf.st_uid; + entries[0].gid = ACL_NSGROUP; + entries[0].mode = (mode >> 6) & 7; + entries[1].uid = ACL_NSUSER; + entries[1].gid = statbuf.st_gid; + entries[1].mode = (mode >> 3) & 7; + entries[2].uid = ACL_NSUSER; + entries[2].gid = ACL_NSGROUP; + entries[2].mode = mode & 7; + + if (desc != -1) + ret = fsetacl (desc, sizeof (entries) / sizeof (struct acl_entry), entries); + else + ret = setacl (name, sizeof (entries) / sizeof (struct acl_entry), entries); + if (ret < 0) + { + if (errno == ENOSYS || errno == EOPNOTSUPP) + return chmod_or_fchmod (name, desc, mode); + return -1; + } + + if (mode & (S_ISUID | S_ISGID | S_ISVTX)) + { + /* We did not call chmod so far, so the special bits have not yet + been set. */ + return chmod_or_fchmod (name, desc, mode); + } + return 0; + +# elif HAVE_ACLX_GET && 0 /* AIX */ + + /* TODO: use aclx_fput or aclx_put, respectively */ + +# elif HAVE_STATACL /* older AIX */ + + union { struct acl a; char room[128]; } u; + int ret; + + u.a.acl_len = (char *) &u.a.acl_ext[0] - (char *) &u.a; /* no entries */ + u.a.acl_mode = mode & ~(S_IXACL | 0777); + u.a.u_access = (mode >> 6) & 7; + u.a.g_access = (mode >> 3) & 7; + u.a.o_access = mode & 7; + + if (desc != -1) + ret = fchacl (desc, &u.a, u.a.acl_len); + else + ret = chacl (name, &u.a, u.a.acl_len); + + if (ret < 0 && errno == ENOSYS) + return chmod_or_fchmod (name, desc, mode); + + return ret; + +# else /* Unknown flavor of ACLs */ + return chmod_or_fchmod (name, desc, mode); +# endif +#else /* !USE_ACL */ + return chmod_or_fchmod (name, desc, mode); +#endif +} + +/* As with qset_acl, but also output a diagnostic on failure. */ + +int +set_acl (char const *name, int desc, mode_t mode) +{ + int r = qset_acl (name, desc, mode); + if (r != 0) + error (0, errno, _("setting permissions for %s"), quote (name)); + return r; +} diff --git a/src/bin/coreutils/lib/setenv.c b/src/bin/coreutils/lib/setenv.c index c54c28d973..83b52b88b9 100644 --- a/src/bin/coreutils/lib/setenv.c +++ b/src/bin/coreutils/lib/setenv.c @@ -1,31 +1,32 @@ -/* Copyright (C) 1992,1995-1999,2000-2003,2005-2007 Free Software Foundation, Inc. +/* Copyright (C) 1992,1995-1999,2000-2003,2005-2008 Free Software Foundation, Inc. This file is part of the GNU C Library. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ #if !_LIBC # include #endif #include +/* Specification. */ +#include + #include #ifndef __set_errno # define __set_errno(ev) ((errno) = (ev)) #endif -#include #include #if _LIBC || HAVE_UNISTD_H # include @@ -34,14 +35,11 @@ #if _LIBC || !HAVE_SETENV #if !_LIBC -# include "allocsa.h" +# include "malloca.h" #endif #if !_LIBC # define __environ environ -# ifndef HAVE_ENVIRON_DECL -extern char **environ; -# endif #endif #if _LIBC @@ -162,7 +160,7 @@ __add_to_environ (const char *name, const char *value, const char *combined, __mempcpy (__mempcpy (__mempcpy (new_value, name, namelen), "=", 1), value, vallen); # else - new_value = (char *) allocsa (namelen + 1 + vallen); + new_value = (char *) malloca (namelen + 1 + vallen); if (new_value == NULL) { __set_errno (ENOMEM); @@ -182,7 +180,7 @@ __add_to_environ (const char *name, const char *value, const char *combined, if (new_environ[size] == NULL) { #if defined USE_TSEARCH && !defined _LIBC - freesa (new_value); + freea (new_value); #endif __set_errno (ENOMEM); UNLOCK; @@ -202,7 +200,7 @@ __add_to_environ (const char *name, const char *value, const char *combined, STORE_VALUE (new_environ[size]); } #if defined USE_TSEARCH && !defined _LIBC - freesa (new_value); + freea (new_value); #endif } @@ -230,7 +228,7 @@ __add_to_environ (const char *name, const char *value, const char *combined, __mempcpy (__mempcpy (__mempcpy (new_value, name, namelen), "=", 1), value, vallen); # else - new_value = allocsa (namelen + 1 + vallen); + new_value = malloca (namelen + 1 + vallen); if (new_value == NULL) { __set_errno (ENOMEM); @@ -250,7 +248,7 @@ __add_to_environ (const char *name, const char *value, const char *combined, if (np == NULL) { #if defined USE_TSEARCH && !defined _LIBC - freesa (new_value); + freea (new_value); #endif __set_errno (ENOMEM); UNLOCK; @@ -268,7 +266,7 @@ __add_to_environ (const char *name, const char *value, const char *combined, STORE_VALUE (np); } #if defined USE_TSEARCH && !defined _LIBC - freesa (new_value); + freea (new_value); #endif } diff --git a/src/bin/coreutils/lib/setenv.h b/src/bin/coreutils/lib/setenv.h deleted file mode 100644 index 92e7bbaf7f..0000000000 --- a/src/bin/coreutils/lib/setenv.h +++ /dev/null @@ -1,54 +0,0 @@ -/* Setting environment variables. - Copyright (C) 2001-2004, 2007 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ - -#if HAVE_SETENV || HAVE_UNSETENV - -/* Get setenv(), unsetenv() declarations. */ -# include - -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -#if !HAVE_SETENV - -/* Set NAME to VALUE in the environment. - If REPLACE is nonzero, overwrite an existing value. */ -extern int setenv (const char *name, const char *value, int replace); - -#endif - -#if HAVE_UNSETENV - -# if VOID_UNSETENV -/* On some systems, unsetenv() returns void. - This is the case for FreeBSD 4.8, NetBSD 1.6, OpenBSD 3.4. */ -# define unsetenv(name) ((unsetenv)(name), 0) -# endif - -#else - -/* Remove the variable NAME from the environment. */ -extern int unsetenv (const char *name); - -#endif - -#ifdef __cplusplus -} -#endif diff --git a/src/bin/coreutils/lib/settime.c b/src/bin/coreutils/lib/settime.c index 25e7e68e49..f565492681 100644 --- a/src/bin/coreutils/lib/settime.c +++ b/src/bin/coreutils/lib/settime.c @@ -3,10 +3,10 @@ Copyright (C) 2002, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Paul Eggert. */ diff --git a/src/bin/coreutils/lib/sha1.c b/src/bin/coreutils/lib/sha1.c index 035f898c71..b3368cd9ca 100644 --- a/src/bin/coreutils/lib/sha1.c +++ b/src/bin/coreutils/lib/sha1.c @@ -1,12 +1,15 @@ +/* -*- buffer-read-only: t -*- vi: set ro: */ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 /* sha1.c - Functions to compute SHA1 message digest of files or memory blocks according to the NIST specification FIPS-180-1. - Copyright (C) 2000, 2001, 2003, 2004, 2005, 2006 Free Software + Copyright (C) 2000, 2001, 2003, 2004, 2005, 2006, 2008 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2, or (at your option) any + Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -67,28 +70,32 @@ sha1_init_ctx (struct sha1_ctx *ctx) ctx->buflen = 0; } -/* Put result from CTX in first 20 bytes following RESBUF. The result - must be in little endian byte order. +/* Copy the 4 byte value from v into the memory location pointed to by *cp, + If your architecture allows unaligned access this is equivalent to + * (uint32_t *) cp = v */ +static inline void +set_uint32 (char *cp, uint32_t v) +{ + memcpy (cp, &v, sizeof v); +} - IMPORTANT: On some systems it is required that RESBUF is correctly - aligned for a 32-bit value. */ +/* Put result from CTX in first 20 bytes following RESBUF. The result + must be in little endian byte order. */ void * sha1_read_ctx (const struct sha1_ctx *ctx, void *resbuf) { - ((uint32_t *) resbuf)[0] = SWAP (ctx->A); - ((uint32_t *) resbuf)[1] = SWAP (ctx->B); - ((uint32_t *) resbuf)[2] = SWAP (ctx->C); - ((uint32_t *) resbuf)[3] = SWAP (ctx->D); - ((uint32_t *) resbuf)[4] = SWAP (ctx->E); + char *r = resbuf; + set_uint32 (r + 0 * sizeof ctx->A, SWAP (ctx->A)); + set_uint32 (r + 1 * sizeof ctx->B, SWAP (ctx->B)); + set_uint32 (r + 2 * sizeof ctx->C, SWAP (ctx->C)); + set_uint32 (r + 3 * sizeof ctx->D, SWAP (ctx->D)); + set_uint32 (r + 4 * sizeof ctx->E, SWAP (ctx->E)); return resbuf; } /* Process the remaining bytes in the internal buffer and the usual - prolog according to the standard and write the result to RESBUF. - - IMPORTANT: On some systems it is required that RESBUF is correctly - aligned for a 32-bit value. */ + prolog according to the standard and write the result to RESBUF. */ void * sha1_finish_ctx (struct sha1_ctx *ctx, void *resbuf) { diff --git a/src/bin/coreutils/lib/sha1.h b/src/bin/coreutils/lib/sha1.h index 9545f0b2be..9b2041cc3e 100644 --- a/src/bin/coreutils/lib/sha1.h +++ b/src/bin/coreutils/lib/sha1.h @@ -1,10 +1,14 @@ +/* -*- buffer-read-only: t -*- vi: set ro: */ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 /* Declarations of functions and data types used for SHA1 sum library functions. - Copyright (C) 2000, 2001, 2003, 2005, 2006 Free Software Foundation, Inc. + Copyright (C) 2000, 2001, 2003, 2005, 2006, 2008 + Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2, or (at your option) any + Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -22,6 +26,8 @@ # include # include +#define SHA1_DIGEST_SIZE 20 + /* Structure to save state of computation between the single steps. */ struct sha1_ctx { @@ -57,19 +63,13 @@ extern void sha1_process_bytes (const void *buffer, size_t len, /* Process the remaining bytes in the buffer and put result from CTX in first 20 bytes following RESBUF. The result is always in little endian byte order, so that a byte-wise output yields to the wanted - ASCII representation of the message digest. - - IMPORTANT: On some systems it is required that RESBUF be correctly - aligned for a 32 bits value. */ + ASCII representation of the message digest. */ extern void *sha1_finish_ctx (struct sha1_ctx *ctx, void *resbuf); /* Put result from CTX in first 20 bytes following RESBUF. The result is always in little endian byte order, so that a byte-wise output yields - to the wanted ASCII representation of the message digest. - - IMPORTANT: On some systems it is required that RESBUF is correctly - aligned for a 32 bits value. */ + to the wanted ASCII representation of the message digest. */ extern void *sha1_read_ctx (const struct sha1_ctx *ctx, void *resbuf); diff --git a/src/bin/coreutils/lib/sha256.c b/src/bin/coreutils/lib/sha256.c index d23c509dc3..0ad9444351 100644 --- a/src/bin/coreutils/lib/sha256.c +++ b/src/bin/coreutils/lib/sha256.c @@ -1,12 +1,12 @@ /* sha256.c - Functions to compute SHA256 and SHA224 message digest of files or memory blocks according to the NIST specification FIPS-180-2. - Copyright (C) 2005, 2006 Free Software Foundation, Inc. + Copyright (C) 2005, 2006, 2008 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2, or (at your option) any - later version. + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by David Madore, considerably copypasting from Scott G. Miller's sha1.c @@ -86,18 +85,25 @@ sha224_init_ctx (struct sha256_ctx *ctx) ctx->buflen = 0; } -/* Put result from CTX in first 32 bytes following RESBUF. The result - must be in little endian byte order. +/* Copy the value from v into the memory location pointed to by *cp, + If your architecture allows unaligned access this is equivalent to + * (uint32_t *) cp = v */ +static inline void +set_uint32 (char *cp, uint32_t v) +{ + memcpy (cp, &v, sizeof v); +} - IMPORTANT: On some systems it is required that RESBUF is correctly - aligned for a 32-bit value. */ +/* Put result from CTX in first 32 bytes following RESBUF. The result + must be in little endian byte order. */ void * sha256_read_ctx (const struct sha256_ctx *ctx, void *resbuf) { int i; + char *r = resbuf; for (i = 0; i < 8; i++) - ((uint32_t *) resbuf)[i] = SWAP (ctx->state[i]); + set_uint32 (r + i * sizeof ctx->state[0], SWAP (ctx->state[i])); return resbuf; } @@ -106,23 +112,21 @@ void * sha224_read_ctx (const struct sha256_ctx *ctx, void *resbuf) { int i; + char *r = resbuf; for (i = 0; i < 7; i++) - ((uint32_t *) resbuf)[i] = SWAP (ctx->state[i]); + set_uint32 (r + i * sizeof ctx->state[0], SWAP (ctx->state[i])); return resbuf; } /* Process the remaining bytes in the internal buffer and the usual - prolog according to the standard and write the result to RESBUF. - - IMPORTANT: On some systems it is required that RESBUF is correctly - aligned for a 32-bit value. */ + prolog according to the standard and write the result to RESBUF. */ static void sha256_conclude_ctx (struct sha256_ctx *ctx) { /* Take yet unprocessed bytes into account. */ - uint32_t bytes = ctx->buflen; + size_t bytes = ctx->buflen; size_t size = (bytes < 56) ? 64 / 4 : 64 * 2 / 4; /* Now count remaining bytes. */ @@ -130,9 +134,13 @@ sha256_conclude_ctx (struct sha256_ctx *ctx) if (ctx->total[0] < bytes) ++ctx->total[1]; - /* Put the 64-bit file length in *bits* at the end of the buffer. */ - ctx->buffer[size - 2] = SWAP ((ctx->total[1] << 3) | (ctx->total[0] >> 29)); - ctx->buffer[size - 1] = SWAP (ctx->total[0] << 3); + /* Put the 64-bit file length in *bits* at the end of the buffer. + Use set_uint32 rather than a simple assignment, to avoid risk of + unaligned access. */ + set_uint32 ((char *) &ctx->buffer[size - 2], + SWAP ((ctx->total[1] << 3) | (ctx->total[0] >> 29))); + set_uint32 ((char *) &ctx->buffer[size - 1], + SWAP (ctx->total[0] << 3)); memcpy (&((char *) ctx->buffer)[bytes], fillbuf, (size - 2) * 4 - bytes); diff --git a/src/bin/coreutils/lib/sha256.h b/src/bin/coreutils/lib/sha256.h index ccbe6cfd75..a63b2015d8 100644 --- a/src/bin/coreutils/lib/sha256.h +++ b/src/bin/coreutils/lib/sha256.h @@ -1,11 +1,11 @@ /* Declarations of functions and data types used for SHA256 and SHA224 sum library functions. - Copyright (C) 2005, 2006 Free Software Foundation, Inc. + Copyright (C) 2005, 2006, 2008 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2, or (at your option) any - later version. + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ #ifndef SHA256_H # define SHA256_H 1 @@ -28,10 +27,12 @@ struct sha256_ctx uint32_t state[8]; uint32_t total[2]; - uint32_t buflen; + size_t buflen; uint32_t buffer[32]; }; +enum { SHA224_DIGEST_SIZE = 224 / 8 }; +enum { SHA256_DIGEST_SIZE = 256 / 8 }; /* Initialize structure containing state of computation. */ extern void sha256_init_ctx (struct sha256_ctx *ctx); @@ -54,20 +55,14 @@ extern void sha256_process_bytes (const void *buffer, size_t len, /* Process the remaining bytes in the buffer and put result from CTX in first 32 (28) bytes following RESBUF. The result is always in little endian byte order, so that a byte-wise output yields to the wanted - ASCII representation of the message digest. - - IMPORTANT: On some systems it is required that RESBUF be correctly - aligned for a 32 bits value. */ + ASCII representation of the message digest. */ extern void *sha256_finish_ctx (struct sha256_ctx *ctx, void *resbuf); extern void *sha224_finish_ctx (struct sha256_ctx *ctx, void *resbuf); /* Put result from CTX in first 32 (28) bytes following RESBUF. The result is always in little endian byte order, so that a byte-wise output yields - to the wanted ASCII representation of the message digest. - - IMPORTANT: On some systems it is required that RESBUF is correctly - aligned for a 32 bits value. */ + to the wanted ASCII representation of the message digest. */ extern void *sha256_read_ctx (const struct sha256_ctx *ctx, void *resbuf); extern void *sha224_read_ctx (const struct sha256_ctx *ctx, void *resbuf); diff --git a/src/bin/coreutils/lib/sha512.c b/src/bin/coreutils/lib/sha512.c index e24c6f5a35..261a7bb02f 100644 --- a/src/bin/coreutils/lib/sha512.c +++ b/src/bin/coreutils/lib/sha512.c @@ -1,12 +1,12 @@ /* sha512.c - Functions to compute SHA512 and SHA384 message digest of files or memory blocks according to the NIST specification FIPS-180-2. - Copyright (C) 2005, 2006 Free Software Foundation, Inc. + Copyright (C) 2005, 2006, 2008 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2, or (at your option) any - later version. + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by David Madore, considerably copypasting from Scott G. Miller's sha1.c @@ -93,18 +92,25 @@ sha384_init_ctx (struct sha512_ctx *ctx) ctx->buflen = 0; } -/* Put result from CTX in first 64 bytes following RESBUF. The result - must be in little endian byte order. +/* Copy the value from V into the memory location pointed to by *CP, + If your architecture allows unaligned access, this is equivalent to + * (__typeof__ (v) *) cp = v */ +static inline void +set_uint64 (char *cp, u64 v) +{ + memcpy (cp, &v, sizeof v); +} - IMPORTANT: On some systems it is required that RESBUF is correctly - aligned for a 64-bit value. */ +/* Put result from CTX in first 64 bytes following RESBUF. + The result must be in little endian byte order. */ void * sha512_read_ctx (const struct sha512_ctx *ctx, void *resbuf) { int i; + char *r = resbuf; for (i = 0; i < 8; i++) - ((u64 *) resbuf)[i] = SWAP (ctx->state[i]); + set_uint64 (r + i * sizeof ctx->state[0], SWAP (ctx->state[i])); return resbuf; } @@ -113,18 +119,16 @@ void * sha384_read_ctx (const struct sha512_ctx *ctx, void *resbuf) { int i; + char *r = resbuf; for (i = 0; i < 6; i++) - ((u64 *) resbuf)[i] = SWAP (ctx->state[i]); + set_uint64 (r + i * sizeof ctx->state[0], SWAP (ctx->state[i])); return resbuf; } /* Process the remaining bytes in the internal buffer and the usual - prolog according to the standard and write the result to RESBUF. - - IMPORTANT: On some systems it is required that RESBUF is correctly - aligned for a 64-bit value. */ + prolog according to the standard and write the result to RESBUF. */ static void sha512_conclude_ctx (struct sha512_ctx *ctx) { @@ -137,10 +141,14 @@ sha512_conclude_ctx (struct sha512_ctx *ctx) if (u64lt (ctx->total[0], u64lo (bytes))) ctx->total[1] = u64plus (ctx->total[1], u64lo (1)); - /* Put the 64-bit file length in *bits* at the end of the buffer. */ - ctx->buffer[size - 2] = SWAP (u64or (u64shl (ctx->total[1], 3), - u64shr (ctx->total[0], 61))); - ctx->buffer[size - 1] = SWAP (u64shl (ctx->total[0], 3)); + /* Put the 128-bit file length in *bits* at the end of the buffer. + Use set_uint64 rather than a simple assignment, to avoid risk of + unaligned access. */ + set_uint64 ((char *) &ctx->buffer[size - 2], + SWAP (u64or (u64shl (ctx->total[1], 3), + u64shr (ctx->total[0], 61)))); + set_uint64 ((char *) &ctx->buffer[size - 1], + SWAP (u64shl (ctx->total[0], 3))); memcpy (&((char *) ctx->buffer)[bytes], fillbuf, (size - 2) * 8 - bytes); @@ -341,7 +349,7 @@ sha512_process_bytes (const void *buffer, size_t len, struct sha512_ctx *ctx) if (ctx->buflen > 128) { - sha512_process_block (ctx->buffer, ctx->buflen & ~63, ctx); + sha512_process_block (ctx->buffer, ctx->buflen & ~127, ctx); ctx->buflen &= 127; /* The regions in the following copy operation cannot overlap. */ diff --git a/src/bin/coreutils/lib/sha512.h b/src/bin/coreutils/lib/sha512.h index 995511e91e..ed12d545c2 100644 --- a/src/bin/coreutils/lib/sha512.h +++ b/src/bin/coreutils/lib/sha512.h @@ -1,11 +1,11 @@ /* Declarations of functions and data types used for SHA512 and SHA384 sum library functions. - Copyright (C) 2005, 2006 Free Software Foundation, Inc. + Copyright (C) 2005, 2006, 2008 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2, or (at your option) any - later version. + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ #ifndef SHA512_H # define SHA512_H 1 @@ -33,6 +32,8 @@ struct sha512_ctx u64 buffer[32]; }; +enum { SHA384_DIGEST_SIZE = 384 / 8 }; +enum { SHA512_DIGEST_SIZE = 512 / 8 }; /* Initialize structure containing state of computation. */ extern void sha512_init_ctx (struct sha512_ctx *ctx); @@ -55,10 +56,7 @@ extern void sha512_process_bytes (const void *buffer, size_t len, /* Process the remaining bytes in the buffer and put result from CTX in first 64 (48) bytes following RESBUF. The result is always in little endian byte order, so that a byte-wise output yields to the wanted - ASCII representation of the message digest. - - IMPORTANT: On some systems it is required that RESBUF be correctly - aligned for a 64 bits value. */ + ASCII representation of the message digest. */ extern void *sha512_finish_ctx (struct sha512_ctx *ctx, void *resbuf); extern void *sha384_finish_ctx (struct sha512_ctx *ctx, void *resbuf); diff --git a/src/bin/coreutils/lib/sig-handler.h b/src/bin/coreutils/lib/sig-handler.h new file mode 100644 index 0000000000..969f679023 --- /dev/null +++ b/src/bin/coreutils/lib/sig-handler.h @@ -0,0 +1,44 @@ +/* Convenience declarations when working with . + + Copyright (C) 2008 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#ifndef _GL_SIG_HANDLER_H +#define _GL_SIG_HANDLER_H + +#include + +/* Convenience type when working with signal handlers. */ +typedef void (*sa_handler_t) (int); + +/* Return the handler of a signal, as a sa_handler_t value regardless + of its true type. The resulting function can be compared to + special values like SIG_IGN but it is not portable to call it. */ +static inline sa_handler_t +get_handler (struct sigaction const *a) +{ +#ifdef SA_SIGINFO + /* POSIX says that special values like SIG_IGN can only occur when + action.sa_flags does not contain SA_SIGINFO. But in Linux 2.4, + for example, sa_sigaction and sa_handler are aliases and a signal + is ignored if sa_sigaction (after casting) equals SIG_IGN. So + use (and cast) sa_sigaction in that case. */ + if (a->sa_flags & SA_SIGINFO) + return (sa_handler_t) a->sa_sigaction; +#endif + return a->sa_handler; +} + +#endif /* _GL_SIG_HANDLER_H */ diff --git a/src/bin/coreutils/lib/sig2str.c b/src/bin/coreutils/lib/sig2str.c index cf2819daab..9252b28661 100644 --- a/src/bin/coreutils/lib/sig2str.c +++ b/src/bin/coreutils/lib/sig2str.c @@ -2,10 +2,10 @@ Copyright (C) 2002, 2004, 2006 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Paul Eggert. */ diff --git a/src/bin/coreutils/lib/sig2str.h b/src/bin/coreutils/lib/sig2str.h index f0fe9c3a11..05a522f478 100644 --- a/src/bin/coreutils/lib/sig2str.h +++ b/src/bin/coreutils/lib/sig2str.h @@ -2,10 +2,10 @@ Copyright (C) 2002, 2005 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Paul Eggert. */ diff --git a/src/bin/coreutils/lib/sigaction.c b/src/bin/coreutils/lib/sigaction.c new file mode 100644 index 0000000000..5fcd3ed9ad --- /dev/null +++ b/src/bin/coreutils/lib/sigaction.c @@ -0,0 +1,204 @@ +/* POSIX compatible signal blocking. + Copyright (C) 2008 Free Software Foundation, Inc. + Written by Eric Blake , 2008. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#include + +/* Specification. */ +#include + +#include +#include +#include + +/* This implementation of sigaction is tailored to Woe32 behavior: + signal() has SysV semantics (ie. the handler is uninstalled before + it is invoked). This is an inherent data race if an asynchronous + signal is sent twice in a row before we can reinstall our handler, + but there's nothing we can do about it. Meanwhile, sigprocmask() + is not present, and while we can use the gnulib replacement to + provide critical sections, it too suffers from potential data races + in the face of an ill-timed asynchronous signal. And we compound + the situation by reading static storage in a signal handler, which + POSIX warns is not generically async-signal-safe. Oh well. + + Additionally: + - We don't implement SA_NOCLDSTOP or SA_NOCLDWAIT, because SIGCHLD + is not defined. + - We don't implement SA_ONSTACK, because sigaltstack() is not present. + - We ignore SA_RESTART, because blocking Win32 calls are not interrupted + anyway when an asynchronous signal occurs, and the MSVCRT runtime + never sets errno to EINTR. + - We don't implement SA_SIGINFO because it is impossible to do so + portably. + + POSIX states that an application should not mix signal() and + sigaction(). We support the use of signal() within the gnulib + sigprocmask() substitute, but all other application code linked + with this module should stick with only sigaction(). */ + +/* Check some of our assumptions. */ +#if defined SIGCHLD || defined HAVE_SIGALTSTACK || defined HAVE_SIGINTERRUPT +# error "Revisit the assumptions made in the sigaction module" +#endif + +/* Out-of-range substitutes make a good fallback for uncatchable + signals. */ +#ifndef SIGKILL +# define SIGKILL (-1) +#endif +#ifndef SIGSTOP +# define SIGSTOP (-1) +#endif + +/* On native Windows, as of 2008, the signal SIGABRT_COMPAT is an alias + for the signal SIGABRT. Only one signal handler is stored for both + SIGABRT and SIGABRT_COMPAT. SIGABRT_COMPAT is not a signal of its own. */ +#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +# undef SIGABRT_COMPAT +# define SIGABRT_COMPAT 6 +#endif + +/* A signal handler. */ +typedef void (*handler_t) (int signal); + +/* Set of current actions. If sa_handler for an entry is NULL, then + that signal is not currently handled by the sigaction handler. */ +static struct sigaction volatile action_array[NSIG] /* = 0 */; + +/* Signal handler that is installed for signals. */ +static void +sigaction_handler (int sig) +{ + handler_t handler; + sigset_t mask; + sigset_t oldmask; + int saved_errno = errno; + if (sig < 0 || NSIG <= sig || !action_array[sig].sa_handler) + { + /* Unexpected situation; be careful to avoid recursive abort. */ + if (sig == SIGABRT) + signal (SIGABRT, SIG_DFL); + abort (); + } + + /* Reinstall the signal handler when required; otherwise update the + bookkeeping so that the user's handler may call sigaction and get + accurate results. We know the signal isn't currently blocked, or + we wouldn't be in its handler, therefore we know that we are not + interrupting a sigaction() call. There is a race where any + asynchronous instance of the same signal occurring before we + reinstall the handler will trigger the default handler; oh + well. */ + handler = action_array[sig].sa_handler; + if ((action_array[sig].sa_flags & SA_RESETHAND) == 0) + signal (sig, sigaction_handler); + else + action_array[sig].sa_handler = NULL; + + /* Block appropriate signals. */ + mask = action_array[sig].sa_mask; + if ((action_array[sig].sa_flags & SA_NODEFER) == 0) + sigaddset (&mask, sig); + sigprocmask (SIG_BLOCK, &mask, &oldmask); + + /* Invoke the user's handler, then restore prior mask. */ + errno = saved_errno; + handler (sig); + saved_errno = errno; + sigprocmask (SIG_SETMASK, &oldmask, NULL); + errno = saved_errno; +} + +/* Change and/or query the action that will be taken on delivery of + signal SIG. If not NULL, ACT describes the new behavior. If not + NULL, OACT is set to the prior behavior. Return 0 on success, or + set errno and return -1 on failure. */ +int +sigaction (int sig, const struct sigaction *restrict act, + struct sigaction *restrict oact) +{ + sigset_t mask; + sigset_t oldmask; + int saved_errno; + + if (sig < 0 || NSIG <= sig || sig == SIGKILL || sig == SIGSTOP + || (act && act->sa_handler == SIG_ERR)) + { + errno = EINVAL; + return -1; + } + + #ifdef SIGABRT_COMPAT + if (sig == SIGABRT_COMPAT) + sig = SIGABRT; + #endif + + /* POSIX requires sigaction() to be async-signal-safe. In other + words, if an asynchronous signal can occur while we are anywhere + inside this function, the user's handler could then call + sigaction() recursively and expect consistent results. We meet + this rule by using sigprocmask to block all signals before + modifying any data structure that could be read from a signal + handler; this works since we know that the gnulib sigprocmask + replacement does not try to use sigaction() from its handler. */ + if (!act && !oact) + return 0; + sigfillset (&mask); + sigprocmask (SIG_BLOCK, &mask, &oldmask); + if (oact) + { + if (action_array[sig].sa_handler) + *oact = action_array[sig]; + else + { + /* Safe to change the handler at will here, since all + signals are currently blocked. */ + oact->sa_handler = signal (sig, SIG_DFL); + if (oact->sa_handler == SIG_ERR) + goto failure; + signal (sig, oact->sa_handler); + oact->sa_flags = SA_RESETHAND | SA_NODEFER; + sigemptyset (&oact->sa_mask); + } + } + + if (act) + { + /* Safe to install the handler before updating action_array, + since all signals are currently blocked. */ + if (act->sa_handler == SIG_DFL || act->sa_handler == SIG_IGN) + { + if (signal (sig, act->sa_handler) == SIG_ERR) + goto failure; + action_array[sig].sa_handler = NULL; + } + else + { + if (signal (sig, sigaction_handler) == SIG_ERR) + goto failure; + action_array[sig] = *act; + } + } + sigprocmask (SIG_SETMASK, &oldmask, NULL); + return 0; + + failure: + saved_errno = errno; + sigprocmask (SIG_SETMASK, &oldmask, NULL); + errno = saved_errno; + return -1; +} diff --git a/src/bin/coreutils/lib/signal.in.h b/src/bin/coreutils/lib/signal.in.h new file mode 100644 index 0000000000..5c42fe9e26 --- /dev/null +++ b/src/bin/coreutils/lib/signal.in.h @@ -0,0 +1,202 @@ +/* A GNU-like . + + Copyright (C) 2006-2009 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +#endif + +#if defined __need_sig_atomic_t || defined __need_sigset_t +/* Special invocation convention inside glibc header files. */ + +# @INCLUDE_NEXT@ @NEXT_SIGNAL_H@ + +#else +/* Normal invocation convention. */ + +#ifndef _GL_SIGNAL_H + +/* The include_next requires a split double-inclusion guard. */ +#@INCLUDE_NEXT@ @NEXT_SIGNAL_H@ + +#ifndef _GL_SIGNAL_H +#define _GL_SIGNAL_H + +/* The definition of GL_LINK_WARNING is copied here. */ + +/* Define pid_t, uid_t. + Also, mingw defines sigset_t not in , but in . */ +#include + +/* On AIX, sig_atomic_t already includes volatile. C99 requires that + 'volatile sig_atomic_t' ignore the extra modifier, but C89 did not. + Hence, redefine this to a non-volatile type as needed. */ +#if ! @HAVE_TYPE_VOLATILE_SIG_ATOMIC_T@ +typedef int rpl_sig_atomic_t; +# undef sig_atomic_t +# define sig_atomic_t rpl_sig_atomic_t +#endif + +#ifdef __cplusplus +extern "C" { +#endif + + +#if @GNULIB_SIGNAL_H_SIGPIPE@ +# ifndef SIGPIPE +/* Define SIGPIPE to a value that does not overlap with other signals. */ +# define SIGPIPE 13 +# define GNULIB_defined_SIGPIPE 1 +/* To actually use SIGPIPE, you also need the gnulib modules 'sigprocmask', + 'write', 'stdio'. */ +# endif +#endif + + +#if !@HAVE_POSIX_SIGNALBLOCKING@ + +/* Maximum signal number + 1. */ +# ifndef NSIG +# define NSIG 32 +# endif + +/* This code supports only 32 signals. */ +typedef int verify_NSIG_constraint[2 * (NSIG <= 32) - 1]; + +/* A set or mask of signals. */ +# if !@HAVE_SIGSET_T@ +typedef unsigned int sigset_t; +# endif + +/* Test whether a given signal is contained in a signal set. */ +extern int sigismember (const sigset_t *set, int sig); + +/* Initialize a signal set to the empty set. */ +extern int sigemptyset (sigset_t *set); + +/* Add a signal to a signal set. */ +extern int sigaddset (sigset_t *set, int sig); + +/* Remove a signal from a signal set. */ +extern int sigdelset (sigset_t *set, int sig); + +/* Fill a signal set with all possible signals. */ +extern int sigfillset (sigset_t *set); + +/* Return the set of those blocked signals that are pending. */ +extern int sigpending (sigset_t *set); + +/* If OLD_SET is not NULL, put the current set of blocked signals in *OLD_SET. + Then, if SET is not NULL, affect the current set of blocked signals by + combining it with *SET as indicated in OPERATION. + In this implementation, you are not allowed to change a signal handler + while the signal is blocked. */ +# define SIG_BLOCK 0 /* blocked_set = blocked_set | *set; */ +# define SIG_SETMASK 1 /* blocked_set = *set; */ +# define SIG_UNBLOCK 2 /* blocked_set = blocked_set & ~*set; */ +extern int sigprocmask (int operation, const sigset_t *set, sigset_t *old_set); + +# define signal rpl_signal +/* Install the handler FUNC for signal SIG, and return the previous + handler. */ +extern void (*signal (int sig, void (*func) (int))) (int); + +# if GNULIB_defined_SIGPIPE + +/* Raise signal SIG. */ +# undef raise +# define raise rpl_raise +extern int raise (int sig); + +# endif + +#endif /* !@HAVE_POSIX_SIGNALBLOCKING@ */ + + +#if !@HAVE_SIGACTION@ + +# if !@HAVE_SIGINFO_T@ +/* Present to allow compilation, but unsupported by gnulib. */ +union sigval +{ + int sival_int; + void *sival_ptr; +}; + +/* Present to allow compilation, but unsupported by gnulib. */ +struct siginfo_t +{ + int si_signo; + int si_code; + int si_errno; + pid_t si_pid; + uid_t si_uid; + void *si_addr; + int si_status; + long si_band; + union sigval si_value; +}; +typedef struct siginfo_t siginfo_t; +# endif /* !@HAVE_SIGINFO_T@ */ + +/* We assume that platforms which lack the sigaction() function also lack + the 'struct sigaction' type, and vice versa. */ + +struct sigaction +{ + union + { + void (*_sa_handler) (int); + /* Present to allow compilation, but unsupported by gnulib. POSIX + says that implementations may, but not must, make sa_sigaction + overlap with sa_handler, but we know of no implementation where + they do not overlap. */ + void (*_sa_sigaction) (int, siginfo_t *, void *); + } _sa_func; + sigset_t sa_mask; + /* Not all POSIX flags are supported. */ + int sa_flags; +}; +# define sa_handler _sa_func._sa_handler +# define sa_sigaction _sa_func._sa_sigaction +/* Unsupported flags are not present. */ +# define SA_RESETHAND 1 +# define SA_NODEFER 2 +# define SA_RESTART 4 + +extern int sigaction (int, const struct sigaction *restrict, + struct sigaction *restrict); + +#elif !@HAVE_STRUCT_SIGACTION_SA_SIGACTION@ + +# define sa_sigaction sa_handler + +#endif /* !@HAVE_SIGACTION@, !@HAVE_STRUCT_SIGACTION_SA_SIGACTION@ */ + + +/* Some systems don't have SA_NODEFER. */ +#ifndef SA_NODEFER +# define SA_NODEFER 0 +#endif + + +#ifdef __cplusplus +} +#endif + +#endif /* _GL_SIGNAL_H */ +#endif /* _GL_SIGNAL_H */ +#endif diff --git a/src/bin/coreutils/lib/signbitd.c b/src/bin/coreutils/lib/signbitd.c new file mode 100644 index 0000000000..30f7e14709 --- /dev/null +++ b/src/bin/coreutils/lib/signbitd.c @@ -0,0 +1,64 @@ +/* signbit() macro: Determine the sign bit of a floating-point number. + Copyright (C) 2007-2009 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#include + +/* Specification. */ +#include + +#include +#include "isnand-nolibm.h" +#include "float+.h" + +#ifdef gl_signbitd_OPTIMIZED_MACRO +# undef gl_signbitd +#endif + +int +gl_signbitd (double arg) +{ +#if defined DBL_SIGNBIT_WORD && defined DBL_SIGNBIT_BIT + /* The use of a union to extract the bits of the representation of a + 'long double' is safe in practice, despite of the "aliasing rules" of + C99, because the GCC docs say + "Even with '-fstrict-aliasing', type-punning is allowed, provided the + memory is accessed through the union type." + and similarly for other compilers. */ +# define NWORDS \ + ((sizeof (double) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) + union { double value; unsigned int word[NWORDS]; } m; + m.value = arg; + return (m.word[DBL_SIGNBIT_WORD] >> DBL_SIGNBIT_BIT) & 1; +#elif HAVE_COPYSIGN_IN_LIBC + return copysign (1.0, arg) < 0; +#else + /* This does not do the right thing for NaN, but this is irrelevant for + most use cases. */ + if (isnand (arg)) + return 0; + if (arg < 0.0) + return 1; + else if (arg == 0.0) + { + /* Distinguish 0.0 and -0.0. */ + static double plus_zero = 0.0; + double arg_mem = arg; + return (memcmp (&plus_zero, &arg_mem, SIZEOF_DBL) != 0); + } + else + return 0; +#endif +} diff --git a/src/bin/coreutils/lib/signbitf.c b/src/bin/coreutils/lib/signbitf.c new file mode 100644 index 0000000000..c3d5545234 --- /dev/null +++ b/src/bin/coreutils/lib/signbitf.c @@ -0,0 +1,64 @@ +/* signbit() macro: Determine the sign bit of a floating-point number. + Copyright (C) 2007, 2009 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#include + +/* Specification. */ +#include + +#include +#include "isnanf-nolibm.h" +#include "float+.h" + +#ifdef gl_signbitf_OPTIMIZED_MACRO +# undef gl_signbitf +#endif + +int +gl_signbitf (float arg) +{ +#if defined FLT_SIGNBIT_WORD && defined FLT_SIGNBIT_BIT + /* The use of a union to extract the bits of the representation of a + 'long double' is safe in practice, despite of the "aliasing rules" of + C99, because the GCC docs say + "Even with '-fstrict-aliasing', type-punning is allowed, provided the + memory is accessed through the union type." + and similarly for other compilers. */ +# define NWORDS \ + ((sizeof (float) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) + union { float value; unsigned int word[NWORDS]; } m; + m.value = arg; + return (m.word[FLT_SIGNBIT_WORD] >> FLT_SIGNBIT_BIT) & 1; +#elif HAVE_COPYSIGNF_IN_LIBC + return copysignf (1.0f, arg) < 0; +#else + /* This does not do the right thing for NaN, but this is irrelevant for + most use cases. */ + if (isnanf (arg)) + return 0; + if (arg < 0.0f) + return 1; + else if (arg == 0.0f) + { + /* Distinguish 0.0f and -0.0f. */ + static float plus_zero = 0.0f; + float arg_mem = arg; + return (memcmp (&plus_zero, &arg_mem, SIZEOF_FLT) != 0); + } + else + return 0; +#endif +} diff --git a/src/bin/coreutils/lib/signbitl.c b/src/bin/coreutils/lib/signbitl.c new file mode 100644 index 0000000000..84d6493d8d --- /dev/null +++ b/src/bin/coreutils/lib/signbitl.c @@ -0,0 +1,64 @@ +/* signbit() macro: Determine the sign bit of a floating-point number. + Copyright (C) 2007, 2009 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#include + +/* Specification. */ +#include + +#include +#include "isnanl-nolibm.h" +#include "float+.h" + +#ifdef gl_signbitl_OPTIMIZED_MACRO +# undef gl_signbitl +#endif + +int +gl_signbitl (long double arg) +{ +#if defined LDBL_SIGNBIT_WORD && defined LDBL_SIGNBIT_BIT + /* The use of a union to extract the bits of the representation of a + 'long double' is safe in practice, despite of the "aliasing rules" of + C99, because the GCC docs say + "Even with '-fstrict-aliasing', type-punning is allowed, provided the + memory is accessed through the union type." + and similarly for other compilers. */ +# define NWORDS \ + ((sizeof (long double) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) + union { long double value; unsigned int word[NWORDS]; } m; + m.value = arg; + return (m.word[LDBL_SIGNBIT_WORD] >> LDBL_SIGNBIT_BIT) & 1; +#elif HAVE_COPYSIGNL_IN_LIBC + return copysignl (1.0L, arg) < 0; +#else + /* This does not do the right thing for NaN, but this is irrelevant for + most use cases. */ + if (isnanl (arg)) + return 0; + if (arg < 0.0L) + return 1; + else if (arg == 0.0L) + { + /* Distinguish 0.0L and -0.0L. */ + static long double plus_zero = 0.0L; + long double arg_mem = arg; + return (memcmp (&plus_zero, &arg_mem, SIZEOF_LDBL) != 0); + } + else + return 0; +#endif +} diff --git a/src/bin/coreutils/lib/sigprocmask.c b/src/bin/coreutils/lib/sigprocmask.c new file mode 100644 index 0000000000..7b486a2b04 --- /dev/null +++ b/src/bin/coreutils/lib/sigprocmask.c @@ -0,0 +1,329 @@ +/* POSIX compatible signal blocking. + Copyright (C) 2006-2008 Free Software Foundation, Inc. + Written by Bruno Haible , 2006. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#include + +/* Specification. */ +#include + +#include +#include +#include + +/* We assume that a platform without POSIX signal blocking functions + also does not have the POSIX sigaction() function, only the + signal() function. We also assume signal() has SysV semantics, + where any handler is uninstalled prior to being invoked. This is + true for Woe32 platforms. */ + +/* We use raw signal(), but also provide a wrapper rpl_signal() so + that applications can query or change a blocked signal. */ +#undef signal + +/* Provide invalid signal numbers as fallbacks if the uncatchable + signals are not defined. */ +#ifndef SIGKILL +# define SIGKILL (-1) +#endif +#ifndef SIGSTOP +# define SIGSTOP (-1) +#endif + +/* On native Windows, as of 2008, the signal SIGABRT_COMPAT is an alias + for the signal SIGABRT. Only one signal handler is stored for both + SIGABRT and SIGABRT_COMPAT. SIGABRT_COMPAT is not a signal of its own. */ +#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +# undef SIGABRT_COMPAT +# define SIGABRT_COMPAT 6 +#endif +#ifdef SIGABRT_COMPAT +# define SIGABRT_COMPAT_MASK (1U << SIGABRT_COMPAT) +#else +# define SIGABRT_COMPAT_MASK 0 +#endif + +typedef void (*handler_t) (int); + +/* Handling of gnulib defined signals. */ + +#if GNULIB_defined_SIGPIPE +static handler_t SIGPIPE_handler = SIG_DFL; +#endif + +#if GNULIB_defined_SIGPIPE +static handler_t +ext_signal (int sig, handler_t handler) +{ + switch (sig) + { + case SIGPIPE: + { + handler_t old_handler = SIGPIPE_handler; + SIGPIPE_handler = handler; + return old_handler; + } + default: /* System defined signal */ + return signal (sig, handler); + } +} +# define signal ext_signal +#endif + +int +sigismember (const sigset_t *set, int sig) +{ + if (sig >= 0 && sig < NSIG) + { + #ifdef SIGABRT_COMPAT + if (sig == SIGABRT_COMPAT) + sig = SIGABRT; + #endif + + return (*set >> sig) & 1; + } + else + return 0; +} + +int +sigemptyset (sigset_t *set) +{ + *set = 0; + return 0; +} + +int +sigaddset (sigset_t *set, int sig) +{ + if (sig >= 0 && sig < NSIG) + { + #ifdef SIGABRT_COMPAT + if (sig == SIGABRT_COMPAT) + sig = SIGABRT; + #endif + + *set |= 1U << sig; + return 0; + } + else + { + errno = EINVAL; + return -1; + } +} + +int +sigdelset (sigset_t *set, int sig) +{ + if (sig >= 0 && sig < NSIG) + { + #ifdef SIGABRT_COMPAT + if (sig == SIGABRT_COMPAT) + sig = SIGABRT; + #endif + + *set &= ~(1U << sig); + return 0; + } + else + { + errno = EINVAL; + return -1; + } +} + + +int +sigfillset (sigset_t *set) +{ + *set = ((2U << (NSIG - 1)) - 1) & ~ SIGABRT_COMPAT_MASK; + return 0; +} + +/* Set of currently blocked signals. */ +static volatile sigset_t blocked_set /* = 0 */; + +/* Set of currently blocked and pending signals. */ +static volatile sig_atomic_t pending_array[NSIG] /* = { 0 } */; + +/* Signal handler that is installed for blocked signals. */ +static void +blocked_handler (int sig) +{ + /* Reinstall the handler, in case the signal occurs multiple times + while blocked. There is an inherent race where an asynchronous + signal in between when the kernel uninstalled the handler and + when we reinstall it will trigger the default handler; oh + well. */ + signal (sig, blocked_handler); + if (sig >= 0 && sig < NSIG) + pending_array[sig] = 1; +} + +int +sigpending (sigset_t *set) +{ + sigset_t pending = 0; + int sig; + + for (sig = 0; sig < NSIG; sig++) + if (pending_array[sig]) + pending |= 1U << sig; + *set = pending; + return 0; +} + +/* The previous signal handlers. + Only the array elements corresponding to blocked signals are relevant. */ +static volatile handler_t old_handlers[NSIG]; + +int +sigprocmask (int operation, const sigset_t *set, sigset_t *old_set) +{ + if (old_set != NULL) + *old_set = blocked_set; + + if (set != NULL) + { + sigset_t new_blocked_set; + sigset_t to_unblock; + sigset_t to_block; + + switch (operation) + { + case SIG_BLOCK: + new_blocked_set = blocked_set | *set; + break; + case SIG_SETMASK: + new_blocked_set = *set; + break; + case SIG_UNBLOCK: + new_blocked_set = blocked_set & ~*set; + break; + default: + errno = EINVAL; + return -1; + } + to_unblock = blocked_set & ~new_blocked_set; + to_block = new_blocked_set & ~blocked_set; + + if (to_block != 0) + { + int sig; + + for (sig = 0; sig < NSIG; sig++) + if ((to_block >> sig) & 1) + { + pending_array[sig] = 0; + if ((old_handlers[sig] = signal (sig, blocked_handler)) != SIG_ERR) + blocked_set |= 1U << sig; + } + } + + if (to_unblock != 0) + { + sig_atomic_t received[NSIG]; + int sig; + + for (sig = 0; sig < NSIG; sig++) + if ((to_unblock >> sig) & 1) + { + if (signal (sig, old_handlers[sig]) != blocked_handler) + /* The application changed a signal handler while the signal + was blocked, bypassing our rpl_signal replacement. + We don't support this. */ + abort (); + received[sig] = pending_array[sig]; + blocked_set &= ~(1U << sig); + pending_array[sig] = 0; + } + else + received[sig] = 0; + + for (sig = 0; sig < NSIG; sig++) + if (received[sig]) + raise (sig); + } + } + return 0; +} + +/* Install the handler FUNC for signal SIG, and return the previous + handler. */ +handler_t +rpl_signal (int sig, handler_t handler) +{ + /* We must provide a wrapper, so that a user can query what handler + they installed even if that signal is currently blocked. */ + if (sig >= 0 && sig < NSIG && sig != SIGKILL && sig != SIGSTOP + && handler != SIG_ERR) + { + #ifdef SIGABRT_COMPAT + if (sig == SIGABRT_COMPAT) + sig = SIGABRT; + #endif + + if (blocked_set & (1U << sig)) + { + /* POSIX states that sigprocmask and signal are both + async-signal-safe. This is not true of our + implementation - there is a slight data race where an + asynchronous interrupt on signal A can occur after we + install blocked_handler but before we have updated + old_handlers for signal B, such that handler A can see + stale information if it calls signal(B). Oh well - + signal handlers really shouldn't try to manipulate the + installed handlers of unrelated signals. */ + handler_t result = old_handlers[sig]; + old_handlers[sig] = handler; + return result; + } + else + return signal (sig, handler); + } + else + { + errno = EINVAL; + return SIG_ERR; + } +} + +#if GNULIB_defined_SIGPIPE +/* Raise the signal SIG. */ +int +rpl_raise (int sig) +# undef raise +{ + switch (sig) + { + case SIGPIPE: + if (blocked_set & (1U << sig)) + pending_array[sig] = 1; + else + { + handler_t handler = SIGPIPE_handler; + if (handler == SIG_DFL) + exit (128 + SIGPIPE); + else if (handler != SIG_IGN) + (*handler) (sig); + } + return 0; + default: /* System defined signal */ + return raise (sig); + } +} +#endif diff --git a/src/bin/coreutils/lib/size_max.h b/src/bin/coreutils/lib/size_max.h new file mode 100644 index 0000000000..bdb3fff662 --- /dev/null +++ b/src/bin/coreutils/lib/size_max.h @@ -0,0 +1,34 @@ +/* -*- buffer-read-only: t -*- vi: set ro: */ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 +/* size_max.h -- declare SIZE_MAX through system headers + Copyright (C) 2005-2006 Free Software Foundation, Inc. + Written by Simon Josefsson. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + +#ifndef GNULIB_SIZE_MAX_H +#define GNULIB_SIZE_MAX_H + +/* Get SIZE_MAX declaration on systems like Solaris 7/8/9. */ +# include +/* Get SIZE_MAX declaration on systems like glibc 2. */ +# if HAVE_STDINT_H +# include +# endif +/* On systems where these include files don't define it, SIZE_MAX is defined + in config.h. */ + +#endif /* GNULIB_SIZE_MAX_H */ diff --git a/src/bin/coreutils/lib/snprintf.c b/src/bin/coreutils/lib/snprintf.c index 7314c83a3e..b74323682e 100644 --- a/src/bin/coreutils/lib/snprintf.c +++ b/src/bin/coreutils/lib/snprintf.c @@ -1,10 +1,13 @@ +/* -*- buffer-read-only: t -*- vi: set ro: */ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 /* Formatted output to strings. - Copyright (C) 2004, 2006-2007 Free Software Foundation, Inc. + Copyright (C) 2004, 2006-2008 Free Software Foundation, Inc. Written by Simon Josefsson and Paul Eggert. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) + the Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -29,11 +32,6 @@ #include "vasnprintf.h" -/* Some systems, like OSF/1 4.0 and Woe32, don't have EOVERFLOW. */ -#ifndef EOVERFLOW -# define EOVERFLOW E2BIG -#endif - /* Print formatted output to string STR. Similar to sprintf, but additional length SIZE limit how much is written into STR. Returns string length of formatted string (which may be larger than SIZE). diff --git a/src/bin/coreutils/lib/socket_.h b/src/bin/coreutils/lib/socket_.h deleted file mode 100644 index 623c98c2f1..0000000000 --- a/src/bin/coreutils/lib/socket_.h +++ /dev/null @@ -1,85 +0,0 @@ -/* Provide a sys/socket header file for systems lacking it (read: MinGW). - Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc. - Written by Simon Josefsson. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ - -#ifndef _GL_SYS_SOCKET_H -#define _GL_SYS_SOCKET_H - -/* This file is supposed to be used on platforms that lack - and on platforms where cannot be included standalone. - It is intended to provide definitions and prototypes needed by an - application. */ - -#if @HAVE_SYS_SOCKET_H@ - -/* On many platforms, assumes prior inclusion of - . */ - -# include -# include @ABSOLUTE_SYS_SOCKET_H@ - -#else - -/* A platform that lacks . - - Currently only MinGW is supported. See the gnulib manual regarding - Windows sockets. MinGW has the header files winsock2.h and - ws2tcpip.h that declare the sys/socket.h definitions we need. Note - that you can influence which definitions you get by setting the - WINVER symbol before including these two files. For example, - getaddrinfo is only available if _WIN32_WINNT >= 0x0501 (that - symbol is set indiriectly through WINVER). You can set this by - adding AC_DEFINE(WINVER, 0x0501) to configure.ac. Note that your - code may not run on older Windows releases then. My Windows 2000 - box was not able to run the code, for example. The situation is - slightly confusing because: - http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winsock/winsock/getaddrinfo_2.asp - suggests that getaddrinfo should be available on all Windows - releases. */ - - -# if @HAVE_WINSOCK2_H@ -# include -# endif -# if @HAVE_WS2TCPIP_H@ -# include -# endif - -/* For shutdown(). */ -# if !defined SHUT_RD && defined SD_RECEIVE -# define SHUT_RD SD_RECEIVE -# endif -# if !defined SHUT_WR && defined SD_SEND -# define SHUT_WR SD_SEND -# endif -# if !defined SHUT_RDWR && defined SD_BOTH -# define SHUT_RDWR SD_BOTH -# endif - -# if defined _WIN32 || defined __WIN32__ -# define ENOTSOCK WSAENOTSOCK -# define EADDRINUSE WSAEADDRINUSE -# define ENETRESET WSAENETRESET -# define ECONNABORTED WSAECONNABORTED -# define ECONNRESET WSAECONNRESET -# define ENOTCONN WSAENOTCONN -# define ESHUTDOWN WSAESHUTDOWN -# endif - -#endif /* HAVE_SYS_SOCKET_H */ - -#endif /* _GL_SYS_SOCKET_H */ diff --git a/src/bin/coreutils/lib/stat-time.h b/src/bin/coreutils/lib/stat-time.h index 5fd18c1fac..8957ab4608 100644 --- a/src/bin/coreutils/lib/stat-time.h +++ b/src/bin/coreutils/lib/stat-time.h @@ -2,10 +2,10 @@ Copyright (C) 2005, 2007 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,21 +13,22 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Paul Eggert. */ #ifndef STAT_TIME_H #define STAT_TIME_H 1 +#include #include /* STAT_TIMESPEC (ST, ST_XTIM) is the ST_XTIM member for *ST of type struct timespec, if available. If not, then STAT_TIMESPEC_NS (ST, ST_XTIM) is the nanosecond component of the ST_XTIM member for *ST, - if available. ST_XTIM can be st_atim, st_ctim, or st_mtim for - access, status change, or data modification time, respectively. + if available. ST_XTIM can be st_atim, st_ctim, st_mtim, or st_birthtim + for access, status change, data modification, or birth (creation) + time respectively. These macros are private to stat-time.h. */ #if defined HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC @@ -52,8 +53,6 @@ get_stat_atime_ns (struct stat const *st) return STAT_TIMESPEC (st, st_atim).tv_nsec; # elif defined STAT_TIMESPEC_NS return STAT_TIMESPEC_NS (st, st_atim); -# elif defined HAVE_STRUCT_STAT_ST_SPARE1 - return st->st_spare1 * 1000; # else return 0; # endif @@ -67,8 +66,6 @@ get_stat_ctime_ns (struct stat const *st) return STAT_TIMESPEC (st, st_ctim).tv_nsec; # elif defined STAT_TIMESPEC_NS return STAT_TIMESPEC_NS (st, st_ctim); -# elif defined HAVE_STRUCT_STAT_ST_SPARE1 - return st->st_spare3 * 1000; # else return 0; # endif @@ -82,13 +79,26 @@ get_stat_mtime_ns (struct stat const *st) return STAT_TIMESPEC (st, st_mtim).tv_nsec; # elif defined STAT_TIMESPEC_NS return STAT_TIMESPEC_NS (st, st_mtim); -# elif defined HAVE_STRUCT_STAT_ST_SPARE1 - return st->st_spare2 * 1000; # else return 0; # endif } +/* Return the nanosecond component of *ST's birth time. */ +static inline long int +get_stat_birthtime_ns (struct stat const *st) +{ +# if defined HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC + return STAT_TIMESPEC (st, st_birthtim).tv_nsec; +# elif defined HAVE_STRUCT_STAT_ST_BIRTHTIMENSEC + return STAT_TIMESPEC_NS (st, st_birthtim); +# else + /* Avoid a "parameter unused" warning. */ + (void) st; + return 0; +# endif +} + /* Return *ST's access time. */ static inline struct timespec get_stat_atime (struct stat const *st) @@ -131,4 +141,47 @@ get_stat_mtime (struct stat const *st) #endif } +/* Return *ST's birth time, if available; otherwise return a value + with negative tv_nsec. */ +static inline struct timespec +get_stat_birthtime (struct stat const *st) +{ + struct timespec t; + +#if (defined HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC \ + || defined HAVE_STRUCT_STAT_ST_BIRTHTIM_TV_NSEC) + t = STAT_TIMESPEC (st, st_birthtim); +#elif defined HAVE_STRUCT_STAT_ST_BIRTHTIMENSEC + t.tv_sec = st->st_birthtime; + t.tv_nsec = st->st_birthtimensec; +#elif (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ + /* Woe32 native platforms (but not Cygwin) put the "file creation + time" in st_ctime (!). See + . */ + t.tv_sec = st->st_ctime; + t.tv_nsec = 0; +#else + /* Birth time is not supported. Set tv_sec to avoid undefined behavior. */ + t.tv_sec = -1; + t.tv_nsec = -1; + /* Avoid a "parameter unused" warning. */ + (void) st; +#endif + +#if (defined HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC \ + || defined HAVE_STRUCT_STAT_ST_BIRTHTIM_TV_NSEC \ + || defined HAVE_STRUCT_STAT_ST_BIRTHTIMENSEC) + /* FreeBSD and NetBSD sometimes signal the absence of knowledge by + using zero. Attempt to work around this problem. Alas, this can + report failure even for valid time stamps. Also, NetBSD + sometimes returns junk in the birth time fields; work around this + bug if it it is detected. There's no need to detect negative + tv_nsec junk as negative tv_nsec already indicates an error. */ + if (t.tv_sec == 0 || 1000000000 <= t.tv_nsec) + t.tv_nsec = -1; +#endif + + return t; +} + #endif diff --git a/src/bin/coreutils/lib/dirent_.h b/src/bin/coreutils/lib/stdarg.in.h similarity index 53% rename from src/bin/coreutils/lib/dirent_.h rename to src/bin/coreutils/lib/stdarg.in.h index 3fa848058f..947f076c96 100644 --- a/src/bin/coreutils/lib/dirent_.h +++ b/src/bin/coreutils/lib/stdarg.in.h @@ -1,9 +1,12 @@ -/* Wrapper around . - Copyright (C) 2006-2007 Free Software Foundation, Inc. +/* -*- buffer-read-only: t -*- vi: set ro: */ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 +/* Substitute for and wrapper around . + Copyright (C) 2008 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) + the Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -15,28 +18,21 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#ifndef _GL_DIRENT_H -#define _GL_DIRENT_H +#ifndef _GL_STDARG_H -#include @ABSOLUTE_DIRENT_H@ - - -/* Declare overridden functions. */ - -#ifdef __cplusplus -extern "C" { +#if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ #endif -#if @REPLACE_FCHDIR@ -# define opendir rpl_opendir -extern DIR * opendir (const char *); -# define closedir rpl_closedir -extern int closedir (DIR *); +/* The include_next requires a split double-inclusion guard. */ +#@INCLUDE_NEXT@ @NEXT_STDARG_H@ + +#ifndef _GL_STDARG_H +#define _GL_STDARG_H + +#ifndef va_copy +# define va_copy(a,b) ((a) = (b)) #endif -#ifdef __cplusplus -} -#endif - - -#endif /* _GL_DIRENT_H */ +#endif /* _GL_STDARG_H */ +#endif /* _GL_STDARG_H */ diff --git a/src/bin/coreutils/lib/stdbool_.h b/src/bin/coreutils/lib/stdbool.in.h similarity index 86% rename from src/bin/coreutils/lib/stdbool_.h rename to src/bin/coreutils/lib/stdbool.in.h index 29161d9f9a..72681fc2fc 100644 --- a/src/bin/coreutils/lib/stdbool_.h +++ b/src/bin/coreutils/lib/stdbool.in.h @@ -1,9 +1,12 @@ -/* Copyright (C) 2001, 2002, 2003, 2006, 2007 Free Software Foundation, Inc. +/* -*- buffer-read-only: t -*- vi: set ro: */ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 +/* Copyright (C) 2001-2003, 2006-2008 Free Software Foundation, Inc. Written by Bruno Haible , 2001. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) + the Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -15,8 +18,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#ifndef _STDBOOL_H -#define _STDBOOL_H +#ifndef _GL_STDBOOL_H +#define _GL_STDBOOL_H /* ISO C 99 for platforms that lack it. */ @@ -58,7 +61,7 @@ /* BeOS already #defines false 0, true 1. We use the same definitions below, but temporarily we have to #undef them. */ -#if (defined(__BEOS__) || defined(__HAIKU__)) +#if defined __BEOS__ && !defined __HAIKU__ # include /* defines bool but not _Bool */ # undef false # undef true @@ -73,7 +76,7 @@ (see ISO C 99 6.7.2.2.(4)); however, '_Bool' must promote to 'int' (see ISO C 99 6.3.1.1.(2)). So we add a negative value to the enum; this ensures that '_Bool' promotes to 'int'. */ -#if defined __cplusplus || (defined(__BEOS__) || defined(__HAIKU__)) +#if defined __cplusplus || (defined __BEOS__ && !defined __HAIKU__) /* A compiler known to have 'bool'. */ /* If the compiler already has both 'bool' and '_Bool', we can assume they are the same types. */ @@ -97,10 +100,11 @@ typedef bool _Bool; "warning: _Bool is a keyword in ISO C99". Use of an enum type, with IRIX cc, leads to a stupid "warning(1185): enumerated type mixed with another type". - The only benefit of the enum type, debuggability, is not important - with these compilers. So use 'signed char' and no typedef. */ + Even the existence of an enum type, without a typedef, + "Invalid enumerator. (badenum)" with HP-UX cc on Tru64. + The only benefit of the enum, debuggability, is not important + with these compilers. So use 'signed char' and no enum. */ # define _Bool signed char -enum { false = 0, true = 1 }; # else /* With this compiler, trust the _Bool type if the compiler has it. */ # if !@HAVE__BOOL@ @@ -115,4 +119,4 @@ typedef enum { _Bool_must_promote_to_int = -1, false = 0, true = 1 } _Bool; #define true 1 #define __bool_true_false_are_defined 1 -#endif /* _STDBOOL_H */ +#endif /* _GL_STDBOOL_H */ diff --git a/src/bin/coreutils/lib/stdint_.h b/src/bin/coreutils/lib/stdint.in.h similarity index 75% rename from src/bin/coreutils/lib/stdint_.h rename to src/bin/coreutils/lib/stdint.in.h index 4fa52516d7..710600eaf0 100644 --- a/src/bin/coreutils/lib/stdint_.h +++ b/src/bin/coreutils/lib/stdint.in.h @@ -1,10 +1,13 @@ -/* Copyright (C) 2001-2002, 2004-2007 Free Software Foundation, Inc. +/* -*- buffer-read-only: t -*- vi: set ro: */ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 +/* Copyright (C) 2001-2002, 2004-2009 Free Software Foundation, Inc. Written by Paul Eggert, Bruno Haible, Sam Steingold, Peter Burwood. This file is part of gnulib. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) + the Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -16,14 +19,19 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#ifndef _GL_STDINT_H -#define _GL_STDINT_H - /* * ISO C 99 for platforms that lack it. * */ +#ifndef _GL_STDINT_H + +/* When including a system file that in turn includes , + use the system , not our substitute. This avoids + problems with (for example) VMS, whose includes + . */ +#define _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H + /* Get those types that are already defined in other system include files, so that we can "#define int8_t signed char" below without worrying about a later system include file containing a "typedef @@ -42,16 +50,23 @@ /* Other systems may have an incomplete or buggy . Include it before , since any "#include " in would reinclude us, skipping our contents because - _GL_STDINT_H is defined. */ -# include @ABSOLUTE_STDINT_H@ + _GL_STDINT_H is defined. + The include_next requires a split double-inclusion guard. */ +# if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +# endif +# @INCLUDE_NEXT@ @NEXT_STDINT_H@ #endif +#if ! defined _GL_STDINT_H && ! defined _GL_JUST_INCLUDE_SYSTEM_STDINT_H +#define _GL_STDINT_H + /* defines some of the stdint.h types as well, on glibc, IRIX 6.5, and OpenBSD 3.8 (via ). AIX 5.2 isn't needed and causes troubles. MacOS X 10.4.6 includes (which is us), but relies on the system definitions, so include - after @ABSOLUTE_STDINT_H@. */ + after @NEXT_STDINT_H@. */ #if @HAVE_SYS_TYPES_H@ && ! defined _AIX # include #endif @@ -63,9 +78,7 @@ /* In OpenBSD 3.8, includes , which defines int{8,16,32,64}_t, uint{8,16,32,64}_t and __BIT_TYPES_DEFINED__. also defines intptr_t and uintptr_t. */ -# define _GL_JUST_INCLUDE_ABSOLUTE_INTTYPES_H # include -# undef _GL_JUST_INCLUDE_ABSOLUTE_INTTYPES_H #elif @HAVE_SYS_INTTYPES_H@ /* Solaris 7 has the types except the *_fast*_t types, and the macros except for *_FAST*_*, INTPTR_MIN, PTRDIFF_MIN, PTRDIFF_MAX. */ @@ -79,14 +92,7 @@ # include #endif -#if ! defined __cplusplus || defined __STDC_CONSTANT_MACROS - -/* Get WCHAR_MIN, WCHAR_MAX. */ -# if ! (defined WCHAR_MIN && defined WCHAR_MAX) -# include -# endif - -#endif +#undef _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H /* Minimum and maximum values for a integer type under the usual assumption. Return an unspecified value if BITS == 0, adding a check to pacify @@ -98,7 +104,10 @@ #define _STDINT_MAX(signed, bits, zero) \ ((signed) \ ? ~ _STDINT_MIN (signed, bits, zero) \ - : ((((zero) + 1) << ((bits) ? (bits) - 1 : 0)) - 1) * 2 + 1) + : /* The expression for the unsigned case. The subtraction of (signed) \ + is a nop in the unsigned case and avoids "signed integer overflow" \ + warnings in the signed case. */ \ + ((((zero) + 1) << ((bits) ? (bits) - 1 - (signed) : 0)) - 1) * 2 + 1) /* 7.18.1.1. Exact-width integer types */ @@ -107,46 +116,58 @@ #undef int8_t #undef uint8_t -#define int8_t signed char -#define uint8_t unsigned char +typedef signed char gl_int8_t; +typedef unsigned char gl_uint8_t; +#define int8_t gl_int8_t +#define uint8_t gl_uint8_t #undef int16_t #undef uint16_t -#define int16_t short int -#define uint16_t unsigned short int +typedef short int gl_int16_t; +typedef unsigned short int gl_uint16_t; +#define int16_t gl_int16_t +#define uint16_t gl_uint16_t #undef int32_t #undef uint32_t -#define int32_t int -#define uint32_t unsigned int +typedef int gl_int32_t; +typedef unsigned int gl_uint32_t; +#define int32_t gl_int32_t +#define uint32_t gl_uint32_t /* Do not undefine int64_t if gnulib is not being used with 64-bit types, since otherwise it breaks platforms like Tandem/NSK. */ #if LONG_MAX >> 31 >> 31 == 1 # undef int64_t -# define int64_t long int +typedef long int gl_int64_t; +# define int64_t gl_int64_t # define GL_INT64_T #elif defined _MSC_VER # undef int64_t -# define int64_t __int64 +typedef __int64 gl_int64_t; +# define int64_t gl_int64_t # define GL_INT64_T #elif @HAVE_LONG_LONG_INT@ # undef int64_t -# define int64_t long long int +typedef long long int gl_int64_t; +# define int64_t gl_int64_t # define GL_INT64_T #endif #if ULONG_MAX >> 31 >> 31 >> 1 == 1 # undef uint64_t -# define uint64_t unsigned long int +typedef unsigned long int gl_uint64_t; +# define uint64_t gl_uint64_t # define GL_UINT64_T #elif defined _MSC_VER # undef uint64_t -# define uint64_t unsigned __int64 +typedef unsigned __int64 gl_uint64_t; +# define uint64_t gl_uint64_t # define GL_UINT64_T #elif @HAVE_UNSIGNED_LONG_LONG_INT@ # undef uint64_t -# define uint64_t unsigned long long int +typedef unsigned long long int gl_uint64_t; +# define uint64_t gl_uint64_t # define GL_UINT64_T #endif @@ -201,12 +222,18 @@ #undef uint_fast32_t #undef int_fast64_t #undef uint_fast64_t -#define int_fast8_t long int -#define uint_fast8_t unsigned int_fast8_t -#define int_fast16_t long int -#define uint_fast16_t unsigned int_fast16_t -#define int_fast32_t long int -#define uint_fast32_t unsigned int_fast32_t +typedef long int gl_int_fast8_t; +typedef unsigned long int gl_uint_fast8_t; +typedef long int gl_int_fast16_t; +typedef unsigned long int gl_uint_fast16_t; +typedef long int gl_int_fast32_t; +typedef unsigned long int gl_uint_fast32_t; +#define int_fast8_t gl_int_fast8_t +#define uint_fast8_t gl_uint_fast8_t +#define int_fast16_t gl_int_fast16_t +#define uint_fast16_t gl_uint_fast16_t +#define int_fast32_t gl_int_fast32_t +#define uint_fast32_t gl_uint_fast32_t #ifdef GL_INT64_T # define int_fast64_t int64_t #endif @@ -218,8 +245,10 @@ #undef intptr_t #undef uintptr_t -#define intptr_t long int -#define uintptr_t unsigned long int +typedef long int gl_intptr_t; +typedef unsigned long int gl_uintptr_t; +#define intptr_t gl_intptr_t +#define uintptr_t gl_uintptr_t /* 7.18.1.5. Greatest-width integer types */ @@ -228,22 +257,31 @@ #undef intmax_t #if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1 -# define intmax_t long long int +typedef long long int gl_intmax_t; +# define intmax_t gl_intmax_t #elif defined GL_INT64_T # define intmax_t int64_t #else -# define intmax_t long int +typedef long int gl_intmax_t; +# define intmax_t gl_intmax_t #endif #undef uintmax_t #if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1 -# define uintmax_t unsigned long long int +typedef unsigned long long int gl_uintmax_t; +# define uintmax_t gl_uintmax_t #elif defined GL_UINT64_T # define uintmax_t uint64_t #else -# define uintmax_t unsigned long int +typedef unsigned long int gl_uintmax_t; +# define uintmax_t gl_uintmax_t #endif +/* Verify that intmax_t and uintmax_t have the same size. Too much code + breaks if this is not the case. If this check fails, the reason is likely + to be found in the autoconf macros. */ +typedef int _verify_intmax_size[2 * (sizeof (intmax_t) == sizeof (uintmax_t)) - 1]; + /* 7.18.2. Limits of specified-width integer types */ #if ! defined __cplusplus || defined __STDC_LIMIT_MACROS @@ -399,10 +437,20 @@ /* ptrdiff_t limits */ #undef PTRDIFF_MIN #undef PTRDIFF_MAX -#define PTRDIFF_MIN \ - _STDINT_MIN (1, @BITSIZEOF_PTRDIFF_T@, 0@PTRDIFF_T_SUFFIX@) -#define PTRDIFF_MAX \ - _STDINT_MAX (1, @BITSIZEOF_PTRDIFF_T@, 0@PTRDIFF_T_SUFFIX@) +#if @APPLE_UNIVERSAL_BUILD@ +# ifdef _LP64 +# define PTRDIFF_MIN _STDINT_MIN (1, 64, 0l) +# define PTRDIFF_MAX _STDINT_MAX (1, 64, 0l) +# else +# define PTRDIFF_MIN _STDINT_MIN (1, 32, 0) +# define PTRDIFF_MAX _STDINT_MAX (1, 32, 0) +# endif +#else +# define PTRDIFF_MIN \ + _STDINT_MIN (1, @BITSIZEOF_PTRDIFF_T@, 0@PTRDIFF_T_SUFFIX@) +# define PTRDIFF_MAX \ + _STDINT_MAX (1, @BITSIZEOF_PTRDIFF_T@, 0@PTRDIFF_T_SUFFIX@) +#endif /* sig_atomic_t limits */ #undef SIG_ATOMIC_MIN @@ -417,9 +465,26 @@ /* size_t limit */ #undef SIZE_MAX -#define SIZE_MAX _STDINT_MAX (0, @BITSIZEOF_SIZE_T@, 0@SIZE_T_SUFFIX@) +#if @APPLE_UNIVERSAL_BUILD@ +# ifdef _LP64 +# define SIZE_MAX _STDINT_MAX (0, 64, 0ul) +# else +# define SIZE_MAX _STDINT_MAX (0, 32, 0ul) +# endif +#else +# define SIZE_MAX _STDINT_MAX (0, @BITSIZEOF_SIZE_T@, 0@SIZE_T_SUFFIX@) +#endif /* wchar_t limits */ +/* Get WCHAR_MIN, WCHAR_MAX. + This include is not on the top, above, because on OSF/1 4.0 we have a sequence of nested + includes -> -> -> , and the latter includes + and assumes its types are already defined. */ +#if ! (defined WCHAR_MIN && defined WCHAR_MAX) +# define _GL_JUST_INCLUDE_SYSTEM_WCHAR_H +# include +# undef _GL_JUST_INCLUDE_SYSTEM_WCHAR_H +#endif #undef WCHAR_MIN #undef WCHAR_MAX #define WCHAR_MIN \ @@ -502,3 +567,4 @@ #endif /* !defined __cplusplus || defined __STDC_CONSTANT_MACROS */ #endif /* _GL_STDINT_H */ +#endif /* !defined _GL_STDINT_H && !defined _GL_JUST_INCLUDE_SYSTEM_STDINT_H */ diff --git a/src/bin/coreutils/lib/stdio--.h b/src/bin/coreutils/lib/stdio--.h index 2385e626ff..39fca29200 100644 --- a/src/bin/coreutils/lib/stdio--.h +++ b/src/bin/coreutils/lib/stdio--.h @@ -2,10 +2,10 @@ Copyright (C) 2005, 2006 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Paul Eggert. */ diff --git a/src/bin/coreutils/lib/stdio-impl.h b/src/bin/coreutils/lib/stdio-impl.h new file mode 100644 index 0000000000..c803e88c97 --- /dev/null +++ b/src/bin/coreutils/lib/stdio-impl.h @@ -0,0 +1,94 @@ +/* Implementation details of FILE streams. + Copyright (C) 2007-2008 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* Many stdio implementations have the same logic and therefore can share + the same implementation of stdio extension API, except that some fields + have different naming conventions, or their access requires some casts. */ + + +/* BSD stdio derived implementations. */ + +#if defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, MacOS X, Cygwin */ + +# if defined __DragonFly__ /* DragonFly */ + /* See . */ +# define fp_ ((struct { struct __FILE_public pub; \ + struct { unsigned char *_base; int _size; } _bf; \ + void *cookie; \ + void *_close; \ + void *_read; \ + void *_seek; \ + void *_write; \ + struct { unsigned char *_base; int _size; } _ub; \ + int _ur; \ + unsigned char _ubuf[3]; \ + unsigned char _nbuf[1]; \ + struct { unsigned char *_base; int _size; } _lb; \ + int _blksize; \ + fpos_t _offset; \ + /* More fields, not relevant here. */ \ + } *) fp) + /* See . */ +# define _p pub._p +# define _flags pub._flags +# define _r pub._r +# define _w pub._w +# else +# define fp_ fp +# endif + +# if defined __NetBSD__ || defined __OpenBSD__ /* NetBSD, OpenBSD */ + /* See + and */ + struct __sfileext + { + struct __sbuf _ub; /* ungetc buffer */ + /* More fields, not relevant here. */ + }; +# define fp_ub ((struct __sfileext *) fp->_ext._base)->_ub +# else /* FreeBSD, DragonFly, MacOS X, Cygwin */ +# define fp_ub fp_->_ub +# endif + +# define HASUB(fp) (fp_ub._base != NULL) + +#endif + + +/* SystemV derived implementations. */ + +#if defined _IOERR + +# if defined __sun && defined _LP64 /* Solaris/{SPARC,AMD64} 64-bit */ +# define fp_ ((struct { unsigned char *_ptr; \ + unsigned char *_base; \ + unsigned char *_end; \ + long _cnt; \ + int _file; \ + unsigned int _flag; \ + } *) fp) +# else +# define fp_ fp +# endif + +# if defined _SCO_DS /* OpenServer */ +# define _cnt __cnt +# define _ptr __ptr +# define _base __base +# define _flag __flag +# endif + +#endif diff --git a/src/bin/coreutils/lib/stdio-safer.h b/src/bin/coreutils/lib/stdio-safer.h index 8329a1a093..c881d5a6a6 100644 --- a/src/bin/coreutils/lib/stdio-safer.h +++ b/src/bin/coreutils/lib/stdio-safer.h @@ -2,10 +2,10 @@ Copyright (C) 2001, 2003, 2006 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Paul Eggert. */ diff --git a/src/bin/coreutils/lib/stdio-write.c b/src/bin/coreutils/lib/stdio-write.c new file mode 100644 index 0000000000..f1d0fcb730 --- /dev/null +++ b/src/bin/coreutils/lib/stdio-write.c @@ -0,0 +1,148 @@ +/* POSIX compatible FILE stream write function. + Copyright (C) 2008 Free Software Foundation, Inc. + Written by Bruno Haible , 2008. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#include + +/* Specification. */ +#include + +/* Replace these functions only if module 'sigpipe' is requested. */ +#if GNULIB_SIGPIPE + +/* On native Windows platforms, SIGPIPE does not exist. When write() is + called on a pipe with no readers, WriteFile() fails with error + GetLastError() = ERROR_NO_DATA, and write() in consequence fails with + error EINVAL. This write() function is at the basis of the function + which flushes the buffer of a FILE stream. */ + +# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ + +# include +# include +# include + +# define WIN32_LEAN_AND_MEAN /* avoid including junk */ +# include + +# define CALL_WITH_SIGPIPE_EMULATION(RETTYPE, EXPRESSION, FAILED) \ + if (ferror (stream)) \ + return (EXPRESSION); \ + else \ + { \ + RETTYPE ret; \ + SetLastError (0); \ + ret = (EXPRESSION); \ + if (FAILED && GetLastError () == ERROR_NO_DATA && ferror (stream)) \ + { \ + int fd = fileno (stream); \ + if (fd >= 0 \ + && GetFileType ((HANDLE) _get_osfhandle (fd)) == FILE_TYPE_PIPE)\ + { \ + /* Try to raise signal SIGPIPE. */ \ + raise (SIGPIPE); \ + /* If it is currently blocked or ignored, change errno from \ + EINVAL to EPIPE. */ \ + errno = EPIPE; \ + } \ + } \ + return ret; \ + } + +# if !REPLACE_PRINTF_POSIX /* avoid collision with printf.c */ +int +printf (const char *format, ...) +{ + int retval; + va_list args; + + va_start (args, format); + retval = vfprintf (stdout, format, args); + va_end (args); + + return retval; +} +# endif + +# if !REPLACE_FPRINTF_POSIX /* avoid collision with fprintf.c */ +int +fprintf (FILE *stream, const char *format, ...) +{ + int retval; + va_list args; + + va_start (args, format); + retval = vfprintf (stream, format, args); + va_end (args); + + return retval; +} +# endif + +# if !REPLACE_VFPRINTF_POSIX /* avoid collision with vprintf.c */ +int +vprintf (const char *format, va_list args) +{ + return vfprintf (stdout, format, args); +} +# endif + +# if !REPLACE_VPRINTF_POSIX /* avoid collision with vfprintf.c */ +int +vfprintf (FILE *stream, const char *format, va_list args) +#undef vfprintf +{ + CALL_WITH_SIGPIPE_EMULATION (int, vfprintf (stream, format, args), ret == EOF) +} +# endif + +int +putchar (int c) +{ + return fputc (c, stdout); +} + +int +fputc (int c, FILE *stream) +#undef fputc +{ + CALL_WITH_SIGPIPE_EMULATION (int, fputc (c, stream), ret == EOF) +} + +int +fputs (const char *string, FILE *stream) +#undef fputs +{ + CALL_WITH_SIGPIPE_EMULATION (int, fputs (string, stream), ret == EOF) +} + +int +puts (const char *string) +#undef puts +{ + FILE *stream = stdout; + CALL_WITH_SIGPIPE_EMULATION (int, puts (string), ret == EOF) +} + +size_t +fwrite (const void *ptr, size_t s, size_t n, FILE *stream) +#undef fwrite +{ + CALL_WITH_SIGPIPE_EMULATION (size_t, fwrite (ptr, s, n, stream), ret < n) +} + +# endif +#endif diff --git a/src/bin/coreutils/lib/stdio.in.h b/src/bin/coreutils/lib/stdio.in.h new file mode 100644 index 0000000000..53bbdc852b --- /dev/null +++ b/src/bin/coreutils/lib/stdio.in.h @@ -0,0 +1,527 @@ +/* -*- buffer-read-only: t -*- vi: set ro: */ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 +/* A GNU-like . + + Copyright (C) 2004, 2007-2008 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + +#if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +#endif + +#if defined __need_FILE || defined __need___FILE +/* Special invocation convention inside glibc header files. */ + +#@INCLUDE_NEXT@ @NEXT_STDIO_H@ + +#else +/* Normal invocation convention. */ + +#ifndef _GL_STDIO_H + +/* The include_next requires a split double-inclusion guard. */ +#@INCLUDE_NEXT@ @NEXT_STDIO_H@ + +#ifndef _GL_STDIO_H +#define _GL_STDIO_H + +#include +#include + +#if (@GNULIB_FSEEKO@ && @REPLACE_FSEEKO@) \ + || (@GNULIB_FTELLO@ && @REPLACE_FTELLO@) \ + || (@GNULIB_GETDELIM@ && !@HAVE_DECL_GETDELIM@) \ + || (@GNULIB_GETLINE@ && (!@HAVE_DECL_GETLINE@ || @REPLACE_GETLINE@)) +/* Get off_t and ssize_t. */ +# include +#endif + +#ifndef __attribute__ +/* This feature is available in gcc versions 2.5 and later. */ +# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) +# define __attribute__(Spec) /* empty */ +# endif +/* The __-protected variants of `format' and `printf' attributes + are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */ +# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) +# define __format__ format +# define __printf__ printf +# endif +#endif + + +/* The definition of GL_LINK_WARNING is copied here. */ + + +#ifdef __cplusplus +extern "C" { +#endif + + +#if @GNULIB_FPRINTF_POSIX@ +# if @REPLACE_FPRINTF@ +# define fprintf rpl_fprintf +extern int fprintf (FILE *fp, const char *format, ...) + __attribute__ ((__format__ (__printf__, 2, 3))); +# endif +#elif @GNULIB_FPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@ +# define fprintf rpl_fprintf +extern int fprintf (FILE *fp, const char *format, ...) + __attribute__ ((__format__ (__printf__, 2, 3))); +#elif defined GNULIB_POSIXCHECK +# undef fprintf +# define fprintf \ + (GL_LINK_WARNING ("fprintf is not always POSIX compliant - " \ + "use gnulib module fprintf-posix for portable " \ + "POSIX compliance"), \ + fprintf) +#endif + +#if @GNULIB_VFPRINTF_POSIX@ +# if @REPLACE_VFPRINTF@ +# define vfprintf rpl_vfprintf +extern int vfprintf (FILE *fp, const char *format, va_list args) + __attribute__ ((__format__ (__printf__, 2, 0))); +# endif +#elif @GNULIB_VFPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@ +# define vfprintf rpl_vfprintf +extern int vfprintf (FILE *fp, const char *format, va_list args) + __attribute__ ((__format__ (__printf__, 2, 0))); +#elif defined GNULIB_POSIXCHECK +# undef vfprintf +# define vfprintf(s,f,a) \ + (GL_LINK_WARNING ("vfprintf is not always POSIX compliant - " \ + "use gnulib module vfprintf-posix for portable " \ + "POSIX compliance"), \ + vfprintf (s, f, a)) +#endif + +#if @GNULIB_PRINTF_POSIX@ +# if @REPLACE_PRINTF@ +/* Don't break __attribute__((format(printf,M,N))). */ +# define printf __printf__ +extern int printf (const char *format, ...) + __attribute__ ((__format__ (__printf__, 1, 2))); +# endif +#elif @GNULIB_PRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@ +/* Don't break __attribute__((format(printf,M,N))). */ +# define printf __printf__ +extern int printf (const char *format, ...) + __attribute__ ((__format__ (__printf__, 1, 2))); +#elif defined GNULIB_POSIXCHECK +# undef printf +# define printf \ + (GL_LINK_WARNING ("printf is not always POSIX compliant - " \ + "use gnulib module printf-posix for portable " \ + "POSIX compliance"), \ + printf) +/* Don't break __attribute__((format(printf,M,N))). */ +# define format(kind,m,n) format (__##kind##__, m, n) +# define __format__(kind,m,n) __format__ (__##kind##__, m, n) +# define ____printf____ __printf__ +# define ____scanf____ __scanf__ +# define ____strftime____ __strftime__ +# define ____strfmon____ __strfmon__ +#endif + +#if @GNULIB_VPRINTF_POSIX@ +# if @REPLACE_VPRINTF@ +# define vprintf rpl_vprintf +extern int vprintf (const char *format, va_list args) + __attribute__ ((__format__ (__printf__, 1, 0))); +# endif +#elif @GNULIB_VPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@ +# define vprintf rpl_vprintf +extern int vprintf (const char *format, va_list args) + __attribute__ ((__format__ (__printf__, 1, 0))); +#elif defined GNULIB_POSIXCHECK +# undef vprintf +# define vprintf(f,a) \ + (GL_LINK_WARNING ("vprintf is not always POSIX compliant - " \ + "use gnulib module vprintf-posix for portable " \ + "POSIX compliance"), \ + vprintf (f, a)) +#endif + +#if @GNULIB_SNPRINTF@ +# if @REPLACE_SNPRINTF@ +# define snprintf rpl_snprintf +# endif +# if @REPLACE_SNPRINTF@ || !@HAVE_DECL_SNPRINTF@ +extern int snprintf (char *str, size_t size, const char *format, ...) + __attribute__ ((__format__ (__printf__, 3, 4))); +# endif +#elif defined GNULIB_POSIXCHECK +# undef snprintf +# define snprintf \ + (GL_LINK_WARNING ("snprintf is unportable - " \ + "use gnulib module snprintf for portability"), \ + snprintf) +#endif + +#if @GNULIB_VSNPRINTF@ +# if @REPLACE_VSNPRINTF@ +# define vsnprintf rpl_vsnprintf +# endif +# if @REPLACE_VSNPRINTF@ || !@HAVE_DECL_VSNPRINTF@ +extern int vsnprintf (char *str, size_t size, const char *format, va_list args) + __attribute__ ((__format__ (__printf__, 3, 0))); +# endif +#elif defined GNULIB_POSIXCHECK +# undef vsnprintf +# define vsnprintf(b,s,f,a) \ + (GL_LINK_WARNING ("vsnprintf is unportable - " \ + "use gnulib module vsnprintf for portability"), \ + vsnprintf (b, s, f, a)) +#endif + +#if @GNULIB_SPRINTF_POSIX@ +# if @REPLACE_SPRINTF@ +# define sprintf rpl_sprintf +extern int sprintf (char *str, const char *format, ...) + __attribute__ ((__format__ (__printf__, 2, 3))); +# endif +#elif defined GNULIB_POSIXCHECK +# undef sprintf +# define sprintf \ + (GL_LINK_WARNING ("sprintf is not always POSIX compliant - " \ + "use gnulib module sprintf-posix for portable " \ + "POSIX compliance"), \ + sprintf) +#endif + +#if @GNULIB_VSPRINTF_POSIX@ +# if @REPLACE_VSPRINTF@ +# define vsprintf rpl_vsprintf +extern int vsprintf (char *str, const char *format, va_list args) + __attribute__ ((__format__ (__printf__, 2, 0))); +# endif +#elif defined GNULIB_POSIXCHECK +# undef vsprintf +# define vsprintf(b,f,a) \ + (GL_LINK_WARNING ("vsprintf is not always POSIX compliant - " \ + "use gnulib module vsprintf-posix for portable " \ + "POSIX compliance"), \ + vsprintf (b, f, a)) +#endif + +#if @GNULIB_DPRINTF@ +# if @REPLACE_DPRINTF@ +# define dprintf rpl_dprintf +# endif +# if @REPLACE_DPRINTF@ || !@HAVE_DPRINTF@ +extern int dprintf (int fd, const char *format, ...) + __attribute__ ((__format__ (__printf__, 2, 3))); +# endif +#elif defined GNULIB_POSIXCHECK +# undef dprintf +# define dprintf(d,f,a) \ + (GL_LINK_WARNING ("dprintf is unportable - " \ + "use gnulib module dprintf for portability"), \ + dprintf (d, f, a)) +#endif + +#if @GNULIB_VDPRINTF@ +# if @REPLACE_VDPRINTF@ +# define vdprintf rpl_vdprintf +# endif +# if @REPLACE_VDPRINTF@ || !@HAVE_VDPRINTF@ +extern int vdprintf (int fd, const char *format, va_list args) + __attribute__ ((__format__ (__printf__, 2, 0))); +# endif +#elif defined GNULIB_POSIXCHECK +# undef vdprintf +# define vdprintf(d,f,a) \ + (GL_LINK_WARNING ("vdprintf is unportable - " \ + "use gnulib module vdprintf for portability"), \ + vdprintf (d, f, a)) +#endif + +#if @GNULIB_VASPRINTF@ +# if @REPLACE_VASPRINTF@ +# define asprintf rpl_asprintf +# define vasprintf rpl_vasprintf +# endif +# if @REPLACE_VASPRINTF@ || !@HAVE_VASPRINTF@ + /* Write formatted output to a string dynamically allocated with malloc(). + If the memory allocation succeeds, store the address of the string in + *RESULT and return the number of resulting bytes, excluding the trailing + NUL. Upon memory allocation error, or some other error, return -1. */ + extern int asprintf (char **result, const char *format, ...) + __attribute__ ((__format__ (__printf__, 2, 3))); + extern int vasprintf (char **result, const char *format, va_list args) + __attribute__ ((__format__ (__printf__, 2, 0))); +# endif +#endif + +#if @GNULIB_OBSTACK_PRINTF@ +# if @REPLACE_OBSTACK_PRINTF@ +# define obstack_printf rpl_osbtack_printf +# define obstack_vprintf rpl_obstack_vprintf +# endif +# if @REPLACE_OBSTACK_PRINTF@ || !@HAVE_DECL_OBSTACK_PRINTF@ + struct obstack; + /* Grow an obstack with formatted output. Return the number of + bytes added to OBS. No trailing nul byte is added, and the + object should be closed with obstack_finish before use. Upon + memory allocation error, call obstack_alloc_failed_handler. Upon + other error, return -1. */ + extern int obstack_printf (struct obstack *obs, const char *format, ...) + __attribute__ ((__format__ (__printf__, 2, 3))); + extern int obstack_vprintf (struct obstack *obs, const char *format, + va_list args) + __attribute__ ((__format__ (__printf__, 2, 0))); +# endif +#endif + +#if @GNULIB_FOPEN@ +# if @REPLACE_FOPEN@ +# undef fopen +# define fopen rpl_fopen +extern FILE * fopen (const char *filename, const char *mode); +# endif +#elif defined GNULIB_POSIXCHECK +# undef fopen +# define fopen(f,m) \ + (GL_LINK_WARNING ("fopen on Win32 platforms is not POSIX compatible - " \ + "use gnulib module fopen for portability"), \ + fopen (f, m)) +#endif + +#if @GNULIB_FREOPEN@ +# if @REPLACE_FREOPEN@ +# undef freopen +# define freopen rpl_freopen +extern FILE * freopen (const char *filename, const char *mode, FILE *stream); +# endif +#elif defined GNULIB_POSIXCHECK +# undef freopen +# define freopen(f,m,s) \ + (GL_LINK_WARNING ("freopen on Win32 platforms is not POSIX compatible - " \ + "use gnulib module freopen for portability"), \ + freopen (f, m, s)) +#endif + +#if @GNULIB_FSEEKO@ +# if @REPLACE_FSEEKO@ +/* Provide fseek, fseeko functions that are aware of a preceding + fflush(), and which detect pipes. */ +# define fseeko rpl_fseeko +extern int fseeko (FILE *fp, off_t offset, int whence); +# define fseek(fp, offset, whence) fseeko (fp, (off_t)(offset), whence) +# endif +#elif defined GNULIB_POSIXCHECK +# undef fseeko +# define fseeko(f,o,w) \ + (GL_LINK_WARNING ("fseeko is unportable - " \ + "use gnulib module fseeko for portability"), \ + fseeko (f, o, w)) +#endif + +#if @GNULIB_FSEEK@ && @REPLACE_FSEEK@ +extern int rpl_fseek (FILE *fp, long offset, int whence); +# undef fseek +# if defined GNULIB_POSIXCHECK +# define fseek(f,o,w) \ + (GL_LINK_WARNING ("fseek cannot handle files larger than 4 GB " \ + "on 32-bit platforms - " \ + "use fseeko function for handling of large files"), \ + rpl_fseek (f, o, w)) +# else +# define fseek rpl_fseek +# endif +#elif defined GNULIB_POSIXCHECK +# ifndef fseek +# define fseek(f,o,w) \ + (GL_LINK_WARNING ("fseek cannot handle files larger than 4 GB " \ + "on 32-bit platforms - " \ + "use fseeko function for handling of large files"), \ + fseek (f, o, w)) +# endif +#endif + +#if @GNULIB_FTELLO@ +# if @REPLACE_FTELLO@ +# define ftello rpl_ftello +extern off_t ftello (FILE *fp); +# define ftell(fp) ftello (fp) +# endif +#elif defined GNULIB_POSIXCHECK +# undef ftello +# define ftello(f) \ + (GL_LINK_WARNING ("ftello is unportable - " \ + "use gnulib module ftello for portability"), \ + ftello (f)) +#endif + +#if @GNULIB_FTELL@ && @REPLACE_FTELL@ +extern long rpl_ftell (FILE *fp); +# undef ftell +# if GNULIB_POSIXCHECK +# define ftell(f) \ + (GL_LINK_WARNING ("ftell cannot handle files larger than 4 GB " \ + "on 32-bit platforms - " \ + "use ftello function for handling of large files"), \ + rpl_ftell (f)) +# else +# define ftell rpl_ftell +# endif +#elif defined GNULIB_POSIXCHECK +# ifndef ftell +# define ftell(f) \ + (GL_LINK_WARNING ("ftell cannot handle files larger than 4 GB " \ + "on 32-bit platforms - " \ + "use ftello function for handling of large files"), \ + ftell (f)) +# endif +#endif + +#if @GNULIB_FFLUSH@ +# if @REPLACE_FFLUSH@ +# define fflush rpl_fflush + /* Flush all pending data on STREAM according to POSIX rules. Both + output and seekable input streams are supported. + Note! LOSS OF DATA can occur if fflush is applied on an input stream + that is _not_seekable_ or on an update stream that is _not_seekable_ + and in which the most recent operation was input. Seekability can + be tested with lseek(fileno(fp),0,SEEK_CUR). */ + extern int fflush (FILE *gl_stream); +# endif +#elif defined GNULIB_POSIXCHECK +# undef fflush +# define fflush(f) \ + (GL_LINK_WARNING ("fflush is not always POSIX compliant - " \ + "use gnulib module fflush for portable " \ + "POSIX compliance"), \ + fflush (f)) +#endif + +#if @GNULIB_FCLOSE@ +# if @REPLACE_FCLOSE@ +# define fclose rpl_fclose + /* Close STREAM and its underlying file descriptor. */ +extern int fclose (FILE *stream); +# endif +#elif defined GNULIB_POSIXCHECK +# undef fclose +# define fclose(f) \ + (GL_LINK_WARNING ("fclose is not always POSIX compliant - " \ + "use gnulib module fclose for portable " \ + "POSIX compliance"), \ + fclose (f)) +#endif + +#if @GNULIB_FPUTC@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@ +# undef fputc +# define fputc rpl_fputc +extern int fputc (int c, FILE *stream); +#endif + +#if @GNULIB_PUTC@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@ +# undef putc +# define putc rpl_fputc +extern int putc (int c, FILE *stream); +#endif + +#if @GNULIB_PUTCHAR@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@ +# undef putchar +# define putchar rpl_putchar +extern int putchar (int c); +#endif + +#if @GNULIB_FPUTS@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@ +# undef fputs +# define fputs rpl_fputs +extern int fputs (const char *string, FILE *stream); +#endif + +#if @GNULIB_PUTS@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@ +# undef puts +# define puts rpl_puts +extern int puts (const char *string); +#endif + +#if @GNULIB_FWRITE@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@ +# undef fwrite +# define fwrite rpl_fwrite +extern size_t fwrite (const void *ptr, size_t s, size_t n, FILE *stream); +#endif + +#if @GNULIB_GETDELIM@ +# if !@HAVE_DECL_GETDELIM@ +/* Read input, up to (and including) the next occurrence of DELIMITER, from + STREAM, store it in *LINEPTR (and NUL-terminate it). + *LINEPTR is a pointer returned from malloc (or NULL), pointing to *LINESIZE + bytes of space. It is realloc'd as necessary. + Return the number of bytes read and stored at *LINEPTR (not including the + NUL terminator), or -1 on error or EOF. */ +extern ssize_t getdelim (char **lineptr, size_t *linesize, int delimiter, + FILE *stream); +# endif +#elif defined GNULIB_POSIXCHECK +# undef getdelim +# define getdelim(l, s, d, f) \ + (GL_LINK_WARNING ("getdelim is unportable - " \ + "use gnulib module getdelim for portability"), \ + getdelim (l, s, d, f)) +#endif + +#if @GNULIB_GETLINE@ +# if @REPLACE_GETLINE@ +# undef getline +# define getline rpl_getline +# endif +# if !@HAVE_DECL_GETLINE@ || @REPLACE_GETLINE@ +/* Read a line, up to (and including) the next newline, from STREAM, store it + in *LINEPTR (and NUL-terminate it). + *LINEPTR is a pointer returned from malloc (or NULL), pointing to *LINESIZE + bytes of space. It is realloc'd as necessary. + Return the number of bytes read and stored at *LINEPTR (not including the + NUL terminator), or -1 on error or EOF. */ +extern ssize_t getline (char **lineptr, size_t *linesize, FILE *stream); +# endif +#elif defined GNULIB_POSIXCHECK +# undef getline +# define getline(l, s, f) \ + (GL_LINK_WARNING ("getline is unportable - " \ + "use gnulib module getline for portability"), \ + getline (l, s, f)) +#endif + +#if @GNULIB_PERROR@ +# if @REPLACE_PERROR@ +# define perror rpl_perror +/* Print a message to standard error, describing the value of ERRNO, + (if STRING is not NULL and not empty) prefixed with STRING and ": ", + and terminated with a newline. */ +extern void perror (const char *string); +# endif +#elif defined GNULIB_POSIXCHECK +# undef perror +# define perror(s) \ + (GL_LINK_WARNING ("perror is not always POSIX compliant - " \ + "use gnulib module perror for portability"), \ + perror (s)) +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* _GL_STDIO_H */ +#endif /* _GL_STDIO_H */ +#endif diff --git a/src/bin/coreutils/lib/stdio_.h b/src/bin/coreutils/lib/stdio_.h deleted file mode 100644 index 441c0d5cdf..0000000000 --- a/src/bin/coreutils/lib/stdio_.h +++ /dev/null @@ -1,192 +0,0 @@ -/* A GNU-like . - - Copyright (C) 2004, 2007 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ - -#if defined __need_FILE || defined __need___FILE -/* Special invocation convention inside glibc header files. */ - -#include @ABSOLUTE_STDIO_H@ - -#else -/* Normal invocation convention. */ -#ifndef _GL_STDIO_H -#define _GL_STDIO_H - -#include @ABSOLUTE_STDIO_H@ - -#include -#include - -#ifndef __attribute__ -/* This feature is available in gcc versions 2.5 and later. */ -# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__ -# define __attribute__(Spec) /* empty */ -# endif -/* The __-protected variants of `format' and `printf' attributes - are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */ -# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) -# define __format__ format -# define __printf__ printf -# endif -#endif - - -/* The definition of GL_LINK_WARNING is copied here. */ - - -#ifdef __cplusplus -extern "C" { -#endif - - -#if @GNULIB_FPRINTF_POSIX@ -# if @REPLACE_FPRINTF@ -# define fprintf rpl_fprintf -extern int fprintf (FILE *fp, const char *format, ...) - __attribute__ ((__format__ (__printf__, 2, 3))); -# endif -#elif defined GNULIB_POSIXCHECK -# undef fprintf -# define fprintf \ - (GL_LINK_WARNING ("fprintf is not always POSIX compliant - " \ - "use gnulib module fprintf-posix for portable " \ - "POSIX compliance"), \ - fprintf) -#endif - -#if @GNULIB_VFPRINTF_POSIX@ -# if @REPLACE_VFPRINTF@ -# define vfprintf rpl_vfprintf -extern int vfprintf (FILE *fp, const char *format, va_list args) - __attribute__ ((__format__ (__printf__, 2, 0))); -# endif -#elif defined GNULIB_POSIXCHECK -# undef vfprintf -# define vfprintf(s,f,a) \ - (GL_LINK_WARNING ("vfprintf is not always POSIX compliant - " \ - "use gnulib module vfprintf-posix for portable " \ - "POSIX compliance"), \ - vfprintf (s, f, a)) -#endif - -#if @GNULIB_PRINTF_POSIX@ -# if @REPLACE_PRINTF@ -/* Don't break __attribute__((format(printf,M,N))). */ -# define printf __printf__ -extern int printf (const char *format, ...) - __attribute__ ((__format__ (__printf__, 1, 2))); -# endif -#elif defined GNULIB_POSIXCHECK -# undef printf -# define printf \ - (GL_LINK_WARNING ("printf is not always POSIX compliant - " \ - "use gnulib module printf-posix for portable " \ - "POSIX compliance"), \ - printf) -/* Don't break __attribute__((format(printf,M,N))). */ -# define format(kind,m,n) format (__##kind##__, m, n) -# define __format__(kind,m,n) __format__ (__##kind##__, m, n) -# define ____printf____ __printf__ -# define ____scanf____ __scanf__ -# define ____strftime____ __strftime__ -# define ____strfmon____ __strfmon__ -#endif - -#if @GNULIB_VPRINTF_POSIX@ -# if @REPLACE_VPRINTF@ -# define vprintf rpl_vprintf -extern int vprintf (const char *format, va_list args) - __attribute__ ((__format__ (__printf__, 1, 0))); -# endif -#elif defined GNULIB_POSIXCHECK -# undef vprintf -# define vprintf(f,a) \ - (GL_LINK_WARNING ("vprintf is not always POSIX compliant - " \ - "use gnulib module vprintf-posix for portable " \ - "POSIX compliance"), \ - vprintf (f, a)) -#endif - -#if @GNULIB_SNPRINTF@ -# if @REPLACE_SNPRINTF@ -# define snprintf rpl_snprintf -# endif -# if @REPLACE_SNPRINTF@ || !@HAVE_DECL_SNPRINTF@ -extern int snprintf (char *str, size_t size, const char *format, ...) - __attribute__ ((__format__ (__printf__, 3, 4))); -# endif -#elif defined GNULIB_POSIXCHECK -# undef snprintf -# define snprintf \ - (GL_LINK_WARNING ("snprintf is unportable - " \ - "use gnulib module snprintf for portability"), \ - snprintf) -#endif - -#if @GNULIB_VSNPRINTF@ -# if @REPLACE_VSNPRINTF@ -# define vsnprintf rpl_vsnprintf -# endif -# if @REPLACE_VSNPRINTF@ || !@HAVE_DECL_VSNPRINTF@ -extern int vsnprintf (char *str, size_t size, const char *format, va_list args) - __attribute__ ((__format__ (__printf__, 3, 0))); -# endif -#elif defined GNULIB_POSIXCHECK -# undef vsnprintf -# define vsnprintf(b,s,f,a) \ - (GL_LINK_WARNING ("vsnprintf is unportable - " \ - "use gnulib module vsnprintf for portability"), \ - vsnprintf (b, s, f, a)) -#endif - -#if @GNULIB_SPRINTF_POSIX@ -# if @REPLACE_SPRINTF@ -# define sprintf rpl_sprintf -extern int sprintf (char *str, const char *format, ...) - __attribute__ ((__format__ (__printf__, 2, 3))); -# endif -#elif defined GNULIB_POSIXCHECK -# undef sprintf -# define sprintf \ - (GL_LINK_WARNING ("sprintf is not always POSIX compliant - " \ - "use gnulib module sprintf-posix for portable " \ - "POSIX compliance"), \ - sprintf) -#endif - -#if @GNULIB_VSPRINTF_POSIX@ -# if @REPLACE_VSPRINTF@ -# define vsprintf rpl_vsprintf -extern int vsprintf (char *str, const char *format, va_list args) - __attribute__ ((__format__ (__printf__, 2, 0))); -# endif -#elif defined GNULIB_POSIXCHECK -# undef vsprintf -# define vsprintf(b,f,a) \ - (GL_LINK_WARNING ("vsprintf is not always POSIX compliant - " \ - "use gnulib module vsprintf-posix for portable " \ - "POSIX compliance"), \ - vsprintf (b, f, a)) -#endif - - -#ifdef __cplusplus -} -#endif - -#endif /* _GL_STDIO_H */ -#endif diff --git a/src/bin/coreutils/lib/stdlib--.h b/src/bin/coreutils/lib/stdlib--.h index 61d6ebe222..495d0eb8f5 100644 --- a/src/bin/coreutils/lib/stdlib--.h +++ b/src/bin/coreutils/lib/stdlib--.h @@ -2,10 +2,10 @@ Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Paul Eggert. */ diff --git a/src/bin/coreutils/lib/stdlib-safer.h b/src/bin/coreutils/lib/stdlib-safer.h index 8b1a7e11e5..a014372962 100644 --- a/src/bin/coreutils/lib/stdlib-safer.h +++ b/src/bin/coreutils/lib/stdlib-safer.h @@ -2,10 +2,10 @@ Copyright (C) 2005 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Paul Eggert. */ diff --git a/src/bin/coreutils/lib/stdlib.in.h b/src/bin/coreutils/lib/stdlib.in.h new file mode 100644 index 0000000000..f99767f600 --- /dev/null +++ b/src/bin/coreutils/lib/stdlib.in.h @@ -0,0 +1,383 @@ +/* A GNU-like . + + Copyright (C) 1995, 2001-2004, 2006-2009 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +#endif + +#if defined __need_malloc_and_calloc +/* Special invocation convention inside glibc header files. */ + +#@INCLUDE_NEXT@ @NEXT_STDLIB_H@ + +#else +/* Normal invocation convention. */ + +#ifndef _GL_STDLIB_H + +/* The include_next requires a split double-inclusion guard. */ +#@INCLUDE_NEXT@ @NEXT_STDLIB_H@ + +#ifndef _GL_STDLIB_H +#define _GL_STDLIB_H + + +/* Solaris declares getloadavg() in . */ +#if @GNULIB_GETLOADAVG@ && @HAVE_SYS_LOADAVG_H@ +# include +#endif + +/* OSF/1 5.1 declares 'struct random_data' in , which is included + from if _REENTRANT is defined. Include it always. */ +#if @HAVE_RANDOM_H@ +# include +#endif + +#if @GNULIB_RANDOM_R@ || !@HAVE_STRUCT_RANDOM_DATA@ +# include +#endif + +#if !@HAVE_STRUCT_RANDOM_DATA@ +struct random_data +{ + int32_t *fptr; /* Front pointer. */ + int32_t *rptr; /* Rear pointer. */ + int32_t *state; /* Array of state values. */ + int rand_type; /* Type of random number generator. */ + int rand_deg; /* Degree of random number generator. */ + int rand_sep; /* Distance between front and rear. */ + int32_t *end_ptr; /* Pointer behind state table. */ +}; +#endif + +/* The definition of GL_LINK_WARNING is copied here. */ + + +/* Some systems do not define EXIT_*, despite otherwise supporting C89. */ +#ifndef EXIT_SUCCESS +# define EXIT_SUCCESS 0 +#endif +/* Tandem/NSK and other platforms that define EXIT_FAILURE as -1 interfere + with proper operation of xargs. */ +#ifndef EXIT_FAILURE +# define EXIT_FAILURE 1 +#elif EXIT_FAILURE != 1 +# undef EXIT_FAILURE +# define EXIT_FAILURE 1 +#endif + + +#ifdef __cplusplus +extern "C" { +#endif + + +#if @GNULIB_MALLOC_POSIX@ +# if !@HAVE_MALLOC_POSIX@ +# undef malloc +# define malloc rpl_malloc +extern void * malloc (size_t size); +# endif +#elif defined GNULIB_POSIXCHECK +# undef malloc +# define malloc(s) \ + (GL_LINK_WARNING ("malloc is not POSIX compliant everywhere - " \ + "use gnulib module malloc-posix for portability"), \ + malloc (s)) +#endif + + +#if @GNULIB_REALLOC_POSIX@ +# if !@HAVE_REALLOC_POSIX@ +# undef realloc +# define realloc rpl_realloc +extern void * realloc (void *ptr, size_t size); +# endif +#elif defined GNULIB_POSIXCHECK +# undef realloc +# define realloc(p,s) \ + (GL_LINK_WARNING ("realloc is not POSIX compliant everywhere - " \ + "use gnulib module realloc-posix for portability"), \ + realloc (p, s)) +#endif + + +#if @GNULIB_CALLOC_POSIX@ +# if !@HAVE_CALLOC_POSIX@ +# undef calloc +# define calloc rpl_calloc +extern void * calloc (size_t nmemb, size_t size); +# endif +#elif defined GNULIB_POSIXCHECK +# undef calloc +# define calloc(n,s) \ + (GL_LINK_WARNING ("calloc is not POSIX compliant everywhere - " \ + "use gnulib module calloc-posix for portability"), \ + calloc (n, s)) +#endif + + +#if @GNULIB_ATOLL@ +# if !@HAVE_ATOLL@ +/* Parse a signed decimal integer. + Returns the value of the integer. Errors are not detected. */ +extern long long atoll (const char *string); +# endif +#elif defined GNULIB_POSIXCHECK +# undef atoll +# define atoll(s) \ + (GL_LINK_WARNING ("atoll is unportable - " \ + "use gnulib module atoll for portability"), \ + atoll (s)) +#endif + + +#if @GNULIB_GETLOADAVG@ +# if !@HAVE_DECL_GETLOADAVG@ +/* Store max(NELEM,3) load average numbers in LOADAVG[]. + The three numbers are the load average of the last 1 minute, the last 5 + minutes, and the last 15 minutes, respectively. + LOADAVG is an array of NELEM numbers. */ +extern int getloadavg (double loadavg[], int nelem); +# endif +#elif defined GNULIB_POSIXCHECK +# undef getloadavg +# define getloadavg(l,n) \ + (GL_LINK_WARNING ("getloadavg is not portable - " \ + "use gnulib module getloadavg for portability"), \ + getloadavg (l, n)) +#endif + + +#if @GNULIB_GETSUBOPT@ +/* Assuming *OPTIONP is a comma separated list of elements of the form + "token" or "token=value", getsubopt parses the first of these elements. + If the first element refers to a "token" that is member of the given + NULL-terminated array of tokens: + - It replaces the comma with a NUL byte, updates *OPTIONP to point past + the first option and the comma, sets *VALUEP to the value of the + element (or NULL if it doesn't contain an "=" sign), + - It returns the index of the "token" in the given array of tokens. + Otherwise it returns -1, and *OPTIONP and *VALUEP are undefined. + For more details see the POSIX:2001 specification. + http://www.opengroup.org/susv3xsh/getsubopt.html */ +# if !@HAVE_GETSUBOPT@ +extern int getsubopt (char **optionp, char *const *tokens, char **valuep); +# endif +#elif defined GNULIB_POSIXCHECK +# undef getsubopt +# define getsubopt(o,t,v) \ + (GL_LINK_WARNING ("getsubopt is unportable - " \ + "use gnulib module getsubopt for portability"), \ + getsubopt (o, t, v)) +#endif + + +#if @GNULIB_MKDTEMP@ +# if !@HAVE_MKDTEMP@ +/* Create a unique temporary directory from TEMPLATE. + The last six characters of TEMPLATE must be "XXXXXX"; + they are replaced with a string that makes the directory name unique. + Returns TEMPLATE, or a null pointer if it cannot get a unique name. + The directory is created mode 700. */ +extern char * mkdtemp (char * /*template*/); +# endif +#elif defined GNULIB_POSIXCHECK +# undef mkdtemp +# define mkdtemp(t) \ + (GL_LINK_WARNING ("mkdtemp is unportable - " \ + "use gnulib module mkdtemp for portability"), \ + mkdtemp (t)) +#endif + + +#if @GNULIB_MKSTEMP@ +# if @REPLACE_MKSTEMP@ +/* Create a unique temporary file from TEMPLATE. + The last six characters of TEMPLATE must be "XXXXXX"; + they are replaced with a string that makes the file name unique. + The file is then created, ensuring it didn't exist before. + The file is created read-write (mask at least 0600 & ~umask), but it may be + world-readable and world-writable (mask 0666 & ~umask), depending on the + implementation. + Returns the open file descriptor if successful, otherwise -1 and errno + set. */ +# define mkstemp rpl_mkstemp +extern int mkstemp (char * /*template*/); +# else +/* On MacOS X 10.3, only declares mkstemp. */ +# include +# endif +#elif defined GNULIB_POSIXCHECK +# undef mkstemp +# define mkstemp(t) \ + (GL_LINK_WARNING ("mkstemp is unportable - " \ + "use gnulib module mkstemp for portability"), \ + mkstemp (t)) +#endif + + +#if @GNULIB_PUTENV@ +# if @REPLACE_PUTENV@ +# undef putenv +# define putenv rpl_putenv +extern int putenv (char *string); +# endif +#endif + + +#if @GNULIB_RANDOM_R@ +# if !@HAVE_RANDOM_R@ + +# ifndef RAND_MAX +# define RAND_MAX 2147483647 +# endif + +int srandom_r (unsigned int seed, struct random_data *rand_state); +int initstate_r (unsigned int seed, char *buf, size_t buf_size, + struct random_data *rand_state); +int setstate_r (char *arg_state, struct random_data *rand_state); +int random_r (struct random_data *buf, int32_t *result); +# endif +#elif defined GNULIB_POSIXCHECK +# undef random_r +# define random_r(b,r) \ + (GL_LINK_WARNING ("random_r is unportable - " \ + "use gnulib module random_r for portability"), \ + random_r (b,r)) +# undef initstate_r +# define initstate_r(s,b,sz,r) \ + (GL_LINK_WARNING ("initstate_r is unportable - " \ + "use gnulib module random_r for portability"), \ + initstate_r (s,b,sz,r)) +# undef srandom_r +# define srandom_r(s,r) \ + (GL_LINK_WARNING ("srandom_r is unportable - " \ + "use gnulib module random_r for portability"), \ + srandom_r (s,r)) +# undef setstate_r +# define setstate_r(a,r) \ + (GL_LINK_WARNING ("setstate_r is unportable - " \ + "use gnulib module random_r for portability"), \ + setstate_r (a,r)) +#endif + + +#if @GNULIB_RPMATCH@ +# if !@HAVE_RPMATCH@ +/* Test a user response to a question. + Return 1 if it is affirmative, 0 if it is negative, or -1 if not clear. */ +extern int rpmatch (const char *response); +# endif +#elif defined GNULIB_POSIXCHECK +# undef rpmatch +# define rpmatch(r) \ + (GL_LINK_WARNING ("rpmatch is unportable - " \ + "use gnulib module rpmatch for portability"), \ + rpmatch (r)) +#endif + + +#if @GNULIB_SETENV@ +# if !@HAVE_SETENV@ +/* Set NAME to VALUE in the environment. + If REPLACE is nonzero, overwrite an existing value. */ +extern int setenv (const char *name, const char *value, int replace); +# endif +#endif + + +#if @GNULIB_UNSETENV@ +# if @HAVE_UNSETENV@ +# if @VOID_UNSETENV@ +/* On some systems, unsetenv() returns void. + This is the case for MacOS X 10.3, FreeBSD 4.8, NetBSD 1.6, OpenBSD 3.4. */ +# define unsetenv(name) ((unsetenv)(name), 0) +# endif +# else +/* Remove the variable NAME from the environment. */ +extern int unsetenv (const char *name); +# endif +#endif + + +#if @GNULIB_STRTOD@ +# if @REPLACE_STRTOD@ +# define strtod rpl_strtod +# endif +# if !@HAVE_STRTOD@ || @REPLACE_STRTOD@ + /* Parse a double from STRING, updating ENDP if appropriate. */ +extern double strtod (const char *str, char **endp); +# endif +#elif defined GNULIB_POSIXCHECK +# undef strtod +# define strtod(s, e) \ + (GL_LINK_WARNING ("strtod is unportable - " \ + "use gnulib module strtod for portability"), \ + strtod (s, e)) +#endif + + +#if @GNULIB_STRTOLL@ +# if !@HAVE_STRTOLL@ +/* Parse a signed integer whose textual representation starts at STRING. + The integer is expected to be in base BASE (2 <= BASE <= 36); if BASE == 0, + it may be decimal or octal (with prefix "0") or hexadecimal (with prefix + "0x"). + If ENDPTR is not NULL, the address of the first byte after the integer is + stored in *ENDPTR. + Upon overflow, the return value is LLONG_MAX or LLONG_MIN, and errno is set + to ERANGE. */ +extern long long strtoll (const char *string, char **endptr, int base); +# endif +#elif defined GNULIB_POSIXCHECK +# undef strtoll +# define strtoll(s,e,b) \ + (GL_LINK_WARNING ("strtoll is unportable - " \ + "use gnulib module strtoll for portability"), \ + strtoll (s, e, b)) +#endif + + +#if @GNULIB_STRTOULL@ +# if !@HAVE_STRTOULL@ +/* Parse an unsigned integer whose textual representation starts at STRING. + The integer is expected to be in base BASE (2 <= BASE <= 36); if BASE == 0, + it may be decimal or octal (with prefix "0") or hexadecimal (with prefix + "0x"). + If ENDPTR is not NULL, the address of the first byte after the integer is + stored in *ENDPTR. + Upon overflow, the return value is ULLONG_MAX, and errno is set to + ERANGE. */ +extern unsigned long long strtoull (const char *string, char **endptr, int base); +# endif +#elif defined GNULIB_POSIXCHECK +# undef strtoull +# define strtoull(s,e,b) \ + (GL_LINK_WARNING ("strtoull is unportable - " \ + "use gnulib module strtoull for portability"), \ + strtoull (s, e, b)) +#endif + + +#ifdef __cplusplus +} +#endif + +#endif /* _GL_STDLIB_H */ +#endif /* _GL_STDLIB_H */ +#endif diff --git a/src/bin/coreutils/lib/stdlib_.h b/src/bin/coreutils/lib/stdlib_.h deleted file mode 100644 index a9204088e3..0000000000 --- a/src/bin/coreutils/lib/stdlib_.h +++ /dev/null @@ -1,141 +0,0 @@ -/* A GNU-like . - - Copyright (C) 1995, 2001-2002, 2006-2007 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ - -#if defined __need_malloc_and_calloc -/* Special invocation convention inside glibc header files. */ - -/* This #pragma avoids a warning with "gcc -Wall" on some glibc systems - on which has an inappropriate declaration, see - . */ -#ifdef __GNUC__ -# pragma GCC system_header -#endif - -#include @ABSOLUTE_STDLIB_H@ - -#else -/* Normal invocation convention. */ -#ifndef _GL_STDLIB_H -#define _GL_STDLIB_H - -/* This #pragma avoids a warning with "gcc -Wall" on some glibc systems - on which has an inappropriate declaration, see - . */ -#ifdef __GNUC__ -# pragma GCC system_header -#endif - -#include @ABSOLUTE_STDLIB_H@ - - -/* The definition of GL_LINK_WARNING is copied here. */ - - -/* Some systems do not define EXIT_*, despite otherwise supporting C89. */ -#ifndef EXIT_SUCCESS -# define EXIT_SUCCESS 0 -#endif -/* Tandem/NSK and other platforms that define EXIT_FAILURE as -1 interfere - with proper operation of xargs. */ -#ifndef EXIT_FAILURE -# define EXIT_FAILURE 1 -#elif EXIT_FAILURE != 1 -# undef EXIT_FAILURE -# define EXIT_FAILURE 1 -#endif - - -#ifdef __cplusplus -extern "C" { -#endif - - -#if @GNULIB_GETSUBOPT@ -/* Assuming *OPTIONP is a comma separated list of elements of the form - "token" or "token=value", getsubopt parses the first of these elements. - If the first element refers to a "token" that is member of the given - NULL-terminated array of tokens: - - It replaces the comma with a NUL byte, updates *OPTIONP to point past - the first option and the comma, sets *VALUEP to the value of the - element (or NULL if it doesn't contain an "=" sign), - - It returns the index of the "token" in the given array of tokens. - Otherwise it returns -1, and *OPTIONP and *VALUEP are undefined. - For more details see the POSIX:2001 specification. - http://www.opengroup.org/susv3xsh/getsubopt.html */ -# if !@HAVE_GETSUBOPT@ -extern int getsubopt (char **optionp, char *const *tokens, char **valuep); -# endif -#elif defined GNULIB_POSIXCHECK -# undef getsubopt -# define getsubopt(o,t,v) \ - (GL_LINK_WARNING ("getsubopt is unportable - " \ - "use gnulib module getsubopt for portability"), \ - getsubopt (o, t, v)) -#endif - - -#if @GNULIB_MKDTEMP@ -# if !@HAVE_MKDTEMP@ -/* Create a unique temporary directory from TEMPLATE. - The last six characters of TEMPLATE must be "XXXXXX"; - they are replaced with a string that makes the directory name unique. - Returns TEMPLATE, or a null pointer if it cannot get a unique name. - The directory is created mode 700. */ -extern char * mkdtemp (char *template); -# endif -#elif defined GNULIB_POSIXCHECK -# undef mkdtemp -# define mkdtemp(t) \ - (GL_LINK_WARNING ("mkdtemp is unportable - " \ - "use gnulib module mkdtemp for portability"), \ - mkdtemp (t)) -#endif - - -#if @GNULIB_MKSTEMP@ -# if @REPLACE_MKSTEMP@ -/* Create a unique temporary file from TEMPLATE. - The last six characters of TEMPLATE must be "XXXXXX"; - they are replaced with a string that makes the file name unique. - The file is then created, ensuring it didn't exist before. - The file is created read-write (mask at least 0600 & ~umask), but it may be - world-readable and world-writable (mask 0666 & ~umask), depending on the - implementation. - Returns the open file descriptor if successful, otherwise -1 and errno - set. */ -# define mkstemp rpl_mkstemp -extern int mkstemp (char *template); -# else -/* On MacOS X 10.3, only declares mkstemp. */ -# include -# endif -#elif defined GNULIB_POSIXCHECK -# undef mkstemp -# define mkstemp(t) \ - (GL_LINK_WARNING ("mkstemp is unportable - " \ - "use gnulib module mkstemp for portability"), \ - mkstemp (t)) -#endif - - -#ifdef __cplusplus -} -#endif - -#endif /* _GL_STDLIB_H */ -#endif diff --git a/src/bin/coreutils/lib/stpcpy.c b/src/bin/coreutils/lib/stpcpy.c index 4089d3946a..1e70013382 100644 --- a/src/bin/coreutils/lib/stpcpy.c +++ b/src/bin/coreutils/lib/stpcpy.c @@ -4,9 +4,9 @@ NOTE: The canonical source of this file is maintained with the GNU C Library. Bugs can be reported to bug-glibc@prep.ai.mit.edu. - This program is free software; you can redistribute it and/or modify it + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2, or (at your option) any + Free Software Foundation; either version 3 of the License, or any later version. This program is distributed in the hope that it will be useful, @@ -15,8 +15,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ #include diff --git a/src/bin/coreutils/lib/stpncpy.c b/src/bin/coreutils/lib/stpncpy.c new file mode 100644 index 0000000000..7a64574609 --- /dev/null +++ b/src/bin/coreutils/lib/stpncpy.c @@ -0,0 +1,91 @@ +/* Copyright (C) 1993, 1995-1997, 2002-2003, 2005-2007 Free Software Foundation, Inc. + + NOTE: The canonical source of this file is maintained with the GNU C Library. + Bugs can be reported to bug-glibc@gnu.org. + + This program is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 3 of the License, or any + later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* This is almost copied from strncpy.c, written by Torbjorn Granlund. */ + +#include + +/* Specification. */ +#include + +#ifndef weak_alias +# define __stpncpy stpncpy +#endif + +/* Copy no more than N bytes of SRC to DST, returning a pointer past the + last non-NUL byte written into DST. */ +char * +__stpncpy (char *dest, const char *src, size_t n) +{ + char c; + char *s = dest; + + if (n >= 4) + { + size_t n4 = n >> 2; + + for (;;) + { + c = *src++; + *dest++ = c; + if (c == '\0') + break; + c = *src++; + *dest++ = c; + if (c == '\0') + break; + c = *src++; + *dest++ = c; + if (c == '\0') + break; + c = *src++; + *dest++ = c; + if (c == '\0') + break; + if (--n4 == 0) + goto last_chars; + } + n -= dest - s; + goto zero_fill; + } + + last_chars: + n &= 3; + if (n == 0) + return dest; + + for (;;) + { + c = *src++; + --n; + *dest++ = c; + if (c == '\0') + break; + if (n == 0) + return dest; + } + + zero_fill: + while (n-- > 0) + dest[n] = '\0'; + + return dest - 1; +} +#ifdef weak_alias +weak_alias (__stpncpy, stpncpy) +#endif diff --git a/src/bin/coreutils/lib/str-kmp.h b/src/bin/coreutils/lib/str-kmp.h new file mode 100644 index 0000000000..4dbcf36856 --- /dev/null +++ b/src/bin/coreutils/lib/str-kmp.h @@ -0,0 +1,153 @@ +/* -*- buffer-read-only: t -*- vi: set ro: */ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 +/* Substring search in a NUL terminated string of 'char' elements, + using the Knuth-Morris-Pratt algorithm. + Copyright (C) 2005-2008 Free Software Foundation, Inc. + Written by Bruno Haible , 2005. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + +/* Before including this file, you need to define: + CANON_ELEMENT(c) A macro that canonicalizes an element right after + it has been fetched from one of the two strings. + The argument is an 'unsigned char'; the result + must be an 'unsigned char' as well. */ + +/* Knuth-Morris-Pratt algorithm. + See http://en.wikipedia.org/wiki/Knuth-Morris-Pratt_algorithm + Return a boolean indicating success: + Return true and set *RESULTP if the search was completed. + Return false if it was aborted because not enough memory was available. */ +static bool +knuth_morris_pratt_unibyte (const char *haystack, const char *needle, + const char **resultp) +{ + size_t m = strlen (needle); + + /* Allocate the table. */ + size_t *table = (size_t *) nmalloca (m, sizeof (size_t)); + if (table == NULL) + return false; + /* Fill the table. + For 0 < i < m: + 0 < table[i] <= i is defined such that + forall 0 < x < table[i]: needle[x..i-1] != needle[0..i-1-x], + and table[i] is as large as possible with this property. + This implies: + 1) For 0 < i < m: + If table[i] < i, + needle[table[i]..i-1] = needle[0..i-1-table[i]]. + 2) For 0 < i < m: + rhaystack[0..i-1] == needle[0..i-1] + and exists h, i <= h < m: rhaystack[h] != needle[h] + implies + forall 0 <= x < table[i]: rhaystack[x..x+m-1] != needle[0..m-1]. + table[0] remains uninitialized. */ + { + size_t i, j; + + /* i = 1: Nothing to verify for x = 0. */ + table[1] = 1; + j = 0; + + for (i = 2; i < m; i++) + { + /* Here: j = i-1 - table[i-1]. + The inequality needle[x..i-1] != needle[0..i-1-x] is known to hold + for x < table[i-1], by induction. + Furthermore, if j>0: needle[i-1-j..i-2] = needle[0..j-1]. */ + unsigned char b = CANON_ELEMENT ((unsigned char) needle[i - 1]); + + for (;;) + { + /* Invariants: The inequality needle[x..i-1] != needle[0..i-1-x] + is known to hold for x < i-1-j. + Furthermore, if j>0: needle[i-1-j..i-2] = needle[0..j-1]. */ + if (b == CANON_ELEMENT ((unsigned char) needle[j])) + { + /* Set table[i] := i-1-j. */ + table[i] = i - ++j; + break; + } + /* The inequality needle[x..i-1] != needle[0..i-1-x] also holds + for x = i-1-j, because + needle[i-1] != needle[j] = needle[i-1-x]. */ + if (j == 0) + { + /* The inequality holds for all possible x. */ + table[i] = i; + break; + } + /* The inequality needle[x..i-1] != needle[0..i-1-x] also holds + for i-1-j < x < i-1-j+table[j], because for these x: + needle[x..i-2] + = needle[x-(i-1-j)..j-1] + != needle[0..j-1-(x-(i-1-j))] (by definition of table[j]) + = needle[0..i-2-x], + hence needle[x..i-1] != needle[0..i-1-x]. + Furthermore + needle[i-1-j+table[j]..i-2] + = needle[table[j]..j-1] + = needle[0..j-1-table[j]] (by definition of table[j]). */ + j = j - table[j]; + } + /* Here: j = i - table[i]. */ + } + } + + /* Search, using the table to accelerate the processing. */ + { + size_t j; + const char *rhaystack; + const char *phaystack; + + *resultp = NULL; + j = 0; + rhaystack = haystack; + phaystack = haystack; + /* Invariant: phaystack = rhaystack + j. */ + while (*phaystack != '\0') + if (CANON_ELEMENT ((unsigned char) needle[j]) + == CANON_ELEMENT ((unsigned char) *phaystack)) + { + j++; + phaystack++; + if (j == m) + { + /* The entire needle has been found. */ + *resultp = rhaystack; + break; + } + } + else if (j > 0) + { + /* Found a match of needle[0..j-1], mismatch at needle[j]. */ + rhaystack += table[j]; + j -= table[j]; + } + else + { + /* Found a mismatch at needle[0] already. */ + rhaystack++; + phaystack++; + } + } + + freea (table); + return true; +} + +#undef CANON_ELEMENT diff --git a/src/bin/coreutils/lib/strcspn.c b/src/bin/coreutils/lib/strcspn.c index 5a8d6f9c17..0eecb8dc15 100644 --- a/src/bin/coreutils/lib/strcspn.c +++ b/src/bin/coreutils/lib/strcspn.c @@ -3,9 +3,9 @@ NOTE: The canonical source of this file is maintained with the GNU C Library. Bugs can be reported to bug-glibc@gnu.org. - This program is free software; you can redistribute it and/or modify it + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2, or (at your option) any + Free Software Foundation; either version 3 of the License, or any later version. This program is distributed in the hope that it will be useful, @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ #include diff --git a/src/bin/coreutils/lib/strdup.c b/src/bin/coreutils/lib/strdup.c index c614108786..635718e511 100644 --- a/src/bin/coreutils/lib/strdup.c +++ b/src/bin/coreutils/lib/strdup.c @@ -1,3 +1,6 @@ +/* -*- buffer-read-only: t -*- vi: set ro: */ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 /* Copyright (C) 1991, 1996, 1997, 1998, 2002, 2003, 2004, 2006, 2007 Free Software Foundation, Inc. @@ -5,7 +8,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) + the Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/src/bin/coreutils/lib/streq.h b/src/bin/coreutils/lib/streq.h new file mode 100644 index 0000000000..ff3a9cb3ad --- /dev/null +++ b/src/bin/coreutils/lib/streq.h @@ -0,0 +1,179 @@ +/* -*- buffer-read-only: t -*- vi: set ro: */ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 +/* Optimized string comparison. + Copyright (C) 2001-2002, 2007 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published + by the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* Written by Bruno Haible . */ + +#ifndef _GL_STREQ_H +#define _GL_STREQ_H + +#include + +/* STREQ allows to optimize string comparison with a small literal string. + STREQ (s, "EUC-KR", 'E', 'U', 'C', '-', 'K', 'R', 0, 0, 0) + is semantically equivalent to + strcmp (s, "EUC-KR") == 0 + just faster. */ + +/* Help GCC to generate good code for string comparisons with + immediate strings. */ +#if defined (__GNUC__) && defined (__OPTIMIZE__) + +static inline int +streq9 (const char *s1, const char *s2) +{ + return strcmp (s1 + 9, s2 + 9) == 0; +} + +static inline int +streq8 (const char *s1, const char *s2, char s28) +{ + if (s1[8] == s28) + { + if (s28 == 0) + return 1; + else + return streq9 (s1, s2); + } + else + return 0; +} + +static inline int +streq7 (const char *s1, const char *s2, char s27, char s28) +{ + if (s1[7] == s27) + { + if (s27 == 0) + return 1; + else + return streq8 (s1, s2, s28); + } + else + return 0; +} + +static inline int +streq6 (const char *s1, const char *s2, char s26, char s27, char s28) +{ + if (s1[6] == s26) + { + if (s26 == 0) + return 1; + else + return streq7 (s1, s2, s27, s28); + } + else + return 0; +} + +static inline int +streq5 (const char *s1, const char *s2, char s25, char s26, char s27, char s28) +{ + if (s1[5] == s25) + { + if (s25 == 0) + return 1; + else + return streq6 (s1, s2, s26, s27, s28); + } + else + return 0; +} + +static inline int +streq4 (const char *s1, const char *s2, char s24, char s25, char s26, char s27, char s28) +{ + if (s1[4] == s24) + { + if (s24 == 0) + return 1; + else + return streq5 (s1, s2, s25, s26, s27, s28); + } + else + return 0; +} + +static inline int +streq3 (const char *s1, const char *s2, char s23, char s24, char s25, char s26, char s27, char s28) +{ + if (s1[3] == s23) + { + if (s23 == 0) + return 1; + else + return streq4 (s1, s2, s24, s25, s26, s27, s28); + } + else + return 0; +} + +static inline int +streq2 (const char *s1, const char *s2, char s22, char s23, char s24, char s25, char s26, char s27, char s28) +{ + if (s1[2] == s22) + { + if (s22 == 0) + return 1; + else + return streq3 (s1, s2, s23, s24, s25, s26, s27, s28); + } + else + return 0; +} + +static inline int +streq1 (const char *s1, const char *s2, char s21, char s22, char s23, char s24, char s25, char s26, char s27, char s28) +{ + if (s1[1] == s21) + { + if (s21 == 0) + return 1; + else + return streq2 (s1, s2, s22, s23, s24, s25, s26, s27, s28); + } + else + return 0; +} + +static inline int +streq0 (const char *s1, const char *s2, char s20, char s21, char s22, char s23, char s24, char s25, char s26, char s27, char s28) +{ + if (s1[0] == s20) + { + if (s20 == 0) + return 1; + else + return streq1 (s1, s2, s21, s22, s23, s24, s25, s26, s27, s28); + } + else + return 0; +} + +#define STREQ(s1,s2,s20,s21,s22,s23,s24,s25,s26,s27,s28) \ + streq0 (s1, s2, s20, s21, s22, s23, s24, s25, s26, s27, s28) + +#else + +#define STREQ(s1,s2,s20,s21,s22,s23,s24,s25,s26,s27,s28) \ + (strcmp (s1, s2) == 0) + +#endif + +#endif /* _GL_STREQ_H */ diff --git a/src/bin/coreutils/lib/strerror.c b/src/bin/coreutils/lib/strerror.c new file mode 100644 index 0000000000..798d854005 --- /dev/null +++ b/src/bin/coreutils/lib/strerror.c @@ -0,0 +1,341 @@ +/* strerror.c --- POSIX compatible system error routine + + Copyright (C) 2007-2009 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#include + +#include + +#if REPLACE_STRERROR + +# include +# include + +# if GNULIB_defined_ESOCK /* native Windows platforms */ +# if HAVE_WINSOCK2_H +# include +# endif +# endif + +# include "intprops.h" + +# undef strerror +# if ! HAVE_DECL_STRERROR +# define strerror(n) NULL +# endif + +char * +rpl_strerror (int n) +{ + char const *msg = NULL; + /* These error messages are taken from glibc/sysdeps/gnu/errlist.c. */ + switch (n) + { +# if GNULIB_defined_ETXTBSY + case ETXTBSY: + msg = "Text file busy"; + break; +# endif + +# if GNULIB_defined_ESOCK /* native Windows platforms */ + /* EWOULDBLOCK is the same as EAGAIN. */ + case EINPROGRESS: + msg = "Operation now in progress"; + break; + case EALREADY: + msg = "Operation already in progress"; + break; + case ENOTSOCK: + msg = "Socket operation on non-socket"; + break; + case EDESTADDRREQ: + msg = "Destination address required"; + break; + case EMSGSIZE: + msg = "Message too long"; + break; + case EPROTOTYPE: + msg = "Protocol wrong type for socket"; + break; + case ENOPROTOOPT: + msg = "Protocol not available"; + break; + case EPROTONOSUPPORT: + msg = "Protocol not supported"; + break; + case ESOCKTNOSUPPORT: + msg = "Socket type not supported"; + break; + case EOPNOTSUPP: + msg = "Operation not supported"; + break; + case EPFNOSUPPORT: + msg = "Protocol family not supported"; + break; + case EAFNOSUPPORT: + msg = "Address family not supported by protocol"; + break; + case EADDRINUSE: + msg = "Address already in use"; + break; + case EADDRNOTAVAIL: + msg = "Cannot assign requested address"; + break; + case ENETDOWN: + msg = "Network is down"; + break; + case ENETUNREACH: + msg = "Network is unreachable"; + break; + case ENETRESET: + msg = "Network dropped connection on reset"; + break; + case ECONNABORTED: + msg = "Software caused connection abort"; + break; + case ECONNRESET: + msg = "Connection reset by peer"; + break; + case ENOBUFS: + msg = "No buffer space available"; + break; + case EISCONN: + msg = "Transport endpoint is already connected"; + break; + case ENOTCONN: + msg = "Transport endpoint is not connected"; + break; + case ESHUTDOWN: + msg = "Cannot send after transport endpoint shutdown"; + break; + case ETOOMANYREFS: + msg = "Too many references: cannot splice"; + break; + case ETIMEDOUT: + msg = "Connection timed out"; + break; + case ECONNREFUSED: + msg = "Connection refused"; + break; + case ELOOP: + msg = "Too many levels of symbolic links"; + break; + case EHOSTDOWN: + msg = "Host is down"; + break; + case EHOSTUNREACH: + msg = "No route to host"; + break; + case EPROCLIM: + msg = "Too many processes"; + break; + case EUSERS: + msg = "Too many users"; + break; + case EDQUOT: + msg = "Disk quota exceeded"; + break; + case ESTALE: + msg = "Stale NFS file handle"; + break; + case EREMOTE: + msg = "Object is remote"; + break; +# if HAVE_WINSOCK2_H + /* WSA_INVALID_HANDLE maps to EBADF */ + /* WSA_NOT_ENOUGH_MEMORY maps to ENOMEM */ + /* WSA_INVALID_PARAMETER maps to EINVAL */ + case WSA_OPERATION_ABORTED: + msg = "Overlapped operation aborted"; + break; + case WSA_IO_INCOMPLETE: + msg = "Overlapped I/O event object not in signaled state"; + break; + case WSA_IO_PENDING: + msg = "Overlapped operations will complete later"; + break; + /* WSAEINTR maps to EINTR */ + /* WSAEBADF maps to EBADF */ + /* WSAEACCES maps to EACCES */ + /* WSAEFAULT maps to EFAULT */ + /* WSAEINVAL maps to EINVAL */ + /* WSAEMFILE maps to EMFILE */ + /* WSAEWOULDBLOCK maps to EWOULDBLOCK */ + /* WSAEINPROGRESS is EINPROGRESS */ + /* WSAEALREADY is EALREADY */ + /* WSAENOTSOCK is ENOTSOCK */ + /* WSAEDESTADDRREQ is EDESTADDRREQ */ + /* WSAEMSGSIZE is EMSGSIZE */ + /* WSAEPROTOTYPE is EPROTOTYPE */ + /* WSAENOPROTOOPT is ENOPROTOOPT */ + /* WSAEPROTONOSUPPORT is EPROTONOSUPPORT */ + /* WSAESOCKTNOSUPPORT is ESOCKTNOSUPPORT */ + /* WSAEOPNOTSUPP is EOPNOTSUPP */ + /* WSAEPFNOSUPPORT is EPFNOSUPPORT */ + /* WSAEAFNOSUPPORT is EAFNOSUPPORT */ + /* WSAEADDRINUSE is EADDRINUSE */ + /* WSAEADDRNOTAVAIL is EADDRNOTAVAIL */ + /* WSAENETDOWN is ENETDOWN */ + /* WSAENETUNREACH is ENETUNREACH */ + /* WSAENETRESET is ENETRESET */ + /* WSAECONNABORTED is ECONNABORTED */ + /* WSAECONNRESET is ECONNRESET */ + /* WSAENOBUFS is ENOBUFS */ + /* WSAEISCONN is EISCONN */ + /* WSAENOTCONN is ENOTCONN */ + /* WSAESHUTDOWN is ESHUTDOWN */ + /* WSAETOOMANYREFS is ETOOMANYREFS */ + /* WSAETIMEDOUT is ETIMEDOUT */ + /* WSAECONNREFUSED is ECONNREFUSED */ + /* WSAELOOP is ELOOP */ + /* WSAENAMETOOLONG maps to ENAMETOOLONG */ + /* WSAEHOSTDOWN is EHOSTDOWN */ + /* WSAEHOSTUNREACH is EHOSTUNREACH */ + /* WSAENOTEMPTY maps to ENOTEMPTY */ + /* WSAEPROCLIM is EPROCLIM */ + /* WSAEUSERS is EUSERS */ + /* WSAEDQUOT is EDQUOT */ + /* WSAESTALE is ESTALE */ + /* WSAEREMOTE is EREMOTE */ + case WSASYSNOTREADY: + msg = "Network subsystem is unavailable"; + break; + case WSAVERNOTSUPPORTED: + msg = "Winsock.dll version out of range"; + break; + case WSANOTINITIALISED: + msg = "Successful WSAStartup not yet performed"; + break; + case WSAEDISCON: + msg = "Graceful shutdown in progress"; + break; + case WSAENOMORE: case WSA_E_NO_MORE: + msg = "No more results"; + break; + case WSAECANCELLED: case WSA_E_CANCELLED: + msg = "Call was canceled"; + break; + case WSAEINVALIDPROCTABLE: + msg = "Procedure call table is invalid"; + break; + case WSAEINVALIDPROVIDER: + msg = "Service provider is invalid"; + break; + case WSAEPROVIDERFAILEDINIT: + msg = "Service provider failed to initialize"; + break; + case WSASYSCALLFAILURE: + msg = "System call failure"; + break; + case WSASERVICE_NOT_FOUND: + msg = "Service not found"; + break; + case WSATYPE_NOT_FOUND: + msg = "Class type not found"; + break; + case WSAEREFUSED: + msg = "Database query was refused"; + break; + case WSAHOST_NOT_FOUND: + msg = "Host not found"; + break; + case WSATRY_AGAIN: + msg = "Nonauthoritative host not found"; + break; + case WSANO_RECOVERY: + msg = "Nonrecoverable error"; + break; + case WSANO_DATA: + msg = "Valid name, no data record of requested type"; + break; + /* WSA_QOS_* omitted */ +# endif +# endif + +# if GNULIB_defined_ENOMSG + case ENOMSG: + msg = "No message of desired type"; + break; +# endif + +# if GNULIB_defined_EIDRM + case EIDRM: + msg = "Identifier removed"; + break; +# endif + +# if GNULIB_defined_ENOLINK + case ENOLINK: + msg = "Link has been severed"; + break; +# endif + +# if GNULIB_defined_EPROTO + case EPROTO: + msg = "Protocol error"; + break; +# endif + +# if GNULIB_defined_EMULTIHOP + case EMULTIHOP: + msg = "Multihop attempted"; + break; +# endif + +# if GNULIB_defined_EBADMSG + case EBADMSG: + msg = "Bad message"; + break; +# endif + +# if GNULIB_defined_EOVERFLOW + case EOVERFLOW: + msg = "Value too large for defined data type"; + break; +# endif + +# if GNULIB_defined_ENOTSUP + case ENOTSUP: + msg = "Not supported"; + break; +# endif + +# if GNULIB_defined_ + case ECANCELED: + msg = "Operation canceled"; + break; +# endif + } + + if (msg) + return (char *) msg; + + { + char *result = strerror (n); + + if (result == NULL || result[0] == '\0') + { + static char const fmt[] = "Unknown error (%d)"; + static char msg_buf[sizeof fmt + INT_STRLEN_BOUND (n)]; + sprintf (msg_buf, fmt, n); + return msg_buf; + } + + return result; + } +} + +#endif diff --git a/src/bin/coreutils/lib/strftime.c b/src/bin/coreutils/lib/strftime.c index 1c202c9b61..fff5d38eae 100644 --- a/src/bin/coreutils/lib/strftime.c +++ b/src/bin/coreutils/lib/strftime.c @@ -1,64 +1,61 @@ -/* Copyright (C) 1991-1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007 Free Software +/* Copyright (C) 1991-1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007, 2009 Free Software Foundation, Inc. NOTE: The canonical source of this file is maintained with the GNU C Library. Bugs can be reported to bug-glibc@prep.ai.mit.edu. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ #ifdef _LIBC -# define HAVE_MBLEN 1 -# define HAVE_MBRLEN 1 # define HAVE_STRUCT_ERA_ENTRY 1 # define HAVE_TM_GMTOFF 1 # define HAVE_TM_ZONE 1 # define HAVE_TZNAME 1 # define HAVE_TZSET 1 -# define MULTIBYTE_IS_FORMAT_SAFE 1 # include "../locale/localeinfo.h" #else # include # if FPRINTFTIME # include "fprintftime.h" +# else +# include "strftime.h" # endif #endif #include #include -#if HAVE_TZNAME && ! defined tzname +#if HAVE_TZNAME && !HAVE_DECL_TZNAME extern char *tzname[]; #endif /* Do multibyte processing if multibytes are supported, unless multibyte sequences are safe in formats. Multibyte sequences are safe if they cannot contain byte sequences that look like format - conversion specifications. The GNU C Library uses UTF8 multibyte - encoding, which is safe for formats, but strftime.c can be used - with other C libraries that use unsafe encodings. */ -#define DO_MULTIBYTE (HAVE_MBLEN && ! MULTIBYTE_IS_FORMAT_SAFE) + conversion specifications. The multibyte encodings used by the + C library on the various platforms (UTF-8, GB2312, GBK, CP936, + GB18030, EUC-TW, BIG5, BIG5-HKSCS, CP950, EUC-JP, EUC-KR, CP949, + SHIFT_JIS, CP932, JOHAB) are safe for formats, because the byte '%' + cannot occur in a multibyte character except in the first byte. + But this does not hold for the DEC-HANYU encoding used on OSF/1. */ +#if !defined __osf__ +# define MULTIBYTE_IS_FORMAT_SAFE 1 +#endif +#define DO_MULTIBYTE (! MULTIBYTE_IS_FORMAT_SAFE) #if DO_MULTIBYTE -# if HAVE_MBRLEN -# include -# else - /* Simulate mbrlen with mblen as best we can. */ -# define mbstate_t int -# define mbrlen(s, n, ps) mblen (s, n) -# define mbsinit(ps) (*(ps) == 0) -# endif +# include static const mbstate_t mbstate_zero; #endif @@ -87,13 +84,6 @@ extern char *tzname[]; # define MEMCPY(d, s, n) memcpy (d, s, n) # define STRLEN(s) strlen (s) -# ifdef _LIBC -# define MEMPCPY(d, s, n) __mempcpy (d, s, n) -# else -# ifndef HAVE_MEMPCPY -# define MEMPCPY(d, s, n) ((void *) ((char *) memcpy (d, s, n) + (n))) -# endif -# endif #endif /* Shift A right by B bits portably, by dividing A by 2**B and diff --git a/src/bin/coreutils/lib/strftime.h b/src/bin/coreutils/lib/strftime.h index 16b996e30d..c3c183ec92 100644 --- a/src/bin/coreutils/lib/strftime.h +++ b/src/bin/coreutils/lib/strftime.h @@ -1,11 +1,11 @@ /* declarations for strftime.c - Copyright (C) 2002, 2004 Free Software Foundation, Inc. + Copyright (C) 2002, 2004, 2008 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,9 +13,14 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ #include -size_t nstrftime (char *, size_t, char const *, struct tm const *, int, int); +/* Just like strftime, but with two more arguments: + POSIX requires that strftime use the local timezone information. + When __UTC is nonzero and tm->tm_zone is NULL or the empty string, + use UTC instead. Use __NS as the number of nanoseconds in the + %N directive. */ +size_t nstrftime (char *, size_t, char const *, struct tm const *, + int __utc, int __ns); diff --git a/src/bin/coreutils/lib/striconv.c b/src/bin/coreutils/lib/striconv.c new file mode 100644 index 0000000000..ba6305ff8b --- /dev/null +++ b/src/bin/coreutils/lib/striconv.c @@ -0,0 +1,461 @@ +/* -*- buffer-read-only: t -*- vi: set ro: */ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 +/* Charset conversion. + Copyright (C) 2001-2007 Free Software Foundation, Inc. + Written by Bruno Haible and Simon Josefsson. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + +#include + +/* Specification. */ +#include "striconv.h" + +#include +#include +#include + +#if HAVE_ICONV +# include +/* Get MB_LEN_MAX, CHAR_BIT. */ +# include +#endif + +#include "c-strcase.h" + +#ifndef SIZE_MAX +# define SIZE_MAX ((size_t) -1) +#endif + + +#if HAVE_ICONV + +int +mem_cd_iconv (const char *src, size_t srclen, iconv_t cd, + char **resultp, size_t *lengthp) +{ +# define tmpbufsize 4096 + size_t length; + char *result; + + /* Avoid glibc-2.1 bug and Solaris 2.7-2.9 bug. */ +# if defined _LIBICONV_VERSION \ + || !((__GLIBC__ - 0 == 2 && __GLIBC_MINOR__ - 0 <= 1) || defined __sun) + /* Set to the initial state. */ + iconv (cd, NULL, NULL, NULL, NULL); +# endif + + /* Determine the length we need. */ + { + size_t count = 0; + /* The alignment is needed when converting e.g. to glibc's WCHAR_T or + libiconv's UCS-4-INTERNAL encoding. */ + union { unsigned int align; char buf[tmpbufsize]; } tmp; +# define tmpbuf tmp.buf + const char *inptr = src; + size_t insize = srclen; + + while (insize > 0) + { + char *outptr = tmpbuf; + size_t outsize = tmpbufsize; + size_t res = iconv (cd, + (ICONV_CONST char **) &inptr, &insize, + &outptr, &outsize); + + if (res == (size_t)(-1)) + { + if (errno == E2BIG) + ; + else if (errno == EINVAL) + break; + else + return -1; + } +# if !defined _LIBICONV_VERSION && !defined __GLIBC__ + /* Irix iconv() inserts a NUL byte if it cannot convert. + NetBSD iconv() inserts a question mark if it cannot convert. + Only GNU libiconv and GNU libc are known to prefer to fail rather + than doing a lossy conversion. */ + else if (res > 0) + { + errno = EILSEQ; + return -1; + } +# endif + count += outptr - tmpbuf; + } + /* Avoid glibc-2.1 bug and Solaris 2.7 bug. */ +# if defined _LIBICONV_VERSION \ + || !((__GLIBC__ - 0 == 2 && __GLIBC_MINOR__ - 0 <= 1) || defined __sun) + { + char *outptr = tmpbuf; + size_t outsize = tmpbufsize; + size_t res = iconv (cd, NULL, NULL, &outptr, &outsize); + + if (res == (size_t)(-1)) + return -1; + count += outptr - tmpbuf; + } +# endif + length = count; +# undef tmpbuf + } + + if (length == 0) + { + *lengthp = 0; + return 0; + } + if (*resultp != NULL && *lengthp >= length) + result = *resultp; + else + { + result = (char *) malloc (length); + if (result == NULL) + { + errno = ENOMEM; + return -1; + } + } + + /* Avoid glibc-2.1 bug and Solaris 2.7-2.9 bug. */ +# if defined _LIBICONV_VERSION \ + || !((__GLIBC__ - 0 == 2 && __GLIBC_MINOR__ - 0 <= 1) || defined __sun) + /* Return to the initial state. */ + iconv (cd, NULL, NULL, NULL, NULL); +# endif + + /* Do the conversion for real. */ + { + const char *inptr = src; + size_t insize = srclen; + char *outptr = result; + size_t outsize = length; + + while (insize > 0) + { + size_t res = iconv (cd, + (ICONV_CONST char **) &inptr, &insize, + &outptr, &outsize); + + if (res == (size_t)(-1)) + { + if (errno == EINVAL) + break; + else + goto fail; + } +# if !defined _LIBICONV_VERSION && !defined __GLIBC__ + /* Irix iconv() inserts a NUL byte if it cannot convert. + NetBSD iconv() inserts a question mark if it cannot convert. + Only GNU libiconv and GNU libc are known to prefer to fail rather + than doing a lossy conversion. */ + else if (res > 0) + { + errno = EILSEQ; + goto fail; + } +# endif + } + /* Avoid glibc-2.1 bug and Solaris 2.7 bug. */ +# if defined _LIBICONV_VERSION \ + || !((__GLIBC__ - 0 == 2 && __GLIBC_MINOR__ - 0 <= 1) || defined __sun) + { + size_t res = iconv (cd, NULL, NULL, &outptr, &outsize); + + if (res == (size_t)(-1)) + goto fail; + } +# endif + if (outsize != 0) + abort (); + } + + *resultp = result; + *lengthp = length; + + return 0; + + fail: + { + if (result != *resultp) + { + int saved_errno = errno; + free (result); + errno = saved_errno; + } + return -1; + } +# undef tmpbufsize +} + +char * +str_cd_iconv (const char *src, iconv_t cd) +{ + /* For most encodings, a trailing NUL byte in the input will be converted + to a trailing NUL byte in the output. But not for UTF-7. So that this + function is usable for UTF-7, we have to exclude the NUL byte from the + conversion and add it by hand afterwards. */ +# if !defined _LIBICONV_VERSION && !defined __GLIBC__ + /* Irix iconv() inserts a NUL byte if it cannot convert. + NetBSD iconv() inserts a question mark if it cannot convert. + Only GNU libiconv and GNU libc are known to prefer to fail rather + than doing a lossy conversion. For other iconv() implementations, + we have to look at the number of irreversible conversions returned; + but this information is lost when iconv() returns for an E2BIG reason. + Therefore we cannot use the second, faster algorithm. */ + + char *result = NULL; + size_t length = 0; + int retval = mem_cd_iconv (src, strlen (src), cd, &result, &length); + char *final_result; + + if (retval < 0) + { + if (result != NULL) + abort (); + return NULL; + } + + /* Add the terminating NUL byte. */ + final_result = + (result != NULL ? realloc (result, length + 1) : malloc (length + 1)); + if (final_result == NULL) + { + if (result != NULL) + free (result); + errno = ENOMEM; + return NULL; + } + final_result[length] = '\0'; + + return final_result; + +# else + /* This algorithm is likely faster than the one above. But it may produce + iconv() returns for an E2BIG reason, when the output size guess is too + small. Therefore it can only be used when we don't need the number of + irreversible conversions performed. */ + char *result; + size_t result_size; + size_t length; + const char *inptr = src; + size_t inbytes_remaining = strlen (src); + + /* Make a guess for the worst-case output size, in order to avoid a + realloc. It's OK if the guess is wrong as long as it is not zero and + doesn't lead to an integer overflow. */ + result_size = inbytes_remaining; + { + size_t approx_sqrt_SIZE_MAX = SIZE_MAX >> (sizeof (size_t) * CHAR_BIT / 2); + if (result_size <= approx_sqrt_SIZE_MAX / MB_LEN_MAX) + result_size *= MB_LEN_MAX; + } + result_size += 1; /* for the terminating NUL */ + + result = (char *) malloc (result_size); + if (result == NULL) + { + errno = ENOMEM; + return NULL; + } + + /* Avoid glibc-2.1 bug and Solaris 2.7-2.9 bug. */ +# if defined _LIBICONV_VERSION \ + || !((__GLIBC__ - 0 == 2 && __GLIBC_MINOR__ - 0 <= 1) || defined __sun) + /* Set to the initial state. */ + iconv (cd, NULL, NULL, NULL, NULL); +# endif + + /* Do the conversion. */ + { + char *outptr = result; + size_t outbytes_remaining = result_size - 1; + + for (;;) + { + /* Here inptr + inbytes_remaining = src + strlen (src), + outptr + outbytes_remaining = result + result_size - 1. */ + size_t res = iconv (cd, + (ICONV_CONST char **) &inptr, &inbytes_remaining, + &outptr, &outbytes_remaining); + + if (res == (size_t)(-1)) + { + if (errno == EINVAL) + break; + else if (errno == E2BIG) + { + size_t used = outptr - result; + size_t newsize = result_size * 2; + char *newresult; + + if (!(newsize > result_size)) + { + errno = ENOMEM; + goto failed; + } + newresult = (char *) realloc (result, newsize); + if (newresult == NULL) + { + errno = ENOMEM; + goto failed; + } + result = newresult; + result_size = newsize; + outptr = result + used; + outbytes_remaining = result_size - 1 - used; + } + else + goto failed; + } + else + break; + } + /* Avoid glibc-2.1 bug and Solaris 2.7 bug. */ +# if defined _LIBICONV_VERSION \ + || !((__GLIBC__ - 0 == 2 && __GLIBC_MINOR__ - 0 <= 1) || defined __sun) + for (;;) + { + /* Here outptr + outbytes_remaining = result + result_size - 1. */ + size_t res = iconv (cd, NULL, NULL, &outptr, &outbytes_remaining); + + if (res == (size_t)(-1)) + { + if (errno == E2BIG) + { + size_t used = outptr - result; + size_t newsize = result_size * 2; + char *newresult; + + if (!(newsize > result_size)) + { + errno = ENOMEM; + goto failed; + } + newresult = (char *) realloc (result, newsize); + if (newresult == NULL) + { + errno = ENOMEM; + goto failed; + } + result = newresult; + result_size = newsize; + outptr = result + used; + outbytes_remaining = result_size - 1 - used; + } + else + goto failed; + } + else + break; + } +# endif + + /* Add the terminating NUL byte. */ + *outptr++ = '\0'; + + length = outptr - result; + } + + /* Give away unused memory. */ + if (length < result_size) + { + char *smaller_result = (char *) realloc (result, length); + + if (smaller_result != NULL) + result = smaller_result; + } + + return result; + + failed: + { + int saved_errno = errno; + free (result); + errno = saved_errno; + return NULL; + } + +# endif +} + +#endif + +char * +str_iconv (const char *src, const char *from_codeset, const char *to_codeset) +{ + if (*src == '\0' || c_strcasecmp (from_codeset, to_codeset) == 0) + { + char *result = strdup (src); + + if (result == NULL) + errno = ENOMEM; + return result; + } + else + { +#if HAVE_ICONV + iconv_t cd; + char *result; + + /* Avoid glibc-2.1 bug with EUC-KR. */ +# if (__GLIBC__ - 0 == 2 && __GLIBC_MINOR__ - 0 <= 1) && !defined _LIBICONV_VERSION + if (c_strcasecmp (from_codeset, "EUC-KR") == 0 + || c_strcasecmp (to_codeset, "EUC-KR") == 0) + { + errno = EINVAL; + return NULL; + } +# endif + cd = iconv_open (to_codeset, from_codeset); + if (cd == (iconv_t) -1) + return NULL; + + result = str_cd_iconv (src, cd); + + if (result == NULL) + { + /* Close cd, but preserve the errno from str_cd_iconv. */ + int saved_errno = errno; + iconv_close (cd); + errno = saved_errno; + } + else + { + if (iconv_close (cd) < 0) + { + /* Return NULL, but free the allocated memory, and while doing + that, preserve the errno from iconv_close. */ + int saved_errno = errno; + free (result); + errno = saved_errno; + return NULL; + } + } + return result; +#else + /* This is a different error code than if iconv_open existed but didn't + support from_codeset and to_codeset, so that the caller can emit + an error message such as + "iconv() is not supported. Installing GNU libiconv and + then reinstalling this package would fix this." */ + errno = ENOSYS; + return NULL; +#endif + } +} diff --git a/src/bin/coreutils/lib/striconv.h b/src/bin/coreutils/lib/striconv.h new file mode 100644 index 0000000000..61892027a4 --- /dev/null +++ b/src/bin/coreutils/lib/striconv.h @@ -0,0 +1,79 @@ +/* -*- buffer-read-only: t -*- vi: set ro: */ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 +/* Charset conversion. + Copyright (C) 2001-2004, 2006-2007 Free Software Foundation, Inc. + Written by Bruno Haible and Simon Josefsson. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + +#ifndef _STRICONV_H +#define _STRICONV_H + +#include +#if HAVE_ICONV +#include +#endif + + +#ifdef __cplusplus +extern "C" { +#endif + + +#if HAVE_ICONV + +/* Convert an entire string from one encoding to another, using iconv. + The original string is at [SRC,...,SRC+SRCLEN-1]. + The conversion descriptor is passed as CD. + *RESULTP and *LENGTH should initially be a scratch buffer and its size, + or *RESULTP can initially be NULL. + May erase the contents of the memory at *RESULTP. + Return value: 0 if successful, otherwise -1 and errno set. + If successful: The resulting string is stored in *RESULTP and its length + in *LENGTHP. *RESULTP is set to a freshly allocated memory block, or is + unchanged if no dynamic memory allocation was necessary. */ +extern int mem_cd_iconv (const char *src, size_t srclen, iconv_t cd, + char **resultp, size_t *lengthp); + +/* Convert an entire string from one encoding to another, using iconv. + The original string is the NUL-terminated string starting at SRC. + The conversion descriptor is passed as CD. Both the "from" and the "to" + encoding must use a single NUL byte at the end of the string (i.e. not + UCS-2, UCS-4, UTF-16, UTF-32). + Allocate a malloced memory block for the result. + Return value: the freshly allocated resulting NUL-terminated string if + successful, otherwise NULL and errno set. */ +extern char * str_cd_iconv (const char *src, iconv_t cd); + +#endif + +/* Convert an entire string from one encoding to another, using iconv. + The original string is the NUL-terminated string starting at SRC. + Both the "from" and the "to" encoding must use a single NUL byte at the + end of the string (i.e. not UCS-2, UCS-4, UTF-16, UTF-32). + Allocate a malloced memory block for the result. + Return value: the freshly allocated resulting NUL-terminated string if + successful, otherwise NULL and errno set. */ +extern char * str_iconv (const char *src, + const char *from_codeset, const char *to_codeset); + + +#ifdef __cplusplus +} +#endif + + +#endif /* _STRICONV_H */ diff --git a/src/bin/coreutils/lib/string_.h b/src/bin/coreutils/lib/string.in.h similarity index 80% rename from src/bin/coreutils/lib/string_.h rename to src/bin/coreutils/lib/string.in.h index b50523cce0..7014ffe67d 100644 --- a/src/bin/coreutils/lib/string_.h +++ b/src/bin/coreutils/lib/string.in.h @@ -1,10 +1,13 @@ +/* -*- buffer-read-only: t -*- vi: set ro: */ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 /* A GNU-like . - Copyright (C) 1995-1996, 2001-2007 Free Software Foundation, Inc. + Copyright (C) 1995-1996, 2001-2008 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) + the Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -17,15 +20,28 @@ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GL_STRING_H -#define _GL_STRING_H -/* This #pragma avoids a warning with "gcc -Wmissing-prototypes" on some - mingw systems. */ -#ifdef __GNUC__ -# pragma GCC system_header +#if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ #endif -#include @ABSOLUTE_STRING_H@ +/* The include_next requires a split double-inclusion guard. */ +#@INCLUDE_NEXT@ @NEXT_STRING_H@ + +#ifndef _GL_STRING_H +#define _GL_STRING_H + + +#ifndef __attribute__ +/* This feature is available in gcc versions 2.5 and later. */ +# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) +# define __attribute__(Spec) /* empty */ +# endif +/* The attribute __pure__ was added in gcc 2.96. */ +# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 96) +# define __pure__ /* empty */ +# endif +#endif /* The definition of GL_LINK_WARNING is copied here. */ @@ -35,17 +51,23 @@ extern "C" { #endif + /* Return the first occurrence of NEEDLE in HAYSTACK. */ #if @GNULIB_MEMMEM@ -# if ! @HAVE_DECL_MEMMEM@ +# if @REPLACE_MEMMEM@ +# define memmem rpl_memmem +# endif +# if ! @HAVE_DECL_MEMMEM@ || @REPLACE_MEMMEM@ extern void *memmem (void const *__haystack, size_t __haystack_len, - void const *__needle, size_t __needle_len); + void const *__needle, size_t __needle_len) + __attribute__ ((__pure__)); # endif #elif defined GNULIB_POSIXCHECK # undef memmem # define memmem(a,al,b,bl) \ - (GL_LINK_WARNING ("memmem is unportable - " \ - "use gnulib module memmem for portability"), \ + (GL_LINK_WARNING ("memmem is unportable and often quadratic - " \ + "use gnulib module memmem-simple for portability, " \ + "and module memmem for speed" ), \ memmem (a, al, b, bl)) #endif @@ -67,7 +89,8 @@ extern void *mempcpy (void *restrict __dest, void const *restrict __src, /* Search backwards through a block for a byte (specified as an int). */ #if @GNULIB_MEMRCHR@ # if ! @HAVE_DECL_MEMRCHR@ -extern void *memrchr (void const *, int, size_t); +extern void *memrchr (void const *, int, size_t) + __attribute__ ((__pure__)); # endif #elif defined GNULIB_POSIXCHECK # undef memrchr @@ -77,6 +100,22 @@ extern void *memrchr (void const *, int, size_t); memrchr (a, b, c)) #endif +/* Find the first occurrence of C in S. More efficient than + memchr(S,C,N), at the expense of undefined behavior if C does not + occur within N bytes. */ +#if @GNULIB_RAWMEMCHR@ +# if ! @HAVE_RAWMEMCHR@ +extern void *rawmemchr (void const *__s, int __c_in) + __attribute__ ((__pure__)); +# endif +#elif defined GNULIB_POSIXCHECK +# undef rawmemchr +# define rawmemchr(a,b) \ + (GL_LINK_WARNING ("rawmemchr is unportable - " \ + "use gnulib module rawmemchr for portability"), \ + rawmemchr (a, b)) +#endif + /* Copy SRC to DST, returning the address of the terminating '\0' in DST. */ #if @GNULIB_STPCPY@ # if ! @HAVE_STPCPY@ @@ -106,50 +145,6 @@ extern char *stpncpy (char *restrict __dst, char const *restrict __src, stpncpy (a, b, n)) #endif -/* Compare strings S1 and S2, ignoring case, returning less than, equal to or - greater than zero if S1 is lexicographically less than, equal to or greater - than S2. - Note: This function does not work in multibyte locales. */ -#if ! @HAVE_STRCASECMP@ -extern int strcasecmp (char const *s1, char const *s2); -#endif -#if defined GNULIB_POSIXCHECK -/* strcasecmp() does not work with multibyte strings: - POSIX says that it operates on "strings", and "string" in POSIX is defined - as a sequence of bytes, not of characters. */ -# undef strcasecmp -# define strcasecmp(a,b) \ - (GL_LINK_WARNING ("strcasecmp cannot work correctly on character strings " \ - "in multibyte locales - " \ - "use mbscasecmp if you care about " \ - "internationalization, or use c_strcasecmp (from " \ - "gnulib module c-strcase) if you want a locale " \ - "independent function"), \ - strcasecmp (a, b)) -#endif - -/* Compare no more than N bytes of strings S1 and S2, ignoring case, - returning less than, equal to or greater than zero if S1 is - lexicographically less than, equal to or greater than S2. - Note: This function cannot work correctly in multibyte locales. */ -#if ! @HAVE_DECL_STRNCASECMP@ -extern int strncasecmp (char const *s1, char const *s2, size_t n); -#endif -#if defined GNULIB_POSIXCHECK -/* strncasecmp() does not work with multibyte strings: - POSIX says that it operates on "strings", and "string" in POSIX is defined - as a sequence of bytes, not of characters. */ -# undef strncasecmp -# define strncasecmp(a,b,n) \ - (GL_LINK_WARNING ("strncasecmp cannot work correctly on character " \ - "strings in multibyte locales - " \ - "use mbsncasecmp or mbspcasecmp if you care about " \ - "internationalization, or use c_strncasecmp (from " \ - "gnulib module c-strcase) if you want a locale " \ - "independent function"), \ - strncasecmp (a, b, n)) -#endif - #if defined GNULIB_POSIXCHECK /* strchr() does not work with multibyte strings if the locale encoding is GB18030 and the character to be searched is a digit. */ @@ -164,7 +159,8 @@ extern int strncasecmp (char const *s1, char const *s2, size_t n); /* Find the first occurrence of C in S or the final NUL byte. */ #if @GNULIB_STRCHRNUL@ # if ! @HAVE_STRCHRNUL@ -extern char *strchrnul (char const *__s, int __c_in); +extern char *strchrnul (char const *__s, int __c_in) + __attribute__ ((__pure__)); # endif #elif defined GNULIB_POSIXCHECK # undef strchrnul @@ -176,7 +172,11 @@ extern char *strchrnul (char const *__s, int __c_in); /* Duplicate S, returning an identical malloc'd string. */ #if @GNULIB_STRDUP@ -# if ! @HAVE_DECL_STRDUP@ && ! defined strdup +# if @REPLACE_STRDUP@ +# undef strdup +# define strdup rpl_strdup +# endif +# if !(@HAVE_DECL_STRDUP@ || defined strdup) || @REPLACE_STRDUP@ extern char *strdup (char const *__s); # endif #elif defined GNULIB_POSIXCHECK @@ -209,7 +209,8 @@ extern char *strndup (char const *__string, size_t __n); return MAXLEN. */ #if @GNULIB_STRNLEN@ # if ! @HAVE_DECL_STRNLEN@ -extern size_t strnlen (char const *__string, size_t __maxlen); +extern size_t strnlen (char const *__string, size_t __maxlen) + __attribute__ ((__pure__)); # endif #elif defined GNULIB_POSIXCHECK # undef strnlen @@ -235,7 +236,8 @@ extern size_t strnlen (char const *__string, size_t __maxlen); /* Find the first occurrence in S of any character in ACCEPT. */ #if @GNULIB_STRPBRK@ # if ! @HAVE_STRPBRK@ -extern char *strpbrk (char const *__s, char const *__accept); +extern char *strpbrk (char const *__s, char const *__accept) + __attribute__ ((__pure__)); # endif # if defined GNULIB_POSIXCHECK /* strpbrk() assumes the second argument is a list of single-byte characters. @@ -315,25 +317,38 @@ extern char *strsep (char **restrict __stringp, char const *restrict __delim); strsep (s, d)) #endif -#if defined GNULIB_POSIXCHECK +#if @GNULIB_STRSTR@ +# if @REPLACE_STRSTR@ +# define strstr rpl_strstr +char *strstr (const char *haystack, const char *needle) + __attribute__ ((__pure__)); +# endif +#elif defined GNULIB_POSIXCHECK /* strstr() does not work with multibyte strings if the locale encoding is different from UTF-8: POSIX says that it operates on "strings", and "string" in POSIX is defined as a sequence of bytes, not of characters. */ # undef strstr # define strstr(a,b) \ - (GL_LINK_WARNING ("strstr cannot work correctly on character strings " \ - "in most multibyte locales - " \ - "use mbsstr if you care about internationalization"), \ + (GL_LINK_WARNING ("strstr is quadratic on many systems, and cannot " \ + "work correctly on character strings in most " \ + "multibyte locales - " \ + "use mbsstr if you care about internationalization, " \ + "or use strstr if you care about speed"), \ strstr (a, b)) #endif /* Find the first occurrence of NEEDLE in HAYSTACK, using case-insensitive comparison. */ -#if ! @HAVE_STRCASESTR@ -extern char *strcasestr (const char *haystack, const char *needle); -#endif -#if defined GNULIB_POSIXCHECK +#if @GNULIB_STRCASESTR@ +# if @REPLACE_STRCASESTR@ +# define strcasestr rpl_strcasestr +# endif +# if ! @HAVE_STRCASESTR@ || @REPLACE_STRCASESTR@ +extern char *strcasestr (const char *haystack, const char *needle) + __attribute__ ((__pure__)); +# endif +#elif defined GNULIB_POSIXCHECK /* strcasestr() does not work with multibyte strings: It is a glibc extension, and glibc implements it only for unibyte locales. */ @@ -400,6 +415,12 @@ extern char *strtok_r (char *restrict s, char const *restrict delim, extern size_t mbslen (const char *string); #endif +#if @GNULIB_MBSNLEN@ +/* Return the number of multibyte characters in the character string starting + at STRING and ending at STRING + LEN. */ +extern size_t mbsnlen (const char *string, size_t len); +#endif + #if @GNULIB_MBSCHR@ /* Locate the first single-byte character C in the character string STRING, and return a pointer to it. Return NULL if C is not found in STRING. @@ -536,9 +557,52 @@ extern char * mbssep (char **stringp, const char *delim); extern char * mbstok_r (char *string, const char *delim, char **save_ptr); #endif +/* Map any int, typically from errno, into an error message. */ +#if @GNULIB_STRERROR@ +# if @REPLACE_STRERROR@ +# undef strerror +# define strerror rpl_strerror +extern char *strerror (int); +# endif +#elif defined GNULIB_POSIXCHECK +# undef strerror +# define strerror(e) \ + (GL_LINK_WARNING ("strerror is unportable - " \ + "use gnulib module strerror to guarantee non-NULL result"), \ + strerror (e)) +#endif + +#if @GNULIB_STRSIGNAL@ +# if @REPLACE_STRSIGNAL@ +# define strsignal rpl_strsignal +# endif +# if ! @HAVE_DECL_STRSIGNAL@ || @REPLACE_STRSIGNAL@ +extern char *strsignal (int __sig); +# endif +#elif defined GNULIB_POSIXCHECK +# undef strsignal +# define strsignal(a) \ + (GL_LINK_WARNING ("strsignal is unportable - " \ + "use gnulib module strsignal for portability"), \ + strsignal (a)) +#endif + +#if @GNULIB_STRVERSCMP@ +# if !@HAVE_STRVERSCMP@ +extern int strverscmp (const char *, const char *); +# endif +#elif defined GNULIB_POSIXCHECK +# undef strverscmp +# define strverscmp(a, b) \ + (GL_LINK_WARNING ("strverscmp is unportable - " \ + "use gnulib module strverscmp for portability"), \ + strverscmp (a, b)) +#endif + #ifdef __cplusplus } #endif -#endif +#endif /* _GL_STRING_H */ +#endif /* _GL_STRING_H */ diff --git a/src/bin/coreutils/lib/strintcmp.c b/src/bin/coreutils/lib/strintcmp.c index f8f18012fd..36acae4c79 100644 --- a/src/bin/coreutils/lib/strintcmp.c +++ b/src/bin/coreutils/lib/strintcmp.c @@ -2,10 +2,10 @@ Copyright (C) 2005, 2006 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Paul Eggert. */ diff --git a/src/bin/coreutils/lib/stripslash.c b/src/bin/coreutils/lib/stripslash.c index 342d497c89..40844102ff 100644 --- a/src/bin/coreutils/lib/stripslash.c +++ b/src/bin/coreutils/lib/stripslash.c @@ -2,10 +2,10 @@ Copyright (C) 1990, 2001, 2003-2006 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ #include diff --git a/src/bin/coreutils/lib/strndup.c b/src/bin/coreutils/lib/strndup.c index 3a1b0eae2e..e458a55b32 100644 --- a/src/bin/coreutils/lib/strndup.c +++ b/src/bin/coreutils/lib/strndup.c @@ -1,3 +1,6 @@ +/* -*- buffer-read-only: t -*- vi: set ro: */ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 /* A replacement function, for systems that lack strndup. Copyright (C) 1996, 1997, 1998, 2001, 2002, 2003, 2005, 2006, 2007 @@ -5,7 +8,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2, or (at your option) any + Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/src/bin/coreutils/lib/strnlen.c b/src/bin/coreutils/lib/strnlen.c index d346d3272c..25eaaec245 100644 --- a/src/bin/coreutils/lib/strnlen.c +++ b/src/bin/coreutils/lib/strnlen.c @@ -1,10 +1,13 @@ +/* -*- buffer-read-only: t -*- vi: set ro: */ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 /* Find the length of STRING, but scan at most MAXLEN characters. Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc. Written by Simon Josefsson. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) + the Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/src/bin/coreutils/lib/strnlen1.c b/src/bin/coreutils/lib/strnlen1.c index 422ed9e80c..752d4fe8fd 100644 --- a/src/bin/coreutils/lib/strnlen1.c +++ b/src/bin/coreutils/lib/strnlen1.c @@ -1,10 +1,10 @@ /* Find the length of STRING + 1, but scan at most MAXLEN bytes. Copyright (C) 2005-2006 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ #include diff --git a/src/bin/coreutils/lib/strnlen1.h b/src/bin/coreutils/lib/strnlen1.h index 7ce7d0c803..c0ea357046 100644 --- a/src/bin/coreutils/lib/strnlen1.h +++ b/src/bin/coreutils/lib/strnlen1.h @@ -1,10 +1,10 @@ /* Find the length of STRING + 1, but scan at most MAXLEN bytes. Copyright (C) 2005 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ #ifndef _STRNLEN1_H #define _STRNLEN1_H diff --git a/src/bin/coreutils/lib/strnumcmp-in.h b/src/bin/coreutils/lib/strnumcmp-in.h index 9b968cb30d..7d19f8e452 100644 --- a/src/bin/coreutils/lib/strnumcmp-in.h +++ b/src/bin/coreutils/lib/strnumcmp-in.h @@ -3,10 +3,10 @@ Copyright (C) 1988, 1991, 1992, 1993, 1995, 1996, 1998, 1999, 2000, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Mike Haertel. */ diff --git a/src/bin/coreutils/lib/strnumcmp.c b/src/bin/coreutils/lib/strnumcmp.c index 3afbfb1d93..fa1590e538 100644 --- a/src/bin/coreutils/lib/strnumcmp.c +++ b/src/bin/coreutils/lib/strnumcmp.c @@ -2,10 +2,10 @@ Copyright (C) 2005, 2006 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Paul Eggert. */ diff --git a/src/bin/coreutils/lib/strpbrk.c b/src/bin/coreutils/lib/strpbrk.c index 7843a6dd6a..31d21d02f3 100644 --- a/src/bin/coreutils/lib/strpbrk.c +++ b/src/bin/coreutils/lib/strpbrk.c @@ -1,3 +1,6 @@ +/* -*- buffer-read-only: t -*- vi: set ro: */ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 /* Copyright (C) 1991, 1994, 2000, 2002-2003, 2006 Free Software Foundation, Inc. @@ -6,7 +9,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2, or (at your option) any + Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/src/bin/coreutils/lib/strtod.c b/src/bin/coreutils/lib/strtod.c index fdfc09f1bc..a2a4d3db65 100644 --- a/src/bin/coreutils/lib/strtod.c +++ b/src/bin/coreutils/lib/strtod.c @@ -1,9 +1,10 @@ -/* Copyright (C) 1991, 1992, 1997, 1999, 2003, 2006 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1992, 1997, 1999, 2003, 2006, 2008 Free + Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -11,34 +12,35 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ #include -#include +#include #include - -#include - +#include #include -#include +#include +#include #include +#include "c-ctype.h" + /* Convert NPTR to a double. If ENDPTR is not NULL, a pointer to the character after the last one used in the number is put in *ENDPTR. */ double strtod (const char *nptr, char **endptr) { - register const char *s; - short int sign; + const unsigned char *s; + bool negative = false; /* The number so far. */ double num; - int got_dot; /* Found a decimal point. */ - int got_digit; /* Seen any digits. */ + bool got_dot; /* Found a decimal point. */ + bool got_digit; /* Seen any digits. */ + bool hex = false; /* Look for hex float exponent. */ /* The exponent of the number. */ long int exponent; @@ -49,92 +51,182 @@ strtod (const char *nptr, char **endptr) goto noconv; } - s = nptr; + /* Use unsigned char for the ctype routines. */ + s = (unsigned char *) nptr; /* Eat whitespace. */ - while (isspace ((unsigned char) *s)) + while (isspace (*s)) ++s; /* Get the sign. */ - sign = *s == '-' ? -1 : 1; + negative = *s == '-'; if (*s == '-' || *s == '+') ++s; num = 0.0; - got_dot = 0; - got_digit = 0; + got_dot = false; + got_digit = false; exponent = 0; - for (;; ++s) + + /* Check for hex float. */ + if (*s == '0' && c_tolower (s[1]) == 'x' + && (c_isxdigit (s[2]) || ('.' == s[2] && c_isxdigit (s[3])))) { - if ('0' <= *s && *s <= '9') + hex = true; + s += 2; + for (;; ++s) { - got_digit = 1; + if (c_isxdigit (*s)) + { + got_digit = true; - /* Make sure that multiplication by 10 will not overflow. */ - if (num > DBL_MAX * 0.1) - /* The value of the digit doesn't matter, since we have already - gotten as many digits as can be represented in a `double'. - This doesn't necessarily mean the result will overflow. - The exponent may reduce it to within range. + /* Make sure that multiplication by 16 will not overflow. */ + if (num > DBL_MAX / 16) + /* The value of the digit doesn't matter, since we have already + gotten as many digits as can be represented in a `double'. + This doesn't necessarily mean the result will overflow. + The exponent may reduce it to within range. - We just need to record that there was another - digit so that we can multiply by 10 later. */ - ++exponent; + We just need to record that there was another + digit so that we can multiply by 16 later. */ + ++exponent; + else + num = ((num * 16.0) + + (c_tolower (*s) - (c_isdigit (*s) ? '0' : 'a' - 10))); + + /* Keep track of the number of digits after the decimal point. + If we just divided by 16 here, we would lose precision. */ + if (got_dot) + --exponent; + } + else if (!got_dot && *s == '.') + /* Record that we have found the decimal point. */ + got_dot = true; else - num = (num * 10.0) + (*s - '0'); - - /* Keep track of the number of digits after the decimal point. - If we just divided by 10 here, we would lose precision. */ - if (got_dot) - --exponent; + /* Any other character terminates the number. */ + break; + } + } + + /* Not a hex float. */ + else + { + for (;; ++s) + { + if (c_isdigit (*s)) + { + got_digit = true; + + /* Make sure that multiplication by 10 will not overflow. */ + if (num > DBL_MAX * 0.1) + /* The value of the digit doesn't matter, since we have already + gotten as many digits as can be represented in a `double'. + This doesn't necessarily mean the result will overflow. + The exponent may reduce it to within range. + + We just need to record that there was another + digit so that we can multiply by 10 later. */ + ++exponent; + else + num = (num * 10.0) + (*s - '0'); + + /* Keep track of the number of digits after the decimal point. + If we just divided by 10 here, we would lose precision. */ + if (got_dot) + --exponent; + } + else if (!got_dot && *s == '.') + /* Record that we have found the decimal point. */ + got_dot = true; + else + /* Any other character terminates the number. */ + break; } - else if (!got_dot && *s == '.') - /* Record that we have found the decimal point. */ - got_dot = 1; - else - /* Any other character terminates the number. */ - break; } if (!got_digit) - goto noconv; + { + /* Check for infinities and NaNs. */ + if (c_tolower (*s) == 'i' + && c_tolower (s[1]) == 'n' + && c_tolower (s[2]) == 'f') + { + s += 3; + num = HUGE_VAL; + if (c_tolower (*s) == 'i' + && c_tolower (s[1]) == 'n' + && c_tolower (s[2]) == 'i' + && c_tolower (s[3]) == 't' + && c_tolower (s[4]) == 'y') + s += 5; + goto valid; + } +#ifdef NAN + else if (c_tolower (*s) == 'n' + && c_tolower (s[1]) == 'a' + && c_tolower (s[2]) == 'n') + { + s += 3; + num = NAN; + /* Since nan() is implementation-defined, + we define it by ignoring . A nicer + implementation would populate the bits of the NaN + according to interpreting n-char-sequence as a + hexadecimal number, but the result is still a NaN. */ + if (*s == '(') + { + const unsigned char *p = s + 1; + while (c_isalnum (*p)) + p++; + if (*p == ')') + s = p + 1; + } + goto valid; + } +#endif + goto noconv; + } - if (tolower ((unsigned char) *s) == 'e') + if (c_tolower (*s) == (hex ? 'p' : 'e') && !isspace (s[1])) { /* Get the exponent specified after the `e' or `E'. */ int save = errno; char *end; - long int exp; + long int value; errno = 0; ++s; - exp = strtol (s, &end, 10); - if (errno == ERANGE) + value = strtol ((char *) s, &end, 10); + if (errno == ERANGE && num) { /* The exponent overflowed a `long int'. It is probably a safe assumption that an exponent that cannot be represented by a `long int' exceeds the limits of a `double'. */ if (endptr != NULL) *endptr = end; - if (exp < 0) + if (value < 0) goto underflow; else goto overflow; } - else if (end == s) + else if (end == (char *) s) /* There was no exponent. Reset END to point to the 'e' or 'E', so *ENDPTR will be set there. */ end = (char *) s - 1; errno = save; - s = end; - exponent += exp; + s = (unsigned char *) end; + exponent += value; } - if (endptr != NULL) - *endptr = (char *) s; - if (num == 0.0) - return 0.0; + goto valid; + + if (hex) + { + /* ldexp takes care of range errors. */ + num = ldexp (num, exponent); + goto valid; + } /* Multiply NUM by 10 to the EXPONENT power, checking for overflow and underflow. */ @@ -152,23 +244,29 @@ strtod (const char *nptr, char **endptr) num *= pow (10.0, (double) exponent); - return num * sign; + valid: + if (endptr != NULL) + *endptr = (char *) s; + return negative ? -num : num; -overflow: + overflow: /* Return an overflow error. */ + if (endptr != NULL) + *endptr = (char *) s; errno = ERANGE; - return HUGE_VAL * sign; + return negative ? -HUGE_VAL : HUGE_VAL; -underflow: + underflow: /* Return an underflow error. */ if (endptr != NULL) - *endptr = (char *) nptr; + *endptr = (char *) s; errno = ERANGE; - return 0.0; + return negative ? -0.0 : 0.0; -noconv: + noconv: /* There was no number. */ if (endptr != NULL) *endptr = (char *) nptr; + errno = EINVAL; return 0.0; } diff --git a/src/bin/coreutils/lib/strtoimax.c b/src/bin/coreutils/lib/strtoimax.c index 82dc4f0d75..ab9bcff3c7 100644 --- a/src/bin/coreutils/lib/strtoimax.c +++ b/src/bin/coreutils/lib/strtoimax.c @@ -3,10 +3,10 @@ Copyright (C) 1999, 2001, 2002, 2003, 2004, 2006 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Paul Eggert. */ diff --git a/src/bin/coreutils/lib/strtol.c b/src/bin/coreutils/lib/strtol.c index e14d3cf9cd..0b2c82a01c 100644 --- a/src/bin/coreutils/lib/strtol.c +++ b/src/bin/coreutils/lib/strtol.c @@ -7,9 +7,9 @@ NOTE: The canonical source of this file is maintained with the GNU C Library. Bugs can be reported to bug-glibc@gnu.org. - This program is free software; you can redistribute it and/or modify it + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2, or (at your option) any + Free Software Foundation; either version 3 of the License, or any later version. This program is distributed in the hope that it will be useful, @@ -18,8 +18,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ #ifdef _LIBC # define USE_NUMBER_GROUPING diff --git a/src/bin/coreutils/lib/strtoll.c b/src/bin/coreutils/lib/strtoll.c index f61f5ada64..ccc99cb43c 100644 --- a/src/bin/coreutils/lib/strtoll.c +++ b/src/bin/coreutils/lib/strtoll.c @@ -2,19 +2,18 @@ Copyright (C) 1995, 1996, 1997, 1999, 2001 Free Software Foundation, Inc. This file is part of the GNU C Library. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ #define QUAD 1 diff --git a/src/bin/coreutils/lib/strtoul.c b/src/bin/coreutils/lib/strtoul.c index 79ceed2f31..88dbfc0741 100644 --- a/src/bin/coreutils/lib/strtoul.c +++ b/src/bin/coreutils/lib/strtoul.c @@ -1,19 +1,18 @@ /* Copyright (C) 1991, 1997 Free Software Foundation, Inc. This file is part of the GNU C Library. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ #define UNSIGNED 1 diff --git a/src/bin/coreutils/lib/strtoull.c b/src/bin/coreutils/lib/strtoull.c index 6186bfb65a..eda4a70697 100644 --- a/src/bin/coreutils/lib/strtoull.c +++ b/src/bin/coreutils/lib/strtoull.c @@ -3,9 +3,9 @@ NOTE: The canonical source of this file is maintained with the GNU C Library. Bugs can be reported to bug-glibc@gnu.org. - This program is free software; you can redistribute it and/or modify it + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2, or (at your option) any + Free Software Foundation; either version 3 of the License, or any later version. This program is distributed in the hope that it will be useful, @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ #define QUAD 1 diff --git a/src/bin/coreutils/lib/strverscmp.c b/src/bin/coreutils/lib/strverscmp.c index f0776516f1..4fb147a885 100644 --- a/src/bin/coreutils/lib/strverscmp.c +++ b/src/bin/coreutils/lib/strverscmp.c @@ -1,3 +1,6 @@ +/* -*- buffer-read-only: t -*- vi: set ro: */ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 /* Compare strings while treating digits characters numerically. Copyright (C) 1997, 2000, 2002, 2004, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -5,7 +8,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) + the Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/src/bin/coreutils/lib/strverscmp.h b/src/bin/coreutils/lib/strverscmp.h deleted file mode 100644 index 7edeac5e4c..0000000000 --- a/src/bin/coreutils/lib/strverscmp.h +++ /dev/null @@ -1,24 +0,0 @@ -/* Compare strings while treating digits characters numerically. - - Copyright (C) 1997, 2003 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ - -#ifndef STRVERSCMP_H_ -# define STRVERSCMP_H_ - -int strverscmp (const char *, const char *); - -#endif /* not STRVERSCMP_H_ */ diff --git a/src/bin/coreutils/lib/sys/stat.h b/src/bin/coreutils/lib/sys/stat.h index a178ece601..90922ad73f 100644 --- a/src/bin/coreutils/lib/sys/stat.h +++ b/src/bin/coreutils/lib/sys/stat.h @@ -273,4 +273,35 @@ rpl_mkdir (char const *name, mode_t mode) # define mkdir rpl_mkdir #endif +/* Declare BSD extensions. */ + +#if 1 +/* Change the mode of FILENAME to MODE, without dereferencing it if FILENAME + denotes a symbolic link. */ +# if !0 +/* The lchmod replacement follows symbolic links. Callers should take + this into account; lchmod should be applied only to arguments that + are known to not be symbolic links. On hosts that lack lchmod, + this can lead to race conditions between the check and the + invocation of lchmod, but we know of no workarounds that are + reliable in general. You might try requesting support for lchmod + from your operating system supplier. */ +# define lchmod chmod +# endif +# if 0 /* assume already declared */ +extern int lchmod (const char *filename, mode_t mode); +# endif +#elif defined GNULIB_POSIXCHECK +# undef lchmod +# define lchmod(f,m) \ + (GL_LINK_WARNING ("lchmod is unportable - " \ + "use gnulib module lchmod for portability"), \ + lchmod (f, m)) +#endif + + +#ifdef __cplusplus +} +#endif + #endif /* _gl_SYS_STAT_H */ diff --git a/src/bin/coreutils/lib/sys_select.in.h b/src/bin/coreutils/lib/sys_select.in.h new file mode 100644 index 0000000000..6d2e039a5b --- /dev/null +++ b/src/bin/coreutils/lib/sys_select.in.h @@ -0,0 +1,96 @@ +/* -*- buffer-read-only: t -*- vi: set ro: */ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 +/* Substitute for . + Copyright (C) 2007-2009 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + +# if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +# endif + +/* On OSF/1, and include . + Simply delegate to the system's header in this case. */ +#if @HAVE_SYS_SELECT_H@ && defined __osf__ && (defined _SYS_TYPES_H_ && !defined _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TYPES_H) && defined _OSF_SOURCE + +# define _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TYPES_H +# @INCLUDE_NEXT@ @NEXT_SYS_SELECT_H@ + +#elif @HAVE_SYS_SELECT_H@ && defined __osf__ && (defined _SYS_TIME_H_ && !defined _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TIME_H) && defined _OSF_SOURCE + +# define _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TIME_H +# @INCLUDE_NEXT@ @NEXT_SYS_SELECT_H@ + +#else + +#ifndef _GL_SYS_SELECT_H + +#if @HAVE_SYS_SELECT_H@ + +/* On many platforms, assumes prior inclusion of + . */ +# include + +/* On OSF/1 4.0, provides only a forward declaration + of 'struct timeval', and no definition of this type.. */ +# include + +/* The include_next requires a split double-inclusion guard. */ +# @INCLUDE_NEXT@ @NEXT_SYS_SELECT_H@ + +#endif + +#ifndef _GL_SYS_SELECT_H +#define _GL_SYS_SELECT_H + +#if !@HAVE_SYS_SELECT_H@ + +/* A platform that lacks . */ + +# include + +/* The definition of GL_LINK_WARNING is copied here. */ + +# ifdef __cplusplus +extern "C" { +# endif + +# if @GNULIB_SELECT@ +# if @HAVE_WINSOCK2_H@ || @REPLACE_SELECT@ +# undef select +# define select rpl_select +extern int rpl_select (int, fd_set *, fd_set *, fd_set *, struct timeval *); +# endif +# elif @HAVE_WINSOCK2_H@ +# undef select +# define select select_used_without_requesting_gnulib_module_select +# elif defined GNULIB_POSIXCHECK +# undef select +# define select(n,r,w,e,t) \ + (GL_LINK_WARNING ("select is not always POSIX compliant - " \ + "use gnulib module select for portability"), \ + select (n, r, w, e, t)) +# endif + +# ifdef __cplusplus +} +# endif + +#endif + +#endif /* _GL_SYS_SELECT_H */ +#endif /* _GL_SYS_SELECT_H */ +#endif /* OSF/1 */ diff --git a/src/bin/coreutils/lib/sys_socket.in.h b/src/bin/coreutils/lib/sys_socket.in.h new file mode 100644 index 0000000000..e9367a7a03 --- /dev/null +++ b/src/bin/coreutils/lib/sys_socket.in.h @@ -0,0 +1,406 @@ +/* -*- buffer-read-only: t -*- vi: set ro: */ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 +/* Provide a sys/socket header file for systems lacking it (read: MinGW) + and for systems where it is incomplete. + Copyright (C) 2005-2009 Free Software Foundation, Inc. + Written by Simon Josefsson. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + +/* This file is supposed to be used on platforms that lack , + on platforms where cannot be included standalone, and on + platforms where does not provide all necessary definitions. + It is intended to provide definitions and prototypes needed by an + application. */ + +#ifndef _GL_SYS_SOCKET_H + +#if @HAVE_SYS_SOCKET_H@ + +# if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +# endif + +/* On many platforms, assumes prior inclusion of + . */ +# include + +/* The include_next requires a split double-inclusion guard. */ +# @INCLUDE_NEXT@ @NEXT_SYS_SOCKET_H@ + +#endif + +#ifndef _GL_SYS_SOCKET_H +#define _GL_SYS_SOCKET_H + +#if @HAVE_SYS_SOCKET_H@ + +/* A platform that has . */ + +/* For shutdown(). */ +# if !defined SHUT_RD +# define SHUT_RD 0 +# endif +# if !defined SHUT_WR +# define SHUT_WR 1 +# endif +# if !defined SHUT_RDWR +# define SHUT_RDWR 2 +# endif + +#else + +# ifdef __CYGWIN__ +# error "Cygwin does have a sys/socket.h, doesn't it?!?" +# endif + +/* A platform that lacks . + + Currently only MinGW is supported. See the gnulib manual regarding + Windows sockets. MinGW has the header files winsock2.h and + ws2tcpip.h that declare the sys/socket.h definitions we need. Note + that you can influence which definitions you get by setting the + WINVER symbol before including these two files. For example, + getaddrinfo is only available if _WIN32_WINNT >= 0x0501 (that + symbol is set indiriectly through WINVER). You can set this by + adding AC_DEFINE(WINVER, 0x0501) to configure.ac. Note that your + code may not run on older Windows releases then. My Windows 2000 + box was not able to run the code, for example. The situation is + slightly confusing because: + http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winsock/winsock/getaddrinfo_2.asp + suggests that getaddrinfo should be available on all Windows + releases. */ + + +# if @HAVE_WINSOCK2_H@ +# include +# endif +# if @HAVE_WS2TCPIP_H@ +# include +# endif + +/* For shutdown(). */ +# if !defined SHUT_RD && defined SD_RECEIVE +# define SHUT_RD SD_RECEIVE +# endif +# if !defined SHUT_WR && defined SD_SEND +# define SHUT_WR SD_SEND +# endif +# if !defined SHUT_RDWR && defined SD_BOTH +# define SHUT_RDWR SD_BOTH +# endif + +/* The definition of GL_LINK_WARNING is copied here. */ + +# if @HAVE_WINSOCK2_H@ +/* Include headers needed by the emulation code. */ +# include +# include + +typedef int socklen_t; + +# endif + +# ifdef __cplusplus +extern "C" { +# endif + +# if @HAVE_WINSOCK2_H@ + +/* Re-define FD_ISSET to avoid a WSA call while we are not using + network sockets. */ +static inline int +rpl_fd_isset (SOCKET fd, fd_set * set) +{ + u_int i; + if (set == NULL) + return 0; + + for (i = 0; i < set->fd_count; i++) + if (set->fd_array[i] == fd) + return 1; + + return 0; +} + +# undef FD_ISSET +# define FD_ISSET(fd, set) rpl_fd_isset(fd, set) + +# endif + +/* Wrap everything else to use libc file descriptors for sockets. */ + +# if @HAVE_WINSOCK2_H@ && !defined _GL_UNISTD_H +# undef close +# define close close_used_without_including_unistd_h +# endif + +# if @HAVE_WINSOCK2_H@ && !defined _GL_UNISTD_H +# undef gethostname +# define gethostname gethostname_used_without_including_unistd_h +# endif + +# if @GNULIB_SOCKET@ +# if @HAVE_WINSOCK2_H@ +# undef socket +# define socket rpl_socket +extern int rpl_socket (int, int, int protocol); +# endif +# elif @HAVE_WINSOCK2_H@ +# undef socket +# define socket socket_used_without_requesting_gnulib_module_socket +# elif defined GNULIB_POSIXCHECK +# undef socket +# define socket(d,t,p) \ + (GL_LINK_WARNING ("socket is not always POSIX compliant - " \ + "use gnulib module socket for portability"), \ + socket (d, t, p)) +# endif + +# if @GNULIB_CONNECT@ +# if @HAVE_WINSOCK2_H@ +# undef connect +# define connect rpl_connect +extern int rpl_connect (int, struct sockaddr *, int); +# endif +# elif @HAVE_WINSOCK2_H@ +# undef connect +# define connect socket_used_without_requesting_gnulib_module_connect +# elif defined GNULIB_POSIXCHECK +# undef connect +# define connect(s,a,l) \ + (GL_LINK_WARNING ("connect is not always POSIX compliant - " \ + "use gnulib module connect for portability"), \ + connect (s, a, l)) +# endif + +# if @GNULIB_ACCEPT@ +# if @HAVE_WINSOCK2_H@ +# undef accept +# define accept rpl_accept +extern int rpl_accept (int, struct sockaddr *, int *); +# endif +# elif @HAVE_WINSOCK2_H@ +# undef accept +# define accept accept_used_without_requesting_gnulib_module_accept +# elif defined GNULIB_POSIXCHECK +# undef accept +# define accept(s,a,l) \ + (GL_LINK_WARNING ("accept is not always POSIX compliant - " \ + "use gnulib module accept for portability"), \ + accept (s, a, l)) +# endif + +# if @GNULIB_BIND@ +# if @HAVE_WINSOCK2_H@ +# undef bind +# define bind rpl_bind +extern int rpl_bind (int, struct sockaddr *, int); +# endif +# elif @HAVE_WINSOCK2_H@ +# undef bind +# define bind bind_used_without_requesting_gnulib_module_bind +# elif defined GNULIB_POSIXCHECK +# undef bind +# define bind(s,a,l) \ + (GL_LINK_WARNING ("bind is not always POSIX compliant - " \ + "use gnulib module bind for portability"), \ + bind (s, a, l)) +# endif + +# if @GNULIB_GETPEERNAME@ +# if @HAVE_WINSOCK2_H@ +# undef getpeername +# define getpeername rpl_getpeername +extern int rpl_getpeername (int, struct sockaddr *, int *); +# endif +# elif @HAVE_WINSOCK2_H@ +# undef getpeername +# define getpeername getpeername_used_without_requesting_gnulib_module_getpeername +# elif defined GNULIB_POSIXCHECK +# undef getpeername +# define getpeername(s,a,l) \ + (GL_LINK_WARNING ("getpeername is not always POSIX compliant - " \ + "use gnulib module getpeername for portability"), \ + getpeername (s, a, l)) +# endif + +# if @GNULIB_GETSOCKNAME@ +# if @HAVE_WINSOCK2_H@ +# undef getsockname +# define getsockname rpl_getsockname +extern int rpl_getsockname (int, struct sockaddr *, int *); +# endif +# elif @HAVE_WINSOCK2_H@ +# undef getsockname +# define getsockname getsockname_used_without_requesting_gnulib_module_getsockname +# elif defined GNULIB_POSIXCHECK +# undef getsockname +# define getsockname(s,a,l) \ + (GL_LINK_WARNING ("getsockname is not always POSIX compliant - " \ + "use gnulib module getsockname for portability"), \ + getsockname (s, a, l)) +# endif + +# if @GNULIB_GETSOCKOPT@ +# if @HAVE_WINSOCK2_H@ +# undef getsockopt +# define getsockopt rpl_getsockopt +extern int rpl_getsockopt (int, int, int, void *, socklen_t *); +# endif +# elif @HAVE_WINSOCK2_H@ +# undef getsockopt +# define getsockopt getsockopt_used_without_requesting_gnulib_module_getsockopt +# elif defined GNULIB_POSIXCHECK +# undef getsockopt +# define getsockopt(s,lvl,o,v,l) \ + (GL_LINK_WARNING ("getsockopt is not always POSIX compliant - " \ + "use gnulib module getsockopt for portability"), \ + getsockopt (s, lvl, o, v, l)) +# endif + +# if @GNULIB_LISTEN@ +# if @HAVE_WINSOCK2_H@ +# undef listen +# define listen rpl_listen +extern int rpl_listen (int, int); +# endif +# elif @HAVE_WINSOCK2_H@ +# undef listen +# define listen listen_used_without_requesting_gnulib_module_listen +# elif defined GNULIB_POSIXCHECK +# undef listen +# define listen(s,b) \ + (GL_LINK_WARNING ("listen is not always POSIX compliant - " \ + "use gnulib module listen for portability"), \ + listen (s, b)) +# endif + +# if @GNULIB_RECV@ +# if @HAVE_WINSOCK2_H@ +# undef recv +# define recv rpl_recv +extern int rpl_recv (int, void *, int, int); +# endif +# elif @HAVE_WINSOCK2_H@ +# undef recv +# define recv recv_used_without_requesting_gnulib_module_recv +# elif defined GNULIB_POSIXCHECK +# undef recv +# define recv(s,b,n,f) \ + (GL_LINK_WARNING ("recv is not always POSIX compliant - " \ + "use gnulib module recv for portability"), \ + recv (s, b, n, f)) +# endif + +# if @GNULIB_SEND@ +# if @HAVE_WINSOCK2_H@ +# undef send +# define send rpl_send +extern int rpl_send (int, const void *, int, int); +# endif +# elif @HAVE_WINSOCK2_H@ +# undef send +# define send send_used_without_requesting_gnulib_module_send +# elif defined GNULIB_POSIXCHECK +# undef send +# define send(s,b,n,f) \ + (GL_LINK_WARNING ("send is not always POSIX compliant - " \ + "use gnulib module send for portability"), \ + send (s, b, n, f)) +# endif + +# if @GNULIB_RECVFROM@ +# if @HAVE_WINSOCK2_H@ +# undef recvfrom +# define recvfrom rpl_recvfrom +extern int rpl_recvfrom (int, void *, int, int, struct sockaddr *, int *); +# endif +# elif @HAVE_WINSOCK2_H@ +# undef recvfrom +# define recvfrom recvfrom_used_without_requesting_gnulib_module_recvfrom +# elif defined GNULIB_POSIXCHECK +# undef recvfrom +# define recvfrom(s,b,n,f,a,l) \ + (GL_LINK_WARNING ("recvfrom is not always POSIX compliant - " \ + "use gnulib module recvfrom for portability"), \ + recvfrom (s, b, n, f, a, l)) +# endif + +# if @GNULIB_SENDTO@ +# if @HAVE_WINSOCK2_H@ +# undef sendto +# define sendto rpl_sendto +extern int rpl_sendto (int, const void *, int, int, struct sockaddr *, int); +# endif +# elif @HAVE_WINSOCK2_H@ +# undef sendto +# define sendto sendto_used_without_requesting_gnulib_module_sendto +# elif defined GNULIB_POSIXCHECK +# undef sendto +# define sendto(s,b,n,f,a,l) \ + (GL_LINK_WARNING ("sendto is not always POSIX compliant - " \ + "use gnulib module sendto for portability"), \ + sendto (s, b, n, f, a, l)) +# endif + +# if @GNULIB_SETSOCKOPT@ +# if @HAVE_WINSOCK2_H@ +# undef setsockopt +# define setsockopt rpl_setsockopt +extern int rpl_setsockopt (int, int, int, const void *, socklen_t); +# endif +# elif @HAVE_WINSOCK2_H@ +# undef setsockopt +# define setsockopt setsockopt_used_without_requesting_gnulib_module_setsockopt +# elif defined GNULIB_POSIXCHECK +# undef setsockopt +# define setsockopt(s,lvl,o,v,l) \ + (GL_LINK_WARNING ("setsockopt is not always POSIX compliant - " \ + "use gnulib module setsockopt for portability"), \ + setsockopt (s, lvl, o, v, l)) +# endif + +# if @GNULIB_SHUTDOWN@ +# if @HAVE_WINSOCK2_H@ +# undef shutdown +# define shutdown rpl_shutdown +extern int rpl_shutdown (int, int); +# endif +# elif @HAVE_WINSOCK2_H@ +# undef shutdown +# define shutdown shutdown_used_without_requesting_gnulib_module_shutdown +# elif defined GNULIB_POSIXCHECK +# undef shutdown +# define shutdown(s,h) \ + (GL_LINK_WARNING ("shutdown is not always POSIX compliant - " \ + "use gnulib module shutdown for portability"), \ + shutdown (s, h)) +# endif + +# if @HAVE_WINSOCK2_H@ +# undef select +# define select select_used_without_including_sys_select_h +# endif + +# ifdef __cplusplus +} +# endif + +#endif /* HAVE_SYS_SOCKET_H */ + +#endif /* _GL_SYS_SOCKET_H */ +#endif /* _GL_SYS_SOCKET_H */ diff --git a/src/bin/coreutils/lib/stat_.h b/src/bin/coreutils/lib/sys_stat.in.h similarity index 66% rename from src/bin/coreutils/lib/stat_.h rename to src/bin/coreutils/lib/sys_stat.in.h index cbf5ac00ac..3a2c6e0bef 100644 --- a/src/bin/coreutils/lib/stat_.h +++ b/src/bin/coreutils/lib/sys_stat.in.h @@ -1,9 +1,12 @@ +/* -*- buffer-read-only: t -*- vi: set ro: */ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 /* Provide a more complete sys/stat header file. - Copyright (C) 2006 Free Software Foundation, Inc. + Copyright (C) 2005-2009 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) + the Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -17,13 +20,40 @@ /* Written by Eric Blake, Paul Eggert, and Jim Meyering. */ -#ifndef _gl_SYS_STAT_H -#define _gl_SYS_STAT_H - /* This file is supposed to be used on platforms where is incomplete. It is intended to provide definitions and prototypes needed by an application. Start with what the system provides. */ -#include @ABSOLUTE_SYS_STAT_H@ + +#if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +#endif + +#if defined __need_system_sys_stat_h +/* Special invocation convention. */ + +#@INCLUDE_NEXT@ @NEXT_SYS_STAT_H@ + +#else +/* Normal invocation convention. */ + +#ifndef _GL_SYS_STAT_H + +/* Get nlink_t. */ +#include + +/* The include_next requires a split double-inclusion guard. */ +#@INCLUDE_NEXT@ @NEXT_SYS_STAT_H@ + +#ifndef _GL_SYS_STAT_H +#define _GL_SYS_STAT_H + +/* The definition of GL_LINK_WARNING is copied here. */ + +/* Before doing "#define mkdir rpl_mkdir" below, we need to include all + headers that may declare mkdir(). */ +#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +# include +#endif #ifndef S_IFMT # define S_IFMT 0170000 @@ -251,17 +281,40 @@ # define S_IRWXUGO (S_IRWXU | S_IRWXG | S_IRWXO) #endif -/* mingw does not support symlinks, therefore it does not have lstat. But - without links, stat does just fine. */ -#if ! HAVE_LSTAT -# define lstat stat + +#ifdef __cplusplus +extern "C" { #endif + +#if @GNULIB_LSTAT@ +# if ! @HAVE_LSTAT@ +/* mingw does not support symlinks, therefore it does not have lstat. But + without links, stat does just fine. */ +# define lstat stat +# elif @REPLACE_LSTAT@ +# undef lstat +# define lstat rpl_lstat +extern int rpl_lstat (const char *name, struct stat *buf); +# endif +#elif defined GNULIB_POSIXCHECK +# undef lstat +# define lstat(p,b) \ + (GL_LINK_WARNING ("lstat is unportable - " \ + "use gnulib module lstat for portability"), \ + lstat (p, b)) +#endif + + +#if @REPLACE_MKDIR@ +# undef mkdir +# define mkdir rpl_mkdir +extern int mkdir (char const *name, mode_t mode); +#else /* mingw's _mkdir() function has 1 argument, but we pass 2 arguments. Additionally, it declares _mkdir (and depending on compile flags, an - alias mkdir), only in the nonstandard io.h. */ -#if ! HAVE_DECL_MKDIR && HAVE_IO_H -# include + alias mkdir), only in the nonstandard , which is included above. */ +# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ static inline int rpl_mkdir (char const *name, mode_t mode) @@ -269,7 +322,43 @@ rpl_mkdir (char const *name, mode_t mode) return _mkdir (name); } -# define mkdir rpl_mkdir +# define mkdir rpl_mkdir +# endif #endif -#endif /* _gl_SYS_STAT_H */ + +/* Declare BSD extensions. */ + +#if @GNULIB_LCHMOD@ +/* Change the mode of FILENAME to MODE, without dereferencing it if FILENAME + denotes a symbolic link. */ +# if !@HAVE_LCHMOD@ +/* The lchmod replacement follows symbolic links. Callers should take + this into account; lchmod should be applied only to arguments that + are known to not be symbolic links. On hosts that lack lchmod, + this can lead to race conditions between the check and the + invocation of lchmod, but we know of no workarounds that are + reliable in general. You might try requesting support for lchmod + from your operating system supplier. */ +# define lchmod chmod +# endif +# if 0 /* assume already declared */ +extern int lchmod (const char *filename, mode_t mode); +# endif +#elif defined GNULIB_POSIXCHECK +# undef lchmod +# define lchmod(f,m) \ + (GL_LINK_WARNING ("lchmod is unportable - " \ + "use gnulib module lchmod for portability"), \ + lchmod (f, m)) +#endif + + +#ifdef __cplusplus +} +#endif + + +#endif /* _GL_SYS_STAT_H */ +#endif /* _GL_SYS_STAT_H */ +#endif diff --git a/src/bin/coreutils/lib/sys_time_.h b/src/bin/coreutils/lib/sys_time.in.h similarity index 52% rename from src/bin/coreutils/lib/sys_time_.h rename to src/bin/coreutils/lib/sys_time.in.h index 46cdb70914..520cfec692 100644 --- a/src/bin/coreutils/lib/sys_time_.h +++ b/src/bin/coreutils/lib/sys_time.in.h @@ -1,10 +1,13 @@ +/* -*- buffer-read-only: t -*- vi: set ro: */ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 /* Provide a more complete sys/time.h. - Copyright (C) 2007 Free Software Foundation, Inc. + Copyright (C) 2007-2008 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) + the Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -18,27 +21,47 @@ /* Written by Paul Eggert. */ -#ifndef _gl_SYS_TIME_H -#define _gl_SYS_TIME_H - -#if @HAVE_SYS_TIME_H@ -# include @ABSOLUTE_SYS_TIME_H@ -#else -# include +#if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ #endif -#if ! @HAVE_STRUCT_TIMEVAL@ +#if defined _GL_SYS_TIME_H + +/* Simply delegate to the system's header, without adding anything. */ +# if @HAVE_SYS_TIME_H@ +# @INCLUDE_NEXT@ @NEXT_SYS_TIME_H@ +# endif + +#else + +# define _GL_SYS_TIME_H + +# if @HAVE_SYS_TIME_H@ +# @INCLUDE_NEXT@ @NEXT_SYS_TIME_H@ +# else +# include +# endif + +#ifdef __cplusplus +extern "C" { +#endif + +# if ! @HAVE_STRUCT_TIMEVAL@ struct timeval { time_t tv_sec; long int tv_usec; }; -#endif +# endif -#if @REPLACE_GETTIMEOFDAY@ -# undef gettimeofday -# define gettimeofday rpl_gettimeofday +# if @REPLACE_GETTIMEOFDAY@ +# undef gettimeofday +# define gettimeofday rpl_gettimeofday int gettimeofday (struct timeval *restrict, void *restrict); +# endif + +#ifdef __cplusplus +} #endif -#endif /* _gl_SYS_TIME_H */ +#endif /* _GL_SYS_TIME_H */ diff --git a/src/bin/coreutils/lib/t-fpending.c b/src/bin/coreutils/lib/t-fpending.c deleted file mode 100644 index 74ecae1bd1..0000000000 --- a/src/bin/coreutils/lib/t-fpending.c +++ /dev/null @@ -1,42 +0,0 @@ -/* Ensure that __fpending works. - - Copyright (C) 2004 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - - Written by Jim Meyering. */ - -#include -#include -#include - -#include "__fpending.h" - -int -main () -{ - if (__fpending (stdout) != 0) - abort (); - - fputs ("foo", stdout); - if (__fpending (stdout) != 3) - abort (); - - fflush (stdout); - if (__fpending (stdout) != 0) - abort (); - - exit (0); -} diff --git a/src/bin/coreutils/lib/tempname.c b/src/bin/coreutils/lib/tempname.c index e213600e3f..f9f351a5b7 100644 --- a/src/bin/coreutils/lib/tempname.c +++ b/src/bin/coreutils/lib/tempname.c @@ -4,25 +4,25 @@ 2000, 2001, 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ /* Extracted from glibc sysdeps/posix/tempname.c. See also tmpdir.c. */ #if !_LIBC # include # include "tempname.h" +# include "randint.h" #endif #include @@ -47,6 +47,7 @@ # define __GT_NOCREATE 3 #endif +#include #include #include #include @@ -78,34 +79,6 @@ # define __secure_getenv getenv #endif -#ifdef _LIBC -# include -# if HP_TIMING_AVAIL -# define RANDOM_BITS(Var) \ - if (__builtin_expect (value == UINT64_C (0), 0)) \ - { \ - /* If this is the first time this function is used initialize \ - the variable we accumulate the value in to some somewhat \ - random value. If we'd not do this programs at startup time \ - might have a reduced set of possible names, at least on slow \ - machines. */ \ - struct timeval tv; \ - __gettimeofday (&tv, NULL); \ - value = ((uint64_t) tv.tv_usec << 16) ^ tv.tv_sec; \ - } \ - HP_TIMING_NOW (Var) -# endif -#endif - -/* Use the widest available unsigned type if uint64_t is not - available. The algorithm below extracts a number less than 62**6 - (approximately 2**35.725) from uint64_t, so ancient hosts where - uintmax_t is only 32 bits lose about 3.725 bits of randomness, - which is better than not having mkstemp at all. */ -#if !defined UINT64_MAX && !defined uint64_t -# define uint64_t uintmax_t -#endif - #if _LIBC /* Return nonzero if DIR is an existent directory. */ static int @@ -179,12 +152,18 @@ __path_search (char *tmpl, size_t tmpl_len, const char *dir, const char *pfx, } #endif /* _LIBC */ +static inline bool +check_x_suffix (char const *s, size_t len) +{ + return strspn (s, "X") == len; +} + /* These are the characters used in temporary file names. */ static const char letters[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; -/* Generate a temporary file name based on TMPL. TMPL must match the - rules for mk[s]temp (i.e. end in "XXXXXX"). The name constructed +/* Generate a temporary file name based on TMPL. TMPL must end in a + a sequence of at least X_SUFFIX_LEN "X"s. The name constructed does not exist at the time of the call to __gen_tempname. TMPL is overwritten with the result. @@ -198,16 +177,15 @@ static const char letters[] = We use a clever algorithm to get hard-to-predict names. */ int -__gen_tempname (char *tmpl, int kind) +gen_tempname_len (char *tmpl, int kind, size_t x_suffix_len) { - int len; + size_t len; char *XXXXXX; - static uint64_t value; - uint64_t random_time_bits; unsigned int count; int fd = -1; int save_errno = errno; struct_stat64 st; + struct randint_source *rand_src; /* A lower bound on the number of temporary files to attempt to generate. The maximum total number of temporary file names that @@ -226,43 +204,28 @@ __gen_tempname (char *tmpl, int kind) #endif len = strlen (tmpl); - if (len < 6 || strcmp (&tmpl[len - 6], "XXXXXX")) + if (len < x_suffix_len || ! check_x_suffix (&tmpl[len - x_suffix_len], + x_suffix_len)) { __set_errno (EINVAL); return -1; } + rand_src = randint_all_new (NULL, 8); + if (! rand_src) + return -1; + /* This is where the Xs start. */ - XXXXXX = &tmpl[len - 6]; + XXXXXX = &tmpl[len - x_suffix_len]; - /* Get some more or less random data. */ -#ifdef RANDOM_BITS - RANDOM_BITS (random_time_bits); -#else - { - struct timeval tv; - __gettimeofday (&tv, NULL); - random_time_bits = ((uint64_t) tv.tv_usec << 16) ^ tv.tv_sec; - } -#endif - value += random_time_bits ^ __getpid (); - - for (count = 0; count < attempts; value += 7777, ++count) + for (count = 0; count < attempts; ++count) { - uint64_t v = value; + size_t i; - /* Fill in the random bits. */ - XXXXXX[0] = letters[v % 62]; - v /= 62; - XXXXXX[1] = letters[v % 62]; - v /= 62; - XXXXXX[2] = letters[v % 62]; - v /= 62; - XXXXXX[3] = letters[v % 62]; - v /= 62; - XXXXXX[4] = letters[v % 62]; - v /= 62; - XXXXXX[5] = letters[v % 62]; + for (i = 0; i < x_suffix_len; i++) + { + XXXXXX[i] = letters[randint_genmax (rand_src, sizeof letters - 2)]; + } switch (kind) { @@ -279,7 +242,7 @@ __gen_tempname (char *tmpl, int kind) break; case __GT_NOCREATE: - /* This case is backward from the other three. __gen_tempname + /* This case is backward from the other three. This function succeeds if __xstat fails because the name does not exist. Note the continue to bypass the common logic at the bottom of the loop. */ @@ -288,11 +251,15 @@ __gen_tempname (char *tmpl, int kind) if (errno == ENOENT) { __set_errno (save_errno); - return 0; + fd = 0; + goto done; } else - /* Give up now. */ - return -1; + { + /* Give up now. */ + fd = -1; + goto done; + } } continue; @@ -303,13 +270,32 @@ __gen_tempname (char *tmpl, int kind) if (fd >= 0) { __set_errno (save_errno); - return fd; + goto done; } else if (errno != EEXIST) - return -1; + { + fd = -1; + goto done; + } } + randint_all_free (rand_src); + /* We got out of the loop because we ran out of combinations to try. */ __set_errno (EEXIST); return -1; + + done: + { + int saved_errno = errno; + randint_all_free (rand_src); + __set_errno (saved_errno); + } + return fd; +} + +int +__gen_tempname (char *tmpl, int kind) +{ + return gen_tempname_len (tmpl, kind, 6); } diff --git a/src/bin/coreutils/lib/tempname.h b/src/bin/coreutils/lib/tempname.h index c51fa69424..e3b68af79e 100644 --- a/src/bin/coreutils/lib/tempname.h +++ b/src/bin/coreutils/lib/tempname.h @@ -1,11 +1,11 @@ /* Create a temporary file or directory. - Copyright (C) 2006 Free Software Foundation, Inc. + Copyright (C) 2006, 2007 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* header written by Eric Blake */ @@ -37,4 +36,6 @@ GT_DIR: create a directory, which will be mode 0700. We use a clever algorithm to get hard-to-predict names. */ +#include extern int gen_tempname (char *tmpl, int kind); +extern int gen_tempname_len (char *tmpl, int kind, size_t x_suffix_len); diff --git a/src/bin/coreutils/lib/time_.h b/src/bin/coreutils/lib/time.in.h similarity index 83% rename from src/bin/coreutils/lib/time_.h rename to src/bin/coreutils/lib/time.in.h index 5467d3dc88..2e51f32374 100644 --- a/src/bin/coreutils/lib/time_.h +++ b/src/bin/coreutils/lib/time.in.h @@ -1,10 +1,13 @@ +/* -*- buffer-read-only: t -*- vi: set ro: */ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 /* A more-standard . - Copyright (C) 2007 Free Software Foundation, Inc. + Copyright (C) 2007-2008 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) + the Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -16,15 +19,26 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +#if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +#endif + /* Don't get in the way of glibc when it includes time.h merely to declare a few standard symbols, rather than to declare all the - symbols. */ -#if defined __need_time_t || defined __need_clock_t || defined __need_timespec -# include @ABSOLUTE_TIME_H@ + symbols. Also, Solaris 8 eventually includes itself + recursively; if that is happening, just include the system + without adding our own declarations. */ +#if (defined __need_time_t || defined __need_clock_t \ + || defined __need_timespec \ + || defined _GL_TIME_H) + +# @INCLUDE_NEXT@ @NEXT_TIME_H@ + +#else -#elif ! defined _GL_TIME_H # define _GL_TIME_H -# include @ABSOLUTE_TIME_H@ + +# @INCLUDE_NEXT@ @NEXT_TIME_H@ # ifdef __cplusplus extern "C" { @@ -84,7 +98,7 @@ char *strptime (char const *restrict __buf, char const *restrict __format, # undef timegm # define timegm rpl_timegm time_t timegm (struct tm *__tm); -#endif +# endif /* Encourage applications to avoid unsafe functions that can overrun buffers when given outlandish struct tm values. Portable diff --git a/src/bin/coreutils/lib/time_r.c b/src/bin/coreutils/lib/time_r.c index 2b72692844..91f368950b 100644 --- a/src/bin/coreutils/lib/time_r.c +++ b/src/bin/coreutils/lib/time_r.c @@ -1,10 +1,13 @@ +/* -*- buffer-read-only: t -*- vi: set ro: */ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 /* Reentrant time functions like localtime_r. Copyright (C) 2003, 2006, 2007 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) + the Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/src/bin/coreutils/lib/timespec.h b/src/bin/coreutils/lib/timespec.h index cce2d663ad..3f51db8e4d 100644 --- a/src/bin/coreutils/lib/timespec.h +++ b/src/bin/coreutils/lib/timespec.h @@ -2,10 +2,10 @@ Copyright (C) 2000, 2002, 2004, 2005, 2007 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ #if ! defined TIMESPEC_H # define TIMESPEC_H diff --git a/src/bin/coreutils/lib/trim.c b/src/bin/coreutils/lib/trim.c new file mode 100644 index 0000000000..452d8bc740 --- /dev/null +++ b/src/bin/coreutils/lib/trim.c @@ -0,0 +1,133 @@ +/* Removes leading and/or trailing whitespaces + Copyright (C) 2006-2008 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* Written by Davide Angelocola */ + +#include + +/* Specification. */ +#include "trim.h" + +#include +#include +#include +#include + +#include "mbchar.h" +#include "mbiter.h" +#include "xalloc.h" + +/* Use this to suppress gcc's `...may be used before initialized' warnings. */ +#ifdef lint +# define IF_LINT(Code) Code +#else +# define IF_LINT(Code) /* empty */ +#endif + +char * +trim2(const char *s, int how) +{ + char *d; + + d = strdup(s); + + if (!d) + xalloc_die(); + + if (MB_CUR_MAX > 1) + { + mbi_iterator_t i; + + /* Trim leading whitespaces. */ + if (how != TRIM_TRAILING) + { + mbi_init (i, d, strlen (d)); + + for (; mbi_avail (i) && mb_isspace (mbi_cur (i)); mbi_advance (i)) + ; + + memmove (d, mbi_cur_ptr (i), strlen (mbi_cur_ptr (i)) + 1); + } + + /* Trim trailing whitespaces. */ + if (how != TRIM_LEADING) + { + int state = 0; + char *r IF_LINT (= NULL); /* used only while state = 2 */ + + mbi_init (i, d, strlen (d)); + + for (; mbi_avail (i); mbi_advance (i)) + { + if (state == 0 && mb_isspace (mbi_cur (i))) + { + state = 0; + continue; + } + + if (state == 0 && !mb_isspace (mbi_cur (i))) + { + state = 1; + continue; + } + + if (state == 1 && !mb_isspace (mbi_cur (i))) + { + state = 1; + continue; + } + + if (state == 1 && mb_isspace (mbi_cur (i))) + { + state = 2; + r = (char *) mbi_cur_ptr (i); + } + else if (state == 2 && mb_isspace (mbi_cur (i))) + { + state = 2; + } + else + { + state = 1; + } + } + + if (state == 2) + *r = '\0'; + } + } + else + { + char *p; + + /* Trim leading whitespaces. */ + if (how != TRIM_TRAILING) { + for (p = d; *p && isspace ((unsigned char) *p); p++) + ; + + memmove (d, p, strlen (p) + 1); + } + + /* Trim trailing whitespaces. */ + if (how != TRIM_LEADING) { + for (p = d + strlen (d) - 1; p >= d && isspace ((unsigned char) *p); p--) + *p = '\0'; + } + } + + return d; +} + diff --git a/src/bin/coreutils/lib/trim.h b/src/bin/coreutils/lib/trim.h new file mode 100644 index 0000000000..ae5708b58a --- /dev/null +++ b/src/bin/coreutils/lib/trim.h @@ -0,0 +1,34 @@ +/* Removes leading and/or trailing whitespaces + Copyright (C) 2006 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* Written by Davide Angelocola */ + +/* Trim mode. */ +#define TRIM_TRAILING 0 +#define TRIM_LEADING 1 +#define TRIM_BOTH 2 + +/* Removes trailing and leading whitespaces. */ +#define trim(s) trim2((s), TRIM_BOTH) + +/* Removes trailing whitespaces. */ +#define trim_trailing(s) trim2((s), TRIM_TRAILING) + +/* Removes leading whitespaces. */ +#define trim_leading(s) trim2((s), TRIM_LEADING) + +char *trim2(const char *, int); + diff --git a/src/bin/coreutils/lib/u64.h b/src/bin/coreutils/lib/u64.h index 1d581ecc71..34fd32be02 100644 --- a/src/bin/coreutils/lib/u64.h +++ b/src/bin/coreutils/lib/u64.h @@ -2,10 +2,10 @@ Copyright (C) 2006 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2, or (at your option) any - later version. + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Paul Eggert. */ diff --git a/src/bin/coreutils/lib/unicodeio.c b/src/bin/coreutils/lib/unicodeio.c index ceeff89886..781621c6f2 100644 --- a/src/bin/coreutils/lib/unicodeio.c +++ b/src/bin/coreutils/lib/unicodeio.c @@ -1,26 +1,22 @@ /* Unicode character output to streams with locale dependent encoding. - Copyright (C) 2000-2003, 2005, 2006 Free Software Foundation, Inc. + Copyright (C) 2000-2003, 2006, 2008 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ /* Written by Bruno Haible . */ -/* Note: This file requires the locale_charset() function. See in - libiconv-1.8/libcharset/INTEGRATE for how to obtain it. */ - #include /* Specification. */ @@ -40,17 +36,8 @@ #define _(msgid) gettext (msgid) #define N_(msgid) msgid -#ifndef __attribute__ -# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8) || __STRICT_ANSI__ -# define __attribute__(x) /* empty */ -# endif -#endif - -#ifndef ATTRIBUTE_UNUSED -# define ATTRIBUTE_UNUSED __attribute__ ((__unused__)) -#endif - #include "localcharset.h" +#include "unistr.h" /* When we pass a Unicode character to iconv(), we must pass it in a suitable encoding. The standardized Unicode encodings are @@ -64,42 +51,6 @@ So we use UTF-8. It supports characters up to \U7FFFFFFF and is unambiguously defined. */ -/* Stores the UTF-8 representation of the Unicode character wc in r[0..5]. - Returns the number of bytes stored, or -1 if wc is out of range. */ -static int -utf8_wctomb (unsigned char *r, unsigned int wc) -{ - int count; - - if (wc < 0x80) - count = 1; - else if (wc < 0x800) - count = 2; - else if (wc < 0x10000) - count = 3; - else if (wc < 0x200000) - count = 4; - else if (wc < 0x4000000) - count = 5; - else if (wc <= 0x7fffffff) - count = 6; - else - return -1; - - switch (count) - { - /* Note: code falls through cases! */ - case 6: r[5] = 0x80 | (wc & 0x3f); wc = wc >> 6; wc |= 0x4000000; - case 5: r[4] = 0x80 | (wc & 0x3f); wc = wc >> 6; wc |= 0x200000; - case 4: r[3] = 0x80 | (wc & 0x3f); wc = wc >> 6; wc |= 0x10000; - case 3: r[2] = 0x80 | (wc & 0x3f); wc = wc >> 6; wc |= 0x800; - case 2: r[1] = 0x80 | (wc & 0x3f); wc = wc >> 6; wc |= 0xc0; - case 1: r[0] = wc; - } - - return count; -} - /* Luckily, the encoding's name is platform independent. */ #define UTF8_NAME "UTF-8" @@ -155,7 +106,7 @@ unicode_to_mb (unsigned int code, } /* Convert the character to UTF-8. */ - count = utf8_wctomb ((unsigned char *) inbuf, code); + count = u8_uctomb ((unsigned char *) inbuf, code, sizeof (inbuf)); if (count < 0) return failure (code, N_("character out of range"), callback_arg); @@ -218,7 +169,7 @@ fwrite_success_callback (const char *buf, size_t buflen, void *callback_arg) /* Simple failure callback that displays an error and exits. */ static long exit_failure_callback (unsigned int code, const char *msg, - void *callback_arg ATTRIBUTE_UNUSED) + void *callback_arg _UNUSED_PARAMETER_) { if (msg == NULL) error (1, 0, _("cannot convert U+%04X to local character set"), code); @@ -231,8 +182,9 @@ exit_failure_callback (unsigned int code, const char *msg, /* Simple failure callback that displays a fallback representation in plain ASCII, using the same notation as ISO C99 strings. */ static long -fallback_failure_callback (unsigned int code, const char *msg ATTRIBUTE_UNUSED - , void *callback_arg) +fallback_failure_callback (unsigned int code, + const char *msg _UNUSED_PARAMETER_, + void *callback_arg) { FILE *stream = (FILE *) callback_arg; diff --git a/src/bin/coreutils/lib/unicodeio.h b/src/bin/coreutils/lib/unicodeio.h index 9560f6e071..5a3400ddf0 100644 --- a/src/bin/coreutils/lib/unicodeio.h +++ b/src/bin/coreutils/lib/unicodeio.h @@ -1,20 +1,19 @@ /* Unicode character output to streams with locale dependent encoding. - Copyright (C) 2000-2003, 2005 Free Software Foundation, Inc. + Copyright (C) 2000-2003, 2005, 2008 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ #ifndef UNICODEIO_H # define UNICODEIO_H @@ -39,11 +38,11 @@ extern long unicode_to_mb (unsigned int code, Upon failure, exit if exit_on_error is true, otherwise output a fallback notation. */ extern void print_unicode_char (FILE *stream, unsigned int code, - int exit_on_error); + int exit_on_error); /* Simple success callback that outputs the converted string. The STREAM is passed as callback_arg. */ extern long fwrite_success_callback (const char *buf, size_t buflen, - void *callback_arg); + void *callback_arg); #endif diff --git a/src/bin/coreutils/lib/unistd--.h b/src/bin/coreutils/lib/unistd--.h index 1fe6ce8b27..1a7fd785b0 100644 --- a/src/bin/coreutils/lib/unistd--.h +++ b/src/bin/coreutils/lib/unistd--.h @@ -2,10 +2,10 @@ Copyright (C) 2005 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Paul Eggert. */ diff --git a/src/bin/coreutils/lib/unistd-safer.h b/src/bin/coreutils/lib/unistd-safer.h index f95999d391..033e857d7a 100644 --- a/src/bin/coreutils/lib/unistd-safer.h +++ b/src/bin/coreutils/lib/unistd-safer.h @@ -2,10 +2,10 @@ Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Paul Eggert. */ diff --git a/src/bin/coreutils/lib/unistd.in.h b/src/bin/coreutils/lib/unistd.in.h new file mode 100644 index 0000000000..9a0c6bebac --- /dev/null +++ b/src/bin/coreutils/lib/unistd.in.h @@ -0,0 +1,581 @@ +/* -*- buffer-read-only: t -*- vi: set ro: */ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 +/* Substitute for and wrapper around . + Copyright (C) 2003-2009 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + +#ifndef _GL_UNISTD_H + +#if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +#endif + +/* The include_next requires a split double-inclusion guard. */ +#if @HAVE_UNISTD_H@ +# @INCLUDE_NEXT@ @NEXT_UNISTD_H@ +#endif + +#ifndef _GL_UNISTD_H +#define _GL_UNISTD_H + +/* mingw doesn't define the SEEK_* or *_FILENO macros in . */ +#if !(defined SEEK_CUR && defined SEEK_END && defined SEEK_SET) +# include +#endif + +/* mingw fails to declare _exit in . */ +/* mingw, BeOS, Haiku declare environ in , not in . */ +#include + +#if @GNULIB_WRITE@ && @REPLACE_WRITE@ && @GNULIB_UNISTD_H_SIGPIPE@ +/* Get ssize_t. */ +# include +#endif + +#if @GNULIB_GETHOSTNAME@ +/* Get all possible declarations of gethostname(). */ +# if @UNISTD_H_HAVE_WINSOCK2_H@ +# include +# if !defined _GL_SYS_SOCKET_H +# undef socket +# define socket socket_used_without_including_sys_socket_h +# undef connect +# define connect connect_used_without_including_sys_socket_h +# undef accept +# define accept accept_used_without_including_sys_socket_h +# undef bind +# define bind bind_used_without_including_sys_socket_h +# undef getpeername +# define getpeername getpeername_used_without_including_sys_socket_h +# undef getsockname +# define getsockname getsockname_used_without_including_sys_socket_h +# undef getsockopt +# define getsockopt getsockopt_used_without_including_sys_socket_h +# undef listen +# define listen listen_used_without_including_sys_socket_h +# undef recv +# define recv recv_used_without_including_sys_socket_h +# undef send +# define send send_used_without_including_sys_socket_h +# undef recvfrom +# define recvfrom recvfrom_used_without_including_sys_socket_h +# undef sendto +# define sendto sendto_used_without_including_sys_socket_h +# undef setsockopt +# define setsockopt setsockopt_used_without_including_sys_socket_h +# undef shutdown +# define shutdown shutdown_used_without_including_sys_socket_h +# endif +# if !defined _GL_SYS_SELECT_H +# undef select +# define select select_used_without_including_sys_select_h +# endif +# endif +#endif + +/* The definition of GL_LINK_WARNING is copied here. */ + + +/* OS/2 EMX lacks these macros. */ +#ifndef STDIN_FILENO +# define STDIN_FILENO 0 +#endif +#ifndef STDOUT_FILENO +# define STDOUT_FILENO 1 +#endif +#ifndef STDERR_FILENO +# define STDERR_FILENO 2 +#endif + +/* Declare overridden functions. */ + +#ifdef __cplusplus +extern "C" { +#endif + + +#if @GNULIB_CHOWN@ +# if @REPLACE_CHOWN@ +# ifndef REPLACE_CHOWN +# define REPLACE_CHOWN 1 +# endif +# if REPLACE_CHOWN +/* Change the owner of FILE to UID (if UID is not -1) and the group of FILE + to GID (if GID is not -1). Follow symbolic links. + Return 0 if successful, otherwise -1 and errno set. + See the POSIX:2001 specification + . */ +# define chown rpl_chown +extern int chown (const char *file, uid_t uid, gid_t gid); +# endif +# endif +#elif defined GNULIB_POSIXCHECK +# undef chown +# define chown(f,u,g) \ + (GL_LINK_WARNING ("chown fails to follow symlinks on some systems and " \ + "doesn't treat a uid or gid of -1 on some systems - " \ + "use gnulib module chown for portability"), \ + chown (f, u, g)) +#endif + + +#if @GNULIB_CLOSE@ +# if @REPLACE_CLOSE@ +/* Automatically included by modules that need a replacement for close. */ +# undef close +# define close rpl_close +extern int close (int); +# endif +#elif @UNISTD_H_HAVE_WINSOCK2_H@ +# undef close +# define close close_used_without_requesting_gnulib_module_close +#elif defined GNULIB_POSIXCHECK +# undef close +# define close(f) \ + (GL_LINK_WARNING ("close does not portably work on sockets - " \ + "use gnulib module close for portability"), \ + close (f)) +#endif + + +#if @GNULIB_DUP2@ +# if !@HAVE_DUP2@ +/* Copy the file descriptor OLDFD into file descriptor NEWFD. Do nothing if + NEWFD = OLDFD, otherwise close NEWFD first if it is open. + Return 0 if successful, otherwise -1 and errno set. + See the POSIX:2001 specification + . */ +extern int dup2 (int oldfd, int newfd); +# endif +#elif defined GNULIB_POSIXCHECK +# undef dup2 +# define dup2(o,n) \ + (GL_LINK_WARNING ("dup2 is unportable - " \ + "use gnulib module dup2 for portability"), \ + dup2 (o, n)) +#endif + + +#if @GNULIB_ENVIRON@ +# if !@HAVE_DECL_ENVIRON@ +/* Set of environment variables and values. An array of strings of the form + "VARIABLE=VALUE", terminated with a NULL. */ +# if defined __APPLE__ && defined __MACH__ +# include +# define environ (*_NSGetEnviron ()) +# else +extern char **environ; +# endif +# endif +#elif defined GNULIB_POSIXCHECK +# undef environ +# define environ \ + (GL_LINK_WARNING ("environ is unportable - " \ + "use gnulib module environ for portability"), \ + environ) +#endif + + +#if @GNULIB_EUIDACCESS@ +# if !@HAVE_EUIDACCESS@ +/* Like access(), except that is uses the effective user id and group id of + the current process. */ +extern int euidaccess (const char *filename, int mode); +# endif +#elif defined GNULIB_POSIXCHECK +# undef euidaccess +# define euidaccess(f,m) \ + (GL_LINK_WARNING ("euidaccess is unportable - " \ + "use gnulib module euidaccess for portability"), \ + euidaccess (f, m)) +#endif + + +#if @GNULIB_FCHDIR@ +# if @REPLACE_FCHDIR@ + +/* Change the process' current working directory to the directory on which + the given file descriptor is open. + Return 0 if successful, otherwise -1 and errno set. + See the POSIX:2001 specification + . */ +extern int fchdir (int /*fd*/); + +# define dup rpl_dup +extern int dup (int); +# define dup2 rpl_dup2 +extern int dup2 (int, int); + +# endif +#elif defined GNULIB_POSIXCHECK +# undef fchdir +# define fchdir(f) \ + (GL_LINK_WARNING ("fchdir is unportable - " \ + "use gnulib module fchdir for portability"), \ + fchdir (f)) +#endif + + +#if @GNULIB_FSYNC@ +/* Synchronize changes to a file. + Return 0 if successful, otherwise -1 and errno set. + See POSIX:2001 specification + . */ +# if !@HAVE_FSYNC@ +extern int fsync (int fd); +# endif +#elif defined GNULIB_POSIXCHECK +# undef fsync +# define fsync(fd) \ + (GL_LINK_WARNING ("fsync is unportable - " \ + "use gnulib module fsync for portability"), \ + fsync (fd)) +#endif + + +#if @GNULIB_FTRUNCATE@ +# if !@HAVE_FTRUNCATE@ +/* Change the size of the file to which FD is opened to become equal to LENGTH. + Return 0 if successful, otherwise -1 and errno set. + See the POSIX:2001 specification + . */ +extern int ftruncate (int fd, off_t length); +# endif +#elif defined GNULIB_POSIXCHECK +# undef ftruncate +# define ftruncate(f,l) \ + (GL_LINK_WARNING ("ftruncate is unportable - " \ + "use gnulib module ftruncate for portability"), \ + ftruncate (f, l)) +#endif + + +#if @GNULIB_GETCWD@ +/* Include the headers that might declare getcwd so that they will not + cause confusion if included after this file. */ +# include +# if @REPLACE_GETCWD@ +/* Get the name of the current working directory, and put it in SIZE bytes + of BUF. + Return BUF if successful, or NULL if the directory couldn't be determined + or SIZE was too small. + See the POSIX:2001 specification + . + Additionally, the gnulib module 'getcwd' guarantees the following GNU + extension: If BUF is NULL, an array is allocated with 'malloc'; the array + is SIZE bytes long, unless SIZE == 0, in which case it is as big as + necessary. */ +# define getcwd rpl_getcwd +extern char * getcwd (char *buf, size_t size); +# endif +#elif defined GNULIB_POSIXCHECK +# undef getcwd +# define getcwd(b,s) \ + (GL_LINK_WARNING ("getcwd is unportable - " \ + "use gnulib module getcwd for portability"), \ + getcwd (b, s)) +#endif + + +#if @GNULIB_GETDOMAINNAME@ +/* Return the NIS domain name of the machine. + WARNING! The NIS domain name is unrelated to the fully qualified host name + of the machine. It is also unrelated to email addresses. + WARNING! The NIS domain name is usually the empty string or "(none)" when + not using NIS. + + Put up to LEN bytes of the NIS domain name into NAME. + Null terminate it if the name is shorter than LEN. + If the NIS domain name is longer than LEN, set errno = EINVAL and return -1. + Return 0 if successful, otherwise set errno and return -1. */ +# if !@HAVE_GETDOMAINNAME@ +extern int getdomainname(char *name, size_t len); +# endif +#elif defined GNULIB_POSIXCHECK +# undef getdomainname +# define getdomainname(n,l) \ + (GL_LINK_WARNING ("getdomainname is unportable - " \ + "use gnulib module getdomainname for portability"), \ + getdomainname (n, l)) +#endif + + +#if @GNULIB_GETDTABLESIZE@ +# if !@HAVE_GETDTABLESIZE@ +/* Return the maximum number of file descriptors in the current process. */ +extern int getdtablesize (void); +# endif +#elif defined GNULIB_POSIXCHECK +# undef getdtablesize +# define getdtablesize() \ + (GL_LINK_WARNING ("getdtablesize is unportable - " \ + "use gnulib module getdtablesize for portability"), \ + getdtablesize ()) +#endif + + +#if @GNULIB_GETHOSTNAME@ +/* Return the standard host name of the machine. + WARNING! The host name may or may not be fully qualified. + + Put up to LEN bytes of the host name into NAME. + Null terminate it if the name is shorter than LEN. + If the host name is longer than LEN, set errno = EINVAL and return -1. + Return 0 if successful, otherwise set errno and return -1. */ +# if @UNISTD_H_HAVE_WINSOCK2_H@ +# undef gethostname +# define gethostname rpl_gethostname +# endif +# if @UNISTD_H_HAVE_WINSOCK2_H@ || !@HAVE_GETHOSTNAME@ +extern int gethostname(char *name, size_t len); +# endif +#elif @UNISTD_H_HAVE_WINSOCK2_H@ +# undef gethostname +# define gethostname gethostname_used_without_requesting_gnulib_module_gethostname +#elif defined GNULIB_POSIXCHECK +# undef gethostname +# define gethostname(n,l) \ + (GL_LINK_WARNING ("gethostname is unportable - " \ + "use gnulib module gethostname for portability"), \ + gethostname (n, l)) +#endif + + +#if @GNULIB_GETLOGIN_R@ +/* Copies the user's login name to NAME. + The array pointed to by NAME has room for SIZE bytes. + + Returns 0 if successful. Upon error, an error number is returned, or -1 in + the case that the login name cannot be found but no specific error is + provided (this case is hopefully rare but is left open by the POSIX spec). + + See . + */ +# if !@HAVE_DECL_GETLOGIN_R@ +# include +extern int getlogin_r (char *name, size_t size); +# endif +#elif defined GNULIB_POSIXCHECK +# undef getlogin_r +# define getlogin_r(n,s) \ + (GL_LINK_WARNING ("getlogin_r is unportable - " \ + "use gnulib module getlogin_r for portability"), \ + getlogin_r (n, s)) +#endif + + +#if @GNULIB_GETPAGESIZE@ +# if @REPLACE_GETPAGESIZE@ +# define getpagesize rpl_getpagesize +extern int getpagesize (void); +# elif !@HAVE_GETPAGESIZE@ +/* This is for POSIX systems. */ +# if !defined getpagesize && defined _SC_PAGESIZE +# if ! (defined __VMS && __VMS_VER < 70000000) +# define getpagesize() sysconf (_SC_PAGESIZE) +# endif +# endif +/* This is for older VMS. */ +# if !defined getpagesize && defined __VMS +# ifdef __ALPHA +# define getpagesize() 8192 +# else +# define getpagesize() 512 +# endif +# endif +/* This is for BeOS. */ +# if !defined getpagesize && @HAVE_OS_H@ +# include +# if defined B_PAGE_SIZE +# define getpagesize() B_PAGE_SIZE +# endif +# endif +/* This is for AmigaOS4.0. */ +# if !defined getpagesize && defined __amigaos4__ +# define getpagesize() 2048 +# endif +/* This is for older Unix systems. */ +# if !defined getpagesize && @HAVE_SYS_PARAM_H@ +# include +# ifdef EXEC_PAGESIZE +# define getpagesize() EXEC_PAGESIZE +# else +# ifdef NBPG +# ifndef CLSIZE +# define CLSIZE 1 +# endif +# define getpagesize() (NBPG * CLSIZE) +# else +# ifdef NBPC +# define getpagesize() NBPC +# endif +# endif +# endif +# endif +# endif +#elif defined GNULIB_POSIXCHECK +# undef getpagesize +# define getpagesize() \ + (GL_LINK_WARNING ("getpagesize is unportable - " \ + "use gnulib module getpagesize for portability"), \ + getpagesize ()) +#endif + + +#if @GNULIB_GETUSERSHELL@ +# if !@HAVE_GETUSERSHELL@ +/* Return the next valid login shell on the system, or NULL when the end of + the list has been reached. */ +extern char *getusershell (void); +/* Rewind to pointer that is advanced at each getusershell() call. */ +extern void setusershell (void); +/* Free the pointer that is advanced at each getusershell() call and + associated resources. */ +extern void endusershell (void); +# endif +#elif defined GNULIB_POSIXCHECK +# undef getusershell +# define getusershell() \ + (GL_LINK_WARNING ("getusershell is unportable - " \ + "use gnulib module getusershell for portability"), \ + getusershell ()) +# undef setusershell +# define setusershell() \ + (GL_LINK_WARNING ("setusershell is unportable - " \ + "use gnulib module getusershell for portability"), \ + setusershell ()) +# undef endusershell +# define endusershell() \ + (GL_LINK_WARNING ("endusershell is unportable - " \ + "use gnulib module getusershell for portability"), \ + endusershell ()) +#endif + + +#if @GNULIB_LCHOWN@ +# if @REPLACE_LCHOWN@ +/* Change the owner of FILE to UID (if UID is not -1) and the group of FILE + to GID (if GID is not -1). Do not follow symbolic links. + Return 0 if successful, otherwise -1 and errno set. + See the POSIX:2001 specification + . */ +# define lchown rpl_lchown +extern int lchown (char const *file, uid_t owner, gid_t group); +# endif +#elif defined GNULIB_POSIXCHECK +# undef lchown +# define lchown(f,u,g) \ + (GL_LINK_WARNING ("lchown is unportable to pre-POSIX.1-2001 " \ + "systems - use gnulib module lchown for portability"), \ + lchown (f, u, g)) +#endif + + +#if @GNULIB_LINK@ +/* Create a new hard link for an existing file. + Return 0 if successful, otherwise -1 and errno set. + See POSIX:2001 specification + . */ +# if !@HAVE_LINK@ +extern int link (const char *path1, const char *path2); +# endif +#elif defined GNULIB_POSIXCHECK +# undef link +# define link(path1,path2) \ + (GL_LINK_WARNING ("link is unportable - " \ + "use gnulib module link for portability"), \ + link (path1, path2)) +#endif + + +#if @GNULIB_LSEEK@ +# if @REPLACE_LSEEK@ +/* Set the offset of FD relative to SEEK_SET, SEEK_CUR, or SEEK_END. + Return the new offset if successful, otherwise -1 and errno set. + See the POSIX:2001 specification + . */ +# define lseek rpl_lseek + extern off_t lseek (int fd, off_t offset, int whence); +# endif +#elif defined GNULIB_POSIXCHECK +# undef lseek +# define lseek(f,o,w) \ + (GL_LINK_WARNING ("lseek does not fail with ESPIPE on pipes on some " \ + "systems - use gnulib module lseek for portability"), \ + lseek (f, o, w)) +#endif + + +#if @GNULIB_READLINK@ +/* Read the contents of the symbolic link FILE and place the first BUFSIZE + bytes of it into BUF. Return the number of bytes placed into BUF if + successful, otherwise -1 and errno set. + See the POSIX:2001 specification + . */ +# if !@HAVE_READLINK@ +# include +extern int readlink (const char *file, char *buf, size_t bufsize); +# endif +#elif defined GNULIB_POSIXCHECK +# undef readlink +# define readlink(f,b,s) \ + (GL_LINK_WARNING ("readlink is unportable - " \ + "use gnulib module readlink for portability"), \ + readlink (f, b, s)) +#endif + + +#if @GNULIB_SLEEP@ +/* Pause the execution of the current thread for N seconds. + Returns the number of seconds left to sleep. + See the POSIX:2001 specification + . */ +# if !@HAVE_SLEEP@ +extern unsigned int sleep (unsigned int n); +# endif +#elif defined GNULIB_POSIXCHECK +# undef sleep +# define sleep(n) \ + (GL_LINK_WARNING ("sleep is unportable - " \ + "use gnulib module sleep for portability"), \ + sleep (n)) +#endif + + +#if @GNULIB_WRITE@ && @REPLACE_WRITE@ && @GNULIB_UNISTD_H_SIGPIPE@ +/* Write up to COUNT bytes starting at BUF to file descriptor FD. + See the POSIX:2001 specification + . */ +# undef write +# define write rpl_write +extern ssize_t write (int fd, const void *buf, size_t count); +#endif + + +#ifdef FCHDIR_REPLACEMENT +/* gnulib internal function. */ +extern void _gl_unregister_fd (int fd); +#endif + + +#ifdef __cplusplus +} +#endif + + +#endif /* _GL_UNISTD_H */ +#endif /* _GL_UNISTD_H */ diff --git a/src/bin/coreutils/lib/unistd_.h b/src/bin/coreutils/lib/unistd_.h deleted file mode 100644 index 77df86116f..0000000000 --- a/src/bin/coreutils/lib/unistd_.h +++ /dev/null @@ -1,192 +0,0 @@ -/* Substitute for and wrapper around . - Copyright (C) 2004-2007 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ - -#ifndef _GL_UNISTD_H -#define _GL_UNISTD_H - -#if @HAVE_UNISTD_H@ -# include @ABSOLUTE_UNISTD_H@ -#endif - - -/* The definition of GL_LINK_WARNING is copied here. */ - - -/* Declare overridden functions. */ - -#ifdef __cplusplus -extern "C" { -#endif - - -#if @GNULIB_CHOWN@ -# if @REPLACE_CHOWN@ -/* Change the owner of FILE to UID (if UID is not -1) and the group of FILE - to GID (if GID is not -1). - Return 0 if successful, otherwise -1 and errno set. - See the POSIX:2001 specification - . */ -# define chown rpl_chown -extern int chown (const char *file, uid_t uid, gid_t gid); -# endif -#elif defined GNULIB_POSIXCHECK -# undef chown -# define chown(f,u,g) \ - (GL_LINK_WARNING ("chown fails to follow symlinks on some systems and " \ - "doesn't treat a uid or gid of -1 on some systems - " \ - "use gnulib module chown for portability"), \ - chown (f, u, g)) -#endif - - -#if @GNULIB_DUP2@ -# if !@HAVE_DUP2@ -/* Copy the file descriptor OLDFD into file descriptor NEWFD. Do nothing if - NEWFD = OLDFD, otherwise close NEWFD first if it is open. - Return 0 if successful, otherwise -1 and errno set. - See the POSIX:2001 specification - . */ -extern int dup2 (int oldfd, int newfd); -# endif -#elif defined GNULIB_POSIXCHECK -# undef dup2 -# define dup2(o,n) \ - (GL_LINK_WARNING ("dup2 is unportable - " \ - "use gnulib module dup2 for portability"), \ - dup2 (o, n)) -#endif - - -#if @GNULIB_FCHDIR@ -# if @REPLACE_FCHDIR@ - -/* Change the process' current working directory to the directory on which - the given file descriptor is open. - Return 0 if successful, otherwise -1 and errno set. - See the POSIX:2001 specification - . */ -extern int fchdir (int /*fd*/); - -# define close rpl_close -extern int close (int); -# define dup rpl_dup -extern int dup (int); -# define dup2 rpl_dup2 -extern int dup2 (int, int); - -# endif -#elif defined GNULIB_POSIXCHECK -# undef fchdir -# define fchdir(f) \ - (GL_LINK_WARNING ("fchdir is unportable - " \ - "use gnulib module fchdir for portability"), \ - fchdir (f)) -#endif - - -#if @GNULIB_FTRUNCATE@ -# if !@HAVE_FTRUNCATE@ -/* Change the size of the file to which FD is opened to become equal to LENGTH. - Return 0 if successful, otherwise -1 and errno set. - See the POSIX:2001 specification - . */ -extern int ftruncate (int fd, off_t length); -# endif -#elif defined GNULIB_POSIXCHECK -# undef ftruncate -# define ftruncate(f,l) \ - (GL_LINK_WARNING ("ftruncate is unportable - " \ - "use gnulib module ftruncate for portability"), \ - ftruncate (f, l)) -#endif - - -#if @GNULIB_GETCWD@ -/* Include the headers that might declare getcwd so that they will not - cause confusion if included after this file. */ -# include -# if @REPLACE_GETCWD@ -/* Get the name of the current working directory, and put it in SIZE bytes - of BUF. - Return BUF if successful, or NULL if the directory couldn't be determined - or SIZE was too small. - See the POSIX:2001 specification - . - Additionally, the gnulib module 'getcwd' guarantees the following GNU - extension: If BUF is NULL, an array is allocated with 'malloc'; the array - is SIZE bytes long, unless SIZE == 0, in which case it is as big as - necessary. */ -# define getcwd rpl_getcwd -extern char * getcwd (char *buf, size_t size); -# endif -#elif defined GNULIB_POSIXCHECK -# undef getcwd -# define getcwd(b,s) \ - (GL_LINK_WARNING ("getcwd is unportable - " \ - "use gnulib module getcwd for portability"), \ - getcwd (b, s)) -#endif - - -#if @GNULIB_GETLOGIN_R@ -/* Copies the user's login name to NAME. - The array pointed to by NAME has room for SIZE bytes. - - Returns 0 if successful. Upon error, an error number is returned, or -1 in - the case that the login name cannot be found but no specific error is - provided (this case is hopefully rare but is left open by the POSIX spec). - - See . - */ -# if !@HAVE_DECL_GETLOGIN_R@ -# include -extern int getlogin_r (char *name, size_t size); -# endif -#elif defined GNULIB_POSIXCHECK -# undef getlogin_r -# define getlogin_r(n,s) \ - (GL_LINK_WARNING ("getlogin_r is unportable - " \ - "use gnulib module getlogin_r for portability"), \ - getlogin_r (n, s)) -#endif - - -#if @GNULIB_READLINK@ -/* Read the contents of the symbolic link FILE and place the first BUFSIZE - bytes of it into BUF. Return the number of bytes placed into BUF if - successful, otherwise -1 and errno set. - See the POSIX:2001 specification - . */ -# if !@HAVE_READLINK@ -# include -extern int readlink (const char *file, char *buf, size_t bufsize); -# endif -#elif defined GNULIB_POSIXCHECK -# undef readlink -# define readlink(f,b,s) \ - (GL_LINK_WARNING ("readlink is unportable - " \ - "use gnulib module readlink for portability"), \ - readlink (f, b, s)) -#endif - - -#ifdef __cplusplus -} -#endif - - -#endif /* _GL_UNISTD_H */ diff --git a/src/bin/coreutils/lib/unistr.h b/src/bin/coreutils/lib/unistr.h new file mode 100644 index 0000000000..f2e1af1e84 --- /dev/null +++ b/src/bin/coreutils/lib/unistr.h @@ -0,0 +1,684 @@ +/* -*- buffer-read-only: t -*- vi: set ro: */ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 +/* Elementary Unicode string functions. + Copyright (C) 2001-2002, 2005-2009 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published + by the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#ifndef _UNISTR_H +#define _UNISTR_H + +#include "unitypes.h" + +/* Get bool. */ +#include + +/* Get size_t. */ +#include + +#ifdef __cplusplus +extern "C" { +#endif + + +/* Conventions: + + All functions prefixed with u8_ operate on UTF-8 encoded strings. + Their unit is an uint8_t (1 byte). + + All functions prefixed with u16_ operate on UTF-16 encoded strings. + Their unit is an uint16_t (a 2-byte word). + + All functions prefixed with u32_ operate on UCS-4 encoded strings. + Their unit is an uint32_t (a 4-byte word). + + All argument pairs (s, n) denote a Unicode string s[0..n-1] with exactly + n units. + + All arguments starting with "str" and the arguments of functions starting + with u8_str/u16_str/u32_str denote a NUL terminated string, i.e. a string + which terminates at the first NUL unit. This termination unit is + considered part of the string for all memory allocation purposes, but + is not considered part of the string for all other logical purposes. + + Functions returning a string result take a (resultbuf, lengthp) argument + pair. If resultbuf is not NULL and the result fits into *lengthp units, + it is put in resultbuf, and resultbuf is returned. Otherwise, a freshly + allocated string is returned. In both cases, *lengthp is set to the + length (number of units) of the returned string. In case of error, + NULL is returned and errno is set. */ + + +/* Elementary string checks. */ + +/* Check whether an UTF-8 string is well-formed. + Return NULL if valid, or a pointer to the first invalid unit otherwise. */ +extern const uint8_t * + u8_check (const uint8_t *s, size_t n); + +/* Check whether an UTF-16 string is well-formed. + Return NULL if valid, or a pointer to the first invalid unit otherwise. */ +extern const uint16_t * + u16_check (const uint16_t *s, size_t n); + +/* Check whether an UCS-4 string is well-formed. + Return NULL if valid, or a pointer to the first invalid unit otherwise. */ +extern const uint32_t * + u32_check (const uint32_t *s, size_t n); + + +/* Elementary string conversions. */ + +/* Convert an UTF-8 string to an UTF-16 string. */ +extern uint16_t * + u8_to_u16 (const uint8_t *s, size_t n, uint16_t *resultbuf, + size_t *lengthp); + +/* Convert an UTF-8 string to an UCS-4 string. */ +extern uint32_t * + u8_to_u32 (const uint8_t *s, size_t n, uint32_t *resultbuf, + size_t *lengthp); + +/* Convert an UTF-16 string to an UTF-8 string. */ +extern uint8_t * + u16_to_u8 (const uint16_t *s, size_t n, uint8_t *resultbuf, + size_t *lengthp); + +/* Convert an UTF-16 string to an UCS-4 string. */ +extern uint32_t * + u16_to_u32 (const uint16_t *s, size_t n, uint32_t *resultbuf, + size_t *lengthp); + +/* Convert an UCS-4 string to an UTF-8 string. */ +extern uint8_t * + u32_to_u8 (const uint32_t *s, size_t n, uint8_t *resultbuf, + size_t *lengthp); + +/* Convert an UCS-4 string to an UTF-16 string. */ +extern uint16_t * + u32_to_u16 (const uint32_t *s, size_t n, uint16_t *resultbuf, + size_t *lengthp); + + +/* Elementary string functions. */ + +/* Return the length (number of units) of the first character in S, which is + no longer than N. Return 0 if it is the NUL character. Return -1 upon + failure. */ +/* Similar to mblen(), except that s must not be NULL. */ +extern int + u8_mblen (const uint8_t *s, size_t n); +extern int + u16_mblen (const uint16_t *s, size_t n); +extern int + u32_mblen (const uint32_t *s, size_t n); + +/* Return the length (number of units) of the first character in S, putting + its 'ucs4_t' representation in *PUC. Upon failure, *PUC is set to 0xfffd, + and an appropriate number of units is returned. + The number of available units, N, must be > 0. */ +/* Similar to mbtowc(), except that puc and s must not be NULL, n must be > 0, + and the NUL character is not treated specially. */ +/* The variants with _safe suffix are safe, even if the library is compiled + without --enable-safety. */ + +#ifdef GNULIB_UNISTR_U8_MBTOUC_UNSAFE +# if !HAVE_INLINE +extern int + u8_mbtouc_unsafe (ucs4_t *puc, const uint8_t *s, size_t n); +# else +extern int + u8_mbtouc_unsafe_aux (ucs4_t *puc, const uint8_t *s, size_t n); +static inline int +u8_mbtouc_unsafe (ucs4_t *puc, const uint8_t *s, size_t n) +{ + uint8_t c = *s; + + if (c < 0x80) + { + *puc = c; + return 1; + } + else + return u8_mbtouc_unsafe_aux (puc, s, n); +} +# endif +#endif + +#ifdef GNULIB_UNISTR_U16_MBTOUC_UNSAFE +# if !HAVE_INLINE +extern int + u16_mbtouc_unsafe (ucs4_t *puc, const uint16_t *s, size_t n); +# else +extern int + u16_mbtouc_unsafe_aux (ucs4_t *puc, const uint16_t *s, size_t n); +static inline int +u16_mbtouc_unsafe (ucs4_t *puc, const uint16_t *s, size_t n) +{ + uint16_t c = *s; + + if (c < 0xd800 || c >= 0xe000) + { + *puc = c; + return 1; + } + else + return u16_mbtouc_unsafe_aux (puc, s, n); +} +# endif +#endif + +#ifdef GNULIB_UNISTR_U32_MBTOUC_UNSAFE +# if !HAVE_INLINE +extern int + u32_mbtouc_unsafe (ucs4_t *puc, const uint32_t *s, size_t n); +# else +static inline int +u32_mbtouc_unsafe (ucs4_t *puc, const uint32_t *s, size_t n _UNUSED_PARAMETER_) +{ + uint32_t c = *s; + +# if CONFIG_UNICODE_SAFETY + if (c < 0xd800 || (c >= 0xe000 && c < 0x110000)) +# endif + *puc = c; +# if CONFIG_UNICODE_SAFETY + else + /* invalid multibyte character */ + *puc = 0xfffd; +# endif + return 1; +} +# endif +#endif + +#ifdef GNULIB_UNISTR_U8_MBTOUC +# if !HAVE_INLINE +extern int + u8_mbtouc (ucs4_t *puc, const uint8_t *s, size_t n); +# else +extern int + u8_mbtouc_aux (ucs4_t *puc, const uint8_t *s, size_t n); +static inline int +u8_mbtouc (ucs4_t *puc, const uint8_t *s, size_t n) +{ + uint8_t c = *s; + + if (c < 0x80) + { + *puc = c; + return 1; + } + else + return u8_mbtouc_aux (puc, s, n); +} +# endif +#endif + +#ifdef GNULIB_UNISTR_U16_MBTOUC +# if !HAVE_INLINE +extern int + u16_mbtouc (ucs4_t *puc, const uint16_t *s, size_t n); +# else +extern int + u16_mbtouc_aux (ucs4_t *puc, const uint16_t *s, size_t n); +static inline int +u16_mbtouc (ucs4_t *puc, const uint16_t *s, size_t n) +{ + uint16_t c = *s; + + if (c < 0xd800 || c >= 0xe000) + { + *puc = c; + return 1; + } + else + return u16_mbtouc_aux (puc, s, n); +} +# endif +#endif + +#ifdef GNULIB_UNISTR_U32_MBTOUC +# if !HAVE_INLINE +extern int + u32_mbtouc (ucs4_t *puc, const uint32_t *s, size_t n); +# else +static inline int +u32_mbtouc (ucs4_t *puc, const uint32_t *s, size_t n _UNUSED_PARAMETER_) +{ + uint32_t c = *s; + + if (c < 0xd800 || (c >= 0xe000 && c < 0x110000)) + *puc = c; + else + /* invalid multibyte character */ + *puc = 0xfffd; + return 1; +} +# endif +#endif + +/* Return the length (number of units) of the first character in S, putting + its 'ucs4_t' representation in *PUC. Upon failure, *PUC is set to 0xfffd, + and -1 is returned for an invalid sequence of units, -2 is returned for an + incomplete sequence of units. + The number of available units, N, must be > 0. */ +/* Similar to u*_mbtouc(), except that the return value gives more details + about the failure, similar to mbrtowc(). */ + +#ifdef GNULIB_UNISTR_U8_MBTOUCR +extern int + u8_mbtoucr (ucs4_t *puc, const uint8_t *s, size_t n); +#endif + +#ifdef GNULIB_UNISTR_U16_MBTOUCR +extern int + u16_mbtoucr (ucs4_t *puc, const uint16_t *s, size_t n); +#endif + +#ifdef GNULIB_UNISTR_U32_MBTOUCR +extern int + u32_mbtoucr (ucs4_t *puc, const uint32_t *s, size_t n); +#endif + +/* Put the multibyte character represented by UC in S, returning its + length. Return -1 upon failure, -2 if the number of available units, N, + is too small. The latter case cannot occur if N >= 6/2/1, respectively. */ +/* Similar to wctomb(), except that s must not be NULL, and the argument n + must be specified. */ + +#ifdef GNULIB_UNISTR_U8_UCTOMB +/* Auxiliary function, also used by u8_chr, u8_strchr, u8_strrchr. */ +extern int + u8_uctomb_aux (uint8_t *s, ucs4_t uc, int n); +# if !HAVE_INLINE +extern int + u8_uctomb (uint8_t *s, ucs4_t uc, int n); +# else +static inline int +u8_uctomb (uint8_t *s, ucs4_t uc, int n) +{ + if (uc < 0x80 && n > 0) + { + s[0] = uc; + return 1; + } + else + return u8_uctomb_aux (s, uc, n); +} +# endif +#endif + +#ifdef GNULIB_UNISTR_U16_UCTOMB +/* Auxiliary function, also used by u16_chr, u16_strchr, u16_strrchr. */ +extern int + u16_uctomb_aux (uint16_t *s, ucs4_t uc, int n); +# if !HAVE_INLINE +extern int + u16_uctomb (uint16_t *s, ucs4_t uc, int n); +# else +static inline int +u16_uctomb (uint16_t *s, ucs4_t uc, int n) +{ + if (uc < 0xd800 && n > 0) + { + s[0] = uc; + return 1; + } + else + return u16_uctomb_aux (s, uc, n); +} +# endif +#endif + +#ifdef GNULIB_UNISTR_U32_UCTOMB +# if !HAVE_INLINE +extern int + u32_uctomb (uint32_t *s, ucs4_t uc, int n); +# else +static inline int +u32_uctomb (uint32_t *s, ucs4_t uc, int n) +{ + if (uc < 0xd800 || (uc >= 0xe000 && uc < 0x110000)) + { + if (n > 0) + { + *s = uc; + return 1; + } + else + return -2; + } + else + return -1; +} +# endif +#endif + +/* Copy N units from SRC to DEST. */ +/* Similar to memcpy(). */ +extern uint8_t * + u8_cpy (uint8_t *dest, const uint8_t *src, size_t n); +extern uint16_t * + u16_cpy (uint16_t *dest, const uint16_t *src, size_t n); +extern uint32_t * + u32_cpy (uint32_t *dest, const uint32_t *src, size_t n); + +/* Copy N units from SRC to DEST, guaranteeing correct behavior for + overlapping memory areas. */ +/* Similar to memmove(). */ +extern uint8_t * + u8_move (uint8_t *dest, const uint8_t *src, size_t n); +extern uint16_t * + u16_move (uint16_t *dest, const uint16_t *src, size_t n); +extern uint32_t * + u32_move (uint32_t *dest, const uint32_t *src, size_t n); + +/* Set the first N characters of S to UC. UC should be a character that + occupies only 1 unit. */ +/* Similar to memset(). */ +extern uint8_t * + u8_set (uint8_t *s, ucs4_t uc, size_t n); +extern uint16_t * + u16_set (uint16_t *s, ucs4_t uc, size_t n); +extern uint32_t * + u32_set (uint32_t *s, ucs4_t uc, size_t n); + +/* Compare S1 and S2, each of length N. */ +/* Similar to memcmp(). */ +extern int + u8_cmp (const uint8_t *s1, const uint8_t *s2, size_t n); +extern int + u16_cmp (const uint16_t *s1, const uint16_t *s2, size_t n); +extern int + u32_cmp (const uint32_t *s1, const uint32_t *s2, size_t n); + +/* Compare S1 and S2. */ +/* Similar to the gnulib function memcmp2(). */ +extern int + u8_cmp2 (const uint8_t *s1, size_t n1, const uint8_t *s2, size_t n2); +extern int + u16_cmp2 (const uint16_t *s1, size_t n1, const uint16_t *s2, size_t n2); +extern int + u32_cmp2 (const uint32_t *s1, size_t n1, const uint32_t *s2, size_t n2); + +/* Search the string at S for UC. */ +/* Similar to memchr(). */ +extern uint8_t * + u8_chr (const uint8_t *s, size_t n, ucs4_t uc); +extern uint16_t * + u16_chr (const uint16_t *s, size_t n, ucs4_t uc); +extern uint32_t * + u32_chr (const uint32_t *s, size_t n, ucs4_t uc); + +/* Count the number of Unicode characters in the N units from S. */ +/* Similar to mbsnlen(). */ +extern size_t + u8_mbsnlen (const uint8_t *s, size_t n); +extern size_t + u16_mbsnlen (const uint16_t *s, size_t n); +extern size_t + u32_mbsnlen (const uint32_t *s, size_t n); + +/* Elementary string functions with memory allocation. */ + +/* Make a freshly allocated copy of S, of length N. */ +extern uint8_t * + u8_cpy_alloc (const uint8_t *s, size_t n); +extern uint16_t * + u16_cpy_alloc (const uint16_t *s, size_t n); +extern uint32_t * + u32_cpy_alloc (const uint32_t *s, size_t n); + +/* Elementary string functions on NUL terminated strings. */ + +/* Return the length (number of units) of the first character in S. + Return 0 if it is the NUL character. Return -1 upon failure. */ +extern int + u8_strmblen (const uint8_t *s); +extern int + u16_strmblen (const uint16_t *s); +extern int + u32_strmblen (const uint32_t *s); + +/* Return the length (number of units) of the first character in S, putting + its 'ucs4_t' representation in *PUC. Return 0 if it is the NUL + character. Return -1 upon failure. */ +extern int + u8_strmbtouc (ucs4_t *puc, const uint8_t *s); +extern int + u16_strmbtouc (ucs4_t *puc, const uint16_t *s); +extern int + u32_strmbtouc (ucs4_t *puc, const uint32_t *s); + +/* Forward iteration step. Advances the pointer past the next character, + or returns NULL if the end of the string has been reached. Puts the + character's 'ucs4_t' representation in *PUC. */ +extern const uint8_t * + u8_next (ucs4_t *puc, const uint8_t *s); +extern const uint16_t * + u16_next (ucs4_t *puc, const uint16_t *s); +extern const uint32_t * + u32_next (ucs4_t *puc, const uint32_t *s); + +/* Backward iteration step. Advances the pointer to point to the previous + character, or returns NULL if the beginning of the string had been reached. + Puts the character's 'ucs4_t' representation in *PUC. */ +extern const uint8_t * + u8_prev (ucs4_t *puc, const uint8_t *s, const uint8_t *start); +extern const uint16_t * + u16_prev (ucs4_t *puc, const uint16_t *s, const uint16_t *start); +extern const uint32_t * + u32_prev (ucs4_t *puc, const uint32_t *s, const uint32_t *start); + +/* Return the number of units in S. */ +/* Similar to strlen(), wcslen(). */ +extern size_t + u8_strlen (const uint8_t *s); +extern size_t + u16_strlen (const uint16_t *s); +extern size_t + u32_strlen (const uint32_t *s); + +/* Return the number of units in S, but at most MAXLEN. */ +/* Similar to strnlen(), wcsnlen(). */ +extern size_t + u8_strnlen (const uint8_t *s, size_t maxlen); +extern size_t + u16_strnlen (const uint16_t *s, size_t maxlen); +extern size_t + u32_strnlen (const uint32_t *s, size_t maxlen); + +/* Copy SRC to DEST. */ +/* Similar to strcpy(), wcscpy(). */ +extern uint8_t * + u8_strcpy (uint8_t *dest, const uint8_t *src); +extern uint16_t * + u16_strcpy (uint16_t *dest, const uint16_t *src); +extern uint32_t * + u32_strcpy (uint32_t *dest, const uint32_t *src); + +/* Copy SRC to DEST, returning the address of the terminating NUL in DEST. */ +/* Similar to stpcpy(). */ +extern uint8_t * + u8_stpcpy (uint8_t *dest, const uint8_t *src); +extern uint16_t * + u16_stpcpy (uint16_t *dest, const uint16_t *src); +extern uint32_t * + u32_stpcpy (uint32_t *dest, const uint32_t *src); + +/* Copy no more than N units of SRC to DEST. */ +/* Similar to strncpy(), wcsncpy(). */ +extern uint8_t * + u8_strncpy (uint8_t *dest, const uint8_t *src, size_t n); +extern uint16_t * + u16_strncpy (uint16_t *dest, const uint16_t *src, size_t n); +extern uint32_t * + u32_strncpy (uint32_t *dest, const uint32_t *src, size_t n); + +/* Copy no more than N units of SRC to DEST, returning the address of + the last unit written into DEST. */ +/* Similar to stpncpy(). */ +extern uint8_t * + u8_stpncpy (uint8_t *dest, const uint8_t *src, size_t n); +extern uint16_t * + u16_stpncpy (uint16_t *dest, const uint16_t *src, size_t n); +extern uint32_t * + u32_stpncpy (uint32_t *dest, const uint32_t *src, size_t n); + +/* Append SRC onto DEST. */ +/* Similar to strcat(), wcscat(). */ +extern uint8_t * + u8_strcat (uint8_t *dest, const uint8_t *src); +extern uint16_t * + u16_strcat (uint16_t *dest, const uint16_t *src); +extern uint32_t * + u32_strcat (uint32_t *dest, const uint32_t *src); + +/* Append no more than N units of SRC onto DEST. */ +/* Similar to strncat(), wcsncat(). */ +extern uint8_t * + u8_strncat (uint8_t *dest, const uint8_t *src, size_t n); +extern uint16_t * + u16_strncat (uint16_t *dest, const uint16_t *src, size_t n); +extern uint32_t * + u32_strncat (uint32_t *dest, const uint32_t *src, size_t n); + +/* Compare S1 and S2. */ +/* Similar to strcmp(), wcscmp(). */ +extern int + u8_strcmp (const uint8_t *s1, const uint8_t *s2); +extern int + u16_strcmp (const uint16_t *s1, const uint16_t *s2); +extern int + u32_strcmp (const uint32_t *s1, const uint32_t *s2); + +/* Compare S1 and S2 using the collation rules of the current locale. + Return -1 if S1 < S2, 0 if S1 = S2, 1 if S1 > S2. + Upon failure, set errno and return any value. */ +/* Similar to strcoll(), wcscoll(). */ +extern int + u8_strcoll (const uint8_t *s1, const uint8_t *s2); +extern int + u16_strcoll (const uint16_t *s1, const uint16_t *s2); +extern int + u32_strcoll (const uint32_t *s1, const uint32_t *s2); + +/* Compare no more than N units of S1 and S2. */ +/* Similar to strncmp(), wcsncmp(). */ +extern int + u8_strncmp (const uint8_t *s1, const uint8_t *s2, size_t n); +extern int + u16_strncmp (const uint16_t *s1, const uint16_t *s2, size_t n); +extern int + u32_strncmp (const uint32_t *s1, const uint32_t *s2, size_t n); + +/* Duplicate S, returning an identical malloc'd string. */ +/* Similar to strdup(), wcsdup(). */ +extern uint8_t * + u8_strdup (const uint8_t *s); +extern uint16_t * + u16_strdup (const uint16_t *s); +extern uint32_t * + u32_strdup (const uint32_t *s); + +/* Find the first occurrence of UC in STR. */ +/* Similar to strchr(), wcschr(). */ +extern uint8_t * + u8_strchr (const uint8_t *str, ucs4_t uc); +extern uint16_t * + u16_strchr (const uint16_t *str, ucs4_t uc); +extern uint32_t * + u32_strchr (const uint32_t *str, ucs4_t uc); + +/* Find the last occurrence of UC in STR. */ +/* Similar to strrchr(), wcsrchr(). */ +extern uint8_t * + u8_strrchr (const uint8_t *str, ucs4_t uc); +extern uint16_t * + u16_strrchr (const uint16_t *str, ucs4_t uc); +extern uint32_t * + u32_strrchr (const uint32_t *str, ucs4_t uc); + +/* Return the length of the initial segment of STR which consists entirely + of Unicode characters not in REJECT. */ +/* Similar to strcspn(), wcscspn(). */ +extern size_t + u8_strcspn (const uint8_t *str, const uint8_t *reject); +extern size_t + u16_strcspn (const uint16_t *str, const uint16_t *reject); +extern size_t + u32_strcspn (const uint32_t *str, const uint32_t *reject); + +/* Return the length of the initial segment of STR which consists entirely + of Unicode characters in ACCEPT. */ +/* Similar to strspn(), wcsspn(). */ +extern size_t + u8_strspn (const uint8_t *str, const uint8_t *accept); +extern size_t + u16_strspn (const uint16_t *str, const uint16_t *accept); +extern size_t + u32_strspn (const uint32_t *str, const uint32_t *accept); + +/* Find the first occurrence in STR of any character in ACCEPT. */ +/* Similar to strpbrk(), wcspbrk(). */ +extern uint8_t * + u8_strpbrk (const uint8_t *str, const uint8_t *accept); +extern uint16_t * + u16_strpbrk (const uint16_t *str, const uint16_t *accept); +extern uint32_t * + u32_strpbrk (const uint32_t *str, const uint32_t *accept); + +/* Find the first occurrence of NEEDLE in HAYSTACK. */ +/* Similar to strstr(), wcsstr(). */ +extern uint8_t * + u8_strstr (const uint8_t *haystack, const uint8_t *needle); +extern uint16_t * + u16_strstr (const uint16_t *haystack, const uint16_t *needle); +extern uint32_t * + u32_strstr (const uint32_t *haystack, const uint32_t *needle); + +/* Test whether STR starts with PREFIX. */ +extern bool + u8_startswith (const uint8_t *str, const uint8_t *prefix); +extern bool + u16_startswith (const uint16_t *str, const uint16_t *prefix); +extern bool + u32_startswith (const uint32_t *str, const uint32_t *prefix); + +/* Test whether STR ends with SUFFIX. */ +extern bool + u8_endswith (const uint8_t *str, const uint8_t *suffix); +extern bool + u16_endswith (const uint16_t *str, const uint16_t *suffix); +extern bool + u32_endswith (const uint32_t *str, const uint32_t *suffix); + +/* Divide STR into tokens separated by characters in DELIM. + This interface is actually more similar to wcstok than to strtok. */ +/* Similar to strtok_r(), wcstok(). */ +extern uint8_t * + u8_strtok (uint8_t *str, const uint8_t *delim, uint8_t **ptr); +extern uint16_t * + u16_strtok (uint16_t *str, const uint16_t *delim, uint16_t **ptr); +extern uint32_t * + u32_strtok (uint32_t *str, const uint32_t *delim, uint32_t **ptr); + + +#ifdef __cplusplus +} +#endif + +#endif /* _UNISTR_H */ diff --git a/src/bin/coreutils/lib/unistr/u8-uctomb-aux.c b/src/bin/coreutils/lib/unistr/u8-uctomb-aux.c new file mode 100644 index 0000000000..7fee7f66f1 --- /dev/null +++ b/src/bin/coreutils/lib/unistr/u8-uctomb-aux.c @@ -0,0 +1,72 @@ +/* -*- buffer-read-only: t -*- vi: set ro: */ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 +/* Conversion UCS-4 to UTF-8. + Copyright (C) 2002, 2006-2007 Free Software Foundation, Inc. + Written by Bruno Haible , 2002. + + This program is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published + by the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#include + +/* Specification. */ +#include "unistr.h" + +int +u8_uctomb_aux (uint8_t *s, ucs4_t uc, int n) +{ + int count; + + if (uc < 0x80) + /* The case n >= 1 is already handled by the caller. */ + return -2; + else if (uc < 0x800) + count = 2; + else if (uc < 0x10000) + { + if (uc < 0xd800 || uc >= 0xe000) + count = 3; + else + return -1; + } +#if 0 + else if (uc < 0x200000) + count = 4; + else if (uc < 0x4000000) + count = 5; + else if (uc <= 0x7fffffff) + count = 6; +#else + else if (uc < 0x110000) + count = 4; +#endif + else + return -1; + + if (n < count) + return -2; + + switch (count) /* note: code falls through cases! */ + { +#if 0 + case 6: s[5] = 0x80 | (uc & 0x3f); uc = uc >> 6; uc |= 0x4000000; + case 5: s[4] = 0x80 | (uc & 0x3f); uc = uc >> 6; uc |= 0x200000; +#endif + case 4: s[3] = 0x80 | (uc & 0x3f); uc = uc >> 6; uc |= 0x10000; + case 3: s[2] = 0x80 | (uc & 0x3f); uc = uc >> 6; uc |= 0x800; + case 2: s[1] = 0x80 | (uc & 0x3f); uc = uc >> 6; uc |= 0xc0; + /*case 1:*/ s[0] = uc; + } + return count; +} diff --git a/src/bin/coreutils/lib/unistr/u8-uctomb.c b/src/bin/coreutils/lib/unistr/u8-uctomb.c new file mode 100644 index 0000000000..a1d2ef4b3c --- /dev/null +++ b/src/bin/coreutils/lib/unistr/u8-uctomb.c @@ -0,0 +1,91 @@ +/* -*- buffer-read-only: t -*- vi: set ro: */ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 +/* Store a character in UTF-8 string. + Copyright (C) 2002, 2005-2006, 2009 Free Software Foundation, Inc. + Written by Bruno Haible , 2002. + + This program is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published + by the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#include + +#if defined IN_LIBUNISTRING +/* Tell unistr.h to declare u8_uctomb as 'extern', not 'static inline'. */ +# include "unistring-notinline.h" +#endif + +/* Specification. */ +#include "unistr.h" + +#if !HAVE_INLINE + +int +u8_uctomb (uint8_t *s, ucs4_t uc, int n) +{ + if (uc < 0x80) + { + if (n > 0) + { + s[0] = uc; + return 1; + } + /* else return -2, below. */ + } + else + { + int count; + + if (uc < 0x800) + count = 2; + else if (uc < 0x10000) + { + if (uc < 0xd800 || uc >= 0xe000) + count = 3; + else + return -1; + } +#if 0 + else if (uc < 0x200000) + count = 4; + else if (uc < 0x4000000) + count = 5; + else if (uc <= 0x7fffffff) + count = 6; +#else + else if (uc < 0x110000) + count = 4; +#endif + else + return -1; + + if (n >= count) + { + switch (count) /* note: code falls through cases! */ + { +#if 0 + case 6: s[5] = 0x80 | (uc & 0x3f); uc = uc >> 6; uc |= 0x4000000; + case 5: s[4] = 0x80 | (uc & 0x3f); uc = uc >> 6; uc |= 0x200000; +#endif + case 4: s[3] = 0x80 | (uc & 0x3f); uc = uc >> 6; uc |= 0x10000; + case 3: s[2] = 0x80 | (uc & 0x3f); uc = uc >> 6; uc |= 0x800; + case 2: s[1] = 0x80 | (uc & 0x3f); uc = uc >> 6; uc |= 0xc0; + /*case 1:*/ s[0] = uc; + } + return count; + } + } + return -2; +} + +#endif diff --git a/src/bin/coreutils/lib/unitypes.h b/src/bin/coreutils/lib/unitypes.h new file mode 100644 index 0000000000..60aa986d30 --- /dev/null +++ b/src/bin/coreutils/lib/unitypes.h @@ -0,0 +1,29 @@ +/* -*- buffer-read-only: t -*- vi: set ro: */ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 +/* Elementary types for the GNU UniString library. + Copyright (C) 2002, 2005-2006 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published + by the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#ifndef _UNITYPES_H +#define _UNITYPES_H + +/* Get uint8_t, uint16_t, uint32_t. */ +#include + +/* Type representing a Unicode character. */ +typedef uint32_t ucs4_t; + +#endif /* _UNITYPES_H */ diff --git a/src/bin/coreutils/lib/uniwidth.h b/src/bin/coreutils/lib/uniwidth.h new file mode 100644 index 0000000000..fbc68a5e63 --- /dev/null +++ b/src/bin/coreutils/lib/uniwidth.h @@ -0,0 +1,67 @@ +/* -*- buffer-read-only: t -*- vi: set ro: */ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 +/* Display width functions. + Copyright (C) 2001-2002, 2005, 2007 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published + by the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#ifndef _UNIWIDTH_H +#define _UNIWIDTH_H + +#include "unitypes.h" + +/* Get size_t. */ +#include + +/* Get locale_charset() declaration. */ +#include "localcharset.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/* Display width. */ + +/* These functions are locale dependent. The encoding argument identifies + the encoding (e.g. "ISO-8859-2" for Polish). */ + +/* Determine number of column positions required for UC. */ +extern int + uc_width (ucs4_t uc, const char *encoding); + +/* Determine number of column positions required for first N units + (or fewer if S ends before this) in S. */ +extern int + u8_width (const uint8_t *s, size_t n, const char *encoding); +extern int + u16_width (const uint16_t *s, size_t n, const char *encoding); +extern int + u32_width (const uint32_t *s, size_t n, const char *encoding); + +/* Determine number of column positions required for S. */ +extern int + u8_strwidth (const uint8_t *s, const char *encoding); +extern int + u16_strwidth (const uint16_t *s, const char *encoding); +extern int + u32_strwidth (const uint32_t *s, const char *encoding); + + +#ifdef __cplusplus +} +#endif + +#endif /* _UNIWIDTH_H */ diff --git a/src/bin/coreutils/lib/uniwidth/cjk.h b/src/bin/coreutils/lib/uniwidth/cjk.h new file mode 100644 index 0000000000..61382bde60 --- /dev/null +++ b/src/bin/coreutils/lib/uniwidth/cjk.h @@ -0,0 +1,40 @@ +/* -*- buffer-read-only: t -*- vi: set ro: */ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 +/* Test for CJK encoding. + Copyright (C) 2001-2002, 2005-2007 Free Software Foundation, Inc. + Written by Bruno Haible , 2002. + + This program is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published + by the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#include "streq.h" + +static int +is_cjk_encoding (const char *encoding) +{ + if (0 + /* Legacy Japanese encodings */ + || STREQ (encoding, "EUC-JP", 'E', 'U', 'C', '-', 'J', 'P', 0, 0, 0) + /* Legacy Chinese encodings */ + || STREQ (encoding, "GB2312", 'G', 'B', '2', '3', '1', '2', 0, 0, 0) + || STREQ (encoding, "GBK", 'G', 'B', 'K', 0, 0, 0, 0, 0, 0) + || STREQ (encoding, "EUC-TW", 'E', 'U', 'C', '-', 'T', 'W', 0, 0, 0) + || STREQ (encoding, "BIG5", 'B', 'I', 'G', '5', 0, 0, 0, 0, 0) + /* Legacy Korean encodings */ + || STREQ (encoding, "EUC-KR", 'E', 'U', 'C', '-', 'K', 'R', 0, 0, 0) + || STREQ (encoding, "CP949", 'C', 'P', '9', '4', '9', 0, 0, 0, 0) + || STREQ (encoding, "JOHAB", 'J', 'O', 'H', 'A', 'B', 0, 0, 0, 0)) + return 1; + return 0; +} diff --git a/src/bin/coreutils/lib/uniwidth/width.c b/src/bin/coreutils/lib/uniwidth/width.c new file mode 100644 index 0000000000..71e538fd8c --- /dev/null +++ b/src/bin/coreutils/lib/uniwidth/width.c @@ -0,0 +1,362 @@ +/* -*- buffer-read-only: t -*- vi: set ro: */ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 +/* Determine display width of Unicode character. + Copyright (C) 2001-2002, 2006-2009 Free Software Foundation, Inc. + Written by Bruno Haible , 2002. + + This program is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published + by the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#include + +/* Specification. */ +#include "uniwidth.h" + +#include "cjk.h" + +/* + * Non-spacing attribute table. + * Consists of: + * - Non-spacing characters; generated from PropList.txt or + * "grep '^[^;]*;[^;]*;[^;]*;[^;]*;NSM;' UnicodeData.txt" + * - Format control characters; generated from + * "grep '^[^;]*;[^;]*;Cf;' UnicodeData.txt" + * - Zero width characters; generated from + * "grep '^[^;]*;ZERO WIDTH ' UnicodeData.txt" + */ +static const unsigned char nonspacing_table_data[26*64] = { + /* 0x0000-0x01ff */ + 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, /* 0x0000-0x003f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, /* 0x0040-0x007f */ + 0xff, 0xff, 0xff, 0xff, 0x00, 0x20, 0x00, 0x00, /* 0x0080-0x00bf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00c0-0x00ff */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0100-0x013f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0140-0x017f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0180-0x01bf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x01c0-0x01ff */ + /* 0x0200-0x03ff */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0200-0x023f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0240-0x027f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0280-0x02bf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x02c0-0x02ff */ + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x0300-0x033f */ + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, /* 0x0340-0x037f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0380-0x03bf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x03c0-0x03ff */ + /* 0x0400-0x05ff */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0400-0x043f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0440-0x047f */ + 0xf8, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0480-0x04bf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x04c0-0x04ff */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0500-0x053f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0540-0x057f */ + 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xbf, /* 0x0580-0x05bf */ + 0xb6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x05c0-0x05ff */ + /* 0x0600-0x07ff */ + 0x0f, 0x00, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, /* 0x0600-0x063f */ + 0x00, 0xf8, 0xff, 0x7f, 0x00, 0x00, 0x01, 0x00, /* 0x0640-0x067f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0680-0x06bf */ + 0x00, 0x00, 0xc0, 0xff, 0x9f, 0x3d, 0x00, 0x00, /* 0x06c0-0x06ff */ + 0x00, 0x80, 0x02, 0x00, 0x00, 0x00, 0xff, 0xff, /* 0x0700-0x073f */ + 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0740-0x077f */ + 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x01, 0x00, /* 0x0780-0x07bf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x0f, 0x00, /* 0x07c0-0x07ff */ + /* 0x0800-0x09ff */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0800-0x083f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0840-0x087f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0880-0x08bf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08c0-0x08ff */ + 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, /* 0x0900-0x093f */ + 0xfe, 0x21, 0x1e, 0x00, 0x0c, 0x00, 0x00, 0x00, /* 0x0940-0x097f */ + 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, /* 0x0980-0x09bf */ + 0x1e, 0x20, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, /* 0x09c0-0x09ff */ + /* 0x0a00-0x0bff */ + 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, /* 0x0a00-0x0a3f */ + 0x86, 0x39, 0x02, 0x00, 0x00, 0x00, 0x23, 0x00, /* 0x0a40-0x0a7f */ + 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, /* 0x0a80-0x0abf */ + 0xbe, 0x21, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, /* 0x0ac0-0x0aff */ + 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x90, /* 0x0b00-0x0b3f */ + 0x1e, 0x20, 0x40, 0x00, 0x0c, 0x00, 0x00, 0x00, /* 0x0b40-0x0b7f */ + 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0b80-0x0bbf */ + 0x01, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0bc0-0x0bff */ + /* 0x0c00-0x0dff */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, /* 0x0c00-0x0c3f */ + 0xc1, 0x3d, 0x60, 0x00, 0x0c, 0x00, 0x00, 0x00, /* 0x0c40-0x0c7f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, /* 0x0c80-0x0cbf */ + 0x00, 0x30, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, /* 0x0cc0-0x0cff */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0d00-0x0d3f */ + 0x1e, 0x20, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, /* 0x0d40-0x0d7f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0d80-0x0dbf */ + 0x00, 0x04, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0dc0-0x0dff */ + /* 0x0e00-0x0fff */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf2, 0x07, /* 0x0e00-0x0e3f */ + 0x80, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0e40-0x0e7f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf2, 0x1b, /* 0x0e80-0x0ebf */ + 0x00, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0ec0-0x0eff */ + 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0xa0, 0x02, /* 0x0f00-0x0f3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x7f, /* 0x0f40-0x0f7f */ + 0xdf, 0x00, 0xff, 0xfe, 0xff, 0xff, 0xff, 0x1f, /* 0x0f80-0x0fbf */ + 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0fc0-0x0fff */ + /* 0x1000-0x11ff */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xfd, 0x66, /* 0x1000-0x103f */ + 0x00, 0x00, 0x00, 0xc3, 0x01, 0x00, 0x1e, 0x00, /* 0x1040-0x107f */ + 0x64, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1080-0x10bf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10c0-0x10ff */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1100-0x113f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1140-0x117f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1180-0x11bf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x11c0-0x11ff */ + /* 0x1200-0x13ff */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1200-0x123f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1240-0x127f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1280-0x12bf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x12c0-0x12ff */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1300-0x133f */ + 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, /* 0x1340-0x137f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1380-0x13bf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x13c0-0x13ff */ + /* 0x1600-0x17ff */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1600-0x163f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1640-0x167f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1680-0x16bf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x16c0-0x16ff */ + 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x1c, 0x00, /* 0x1700-0x173f */ + 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x0c, 0x00, /* 0x1740-0x177f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0x3f, /* 0x1780-0x17bf */ + 0x40, 0xfe, 0x0f, 0x20, 0x00, 0x00, 0x00, 0x00, /* 0x17c0-0x17ff */ + /* 0x1800-0x19ff */ + 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1800-0x183f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1840-0x187f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, /* 0x1880-0x18bf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18c0-0x18ff */ + 0x00, 0x00, 0x00, 0x00, 0x87, 0x01, 0x04, 0x0e, /* 0x1900-0x193f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1940-0x197f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1980-0x19bf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x19c0-0x19ff */ + /* 0x1a00-0x1bff */ + 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, /* 0x1a00-0x1a3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1a40-0x1a7f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1a80-0x1abf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1ac0-0x1aff */ + 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd0, 0x17, /* 0x1b00-0x1b3f */ + 0x04, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x0f, 0x00, /* 0x1b40-0x1b7f */ + 0x03, 0x00, 0x00, 0x00, 0x3c, 0x03, 0x00, 0x00, /* 0x1b80-0x1bbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1bc0-0x1bff */ + /* 0x1c00-0x1dff */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xcf, 0x00, /* 0x1c00-0x1c3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1c40-0x1c7f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1c80-0x1cbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1cc0-0x1cff */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1d00-0x1d3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1d40-0x1d7f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1d80-0x1dbf */ + 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0xc0, /* 0x1dc0-0x1dff */ + /* 0x2000-0x21ff */ + 0x00, 0xf8, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, /* 0x2000-0x203f */ + 0x00, 0x00, 0x00, 0x00, 0x1f, 0xfc, 0x00, 0x00, /* 0x2040-0x207f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x2080-0x20bf */ + 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, /* 0x20c0-0x20ff */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x2100-0x213f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x2140-0x217f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x2180-0x21bf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x21c0-0x21ff */ + /* 0x2c00-0x2dff */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x2c00-0x2c3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x2c40-0x2c7f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x2c80-0x2cbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x2cc0-0x2cff */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x2d00-0x2d3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x2d40-0x2d7f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x2d80-0x2dbf */ + 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, /* 0x2dc0-0x2dff */ + /* 0x3000-0x31ff */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, /* 0x3000-0x303f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x3040-0x307f */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, /* 0x3080-0x30bf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30c0-0x30ff */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x3100-0x313f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x3140-0x317f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x3180-0x31bf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x31c0-0x31ff */ + /* 0xa600-0xa7ff */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa600-0xa63f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x07, 0x30, /* 0xa640-0xa67f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa680-0xa6bf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa6c0-0xa6ff */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa700-0xa73f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa740-0xa77f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa780-0xa7bf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa7c0-0xa7ff */ + /* 0xa800-0xa9ff */ + 0x44, 0x08, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, /* 0xa800-0xa83f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa840-0xa87f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa880-0xa8bf */ + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8c0-0xa8ff */ + 0x00, 0x00, 0x00, 0x00, 0xc0, 0x3f, 0x00, 0x00, /* 0xa900-0xa93f */ + 0x80, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa940-0xa97f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa980-0xa9bf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa9c0-0xa9ff */ + /* 0xaa00-0xabff */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x66, 0x00, /* 0xaa00-0xaa3f */ + 0x08, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xaa40-0xaa7f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xaa80-0xaabf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xaac0-0xaaff */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xab00-0xab3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xab40-0xab7f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xab80-0xabbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xabc0-0xabff */ + /* 0xfa00-0xfbff */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xfa00-0xfa3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xfa40-0xfa7f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xfa80-0xfabf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xfac0-0xfaff */ + 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, /* 0xfb00-0xfb3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xfb40-0xfb7f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xfb80-0xfbbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xfbc0-0xfbff */ + /* 0xfe00-0xffff */ + 0xff, 0xff, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00, /* 0xfe00-0xfe3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xfe40-0xfe7f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xfe80-0xfebf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, /* 0xfec0-0xfeff */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xff00-0xff3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xff40-0xff7f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xff80-0xffbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, /* 0xffc0-0xffff */ + /* 0x10000-0x101ff */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10000-0x1003f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10040-0x1007f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10080-0x100bf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x100c0-0x100ff */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10100-0x1013f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10140-0x1017f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10180-0x101bf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, /* 0x101c0-0x101ff */ + /* 0x10a00-0x10bff */ + 0x6e, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x87, /* 0x10a00-0x10a3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10a40-0x10a7f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10a80-0x10abf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10ac0-0x10aff */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10b00-0x10b3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10b40-0x10b7f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10b80-0x10bbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10bc0-0x10bff */ + /* 0x1d000-0x1d1ff */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1d000-0x1d03f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1d040-0x1d07f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1d080-0x1d0bf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1d0c0-0x1d0ff */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1d100-0x1d13f */ + 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0xf8, /* 0x1d140-0x1d17f */ + 0xe7, 0x0f, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, /* 0x1d180-0x1d1bf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1d1c0-0x1d1ff */ + /* 0x1d200-0x1d3ff */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1d200-0x1d23f */ + 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1d240-0x1d27f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1d280-0x1d2bf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1d2c0-0x1d2ff */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1d300-0x1d33f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1d340-0x1d37f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1d380-0x1d3bf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* 0x1d3c0-0x1d3ff */ +}; +static const signed char nonspacing_table_ind[240] = { + 0, 1, 2, 3, 4, 5, 6, 7, /* 0x0000-0x0fff */ + 8, 9, -1, 10, 11, 12, 13, -1, /* 0x1000-0x1fff */ + 14, -1, -1, -1, -1, -1, 15, -1, /* 0x2000-0x2fff */ + 16, -1, -1, -1, -1, -1, -1, -1, /* 0x3000-0x3fff */ + -1, -1, -1, -1, -1, -1, -1, -1, /* 0x4000-0x4fff */ + -1, -1, -1, -1, -1, -1, -1, -1, /* 0x5000-0x5fff */ + -1, -1, -1, -1, -1, -1, -1, -1, /* 0x6000-0x6fff */ + -1, -1, -1, -1, -1, -1, -1, -1, /* 0x7000-0x7fff */ + -1, -1, -1, -1, -1, -1, -1, -1, /* 0x8000-0x8fff */ + -1, -1, -1, -1, -1, -1, -1, -1, /* 0x9000-0x9fff */ + -1, -1, -1, 17, 18, 19, -1, -1, /* 0xa000-0xafff */ + -1, -1, -1, -1, -1, -1, -1, -1, /* 0xb000-0xbfff */ + -1, -1, -1, -1, -1, -1, -1, -1, /* 0xc000-0xcfff */ + -1, -1, -1, -1, -1, -1, -1, -1, /* 0xd000-0xdfff */ + -1, -1, -1, -1, -1, -1, -1, -1, /* 0xe000-0xefff */ + -1, -1, -1, -1, -1, 20, -1, 21, /* 0xf000-0xffff */ + 22, -1, -1, -1, -1, 23, -1, -1, /* 0x10000-0x10fff */ + -1, -1, -1, -1, -1, -1, -1, -1, /* 0x11000-0x11fff */ + -1, -1, -1, -1, -1, -1, -1, -1, /* 0x12000-0x12fff */ + -1, -1, -1, -1, -1, -1, -1, -1, /* 0x13000-0x13fff */ + -1, -1, -1, -1, -1, -1, -1, -1, /* 0x14000-0x14fff */ + -1, -1, -1, -1, -1, -1, -1, -1, /* 0x15000-0x15fff */ + -1, -1, -1, -1, -1, -1, -1, -1, /* 0x16000-0x16fff */ + -1, -1, -1, -1, -1, -1, -1, -1, /* 0x17000-0x17fff */ + -1, -1, -1, -1, -1, -1, -1, -1, /* 0x18000-0x18fff */ + -1, -1, -1, -1, -1, -1, -1, -1, /* 0x19000-0x19fff */ + -1, -1, -1, -1, -1, -1, -1, -1, /* 0x1a000-0x1afff */ + -1, -1, -1, -1, -1, -1, -1, -1, /* 0x1b000-0x1bfff */ + -1, -1, -1, -1, -1, -1, -1, -1, /* 0x1c000-0x1cfff */ + 24, 25, -1, -1, -1, -1, -1, -1 /* 0x1d000-0x1dfff */ +}; + +/* Determine number of column positions required for UC. */ +int +uc_width (ucs4_t uc, const char *encoding) +{ + /* Test for non-spacing or control character. */ + if ((uc >> 9) < 240) + { + int ind = nonspacing_table_ind[uc >> 9]; + if (ind >= 0) + if ((nonspacing_table_data[64*ind + ((uc >> 3) & 63)] >> (uc & 7)) & 1) + { + if (uc > 0 && uc < 0xa0) + return -1; + else + return 0; + } + } + else if ((uc >> 9) == (0xe0000 >> 9)) + { + if (uc >= 0xe0100) + { + if (uc <= 0xe01ef) + return 0; + } + else + { + if (uc >= 0xe0020 ? uc <= 0xe007f : uc == 0xe0001) + return 0; + } + } + /* Test for double-width character. + * Generated from "grep '^....;[WF]' EastAsianWidth.txt" + * and "grep '^....;[^WF]' EastAsianWidth.txt" + */ + if (uc >= 0x1100 + && ((uc < 0x1160) /* Hangul Jamo */ + || (uc >= 0x2329 && uc < 0x232b) /* Angle Brackets */ + || (uc >= 0x2e80 && uc < 0xa4d0 /* CJK ... Yi */ + && !(uc == 0x303f) && !(uc >= 0x4dc0 && uc < 0x4e00)) + || (uc >= 0xac00 && uc < 0xd7a4) /* Hangul Syllables */ + || (uc >= 0xf900 && uc < 0xfb00) /* CJK Compatibility Ideographs */ + || (uc >= 0xfe10 && uc < 0xfe20) /* Presentation Forms for Vertical */ + || (uc >= 0xfe30 && uc < 0xfe70) /* CJK Compatibility Forms */ + || (uc >= 0xff00 && uc < 0xff61) /* Fullwidth Forms */ + || (uc >= 0xffe0 && uc < 0xffe7) /* Fullwidth Signs */ + || (uc >= 0x20000 && uc <= 0x2a6d6) /* CJK */ + || (uc >= 0x2f800 && uc <= 0x2fa1d) /* CJK Compatibility Ideographs */ + ) ) + return 2; + /* In ancient CJK encodings, Cyrillic and most other characters are + double-width as well. */ + if (uc >= 0x00A1 && uc < 0xFF61 && uc != 0x20A9 + && is_cjk_encoding (encoding)) + return 2; + return 1; +} diff --git a/src/bin/coreutils/lib/unlinkdir.c b/src/bin/coreutils/lib/unlinkdir.c index 07620dbf05..a9713c79c7 100644 --- a/src/bin/coreutils/lib/unlinkdir.c +++ b/src/bin/coreutils/lib/unlinkdir.c @@ -1,11 +1,11 @@ -/* unlinkdir.c - determine (and maybe change) whether we can unlink directories +/* unlinkdir.c - determine whether we can unlink directories - Copyright (C) 2005, 2006 Free Software Foundation, Inc. + Copyright (C) 2005-2006, 2009 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,25 +13,20 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ -/* Written by Paul Eggert and Jim Meyering. */ +/* Written by Paul Eggert, Jim Meyering, and David Bartley. */ #include #include "unlinkdir.h" - -#if HAVE_PRIV_H -# include -#endif +#include "priv-set.h" #include #if ! UNLINK_CANNOT_UNLINK_DIR /* Return true if we cannot unlink directories, false if we might be - able to unlink directories. If possible, tell the kernel we don't - want to be able to unlink directories, so that we can return true. */ + able to unlink directories. */ bool cannot_unlink_dir (void) @@ -41,20 +36,11 @@ cannot_unlink_dir (void) if (! initialized) { -# if defined PRIV_EFFECTIVE && defined PRIV_SYS_LINKDIR +# if defined PRIV_SYS_LINKDIR /* We might be able to unlink directories if we cannot determine our privileges, or if we have the - PRIV_SYS_LINKDIR privilege and cannot delete it. */ - priv_set_t *pset = priv_allocset (); - if (pset) - { - cannot = - (getppriv (PRIV_EFFECTIVE, pset) == 0 - && (! priv_ismember (pset, PRIV_SYS_LINKDIR) - || (priv_delset (pset, PRIV_SYS_LINKDIR) == 0 - && setppriv (PRIV_SET, PRIV_EFFECTIVE, pset) == 0))); - priv_freeset (pset); - } + PRIV_SYS_LINKDIR privilege. */ + cannot = (priv_set_ismember (PRIV_SYS_LINKDIR) == 0); # else /* In traditional Unix, only root can unlink directories. */ cannot = (geteuid () != 0); diff --git a/src/bin/coreutils/lib/unlinkdir.h b/src/bin/coreutils/lib/unlinkdir.h index 6582418bc9..10c4e5f656 100644 --- a/src/bin/coreutils/lib/unlinkdir.h +++ b/src/bin/coreutils/lib/unlinkdir.h @@ -2,10 +2,10 @@ Copyright (C) 2005 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Paul Eggert and Jim Meyering. */ diff --git a/src/bin/coreutils/lib/unlocked-io.h b/src/bin/coreutils/lib/unlocked-io.h index d00930361c..6b2939e1ba 100644 --- a/src/bin/coreutils/lib/unlocked-io.h +++ b/src/bin/coreutils/lib/unlocked-io.h @@ -2,19 +2,18 @@ Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ /* Written by Jim Meyering. */ diff --git a/src/bin/coreutils/lib/unsetenv.c b/src/bin/coreutils/lib/unsetenv.c index 0f837440db..73ea878a68 100644 --- a/src/bin/coreutils/lib/unsetenv.c +++ b/src/bin/coreutils/lib/unsetenv.c @@ -1,36 +1,34 @@ -/* Copyright (C) 1992,1995-1999,2000-2002,2005-2006 Free Software Foundation, Inc. +/* Copyright (C) 1992,1995-1999,2000-2002,2005-2008 Free Software Foundation, Inc. This file is part of the GNU C Library. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ #include +/* Specification. */ +#include + #include #if !_LIBC # define __set_errno(ev) ((errno) = (ev)) #endif -#include #include #include #if !_LIBC # define __environ environ -# ifndef HAVE_ENVIRON_DECL -extern char **environ; -# endif #endif #if _LIBC diff --git a/src/bin/coreutils/lib/userspec.c b/src/bin/coreutils/lib/userspec.c index c1f580a17f..17f9326ae6 100644 --- a/src/bin/coreutils/lib/userspec.c +++ b/src/bin/coreutils/lib/userspec.c @@ -2,10 +2,10 @@ Copyright (C) 1989-1992, 1997-1998, 2000, 2002-2007 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by David MacKenzie . */ @@ -72,6 +71,8 @@ # define MAXGID GID_T_MAX #endif +#ifdef __DJGPP__ + /* ISDIGIT differs from isdigit, as follows: - Its arg may be any int or unsigned int; it need not be an unsigned char or EOF. @@ -81,8 +82,6 @@ of `digit' even when the host does not conform to POSIX. */ #define ISDIGIT(c) ((unsigned int) (c) - '0' <= 9) -#ifdef __DJGPP__ - /* Return true if STR represents an unsigned decimal integer. */ static bool diff --git a/src/bin/coreutils/lib/utime.c b/src/bin/coreutils/lib/utime.c deleted file mode 100644 index 273a5fb31f..0000000000 --- a/src/bin/coreutils/lib/utime.c +++ /dev/null @@ -1,109 +0,0 @@ -/* Copyright (C) 1998, 2001, 2002, 2003, 2004, 2006 Free Software - Foundation, Inc. - - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2, or (at your option) any - later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ - -/* derived from a function in touch.c */ - -#include -#undef utime - -#include - -#ifdef HAVE_UTIME_H -# include -#endif - -#if !HAVE_UTIMES_NULL -# include -# include -#endif - -#include -#include - -#include "full-write.h" -#include "safe-read.h" - -/* Some systems (even some that do have ) don't declare this - structure anywhere. */ -#ifndef HAVE_STRUCT_UTIMBUF -struct utimbuf -{ - long actime; - long modtime; -}; -#endif - -/* The results of open() in this file are not used with fchdir, - therefore save some unnecessary work in fchdir.c. */ -#undef open -#undef close - -/* Emulate utime (file, NULL) for systems (like 4.3BSD) that do not - interpret it to set the access and modification times of FILE to - the current time. Return 0 if successful, -1 if not. */ - -static int -utime_null (const char *file) -{ -#if HAVE_UTIMES_NULL - return utimes (file, 0); -#else - int fd; - char c; - int status = 0; - struct stat st; - int saved_errno = 0; - - fd = open (file, O_RDWR); - if (fd < 0 - || fstat (fd, &st) < 0 - || safe_read (fd, &c, sizeof c) == SAFE_READ_ERROR - || lseek (fd, (off_t) 0, SEEK_SET) < 0 - || full_write (fd, &c, sizeof c) != sizeof c - /* Maybe do this -- it's necessary on SunOS 4.1.3 with some combination - of patches, but that system doesn't use this code: it has utimes. - || fsync (fd) < 0 - */ - || (st.st_size == 0 && ftruncate (fd, st.st_size) < 0)) - { - saved_errno = errno; - status = -1; - } - - if (0 <= fd) - { - if (close (fd) < 0) - status = -1; - - /* If there was a prior failure, use the saved errno value. - But if the only failure was in the close, don't change errno. */ - if (saved_errno) - errno = saved_errno; - } - - return status; -#endif -} - -int -rpl_utime (const char *file, const struct utimbuf *times) -{ - if (times) - return utime (file, times); - - return utime_null (file); -} diff --git a/src/bin/coreutils/lib/utimecmp.c b/src/bin/coreutils/lib/utimecmp.c index 051d03a10f..6a9087398b 100644 --- a/src/bin/coreutils/lib/utimecmp.c +++ b/src/bin/coreutils/lib/utimecmp.c @@ -2,10 +2,10 @@ Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Paul Eggert. */ diff --git a/src/bin/coreutils/lib/utimecmp.h b/src/bin/coreutils/lib/utimecmp.h index e82d15b80e..7d33c474d2 100644 --- a/src/bin/coreutils/lib/utimecmp.h +++ b/src/bin/coreutils/lib/utimecmp.h @@ -2,10 +2,10 @@ Copyright (C) 2004 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Paul Eggert. */ diff --git a/src/bin/coreutils/lib/utimens.c b/src/bin/coreutils/lib/utimens.c index 71bc510d86..708de10989 100644 --- a/src/bin/coreutils/lib/utimens.c +++ b/src/bin/coreutils/lib/utimens.c @@ -1,11 +1,11 @@ /* Set file access and modification times. - Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software + Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify it + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2, or (at your option) any + Free Software Foundation; either version 3 of the License, or any later version. This program is distributed in the hope that it will be useful, @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Paul Eggert. */ @@ -27,6 +26,7 @@ #include #include +#include #include #include @@ -55,7 +55,7 @@ struct utimbuf #endif #ifndef __attribute__ -# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8) || __STRICT_ANSI__ +# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8) # define __attribute__(x) # endif #endif @@ -75,8 +75,8 @@ struct utimbuf Return 0 on success, -1 (setting errno) on failure. */ int -futimens (int fd ATTRIBUTE_UNUSED, - char const *file, struct timespec const timespec[2]) +gl_futimens (int fd ATTRIBUTE_UNUSED, + char const *file, struct timespec const timespec[2]) { /* Some Linux-based NFS clients are buggy, and mishandle time stamps of files in NFS file systems in some cases. We have no @@ -95,89 +95,127 @@ futimens (int fd ATTRIBUTE_UNUSED, fsync (fd); #endif - /* There's currently no interface to set file timestamps with - nanosecond resolution, so do the best we can, discarding any - fractional part of the timestamp. */ -#if HAVE_FUTIMESAT || HAVE_WORKING_UTIMES - struct timeval timeval[2]; - struct timeval const *t; - if (timespec) - { - timeval[0].tv_sec = timespec[0].tv_sec; - timeval[0].tv_usec = timespec[0].tv_nsec / 1000; - timeval[1].tv_sec = timespec[1].tv_sec; - timeval[1].tv_usec = timespec[1].tv_nsec / 1000; - t = timeval; - } - else - t = NULL; - - + /* POSIX 200x added two interfaces to set file timestamps with + nanosecond resolution. We provide a fallback for ENOSYS (for + example, compiling against Linux 2.6.25 kernel headers and glibc + 2.7, but running on Linux 2.6.18 kernel). */ +#if HAVE_UTIMENSAT if (fd < 0) { -# if HAVE_FUTIMESAT - return futimesat (AT_FDCWD, file, t); -# endif - } - else - { - /* If futimesat or futimes fails here, don't try to speed things - up by returning right away. glibc can incorrectly fail with - errno == ENOENT if /proc isn't mounted. Also, Mandrake 10.0 - in high security mode doesn't allow ordinary users to read - /proc/self, so glibc incorrectly fails with errno == EACCES. - If errno == EIO, EPERM, or EROFS, it's probably safe to fail - right away, but these cases are rare enough that they're not - worth optimizing, and who knows what other messed-up systems - are out there? So play it safe and fall back on the code - below. */ -# if HAVE_FUTIMESAT - if (futimesat (fd, NULL, t) == 0) - return 0; -# elif HAVE_FUTIMES - if (futimes (fd, t) == 0) - return 0; + int result = utimensat (AT_FDCWD, file, timespec, 0); +# ifdef __linux__ + /* Work around what might be a kernel bug: + http://bugzilla.redhat.com/442352 + http://bugzilla.redhat.com/449910 + It appears that utimensat can mistakenly return 280 rather + than -1 upon failure. + FIXME: remove in 2010 or whenever the offending kernels + are no longer in common use. */ + if (0 < result) + errno = ENOSYS; # endif + + if (result == 0 || errno != ENOSYS) + return result; } #endif - - if (!file) - { -#if ! (HAVE_FUTIMESAT || (HAVE_WORKING_UTIMES && HAVE_FUTIMES)) - errno = ENOSYS; -#endif - - /* Prefer EBADF to ENOSYS if both error numbers apply. */ - if (errno == ENOSYS) - { - int fd2 = dup (fd); - int dup_errno = errno; - if (0 <= fd2) - close (fd2); - errno = (fd2 < 0 && dup_errno == EBADF ? EBADF : ENOSYS); - } - - return -1; - } - -#if HAVE_WORKING_UTIMES - return utimes (file, t); -#else +#if HAVE_FUTIMENS { - struct utimbuf utimbuf; - struct utimbuf const *ut; - if (timespec) - { - utimbuf.actime = timespec[0].tv_sec; - utimbuf.modtime = timespec[1].tv_sec; - ut = &utimbuf; - } - else - ut = NULL; - - return utime (file, ut); + int result = futimens (fd, timespec); +# ifdef __linux__ + /* Work around the same bug as above. */ + if (0 < result) + errno = ENOSYS; +# endif + if (result == 0 || errno != ENOSYS) + return result; } #endif + + /* The platform lacks an interface to set file timestamps with + nanosecond resolution, so do the best we can, discarding any + fractional part of the timestamp. */ + { +#if HAVE_FUTIMESAT || HAVE_WORKING_UTIMES + struct timeval timeval[2]; + struct timeval const *t; + if (timespec) + { + timeval[0].tv_sec = timespec[0].tv_sec; + timeval[0].tv_usec = timespec[0].tv_nsec / 1000; + timeval[1].tv_sec = timespec[1].tv_sec; + timeval[1].tv_usec = timespec[1].tv_nsec / 1000; + t = timeval; + } + else + t = NULL; + + if (fd < 0) + { +# if HAVE_FUTIMESAT + return futimesat (AT_FDCWD, file, t); +# endif + } + else + { + /* If futimesat or futimes fails here, don't try to speed things + up by returning right away. glibc can incorrectly fail with + errno == ENOENT if /proc isn't mounted. Also, Mandrake 10.0 + in high security mode doesn't allow ordinary users to read + /proc/self, so glibc incorrectly fails with errno == EACCES. + If errno == EIO, EPERM, or EROFS, it's probably safe to fail + right away, but these cases are rare enough that they're not + worth optimizing, and who knows what other messed-up systems + are out there? So play it safe and fall back on the code + below. */ +# if HAVE_FUTIMESAT + if (futimesat (fd, NULL, t) == 0) + return 0; +# elif HAVE_FUTIMES + if (futimes (fd, t) == 0) + return 0; +# endif + } +#endif /* HAVE_FUTIMESAT || HAVE_WORKING_UTIMES */ + + if (!file) + { +#if ! (HAVE_FUTIMESAT || (HAVE_WORKING_UTIMES && HAVE_FUTIMES)) + errno = ENOSYS; +#endif + + /* Prefer EBADF to ENOSYS if both error numbers apply. */ + if (errno == ENOSYS) + { + int fd2 = dup (fd); + int dup_errno = errno; + if (0 <= fd2) + close (fd2); + errno = (fd2 < 0 && dup_errno == EBADF ? EBADF : ENOSYS); + } + + return -1; + } + +#if HAVE_WORKING_UTIMES + return utimes (file, t); +#else + { + struct utimbuf utimbuf; + struct utimbuf const *ut; + if (timespec) + { + utimbuf.actime = timespec[0].tv_sec; + utimbuf.modtime = timespec[1].tv_sec; + ut = &utimbuf; + } + else + ut = NULL; + + return utime (file, ut); + } +#endif /* !HAVE_WORKING_UTIMES */ + } } /* Set the access and modification time stamps of FILE to be @@ -185,5 +223,5 @@ futimens (int fd ATTRIBUTE_UNUSED, int utimens (char const *file, struct timespec const timespec[2]) { - return futimens (-1, file, timespec); + return gl_futimens (-1, file, timespec); } diff --git a/src/bin/coreutils/lib/utimens.h b/src/bin/coreutils/lib/utimens.h index 0097aaaf75..169521da73 100644 --- a/src/bin/coreutils/lib/utimens.h +++ b/src/bin/coreutils/lib/utimens.h @@ -1,3 +1,3 @@ #include -int futimens (int, char const *, struct timespec const [2]); +int gl_futimens (int, char const *, struct timespec const [2]); int utimens (char const *, struct timespec const [2]); diff --git a/src/bin/coreutils/lib/vasnprintf.c b/src/bin/coreutils/lib/vasnprintf.c index 8a9ec9e93c..850f77b0a4 100644 --- a/src/bin/coreutils/lib/vasnprintf.c +++ b/src/bin/coreutils/lib/vasnprintf.c @@ -1,12 +1,12 @@ +/* -*- buffer-read-only: t -*- vi: set ro: */ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 /* vsprintf with automatic memory allocation. - This file is intended to provide exactly the same functionality - as the version in gnulib, but without the need for the xsize module. - - Copyright (C) 1999, 2002-2007 Free Software Foundation, Inc. + Copyright (C) 1999, 2002-2009 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) + the Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -18,6 +18,35 @@ with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +/* This file can be parametrized with the following macros: + VASNPRINTF The name of the function being defined. + FCHAR_T The element type of the format string. + DCHAR_T The element type of the destination (result) string. + FCHAR_T_ONLY_ASCII Set to 1 to enable verification that all characters + in the format string are ASCII. MUST be set if + FCHAR_T and DCHAR_T are not the same type. + DIRECTIVE Structure denoting a format directive. + Depends on FCHAR_T. + DIRECTIVES Structure denoting the set of format directives of a + format string. Depends on FCHAR_T. + PRINTF_PARSE Function that parses a format string. + Depends on FCHAR_T. + DCHAR_CPY memcpy like function for DCHAR_T[] arrays. + DCHAR_SET memset like function for DCHAR_T[] arrays. + DCHAR_MBSNLEN mbsnlen like function for DCHAR_T[] arrays. + SNPRINTF The system's snprintf (or similar) function. + This may be either snprintf or swprintf. + TCHAR_T The element type of the argument and result string + of the said SNPRINTF function. This may be either + char or wchar_t. The code exploits that + sizeof (TCHAR_T) | sizeof (DCHAR_T) and + alignof (TCHAR_T) <= alignof (DCHAR_T). + DCHAR_IS_TCHAR Set to 1 if DCHAR_T and TCHAR_T are the same type. + DCHAR_CONV_FROM_ENCODING A function to convert from char[] to DCHAR[]. + DCHAR_IS_UINT8_T Set to 1 if DCHAR_T is uint8_t. + DCHAR_IS_UINT16_T Set to 1 if DCHAR_T is uint16_t. + DCHAR_IS_UINT32_T Set to 1 if DCHAR_T is uint32_t. */ + /* Tell glibc's to provide a prototype for snprintf(). This must come before because may include , and once has been included, it's too late. */ @@ -25,32 +54,166 @@ # define _GNU_SOURCE 1 #endif -#include +#ifndef VASNPRINTF +# include +#endif #ifndef IN_LIBINTL # include #endif /* Specification. */ -#if WIDE_CHAR_VERSION -# include "vasnwprintf.h" -#else -# include "vasnprintf.h" +#ifndef VASNPRINTF +# if WIDE_CHAR_VERSION +# include "vasnwprintf.h" +# else +# include "vasnprintf.h" +# endif #endif +#include /* localeconv() */ #include /* snprintf(), sprintf() */ #include /* abort(), malloc(), realloc(), free() */ -#include /* SIZE_MAX */ #include /* memcpy(), strlen() */ #include /* errno */ -#include /* CHAR_BIT, INT_MAX */ +#include /* CHAR_BIT */ #include /* DBL_MAX_EXP, LDBL_MAX_EXP */ -#if WIDE_CHAR_VERSION -# include "wprintf-parse.h" -#else -# include "printf-parse.h" +#if HAVE_NL_LANGINFO +# include +#endif +#ifndef VASNPRINTF +# if WIDE_CHAR_VERSION +# include "wprintf-parse.h" +# else +# include "printf-parse.h" +# endif #endif -#if HAVE_WCHAR_T +/* Checked size_t computations. */ +#include "xsize.h" + +#if (NEED_PRINTF_DOUBLE || NEED_PRINTF_LONG_DOUBLE) && !defined IN_LIBINTL +# include +# include "float+.h" +#endif + +#if (NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_DOUBLE) && !defined IN_LIBINTL +# include +# include "isnand-nolibm.h" +#endif + +#if (NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_INFINITE_LONG_DOUBLE) && !defined IN_LIBINTL +# include +# include "isnanl-nolibm.h" +# include "fpucw.h" +#endif + +#if (NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_DOUBLE) && !defined IN_LIBINTL +# include +# include "isnand-nolibm.h" +# include "printf-frexp.h" +#endif + +#if (NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_LONG_DOUBLE) && !defined IN_LIBINTL +# include +# include "isnanl-nolibm.h" +# include "printf-frexpl.h" +# include "fpucw.h" +#endif + +/* Default parameters. */ +#ifndef VASNPRINTF +# if WIDE_CHAR_VERSION +# define VASNPRINTF vasnwprintf +# define FCHAR_T wchar_t +# define DCHAR_T wchar_t +# define TCHAR_T wchar_t +# define DCHAR_IS_TCHAR 1 +# define DIRECTIVE wchar_t_directive +# define DIRECTIVES wchar_t_directives +# define PRINTF_PARSE wprintf_parse +# define DCHAR_CPY wmemcpy +# define DCHAR_SET wmemset +# else +# define VASNPRINTF vasnprintf +# define FCHAR_T char +# define DCHAR_T char +# define TCHAR_T char +# define DCHAR_IS_TCHAR 1 +# define DIRECTIVE char_directive +# define DIRECTIVES char_directives +# define PRINTF_PARSE printf_parse +# define DCHAR_CPY memcpy +# define DCHAR_SET memset +# endif +#endif +#if WIDE_CHAR_VERSION + /* TCHAR_T is wchar_t. */ +# define USE_SNPRINTF 1 +# if HAVE_DECL__SNWPRINTF + /* On Windows, the function swprintf() has a different signature than + on Unix; we use the _snwprintf() function instead. */ +# define SNPRINTF _snwprintf +# else + /* Unix. */ +# define SNPRINTF swprintf +# endif +#else + /* TCHAR_T is char. */ + /* Use snprintf if it exists under the name 'snprintf' or '_snprintf'. + But don't use it on BeOS, since BeOS snprintf produces no output if the + size argument is >= 0x3000000. + Also don't use it on Linux libc5, since there snprintf with size = 1 + writes any output without bounds, like sprintf. */ +# if (HAVE_DECL__SNPRINTF || HAVE_SNPRINTF) && !defined __BEOS__ && !(__GNU_LIBRARY__ == 1) +# define USE_SNPRINTF 1 +# else +# define USE_SNPRINTF 0 +# endif +# if HAVE_DECL__SNPRINTF + /* Windows. */ +# define SNPRINTF _snprintf +# else + /* Unix. */ +# define SNPRINTF snprintf + /* Here we need to call the native snprintf, not rpl_snprintf. */ +# undef snprintf +# endif +#endif +/* Here we need to call the native sprintf, not rpl_sprintf. */ +#undef sprintf + +/* GCC >= 4.0 with -Wall emits unjustified "... may be used uninitialized" + warnings in this file. Use -Dlint to suppress them. */ +#ifdef lint +# define IF_LINT(Code) Code +#else +# define IF_LINT(Code) /* empty */ +#endif + +/* Avoid some warnings from "gcc -Wshadow". + This file doesn't use the exp() and remainder() functions. */ +#undef exp +#define exp expo +#undef remainder +#define remainder rem + +#if !USE_SNPRINTF && !WIDE_CHAR_VERSION +# if (HAVE_STRNLEN && !defined _AIX) +# define local_strnlen strnlen +# else +# ifndef local_strnlen_defined +# define local_strnlen_defined 1 +static size_t +local_strnlen (const char *string, size_t maxlen) +{ + const char *end = memchr (string, '\0', maxlen); + return end ? (size_t) (end - string) : maxlen; +} +# endif +# endif +#endif + +#if (!USE_SNPRINTF || (NEED_PRINTF_DIRECTIVE_LS && !defined IN_LIBINTL)) && HAVE_WCHAR_T && (WIDE_CHAR_VERSION || DCHAR_IS_TCHAR) # if HAVE_WCSLEN # define local_wcslen wcslen # else @@ -73,55 +236,1264 @@ local_wcslen (const wchar_t *s) # endif #endif -#if WIDE_CHAR_VERSION -# define VASNPRINTF vasnwprintf -# define CHAR_T wchar_t -# define DIRECTIVE wchar_t_directive -# define DIRECTIVES wchar_t_directives -# define PRINTF_PARSE wprintf_parse -# define USE_SNPRINTF 1 -# if HAVE_DECL__SNWPRINTF - /* On Windows, the function swprintf() has a different signature than - on Unix; we use the _snwprintf() function instead. */ -# define SNPRINTF _snwprintf +#if !USE_SNPRINTF && HAVE_WCHAR_T && WIDE_CHAR_VERSION +# if HAVE_WCSNLEN +# define local_wcsnlen wcsnlen # else - /* Unix. */ -# define SNPRINTF swprintf -# endif -#else -# define VASNPRINTF vasnprintf -# define CHAR_T char -# define DIRECTIVE char_directive -# define DIRECTIVES char_directives -# define PRINTF_PARSE printf_parse -# define USE_SNPRINTF (HAVE_DECL__SNPRINTF || HAVE_SNPRINTF) -# if HAVE_DECL__SNPRINTF - /* Windows. */ -# define SNPRINTF _snprintf -# else - /* Unix. */ -# define SNPRINTF snprintf +# ifndef local_wcsnlen_defined +# define local_wcsnlen_defined 1 +static size_t +local_wcsnlen (const wchar_t *s, size_t maxlen) +{ + const wchar_t *ptr; + + for (ptr = s; maxlen > 0 && *ptr != (wchar_t) 0; ptr++, maxlen--) + ; + return ptr - s; +} +# endif # endif #endif -CHAR_T * -VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list args) +#if (NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_INFINITE_LONG_DOUBLE || NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_DOUBLE) && !defined IN_LIBINTL +/* Determine the decimal-point character according to the current locale. */ +# ifndef decimal_point_char_defined +# define decimal_point_char_defined 1 +static char +decimal_point_char () +{ + const char *point; + /* Determine it in a multithread-safe way. We know nl_langinfo is + multithread-safe on glibc systems, but is not required to be multithread- + safe by POSIX. sprintf(), however, is multithread-safe. localeconv() + is rarely multithread-safe. */ +# if HAVE_NL_LANGINFO && __GLIBC__ + point = nl_langinfo (RADIXCHAR); +# elif 1 + char pointbuf[5]; + sprintf (pointbuf, "%#.0f", 1.0); + point = &pointbuf[1]; +# else + point = localeconv () -> decimal_point; +# endif + /* The decimal point is always a single byte: either '.' or ','. */ + return (point[0] != '\0' ? point[0] : '.'); +} +# endif +#endif + +#if NEED_PRINTF_INFINITE_DOUBLE && !NEED_PRINTF_DOUBLE && !defined IN_LIBINTL + +/* Equivalent to !isfinite(x) || x == 0, but does not require libm. */ +static int +is_infinite_or_zero (double x) +{ + return isnand (x) || x + x == x; +} + +#endif + +#if NEED_PRINTF_INFINITE_LONG_DOUBLE && !NEED_PRINTF_LONG_DOUBLE && !defined IN_LIBINTL + +/* Equivalent to !isfinite(x) || x == 0, but does not require libm. */ +static int +is_infinite_or_zerol (long double x) +{ + return isnanl (x) || x + x == x; +} + +#endif + +#if (NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_DOUBLE) && !defined IN_LIBINTL + +/* Converting 'long double' to decimal without rare rounding bugs requires + real bignums. We use the naming conventions of GNU gmp, but vastly simpler + (and slower) algorithms. */ + +typedef unsigned int mp_limb_t; +# define GMP_LIMB_BITS 32 +typedef int mp_limb_verify[2 * (sizeof (mp_limb_t) * CHAR_BIT == GMP_LIMB_BITS) - 1]; + +typedef unsigned long long mp_twolimb_t; +# define GMP_TWOLIMB_BITS 64 +typedef int mp_twolimb_verify[2 * (sizeof (mp_twolimb_t) * CHAR_BIT == GMP_TWOLIMB_BITS) - 1]; + +/* Representation of a bignum >= 0. */ +typedef struct +{ + size_t nlimbs; + mp_limb_t *limbs; /* Bits in little-endian order, allocated with malloc(). */ +} mpn_t; + +/* Compute the product of two bignums >= 0. + Return the allocated memory in case of success, NULL in case of memory + allocation failure. */ +static void * +multiply (mpn_t src1, mpn_t src2, mpn_t *dest) +{ + const mp_limb_t *p1; + const mp_limb_t *p2; + size_t len1; + size_t len2; + + if (src1.nlimbs <= src2.nlimbs) + { + len1 = src1.nlimbs; + p1 = src1.limbs; + len2 = src2.nlimbs; + p2 = src2.limbs; + } + else + { + len1 = src2.nlimbs; + p1 = src2.limbs; + len2 = src1.nlimbs; + p2 = src1.limbs; + } + /* Now 0 <= len1 <= len2. */ + if (len1 == 0) + { + /* src1 or src2 is zero. */ + dest->nlimbs = 0; + dest->limbs = (mp_limb_t *) malloc (1); + } + else + { + /* Here 1 <= len1 <= len2. */ + size_t dlen; + mp_limb_t *dp; + size_t k, i, j; + + dlen = len1 + len2; + dp = (mp_limb_t *) malloc (dlen * sizeof (mp_limb_t)); + if (dp == NULL) + return NULL; + for (k = len2; k > 0; ) + dp[--k] = 0; + for (i = 0; i < len1; i++) + { + mp_limb_t digit1 = p1[i]; + mp_twolimb_t carry = 0; + for (j = 0; j < len2; j++) + { + mp_limb_t digit2 = p2[j]; + carry += (mp_twolimb_t) digit1 * (mp_twolimb_t) digit2; + carry += dp[i + j]; + dp[i + j] = (mp_limb_t) carry; + carry = carry >> GMP_LIMB_BITS; + } + dp[i + len2] = (mp_limb_t) carry; + } + /* Normalise. */ + while (dlen > 0 && dp[dlen - 1] == 0) + dlen--; + dest->nlimbs = dlen; + dest->limbs = dp; + } + return dest->limbs; +} + +/* Compute the quotient of a bignum a >= 0 and a bignum b > 0. + a is written as a = q * b + r with 0 <= r < b. q is the quotient, r + the remainder. + Finally, round-to-even is performed: If r > b/2 or if r = b/2 and q is odd, + q is incremented. + Return the allocated memory in case of success, NULL in case of memory + allocation failure. */ +static void * +divide (mpn_t a, mpn_t b, mpn_t *q) +{ + /* Algorithm: + First normalise a and b: a=[a[m-1],...,a[0]], b=[b[n-1],...,b[0]] + with m>=0 and n>0 (in base beta = 2^GMP_LIMB_BITS). + If m=n=1, perform a single-precision division: + r:=0, j:=m, + while j>0 do + {Here (q[m-1]*beta^(m-1)+...+q[j]*beta^j) * b[0] + r*beta^j = + = a[m-1]*beta^(m-1)+...+a[j]*beta^j und 0<=r=n>1, perform a multiple-precision division: + We have a/b < beta^(m-n+1). + s:=intDsize-1-(highest bit in b[n-1]), 0<=s=beta/2. + For j=m-n,...,0: {Here 0 <= r < b*beta^(j+1).} + Compute q* : + q* := floor((r[j+n]*beta+r[j+n-1])/b[n-1]). + In case of overflow (q* >= beta) set q* := beta-1. + Compute c2 := ((r[j+n]*beta+r[j+n-1]) - q* * b[n-1])*beta + r[j+n-2] + and c3 := b[n-2] * q*. + {We have 0 <= c2 < 2*beta^2, even 0 <= c2 < beta^2 if no overflow + occurred. Furthermore 0 <= c3 < beta^2. + If there was overflow and + r[j+n]*beta+r[j+n-1] - q* * b[n-1] >= beta, i.e. c2 >= beta^2, + the next test can be skipped.} + While c3 > c2, {Here 0 <= c2 < c3 < beta^2} + Put q* := q* - 1, c2 := c2 + b[n-1]*beta, c3 := c3 - b[n-2]. + If q* > 0: + Put r := r - b * q* * beta^j. In detail: + [r[n+j],...,r[j]] := [r[n+j],...,r[j]] - q* * [b[n-1],...,b[0]]. + hence: u:=0, for i:=0 to n-1 do + u := u + q* * b[i], + r[j+i]:=r[j+i]-(u mod beta) (+ beta, if carry), + u:=u div beta (+ 1, if carry in subtraction) + r[n+j]:=r[n+j]-u. + {Since always u = (q* * [b[i-1],...,b[0]] div beta^i) + 1 + < q* + 1 <= beta, + the carry u does not overflow.} + If a negative carry occurs, put q* := q* - 1 + and [r[n+j],...,r[j]] := [r[n+j],...,r[j]] + [0,b[n-1],...,b[0]]. + Set q[j] := q*. + Normalise [q[m-n],..,q[0]]; this yields the quotient q. + Shift [r[n-1],...,r[0]] right by s bits and normalise; this yields the + rest r. + The room for q[j] can be allocated at the memory location of r[n+j]. + Finally, round-to-even: + Shift r left by 1 bit. + If r > b or if r = b and q[0] is odd, q := q+1. + */ + const mp_limb_t *a_ptr = a.limbs; + size_t a_len = a.nlimbs; + const mp_limb_t *b_ptr = b.limbs; + size_t b_len = b.nlimbs; + mp_limb_t *roomptr; + mp_limb_t *tmp_roomptr = NULL; + mp_limb_t *q_ptr; + size_t q_len; + mp_limb_t *r_ptr; + size_t r_len; + + /* Allocate room for a_len+2 digits. + (Need a_len+1 digits for the real division and 1 more digit for the + final rounding of q.) */ + roomptr = (mp_limb_t *) malloc ((a_len + 2) * sizeof (mp_limb_t)); + if (roomptr == NULL) + return NULL; + + /* Normalise a. */ + while (a_len > 0 && a_ptr[a_len - 1] == 0) + a_len--; + + /* Normalise b. */ + for (;;) + { + if (b_len == 0) + /* Division by zero. */ + abort (); + if (b_ptr[b_len - 1] == 0) + b_len--; + else + break; + } + + /* Here m = a_len >= 0 and n = b_len > 0. */ + + if (a_len < b_len) + { + /* m beta^(m-2) <= a/b < beta^m */ + r_ptr = roomptr; + q_ptr = roomptr + 1; + { + mp_limb_t den = b_ptr[0]; + mp_limb_t remainder = 0; + const mp_limb_t *sourceptr = a_ptr + a_len; + mp_limb_t *destptr = q_ptr + a_len; + size_t count; + for (count = a_len; count > 0; count--) + { + mp_twolimb_t num = + ((mp_twolimb_t) remainder << GMP_LIMB_BITS) | *--sourceptr; + *--destptr = num / den; + remainder = num % den; + } + /* Normalise and store r. */ + if (remainder > 0) + { + r_ptr[0] = remainder; + r_len = 1; + } + else + r_len = 0; + /* Normalise q. */ + q_len = a_len; + if (q_ptr[q_len - 1] == 0) + q_len--; + } + } + else + { + /* n>1: multiple precision division. + beta^(m-1) <= a < beta^m, beta^(n-1) <= b < beta^n ==> + beta^(m-n-1) <= a/b < beta^(m-n+1). */ + /* Determine s. */ + size_t s; + { + mp_limb_t msd = b_ptr[b_len - 1]; /* = b[n-1], > 0 */ + s = 31; + if (msd >= 0x10000) + { + msd = msd >> 16; + s -= 16; + } + if (msd >= 0x100) + { + msd = msd >> 8; + s -= 8; + } + if (msd >= 0x10) + { + msd = msd >> 4; + s -= 4; + } + if (msd >= 0x4) + { + msd = msd >> 2; + s -= 2; + } + if (msd >= 0x2) + { + msd = msd >> 1; + s -= 1; + } + } + /* 0 <= s < GMP_LIMB_BITS. + Copy b, shifting it left by s bits. */ + if (s > 0) + { + tmp_roomptr = (mp_limb_t *) malloc (b_len * sizeof (mp_limb_t)); + if (tmp_roomptr == NULL) + { + free (roomptr); + return NULL; + } + { + const mp_limb_t *sourceptr = b_ptr; + mp_limb_t *destptr = tmp_roomptr; + mp_twolimb_t accu = 0; + size_t count; + for (count = b_len; count > 0; count--) + { + accu += (mp_twolimb_t) *sourceptr++ << s; + *destptr++ = (mp_limb_t) accu; + accu = accu >> GMP_LIMB_BITS; + } + /* accu must be zero, since that was how s was determined. */ + if (accu != 0) + abort (); + } + b_ptr = tmp_roomptr; + } + /* Copy a, shifting it left by s bits, yields r. + Memory layout: + At the beginning: r = roomptr[0..a_len], + at the end: r = roomptr[0..b_len-1], q = roomptr[b_len..a_len] */ + r_ptr = roomptr; + if (s == 0) + { + memcpy (r_ptr, a_ptr, a_len * sizeof (mp_limb_t)); + r_ptr[a_len] = 0; + } + else + { + const mp_limb_t *sourceptr = a_ptr; + mp_limb_t *destptr = r_ptr; + mp_twolimb_t accu = 0; + size_t count; + for (count = a_len; count > 0; count--) + { + accu += (mp_twolimb_t) *sourceptr++ << s; + *destptr++ = (mp_limb_t) accu; + accu = accu >> GMP_LIMB_BITS; + } + *destptr++ = (mp_limb_t) accu; + } + q_ptr = roomptr + b_len; + q_len = a_len - b_len + 1; /* q will have m-n+1 limbs */ + { + size_t j = a_len - b_len; /* m-n */ + mp_limb_t b_msd = b_ptr[b_len - 1]; /* b[n-1] */ + mp_limb_t b_2msd = b_ptr[b_len - 2]; /* b[n-2] */ + mp_twolimb_t b_msdd = /* b[n-1]*beta+b[n-2] */ + ((mp_twolimb_t) b_msd << GMP_LIMB_BITS) | b_2msd; + /* Division loop, traversed m-n+1 times. + j counts down, b is unchanged, beta/2 <= b[n-1] < beta. */ + for (;;) + { + mp_limb_t q_star; + mp_limb_t c1; + if (r_ptr[j + b_len] < b_msd) /* r[j+n] < b[n-1] ? */ + { + /* Divide r[j+n]*beta+r[j+n-1] by b[n-1], no overflow. */ + mp_twolimb_t num = + ((mp_twolimb_t) r_ptr[j + b_len] << GMP_LIMB_BITS) + | r_ptr[j + b_len - 1]; + q_star = num / b_msd; + c1 = num % b_msd; + } + else + { + /* Overflow, hence r[j+n]*beta+r[j+n-1] >= beta*b[n-1]. */ + q_star = (mp_limb_t)~(mp_limb_t)0; /* q* = beta-1 */ + /* Test whether r[j+n]*beta+r[j+n-1] - (beta-1)*b[n-1] >= beta + <==> r[j+n]*beta+r[j+n-1] + b[n-1] >= beta*b[n-1]+beta + <==> b[n-1] < floor((r[j+n]*beta+r[j+n-1]+b[n-1])/beta) + {<= beta !}. + If yes, jump directly to the subtraction loop. + (Otherwise, r[j+n]*beta+r[j+n-1] - (beta-1)*b[n-1] < beta + <==> floor((r[j+n]*beta+r[j+n-1]+b[n-1])/beta) = b[n-1] ) */ + if (r_ptr[j + b_len] > b_msd + || (c1 = r_ptr[j + b_len - 1] + b_msd) < b_msd) + /* r[j+n] >= b[n-1]+1 or + r[j+n] = b[n-1] and the addition r[j+n-1]+b[n-1] gives a + carry. */ + goto subtract; + } + /* q_star = q*, + c1 = (r[j+n]*beta+r[j+n-1]) - q* * b[n-1] (>=0, 0, decrease it by + b[n-1]*beta+b[n-2]. Because of b[n-1]*beta+b[n-2] >= beta^2/2 + this can happen only twice. */ + if (c3 > c2) + { + q_star = q_star - 1; /* q* := q* - 1 */ + if (c3 - c2 > b_msdd) + q_star = q_star - 1; /* q* := q* - 1 */ + } + } + if (q_star > 0) + subtract: + { + /* Subtract r := r - b * q* * beta^j. */ + mp_limb_t cr; + { + const mp_limb_t *sourceptr = b_ptr; + mp_limb_t *destptr = r_ptr + j; + mp_twolimb_t carry = 0; + size_t count; + for (count = b_len; count > 0; count--) + { + /* Here 0 <= carry <= q*. */ + carry = + carry + + (mp_twolimb_t) q_star * (mp_twolimb_t) *sourceptr++ + + (mp_limb_t) ~(*destptr); + /* Here 0 <= carry <= beta*q* + beta-1. */ + *destptr++ = ~(mp_limb_t) carry; + carry = carry >> GMP_LIMB_BITS; /* <= q* */ + } + cr = (mp_limb_t) carry; + } + /* Subtract cr from r_ptr[j + b_len], then forget about + r_ptr[j + b_len]. */ + if (cr > r_ptr[j + b_len]) + { + /* Subtraction gave a carry. */ + q_star = q_star - 1; /* q* := q* - 1 */ + /* Add b back. */ + { + const mp_limb_t *sourceptr = b_ptr; + mp_limb_t *destptr = r_ptr + j; + mp_limb_t carry = 0; + size_t count; + for (count = b_len; count > 0; count--) + { + mp_limb_t source1 = *sourceptr++; + mp_limb_t source2 = *destptr; + *destptr++ = source1 + source2 + carry; + carry = + (carry + ? source1 >= (mp_limb_t) ~source2 + : source1 > (mp_limb_t) ~source2); + } + } + /* Forget about the carry and about r[j+n]. */ + } + } + /* q* is determined. Store it as q[j]. */ + q_ptr[j] = q_star; + if (j == 0) + break; + j--; + } + } + r_len = b_len; + /* Normalise q. */ + if (q_ptr[q_len - 1] == 0) + q_len--; +# if 0 /* Not needed here, since we need r only to compare it with b/2, and + b is shifted left by s bits. */ + /* Shift r right by s bits. */ + if (s > 0) + { + mp_limb_t ptr = r_ptr + r_len; + mp_twolimb_t accu = 0; + size_t count; + for (count = r_len; count > 0; count--) + { + accu = (mp_twolimb_t) (mp_limb_t) accu << GMP_LIMB_BITS; + accu += (mp_twolimb_t) *--ptr << (GMP_LIMB_BITS - s); + *ptr = (mp_limb_t) (accu >> GMP_LIMB_BITS); + } + } +# endif + /* Normalise r. */ + while (r_len > 0 && r_ptr[r_len - 1] == 0) + r_len--; + } + /* Compare r << 1 with b. */ + if (r_len > b_len) + goto increment_q; + { + size_t i; + for (i = b_len;;) + { + mp_limb_t r_i = + (i <= r_len && i > 0 ? r_ptr[i - 1] >> (GMP_LIMB_BITS - 1) : 0) + | (i < r_len ? r_ptr[i] << 1 : 0); + mp_limb_t b_i = (i < b_len ? b_ptr[i] : 0); + if (r_i > b_i) + goto increment_q; + if (r_i < b_i) + goto keep_q; + if (i == 0) + break; + i--; + } + } + if (q_len > 0 && ((q_ptr[0] & 1) != 0)) + /* q is odd. */ + increment_q: + { + size_t i; + for (i = 0; i < q_len; i++) + if (++(q_ptr[i]) != 0) + goto keep_q; + q_ptr[q_len++] = 1; + } + keep_q: + if (tmp_roomptr != NULL) + free (tmp_roomptr); + q->limbs = q_ptr; + q->nlimbs = q_len; + return roomptr; +} + +/* Convert a bignum a >= 0, multiplied with 10^extra_zeroes, to decimal + representation. + Destroys the contents of a. + Return the allocated memory - containing the decimal digits in low-to-high + order, terminated with a NUL character - in case of success, NULL in case + of memory allocation failure. */ +static char * +convert_to_decimal (mpn_t a, size_t extra_zeroes) +{ + mp_limb_t *a_ptr = a.limbs; + size_t a_len = a.nlimbs; + /* 0.03345 is slightly larger than log(2)/(9*log(10)). */ + size_t c_len = 9 * ((size_t)(a_len * (GMP_LIMB_BITS * 0.03345f)) + 1); + char *c_ptr = (char *) malloc (xsum (c_len, extra_zeroes)); + if (c_ptr != NULL) + { + char *d_ptr = c_ptr; + for (; extra_zeroes > 0; extra_zeroes--) + *d_ptr++ = '0'; + while (a_len > 0) + { + /* Divide a by 10^9, in-place. */ + mp_limb_t remainder = 0; + mp_limb_t *ptr = a_ptr + a_len; + size_t count; + for (count = a_len; count > 0; count--) + { + mp_twolimb_t num = + ((mp_twolimb_t) remainder << GMP_LIMB_BITS) | *--ptr; + *ptr = num / 1000000000; + remainder = num % 1000000000; + } + /* Store the remainder as 9 decimal digits. */ + for (count = 9; count > 0; count--) + { + *d_ptr++ = '0' + (remainder % 10); + remainder = remainder / 10; + } + /* Normalize a. */ + if (a_ptr[a_len - 1] == 0) + a_len--; + } + /* Remove leading zeroes. */ + while (d_ptr > c_ptr && d_ptr[-1] == '0') + d_ptr--; + /* But keep at least one zero. */ + if (d_ptr == c_ptr) + *d_ptr++ = '0'; + /* Terminate the string. */ + *d_ptr = '\0'; + } + return c_ptr; +} + +# if NEED_PRINTF_LONG_DOUBLE + +/* Assuming x is finite and >= 0: + write x as x = 2^e * m, where m is a bignum. + Return the allocated memory in case of success, NULL in case of memory + allocation failure. */ +static void * +decode_long_double (long double x, int *ep, mpn_t *mp) +{ + mpn_t m; + int exp; + long double y; + size_t i; + + /* Allocate memory for result. */ + m.nlimbs = (LDBL_MANT_BIT + GMP_LIMB_BITS - 1) / GMP_LIMB_BITS; + m.limbs = (mp_limb_t *) malloc (m.nlimbs * sizeof (mp_limb_t)); + if (m.limbs == NULL) + return NULL; + /* Split into exponential part and mantissa. */ + y = frexpl (x, &exp); + if (!(y >= 0.0L && y < 1.0L)) + abort (); + /* x = 2^exp * y = 2^(exp - LDBL_MANT_BIT) * (y * LDBL_MANT_BIT), and the + latter is an integer. */ + /* Convert the mantissa (y * LDBL_MANT_BIT) to a sequence of limbs. + I'm not sure whether it's safe to cast a 'long double' value between + 2^31 and 2^32 to 'unsigned int', therefore play safe and cast only + 'long double' values between 0 and 2^16 (to 'unsigned int' or 'int', + doesn't matter). */ +# if (LDBL_MANT_BIT % GMP_LIMB_BITS) != 0 +# if (LDBL_MANT_BIT % GMP_LIMB_BITS) > GMP_LIMB_BITS / 2 + { + mp_limb_t hi, lo; + y *= (mp_limb_t) 1 << (LDBL_MANT_BIT % (GMP_LIMB_BITS / 2)); + hi = (int) y; + y -= hi; + if (!(y >= 0.0L && y < 1.0L)) + abort (); + y *= (mp_limb_t) 1 << (GMP_LIMB_BITS / 2); + lo = (int) y; + y -= lo; + if (!(y >= 0.0L && y < 1.0L)) + abort (); + m.limbs[LDBL_MANT_BIT / GMP_LIMB_BITS] = (hi << (GMP_LIMB_BITS / 2)) | lo; + } +# else + { + mp_limb_t d; + y *= (mp_limb_t) 1 << (LDBL_MANT_BIT % GMP_LIMB_BITS); + d = (int) y; + y -= d; + if (!(y >= 0.0L && y < 1.0L)) + abort (); + m.limbs[LDBL_MANT_BIT / GMP_LIMB_BITS] = d; + } +# endif +# endif + for (i = LDBL_MANT_BIT / GMP_LIMB_BITS; i > 0; ) + { + mp_limb_t hi, lo; + y *= (mp_limb_t) 1 << (GMP_LIMB_BITS / 2); + hi = (int) y; + y -= hi; + if (!(y >= 0.0L && y < 1.0L)) + abort (); + y *= (mp_limb_t) 1 << (GMP_LIMB_BITS / 2); + lo = (int) y; + y -= lo; + if (!(y >= 0.0L && y < 1.0L)) + abort (); + m.limbs[--i] = (hi << (GMP_LIMB_BITS / 2)) | lo; + } +#if 0 /* On FreeBSD 6.1/x86, 'long double' numbers sometimes have excess + precision. */ + if (!(y == 0.0L)) + abort (); +#endif + /* Normalise. */ + while (m.nlimbs > 0 && m.limbs[m.nlimbs - 1] == 0) + m.nlimbs--; + *mp = m; + *ep = exp - LDBL_MANT_BIT; + return m.limbs; +} + +# endif + +# if NEED_PRINTF_DOUBLE + +/* Assuming x is finite and >= 0: + write x as x = 2^e * m, where m is a bignum. + Return the allocated memory in case of success, NULL in case of memory + allocation failure. */ +static void * +decode_double (double x, int *ep, mpn_t *mp) +{ + mpn_t m; + int exp; + double y; + size_t i; + + /* Allocate memory for result. */ + m.nlimbs = (DBL_MANT_BIT + GMP_LIMB_BITS - 1) / GMP_LIMB_BITS; + m.limbs = (mp_limb_t *) malloc (m.nlimbs * sizeof (mp_limb_t)); + if (m.limbs == NULL) + return NULL; + /* Split into exponential part and mantissa. */ + y = frexp (x, &exp); + if (!(y >= 0.0 && y < 1.0)) + abort (); + /* x = 2^exp * y = 2^(exp - DBL_MANT_BIT) * (y * DBL_MANT_BIT), and the + latter is an integer. */ + /* Convert the mantissa (y * DBL_MANT_BIT) to a sequence of limbs. + I'm not sure whether it's safe to cast a 'double' value between + 2^31 and 2^32 to 'unsigned int', therefore play safe and cast only + 'double' values between 0 and 2^16 (to 'unsigned int' or 'int', + doesn't matter). */ +# if (DBL_MANT_BIT % GMP_LIMB_BITS) != 0 +# if (DBL_MANT_BIT % GMP_LIMB_BITS) > GMP_LIMB_BITS / 2 + { + mp_limb_t hi, lo; + y *= (mp_limb_t) 1 << (DBL_MANT_BIT % (GMP_LIMB_BITS / 2)); + hi = (int) y; + y -= hi; + if (!(y >= 0.0 && y < 1.0)) + abort (); + y *= (mp_limb_t) 1 << (GMP_LIMB_BITS / 2); + lo = (int) y; + y -= lo; + if (!(y >= 0.0 && y < 1.0)) + abort (); + m.limbs[DBL_MANT_BIT / GMP_LIMB_BITS] = (hi << (GMP_LIMB_BITS / 2)) | lo; + } +# else + { + mp_limb_t d; + y *= (mp_limb_t) 1 << (DBL_MANT_BIT % GMP_LIMB_BITS); + d = (int) y; + y -= d; + if (!(y >= 0.0 && y < 1.0)) + abort (); + m.limbs[DBL_MANT_BIT / GMP_LIMB_BITS] = d; + } +# endif +# endif + for (i = DBL_MANT_BIT / GMP_LIMB_BITS; i > 0; ) + { + mp_limb_t hi, lo; + y *= (mp_limb_t) 1 << (GMP_LIMB_BITS / 2); + hi = (int) y; + y -= hi; + if (!(y >= 0.0 && y < 1.0)) + abort (); + y *= (mp_limb_t) 1 << (GMP_LIMB_BITS / 2); + lo = (int) y; + y -= lo; + if (!(y >= 0.0 && y < 1.0)) + abort (); + m.limbs[--i] = (hi << (GMP_LIMB_BITS / 2)) | lo; + } + if (!(y == 0.0)) + abort (); + /* Normalise. */ + while (m.nlimbs > 0 && m.limbs[m.nlimbs - 1] == 0) + m.nlimbs--; + *mp = m; + *ep = exp - DBL_MANT_BIT; + return m.limbs; +} + +# endif + +/* Assuming x = 2^e * m is finite and >= 0, and n is an integer: + Returns the decimal representation of round (x * 10^n). + Return the allocated memory - containing the decimal digits in low-to-high + order, terminated with a NUL character - in case of success, NULL in case + of memory allocation failure. */ +static char * +scale10_round_decimal_decoded (int e, mpn_t m, void *memory, int n) +{ + int s; + size_t extra_zeroes; + unsigned int abs_n; + unsigned int abs_s; + mp_limb_t *pow5_ptr; + size_t pow5_len; + unsigned int s_limbs; + unsigned int s_bits; + mpn_t pow5; + mpn_t z; + void *z_memory; + char *digits; + + if (memory == NULL) + return NULL; + /* x = 2^e * m, hence + y = round (2^e * 10^n * m) = round (2^(e+n) * 5^n * m) + = round (2^s * 5^n * m). */ + s = e + n; + extra_zeroes = 0; + /* Factor out a common power of 10 if possible. */ + if (s > 0 && n > 0) + { + extra_zeroes = (s < n ? s : n); + s -= extra_zeroes; + n -= extra_zeroes; + } + /* Here y = round (2^s * 5^n * m) * 10^extra_zeroes. + Before converting to decimal, we need to compute + z = round (2^s * 5^n * m). */ + /* Compute 5^|n|, possibly shifted by |s| bits if n and s have the same + sign. 2.322 is slightly larger than log(5)/log(2). */ + abs_n = (n >= 0 ? n : -n); + abs_s = (s >= 0 ? s : -s); + pow5_ptr = (mp_limb_t *) malloc (((int)(abs_n * (2.322f / GMP_LIMB_BITS)) + 1 + + abs_s / GMP_LIMB_BITS + 1) + * sizeof (mp_limb_t)); + if (pow5_ptr == NULL) + { + free (memory); + return NULL; + } + /* Initialize with 1. */ + pow5_ptr[0] = 1; + pow5_len = 1; + /* Multiply with 5^|n|. */ + if (abs_n > 0) + { + static mp_limb_t const small_pow5[13 + 1] = + { + 1, 5, 25, 125, 625, 3125, 15625, 78125, 390625, 1953125, 9765625, + 48828125, 244140625, 1220703125 + }; + unsigned int n13; + for (n13 = 0; n13 <= abs_n; n13 += 13) + { + mp_limb_t digit1 = small_pow5[n13 + 13 <= abs_n ? 13 : abs_n - n13]; + size_t j; + mp_twolimb_t carry = 0; + for (j = 0; j < pow5_len; j++) + { + mp_limb_t digit2 = pow5_ptr[j]; + carry += (mp_twolimb_t) digit1 * (mp_twolimb_t) digit2; + pow5_ptr[j] = (mp_limb_t) carry; + carry = carry >> GMP_LIMB_BITS; + } + if (carry > 0) + pow5_ptr[pow5_len++] = (mp_limb_t) carry; + } + } + s_limbs = abs_s / GMP_LIMB_BITS; + s_bits = abs_s % GMP_LIMB_BITS; + if (n >= 0 ? s >= 0 : s <= 0) + { + /* Multiply with 2^|s|. */ + if (s_bits > 0) + { + mp_limb_t *ptr = pow5_ptr; + mp_twolimb_t accu = 0; + size_t count; + for (count = pow5_len; count > 0; count--) + { + accu += (mp_twolimb_t) *ptr << s_bits; + *ptr++ = (mp_limb_t) accu; + accu = accu >> GMP_LIMB_BITS; + } + if (accu > 0) + { + *ptr = (mp_limb_t) accu; + pow5_len++; + } + } + if (s_limbs > 0) + { + size_t count; + for (count = pow5_len; count > 0;) + { + count--; + pow5_ptr[s_limbs + count] = pow5_ptr[count]; + } + for (count = s_limbs; count > 0;) + { + count--; + pow5_ptr[count] = 0; + } + pow5_len += s_limbs; + } + pow5.limbs = pow5_ptr; + pow5.nlimbs = pow5_len; + if (n >= 0) + { + /* Multiply m with pow5. No division needed. */ + z_memory = multiply (m, pow5, &z); + } + else + { + /* Divide m by pow5 and round. */ + z_memory = divide (m, pow5, &z); + } + } + else + { + pow5.limbs = pow5_ptr; + pow5.nlimbs = pow5_len; + if (n >= 0) + { + /* n >= 0, s < 0. + Multiply m with pow5, then divide by 2^|s|. */ + mpn_t numerator; + mpn_t denominator; + void *tmp_memory; + tmp_memory = multiply (m, pow5, &numerator); + if (tmp_memory == NULL) + { + free (pow5_ptr); + free (memory); + return NULL; + } + /* Construct 2^|s|. */ + { + mp_limb_t *ptr = pow5_ptr + pow5_len; + size_t i; + for (i = 0; i < s_limbs; i++) + ptr[i] = 0; + ptr[s_limbs] = (mp_limb_t) 1 << s_bits; + denominator.limbs = ptr; + denominator.nlimbs = s_limbs + 1; + } + z_memory = divide (numerator, denominator, &z); + free (tmp_memory); + } + else + { + /* n < 0, s > 0. + Multiply m with 2^s, then divide by pow5. */ + mpn_t numerator; + mp_limb_t *num_ptr; + num_ptr = (mp_limb_t *) malloc ((m.nlimbs + s_limbs + 1) + * sizeof (mp_limb_t)); + if (num_ptr == NULL) + { + free (pow5_ptr); + free (memory); + return NULL; + } + { + mp_limb_t *destptr = num_ptr; + { + size_t i; + for (i = 0; i < s_limbs; i++) + *destptr++ = 0; + } + if (s_bits > 0) + { + const mp_limb_t *sourceptr = m.limbs; + mp_twolimb_t accu = 0; + size_t count; + for (count = m.nlimbs; count > 0; count--) + { + accu += (mp_twolimb_t) *sourceptr++ << s_bits; + *destptr++ = (mp_limb_t) accu; + accu = accu >> GMP_LIMB_BITS; + } + if (accu > 0) + *destptr++ = (mp_limb_t) accu; + } + else + { + const mp_limb_t *sourceptr = m.limbs; + size_t count; + for (count = m.nlimbs; count > 0; count--) + *destptr++ = *sourceptr++; + } + numerator.limbs = num_ptr; + numerator.nlimbs = destptr - num_ptr; + } + z_memory = divide (numerator, pow5, &z); + free (num_ptr); + } + } + free (pow5_ptr); + free (memory); + + /* Here y = round (x * 10^n) = z * 10^extra_zeroes. */ + + if (z_memory == NULL) + return NULL; + digits = convert_to_decimal (z, extra_zeroes); + free (z_memory); + return digits; +} + +# if NEED_PRINTF_LONG_DOUBLE + +/* Assuming x is finite and >= 0, and n is an integer: + Returns the decimal representation of round (x * 10^n). + Return the allocated memory - containing the decimal digits in low-to-high + order, terminated with a NUL character - in case of success, NULL in case + of memory allocation failure. */ +static char * +scale10_round_decimal_long_double (long double x, int n) +{ + int e IF_LINT(= 0); + mpn_t m; + void *memory = decode_long_double (x, &e, &m); + return scale10_round_decimal_decoded (e, m, memory, n); +} + +# endif + +# if NEED_PRINTF_DOUBLE + +/* Assuming x is finite and >= 0, and n is an integer: + Returns the decimal representation of round (x * 10^n). + Return the allocated memory - containing the decimal digits in low-to-high + order, terminated with a NUL character - in case of success, NULL in case + of memory allocation failure. */ +static char * +scale10_round_decimal_double (double x, int n) +{ + int e IF_LINT(= 0); + mpn_t m; + void *memory = decode_double (x, &e, &m); + return scale10_round_decimal_decoded (e, m, memory, n); +} + +# endif + +# if NEED_PRINTF_LONG_DOUBLE + +/* Assuming x is finite and > 0: + Return an approximation for n with 10^n <= x < 10^(n+1). + The approximation is usually the right n, but may be off by 1 sometimes. */ +static int +floorlog10l (long double x) +{ + int exp; + long double y; + double z; + double l; + + /* Split into exponential part and mantissa. */ + y = frexpl (x, &exp); + if (!(y >= 0.0L && y < 1.0L)) + abort (); + if (y == 0.0L) + return INT_MIN; + if (y < 0.5L) + { + while (y < (1.0L / (1 << (GMP_LIMB_BITS / 2)) / (1 << (GMP_LIMB_BITS / 2)))) + { + y *= 1.0L * (1 << (GMP_LIMB_BITS / 2)) * (1 << (GMP_LIMB_BITS / 2)); + exp -= GMP_LIMB_BITS; + } + if (y < (1.0L / (1 << 16))) + { + y *= 1.0L * (1 << 16); + exp -= 16; + } + if (y < (1.0L / (1 << 8))) + { + y *= 1.0L * (1 << 8); + exp -= 8; + } + if (y < (1.0L / (1 << 4))) + { + y *= 1.0L * (1 << 4); + exp -= 4; + } + if (y < (1.0L / (1 << 2))) + { + y *= 1.0L * (1 << 2); + exp -= 2; + } + if (y < (1.0L / (1 << 1))) + { + y *= 1.0L * (1 << 1); + exp -= 1; + } + } + if (!(y >= 0.5L && y < 1.0L)) + abort (); + /* Compute an approximation for l = log2(x) = exp + log2(y). */ + l = exp; + z = y; + if (z < 0.70710678118654752444) + { + z *= 1.4142135623730950488; + l -= 0.5; + } + if (z < 0.8408964152537145431) + { + z *= 1.1892071150027210667; + l -= 0.25; + } + if (z < 0.91700404320467123175) + { + z *= 1.0905077326652576592; + l -= 0.125; + } + if (z < 0.9576032806985736469) + { + z *= 1.0442737824274138403; + l -= 0.0625; + } + /* Now 0.95 <= z <= 1.01. */ + z = 1 - z; + /* log2(1-z) = 1/log(2) * (- z - z^2/2 - z^3/3 - z^4/4 - ...) + Four terms are enough to get an approximation with error < 10^-7. */ + l -= 1.4426950408889634074 * z * (1.0 + z * (0.5 + z * ((1.0 / 3) + z * 0.25))); + /* Finally multiply with log(2)/log(10), yields an approximation for + log10(x). */ + l *= 0.30102999566398119523; + /* Round down to the next integer. */ + return (int) l + (l < 0 ? -1 : 0); +} + +# endif + +# if NEED_PRINTF_DOUBLE + +/* Assuming x is finite and > 0: + Return an approximation for n with 10^n <= x < 10^(n+1). + The approximation is usually the right n, but may be off by 1 sometimes. */ +static int +floorlog10 (double x) +{ + int exp; + double y; + double z; + double l; + + /* Split into exponential part and mantissa. */ + y = frexp (x, &exp); + if (!(y >= 0.0 && y < 1.0)) + abort (); + if (y == 0.0) + return INT_MIN; + if (y < 0.5) + { + while (y < (1.0 / (1 << (GMP_LIMB_BITS / 2)) / (1 << (GMP_LIMB_BITS / 2)))) + { + y *= 1.0 * (1 << (GMP_LIMB_BITS / 2)) * (1 << (GMP_LIMB_BITS / 2)); + exp -= GMP_LIMB_BITS; + } + if (y < (1.0 / (1 << 16))) + { + y *= 1.0 * (1 << 16); + exp -= 16; + } + if (y < (1.0 / (1 << 8))) + { + y *= 1.0 * (1 << 8); + exp -= 8; + } + if (y < (1.0 / (1 << 4))) + { + y *= 1.0 * (1 << 4); + exp -= 4; + } + if (y < (1.0 / (1 << 2))) + { + y *= 1.0 * (1 << 2); + exp -= 2; + } + if (y < (1.0 / (1 << 1))) + { + y *= 1.0 * (1 << 1); + exp -= 1; + } + } + if (!(y >= 0.5 && y < 1.0)) + abort (); + /* Compute an approximation for l = log2(x) = exp + log2(y). */ + l = exp; + z = y; + if (z < 0.70710678118654752444) + { + z *= 1.4142135623730950488; + l -= 0.5; + } + if (z < 0.8408964152537145431) + { + z *= 1.1892071150027210667; + l -= 0.25; + } + if (z < 0.91700404320467123175) + { + z *= 1.0905077326652576592; + l -= 0.125; + } + if (z < 0.9576032806985736469) + { + z *= 1.0442737824274138403; + l -= 0.0625; + } + /* Now 0.95 <= z <= 1.01. */ + z = 1 - z; + /* log2(1-z) = 1/log(2) * (- z - z^2/2 - z^3/3 - z^4/4 - ...) + Four terms are enough to get an approximation with error < 10^-7. */ + l -= 1.4426950408889634074 * z * (1.0 + z * (0.5 + z * ((1.0 / 3) + z * 0.25))); + /* Finally multiply with log(2)/log(10), yields an approximation for + log10(x). */ + l *= 0.30102999566398119523; + /* Round down to the next integer. */ + return (int) l + (l < 0 ? -1 : 0); +} + +# endif + +/* Tests whether a string of digits consists of exactly PRECISION zeroes and + a single '1' digit. */ +static int +is_borderline (const char *digits, size_t precision) +{ + for (; precision > 0; precision--, digits++) + if (*digits != '0') + return 0; + if (*digits != '1') + return 0; + digits++; + return *digits == '\0'; +} + +#endif + +DCHAR_T * +VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, + const FCHAR_T *format, va_list args) { DIRECTIVES d; arguments a; if (PRINTF_PARSE (format, &d, &a) < 0) - { - errno = EINVAL; - return NULL; - } + /* errno is already set. */ + return NULL; #define CLEANUP() \ free (d.dir); \ if (a.arg) \ free (a.arg); - if (printf_fetchargs (args, &a) < 0) + if (PRINTF_FETCHARGS (args, &a) < 0) { CLEANUP (); errno = EINVAL; @@ -130,31 +1502,33 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list ar { size_t buf_neededlength; - CHAR_T *buf; - CHAR_T *buf_malloced; - const CHAR_T *cp; + TCHAR_T *buf; + TCHAR_T *buf_malloced; + const FCHAR_T *cp; size_t i; DIRECTIVE *dp; /* Output string accumulator. */ - CHAR_T *result; + DCHAR_T *result; size_t allocated; size_t length; /* Allocate a small buffer that will hold a directive passed to sprintf or snprintf. */ - buf_neededlength = 7 + d.max_width_length + d.max_precision_length + 6; + buf_neededlength = + xsum4 (7, d.max_width_length, d.max_precision_length, 6); #if HAVE_ALLOCA - if (buf_neededlength < 4000 / sizeof (CHAR_T)) + if (buf_neededlength < 4000 / sizeof (TCHAR_T)) { - buf = alloca (buf_neededlength * sizeof (CHAR_T)); + buf = (TCHAR_T *) alloca (buf_neededlength * sizeof (TCHAR_T)); buf_malloced = NULL; } else #endif { - if (SIZE_MAX / sizeof (CHAR_T) < buf_neededlength) + size_t buf_memsize = xtimes (buf_neededlength, sizeof (TCHAR_T)); + if (size_overflow_p (buf_memsize)) goto out_of_memory_1; - buf = (CHAR_T *) malloc (buf_neededlength * sizeof (CHAR_T)); + buf = (TCHAR_T *) malloc (buf_memsize); if (buf == NULL) goto out_of_memory_1; buf_malloced = buf; @@ -175,45 +1549,53 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list ar result is either == resultbuf or == NULL or malloc-allocated. If length > 0, then result != NULL. */ - /* Ensures that allocated >= length + extra. Aborts through a jump to - out_of_memory if size is too big. */ -#define ENSURE_ALLOCATION(extra) \ - { \ - size_t needed = length + (extra); \ - if (needed < length) \ - goto out_of_memory; \ - if (needed > allocated) \ + /* Ensures that allocated >= needed. Aborts through a jump to + out_of_memory if needed is SIZE_MAX or otherwise too big. */ +#define ENSURE_ALLOCATION(needed) \ + if ((needed) > allocated) \ { \ size_t memory_size; \ - CHAR_T *memory; \ + DCHAR_T *memory; \ \ - allocated = (allocated > 0 ? 2 * allocated : 12); \ - if (needed > allocated) \ - allocated = needed; \ - if (SIZE_MAX / sizeof (CHAR_T) < allocated) \ + allocated = (allocated > 0 ? xtimes (allocated, 2) : 12); \ + if ((needed) > allocated) \ + allocated = (needed); \ + memory_size = xtimes (allocated, sizeof (DCHAR_T)); \ + if (size_overflow_p (memory_size)) \ goto out_of_memory; \ - memory_size = allocated * sizeof (CHAR_T); \ if (result == resultbuf || result == NULL) \ - memory = (CHAR_T *) malloc (memory_size); \ + memory = (DCHAR_T *) malloc (memory_size); \ else \ - memory = (CHAR_T *) realloc (result, memory_size); \ + memory = (DCHAR_T *) realloc (result, memory_size); \ if (memory == NULL) \ goto out_of_memory; \ if (result == resultbuf && length > 0) \ - memcpy (memory, result, length * sizeof (CHAR_T)); \ + DCHAR_CPY (memory, result, length); \ result = memory; \ - } \ - } + } for (cp = format, i = 0, dp = &d.dir[0]; ; cp = dp->dir_end, i++, dp++) { if (cp != dp->dir_start) { size_t n = dp->dir_start - cp; + size_t augmented_length = xsum (length, n); - ENSURE_ALLOCATION (n); - memcpy (result + length, cp, n * sizeof (CHAR_T)); - length += n; + ENSURE_ALLOCATION (augmented_length); + /* This copies a piece of FCHAR_T[] into a DCHAR_T[]. Here we + need that the format string contains only ASCII characters + if FCHAR_T and DCHAR_T are not the same type. */ + if (sizeof (FCHAR_T) == sizeof (DCHAR_T)) + { + DCHAR_CPY (result + length, (const DCHAR_T *) cp, n); + length = augmented_length; + } + else + { + do + result[length++] = (unsigned char) *cp++; + while (--n > 0); + } } if (i == d.count) break; @@ -221,11 +1603,14 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list ar /* Execute a single directive. */ if (dp->conversion == '%') { + size_t augmented_length; + if (!(dp->arg_index == ARG_NONE)) abort (); - ENSURE_ALLOCATION (1); + augmented_length = xsum (length, 1); + ENSURE_ALLOCATION (augmented_length); result[length] = '%'; - length += 1; + length = augmented_length; } else { @@ -257,77 +1642,2805 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list ar abort (); } } +#if ENABLE_UNISTDIO + /* The unistdio extensions. */ + else if (dp->conversion == 'U') + { + arg_type type = a.arg[dp->arg_index].type; + int flags = dp->flags; + int has_width; + size_t width; + int has_precision; + size_t precision; + + has_width = 0; + width = 0; + if (dp->width_start != dp->width_end) + { + if (dp->width_arg_index != ARG_NONE) + { + int arg; + + if (!(a.arg[dp->width_arg_index].type == TYPE_INT)) + abort (); + arg = a.arg[dp->width_arg_index].a.a_int; + if (arg < 0) + { + /* "A negative field width is taken as a '-' flag + followed by a positive field width." */ + flags |= FLAG_LEFT; + width = (unsigned int) (-arg); + } + else + width = arg; + } + else + { + const FCHAR_T *digitp = dp->width_start; + + do + width = xsum (xtimes (width, 10), *digitp++ - '0'); + while (digitp != dp->width_end); + } + has_width = 1; + } + + has_precision = 0; + precision = 0; + if (dp->precision_start != dp->precision_end) + { + if (dp->precision_arg_index != ARG_NONE) + { + int arg; + + if (!(a.arg[dp->precision_arg_index].type == TYPE_INT)) + abort (); + arg = a.arg[dp->precision_arg_index].a.a_int; + /* "A negative precision is taken as if the precision + were omitted." */ + if (arg >= 0) + { + precision = arg; + has_precision = 1; + } + } + else + { + const FCHAR_T *digitp = dp->precision_start + 1; + + precision = 0; + while (digitp != dp->precision_end) + precision = xsum (xtimes (precision, 10), *digitp++ - '0'); + has_precision = 1; + } + } + + switch (type) + { + case TYPE_U8_STRING: + { + const uint8_t *arg = a.arg[dp->arg_index].a.a_u8_string; + const uint8_t *arg_end; + size_t characters; + + if (has_precision) + { + /* Use only PRECISION characters, from the left. */ + arg_end = arg; + characters = 0; + for (; precision > 0; precision--) + { + int count = u8_strmblen (arg_end); + if (count == 0) + break; + if (count < 0) + { + if (!(result == resultbuf || result == NULL)) + free (result); + if (buf_malloced != NULL) + free (buf_malloced); + CLEANUP (); + errno = EILSEQ; + return NULL; + } + arg_end += count; + characters++; + } + } + else if (has_width) + { + /* Use the entire string, and count the number of + characters. */ + arg_end = arg; + characters = 0; + for (;;) + { + int count = u8_strmblen (arg_end); + if (count == 0) + break; + if (count < 0) + { + if (!(result == resultbuf || result == NULL)) + free (result); + if (buf_malloced != NULL) + free (buf_malloced); + CLEANUP (); + errno = EILSEQ; + return NULL; + } + arg_end += count; + characters++; + } + } + else + { + /* Use the entire string. */ + arg_end = arg + u8_strlen (arg); + /* The number of characters doesn't matter. */ + characters = 0; + } + + if (has_width && width > characters + && !(dp->flags & FLAG_LEFT)) + { + size_t n = width - characters; + ENSURE_ALLOCATION (xsum (length, n)); + DCHAR_SET (result + length, ' ', n); + length += n; + } + +# if DCHAR_IS_UINT8_T + { + size_t n = arg_end - arg; + ENSURE_ALLOCATION (xsum (length, n)); + DCHAR_CPY (result + length, arg, n); + length += n; + } +# else + { /* Convert. */ + DCHAR_T *converted = result + length; + size_t converted_len = allocated - length; +# if DCHAR_IS_TCHAR + /* Convert from UTF-8 to locale encoding. */ + converted = + u8_conv_to_encoding (locale_charset (), + iconveh_question_mark, + arg, arg_end - arg, NULL, + converted, &converted_len); +# else + /* Convert from UTF-8 to UTF-16/UTF-32. */ + converted = + U8_TO_DCHAR (arg, arg_end - arg, + converted, &converted_len); +# endif + if (converted == NULL) + { + int saved_errno = errno; + if (!(result == resultbuf || result == NULL)) + free (result); + if (buf_malloced != NULL) + free (buf_malloced); + CLEANUP (); + errno = saved_errno; + return NULL; + } + if (converted != result + length) + { + ENSURE_ALLOCATION (xsum (length, converted_len)); + DCHAR_CPY (result + length, converted, converted_len); + free (converted); + } + length += converted_len; + } +# endif + + if (has_width && width > characters + && (dp->flags & FLAG_LEFT)) + { + size_t n = width - characters; + ENSURE_ALLOCATION (xsum (length, n)); + DCHAR_SET (result + length, ' ', n); + length += n; + } + } + break; + + case TYPE_U16_STRING: + { + const uint16_t *arg = a.arg[dp->arg_index].a.a_u16_string; + const uint16_t *arg_end; + size_t characters; + + if (has_precision) + { + /* Use only PRECISION characters, from the left. */ + arg_end = arg; + characters = 0; + for (; precision > 0; precision--) + { + int count = u16_strmblen (arg_end); + if (count == 0) + break; + if (count < 0) + { + if (!(result == resultbuf || result == NULL)) + free (result); + if (buf_malloced != NULL) + free (buf_malloced); + CLEANUP (); + errno = EILSEQ; + return NULL; + } + arg_end += count; + characters++; + } + } + else if (has_width) + { + /* Use the entire string, and count the number of + characters. */ + arg_end = arg; + characters = 0; + for (;;) + { + int count = u16_strmblen (arg_end); + if (count == 0) + break; + if (count < 0) + { + if (!(result == resultbuf || result == NULL)) + free (result); + if (buf_malloced != NULL) + free (buf_malloced); + CLEANUP (); + errno = EILSEQ; + return NULL; + } + arg_end += count; + characters++; + } + } + else + { + /* Use the entire string. */ + arg_end = arg + u16_strlen (arg); + /* The number of characters doesn't matter. */ + characters = 0; + } + + if (has_width && width > characters + && !(dp->flags & FLAG_LEFT)) + { + size_t n = width - characters; + ENSURE_ALLOCATION (xsum (length, n)); + DCHAR_SET (result + length, ' ', n); + length += n; + } + +# if DCHAR_IS_UINT16_T + { + size_t n = arg_end - arg; + ENSURE_ALLOCATION (xsum (length, n)); + DCHAR_CPY (result + length, arg, n); + length += n; + } +# else + { /* Convert. */ + DCHAR_T *converted = result + length; + size_t converted_len = allocated - length; +# if DCHAR_IS_TCHAR + /* Convert from UTF-16 to locale encoding. */ + converted = + u16_conv_to_encoding (locale_charset (), + iconveh_question_mark, + arg, arg_end - arg, NULL, + converted, &converted_len); +# else + /* Convert from UTF-16 to UTF-8/UTF-32. */ + converted = + U16_TO_DCHAR (arg, arg_end - arg, + converted, &converted_len); +# endif + if (converted == NULL) + { + int saved_errno = errno; + if (!(result == resultbuf || result == NULL)) + free (result); + if (buf_malloced != NULL) + free (buf_malloced); + CLEANUP (); + errno = saved_errno; + return NULL; + } + if (converted != result + length) + { + ENSURE_ALLOCATION (xsum (length, converted_len)); + DCHAR_CPY (result + length, converted, converted_len); + free (converted); + } + length += converted_len; + } +# endif + + if (has_width && width > characters + && (dp->flags & FLAG_LEFT)) + { + size_t n = width - characters; + ENSURE_ALLOCATION (xsum (length, n)); + DCHAR_SET (result + length, ' ', n); + length += n; + } + } + break; + + case TYPE_U32_STRING: + { + const uint32_t *arg = a.arg[dp->arg_index].a.a_u32_string; + const uint32_t *arg_end; + size_t characters; + + if (has_precision) + { + /* Use only PRECISION characters, from the left. */ + arg_end = arg; + characters = 0; + for (; precision > 0; precision--) + { + int count = u32_strmblen (arg_end); + if (count == 0) + break; + if (count < 0) + { + if (!(result == resultbuf || result == NULL)) + free (result); + if (buf_malloced != NULL) + free (buf_malloced); + CLEANUP (); + errno = EILSEQ; + return NULL; + } + arg_end += count; + characters++; + } + } + else if (has_width) + { + /* Use the entire string, and count the number of + characters. */ + arg_end = arg; + characters = 0; + for (;;) + { + int count = u32_strmblen (arg_end); + if (count == 0) + break; + if (count < 0) + { + if (!(result == resultbuf || result == NULL)) + free (result); + if (buf_malloced != NULL) + free (buf_malloced); + CLEANUP (); + errno = EILSEQ; + return NULL; + } + arg_end += count; + characters++; + } + } + else + { + /* Use the entire string. */ + arg_end = arg + u32_strlen (arg); + /* The number of characters doesn't matter. */ + characters = 0; + } + + if (has_width && width > characters + && !(dp->flags & FLAG_LEFT)) + { + size_t n = width - characters; + ENSURE_ALLOCATION (xsum (length, n)); + DCHAR_SET (result + length, ' ', n); + length += n; + } + +# if DCHAR_IS_UINT32_T + { + size_t n = arg_end - arg; + ENSURE_ALLOCATION (xsum (length, n)); + DCHAR_CPY (result + length, arg, n); + length += n; + } +# else + { /* Convert. */ + DCHAR_T *converted = result + length; + size_t converted_len = allocated - length; +# if DCHAR_IS_TCHAR + /* Convert from UTF-32 to locale encoding. */ + converted = + u32_conv_to_encoding (locale_charset (), + iconveh_question_mark, + arg, arg_end - arg, NULL, + converted, &converted_len); +# else + /* Convert from UTF-32 to UTF-8/UTF-16. */ + converted = + U32_TO_DCHAR (arg, arg_end - arg, + converted, &converted_len); +# endif + if (converted == NULL) + { + int saved_errno = errno; + if (!(result == resultbuf || result == NULL)) + free (result); + if (buf_malloced != NULL) + free (buf_malloced); + CLEANUP (); + errno = saved_errno; + return NULL; + } + if (converted != result + length) + { + ENSURE_ALLOCATION (xsum (length, converted_len)); + DCHAR_CPY (result + length, converted, converted_len); + free (converted); + } + length += converted_len; + } +# endif + + if (has_width && width > characters + && (dp->flags & FLAG_LEFT)) + { + size_t n = width - characters; + ENSURE_ALLOCATION (xsum (length, n)); + DCHAR_SET (result + length, ' ', n); + length += n; + } + } + break; + + default: + abort (); + } + } +#endif +#if (!USE_SNPRINTF || (NEED_PRINTF_DIRECTIVE_LS && !defined IN_LIBINTL)) && HAVE_WCHAR_T + else if (dp->conversion == 's' +# if WIDE_CHAR_VERSION + && a.arg[dp->arg_index].type != TYPE_WIDE_STRING +# else + && a.arg[dp->arg_index].type == TYPE_WIDE_STRING +# endif + ) + { + /* The normal handling of the 's' directive below requires + allocating a temporary buffer. The determination of its + length (tmp_length), in the case when a precision is + specified, below requires a conversion between a char[] + string and a wchar_t[] wide string. It could be done, but + we have no guarantee that the implementation of sprintf will + use the exactly same algorithm. Without this guarantee, it + is possible to have buffer overrun bugs. In order to avoid + such bugs, we implement the entire processing of the 's' + directive ourselves. */ + int flags = dp->flags; + int has_width; + size_t width; + int has_precision; + size_t precision; + + has_width = 0; + width = 0; + if (dp->width_start != dp->width_end) + { + if (dp->width_arg_index != ARG_NONE) + { + int arg; + + if (!(a.arg[dp->width_arg_index].type == TYPE_INT)) + abort (); + arg = a.arg[dp->width_arg_index].a.a_int; + if (arg < 0) + { + /* "A negative field width is taken as a '-' flag + followed by a positive field width." */ + flags |= FLAG_LEFT; + width = (unsigned int) (-arg); + } + else + width = arg; + } + else + { + const FCHAR_T *digitp = dp->width_start; + + do + width = xsum (xtimes (width, 10), *digitp++ - '0'); + while (digitp != dp->width_end); + } + has_width = 1; + } + + has_precision = 0; + precision = 6; + if (dp->precision_start != dp->precision_end) + { + if (dp->precision_arg_index != ARG_NONE) + { + int arg; + + if (!(a.arg[dp->precision_arg_index].type == TYPE_INT)) + abort (); + arg = a.arg[dp->precision_arg_index].a.a_int; + /* "A negative precision is taken as if the precision + were omitted." */ + if (arg >= 0) + { + precision = arg; + has_precision = 1; + } + } + else + { + const FCHAR_T *digitp = dp->precision_start + 1; + + precision = 0; + while (digitp != dp->precision_end) + precision = xsum (xtimes (precision, 10), *digitp++ - '0'); + has_precision = 1; + } + } + +# if WIDE_CHAR_VERSION + /* %s in vasnwprintf. See the specification of fwprintf. */ + { + const char *arg = a.arg[dp->arg_index].a.a_string; + const char *arg_end; + size_t characters; + + if (has_precision) + { + /* Use only as many bytes as needed to produce PRECISION + wide characters, from the left. */ +# if HAVE_MBRTOWC + mbstate_t state; + memset (&state, '\0', sizeof (mbstate_t)); +# endif + arg_end = arg; + characters = 0; + for (; precision > 0; precision--) + { + int count; +# if HAVE_MBRTOWC + count = mbrlen (arg_end, MB_CUR_MAX, &state); +# else + count = mblen (arg_end, MB_CUR_MAX); +# endif + if (count == 0) + /* Found the terminating NUL. */ + break; + if (count < 0) + { + /* Invalid or incomplete multibyte character. */ + if (!(result == resultbuf || result == NULL)) + free (result); + if (buf_malloced != NULL) + free (buf_malloced); + CLEANUP (); + errno = EILSEQ; + return NULL; + } + arg_end += count; + characters++; + } + } + else if (has_width) + { + /* Use the entire string, and count the number of wide + characters. */ +# if HAVE_MBRTOWC + mbstate_t state; + memset (&state, '\0', sizeof (mbstate_t)); +# endif + arg_end = arg; + characters = 0; + for (;;) + { + int count; +# if HAVE_MBRTOWC + count = mbrlen (arg_end, MB_CUR_MAX, &state); +# else + count = mblen (arg_end, MB_CUR_MAX); +# endif + if (count == 0) + /* Found the terminating NUL. */ + break; + if (count < 0) + { + /* Invalid or incomplete multibyte character. */ + if (!(result == resultbuf || result == NULL)) + free (result); + if (buf_malloced != NULL) + free (buf_malloced); + CLEANUP (); + errno = EILSEQ; + return NULL; + } + arg_end += count; + characters++; + } + } + else + { + /* Use the entire string. */ + arg_end = arg + strlen (arg); + /* The number of characters doesn't matter. */ + characters = 0; + } + + if (has_width && width > characters + && !(dp->flags & FLAG_LEFT)) + { + size_t n = width - characters; + ENSURE_ALLOCATION (xsum (length, n)); + DCHAR_SET (result + length, ' ', n); + length += n; + } + + if (has_precision || has_width) + { + /* We know the number of wide characters in advance. */ + size_t remaining; +# if HAVE_MBRTOWC + mbstate_t state; + memset (&state, '\0', sizeof (mbstate_t)); +# endif + ENSURE_ALLOCATION (xsum (length, characters)); + for (remaining = characters; remaining > 0; remaining--) + { + wchar_t wc; + int count; +# if HAVE_MBRTOWC + count = mbrtowc (&wc, arg, arg_end - arg, &state); +# else + count = mbtowc (&wc, arg, arg_end - arg); +# endif + if (count <= 0) + /* mbrtowc not consistent with mbrlen, or mbtowc + not consistent with mblen. */ + abort (); + result[length++] = wc; + arg += count; + } + if (!(arg == arg_end)) + abort (); + } + else + { +# if HAVE_MBRTOWC + mbstate_t state; + memset (&state, '\0', sizeof (mbstate_t)); +# endif + while (arg < arg_end) + { + wchar_t wc; + int count; +# if HAVE_MBRTOWC + count = mbrtowc (&wc, arg, arg_end - arg, &state); +# else + count = mbtowc (&wc, arg, arg_end - arg); +# endif + if (count <= 0) + /* mbrtowc not consistent with mbrlen, or mbtowc + not consistent with mblen. */ + abort (); + ENSURE_ALLOCATION (xsum (length, 1)); + result[length++] = wc; + arg += count; + } + } + + if (has_width && width > characters + && (dp->flags & FLAG_LEFT)) + { + size_t n = width - characters; + ENSURE_ALLOCATION (xsum (length, n)); + DCHAR_SET (result + length, ' ', n); + length += n; + } + } +# else + /* %ls in vasnprintf. See the specification of fprintf. */ + { + const wchar_t *arg = a.arg[dp->arg_index].a.a_wide_string; + const wchar_t *arg_end; + size_t characters; +# if !DCHAR_IS_TCHAR + /* This code assumes that TCHAR_T is 'char'. */ + typedef int TCHAR_T_verify[2 * (sizeof (TCHAR_T) == 1) - 1]; + TCHAR_T *tmpsrc; + DCHAR_T *tmpdst; + size_t tmpdst_len; +# endif + size_t w; + + if (has_precision) + { + /* Use only as many wide characters as needed to produce + at most PRECISION bytes, from the left. */ +# if HAVE_WCRTOMB + mbstate_t state; + memset (&state, '\0', sizeof (mbstate_t)); +# endif + arg_end = arg; + characters = 0; + while (precision > 0) + { + char buf[64]; /* Assume MB_CUR_MAX <= 64. */ + int count; + + if (*arg_end == 0) + /* Found the terminating null wide character. */ + break; +# if HAVE_WCRTOMB + count = wcrtomb (buf, *arg_end, &state); +# else + count = wctomb (buf, *arg_end); +# endif + if (count < 0) + { + /* Cannot convert. */ + if (!(result == resultbuf || result == NULL)) + free (result); + if (buf_malloced != NULL) + free (buf_malloced); + CLEANUP (); + errno = EILSEQ; + return NULL; + } + if (precision < count) + break; + arg_end++; + characters += count; + precision -= count; + } + } +# if DCHAR_IS_TCHAR + else if (has_width) +# else + else +# endif + { + /* Use the entire string, and count the number of + bytes. */ +# if HAVE_WCRTOMB + mbstate_t state; + memset (&state, '\0', sizeof (mbstate_t)); +# endif + arg_end = arg; + characters = 0; + for (;;) + { + char buf[64]; /* Assume MB_CUR_MAX <= 64. */ + int count; + + if (*arg_end == 0) + /* Found the terminating null wide character. */ + break; +# if HAVE_WCRTOMB + count = wcrtomb (buf, *arg_end, &state); +# else + count = wctomb (buf, *arg_end); +# endif + if (count < 0) + { + /* Cannot convert. */ + if (!(result == resultbuf || result == NULL)) + free (result); + if (buf_malloced != NULL) + free (buf_malloced); + CLEANUP (); + errno = EILSEQ; + return NULL; + } + arg_end++; + characters += count; + } + } +# if DCHAR_IS_TCHAR + else + { + /* Use the entire string. */ + arg_end = arg + local_wcslen (arg); + /* The number of bytes doesn't matter. */ + characters = 0; + } +# endif + +# if !DCHAR_IS_TCHAR + /* Convert the string into a piece of temporary memory. */ + tmpsrc = (TCHAR_T *) malloc (characters * sizeof (TCHAR_T)); + if (tmpsrc == NULL) + goto out_of_memory; + { + TCHAR_T *tmpptr = tmpsrc; + size_t remaining; +# if HAVE_WCRTOMB + mbstate_t state; + memset (&state, '\0', sizeof (mbstate_t)); +# endif + for (remaining = characters; remaining > 0; ) + { + char buf[64]; /* Assume MB_CUR_MAX <= 64. */ + int count; + + if (*arg == 0) + abort (); +# if HAVE_WCRTOMB + count = wcrtomb (buf, *arg, &state); +# else + count = wctomb (buf, *arg); +# endif + if (count <= 0) + /* Inconsistency. */ + abort (); + memcpy (tmpptr, buf, count); + tmpptr += count; + arg++; + remaining -= count; + } + if (!(arg == arg_end)) + abort (); + } + + /* Convert from TCHAR_T[] to DCHAR_T[]. */ + tmpdst = + DCHAR_CONV_FROM_ENCODING (locale_charset (), + iconveh_question_mark, + tmpsrc, characters, + NULL, + NULL, &tmpdst_len); + if (tmpdst == NULL) + { + int saved_errno = errno; + free (tmpsrc); + if (!(result == resultbuf || result == NULL)) + free (result); + if (buf_malloced != NULL) + free (buf_malloced); + CLEANUP (); + errno = saved_errno; + return NULL; + } + free (tmpsrc); +# endif + + if (has_width) + { +# if ENABLE_UNISTDIO + /* Outside POSIX, it's preferrable to compare the width + against the number of _characters_ of the converted + value. */ + w = DCHAR_MBSNLEN (result + length, characters); +# else + /* The width is compared against the number of _bytes_ + of the converted value, says POSIX. */ + w = characters; +# endif + } + else + /* w doesn't matter. */ + w = 0; + + if (has_width && width > w + && !(dp->flags & FLAG_LEFT)) + { + size_t n = width - w; + ENSURE_ALLOCATION (xsum (length, n)); + DCHAR_SET (result + length, ' ', n); + length += n; + } + +# if DCHAR_IS_TCHAR + if (has_precision || has_width) + { + /* We know the number of bytes in advance. */ + size_t remaining; +# if HAVE_WCRTOMB + mbstate_t state; + memset (&state, '\0', sizeof (mbstate_t)); +# endif + ENSURE_ALLOCATION (xsum (length, characters)); + for (remaining = characters; remaining > 0; ) + { + char buf[64]; /* Assume MB_CUR_MAX <= 64. */ + int count; + + if (*arg == 0) + abort (); +# if HAVE_WCRTOMB + count = wcrtomb (buf, *arg, &state); +# else + count = wctomb (buf, *arg); +# endif + if (count <= 0) + /* Inconsistency. */ + abort (); + memcpy (result + length, buf, count); + length += count; + arg++; + remaining -= count; + } + if (!(arg == arg_end)) + abort (); + } + else + { +# if HAVE_WCRTOMB + mbstate_t state; + memset (&state, '\0', sizeof (mbstate_t)); +# endif + while (arg < arg_end) + { + char buf[64]; /* Assume MB_CUR_MAX <= 64. */ + int count; + + if (*arg == 0) + abort (); +# if HAVE_WCRTOMB + count = wcrtomb (buf, *arg, &state); +# else + count = wctomb (buf, *arg); +# endif + if (count <= 0) + /* Inconsistency. */ + abort (); + ENSURE_ALLOCATION (xsum (length, count)); + memcpy (result + length, buf, count); + length += count; + arg++; + } + } +# else + ENSURE_ALLOCATION (xsum (length, tmpdst_len)); + DCHAR_CPY (result + length, tmpdst, tmpdst_len); + free (tmpdst); + length += tmpdst_len; +# endif + + if (has_width && width > w + && (dp->flags & FLAG_LEFT)) + { + size_t n = width - w; + ENSURE_ALLOCATION (xsum (length, n)); + DCHAR_SET (result + length, ' ', n); + length += n; + } + } + } +# endif +#endif +#if (NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_DOUBLE) && !defined IN_LIBINTL + else if ((dp->conversion == 'a' || dp->conversion == 'A') +# if !(NEED_PRINTF_DIRECTIVE_A || (NEED_PRINTF_LONG_DOUBLE && NEED_PRINTF_DOUBLE)) + && (0 +# if NEED_PRINTF_DOUBLE + || a.arg[dp->arg_index].type == TYPE_DOUBLE +# endif +# if NEED_PRINTF_LONG_DOUBLE + || a.arg[dp->arg_index].type == TYPE_LONGDOUBLE +# endif + ) +# endif + ) + { + arg_type type = a.arg[dp->arg_index].type; + int flags = dp->flags; + int has_width; + size_t width; + int has_precision; + size_t precision; + size_t tmp_length; + DCHAR_T tmpbuf[700]; + DCHAR_T *tmp; + DCHAR_T *pad_ptr; + DCHAR_T *p; + + has_width = 0; + width = 0; + if (dp->width_start != dp->width_end) + { + if (dp->width_arg_index != ARG_NONE) + { + int arg; + + if (!(a.arg[dp->width_arg_index].type == TYPE_INT)) + abort (); + arg = a.arg[dp->width_arg_index].a.a_int; + if (arg < 0) + { + /* "A negative field width is taken as a '-' flag + followed by a positive field width." */ + flags |= FLAG_LEFT; + width = (unsigned int) (-arg); + } + else + width = arg; + } + else + { + const FCHAR_T *digitp = dp->width_start; + + do + width = xsum (xtimes (width, 10), *digitp++ - '0'); + while (digitp != dp->width_end); + } + has_width = 1; + } + + has_precision = 0; + precision = 0; + if (dp->precision_start != dp->precision_end) + { + if (dp->precision_arg_index != ARG_NONE) + { + int arg; + + if (!(a.arg[dp->precision_arg_index].type == TYPE_INT)) + abort (); + arg = a.arg[dp->precision_arg_index].a.a_int; + /* "A negative precision is taken as if the precision + were omitted." */ + if (arg >= 0) + { + precision = arg; + has_precision = 1; + } + } + else + { + const FCHAR_T *digitp = dp->precision_start + 1; + + precision = 0; + while (digitp != dp->precision_end) + precision = xsum (xtimes (precision, 10), *digitp++ - '0'); + has_precision = 1; + } + } + + /* Allocate a temporary buffer of sufficient size. */ + if (type == TYPE_LONGDOUBLE) + tmp_length = + (unsigned int) ((LDBL_DIG + 1) + * 0.831 /* decimal -> hexadecimal */ + ) + + 1; /* turn floor into ceil */ + else + tmp_length = + (unsigned int) ((DBL_DIG + 1) + * 0.831 /* decimal -> hexadecimal */ + ) + + 1; /* turn floor into ceil */ + if (tmp_length < precision) + tmp_length = precision; + /* Account for sign, decimal point etc. */ + tmp_length = xsum (tmp_length, 12); + + if (tmp_length < width) + tmp_length = width; + + tmp_length = xsum (tmp_length, 1); /* account for trailing NUL */ + + if (tmp_length <= sizeof (tmpbuf) / sizeof (DCHAR_T)) + tmp = tmpbuf; + else + { + size_t tmp_memsize = xtimes (tmp_length, sizeof (DCHAR_T)); + + if (size_overflow_p (tmp_memsize)) + /* Overflow, would lead to out of memory. */ + goto out_of_memory; + tmp = (DCHAR_T *) malloc (tmp_memsize); + if (tmp == NULL) + /* Out of memory. */ + goto out_of_memory; + } + + pad_ptr = NULL; + p = tmp; + if (type == TYPE_LONGDOUBLE) + { +# if NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_LONG_DOUBLE + long double arg = a.arg[dp->arg_index].a.a_longdouble; + + if (isnanl (arg)) + { + if (dp->conversion == 'A') + { + *p++ = 'N'; *p++ = 'A'; *p++ = 'N'; + } + else + { + *p++ = 'n'; *p++ = 'a'; *p++ = 'n'; + } + } + else + { + int sign = 0; + DECL_LONG_DOUBLE_ROUNDING + + BEGIN_LONG_DOUBLE_ROUNDING (); + + if (signbit (arg)) /* arg < 0.0L or negative zero */ + { + sign = -1; + arg = -arg; + } + + if (sign < 0) + *p++ = '-'; + else if (flags & FLAG_SHOWSIGN) + *p++ = '+'; + else if (flags & FLAG_SPACE) + *p++ = ' '; + + if (arg > 0.0L && arg + arg == arg) + { + if (dp->conversion == 'A') + { + *p++ = 'I'; *p++ = 'N'; *p++ = 'F'; + } + else + { + *p++ = 'i'; *p++ = 'n'; *p++ = 'f'; + } + } + else + { + int exponent; + long double mantissa; + + if (arg > 0.0L) + mantissa = printf_frexpl (arg, &exponent); + else + { + exponent = 0; + mantissa = 0.0L; + } + + if (has_precision + && precision < (unsigned int) ((LDBL_DIG + 1) * 0.831) + 1) + { + /* Round the mantissa. */ + long double tail = mantissa; + size_t q; + + for (q = precision; ; q--) + { + int digit = (int) tail; + tail -= digit; + if (q == 0) + { + if (digit & 1 ? tail >= 0.5L : tail > 0.5L) + tail = 1 - tail; + else + tail = - tail; + break; + } + tail *= 16.0L; + } + if (tail != 0.0L) + for (q = precision; q > 0; q--) + tail *= 0.0625L; + mantissa += tail; + } + + *p++ = '0'; + *p++ = dp->conversion - 'A' + 'X'; + pad_ptr = p; + { + int digit; + + digit = (int) mantissa; + mantissa -= digit; + *p++ = '0' + digit; + if ((flags & FLAG_ALT) + || mantissa > 0.0L || precision > 0) + { + *p++ = decimal_point_char (); + /* This loop terminates because we assume + that FLT_RADIX is a power of 2. */ + while (mantissa > 0.0L) + { + mantissa *= 16.0L; + digit = (int) mantissa; + mantissa -= digit; + *p++ = digit + + (digit < 10 + ? '0' + : dp->conversion - 10); + if (precision > 0) + precision--; + } + while (precision > 0) + { + *p++ = '0'; + precision--; + } + } + } + *p++ = dp->conversion - 'A' + 'P'; +# if WIDE_CHAR_VERSION + { + static const wchar_t decimal_format[] = + { '%', '+', 'd', '\0' }; + SNPRINTF (p, 6 + 1, decimal_format, exponent); + } + while (*p != '\0') + p++; +# else + if (sizeof (DCHAR_T) == 1) + { + sprintf ((char *) p, "%+d", exponent); + while (*p != '\0') + p++; + } + else + { + char expbuf[6 + 1]; + const char *ep; + sprintf (expbuf, "%+d", exponent); + for (ep = expbuf; (*p = *ep) != '\0'; ep++) + p++; + } +# endif + } + + END_LONG_DOUBLE_ROUNDING (); + } +# else + abort (); +# endif + } + else + { +# if NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_DOUBLE + double arg = a.arg[dp->arg_index].a.a_double; + + if (isnand (arg)) + { + if (dp->conversion == 'A') + { + *p++ = 'N'; *p++ = 'A'; *p++ = 'N'; + } + else + { + *p++ = 'n'; *p++ = 'a'; *p++ = 'n'; + } + } + else + { + int sign = 0; + + if (signbit (arg)) /* arg < 0.0 or negative zero */ + { + sign = -1; + arg = -arg; + } + + if (sign < 0) + *p++ = '-'; + else if (flags & FLAG_SHOWSIGN) + *p++ = '+'; + else if (flags & FLAG_SPACE) + *p++ = ' '; + + if (arg > 0.0 && arg + arg == arg) + { + if (dp->conversion == 'A') + { + *p++ = 'I'; *p++ = 'N'; *p++ = 'F'; + } + else + { + *p++ = 'i'; *p++ = 'n'; *p++ = 'f'; + } + } + else + { + int exponent; + double mantissa; + + if (arg > 0.0) + mantissa = printf_frexp (arg, &exponent); + else + { + exponent = 0; + mantissa = 0.0; + } + + if (has_precision + && precision < (unsigned int) ((DBL_DIG + 1) * 0.831) + 1) + { + /* Round the mantissa. */ + double tail = mantissa; + size_t q; + + for (q = precision; ; q--) + { + int digit = (int) tail; + tail -= digit; + if (q == 0) + { + if (digit & 1 ? tail >= 0.5 : tail > 0.5) + tail = 1 - tail; + else + tail = - tail; + break; + } + tail *= 16.0; + } + if (tail != 0.0) + for (q = precision; q > 0; q--) + tail *= 0.0625; + mantissa += tail; + } + + *p++ = '0'; + *p++ = dp->conversion - 'A' + 'X'; + pad_ptr = p; + { + int digit; + + digit = (int) mantissa; + mantissa -= digit; + *p++ = '0' + digit; + if ((flags & FLAG_ALT) + || mantissa > 0.0 || precision > 0) + { + *p++ = decimal_point_char (); + /* This loop terminates because we assume + that FLT_RADIX is a power of 2. */ + while (mantissa > 0.0) + { + mantissa *= 16.0; + digit = (int) mantissa; + mantissa -= digit; + *p++ = digit + + (digit < 10 + ? '0' + : dp->conversion - 10); + if (precision > 0) + precision--; + } + while (precision > 0) + { + *p++ = '0'; + precision--; + } + } + } + *p++ = dp->conversion - 'A' + 'P'; +# if WIDE_CHAR_VERSION + { + static const wchar_t decimal_format[] = + { '%', '+', 'd', '\0' }; + SNPRINTF (p, 6 + 1, decimal_format, exponent); + } + while (*p != '\0') + p++; +# else + if (sizeof (DCHAR_T) == 1) + { + sprintf ((char *) p, "%+d", exponent); + while (*p != '\0') + p++; + } + else + { + char expbuf[6 + 1]; + const char *ep; + sprintf (expbuf, "%+d", exponent); + for (ep = expbuf; (*p = *ep) != '\0'; ep++) + p++; + } +# endif + } + } +# else + abort (); +# endif + } + /* The generated string now extends from tmp to p, with the + zero padding insertion point being at pad_ptr. */ + if (has_width && p - tmp < width) + { + size_t pad = width - (p - tmp); + DCHAR_T *end = p + pad; + + if (flags & FLAG_LEFT) + { + /* Pad with spaces on the right. */ + for (; pad > 0; pad--) + *p++ = ' '; + } + else if ((flags & FLAG_ZERO) && pad_ptr != NULL) + { + /* Pad with zeroes. */ + DCHAR_T *q = end; + + while (p > pad_ptr) + *--q = *--p; + for (; pad > 0; pad--) + *p++ = '0'; + } + else + { + /* Pad with spaces on the left. */ + DCHAR_T *q = end; + + while (p > tmp) + *--q = *--p; + for (; pad > 0; pad--) + *p++ = ' '; + } + + p = end; + } + + { + size_t count = p - tmp; + + if (count >= tmp_length) + /* tmp_length was incorrectly calculated - fix the + code above! */ + abort (); + + /* Make room for the result. */ + if (count >= allocated - length) + { + size_t n = xsum (length, count); + + ENSURE_ALLOCATION (n); + } + + /* Append the result. */ + memcpy (result + length, tmp, count * sizeof (DCHAR_T)); + if (tmp != tmpbuf) + free (tmp); + length += count; + } + } +#endif +#if (NEED_PRINTF_INFINITE_DOUBLE || NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_LONG_DOUBLE || NEED_PRINTF_LONG_DOUBLE) && !defined IN_LIBINTL + else if ((dp->conversion == 'f' || dp->conversion == 'F' + || dp->conversion == 'e' || dp->conversion == 'E' + || dp->conversion == 'g' || dp->conversion == 'G' + || dp->conversion == 'a' || dp->conversion == 'A') + && (0 +# if NEED_PRINTF_DOUBLE + || a.arg[dp->arg_index].type == TYPE_DOUBLE +# elif NEED_PRINTF_INFINITE_DOUBLE + || (a.arg[dp->arg_index].type == TYPE_DOUBLE + /* The systems (mingw) which produce wrong output + for Inf, -Inf, and NaN also do so for -0.0. + Therefore we treat this case here as well. */ + && is_infinite_or_zero (a.arg[dp->arg_index].a.a_double)) +# endif +# if NEED_PRINTF_LONG_DOUBLE + || a.arg[dp->arg_index].type == TYPE_LONGDOUBLE +# elif NEED_PRINTF_INFINITE_LONG_DOUBLE + || (a.arg[dp->arg_index].type == TYPE_LONGDOUBLE + /* Some systems produce wrong output for Inf, + -Inf, and NaN. Some systems in this category + (IRIX 5.3) also do so for -0.0. Therefore we + treat this case here as well. */ + && is_infinite_or_zerol (a.arg[dp->arg_index].a.a_longdouble)) +# endif + )) + { +# if (NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_DOUBLE) && (NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_INFINITE_LONG_DOUBLE) + arg_type type = a.arg[dp->arg_index].type; +# endif + int flags = dp->flags; + int has_width; + size_t width; + int has_precision; + size_t precision; + size_t tmp_length; + DCHAR_T tmpbuf[700]; + DCHAR_T *tmp; + DCHAR_T *pad_ptr; + DCHAR_T *p; + + has_width = 0; + width = 0; + if (dp->width_start != dp->width_end) + { + if (dp->width_arg_index != ARG_NONE) + { + int arg; + + if (!(a.arg[dp->width_arg_index].type == TYPE_INT)) + abort (); + arg = a.arg[dp->width_arg_index].a.a_int; + if (arg < 0) + { + /* "A negative field width is taken as a '-' flag + followed by a positive field width." */ + flags |= FLAG_LEFT; + width = (unsigned int) (-arg); + } + else + width = arg; + } + else + { + const FCHAR_T *digitp = dp->width_start; + + do + width = xsum (xtimes (width, 10), *digitp++ - '0'); + while (digitp != dp->width_end); + } + has_width = 1; + } + + has_precision = 0; + precision = 0; + if (dp->precision_start != dp->precision_end) + { + if (dp->precision_arg_index != ARG_NONE) + { + int arg; + + if (!(a.arg[dp->precision_arg_index].type == TYPE_INT)) + abort (); + arg = a.arg[dp->precision_arg_index].a.a_int; + /* "A negative precision is taken as if the precision + were omitted." */ + if (arg >= 0) + { + precision = arg; + has_precision = 1; + } + } + else + { + const FCHAR_T *digitp = dp->precision_start + 1; + + precision = 0; + while (digitp != dp->precision_end) + precision = xsum (xtimes (precision, 10), *digitp++ - '0'); + has_precision = 1; + } + } + + /* POSIX specifies the default precision to be 6 for %f, %F, + %e, %E, but not for %g, %G. Implementations appear to use + the same default precision also for %g, %G. But for %a, %A, + the default precision is 0. */ + if (!has_precision) + if (!(dp->conversion == 'a' || dp->conversion == 'A')) + precision = 6; + + /* Allocate a temporary buffer of sufficient size. */ +# if NEED_PRINTF_DOUBLE && NEED_PRINTF_LONG_DOUBLE + tmp_length = (type == TYPE_LONGDOUBLE ? LDBL_DIG + 1 : DBL_DIG + 1); +# elif NEED_PRINTF_INFINITE_DOUBLE && NEED_PRINTF_LONG_DOUBLE + tmp_length = (type == TYPE_LONGDOUBLE ? LDBL_DIG + 1 : 0); +# elif NEED_PRINTF_LONG_DOUBLE + tmp_length = LDBL_DIG + 1; +# elif NEED_PRINTF_DOUBLE + tmp_length = DBL_DIG + 1; +# else + tmp_length = 0; +# endif + if (tmp_length < precision) + tmp_length = precision; +# if NEED_PRINTF_LONG_DOUBLE +# if NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_DOUBLE + if (type == TYPE_LONGDOUBLE) +# endif + if (dp->conversion == 'f' || dp->conversion == 'F') + { + long double arg = a.arg[dp->arg_index].a.a_longdouble; + if (!(isnanl (arg) || arg + arg == arg)) + { + /* arg is finite and nonzero. */ + int exponent = floorlog10l (arg < 0 ? -arg : arg); + if (exponent >= 0 && tmp_length < exponent + precision) + tmp_length = exponent + precision; + } + } +# endif +# if NEED_PRINTF_DOUBLE +# if NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_INFINITE_LONG_DOUBLE + if (type == TYPE_DOUBLE) +# endif + if (dp->conversion == 'f' || dp->conversion == 'F') + { + double arg = a.arg[dp->arg_index].a.a_double; + if (!(isnand (arg) || arg + arg == arg)) + { + /* arg is finite and nonzero. */ + int exponent = floorlog10 (arg < 0 ? -arg : arg); + if (exponent >= 0 && tmp_length < exponent + precision) + tmp_length = exponent + precision; + } + } +# endif + /* Account for sign, decimal point etc. */ + tmp_length = xsum (tmp_length, 12); + + if (tmp_length < width) + tmp_length = width; + + tmp_length = xsum (tmp_length, 1); /* account for trailing NUL */ + + if (tmp_length <= sizeof (tmpbuf) / sizeof (DCHAR_T)) + tmp = tmpbuf; + else + { + size_t tmp_memsize = xtimes (tmp_length, sizeof (DCHAR_T)); + + if (size_overflow_p (tmp_memsize)) + /* Overflow, would lead to out of memory. */ + goto out_of_memory; + tmp = (DCHAR_T *) malloc (tmp_memsize); + if (tmp == NULL) + /* Out of memory. */ + goto out_of_memory; + } + + pad_ptr = NULL; + p = tmp; + +# if NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_INFINITE_LONG_DOUBLE +# if NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_DOUBLE + if (type == TYPE_LONGDOUBLE) +# endif + { + long double arg = a.arg[dp->arg_index].a.a_longdouble; + + if (isnanl (arg)) + { + if (dp->conversion >= 'A' && dp->conversion <= 'Z') + { + *p++ = 'N'; *p++ = 'A'; *p++ = 'N'; + } + else + { + *p++ = 'n'; *p++ = 'a'; *p++ = 'n'; + } + } + else + { + int sign = 0; + DECL_LONG_DOUBLE_ROUNDING + + BEGIN_LONG_DOUBLE_ROUNDING (); + + if (signbit (arg)) /* arg < 0.0L or negative zero */ + { + sign = -1; + arg = -arg; + } + + if (sign < 0) + *p++ = '-'; + else if (flags & FLAG_SHOWSIGN) + *p++ = '+'; + else if (flags & FLAG_SPACE) + *p++ = ' '; + + if (arg > 0.0L && arg + arg == arg) + { + if (dp->conversion >= 'A' && dp->conversion <= 'Z') + { + *p++ = 'I'; *p++ = 'N'; *p++ = 'F'; + } + else + { + *p++ = 'i'; *p++ = 'n'; *p++ = 'f'; + } + } + else + { +# if NEED_PRINTF_LONG_DOUBLE + pad_ptr = p; + + if (dp->conversion == 'f' || dp->conversion == 'F') + { + char *digits; + size_t ndigits; + + digits = + scale10_round_decimal_long_double (arg, precision); + if (digits == NULL) + { + END_LONG_DOUBLE_ROUNDING (); + goto out_of_memory; + } + ndigits = strlen (digits); + + if (ndigits > precision) + do + { + --ndigits; + *p++ = digits[ndigits]; + } + while (ndigits > precision); + else + *p++ = '0'; + /* Here ndigits <= precision. */ + if ((flags & FLAG_ALT) || precision > 0) + { + *p++ = decimal_point_char (); + for (; precision > ndigits; precision--) + *p++ = '0'; + while (ndigits > 0) + { + --ndigits; + *p++ = digits[ndigits]; + } + } + + free (digits); + } + else if (dp->conversion == 'e' || dp->conversion == 'E') + { + int exponent; + + if (arg == 0.0L) + { + exponent = 0; + *p++ = '0'; + if ((flags & FLAG_ALT) || precision > 0) + { + *p++ = decimal_point_char (); + for (; precision > 0; precision--) + *p++ = '0'; + } + } + else + { + /* arg > 0.0L. */ + int adjusted; + char *digits; + size_t ndigits; + + exponent = floorlog10l (arg); + adjusted = 0; + for (;;) + { + digits = + scale10_round_decimal_long_double (arg, + (int)precision - exponent); + if (digits == NULL) + { + END_LONG_DOUBLE_ROUNDING (); + goto out_of_memory; + } + ndigits = strlen (digits); + + if (ndigits == precision + 1) + break; + if (ndigits < precision + || ndigits > precision + 2) + /* The exponent was not guessed + precisely enough. */ + abort (); + if (adjusted) + /* None of two values of exponent is + the right one. Prevent an endless + loop. */ + abort (); + free (digits); + if (ndigits == precision) + exponent -= 1; + else + exponent += 1; + adjusted = 1; + } + /* Here ndigits = precision+1. */ + if (is_borderline (digits, precision)) + { + /* Maybe the exponent guess was too high + and a smaller exponent can be reached + by turning a 10...0 into 9...9x. */ + char *digits2 = + scale10_round_decimal_long_double (arg, + (int)precision - exponent + 1); + if (digits2 == NULL) + { + free (digits); + END_LONG_DOUBLE_ROUNDING (); + goto out_of_memory; + } + if (strlen (digits2) == precision + 1) + { + free (digits); + digits = digits2; + exponent -= 1; + } + else + free (digits2); + } + /* Here ndigits = precision+1. */ + + *p++ = digits[--ndigits]; + if ((flags & FLAG_ALT) || precision > 0) + { + *p++ = decimal_point_char (); + while (ndigits > 0) + { + --ndigits; + *p++ = digits[ndigits]; + } + } + + free (digits); + } + + *p++ = dp->conversion; /* 'e' or 'E' */ +# if WIDE_CHAR_VERSION + { + static const wchar_t decimal_format[] = + { '%', '+', '.', '2', 'd', '\0' }; + SNPRINTF (p, 6 + 1, decimal_format, exponent); + } + while (*p != '\0') + p++; +# else + if (sizeof (DCHAR_T) == 1) + { + sprintf ((char *) p, "%+.2d", exponent); + while (*p != '\0') + p++; + } + else + { + char expbuf[6 + 1]; + const char *ep; + sprintf (expbuf, "%+.2d", exponent); + for (ep = expbuf; (*p = *ep) != '\0'; ep++) + p++; + } +# endif + } + else if (dp->conversion == 'g' || dp->conversion == 'G') + { + if (precision == 0) + precision = 1; + /* precision >= 1. */ + + if (arg == 0.0L) + /* The exponent is 0, >= -4, < precision. + Use fixed-point notation. */ + { + size_t ndigits = precision; + /* Number of trailing zeroes that have to be + dropped. */ + size_t nzeroes = + (flags & FLAG_ALT ? 0 : precision - 1); + + --ndigits; + *p++ = '0'; + if ((flags & FLAG_ALT) || ndigits > nzeroes) + { + *p++ = decimal_point_char (); + while (ndigits > nzeroes) + { + --ndigits; + *p++ = '0'; + } + } + } + else + { + /* arg > 0.0L. */ + int exponent; + int adjusted; + char *digits; + size_t ndigits; + size_t nzeroes; + + exponent = floorlog10l (arg); + adjusted = 0; + for (;;) + { + digits = + scale10_round_decimal_long_double (arg, + (int)(precision - 1) - exponent); + if (digits == NULL) + { + END_LONG_DOUBLE_ROUNDING (); + goto out_of_memory; + } + ndigits = strlen (digits); + + if (ndigits == precision) + break; + if (ndigits < precision - 1 + || ndigits > precision + 1) + /* The exponent was not guessed + precisely enough. */ + abort (); + if (adjusted) + /* None of two values of exponent is + the right one. Prevent an endless + loop. */ + abort (); + free (digits); + if (ndigits < precision) + exponent -= 1; + else + exponent += 1; + adjusted = 1; + } + /* Here ndigits = precision. */ + if (is_borderline (digits, precision - 1)) + { + /* Maybe the exponent guess was too high + and a smaller exponent can be reached + by turning a 10...0 into 9...9x. */ + char *digits2 = + scale10_round_decimal_long_double (arg, + (int)(precision - 1) - exponent + 1); + if (digits2 == NULL) + { + free (digits); + END_LONG_DOUBLE_ROUNDING (); + goto out_of_memory; + } + if (strlen (digits2) == precision) + { + free (digits); + digits = digits2; + exponent -= 1; + } + else + free (digits2); + } + /* Here ndigits = precision. */ + + /* Determine the number of trailing zeroes + that have to be dropped. */ + nzeroes = 0; + if ((flags & FLAG_ALT) == 0) + while (nzeroes < ndigits + && digits[nzeroes] == '0') + nzeroes++; + + /* The exponent is now determined. */ + if (exponent >= -4 + && exponent < (long)precision) + { + /* Fixed-point notation: + max(exponent,0)+1 digits, then the + decimal point, then the remaining + digits without trailing zeroes. */ + if (exponent >= 0) + { + size_t count = exponent + 1; + /* Note: count <= precision = ndigits. */ + for (; count > 0; count--) + *p++ = digits[--ndigits]; + if ((flags & FLAG_ALT) || ndigits > nzeroes) + { + *p++ = decimal_point_char (); + while (ndigits > nzeroes) + { + --ndigits; + *p++ = digits[ndigits]; + } + } + } + else + { + size_t count = -exponent - 1; + *p++ = '0'; + *p++ = decimal_point_char (); + for (; count > 0; count--) + *p++ = '0'; + while (ndigits > nzeroes) + { + --ndigits; + *p++ = digits[ndigits]; + } + } + } + else + { + /* Exponential notation. */ + *p++ = digits[--ndigits]; + if ((flags & FLAG_ALT) || ndigits > nzeroes) + { + *p++ = decimal_point_char (); + while (ndigits > nzeroes) + { + --ndigits; + *p++ = digits[ndigits]; + } + } + *p++ = dp->conversion - 'G' + 'E'; /* 'e' or 'E' */ +# if WIDE_CHAR_VERSION + { + static const wchar_t decimal_format[] = + { '%', '+', '.', '2', 'd', '\0' }; + SNPRINTF (p, 6 + 1, decimal_format, exponent); + } + while (*p != '\0') + p++; +# else + if (sizeof (DCHAR_T) == 1) + { + sprintf ((char *) p, "%+.2d", exponent); + while (*p != '\0') + p++; + } + else + { + char expbuf[6 + 1]; + const char *ep; + sprintf (expbuf, "%+.2d", exponent); + for (ep = expbuf; (*p = *ep) != '\0'; ep++) + p++; + } +# endif + } + + free (digits); + } + } + else + abort (); +# else + /* arg is finite. */ + if (!(arg == 0.0L)) + abort (); + + pad_ptr = p; + + if (dp->conversion == 'f' || dp->conversion == 'F') + { + *p++ = '0'; + if ((flags & FLAG_ALT) || precision > 0) + { + *p++ = decimal_point_char (); + for (; precision > 0; precision--) + *p++ = '0'; + } + } + else if (dp->conversion == 'e' || dp->conversion == 'E') + { + *p++ = '0'; + if ((flags & FLAG_ALT) || precision > 0) + { + *p++ = decimal_point_char (); + for (; precision > 0; precision--) + *p++ = '0'; + } + *p++ = dp->conversion; /* 'e' or 'E' */ + *p++ = '+'; + *p++ = '0'; + *p++ = '0'; + } + else if (dp->conversion == 'g' || dp->conversion == 'G') + { + *p++ = '0'; + if (flags & FLAG_ALT) + { + size_t ndigits = + (precision > 0 ? precision - 1 : 0); + *p++ = decimal_point_char (); + for (; ndigits > 0; --ndigits) + *p++ = '0'; + } + } + else if (dp->conversion == 'a' || dp->conversion == 'A') + { + *p++ = '0'; + *p++ = dp->conversion - 'A' + 'X'; + pad_ptr = p; + *p++ = '0'; + if ((flags & FLAG_ALT) || precision > 0) + { + *p++ = decimal_point_char (); + for (; precision > 0; precision--) + *p++ = '0'; + } + *p++ = dp->conversion - 'A' + 'P'; + *p++ = '+'; + *p++ = '0'; + } + else + abort (); +# endif + } + + END_LONG_DOUBLE_ROUNDING (); + } + } +# if NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_DOUBLE + else +# endif +# endif +# if NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_DOUBLE + { + double arg = a.arg[dp->arg_index].a.a_double; + + if (isnand (arg)) + { + if (dp->conversion >= 'A' && dp->conversion <= 'Z') + { + *p++ = 'N'; *p++ = 'A'; *p++ = 'N'; + } + else + { + *p++ = 'n'; *p++ = 'a'; *p++ = 'n'; + } + } + else + { + int sign = 0; + + if (signbit (arg)) /* arg < 0.0 or negative zero */ + { + sign = -1; + arg = -arg; + } + + if (sign < 0) + *p++ = '-'; + else if (flags & FLAG_SHOWSIGN) + *p++ = '+'; + else if (flags & FLAG_SPACE) + *p++ = ' '; + + if (arg > 0.0 && arg + arg == arg) + { + if (dp->conversion >= 'A' && dp->conversion <= 'Z') + { + *p++ = 'I'; *p++ = 'N'; *p++ = 'F'; + } + else + { + *p++ = 'i'; *p++ = 'n'; *p++ = 'f'; + } + } + else + { +# if NEED_PRINTF_DOUBLE + pad_ptr = p; + + if (dp->conversion == 'f' || dp->conversion == 'F') + { + char *digits; + size_t ndigits; + + digits = + scale10_round_decimal_double (arg, precision); + if (digits == NULL) + goto out_of_memory; + ndigits = strlen (digits); + + if (ndigits > precision) + do + { + --ndigits; + *p++ = digits[ndigits]; + } + while (ndigits > precision); + else + *p++ = '0'; + /* Here ndigits <= precision. */ + if ((flags & FLAG_ALT) || precision > 0) + { + *p++ = decimal_point_char (); + for (; precision > ndigits; precision--) + *p++ = '0'; + while (ndigits > 0) + { + --ndigits; + *p++ = digits[ndigits]; + } + } + + free (digits); + } + else if (dp->conversion == 'e' || dp->conversion == 'E') + { + int exponent; + + if (arg == 0.0) + { + exponent = 0; + *p++ = '0'; + if ((flags & FLAG_ALT) || precision > 0) + { + *p++ = decimal_point_char (); + for (; precision > 0; precision--) + *p++ = '0'; + } + } + else + { + /* arg > 0.0. */ + int adjusted; + char *digits; + size_t ndigits; + + exponent = floorlog10 (arg); + adjusted = 0; + for (;;) + { + digits = + scale10_round_decimal_double (arg, + (int)precision - exponent); + if (digits == NULL) + goto out_of_memory; + ndigits = strlen (digits); + + if (ndigits == precision + 1) + break; + if (ndigits < precision + || ndigits > precision + 2) + /* The exponent was not guessed + precisely enough. */ + abort (); + if (adjusted) + /* None of two values of exponent is + the right one. Prevent an endless + loop. */ + abort (); + free (digits); + if (ndigits == precision) + exponent -= 1; + else + exponent += 1; + adjusted = 1; + } + /* Here ndigits = precision+1. */ + if (is_borderline (digits, precision)) + { + /* Maybe the exponent guess was too high + and a smaller exponent can be reached + by turning a 10...0 into 9...9x. */ + char *digits2 = + scale10_round_decimal_double (arg, + (int)precision - exponent + 1); + if (digits2 == NULL) + { + free (digits); + goto out_of_memory; + } + if (strlen (digits2) == precision + 1) + { + free (digits); + digits = digits2; + exponent -= 1; + } + else + free (digits2); + } + /* Here ndigits = precision+1. */ + + *p++ = digits[--ndigits]; + if ((flags & FLAG_ALT) || precision > 0) + { + *p++ = decimal_point_char (); + while (ndigits > 0) + { + --ndigits; + *p++ = digits[ndigits]; + } + } + + free (digits); + } + + *p++ = dp->conversion; /* 'e' or 'E' */ +# if WIDE_CHAR_VERSION + { + static const wchar_t decimal_format[] = + /* Produce the same number of exponent digits + as the native printf implementation. */ +# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ + { '%', '+', '.', '3', 'd', '\0' }; +# else + { '%', '+', '.', '2', 'd', '\0' }; +# endif + SNPRINTF (p, 6 + 1, decimal_format, exponent); + } + while (*p != '\0') + p++; +# else + { + static const char decimal_format[] = + /* Produce the same number of exponent digits + as the native printf implementation. */ +# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ + "%+.3d"; +# else + "%+.2d"; +# endif + if (sizeof (DCHAR_T) == 1) + { + sprintf ((char *) p, decimal_format, exponent); + while (*p != '\0') + p++; + } + else + { + char expbuf[6 + 1]; + const char *ep; + sprintf (expbuf, decimal_format, exponent); + for (ep = expbuf; (*p = *ep) != '\0'; ep++) + p++; + } + } +# endif + } + else if (dp->conversion == 'g' || dp->conversion == 'G') + { + if (precision == 0) + precision = 1; + /* precision >= 1. */ + + if (arg == 0.0) + /* The exponent is 0, >= -4, < precision. + Use fixed-point notation. */ + { + size_t ndigits = precision; + /* Number of trailing zeroes that have to be + dropped. */ + size_t nzeroes = + (flags & FLAG_ALT ? 0 : precision - 1); + + --ndigits; + *p++ = '0'; + if ((flags & FLAG_ALT) || ndigits > nzeroes) + { + *p++ = decimal_point_char (); + while (ndigits > nzeroes) + { + --ndigits; + *p++ = '0'; + } + } + } + else + { + /* arg > 0.0. */ + int exponent; + int adjusted; + char *digits; + size_t ndigits; + size_t nzeroes; + + exponent = floorlog10 (arg); + adjusted = 0; + for (;;) + { + digits = + scale10_round_decimal_double (arg, + (int)(precision - 1) - exponent); + if (digits == NULL) + goto out_of_memory; + ndigits = strlen (digits); + + if (ndigits == precision) + break; + if (ndigits < precision - 1 + || ndigits > precision + 1) + /* The exponent was not guessed + precisely enough. */ + abort (); + if (adjusted) + /* None of two values of exponent is + the right one. Prevent an endless + loop. */ + abort (); + free (digits); + if (ndigits < precision) + exponent -= 1; + else + exponent += 1; + adjusted = 1; + } + /* Here ndigits = precision. */ + if (is_borderline (digits, precision - 1)) + { + /* Maybe the exponent guess was too high + and a smaller exponent can be reached + by turning a 10...0 into 9...9x. */ + char *digits2 = + scale10_round_decimal_double (arg, + (int)(precision - 1) - exponent + 1); + if (digits2 == NULL) + { + free (digits); + goto out_of_memory; + } + if (strlen (digits2) == precision) + { + free (digits); + digits = digits2; + exponent -= 1; + } + else + free (digits2); + } + /* Here ndigits = precision. */ + + /* Determine the number of trailing zeroes + that have to be dropped. */ + nzeroes = 0; + if ((flags & FLAG_ALT) == 0) + while (nzeroes < ndigits + && digits[nzeroes] == '0') + nzeroes++; + + /* The exponent is now determined. */ + if (exponent >= -4 + && exponent < (long)precision) + { + /* Fixed-point notation: + max(exponent,0)+1 digits, then the + decimal point, then the remaining + digits without trailing zeroes. */ + if (exponent >= 0) + { + size_t count = exponent + 1; + /* Note: count <= precision = ndigits. */ + for (; count > 0; count--) + *p++ = digits[--ndigits]; + if ((flags & FLAG_ALT) || ndigits > nzeroes) + { + *p++ = decimal_point_char (); + while (ndigits > nzeroes) + { + --ndigits; + *p++ = digits[ndigits]; + } + } + } + else + { + size_t count = -exponent - 1; + *p++ = '0'; + *p++ = decimal_point_char (); + for (; count > 0; count--) + *p++ = '0'; + while (ndigits > nzeroes) + { + --ndigits; + *p++ = digits[ndigits]; + } + } + } + else + { + /* Exponential notation. */ + *p++ = digits[--ndigits]; + if ((flags & FLAG_ALT) || ndigits > nzeroes) + { + *p++ = decimal_point_char (); + while (ndigits > nzeroes) + { + --ndigits; + *p++ = digits[ndigits]; + } + } + *p++ = dp->conversion - 'G' + 'E'; /* 'e' or 'E' */ +# if WIDE_CHAR_VERSION + { + static const wchar_t decimal_format[] = + /* Produce the same number of exponent digits + as the native printf implementation. */ +# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ + { '%', '+', '.', '3', 'd', '\0' }; +# else + { '%', '+', '.', '2', 'd', '\0' }; +# endif + SNPRINTF (p, 6 + 1, decimal_format, exponent); + } + while (*p != '\0') + p++; +# else + { + static const char decimal_format[] = + /* Produce the same number of exponent digits + as the native printf implementation. */ +# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ + "%+.3d"; +# else + "%+.2d"; +# endif + if (sizeof (DCHAR_T) == 1) + { + sprintf ((char *) p, decimal_format, exponent); + while (*p != '\0') + p++; + } + else + { + char expbuf[6 + 1]; + const char *ep; + sprintf (expbuf, decimal_format, exponent); + for (ep = expbuf; (*p = *ep) != '\0'; ep++) + p++; + } + } +# endif + } + + free (digits); + } + } + else + abort (); +# else + /* arg is finite. */ + if (!(arg == 0.0)) + abort (); + + pad_ptr = p; + + if (dp->conversion == 'f' || dp->conversion == 'F') + { + *p++ = '0'; + if ((flags & FLAG_ALT) || precision > 0) + { + *p++ = decimal_point_char (); + for (; precision > 0; precision--) + *p++ = '0'; + } + } + else if (dp->conversion == 'e' || dp->conversion == 'E') + { + *p++ = '0'; + if ((flags & FLAG_ALT) || precision > 0) + { + *p++ = decimal_point_char (); + for (; precision > 0; precision--) + *p++ = '0'; + } + *p++ = dp->conversion; /* 'e' or 'E' */ + *p++ = '+'; + /* Produce the same number of exponent digits as + the native printf implementation. */ +# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ + *p++ = '0'; +# endif + *p++ = '0'; + *p++ = '0'; + } + else if (dp->conversion == 'g' || dp->conversion == 'G') + { + *p++ = '0'; + if (flags & FLAG_ALT) + { + size_t ndigits = + (precision > 0 ? precision - 1 : 0); + *p++ = decimal_point_char (); + for (; ndigits > 0; --ndigits) + *p++ = '0'; + } + } + else + abort (); +# endif + } + } + } +# endif + + /* The generated string now extends from tmp to p, with the + zero padding insertion point being at pad_ptr. */ + if (has_width && p - tmp < width) + { + size_t pad = width - (p - tmp); + DCHAR_T *end = p + pad; + + if (flags & FLAG_LEFT) + { + /* Pad with spaces on the right. */ + for (; pad > 0; pad--) + *p++ = ' '; + } + else if ((flags & FLAG_ZERO) && pad_ptr != NULL) + { + /* Pad with zeroes. */ + DCHAR_T *q = end; + + while (p > pad_ptr) + *--q = *--p; + for (; pad > 0; pad--) + *p++ = '0'; + } + else + { + /* Pad with spaces on the left. */ + DCHAR_T *q = end; + + while (p > tmp) + *--q = *--p; + for (; pad > 0; pad--) + *p++ = ' '; + } + + p = end; + } + + { + size_t count = p - tmp; + + if (count >= tmp_length) + /* tmp_length was incorrectly calculated - fix the + code above! */ + abort (); + + /* Make room for the result. */ + if (count >= allocated - length) + { + size_t n = xsum (length, count); + + ENSURE_ALLOCATION (n); + } + + /* Append the result. */ + memcpy (result + length, tmp, count * sizeof (DCHAR_T)); + if (tmp != tmpbuf) + free (tmp); + length += count; + } + } +#endif else { arg_type type = a.arg[dp->arg_index].type; - CHAR_T *p; + int flags = dp->flags; +#if !USE_SNPRINTF || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION + int has_width; + size_t width; +#endif +#if !USE_SNPRINTF || NEED_PRINTF_UNBOUNDED_PRECISION + int has_precision; + size_t precision; +#endif +#if NEED_PRINTF_UNBOUNDED_PRECISION + int prec_ourselves; +#else +# define prec_ourselves 0 +#endif +#if NEED_PRINTF_FLAG_LEFTADJUST +# define pad_ourselves 1 +#elif !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION + int pad_ourselves; +#else +# define pad_ourselves 0 +#endif + TCHAR_T *fbp; unsigned int prefix_count; - int prefixes[2]; + int prefixes[2] IF_LINT (= { 0 }); #if !USE_SNPRINTF size_t tmp_length; - CHAR_T tmpbuf[700]; - CHAR_T *tmp; + TCHAR_T tmpbuf[700]; + TCHAR_T *tmp; +#endif +#if !USE_SNPRINTF || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION + has_width = 0; + width = 0; + if (dp->width_start != dp->width_end) + { + if (dp->width_arg_index != ARG_NONE) + { + int arg; + + if (!(a.arg[dp->width_arg_index].type == TYPE_INT)) + abort (); + arg = a.arg[dp->width_arg_index].a.a_int; + if (arg < 0) + { + /* "A negative field width is taken as a '-' flag + followed by a positive field width." */ + flags |= FLAG_LEFT; + width = (unsigned int) (-arg); + } + else + width = arg; + } + else + { + const FCHAR_T *digitp = dp->width_start; + + do + width = xsum (xtimes (width, 10), *digitp++ - '0'); + while (digitp != dp->width_end); + } + has_width = 1; + } +#endif + +#if !USE_SNPRINTF || NEED_PRINTF_UNBOUNDED_PRECISION + has_precision = 0; + precision = 6; + if (dp->precision_start != dp->precision_end) + { + if (dp->precision_arg_index != ARG_NONE) + { + int arg; + + if (!(a.arg[dp->precision_arg_index].type == TYPE_INT)) + abort (); + arg = a.arg[dp->precision_arg_index].a.a_int; + /* "A negative precision is taken as if the precision + were omitted." */ + if (arg >= 0) + { + precision = arg; + has_precision = 1; + } + } + else + { + const FCHAR_T *digitp = dp->precision_start + 1; + + precision = 0; + while (digitp != dp->precision_end) + precision = xsum (xtimes (precision, 10), *digitp++ - '0'); + has_precision = 1; + } + } +#endif + + /* Decide whether to handle the precision ourselves. */ +#if NEED_PRINTF_UNBOUNDED_PRECISION + switch (dp->conversion) + { + case 'd': case 'i': case 'u': + case 'o': + case 'x': case 'X': case 'p': + prec_ourselves = has_precision && (precision > 0); + break; + default: + prec_ourselves = 0; + break; + } +#endif + + /* Decide whether to perform the padding ourselves. */ +#if !NEED_PRINTF_FLAG_LEFTADJUST && (!DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION) + switch (dp->conversion) + { +# if !DCHAR_IS_TCHAR || ENABLE_UNISTDIO + /* If we need conversion from TCHAR_T[] to DCHAR_T[], we need + to perform the padding after this conversion. Functions + with unistdio extensions perform the padding based on + character count rather than element count. */ + case 'c': case 's': +# endif +# if NEED_PRINTF_FLAG_ZERO + case 'f': case 'F': case 'e': case 'E': case 'g': case 'G': + case 'a': case 'A': +# endif + pad_ourselves = 1; + break; + default: + pad_ourselves = prec_ourselves; + break; + } +#endif + +#if !USE_SNPRINTF /* Allocate a temporary buffer of sufficient size for calling sprintf. */ { - size_t width; - size_t precision; - - width = 0; - if (dp->width_start != dp->width_end) - { - if (dp->width_arg_index != ARG_NONE) - { - int arg; - - if (!(a.arg[dp->width_arg_index].type == TYPE_INT)) - abort (); - arg = a.arg[dp->width_arg_index].a.a_int; - width = (arg < 0 ? (unsigned int) (-arg) : arg); - } - else - { - const CHAR_T *digitp = dp->width_start; - - do - { - size_t w_tmp = width * 10 + (*digitp++ - '0'); - if (SIZE_MAX / 10 < width || w_tmp < width) - goto out_of_memory; - width = w_tmp; - } - while (digitp != dp->width_end); - } - } - - precision = 6; - if (dp->precision_start != dp->precision_end) - { - if (dp->precision_arg_index != ARG_NONE) - { - int arg; - - if (!(a.arg[dp->precision_arg_index].type == TYPE_INT)) - abort (); - arg = a.arg[dp->precision_arg_index].a.a_int; - precision = (arg < 0 ? 0 : arg); - } - else - { - const CHAR_T *digitp = dp->precision_start + 1; - - precision = 0; - while (digitp != dp->precision_end) - { - size_t p1 = 10 * precision + (*digitp++ - '0'); - precision = ((SIZE_MAX / 10 < precision - || p1 < precision) - ? SIZE_MAX : p1); - } - } - } - switch (dp->conversion) { @@ -356,10 +4469,9 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list ar if (tmp_length < precision) tmp_length = precision; /* Multiply by 2, as an estimate for FLAG_GROUP. */ + tmp_length = xsum (tmp_length, tmp_length); /* Add 1, to account for a leading sign. */ - tmp_length = (tmp_length < SIZE_MAX / 2 - ? 2 * tmp_length + 1 - : SIZE_MAX); + tmp_length = xsum (tmp_length, 1); break; case 'o': @@ -387,7 +4499,7 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list ar if (tmp_length < precision) tmp_length = precision; /* Add 1, to account for a leading sign. */ - tmp_length += (tmp_length < SIZE_MAX); + tmp_length = xsum (tmp_length, 1); break; case 'x': case 'X': @@ -415,13 +4527,10 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list ar if (tmp_length < precision) tmp_length = precision; /* Add 2, to account for a leading sign or alternate form. */ - tmp_length += 2; - if (tmp_length < 2) - goto out_of_memory; + tmp_length = xsum (tmp_length, 2); break; case 'f': case 'F': -# if HAVE_LONG_DOUBLE if (type == TYPE_LONGDOUBLE) tmp_length = (unsigned int) (LDBL_MAX_EXP @@ -431,7 +4540,6 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list ar + 1 /* turn floor into ceil */ + 10; /* sign, decimal point etc. */ else -# endif tmp_length = (unsigned int) (DBL_MAX_EXP * 0.30103 /* binary -> decimal */ @@ -439,21 +4547,16 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list ar ) + 1 /* turn floor into ceil */ + 10; /* sign, decimal point etc. */ - tmp_length += precision; - if (tmp_length < precision) - goto out_of_memory; + tmp_length = xsum (tmp_length, precision); break; case 'e': case 'E': case 'g': case 'G': tmp_length = 12; /* sign, decimal point, exponent etc. */ - tmp_length += precision; - if (tmp_length < precision) - goto out_of_memory; + tmp_length = xsum (tmp_length, precision); break; case 'a': case 'A': -# if HAVE_LONG_DOUBLE if (type == TYPE_LONGDOUBLE) tmp_length = (unsigned int) (LDBL_DIG @@ -461,7 +4564,6 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list ar ) + 1; /* turn floor into ceil */ else -# endif tmp_length = (unsigned int) (DBL_DIG * 0.831 /* decimal -> hexadecimal */ @@ -470,9 +4572,7 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list ar if (tmp_length < precision) tmp_length = precision; /* Account for sign, decimal point etc. */ - tmp_length += 12; - if (tmp_length < 12) - goto out_of_memory; + tmp_length = xsum (tmp_length, 12); break; case 'c': @@ -488,18 +4588,64 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list ar # if HAVE_WCHAR_T if (type == TYPE_WIDE_STRING) { - tmp_length = - local_wcslen (a.arg[dp->arg_index].a.a_wide_string); +# if WIDE_CHAR_VERSION + /* ISO C says about %ls in fwprintf: + "If the precision is not specified or is greater + than the size of the array, the array shall + contain a null wide character." + So if there is a precision, we must not use + wcslen. */ + const wchar_t *arg = + a.arg[dp->arg_index].a.a_wide_string; -# if !WIDE_CHAR_VERSION - if (SIZE_MAX / MB_CUR_MAX < tmp_length) - goto out_of_memory; - tmp_length *= MB_CUR_MAX; + if (has_precision) + tmp_length = local_wcsnlen (arg, precision); + else + tmp_length = local_wcslen (arg); +# else + /* ISO C says about %ls in fprintf: + "If a precision is specified, no more than that + many bytes are written (including shift + sequences, if any), and the array shall contain + a null wide character if, to equal the + multibyte character sequence length given by + the precision, the function would need to + access a wide character one past the end of the + array." + So if there is a precision, we must not use + wcslen. */ + /* This case has already been handled above. */ + abort (); # endif } else # endif - tmp_length = strlen (a.arg[dp->arg_index].a.a_string); + { +# if WIDE_CHAR_VERSION + /* ISO C says about %s in fwprintf: + "If the precision is not specified or is greater + than the size of the converted array, the + converted array shall contain a null wide + character." + So if there is a precision, we must not use + strlen. */ + /* This case has already been handled above. */ + abort (); +# else + /* ISO C says about %s in fprintf: + "If the precision is not specified or greater + than the size of the array, the array shall + contain a null character." + So if there is a precision, we must not use + strlen. */ + const char *arg = a.arg[dp->arg_index].a.a_string; + + if (has_precision) + tmp_length = local_strnlen (arg, precision); + else + tmp_length = strlen (arg); +# endif + } break; case 'p': @@ -515,22 +4661,36 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list ar abort (); } - if (tmp_length < width) - tmp_length = width; + if (!pad_ourselves) + { +# if ENABLE_UNISTDIO + /* Padding considers the number of characters, therefore + the number of elements after padding may be + > max (tmp_length, width) + but is certainly + <= tmp_length + width. */ + tmp_length = xsum (tmp_length, width); +# else + /* Padding considers the number of elements, + says POSIX. */ + if (tmp_length < width) + tmp_length = width; +# endif + } - tmp_length++; /* account for trailing NUL */ - if (!tmp_length) - goto out_of_memory; + tmp_length = xsum (tmp_length, 1); /* account for trailing NUL */ } - if (tmp_length <= sizeof (tmpbuf) / sizeof (CHAR_T)) + if (tmp_length <= sizeof (tmpbuf) / sizeof (TCHAR_T)) tmp = tmpbuf; else { - if (SIZE_MAX / sizeof (CHAR_T) < tmp_length) + size_t tmp_memsize = xtimes (tmp_length, sizeof (TCHAR_T)); + + if (size_overflow_p (tmp_memsize)) /* Overflow, would lead to out of memory. */ goto out_of_memory; - tmp = (CHAR_T *) malloc (tmp_length * sizeof (CHAR_T)); + tmp = (TCHAR_T *) malloc (tmp_memsize); if (tmp == NULL) /* Out of memory. */ goto out_of_memory; @@ -539,31 +4699,67 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list ar /* Construct the format string for calling snprintf or sprintf. */ - p = buf; - *p++ = '%'; - if (dp->flags & FLAG_GROUP) - *p++ = '\''; - if (dp->flags & FLAG_LEFT) - *p++ = '-'; - if (dp->flags & FLAG_SHOWSIGN) - *p++ = '+'; - if (dp->flags & FLAG_SPACE) - *p++ = ' '; - if (dp->flags & FLAG_ALT) - *p++ = '#'; - if (dp->flags & FLAG_ZERO) - *p++ = '0'; - if (dp->width_start != dp->width_end) + fbp = buf; + *fbp++ = '%'; +#if NEED_PRINTF_FLAG_GROUPING + /* The underlying implementation doesn't support the ' flag. + Produce no grouping characters in this case; this is + acceptable because the grouping is locale dependent. */ +#else + if (flags & FLAG_GROUP) + *fbp++ = '\''; +#endif + if (flags & FLAG_LEFT) + *fbp++ = '-'; + if (flags & FLAG_SHOWSIGN) + *fbp++ = '+'; + if (flags & FLAG_SPACE) + *fbp++ = ' '; + if (flags & FLAG_ALT) + *fbp++ = '#'; + if (!pad_ourselves) { - size_t n = dp->width_end - dp->width_start; - memcpy (p, dp->width_start, n * sizeof (CHAR_T)); - p += n; + if (flags & FLAG_ZERO) + *fbp++ = '0'; + if (dp->width_start != dp->width_end) + { + size_t n = dp->width_end - dp->width_start; + /* The width specification is known to consist only + of standard ASCII characters. */ + if (sizeof (FCHAR_T) == sizeof (TCHAR_T)) + { + memcpy (fbp, dp->width_start, n * sizeof (TCHAR_T)); + fbp += n; + } + else + { + const FCHAR_T *mp = dp->width_start; + do + *fbp++ = (unsigned char) *mp++; + while (--n > 0); + } + } } - if (dp->precision_start != dp->precision_end) + if (!prec_ourselves) { - size_t n = dp->precision_end - dp->precision_start; - memcpy (p, dp->precision_start, n * sizeof (CHAR_T)); - p += n; + if (dp->precision_start != dp->precision_end) + { + size_t n = dp->precision_end - dp->precision_start; + /* The precision specification is known to consist only + of standard ASCII characters. */ + if (sizeof (FCHAR_T) == sizeof (TCHAR_T)) + { + memcpy (fbp, dp->precision_start, n * sizeof (TCHAR_T)); + fbp += n; + } + else + { + const FCHAR_T *mp = dp->precision_start; + do + *fbp++ = (unsigned char) *mp++; + while (--n > 0); + } + } } switch (type) @@ -571,8 +4767,15 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list ar #if HAVE_LONG_LONG_INT case TYPE_LONGLONGINT: case TYPE_ULONGLONGINT: - *p++ = 'l'; +# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ + *fbp++ = 'I'; + *fbp++ = '6'; + *fbp++ = '4'; + break; +# else + *fbp++ = 'l'; /*FALLTHROUGH*/ +# endif #endif case TYPE_LONGINT: case TYPE_ULONGINT: @@ -582,34 +4785,64 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list ar #if HAVE_WCHAR_T case TYPE_WIDE_STRING: #endif - *p++ = 'l'; + *fbp++ = 'l'; break; -#if HAVE_LONG_DOUBLE case TYPE_LONGDOUBLE: - *p++ = 'L'; + *fbp++ = 'L'; break; -#endif default: break; } - *p = dp->conversion; +#if NEED_PRINTF_DIRECTIVE_F + if (dp->conversion == 'F') + *fbp = 'f'; + else +#endif + *fbp = dp->conversion; #if USE_SNPRINTF - p[1] = '%'; - p[2] = 'n'; - p[3] = '\0'; +# if !(__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3) || ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)) + fbp[1] = '%'; + fbp[2] = 'n'; + fbp[3] = '\0'; +# else + /* On glibc2 systems from glibc >= 2.3 - probably also older + ones - we know that snprintf's returns value conforms to + ISO C 99: the gl_SNPRINTF_DIRECTIVE_N test passes. + Therefore we can avoid using %n in this situation. + On glibc2 systems from 2004-10-18 or newer, the use of %n + in format strings in writable memory may crash the program + (if compiled with _FORTIFY_SOURCE=2), so we should avoid it + in this situation. */ + /* On native Win32 systems (such as mingw), we can avoid using + %n because: + - Although the gl_SNPRINTF_TRUNCATION_C99 test fails, + snprintf does not write more than the specified number + of bytes. (snprintf (buf, 3, "%d %d", 4567, 89) writes + '4', '5', '6' into buf, not '4', '5', '\0'.) + - Although the gl_SNPRINTF_RETVAL_C99 test fails, snprintf + allows us to recognize the case of an insufficient + buffer size: it returns -1 in this case. + On native Win32 systems (such as mingw) where the OS is + Windows Vista, the use of %n in format strings by default + crashes the program. See + and + + So we should avoid %n in this situation. */ + fbp[1] = '\0'; +# endif #else - p[1] = '\0'; + fbp[1] = '\0'; #endif /* Construct the arguments for calling snprintf or sprintf. */ prefix_count = 0; - if (dp->width_arg_index != ARG_NONE) + if (!pad_ourselves && dp->width_arg_index != ARG_NONE) { if (!(a.arg[dp->width_arg_index].type == TYPE_INT)) abort (); prefixes[prefix_count++] = a.arg[dp->width_arg_index].a.a_int; } - if (dp->precision_arg_index != ARG_NONE) + if (!prec_ourselves && dp->precision_arg_index != ARG_NONE) { if (!(a.arg[dp->precision_arg_index].type == TYPE_INT)) abort (); @@ -617,36 +4850,50 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list ar } #if USE_SNPRINTF + /* The SNPRINTF result is appended after result[0..length]. + The latter is an array of DCHAR_T; SNPRINTF appends an + array of TCHAR_T to it. This is possible because + sizeof (TCHAR_T) divides sizeof (DCHAR_T) and + alignof (TCHAR_T) <= alignof (DCHAR_T). */ +# define TCHARS_PER_DCHAR (sizeof (DCHAR_T) / sizeof (TCHAR_T)) + /* Ensure that maxlen below will be >= 2. Needed on BeOS, + where an snprintf() with maxlen==1 acts like sprintf(). */ + ENSURE_ALLOCATION (xsum (length, + (2 + TCHARS_PER_DCHAR - 1) + / TCHARS_PER_DCHAR)); /* Prepare checking whether snprintf returns the count via %n. */ - ENSURE_ALLOCATION (1); - result[length] = '\0'; + *(TCHAR_T *) (result + length) = '\0'; #endif for (;;) { - size_t maxlen; - int count; - int retcount; - - maxlen = allocated - length; - count = -1; - retcount = 0; + int count = -1; #if USE_SNPRINTF + int retcount = 0; + size_t maxlen = allocated - length; + /* SNPRINTF can fail if its second argument is + > INT_MAX. */ + if (maxlen > INT_MAX / TCHARS_PER_DCHAR) + maxlen = INT_MAX / TCHARS_PER_DCHAR; + maxlen = maxlen * TCHARS_PER_DCHAR; # define SNPRINTF_BUF(arg) \ switch (prefix_count) \ { \ case 0: \ - retcount = SNPRINTF (result + length, maxlen, buf, \ + retcount = SNPRINTF ((TCHAR_T *) (result + length), \ + maxlen, buf, \ arg, &count); \ break; \ case 1: \ - retcount = SNPRINTF (result + length, maxlen, buf, \ + retcount = SNPRINTF ((TCHAR_T *) (result + length), \ + maxlen, buf, \ prefixes[0], arg, &count); \ break; \ case 2: \ - retcount = SNPRINTF (result + length, maxlen, buf, \ + retcount = SNPRINTF ((TCHAR_T *) (result + length), \ + maxlen, buf, \ prefixes[0], prefixes[1], arg, \ &count); \ break; \ @@ -742,14 +4989,12 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list ar SNPRINTF_BUF (arg); } break; -#if HAVE_LONG_DOUBLE case TYPE_LONGDOUBLE: { long double arg = a.arg[dp->arg_index].a.a_longdouble; SNPRINTF_BUF (arg); } break; -#endif case TYPE_CHAR: { int arg = a.arg[dp->arg_index].a.a_char; @@ -797,7 +5042,8 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list ar { /* Verify that snprintf() has NUL-terminated its result. */ - if (count < maxlen && result[length + count] != '\0') + if (count < maxlen + && ((TCHAR_T *) (result + length)) [count] != '\0') abort (); /* Portability hack. */ if (retcount > count) @@ -807,11 +5053,11 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list ar { /* snprintf() doesn't understand the '%n' directive. */ - if (p[1] != '\0') + if (fbp[1] != '\0') { /* Don't use the '%n' directive; instead, look at the snprintf() return value. */ - p[1] = '\0'; + fbp[1] = '\0'; continue; } else @@ -825,7 +5071,7 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list ar that would have been required) when the buffer is too small. */ size_t bigger_need = - (allocated > 12 ? allocated : 12); + xsum (xtimes (allocated, 2), 12); ENSURE_ALLOCATION (bigger_need); continue; } @@ -847,6 +5093,106 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list ar return NULL; } +#if USE_SNPRINTF + /* Handle overflow of the allocated buffer. + If such an overflow occurs, a C99 compliant snprintf() + returns a count >= maxlen. However, a non-compliant + snprintf() function returns only count = maxlen - 1. To + cover both cases, test whether count >= maxlen - 1. */ + if ((unsigned int) count + 1 >= maxlen) + { + /* If maxlen already has attained its allowed maximum, + allocating more memory will not increase maxlen. + Instead of looping, bail out. */ + if (maxlen == INT_MAX / TCHARS_PER_DCHAR) + goto overflow; + else + { + /* Need at least (count + 1) * sizeof (TCHAR_T) + bytes. (The +1 is for the trailing NUL.) + But ask for (count + 2) * sizeof (TCHAR_T) + bytes, so that in the next round, we likely get + maxlen > (unsigned int) count + 1 + and so we don't get here again. + And allocate proportionally, to avoid looping + eternally if snprintf() reports a too small + count. */ + size_t n = + xmax (xsum (length, + ((unsigned int) count + 2 + + TCHARS_PER_DCHAR - 1) + / TCHARS_PER_DCHAR), + xtimes (allocated, 2)); + + ENSURE_ALLOCATION (n); + continue; + } + } +#endif + +#if NEED_PRINTF_UNBOUNDED_PRECISION + if (prec_ourselves) + { + /* Handle the precision. */ + TCHAR_T *prec_ptr = +# if USE_SNPRINTF + (TCHAR_T *) (result + length); +# else + tmp; +# endif + size_t prefix_count; + size_t move; + + prefix_count = 0; + /* Put the additional zeroes after the sign. */ + if (count >= 1 + && (*prec_ptr == '-' || *prec_ptr == '+' + || *prec_ptr == ' ')) + prefix_count = 1; + /* Put the additional zeroes after the 0x prefix if + (flags & FLAG_ALT) || (dp->conversion == 'p'). */ + else if (count >= 2 + && prec_ptr[0] == '0' + && (prec_ptr[1] == 'x' || prec_ptr[1] == 'X')) + prefix_count = 2; + + move = count - prefix_count; + if (precision > move) + { + /* Insert zeroes. */ + size_t insert = precision - move; + TCHAR_T *prec_end; + +# if USE_SNPRINTF + size_t n = + xsum (length, + (count + insert + TCHARS_PER_DCHAR - 1) + / TCHARS_PER_DCHAR); + length += (count + TCHARS_PER_DCHAR - 1) / TCHARS_PER_DCHAR; + ENSURE_ALLOCATION (n); + length -= (count + TCHARS_PER_DCHAR - 1) / TCHARS_PER_DCHAR; + prec_ptr = (TCHAR_T *) (result + length); +# endif + + prec_end = prec_ptr + count; + prec_ptr += prefix_count; + + while (prec_end > prec_ptr) + { + prec_end--; + prec_end[insert] = prec_end[0]; + } + + prec_end += insert; + do + *--prec_end = '0'; + while (prec_end > prec_ptr); + + count += insert; + } + } +#endif + #if !USE_SNPRINTF if (count >= tmp_length) /* tmp_length was incorrectly calculated - fix the @@ -854,28 +5200,228 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list ar abort (); #endif - /* Make room for the result. */ - if (count >= maxlen) +#if !DCHAR_IS_TCHAR + /* Convert from TCHAR_T[] to DCHAR_T[]. */ + if (dp->conversion == 'c' || dp->conversion == 's') { - /* Need at least count bytes. But allocate - proportionally, to avoid looping eternally if - snprintf() reports a too small count. */ - ENSURE_ALLOCATION (count < allocated - ? allocated : count); -#if USE_SNPRINTF - continue; -#endif + /* type = TYPE_CHAR or TYPE_WIDE_CHAR or TYPE_STRING + TYPE_WIDE_STRING. + The result string is not certainly ASCII. */ + const TCHAR_T *tmpsrc; + DCHAR_T *tmpdst; + size_t tmpdst_len; + /* This code assumes that TCHAR_T is 'char'. */ + typedef int TCHAR_T_verify + [2 * (sizeof (TCHAR_T) == 1) - 1]; +# if USE_SNPRINTF + tmpsrc = (TCHAR_T *) (result + length); +# else + tmpsrc = tmp; +# endif + tmpdst = + DCHAR_CONV_FROM_ENCODING (locale_charset (), + iconveh_question_mark, + tmpsrc, count, + NULL, + NULL, &tmpdst_len); + if (tmpdst == NULL) + { + int saved_errno = errno; + if (!(result == resultbuf || result == NULL)) + free (result); + if (buf_malloced != NULL) + free (buf_malloced); + CLEANUP (); + errno = saved_errno; + return NULL; + } + ENSURE_ALLOCATION (xsum (length, tmpdst_len)); + DCHAR_CPY (result + length, tmpdst, tmpdst_len); + free (tmpdst); + count = tmpdst_len; } + else + { + /* The result string is ASCII. + Simple 1:1 conversion. */ +# if USE_SNPRINTF + /* If sizeof (DCHAR_T) == sizeof (TCHAR_T), it's a + no-op conversion, in-place on the array starting + at (result + length). */ + if (sizeof (DCHAR_T) != sizeof (TCHAR_T)) +# endif + { + const TCHAR_T *tmpsrc; + DCHAR_T *tmpdst; + size_t n; -#if USE_SNPRINTF +# if USE_SNPRINTF + if (result == resultbuf) + { + tmpsrc = (TCHAR_T *) (result + length); + /* ENSURE_ALLOCATION will not move tmpsrc + (because it's part of resultbuf). */ + ENSURE_ALLOCATION (xsum (length, count)); + } + else + { + /* ENSURE_ALLOCATION will move the array + (because it uses realloc(). */ + ENSURE_ALLOCATION (xsum (length, count)); + tmpsrc = (TCHAR_T *) (result + length); + } +# else + tmpsrc = tmp; + ENSURE_ALLOCATION (xsum (length, count)); +# endif + tmpdst = result + length; + /* Copy backwards, because of overlapping. */ + tmpsrc += count; + tmpdst += count; + for (n = count; n > 0; n--) + *--tmpdst = (unsigned char) *--tmpsrc; + } + } +#endif + +#if DCHAR_IS_TCHAR && !USE_SNPRINTF + /* Make room for the result. */ + if (count > allocated - length) + { + /* Need at least count elements. But allocate + proportionally. */ + size_t n = + xmax (xsum (length, count), xtimes (allocated, 2)); + + ENSURE_ALLOCATION (n); + } +#endif + + /* Here count <= allocated - length. */ + + /* Perform padding. */ +#if !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION + if (pad_ourselves && has_width) + { + size_t w; +# if ENABLE_UNISTDIO + /* Outside POSIX, it's preferrable to compare the width + against the number of _characters_ of the converted + value. */ + w = DCHAR_MBSNLEN (result + length, count); +# else + /* The width is compared against the number of _bytes_ + of the converted value, says POSIX. */ + w = count; +# endif + if (w < width) + { + size_t pad = width - w; + + /* Make room for the result. */ + if (xsum (count, pad) > allocated - length) + { + /* Need at least count + pad elements. But + allocate proportionally. */ + size_t n = + xmax (xsum3 (length, count, pad), + xtimes (allocated, 2)); + +# if USE_SNPRINTF + length += count; + ENSURE_ALLOCATION (n); + length -= count; +# else + ENSURE_ALLOCATION (n); +# endif + } + /* Here count + pad <= allocated - length. */ + + { +# if !DCHAR_IS_TCHAR || USE_SNPRINTF + DCHAR_T * const rp = result + length; +# else + DCHAR_T * const rp = tmp; +# endif + DCHAR_T *p = rp + count; + DCHAR_T *end = p + pad; + DCHAR_T *pad_ptr; +# if !DCHAR_IS_TCHAR || ENABLE_UNISTDIO + if (dp->conversion == 'c' + || dp->conversion == 's') + /* No zero-padding for string directives. */ + pad_ptr = NULL; + else +# endif + { + pad_ptr = (*rp == '-' ? rp + 1 : rp); + /* No zero-padding of "inf" and "nan". */ + if ((*pad_ptr >= 'A' && *pad_ptr <= 'Z') + || (*pad_ptr >= 'a' && *pad_ptr <= 'z')) + pad_ptr = NULL; + } + /* The generated string now extends from rp to p, + with the zero padding insertion point being at + pad_ptr. */ + + count = count + pad; /* = end - rp */ + + if (flags & FLAG_LEFT) + { + /* Pad with spaces on the right. */ + for (; pad > 0; pad--) + *p++ = ' '; + } + else if ((flags & FLAG_ZERO) && pad_ptr != NULL) + { + /* Pad with zeroes. */ + DCHAR_T *q = end; + + while (p > pad_ptr) + *--q = *--p; + for (; pad > 0; pad--) + *p++ = '0'; + } + else + { + /* Pad with spaces on the left. */ + DCHAR_T *q = end; + + while (p > rp) + *--q = *--p; + for (; pad > 0; pad--) + *p++ = ' '; + } + } + } + } +#endif + + /* Here still count <= allocated - length. */ + +#if !DCHAR_IS_TCHAR || USE_SNPRINTF /* The snprintf() result did fit. */ #else /* Append the sprintf() result. */ - memcpy (result + length, tmp, count * sizeof (CHAR_T)); + memcpy (result + length, tmp, count * sizeof (DCHAR_T)); +#endif +#if !USE_SNPRINTF if (tmp != tmpbuf) free (tmp); #endif +#if NEED_PRINTF_DIRECTIVE_F + if (dp->conversion == 'F') + { + /* Convert the %f result to upper case for %F. */ + DCHAR_T *rp = result + length; + size_t rc; + for (rc = count; rc > 0; rc--, rp++) + if (*rp >= 'a' && *rp <= 'z') + *rp = *rp - 'a' + 'A'; + } +#endif + length += count; break; } @@ -884,15 +5430,15 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list ar } /* Add the final NUL. */ - ENSURE_ALLOCATION (1); + ENSURE_ALLOCATION (xsum (length, 1)); result[length] = '\0'; if (result != resultbuf && length + 1 < allocated) { /* Shrink the allocated memory if possible. */ - CHAR_T *memory; + DCHAR_T *memory; - memory = (CHAR_T *) realloc (result, (length + 1) * sizeof (CHAR_T)); + memory = (DCHAR_T *) realloc (result, (length + 1) * sizeof (DCHAR_T)); if (memory != NULL) result = memory; } @@ -901,18 +5447,22 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list ar free (buf_malloced); CLEANUP (); *lengthp = length; - if (length > INT_MAX) - goto length_overflow; + /* Note that we can produce a big string of a length > INT_MAX. POSIX + says that snprintf() fails with errno = EOVERFLOW in this case, but + that's only because snprintf() returns an 'int'. This function does + not have this limitation. */ return result; - length_overflow: - /* We could produce such a big string, but its length doesn't fit into - an 'int'. POSIX says that snprintf() fails with errno = EOVERFLOW in - this case. */ - if (result != resultbuf) +#if USE_SNPRINTF + overflow: + if (!(result == resultbuf || result == NULL)) free (result); + if (buf_malloced != NULL) + free (buf_malloced); + CLEANUP (); errno = EOVERFLOW; return NULL; +#endif out_of_memory: if (!(result == resultbuf || result == NULL)) @@ -926,10 +5476,15 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list ar } } +#undef TCHARS_PER_DCHAR #undef SNPRINTF #undef USE_SNPRINTF +#undef DCHAR_CPY #undef PRINTF_PARSE #undef DIRECTIVES #undef DIRECTIVE -#undef CHAR_T +#undef DCHAR_IS_TCHAR +#undef TCHAR_T +#undef DCHAR_T +#undef FCHAR_T #undef VASNPRINTF diff --git a/src/bin/coreutils/lib/vasnprintf.h b/src/bin/coreutils/lib/vasnprintf.h index 7a0c01f4bf..d3e86d9121 100644 --- a/src/bin/coreutils/lib/vasnprintf.h +++ b/src/bin/coreutils/lib/vasnprintf.h @@ -1,9 +1,12 @@ +/* -*- buffer-read-only: t -*- vi: set ro: */ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 /* vsprintf with automatic memory allocation. - Copyright (C) 2002-2004, 2007 Free Software Foundation, Inc. + Copyright (C) 2002-2004, 2007-2008 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) + the Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -26,7 +29,7 @@ #ifndef __attribute__ /* This feature is available in gcc versions 2.5 and later. */ -# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__ +# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) # define __attribute__(Spec) /* empty */ # endif /* The __-protected variants of `format' and `printf' attributes diff --git a/src/bin/coreutils/lib/vasprintf.c b/src/bin/coreutils/lib/vasprintf.c index 824707345a..292ec538f1 100644 --- a/src/bin/coreutils/lib/vasprintf.c +++ b/src/bin/coreutils/lib/vasprintf.c @@ -1,9 +1,12 @@ +/* -*- buffer-read-only: t -*- vi: set ro: */ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 /* Formatted output to strings. - Copyright (C) 1999, 2002, 2006 Free Software Foundation, Inc. + Copyright (C) 1999, 2002, 2006-2008 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) + the Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -18,7 +21,11 @@ #include /* Specification. */ -#include "vasprintf.h" +#ifdef IN_LIBASPRINTF +# include "vasprintf.h" +#else +# include +#endif #include #include @@ -26,11 +33,6 @@ #include "vasnprintf.h" -/* Some systems, like OSF/1 4.0 and Woe32, don't have EOVERFLOW. */ -#ifndef EOVERFLOW -# define EOVERFLOW E2BIG -#endif - int vasprintf (char **resultp, const char *format, va_list args) { diff --git a/src/bin/coreutils/lib/vasprintf.h b/src/bin/coreutils/lib/vasprintf.h deleted file mode 100644 index 65f05315fe..0000000000 --- a/src/bin/coreutils/lib/vasprintf.h +++ /dev/null @@ -1,69 +0,0 @@ -/* vsprintf with automatic memory allocation. - Copyright (C) 2002-2003, 2007 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ - -#ifndef _VASPRINTF_H -#define _VASPRINTF_H - -#if HAVE_VASPRINTF - -/* Get asprintf(), vasprintf() declarations. */ -#include - -#endif - -#if !HAVE_VASPRINTF || REPLACE_VASPRINTF - -/* Get va_list. */ -#include - -#ifndef __attribute__ -/* This feature is available in gcc versions 2.5 and later. */ -# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__ -# define __attribute__(Spec) /* empty */ -# endif -/* The __-protected variants of `format' and `printf' attributes - are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */ -# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) -# define __format__ format -# define __printf__ printf -# endif -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/* Write formatted output to a string dynamically allocated with malloc(). - If the memory allocation succeeds, store the address of the string in - *RESULT and return the number of resulting bytes, excluding the trailing - NUL. Upon memory allocation error, or some other error, return -1. */ -#if REPLACE_VASPRINTF -# define asprintf rpl_asprintf -# define vasprintf rpl_vasprintf -#endif -extern int asprintf (char **result, const char *format, ...) - __attribute__ ((__format__ (__printf__, 2, 3))); -extern int vasprintf (char **result, const char *format, va_list args) - __attribute__ ((__format__ (__printf__, 2, 0))); - -#ifdef __cplusplus -} -#endif - -#endif - -#endif /* _VASPRINTF_H */ diff --git a/src/bin/coreutils/lib/verify.h b/src/bin/coreutils/lib/verify.h index d603b17379..fac53f6fc4 100644 --- a/src/bin/coreutils/lib/verify.h +++ b/src/bin/coreutils/lib/verify.h @@ -2,10 +2,10 @@ Copyright (C) 2005, 2006 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Paul Eggert, Bruno Haible, and Jim Meyering. */ diff --git a/src/bin/coreutils/lib/verror.c b/src/bin/coreutils/lib/verror.c new file mode 100644 index 0000000000..0a7981ea27 --- /dev/null +++ b/src/bin/coreutils/lib/verror.c @@ -0,0 +1,77 @@ +/* va_list error handler for noninteractive utilities + Copyright (C) 2006-2007 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* Written by Eric Blake. */ + +#include + +#include "verror.h" +#include "xvasprintf.h" + +#include +#include +#include + +#if ENABLE_NLS +# include "gettext.h" +# define _(msgid) gettext (msgid) +#endif + +#ifndef _ +# define _(String) String +#endif + +/* Print a message with `vfprintf (stderr, FORMAT, ARGS)'; + if ERRNUM is nonzero, follow it with ": " and strerror (ERRNUM). + If STATUS is nonzero, terminate the program with `exit (STATUS)'. + Use the globals error_print_progname and error_message_count similarly + to error(). */ +void +verror (int status, int errnum, const char *format, va_list args) +{ + verror_at_line (status, errnum, NULL, 0, format, args); +} + +/* Print a message with `vfprintf (stderr, FORMAT, ARGS)'; + if ERRNUM is nonzero, follow it with ": " and strerror (ERRNUM). + If STATUS is nonzero, terminate the program with `exit (STATUS)'. + If FNAME is not NULL, prepend the message with `FNAME:LINENO:'. + Use the globals error_print_progname, error_message_count, and + error_one_per_line similarly to error_at_line(). */ +void +verror_at_line (int status, int errnum, const char *file, + unsigned int line_number, const char *format, va_list args) +{ + char *message = xvasprintf (format, args); + if (message) + { + /* Until http://sourceware.org/bugzilla/show_bug.cgi?id=2997 is fixed, + glibc violates GNU Coding Standards when the file argument to + error_at_line is NULL. */ + if (file) + error_at_line (status, errnum, file, line_number, "%s", message); + else + error (status, errnum, "%s", message); + } + else + { + /* EOVERFLOW, EINVAL, and EILSEQ from xvasprintf are signs of + serious programmer errors. */ + error (0, errno, _("unable to display error message")); + abort (); + } + free (message); +} diff --git a/src/bin/coreutils/lib/verror.h b/src/bin/coreutils/lib/verror.h new file mode 100644 index 0000000000..4d3b7ce657 --- /dev/null +++ b/src/bin/coreutils/lib/verror.h @@ -0,0 +1,53 @@ +/* Declaration for va_list error-reporting function + Copyright (C) 2006-2007 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#ifndef _VERROR_H +#define _VERROR_H 1 + +#include "error.h" +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Print a message with `vfprintf (stderr, FORMAT, ARGS)'; + if ERRNUM is nonzero, follow it with ": " and strerror (ERRNUM). + If STATUS is nonzero, terminate the program with `exit (STATUS)'. + Use the globals error_print_progname and error_message_count similarly + to error(). */ + +extern void verror (int __status, int __errnum, const char *__format, + va_list __args) + __attribute__ ((__format__ (__printf__, 3, 0))); + +/* Print a message with `vfprintf (stderr, FORMAT, ARGS)'; + if ERRNUM is nonzero, follow it with ": " and strerror (ERRNUM). + If STATUS is nonzero, terminate the program with `exit (STATUS)'. + If FNAME is not NULL, prepend the message with `FNAME:LINENO:'. + Use the globals error_print_progname, error_message_count, and + error_one_per_line similarly to error_at_line(). */ + +extern void verror_at_line (int __status, int __errnum, const char *__fname, + unsigned int __lineno, const char *__format, + va_list __args) + __attribute__ ((__format__ (__printf__, 5, 0))); + +#ifdef __cplusplus +} +#endif + +#endif /* verror.h */ diff --git a/src/bin/coreutils/lib/version-etc-fsf.c b/src/bin/coreutils/lib/version-etc-fsf.c index f25eb653ea..4c0d174d63 100644 --- a/src/bin/coreutils/lib/version-etc-fsf.c +++ b/src/bin/coreutils/lib/version-etc-fsf.c @@ -1,10 +1,10 @@ /* Variable with FSF copyright information, for version-etc. Copyright (C) 1999-2006 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Jim Meyering. */ diff --git a/src/bin/coreutils/lib/version-etc.c b/src/bin/coreutils/lib/version-etc.c index 65997d9188..2258c2e21d 100644 --- a/src/bin/coreutils/lib/version-etc.c +++ b/src/bin/coreutils/lib/version-etc.c @@ -1,10 +1,10 @@ -/* Utility to help print --version output in a consistent format. - Copyright (C) 1999-2007 Free Software Foundation, Inc. +/* Print --version and bug-reporting information in a consistent format. + Copyright (C) 1999-2009 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Jim Meyering. */ @@ -33,7 +32,7 @@ #include "gettext.h" #define _(msgid) gettext (msgid) -enum { COPYRIGHT_YEAR = 2007 }; +enum { COPYRIGHT_YEAR = 2009 }; /* Like version_etc, below, but with the NULL-terminated author list provided via a variable of type va_list. */ @@ -67,8 +66,8 @@ version_etc_va (FILE *stream, fputs (_("\ \n\ -This is free software. You may redistribute copies of it under the terms of\n\ -the GNU General Public License .\n\ +License GPLv3+: GNU GPL version 3 or later .\n\ +This is free software: you are free to change and redistribute it.\n\ There is NO WARRANTY, to the extent permitted by law.\n\ \n\ "), @@ -171,3 +170,17 @@ version_etc (FILE *stream, va_start (authors, version); version_etc_va (stream, command_name, package, version, authors); } + +void +emit_bug_reporting_address (void) +{ + /* TRANSLATORS: The placeholder indicates the bug-reporting address + for this package. Please add _another line_ saying + "Report translation bugs to <...>\n" with the address for translation + bugs (typically your translation team's web or email address). */ + printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT); + printf (_("%s home page: .\n"), + PACKAGE_NAME, PACKAGE); + fputs (_("General help using GNU software: .\n"), + stdout); +} diff --git a/src/bin/coreutils/lib/version-etc.h b/src/bin/coreutils/lib/version-etc.h index 84da535001..33a8e7f143 100644 --- a/src/bin/coreutils/lib/version-etc.h +++ b/src/bin/coreutils/lib/version-etc.h @@ -1,10 +1,10 @@ -/* Utility to help print --version output in a consistent format. - Copyright (C) 1999, 2003, 2005 Free Software Foundation, Inc. +/* Print --version and bug-reporting information in a consistent format. + Copyright (C) 1999, 2003, 2005, 2009 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Jim Meyering. */ @@ -32,6 +31,8 @@ extern void version_etc_va (FILE *stream, extern void version_etc (FILE *stream, const char *command_name, const char *package, const char *version, - /* const char *author1, ...*/ ...); + /* const char *author1, ...*/ ...); + +extern void emit_bug_reporting_address (void); #endif /* VERSION_ETC_H */ diff --git a/src/bin/coreutils/lib/version.c b/src/bin/coreutils/lib/version.c new file mode 100644 index 0000000000..23b9964587 --- /dev/null +++ b/src/bin/coreutils/lib/version.c @@ -0,0 +1,2 @@ +#include +char const *Version = "7.4"; diff --git a/src/bin/coreutils/lib/version.h b/src/bin/coreutils/lib/version.h new file mode 100644 index 0000000000..f6a1ed330e --- /dev/null +++ b/src/bin/coreutils/lib/version.h @@ -0,0 +1 @@ +extern char const *Version; diff --git a/src/bin/coreutils/lib/vfprintf.c b/src/bin/coreutils/lib/vfprintf.c new file mode 100644 index 0000000000..225466a458 --- /dev/null +++ b/src/bin/coreutils/lib/vfprintf.c @@ -0,0 +1,74 @@ +/* -*- buffer-read-only: t -*- vi: set ro: */ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 +/* Formatted output to a stream. + Copyright (C) 2004, 2006-2008 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#if 1 +# include +#endif + +/* Specification. */ +#include + +#include +#include +#include +#include + +#include "fseterr.h" +#include "vasnprintf.h" + +/* Print formatted output to the stream FP. + Return string length of formatted string. On error, return a negative + value. */ +int +vfprintf (FILE *fp, const char *format, va_list args) +{ + char buf[2000]; + char *output; + size_t len; + size_t lenbuf = sizeof (buf); + + output = vasnprintf (buf, &lenbuf, format, args); + len = lenbuf; + + if (!output) + { + fseterr (fp); + return -1; + } + + if (fwrite (output, 1, len, fp) < len) + { + if (output != buf) + { + int saved_errno = errno; + free (output); + errno = saved_errno; + } + return -1; + } + + if (len > INT_MAX) + { + errno = EOVERFLOW; + fseterr (fp); + return -1; + } + + return len; +} diff --git a/src/bin/coreutils/lib/vprintf.c b/src/bin/coreutils/lib/vprintf.c new file mode 100644 index 0000000000..ab57d9b550 --- /dev/null +++ b/src/bin/coreutils/lib/vprintf.c @@ -0,0 +1,36 @@ +/* -*- buffer-read-only: t -*- vi: set ro: */ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 +/* Formatted output to a stream. + Copyright (C) 2007 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#if 1 +# include +#endif + +/* Specification. */ +#include + +#include + +/* Print formatted output to standard output. + Return string length of formatted string. On error, return a negative + value. */ +int +vprintf (const char *format, va_list args) +{ + return vfprintf (stdout, format, args); +} diff --git a/src/bin/coreutils/lib/wchar.in.h b/src/bin/coreutils/lib/wchar.in.h new file mode 100644 index 0000000000..6c812bebfb --- /dev/null +++ b/src/bin/coreutils/lib/wchar.in.h @@ -0,0 +1,313 @@ +/* -*- buffer-read-only: t -*- vi: set ro: */ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 +/* A substitute for ISO C99 , for platforms that have issues. + + Copyright (C) 2007-2009 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + +/* Written by Eric Blake. */ + +/* + * ISO C 99 for platforms that have issues. + * + * + * For now, this just ensures proper prerequisite inclusion order and + * the declaration of wcwidth(). + */ + +#if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +#endif + +#if defined __need_mbstate_t || (defined __hpux && ((defined _INTTYPES_INCLUDED && !defined strtoimax) || defined _GL_JUST_INCLUDE_SYSTEM_WCHAR_H)) || defined _GL_ALREADY_INCLUDING_WCHAR_H +/* Special invocation convention: + - Inside uClibc header files. + - On HP-UX 11.00 we have a sequence of nested includes + -> -> , and the latter includes , + once indirectly -> -> -> + and once directly. In both situations 'wint_t' is not yet defined, + therefore we cannot provide the function overrides; instead include only + the system's . + - On IRIX 6.5, similarly, we have an include -> , and + the latter includes . But here, we have no way to detect whether + is completely included or is still being included. */ + +#@INCLUDE_NEXT@ @NEXT_WCHAR_H@ + +#else +/* Normal invocation convention. */ + +#ifndef _GL_WCHAR_H + +#define _GL_ALREADY_INCLUDING_WCHAR_H + +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include + +/* Include the original if it exists. + Some builds of uClibc lack it. */ +/* The include_next requires a split double-inclusion guard. */ +#if @HAVE_WCHAR_H@ +# @INCLUDE_NEXT@ @NEXT_WCHAR_H@ +#endif + +#undef _GL_ALREADY_INCLUDING_WCHAR_H + +#ifndef _GL_WCHAR_H +#define _GL_WCHAR_H + +/* The definition of GL_LINK_WARNING is copied here. */ + +#ifdef __cplusplus +extern "C" { +#endif + + +/* Define wint_t. (Also done in wctype.in.h.) */ +#if !@HAVE_WINT_T@ && !defined wint_t +# define wint_t int +# ifndef WEOF +# define WEOF -1 +# endif +#endif + + +/* Override mbstate_t if it is too small. + On IRIX 6.5, sizeof (mbstate_t) == 1, which is not sufficient for + implementing mbrtowc for encodings like UTF-8. */ +#if !(@HAVE_MBSINIT@ && @HAVE_MBRTOWC@) || @REPLACE_MBSTATE_T@ +typedef int rpl_mbstate_t; +# undef mbstate_t +# define mbstate_t rpl_mbstate_t +# define GNULIB_defined_mbstate_t 1 +#endif + + +/* Convert a single-byte character to a wide character. */ +#if @GNULIB_BTOWC@ +# if @REPLACE_BTOWC@ +# undef btowc +# define btowc rpl_btowc +# endif +# if !@HAVE_BTOWC@ || @REPLACE_BTOWC@ +extern wint_t btowc (int c); +# endif +#elif defined GNULIB_POSIXCHECK +# undef btowc +# define btowc(c) \ + (GL_LINK_WARNING ("btowc is unportable - " \ + "use gnulib module btowc for portability"), \ + btowc (c)) +#endif + + +/* Convert a wide character to a single-byte character. */ +#if @GNULIB_WCTOB@ +# if @REPLACE_WCTOB@ +# undef wctob +# define wctob rpl_wctob +# endif +# if (!defined wctob && !@HAVE_DECL_WCTOB@) || @REPLACE_WCTOB@ +/* wctob is provided by gnulib, or wctob exists but is not declared. */ +extern int wctob (wint_t wc); +# endif +#elif defined GNULIB_POSIXCHECK +# undef wctob +# define wctob(w) \ + (GL_LINK_WARNING ("wctob is unportable - " \ + "use gnulib module wctob for portability"), \ + wctob (w)) +#endif + + +/* Test whether *PS is in the initial state. */ +#if @GNULIB_MBSINIT@ +# if @REPLACE_MBSINIT@ +# undef mbsinit +# define mbsinit rpl_mbsinit +# endif +# if !@HAVE_MBSINIT@ || @REPLACE_MBSINIT@ +extern int mbsinit (const mbstate_t *ps); +# endif +#elif defined GNULIB_POSIXCHECK +# undef mbsinit +# define mbsinit(p) \ + (GL_LINK_WARNING ("mbsinit is unportable - " \ + "use gnulib module mbsinit for portability"), \ + mbsinit (p)) +#endif + + +/* Convert a multibyte character to a wide character. */ +#if @GNULIB_MBRTOWC@ +# if @REPLACE_MBRTOWC@ +# undef mbrtowc +# define mbrtowc rpl_mbrtowc +# endif +# if !@HAVE_MBRTOWC@ || @REPLACE_MBRTOWC@ +extern size_t mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps); +# endif +#elif defined GNULIB_POSIXCHECK +# undef mbrtowc +# define mbrtowc(w,s,n,p) \ + (GL_LINK_WARNING ("mbrtowc is unportable - " \ + "use gnulib module mbrtowc for portability"), \ + mbrtowc (w, s, n, p)) +#endif + + +/* Recognize a multibyte character. */ +#if @GNULIB_MBRLEN@ +# if @REPLACE_MBRLEN@ +# undef mbrlen +# define mbrlen rpl_mbrlen +# endif +# if !@HAVE_MBRLEN@ || @REPLACE_MBRLEN@ +extern size_t mbrlen (const char *s, size_t n, mbstate_t *ps); +# endif +#elif defined GNULIB_POSIXCHECK +# undef mbrlen +# define mbrlen(s,n,p) \ + (GL_LINK_WARNING ("mbrlen is unportable - " \ + "use gnulib module mbrlen for portability"), \ + mbrlen (s, n, p)) +#endif + + +/* Convert a string to a wide string. */ +#if @GNULIB_MBSRTOWCS@ +# if @REPLACE_MBSRTOWCS@ +# undef mbsrtowcs +# define mbsrtowcs rpl_mbsrtowcs +# endif +# if !@HAVE_MBSRTOWCS@ || @REPLACE_MBSRTOWCS@ +extern size_t mbsrtowcs (wchar_t *dest, const char **srcp, size_t len, mbstate_t *ps); +# endif +#elif defined GNULIB_POSIXCHECK +# undef mbsrtowcs +# define mbsrtowcs(d,s,l,p) \ + (GL_LINK_WARNING ("mbsrtowcs is unportable - " \ + "use gnulib module mbsrtowcs for portability"), \ + mbsrtowcs (d, s, l, p)) +#endif + + +/* Convert a string to a wide string. */ +#if @GNULIB_MBSNRTOWCS@ +# if @REPLACE_MBSNRTOWCS@ +# undef mbsnrtowcs +# define mbsnrtowcs rpl_mbsnrtowcs +# endif +# if !@HAVE_MBSNRTOWCS@ || @REPLACE_MBSNRTOWCS@ +extern size_t mbsnrtowcs (wchar_t *dest, const char **srcp, size_t srclen, size_t len, mbstate_t *ps); +# endif +#elif defined GNULIB_POSIXCHECK +# undef mbsnrtowcs +# define mbsnrtowcs(d,s,n,l,p) \ + (GL_LINK_WARNING ("mbsnrtowcs is unportable - " \ + "use gnulib module mbsnrtowcs for portability"), \ + mbsnrtowcs (d, s, n, l, p)) +#endif + + +/* Convert a wide character to a multibyte character. */ +#if @GNULIB_WCRTOMB@ +# if @REPLACE_WCRTOMB@ +# undef wcrtomb +# define wcrtomb rpl_wcrtomb +# endif +# if !@HAVE_WCRTOMB@ || @REPLACE_WCRTOMB@ +extern size_t wcrtomb (char *s, wchar_t wc, mbstate_t *ps); +# endif +#elif defined GNULIB_POSIXCHECK +# undef wcrtomb +# define wcrtomb(s,w,p) \ + (GL_LINK_WARNING ("wcrtomb is unportable - " \ + "use gnulib module wcrtomb for portability"), \ + wcrtomb (s, w, p)) +#endif + + +/* Convert a wide string to a string. */ +#if @GNULIB_WCSRTOMBS@ +# if @REPLACE_WCSRTOMBS@ +# undef wcsrtombs +# define wcsrtombs rpl_wcsrtombs +# endif +# if !@HAVE_WCSRTOMBS@ || @REPLACE_WCSRTOMBS@ +extern size_t wcsrtombs (char *dest, const wchar_t **srcp, size_t len, mbstate_t *ps); +# endif +#elif defined GNULIB_POSIXCHECK +# undef wcsrtombs +# define wcsrtombs(d,s,l,p) \ + (GL_LINK_WARNING ("wcsrtombs is unportable - " \ + "use gnulib module wcsrtombs for portability"), \ + wcsrtombs (d, s, l, p)) +#endif + + +/* Convert a wide string to a string. */ +#if @GNULIB_WCSNRTOMBS@ +# if @REPLACE_WCSNRTOMBS@ +# undef wcsnrtombs +# define wcsnrtombs rpl_wcsnrtombs +# endif +# if !@HAVE_WCSNRTOMBS@ || @REPLACE_WCSNRTOMBS@ +extern size_t wcsnrtombs (char *dest, const wchar_t **srcp, size_t srclen, size_t len, mbstate_t *ps); +# endif +#elif defined GNULIB_POSIXCHECK +# undef wcsnrtombs +# define wcsnrtombs(d,s,n,l,p) \ + (GL_LINK_WARNING ("wcsnrtombs is unportable - " \ + "use gnulib module wcsnrtombs for portability"), \ + wcsnrtombs (d, s, n, l, p)) +#endif + + +/* Return the number of screen columns needed for WC. */ +#if @GNULIB_WCWIDTH@ +# if @REPLACE_WCWIDTH@ +# undef wcwidth +# define wcwidth rpl_wcwidth +extern int wcwidth (wchar_t); +# else +# if !defined wcwidth && !@HAVE_DECL_WCWIDTH@ +/* wcwidth exists but is not declared. */ +extern int wcwidth (int /* actually wchar_t */); +# endif +# endif +#elif defined GNULIB_POSIXCHECK +# undef wcwidth +# define wcwidth(w) \ + (GL_LINK_WARNING ("wcwidth is unportable - " \ + "use gnulib module wcwidth for portability"), \ + wcwidth (w)) +#endif + + +#ifdef __cplusplus +} +#endif + +#endif /* _GL_WCHAR_H */ +#endif /* _GL_WCHAR_H */ +#endif diff --git a/src/bin/coreutils/lib/wchar_.h b/src/bin/coreutils/lib/wchar_.h deleted file mode 100644 index 6813a2116d..0000000000 --- a/src/bin/coreutils/lib/wchar_.h +++ /dev/null @@ -1,42 +0,0 @@ -/* A substitute for ISO C99 , for platforms that have issues. - - Copyright (C) 2007 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ - -/* Written by Eric Blake. */ - -/* - * ISO C 99 for platforms that have issues. - * - * - * For now, this just ensures proper prerequisite inclusion order. - */ - -#ifndef _GL_WCHAR_H -#define _GL_WCHAR_H - -/* Tru64 with Desktop Toolkit C has a bug: must be included before - . - BSD/OS 4.0.1 has a bug: , and must be - included before . */ -#include -#include -#include - -/* Include the original . */ -#include @ABSOLUTE_WCHAR_H@ - -#endif /* _GL_WCHAR_H */ diff --git a/src/bin/coreutils/lib/wcrtomb.c b/src/bin/coreutils/lib/wcrtomb.c new file mode 100644 index 0000000000..79df99f235 --- /dev/null +++ b/src/bin/coreutils/lib/wcrtomb.c @@ -0,0 +1,53 @@ +/* Convert wide character to multibyte character. + Copyright (C) 2008 Free Software Foundation, Inc. + Written by Bruno Haible , 2008. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#include + +/* Specification. */ +#include + +#include +#include + + +size_t +wcrtomb (char *s, wchar_t wc, mbstate_t *ps) +{ + /* This implementation of wcrtomb on top of wctomb() supports only + stateless encodings. ps must be in the initial state. */ + if (ps != NULL && !mbsinit (ps)) + { + errno = EINVAL; + return (size_t)(-1); + } + + if (s == NULL) + /* We know the NUL wide character corresponds to the NUL character. */ + return 1; + else + { + int ret = wctomb (s, wc); + + if (ret >= 0) + return ret; + else + { + errno = EILSEQ; + return (size_t)(-1); + } + } +} diff --git a/src/bin/coreutils/lib/wctype_.h b/src/bin/coreutils/lib/wctype.in.h similarity index 69% rename from src/bin/coreutils/lib/wctype_.h rename to src/bin/coreutils/lib/wctype.in.h index 1297c61e62..a9c4491f88 100644 --- a/src/bin/coreutils/lib/wctype_.h +++ b/src/bin/coreutils/lib/wctype.in.h @@ -1,10 +1,13 @@ +/* -*- buffer-read-only: t -*- vi: set ro: */ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 /* A substitute for ISO C99 , for platforms that lack it. - Copyright (C) 2006, 2007 Free Software Foundation, Inc. + Copyright (C) 2006-2008 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) + the Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -27,7 +30,10 @@ */ #ifndef _GL_WCTYPE_H -#define _GL_WCTYPE_H + +#if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +#endif #if @HAVE_WINT_T@ /* Solaris 2.5 has a bug: must be included before . @@ -39,20 +45,30 @@ # include # include # include -typedef wint_t __wctype_wint_t; -#else -typedef int __wctype_wint_t; #endif /* Include the original if it exists. BeOS 5 has the functions but no . */ +/* The include_next requires a split double-inclusion guard. */ #if @HAVE_WCTYPE_H@ -# include @ABSOLUTE_WCTYPE_H@ +# @INCLUDE_NEXT@ @NEXT_WCTYPE_H@ +#endif + +#ifndef _GL_WCTYPE_H +#define _GL_WCTYPE_H + +/* Define wint_t. (Also done in wchar.in.h.) */ +#if !@HAVE_WINT_T@ && !defined wint_t +# define wint_t int +# ifndef WEOF +# define WEOF -1 +# endif #endif /* FreeBSD 4.4 to 4.11 has but lacks the functions. + Linux libc5 has and the functions but they are broken. Assume all 12 functions are implemented the same way, or not at all. */ -#if ! HAVE_ISWCNTRL +#if ! @HAVE_ISWCNTRL@ || @REPLACE_ISWCNTRL@ /* IRIX 5.3 has macros but no functions, its isw* macros refer to an undefined variable _ctmp_ and to macros like _P, and they @@ -72,57 +88,73 @@ typedef int __wctype_wint_t; # undef iswupper # undef iswxdigit +/* Linux libc5 has and the functions but they are broken. */ +# if @REPLACE_ISWCNTRL@ +# define iswalnum rpl_iswalnum +# define iswalpha rpl_iswalpha +# define iswblank rpl_iswblank +# define iswcntrl rpl_iswcntrl +# define iswdigit rpl_iswdigit +# define iswgraph rpl_iswgraph +# define iswlower rpl_iswlower +# define iswprint rpl_iswprint +# define iswpunct rpl_iswpunct +# define iswspace rpl_iswspace +# define iswupper rpl_iswupper +# define iswxdigit rpl_iswxdigit +# endif + static inline int -iswalnum (__wctype_wint_t wc) +iswalnum (wint_t wc) { return ((wc >= '0' && wc <= '9') || ((wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'Z')); } static inline int -iswalpha (__wctype_wint_t wc) +iswalpha (wint_t wc) { return (wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'Z'; } static inline int -iswblank (__wctype_wint_t wc) +iswblank (wint_t wc) { return wc == ' ' || wc == '\t'; } static inline int -iswcntrl (__wctype_wint_t wc) +iswcntrl (wint_t wc) { return (wc & ~0x1f) == 0 || wc == 0x7f; } static inline int -iswdigit (__wctype_wint_t wc) +iswdigit (wint_t wc) { return wc >= '0' && wc <= '9'; } static inline int -iswgraph (__wctype_wint_t wc) +iswgraph (wint_t wc) { return wc >= '!' && wc <= '~'; } static inline int -iswlower (__wctype_wint_t wc) +iswlower (wint_t wc) { return wc >= 'a' && wc <= 'z'; } static inline int -iswprint (__wctype_wint_t wc) +iswprint (wint_t wc) { return wc >= ' ' && wc <= '~'; } static inline int -iswpunct (__wctype_wint_t wc) +iswpunct (wint_t wc) { return (wc >= '!' && wc <= '~' && !((wc >= '0' && wc <= '9') @@ -130,20 +162,20 @@ iswpunct (__wctype_wint_t wc) } static inline int -iswspace (__wctype_wint_t wc) +iswspace (wint_t wc) { return (wc == ' ' || wc == '\t' || wc == '\n' || wc == '\v' || wc == '\f' || wc == '\r'); } static inline int -iswupper (__wctype_wint_t wc) +iswupper (wint_t wc) { return wc >= 'A' && wc <= 'Z'; } static inline int -iswxdigit (__wctype_wint_t wc) +iswxdigit (wint_t wc) { return ((wc >= '0' && wc <= '9') || ((wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'F')); @@ -152,3 +184,4 @@ iswxdigit (__wctype_wint_t wc) # endif /* ! HAVE_ISWCNTRL */ #endif /* _GL_WCTYPE_H */ +#endif /* _GL_WCTYPE_H */ diff --git a/src/bin/coreutils/lib/wcwidth.c b/src/bin/coreutils/lib/wcwidth.c new file mode 100644 index 0000000000..4885071d06 --- /dev/null +++ b/src/bin/coreutils/lib/wcwidth.c @@ -0,0 +1,51 @@ +/* Determine the number of screen columns needed for a character. + Copyright (C) 2006, 2007 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#include + +/* Specification. */ +#include + +/* Get iswprint. */ +#include + +#include "localcharset.h" +#include "streq.h" +#include "uniwidth.h" + +#undef wcwidth + +int +rpl_wcwidth (wchar_t wc) +{ + /* In UTF-8 locales, use a Unicode aware width function. */ + const char *encoding = locale_charset (); + if (STREQ (encoding, "UTF-8", 'U', 'T', 'F', '-', '8', 0, 0, 0 ,0)) + { + /* We assume that in a UTF-8 locale, a wide character is the same as a + Unicode character. */ + return uc_width (wc, encoding); + } + else + { + /* Otherwise, fall back to the system's wcwidth function. */ +#if HAVE_WCWIDTH + return wcwidth (wc); +#else + return wc == 0 ? 0 : iswprint (wc) ? 1 : -1; +#endif + } +} diff --git a/src/bin/coreutils/lib/wcwidth.h b/src/bin/coreutils/lib/wcwidth.h deleted file mode 100644 index 8ed5ff8c91..0000000000 --- a/src/bin/coreutils/lib/wcwidth.h +++ /dev/null @@ -1,57 +0,0 @@ -/* Determine the number of screen columns needed for a character. - Copyright (C) 2006, 2007 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ - -#ifndef _gl_WCWIDTH_H -#define _gl_WCWIDTH_H - -#if HAVE_WCHAR_T - -/* Get wcwidth if available, along with wchar_t. */ -# include - -/* Get iswprint. */ -# include - -# ifndef HAVE_DECL_WCWIDTH -"this configure-time declaration test was not run" -# endif -# ifndef wcwidth -# if !HAVE_WCWIDTH - -/* wcwidth doesn't exist, so assume all printable characters have - width 1. */ -static inline int -wcwidth (wchar_t wc) -{ - return wc == 0 ? 0 : iswprint (wc) ? 1 : -1; -} - -# elif !HAVE_DECL_WCWIDTH - -/* wcwidth exists but is not declared. */ -extern -# ifdef __cplusplus -"C" -# endif -int wcwidth (int /* actually wchar_t */); - -# endif -# endif - -#endif /* HAVE_WCHAR_T */ - -#endif /* _gl_WCWIDTH_H */ diff --git a/src/bin/coreutils/lib/write-any-file.c b/src/bin/coreutils/lib/write-any-file.c new file mode 100644 index 0000000000..26db765fa6 --- /dev/null +++ b/src/bin/coreutils/lib/write-any-file.c @@ -0,0 +1,50 @@ +/* Determine whether we can write any file. + + Copyright (C) 2007 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* Written by Paul Eggert. */ + +#include + +#include "write-any-file.h" +#include "priv-set.h" + +#include + +/* Return true if we know that we can write any file, including + writing directories. */ + +bool +can_write_any_file (void) +{ + static bool initialized; + static bool can_write; + + if (! initialized) + { + bool can = false; +#if defined PRIV_FILE_DAC_WRITE + can = (priv_set_ismember (PRIV_FILE_DAC_WRITE) == 1); +#else + /* In traditional Unix, only root can unlink directories. */ + can = (geteuid () == 0); +#endif + can_write = can; + initialized = true; + } + + return can_write; +} diff --git a/src/bin/coreutils/lib/write-any-file.h b/src/bin/coreutils/lib/write-any-file.h new file mode 100644 index 0000000000..3930d4dccd --- /dev/null +++ b/src/bin/coreutils/lib/write-any-file.h @@ -0,0 +1,2 @@ +#include +bool can_write_any_file (void); diff --git a/src/bin/coreutils/lib/write.c b/src/bin/coreutils/lib/write.c new file mode 100644 index 0000000000..250b5cc8fd --- /dev/null +++ b/src/bin/coreutils/lib/write.c @@ -0,0 +1,62 @@ +/* POSIX compatible write() function. + Copyright (C) 2008 Free Software Foundation, Inc. + Written by Bruno Haible , 2008. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#include + +/* Specification. */ +#include + +/* Replace this function only if module 'sigpipe' is requested. */ +#if GNULIB_SIGPIPE + +/* On native Windows platforms, SIGPIPE does not exist. When write() is + called on a pipe with no readers, WriteFile() fails with error + GetLastError() = ERROR_NO_DATA, and write() in consequence fails with + error EINVAL. */ + +# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ + +# include +# include +# include + +# define WIN32_LEAN_AND_MEAN /* avoid including junk */ +# include + +ssize_t +rpl_write (int fd, const void *buf, size_t count) +#undef write +{ + ssize_t ret = write (fd, buf, count); + + if (ret < 0) + { + if (GetLastError () == ERROR_NO_DATA + && GetFileType (_get_osfhandle (fd)) == FILE_TYPE_PIPE) + { + /* Try to raise signal SIGPIPE. */ + raise (SIGPIPE); + /* If it is currently blocked or ignored, change errno from EINVAL + to EPIPE. */ + errno = EPIPE; + } + } + return ret; +} + +# endif +#endif diff --git a/src/bin/coreutils/lib/xalloc-die.c b/src/bin/coreutils/lib/xalloc-die.c index 090f060df7..0a0694fcfe 100644 --- a/src/bin/coreutils/lib/xalloc-die.c +++ b/src/bin/coreutils/lib/xalloc-die.c @@ -3,10 +3,10 @@ Copyright (C) 1997, 1998, 1999, 2000, 2002, 2003, 2004, 2006 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ #include diff --git a/src/bin/coreutils/lib/xalloc.h b/src/bin/coreutils/lib/xalloc.h index 0c6d8dcf50..57a13e0afa 100644 --- a/src/bin/coreutils/lib/xalloc.h +++ b/src/bin/coreutils/lib/xalloc.h @@ -1,12 +1,12 @@ /* xalloc.h -- malloc with out-of-memory checking Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2003, 2004, 2006, 2007 Free Software Foundation, Inc. + 1999, 2000, 2003, 2004, 2006, 2007, 2008 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ #ifndef XALLOC_H_ # define XALLOC_H_ @@ -29,7 +28,7 @@ extern "C" { # ifndef __attribute__ -# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8) || __STRICT_ANSI__ +# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8) # define __attribute__(x) # endif # endif @@ -38,6 +37,14 @@ extern "C" { # define ATTRIBUTE_NORETURN __attribute__ ((__noreturn__)) # endif +# ifndef ATTRIBUTE_MALLOC +# if __GNUC__ >= 3 +# define ATTRIBUTE_MALLOC __attribute__ ((__malloc__)) +# else +# define ATTRIBUTE_MALLOC +# endif +# endif + /* This function is always triggered when memory is exhausted. It must be defined by the application, either explicitly or by using gnulib's xalloc-die module. This is the @@ -45,13 +52,13 @@ extern "C" { memory allocation failure. */ extern void xalloc_die (void) ATTRIBUTE_NORETURN; -void *xmalloc (size_t s); -void *xzalloc (size_t s); -void *xcalloc (size_t n, size_t s); +void *xmalloc (size_t s) ATTRIBUTE_MALLOC; +void *xzalloc (size_t s) ATTRIBUTE_MALLOC; +void *xcalloc (size_t n, size_t s) ATTRIBUTE_MALLOC; void *xrealloc (void *p, size_t s); void *x2realloc (void *p, size_t *pn); -void *xmemdup (void const *p, size_t s); -char *xstrdup (char const *str); +void *xmemdup (void const *p, size_t s) ATTRIBUTE_MALLOC; +char *xstrdup (char const *str) ATTRIBUTE_MALLOC; /* Return 1 if an array of N objects, each of size S, cannot exist due to size arithmetic overflow. S must be positive and N must be @@ -98,10 +105,10 @@ char *xstrdup (char const *str); # if HAVE_INLINE # define static_inline static inline # else - void *xnmalloc (size_t n, size_t s); + void *xnmalloc (size_t n, size_t s) ATTRIBUTE_MALLOC; void *xnrealloc (void *p, size_t n, size_t s); void *x2nrealloc (void *p, size_t *pn, size_t s); - char *xcharalloc (size_t n); + char *xcharalloc (size_t n) ATTRIBUTE_MALLOC; # endif # ifdef static_inline @@ -109,6 +116,7 @@ char *xstrdup (char const *str); /* Allocate an array of N objects, each with S bytes of memory, dynamically, with error checking. S must be nonzero. */ +static_inline void *xnmalloc (size_t n, size_t s) ATTRIBUTE_MALLOC; static_inline void * xnmalloc (size_t n, size_t s) { @@ -220,6 +228,7 @@ x2nrealloc (void *p, size_t *pn, size_t s) /* Return a pointer to a new buffer of N bytes. This is like xmalloc, except it returns char *. */ +static_inline char *xcharalloc (size_t n) ATTRIBUTE_MALLOC; static_inline char * xcharalloc (size_t n) { diff --git a/src/bin/coreutils/lib/xasprintf.c b/src/bin/coreutils/lib/xasprintf.c new file mode 100644 index 0000000000..5b4f0c0bea --- /dev/null +++ b/src/bin/coreutils/lib/xasprintf.c @@ -0,0 +1,33 @@ +/* vasprintf and asprintf with out-of-memory checking. + Copyright (C) 1999, 2002-2004, 2006 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#include + +/* Specification. */ +#include "xvasprintf.h" + +char * +xasprintf (const char *format, ...) +{ + va_list args; + char *result; + + va_start (args, format); + result = xvasprintf (format, args); + va_end (args); + + return result; +} diff --git a/src/bin/coreutils/lib/xfreopen.c b/src/bin/coreutils/lib/xfreopen.c new file mode 100644 index 0000000000..e3c4a7c70d --- /dev/null +++ b/src/bin/coreutils/lib/xfreopen.c @@ -0,0 +1,41 @@ +/* a wrapper for frepoen + Copyright (C) 2008 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#include +#include "xfreopen.h" + +#include +#include "error.h" +#include "exitfail.h" +#include "quote.h" + +#include "gettext.h" +#define _(msgid) gettext (msgid) + +void +xfreopen (char const *filename, char const *mode, FILE *fp) +{ + if (!freopen (filename, mode, fp)) + { + char const *f = (filename ? filename + : (fp == stdin ? _("stdin") + : (fp == stdout ? _("stdout") + : (fp == stderr ? _("stderr") + : _("unknown stream"))))); + error (exit_failure, errno, _("failed to reopen %s with mode %s"), + quote_n (0, f), quote_n (1, mode)); + } +} diff --git a/src/bin/coreutils/lib/xfreopen.h b/src/bin/coreutils/lib/xfreopen.h new file mode 100644 index 0000000000..2ce49b5a4a --- /dev/null +++ b/src/bin/coreutils/lib/xfreopen.h @@ -0,0 +1,2 @@ +#include +void xfreopen (char const *filename, char const *mode, FILE *fp); diff --git a/src/bin/coreutils/lib/xfts.c b/src/bin/coreutils/lib/xfts.c index 1402e95e30..579ebeb023 100644 --- a/src/bin/coreutils/lib/xfts.c +++ b/src/bin/coreutils/lib/xfts.c @@ -2,10 +2,10 @@ Copyright (C) 2003, 2005-2007 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Jim Meyering. */ diff --git a/src/bin/coreutils/lib/xgetcwd.c b/src/bin/coreutils/lib/xgetcwd.c index 26ea5da53d..6787b4653c 100644 --- a/src/bin/coreutils/lib/xgetcwd.c +++ b/src/bin/coreutils/lib/xgetcwd.c @@ -2,10 +2,10 @@ Copyright (C) 2001, 2003, 2004, 2006, 2007 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Jim Meyering. */ diff --git a/src/bin/coreutils/lib/xgetcwd.h b/src/bin/coreutils/lib/xgetcwd.h index 70afe35e7c..3d966de967 100644 --- a/src/bin/coreutils/lib/xgetcwd.h +++ b/src/bin/coreutils/lib/xgetcwd.h @@ -1,10 +1,10 @@ /* prototype for xgetcwd Copyright (C) 1995, 2001, 2003 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,7 +12,6 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ extern char *xgetcwd (void); diff --git a/src/bin/coreutils/lib/xgethostname.c b/src/bin/coreutils/lib/xgethostname.c index b4c8dcc732..875d497618 100644 --- a/src/bin/coreutils/lib/xgethostname.c +++ b/src/bin/coreutils/lib/xgethostname.c @@ -3,10 +3,10 @@ Copyright (C) 1992, 1996, 2000, 2001, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* written by Jim Meyering */ diff --git a/src/bin/coreutils/lib/xmalloc.c b/src/bin/coreutils/lib/xmalloc.c index 318e0ddb5a..585fb4b1e8 100644 --- a/src/bin/coreutils/lib/xmalloc.c +++ b/src/bin/coreutils/lib/xmalloc.c @@ -1,13 +1,13 @@ /* xmalloc.c -- malloc with out of memory checking Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, + 1999, 2000, 2002, 2003, 2004, 2005, 2006, 2008-2009 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -15,8 +15,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ #include @@ -29,10 +28,6 @@ #include #include -#ifndef SIZE_MAX -# define SIZE_MAX ((size_t) -1) -#endif - /* 1 if calloc is known to be compatible with GNU calloc. This matters if we are not also using the calloc module, which defines HAVE_CALLOC and supports the GNU API even on non-GNU platforms. */ diff --git a/src/bin/coreutils/lib/xmemcoll.c b/src/bin/coreutils/lib/xmemcoll.c index de00c84447..393e6d50a4 100644 --- a/src/bin/coreutils/lib/xmemcoll.c +++ b/src/bin/coreutils/lib/xmemcoll.c @@ -2,10 +2,10 @@ Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Contributed by Paul Eggert . */ diff --git a/src/bin/coreutils/lib/xmemxfrm.c b/src/bin/coreutils/lib/xmemxfrm.c index 8150334cde..84f51583bc 100644 --- a/src/bin/coreutils/lib/xmemxfrm.c +++ b/src/bin/coreutils/lib/xmemxfrm.c @@ -2,10 +2,10 @@ Copyright (C) 2006 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Paul Eggert . */ @@ -53,9 +52,9 @@ xmemxfrm (char *restrict dest, size_t destsize, if (errno) { error (0, errno, _("string transformation failed")); - error (0, 0, _("Set LC_ALL='C' to work around the problem.")); + error (0, 0, _("set LC_ALL='C' to work around the problem")); error (exit_failure, 0, - _("The untransformed string was %s."), + _("the untransformed string was %s"), quotearg_n_style_mem (0, locale_quoting_style, src, srcsize)); } diff --git a/src/bin/coreutils/lib/xnanosleep.c b/src/bin/coreutils/lib/xnanosleep.c index ebbd7ee89a..1c7de6241c 100644 --- a/src/bin/coreutils/lib/xnanosleep.c +++ b/src/bin/coreutils/lib/xnanosleep.c @@ -3,10 +3,10 @@ Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Mostly written (for sleep.c) by Paul Eggert. Factored out (creating this file) by Jim Meyering. */ @@ -50,36 +49,49 @@ xnanosleep (double seconds) { enum { BILLION = 1000000000 }; - bool overflow = false; - double ns; + /* For overflow checking, use naive comparison if possible, widening + to long double if double is not wide enough. Otherwise, use <=, + not <, to avoid problems when TIME_T_MAX is less than SECONDS but + compares equal to SECONDS after loss of precision when coercing + from time_t to long double. This mishandles near-maximal values + in some rare (perhaps theoretical) cases but that is better than + undefined behavior. */ + bool overflow = ((time_t) ((double) TIME_T_MAX / 2) == TIME_T_MAX / 2 + ? TIME_T_MAX < seconds + : (time_t) ((long double) TIME_T_MAX / 2) == TIME_T_MAX / 2 + ? TIME_T_MAX < (long double) seconds + : TIME_T_MAX <= (long double) seconds); + struct timespec ts_sleep; assert (0 <= seconds); - /* Separate whole seconds from nanoseconds. - Be careful to detect any overflow. */ - ts_sleep.tv_sec = seconds; - ns = BILLION * (seconds - ts_sleep.tv_sec); - overflow |= ! (ts_sleep.tv_sec <= seconds && 0 <= ns && ns <= BILLION); - ts_sleep.tv_nsec = ns; - - /* Round up to the next whole number, if necessary, so that we - always sleep for at least the requested amount of time. Assuming - the default rounding mode, we don't have to worry about the - rounding error when computing 'ns' above, since the error won't - cause 'ns' to drop below an integer boundary. */ - ts_sleep.tv_nsec += (ts_sleep.tv_nsec < ns); - - /* Normalize the interval length. nanosleep requires this. */ - if (BILLION <= ts_sleep.tv_nsec) + /* Separate whole seconds from nanoseconds. */ + if (! overflow) { - time_t t = ts_sleep.tv_sec + 1; + time_t floor_seconds = seconds; + double ns = BILLION * (seconds - floor_seconds); + ts_sleep.tv_sec = floor_seconds; - /* Detect integer overflow. */ - overflow |= (t < ts_sleep.tv_sec); + /* Round up to the next whole number, if necessary, so that we + always sleep for at least the requested amount of time. Assuming + the default rounding mode, we don't have to worry about the + rounding error when computing 'ns' above, since the error won't + cause 'ns' to drop below an integer boundary. */ + ts_sleep.tv_nsec = ns; + ts_sleep.tv_nsec += (ts_sleep.tv_nsec < ns); - ts_sleep.tv_sec = t; - ts_sleep.tv_nsec -= BILLION; + /* Normalize the interval length. nanosleep requires this. */ + if (BILLION <= ts_sleep.tv_nsec) + { + if (ts_sleep.tv_sec == TIME_T_MAX) + overflow = true; + else + { + ts_sleep.tv_sec++; + ts_sleep.tv_nsec -= BILLION; + } + } } for (;;) diff --git a/src/bin/coreutils/lib/xprintf.c b/src/bin/coreutils/lib/xprintf.c new file mode 100644 index 0000000000..8f279faf41 --- /dev/null +++ b/src/bin/coreutils/lib/xprintf.c @@ -0,0 +1,79 @@ +/* printf wrappers that fail immediately for non-file-related errors + Copyright (C) 2007 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#include + +#include "xprintf.h" + +#include + +#include "error.h" +#include "exitfail.h" +#include "gettext.h" + +/* written by Jim Meyering */ + +/* Just like printf, but call error if it fails without setting the + stream's error indicator. */ +int +xprintf (char const *restrict format, ...) +{ + va_list args; + int retval; + va_start (args, format); + retval = xvprintf (format, args); + va_end (args); + + return retval; +} + +/* Just like vprintf, but call error if it fails without setting the + stream's error indicator. */ +int +xvprintf (char const *restrict format, va_list args) +{ + int retval = vprintf (format, args); + if (retval < 0 && ! ferror (stdout)) + error (exit_failure, errno, gettext ("cannot perform formatted output")); + + return retval; +} + +/* Just like fprintf, but call error if it fails without setting the + stream's error indicator. */ +int +xfprintf (FILE *restrict stream, char const *restrict format, ...) +{ + va_list args; + int retval; + va_start (args, format); + retval = xvfprintf (stream, format, args); + va_end (args); + + return retval; +} + +/* Just like vfprintf, but call error if it fails without setting the + stream's error indicator. */ +int +xvfprintf (FILE *restrict stream, char const *restrict format, va_list args) +{ + int retval = vfprintf (stream, format, args); + if (retval < 0 && ! ferror (stream)) + error (exit_failure, errno, gettext ("cannot perform formatted output")); + + return retval; +} diff --git a/src/bin/coreutils/lib/xprintf.h b/src/bin/coreutils/lib/xprintf.h new file mode 100644 index 0000000000..d11e270e98 --- /dev/null +++ b/src/bin/coreutils/lib/xprintf.h @@ -0,0 +1,46 @@ +/* printf wrappers that fail immediately for non-file-related errors + Copyright (C) 2007-2008 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#ifndef _XPRINTF_H +#define _XPRINTF_H + +#include +#include + +#ifndef __attribute__ +/* This feature is available in gcc versions 2.5 and later. */ +# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) +# define __attribute__(Spec) /* empty */ +# endif +/* The __-protected variants of `format' and `printf' attributes + are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */ +# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) +# define __format__ format +# define __printf__ printf +# endif +#endif + +extern int xprintf (char const *restrict format, ...) + __attribute__ ((__format__ (__printf__, 1, 2))); +extern int xvprintf (char const *restrict format, va_list args) + __attribute__ ((__format__ (__printf__, 1, 0))); +extern int xfprintf (FILE *restrict stream, char const *restrict format, ...) + __attribute__ ((__format__ (__printf__, 2, 3))); +extern int xvfprintf (FILE *restrict stream, char const *restrict format, + va_list args) + __attribute__ ((__format__ (__printf__, 2, 0))); + +#endif diff --git a/src/bin/coreutils/lib/xreadlink.c b/src/bin/coreutils/lib/xreadlink.c deleted file mode 100644 index 2aba265478..0000000000 --- a/src/bin/coreutils/lib/xreadlink.c +++ /dev/null @@ -1,131 +0,0 @@ -/* xreadlink.c -- readlink wrapper to return the link name in malloc'd storage - - Copyright (C) 2001, 2003-2007 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. - If not, write to the Free Software Foundation, - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ - -/* Written by Jim Meyering - and Bruno Haible . */ - -#include - -/* Specification. */ -#include "xreadlink.h" - -#include -#include -#include -#include -#include -#include -#include - -#ifndef SIZE_MAX -# define SIZE_MAX ((size_t) -1) -#endif -#ifndef SSIZE_MAX -# define SSIZE_MAX ((ssize_t) (SIZE_MAX / 2)) -#endif - -#ifdef NO_XMALLOC -# define xmalloc malloc -#else -# include "xalloc.h" -#endif - -/* Call readlink to get the symbolic link value of FILENAME. - Return a pointer to that NUL-terminated string in malloc'd storage. - If readlink fails, return NULL (caller may use errno to diagnose). - If realloc fails, or if the link value is longer than SIZE_MAX :-), - give a diagnostic and exit. */ - -char * -xreadlink (char const *filename) -{ - /* The initial buffer size for the link value. A power of 2 - detects arithmetic overflow earlier, but is not required. */ -#define INITIAL_BUF_SIZE 1024 - - /* Allocate the initial buffer on the stack. This way, in the common - case of a symlink of small size, we get away with a single small malloc() - instead of a big malloc() followed by a shrinking realloc(). */ - char initial_buf[INITIAL_BUF_SIZE]; - - char *buffer = initial_buf; - size_t buf_size = sizeof (initial_buf); - - while (1) - { - /* Attempt to read the link into the current buffer. */ - ssize_t link_length = readlink (filename, buffer, buf_size); - - /* On AIX 5L v5.3 and HP-UX 11i v2 04/09, readlink returns -1 - with errno == ERANGE if the buffer is too small. */ - if (link_length < 0 && errno != ERANGE) - { - if (buffer != initial_buf) - { - int saved_errno = errno; - free (buffer); - errno = saved_errno; - } - return NULL; - } - - if ((size_t) link_length < buf_size) - { - buffer[link_length++] = '\0'; - - /* Return it in a chunk of memory as small as possible. */ - if (buffer == initial_buf) - { - buffer = (char *) xmalloc (link_length); -#ifdef NO_XMALLOC - if (buffer == NULL) - return NULL; -#endif - memcpy (buffer, initial_buf, link_length); - } - else - { - /* Shrink buffer before returning it. */ - if ((size_t) link_length < buf_size) - { - char *smaller_buffer = (char *) realloc (buffer, link_length); - - if (smaller_buffer != NULL) - buffer = smaller_buffer; - } - } - return buffer; - } - - if (buffer != initial_buf) - free (buffer); - buf_size *= 2; - if (SSIZE_MAX < buf_size || (SIZE_MAX / 2 < SSIZE_MAX && buf_size == 0)) -#ifdef NO_XMALLOC - return NULL; -#else - xalloc_die (); -#endif - buffer = (char *) xmalloc (buf_size); -#ifdef NO_XMALLOC - if (buffer == NULL) - return NULL; -#endif - } -} diff --git a/src/bin/coreutils/lib/xreadlink.h b/src/bin/coreutils/lib/xreadlink.h deleted file mode 100644 index 6d93fe6c3b..0000000000 --- a/src/bin/coreutils/lib/xreadlink.h +++ /dev/null @@ -1,34 +0,0 @@ -/* Reading symbolic links without size limitation. - - Copyright (C) 2001, 2003, 2004, 2007 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. - If not, write to the Free Software Foundation, - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ - -/* Written by Jim Meyering */ - -#include - -/* Call readlink to get the symbolic link value of FILENAME. - Return a pointer to that NUL-terminated string in malloc'd storage. - If readlink fails, return NULL and set errno. */ -extern char *xreadlink (char const *filename); - -/* Call readlink to get the symbolic link value of FILENAME. - SIZE_HINT is a hint as to how long the link is expected to be; - typically it is taken from st_size. It need not be correct. - Return a pointer to that NUL-terminated string in malloc'd storage. - If readlink fails, return NULL and set errno. */ -extern char *xreadlink_with_size (char const *filename, size_t size_hint); diff --git a/src/bin/coreutils/lib/xsize.h b/src/bin/coreutils/lib/xsize.h new file mode 100644 index 0000000000..60a311a790 --- /dev/null +++ b/src/bin/coreutils/lib/xsize.h @@ -0,0 +1,111 @@ +/* -*- buffer-read-only: t -*- vi: set ro: */ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#line 1 +/* xsize.h -- Checked size_t computations. + + Copyright (C) 2003, 2008 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + +#ifndef _XSIZE_H +#define _XSIZE_H + +/* Get size_t. */ +#include + +/* Get SIZE_MAX. */ +#include +#if HAVE_STDINT_H +# include +#endif + +/* The size of memory objects is often computed through expressions of + type size_t. Example: + void* p = malloc (header_size + n * element_size). + These computations can lead to overflow. When this happens, malloc() + returns a piece of memory that is way too small, and the program then + crashes while attempting to fill the memory. + To avoid this, the functions and macros in this file check for overflow. + The convention is that SIZE_MAX represents overflow. + malloc (SIZE_MAX) is not guaranteed to fail -- think of a malloc + implementation that uses mmap --, it's recommended to use size_overflow_p() + or size_in_bounds_p() before invoking malloc(). + The example thus becomes: + size_t size = xsum (header_size, xtimes (n, element_size)); + void *p = (size_in_bounds_p (size) ? malloc (size) : NULL); +*/ + +/* Convert an arbitrary value >= 0 to type size_t. */ +#define xcast_size_t(N) \ + ((N) <= SIZE_MAX ? (size_t) (N) : SIZE_MAX) + +/* Sum of two sizes, with overflow check. */ +static inline size_t +#if __GNUC__ >= 3 +__attribute__ ((__pure__)) +#endif +xsum (size_t size1, size_t size2) +{ + size_t sum = size1 + size2; + return (sum >= size1 ? sum : SIZE_MAX); +} + +/* Sum of three sizes, with overflow check. */ +static inline size_t +#if __GNUC__ >= 3 +__attribute__ ((__pure__)) +#endif +xsum3 (size_t size1, size_t size2, size_t size3) +{ + return xsum (xsum (size1, size2), size3); +} + +/* Sum of four sizes, with overflow check. */ +static inline size_t +#if __GNUC__ >= 3 +__attribute__ ((__pure__)) +#endif +xsum4 (size_t size1, size_t size2, size_t size3, size_t size4) +{ + return xsum (xsum (xsum (size1, size2), size3), size4); +} + +/* Maximum of two sizes, with overflow check. */ +static inline size_t +#if __GNUC__ >= 3 +__attribute__ ((__pure__)) +#endif +xmax (size_t size1, size_t size2) +{ + /* No explicit check is needed here, because for any n: + max (SIZE_MAX, n) == SIZE_MAX and max (n, SIZE_MAX) == SIZE_MAX. */ + return (size1 >= size2 ? size1 : size2); +} + +/* Multiplication of a count with an element size, with overflow check. + The count must be >= 0 and the element size must be > 0. + This is a macro, not an inline function, so that it works correctly even + when N is of a wider type and N > SIZE_MAX. */ +#define xtimes(N, ELSIZE) \ + ((N) <= SIZE_MAX / (ELSIZE) ? (size_t) (N) * (ELSIZE) : SIZE_MAX) + +/* Check for overflow. */ +#define size_overflow_p(SIZE) \ + ((SIZE) == SIZE_MAX) +/* Check against overflow. */ +#define size_in_bounds_p(SIZE) \ + ((SIZE) != SIZE_MAX) + +#endif /* _XSIZE_H */ diff --git a/src/bin/coreutils/lib/xstriconv.c b/src/bin/coreutils/lib/xstriconv.c new file mode 100644 index 0000000000..14d8775cbf --- /dev/null +++ b/src/bin/coreutils/lib/xstriconv.c @@ -0,0 +1,62 @@ +/* Charset conversion with out-of-memory checking. + Copyright (C) 2001-2004, 2006 Free Software Foundation, Inc. + Written by Bruno Haible. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#include + +/* Specification. */ +#include "xstriconv.h" + +#include + +#include "striconv.h" +#include "xalloc.h" + + +#if HAVE_ICONV + +int +xmem_cd_iconv (const char *src, size_t srclen, iconv_t cd, + char **resultp, size_t *lengthp) +{ + int retval = mem_cd_iconv (src, srclen, cd, resultp, lengthp); + + if (retval < 0 && errno == ENOMEM) + xalloc_die (); + return retval; +} + +char * +xstr_cd_iconv (const char *src, iconv_t cd) +{ + char *result = str_cd_iconv (src, cd); + + if (result == NULL && errno == ENOMEM) + xalloc_die (); + return result; +} + +#endif + +char * +xstr_iconv (const char *src, const char *from_codeset, const char *to_codeset) +{ + char *result = str_iconv (src, from_codeset, to_codeset); + + if (result == NULL && errno == ENOMEM) + xalloc_die (); + return result; +} diff --git a/src/bin/coreutils/lib/xstriconv.h b/src/bin/coreutils/lib/xstriconv.h new file mode 100644 index 0000000000..a8a197102a --- /dev/null +++ b/src/bin/coreutils/lib/xstriconv.h @@ -0,0 +1,78 @@ +/* Charset conversion with out-of-memory checking. + Copyright (C) 2001-2004, 2006-2007 Free Software Foundation, Inc. + Written by Bruno Haible and Simon Josefsson. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#ifndef _XSTRICONV_H +#define _XSTRICONV_H + +#include +#if HAVE_ICONV +#include +#endif + + +#ifdef __cplusplus +extern "C" { +#endif + + +#if HAVE_ICONV + +/* Convert an entire string from one encoding to another, using iconv. + The original string is at [SRC,...,SRC+SRCLEN-1]. + The conversion descriptor is passed as CD. + *RESULTP and *LENGTH should initially be a scratch buffer and its size, + or *RESULTP can initially be NULL. + May erase the contents of the memory at *RESULTP. + Upon memory allocation failure, report the error and exit. + Return value: 0 if successful, otherwise -1 and errno set. + If successful: The resulting string is stored in *RESULTP and its length + in *LENGTHP. *RESULTP is set to a freshly allocated memory block, or is + unchanged if no dynamic memory allocation was necessary. */ +extern int xmem_cd_iconv (const char *src, size_t srclen, iconv_t cd, + char **resultp, size_t *lengthp); + +/* Convert an entire string from one encoding to another, using iconv. + The original string is the NUL-terminated string starting at SRC. + The conversion descriptor is passed as CD. Both the "from" and the "to" + encoding must use a single NUL byte at the end of the string (i.e. not + UCS-2, UCS-4, UTF-16, UTF-32). + Allocate a malloced memory block for the result. + Upon memory allocation failure, report the error and exit. + Return value: the freshly allocated resulting NUL-terminated string if + successful, otherwise NULL and errno set. */ +extern char * xstr_cd_iconv (const char *src, iconv_t cd); + +#endif + +/* Convert an entire string from one encoding to another, using iconv. + The original string is the NUL-terminated string starting at SRC. + Both the "from" and the "to" encoding must use a single NUL byte at the + end of the string (i.e. not UCS-2, UCS-4, UTF-16, UTF-32). + Allocate a malloced memory block for the result. + Upon memory allocation failure, report the error and exit. + Return value: the freshly allocated resulting NUL-terminated string if + successful, otherwise NULL and errno set. */ +extern char * xstr_iconv (const char *src, + const char *from_codeset, const char *to_codeset); + + +#ifdef __cplusplus +} +#endif + + +#endif /* _XSTRICONV_H */ diff --git a/src/bin/coreutils/lib/xstrndup.c b/src/bin/coreutils/lib/xstrndup.c index 7ccefd798a..37488cd99d 100644 --- a/src/bin/coreutils/lib/xstrndup.c +++ b/src/bin/coreutils/lib/xstrndup.c @@ -2,10 +2,10 @@ checking. Copyright (C) 2003, 2006, 2007 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ #include diff --git a/src/bin/coreutils/lib/xstrndup.h b/src/bin/coreutils/lib/xstrndup.h index 88354cfd43..4882e39475 100644 --- a/src/bin/coreutils/lib/xstrndup.h +++ b/src/bin/coreutils/lib/xstrndup.h @@ -2,10 +2,10 @@ checking. Copyright (C) 2003 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ #include diff --git a/src/bin/coreutils/lib/xstrtod.c b/src/bin/coreutils/lib/xstrtod.c index 86e124f209..8b4a72c8b7 100644 --- a/src/bin/coreutils/lib/xstrtod.c +++ b/src/bin/coreutils/lib/xstrtod.c @@ -3,10 +3,10 @@ Copyright (C) 1996, 1999, 2000, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Jim Meyering. */ diff --git a/src/bin/coreutils/lib/xstrtod.h b/src/bin/coreutils/lib/xstrtod.h index 1e5ad94f5c..949d6d469e 100644 --- a/src/bin/coreutils/lib/xstrtod.h +++ b/src/bin/coreutils/lib/xstrtod.h @@ -2,10 +2,10 @@ Copyright (C) 1996, 1998, 2003, 2004, 2006 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Jim Meyering. */ diff --git a/src/bin/coreutils/lib/xstrtol-error.c b/src/bin/coreutils/lib/xstrtol-error.c new file mode 100644 index 0000000000..67b5bf065b --- /dev/null +++ b/src/bin/coreutils/lib/xstrtol-error.c @@ -0,0 +1,98 @@ +/* A more useful interface to strtol. + + Copyright (C) 1995, 1996, 1998, 1999, 2001-2004, 2006-2008 + Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#include +#include "xstrtol.h" + +#include + +#include "error.h" +#include "exitfail.h" +#include "gettext.h" + +#define N_(msgid) msgid + +/* Report an error for an invalid integer in an option argument. + + ERR is the error code returned by one of the xstrto* functions. + + Use OPT_IDX to decide whether to print the short option string "C" + or "-C" or a long option string derived from LONG_OPTION. OPT_IDX + is -2 if the short option "C" was used, without any leading "-"; it + is -1 if the short option "-C" was used; otherwise it is an index + into LONG_OPTIONS, which should have a name preceded by two '-' + characters. + + ARG is the option-argument containing the integer. + + After reporting an error, exit with status EXIT_STATUS if it is + nonzero. */ + +static void +xstrtol_error (enum strtol_error err, + int opt_idx, char c, struct option const *long_options, + char const *arg, + int exit_status) +{ + char const *hyphens = "--"; + char const *msgid; + char const *option; + char option_buffer[2]; + + switch (err) + { + default: + abort (); + + case LONGINT_INVALID: + msgid = N_("invalid %s%s argument `%s'"); + break; + + case LONGINT_INVALID_SUFFIX_CHAR: + case LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW: + msgid = N_("invalid suffix in %s%s argument `%s'"); + break; + + case LONGINT_OVERFLOW: + msgid = N_("%s%s argument `%s' too large"); + break; + } + + if (opt_idx < 0) + { + hyphens -= opt_idx; + option_buffer[0] = c; + option_buffer[1] = '\0'; + option = option_buffer; + } + else + option = long_options[opt_idx].name; + + error (exit_status, 0, gettext (msgid), hyphens, option, arg); +} + +/* Like xstrtol_error, except exit with a failure status. */ + +void +xstrtol_fatal (enum strtol_error err, + int opt_idx, char c, struct option const *long_options, + char const *arg) +{ + xstrtol_error (err, opt_idx, c, long_options, arg, exit_failure); + abort (); +} diff --git a/src/bin/coreutils/lib/xstrtol.c b/src/bin/coreutils/lib/xstrtol.c index c4557a0064..1804fe5866 100644 --- a/src/bin/coreutils/lib/xstrtol.c +++ b/src/bin/coreutils/lib/xstrtol.c @@ -1,12 +1,12 @@ /* A more useful interface to strtol. - Copyright (C) 1995, 1996, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006 - Free Software Foundation, Inc. + Copyright (C) 1995, 1996, 1998, 1999, 2000, 2001, 2003, 2004, 2005, + 2006, 2007 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Jim Meyering. */ @@ -227,37 +226,3 @@ __xstrtol (const char *s, char **ptr, int strtol_base, *val = tmp; return err; } - -#ifdef TESTING_XSTRTO - -# include -# include "error.h" - -char *program_name; - -int -main (int argc, char **argv) -{ - strtol_error s_err; - int i; - - program_name = argv[0]; - for (i=1; i%lu (%s)\n", argv[i], val, p); - } - else - { - STRTOL_FATAL_ERROR (argv[i], "arg", s_err); - } - } - exit (0); -} - -#endif /* TESTING_XSTRTO */ diff --git a/src/bin/coreutils/lib/xstrtol.h b/src/bin/coreutils/lib/xstrtol.h index 475728aa44..9ac168bf38 100644 --- a/src/bin/coreutils/lib/xstrtol.h +++ b/src/bin/coreutils/lib/xstrtol.h @@ -1,12 +1,12 @@ /* A more useful interface to strtol. - Copyright (C) 1995, 1996, 1998, 1999, 2001, 2002, 2003, 2004, 2006 - Free Software Foundation, Inc. + Copyright (C) 1995, 1996, 1998, 1999, 2001, 2002, 2003, 2004, 2006, 2007, + 2008 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,18 +14,14 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ #ifndef XSTRTOL_H_ # define XSTRTOL_H_ 1 -# include "exitfail.h" - +# include # include -# include "gettext.h" - # ifndef _STRTOL_ERROR enum strtol_error { @@ -50,38 +46,33 @@ _DECLARE_XSTRTOL (xstrtoul, unsigned long int) _DECLARE_XSTRTOL (xstrtoimax, intmax_t) _DECLARE_XSTRTOL (xstrtoumax, uintmax_t) -# define _STRTOL_ERROR(Exit_code, Str, Argument_type_string, Err) \ - do \ - { \ - switch ((Err)) \ - { \ - default: \ - abort (); \ - \ - case LONGINT_INVALID: \ - error ((Exit_code), 0, gettext ("invalid %s `%s'"), \ - (Argument_type_string), (Str)); \ - break; \ - \ - case LONGINT_INVALID_SUFFIX_CHAR: \ - case LONGINT_INVALID_SUFFIX_CHAR | LONGINT_OVERFLOW: \ - error ((Exit_code), 0, \ - gettext ("invalid character following %s in `%s'"), \ - (Argument_type_string), (Str)); \ - break; \ - \ - case LONGINT_OVERFLOW: \ - error ((Exit_code), 0, gettext ("%s `%s' too large"), \ - (Argument_type_string), (Str)); \ - break; \ - } \ - } \ - while (0) +#ifndef __attribute__ +# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8) +# define __attribute__(x) +# endif +#endif -# define STRTOL_FATAL_ERROR(Str, Argument_type_string, Err) \ - _STRTOL_ERROR (exit_failure, Str, Argument_type_string, Err) +#ifndef ATTRIBUTE_NORETURN +# define ATTRIBUTE_NORETURN __attribute__ ((__noreturn__)) +#endif -# define STRTOL_FAIL_WARN(Str, Argument_type_string, Err) \ - _STRTOL_ERROR (0, Str, Argument_type_string, Err) +/* Report an error for an invalid integer in an option argument. + + ERR is the error code returned by one of the xstrto* functions. + + Use OPT_IDX to decide whether to print the short option string "C" + or "-C" or a long option string derived from LONG_OPTION. OPT_IDX + is -2 if the short option "C" was used, without any leading "-"; it + is -1 if the short option "-C" was used; otherwise it is an index + into LONG_OPTIONS, which should have a name preceded by two '-' + characters. + + ARG is the option-argument containing the integer. + + After reporting an error, exit with a failure status. */ + +void xstrtol_fatal (enum strtol_error, + int, char, struct option const *, + char const *) ATTRIBUTE_NORETURN; #endif /* not XSTRTOL_H_ */ diff --git a/src/bin/coreutils/lib/xtime.h b/src/bin/coreutils/lib/xtime.h index d268d2d2e5..1be9ad7681 100644 --- a/src/bin/coreutils/lib/xtime.h +++ b/src/bin/coreutils/lib/xtime.h @@ -2,10 +2,10 @@ Copyright (C) 2005, 2006 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Paul Eggert. */ diff --git a/src/bin/coreutils/lib/xvasprintf.c b/src/bin/coreutils/lib/xvasprintf.c new file mode 100644 index 0000000000..fd7f21b101 --- /dev/null +++ b/src/bin/coreutils/lib/xvasprintf.c @@ -0,0 +1,110 @@ +/* vasprintf and asprintf with out-of-memory checking. + Copyright (C) 1999, 2002-2004, 2006-2008 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#include + +/* Specification. */ +#include "xvasprintf.h" + +#include +#include +#include +#include + +#include "xalloc.h" + +/* Checked size_t computations. */ +#include "xsize.h" + +static inline char * +xstrcat (size_t argcount, va_list args) +{ + char *result; + va_list ap; + size_t totalsize; + size_t i; + char *p; + + /* Determine the total size. */ + totalsize = 0; + va_copy (ap, args); + for (i = argcount; i > 0; i--) + { + const char *next = va_arg (ap, const char *); + totalsize = xsum (totalsize, strlen (next)); + } + va_end (ap); + + /* Test for overflow in the summing pass above or in (totalsize + 1) below. + Also, don't return a string longer than INT_MAX, for consistency with + vasprintf(). */ + if (totalsize == SIZE_MAX || totalsize > INT_MAX) + { + errno = EOVERFLOW; + return NULL; + } + + /* Allocate and fill the result string. */ + result = XNMALLOC (totalsize + 1, char); + p = result; + for (i = argcount; i > 0; i--) + { + const char *next = va_arg (args, const char *); + size_t len = strlen (next); + memcpy (p, next, len); + p += len; + } + *p = '\0'; + + return result; +} + +char * +xvasprintf (const char *format, va_list args) +{ + char *result; + + /* Recognize the special case format = "%s...%s". It is a frequently used + idiom for string concatenation and needs to be fast. We don't want to + have a separate function xstrcat() for this purpose. */ + { + size_t argcount = 0; + const char *f; + + for (f = format;;) + { + if (*f == '\0') + /* Recognized the special case of string concatenation. */ + return xstrcat (argcount, args); + if (*f != '%') + break; + f++; + if (*f != 's') + break; + f++; + argcount++; + } + } + + if (vasprintf (&result, format, args) < 0) + { + if (errno == ENOMEM) + xalloc_die (); + return NULL; + } + + return result; +} diff --git a/src/bin/coreutils/lib/xvasprintf.h b/src/bin/coreutils/lib/xvasprintf.h new file mode 100644 index 0000000000..42b032a487 --- /dev/null +++ b/src/bin/coreutils/lib/xvasprintf.h @@ -0,0 +1,56 @@ +/* vasprintf and asprintf with out-of-memory checking. + Copyright (C) 2002-2004, 2006-2008 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#ifndef _XVASPRINTF_H +#define _XVASPRINTF_H + +/* Get va_list. */ +#include + +#ifndef __attribute__ +/* This feature is available in gcc versions 2.5 and later. */ +# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) +# define __attribute__(Spec) /* empty */ +# endif +/* The __-protected variants of `format' and `printf' attributes + are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */ +# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) +# define __format__ format +# define __printf__ printf +# endif +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* Write formatted output to a string dynamically allocated with malloc(), + and return it. Upon [ENOMEM] memory allocation error, call xalloc_die. + On some other error + - [EOVERFLOW] resulting string length is > INT_MAX, + - [EINVAL] invalid format string, + - [EILSEQ] error during conversion between wide and multibyte characters, + return NULL. */ +extern char *xasprintf (const char *format, ...) + __attribute__ ((__format__ (__printf__, 1, 2))); +extern char *xvasprintf (const char *format, va_list args) + __attribute__ ((__format__ (__printf__, 1, 0))); + +#ifdef __cplusplus +} +#endif + +#endif /* _XVASPRINTF_H */ diff --git a/src/bin/coreutils/lib/yesno.c b/src/bin/coreutils/lib/yesno.c index 24006281f0..139ab93114 100644 --- a/src/bin/coreutils/lib/yesno.c +++ b/src/bin/coreutils/lib/yesno.c @@ -1,12 +1,11 @@ /* yesno.c -- read a yes/no response from stdin - Copyright (C) 1990, 1998, 2001, 2003, 2004, 2005, 2006 Free - Software Foundation, Inc. + Copyright (C) 1990, 1998, 2001, 2003-2008 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ #include @@ -24,13 +22,11 @@ #include #include -#if ENABLE_NLS -# include "getline.h" -#endif +/* Return true if we read an affirmative line from standard input. -/* Return true if we read an affirmative line from standard input. */ - -extern int rpmatch (char const *response); + Since this function uses stdin, it is suggested that the caller not + use STDIN_FILENO directly, and also that the line + atexit(close_stdin) be added to main(). */ bool yesno (void) diff --git a/src/bin/coreutils/lib/yesno.h b/src/bin/coreutils/lib/yesno.h index dfa70bcff3..633c274a64 100644 --- a/src/bin/coreutils/lib/yesno.h +++ b/src/bin/coreutils/lib/yesno.h @@ -1,10 +1,10 @@ /* declare yesno Copyright (C) 2004 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,9 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. - If not, write to the Free Software Foundation, - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ #ifndef YESNO_H_ # define YESNO_H_ diff --git a/src/bin/coreutils/man/Makefile.am b/src/bin/coreutils/man/Makefile.am index 32df9d1766..ec5284b24d 100644 --- a/src/bin/coreutils/man/Makefile.am +++ b/src/bin/coreutils/man/Makefile.am @@ -1,10 +1,10 @@ # Make coreutils man pages. -*-Makefile-*- -# Copyright (C) 2002-2007 Free Software Foundation, Inc. +# Copyright (C) 2002-2009 Free Software Foundation, Inc. -# This program is free software; you can redistribute it and/or modify +# This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or +# the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # This program is distributed in the hope that it will be useful, @@ -13,38 +13,25 @@ # GNU General Public License for more details. # You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -# 02110-1301, USA. +# along with this program. If not, see . -dist_man_MANS = \ - base64.1 basename.1 cat.1 chgrp.1 chmod.1 chown.1 cksum.1 comm.1 \ - cp.1 csplit.1 cut.1 date.1 dd.1 df.1 dir.1 dircolors.1 dirname.1 du.1 \ - echo.1 env.1 expand.1 expr.1 factor.1 false.1 fmt.1 fold.1 groups.1 \ - head.1 hostname.1 id.1 install.1 join.1 kill.1 \ - link.1 ln.1 logname.1 \ - ls.1 md5sum.1 mkdir.1 mkfifo.1 mknod.1 mv.1 nl.1 nohup.1 od.1 \ - paste.1 pathchk.1 pr.1 printenv.1 printf.1 ptx.1 pwd.1 readlink.1 \ - rm.1 rmdir.1 seq.1 sha1sum.1 sha224sum.1 sha256sum.1 sha384sum.1 sha512sum.1 \ - shred.1 shuf.1 sleep.1 sort.1 split.1 stat.1 \ - su.1 sum.1 sync.1 tac.1 tail.1 tee.1 test.1 touch.1 tr.1 true.1 tsort.1 \ - tty.1 unexpand.1 uniq.1 unlink.1 vdir.1 wc.1 \ - whoami.1 yes.1 $(MAN) -optional_mans = \ - chroot.1 hostid.1 nice.1 pinky.1 stty.1 uname.1 uptime.1 users.1 who.1 +dist_man1_MANS = $(MAN) +man_aux = $(dist_man1_MANS:.1=.x) -man_aux = $(dist_man_MANS:.1=.x) $(optional_mans:.1=.x) +EXTRA_DIST = $(man_aux) $(NO_INSTALL_PROGS_DEFAULT:%=%.x) help2man +MAINTAINERCLEANFILES = $(dist_man1_MANS) -EXTRA_DIST = $(man_aux) help2man $(optional_mans) -MAINTAINERCLEANFILES = $(dist_man_MANS) +# Depend on ../.version to get version number changes. +common_dep = ../.version -# Depend on configure.ac to get version number changes. -common_dep = $(top_srcdir)/configure.ac +# Note that arch depends on uname.c +arch.1: $(common_dep) $(srcdir)/arch.x ../src/uname.c base64.1: $(common_dep) $(srcdir)/base64.x ../src/base64.c basename.1: $(common_dep) $(srcdir)/basename.x ../src/basename.c cat.1: $(common_dep) $(srcdir)/cat.x ../src/cat.c +chcon.1: $(common_dep) $(srcdir)/chcon.x ../src/chcon.c chgrp.1: $(common_dep) $(srcdir)/chgrp.x ../src/chgrp.c chmod.1: $(common_dep) $(srcdir)/chmod.x ../src/chmod.c chown.1: $(common_dep) $(srcdir)/chown.x ../src/chown.c @@ -72,7 +59,7 @@ factor.1: $(common_dep) $(srcdir)/factor.x ../src/factor.c false.1: $(common_dep) $(srcdir)/false.x ../src/false.c fmt.1: $(common_dep) $(srcdir)/fmt.x ../src/fmt.c fold.1: $(common_dep) $(srcdir)/fold.x ../src/fold.c -groups.1: $(common_dep) $(srcdir)/groups.x ../src/groups.sh +groups.1: $(common_dep) $(srcdir)/groups.x ../src/groups.c head.1: $(common_dep) $(srcdir)/head.x ../src/head.c hostid.1: $(common_dep) $(srcdir)/hostid.x ../src/hostid.c hostname.1: $(common_dep) $(srcdir)/hostname.x ../src/hostname.c @@ -88,6 +75,7 @@ md5sum.1: $(common_dep) $(srcdir)/md5sum.x ../src/md5sum.c mkdir.1: $(common_dep) $(srcdir)/mkdir.x ../src/mkdir.c mkfifo.1: $(common_dep) $(srcdir)/mkfifo.x ../src/mkfifo.c mknod.1: $(common_dep) $(srcdir)/mknod.x ../src/mknod.c +mktemp.1: $(common_dep) $(srcdir)/mktemp.x ../src/mktemp.c mv.1: $(common_dep) $(srcdir)/mv.x ../src/mv.c nice.1: $(common_dep) $(srcdir)/nice.x ../src/nice.c nl.1: $(common_dep) $(srcdir)/nl.x ../src/nl.c @@ -104,6 +92,7 @@ pwd.1: $(common_dep) $(srcdir)/pwd.x ../src/pwd.c readlink.1: $(common_dep) $(srcdir)/readlink.x ../src/readlink.c rm.1: $(common_dep) $(srcdir)/rm.x ../src/rm.c rmdir.1: $(common_dep) $(srcdir)/rmdir.x ../src/rmdir.c +runcon.1: $(common_dep) $(srcdir)/runcon.x ../src/runcon.c seq.1: $(common_dep) $(srcdir)/seq.x ../src/seq.c sha1sum.1: $(common_dep) $(srcdir)/sha1sum.x ../src/md5sum.c sha224sum.1: $(common_dep) $(srcdir)/sha224sum.x ../src/md5sum.c @@ -124,9 +113,11 @@ tac.1: $(common_dep) $(srcdir)/tac.x ../src/tac.c tail.1: $(common_dep) $(srcdir)/tail.x ../src/tail.c tee.1: $(common_dep) $(srcdir)/tee.x ../src/tee.c test.1: $(common_dep) $(srcdir)/test.x ../src/test.c +timeout.1: $(common_dep) $(srcdir)/timeout.x ../src/timeout.c touch.1: $(common_dep) $(srcdir)/touch.x ../src/touch.c tr.1: $(common_dep) $(srcdir)/tr.x ../src/tr.c true.1: $(common_dep) $(srcdir)/true.x ../src/true.c +truncate.1: $(common_dep) $(srcdir)/truncate.x ../src/truncate.c tsort.1: $(common_dep) $(srcdir)/tsort.x ../src/tsort.c tty.1: $(common_dep) $(srcdir)/tty.x ../src/tty.c uname.1: $(common_dep) $(srcdir)/uname.x ../src/uname.c @@ -141,13 +132,17 @@ who.1: $(common_dep) $(srcdir)/who.x ../src/who.c whoami.1: $(common_dep) $(srcdir)/whoami.x ../src/whoami.c yes.1: $(common_dep) $(srcdir)/yes.x ../src/yes.c +# This is required so that changes to e.g., emit_bug_reporting_address +# provoke regeneration of all $(MAN) files. +$(MAN): $(top_srcdir)/src/system.h + SUFFIXES = .x .1 # Ensure that help2man runs the ../src/ginstall binary as # `install' when creating install.1. # Similarly, ensure that it uses the ../src/[ binary to create test.1. t = $*.td -mapped_name = `echo $*|sed 's/install/ginstall/; s/test/[/'` +mapped_name = `echo $*|sed 's/^install$$/ginstall/; s/^test$$/[/'` # Note the use of $t/$*, rather than just `$*' as in other packages. # That is necessary to avoid failures for programs that are also shell built-in @@ -161,20 +156,19 @@ mapped_name = `echo $*|sed 's/install/ginstall/; s/test/[/'` *) \ rm -f $@ \ && { echo "Updating man page $@"; \ - rm -rf $t; \ - mkdir $t; \ - (cd $t && $(LN_S) ../../src/$(mapped_name) $*); \ - $(PERL) -- $(srcdir)/help2man \ - --source='$(PACKAGE_STRING)' \ - --include=$(srcdir)/$*.x \ - --output=$t/$@ $t/$*; \ + rm -rf $t; \ + mkdir $t; \ + (cd $t && $(LN_S) ../../src/$(mapped_name) $*); \ + $(PERL) -- $(srcdir)/help2man \ + --source='$(PACKAGE_STRING)' \ + --include=$(srcdir)/$*.x \ + --output=$t/$@ $t/$*; \ } \ && sed 's|$*\.td/||g' $t/$@ > $@ \ - && chmod a-w $@ \ && rm -rf $t ;; \ esac -check-local: check-x-vs-1 check-programs-vs-x +distcheck-hook: check-x-vs-1 check-programs-vs-x # Sort in traditional ASCII order, regardless of the current locale; # otherwise we may get into trouble with distinct strings that the @@ -182,14 +176,17 @@ check-local: check-x-vs-1 check-programs-vs-x ASSORT = LC_ALL=C sort # Ensure that for each .x file in this directory, there is a -# corresponding .1 file in the definition of $(dist_man_MANS) above. +# corresponding .1 file in the definition of $(dist_man1_MANS) above. +# But since that expansion usually lacks programs like su and arch, +# add them here manually. .PHONY: check-x-vs-1 check-x-vs-1: PATH=../src$(PATH_SEPARATOR)$$PATH; export PATH; \ t=ls-files.$$$$; \ (cd $(srcdir) && ls -1 *.x) | sed 's/\.x$$//' | $(ASSORT) > $$t;\ - echo $(dist_man_MANS) | tr -s ' ' '\n' | sed 's/\.1$$//' \ - | $(ASSORT) | diff - $$t || { rm $$t; exit 1; }; \ + (echo $(dist_man1_MANS) $(NO_INSTALL_PROGS_DEFAULT) \ + | tr -s ' ' '\n' | sed 's/\.1$$//') \ + | $(ASSORT) -u | diff - $$t || { rm $$t; exit 1; }; \ rm $$t all_programs = \ diff --git a/src/bin/coreutils/man/Makefile.in b/src/bin/coreutils/man/Makefile.in index f75b88b150..352c15d3cb 100644 --- a/src/bin/coreutils/man/Makefile.in +++ b/src/bin/coreutils/man/Makefile.in @@ -1,8 +1,9 @@ -# Makefile.in generated by automake 1.10 from Makefile.am. +# Makefile.in generated by automake 1.10c from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -16,11 +17,11 @@ # Make coreutils man pages. -*-Makefile-*- -# Copyright (C) 2002-2007 Free Software Foundation, Inc. +# Copyright (C) 2002-2009 Free Software Foundation, Inc. -# This program is free software; you can redistribute it and/or modify +# This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or +# the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # This program is distributed in the hope that it will be useful, @@ -29,13 +30,12 @@ # GNU General Public License for more details. # You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -# 02110-1301, USA. +# along with this program. If not, see . VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c @@ -51,40 +51,48 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = man -DIST_COMMON = $(dist_man_MANS) $(srcdir)/Makefile.am \ +DIST_COMMON = $(dist_man1_MANS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/absolute-header.m4 \ +am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \ $(top_srcdir)/m4/acl.m4 $(top_srcdir)/m4/alloca.m4 \ - $(top_srcdir)/m4/allocsa.m4 $(top_srcdir)/m4/argmatch.m4 \ - $(top_srcdir)/m4/arpa_inet_h.m4 $(top_srcdir)/m4/assert.m4 \ - $(top_srcdir)/m4/atexit.m4 $(top_srcdir)/m4/autobuild.m4 \ - $(top_srcdir)/m4/backupfile.m4 $(top_srcdir)/m4/base64.m4 \ - $(top_srcdir)/m4/bison.m4 $(top_srcdir)/m4/boottime.m4 \ + $(top_srcdir)/m4/argmatch.m4 $(top_srcdir)/m4/arpa_inet_h.m4 \ + $(top_srcdir)/m4/assert.m4 $(top_srcdir)/m4/atexit.m4 \ + $(top_srcdir)/m4/autobuild.m4 $(top_srcdir)/m4/backupfile.m4 \ + $(top_srcdir)/m4/base64.m4 $(top_srcdir)/m4/bison.m4 \ + $(top_srcdir)/m4/boottime.m4 $(top_srcdir)/m4/btowc.m4 \ $(top_srcdir)/m4/c-strtod.m4 $(top_srcdir)/m4/calloc.m4 \ $(top_srcdir)/m4/canon-host.m4 \ $(top_srcdir)/m4/canonicalize.m4 \ $(top_srcdir)/m4/chdir-long.m4 $(top_srcdir)/m4/check-decl.m4 \ $(top_srcdir)/m4/chown.m4 $(top_srcdir)/m4/clock_time.m4 \ $(top_srcdir)/m4/cloexec.m4 $(top_srcdir)/m4/close-stream.m4 \ + $(top_srcdir)/m4/close.m4 $(top_srcdir)/m4/closein.m4 \ $(top_srcdir)/m4/closeout.m4 $(top_srcdir)/m4/codeset.m4 \ $(top_srcdir)/m4/config-h.m4 $(top_srcdir)/m4/cycle-check.m4 \ $(top_srcdir)/m4/d-ino.m4 $(top_srcdir)/m4/d-type.m4 \ - $(top_srcdir)/m4/dirfd.m4 $(top_srcdir)/m4/dirname.m4 \ - $(top_srcdir)/m4/dos.m4 $(top_srcdir)/m4/double-slash-root.m4 \ - $(top_srcdir)/m4/dup2.m4 $(top_srcdir)/m4/eealloc.m4 \ - $(top_srcdir)/m4/eoverflow.m4 $(top_srcdir)/m4/error.m4 \ + $(top_srcdir)/m4/dirent_h.m4 $(top_srcdir)/m4/dirfd.m4 \ + $(top_srcdir)/m4/dirname.m4 $(top_srcdir)/m4/dos.m4 \ + $(top_srcdir)/m4/double-slash-root.m4 $(top_srcdir)/m4/dup2.m4 \ + $(top_srcdir)/m4/eealloc.m4 $(top_srcdir)/m4/environ.m4 \ + $(top_srcdir)/m4/errno_h.m4 $(top_srcdir)/m4/error.m4 \ $(top_srcdir)/m4/euidaccess-stat.m4 \ $(top_srcdir)/m4/euidaccess.m4 $(top_srcdir)/m4/exclude.m4 \ - $(top_srcdir)/m4/exitfail.m4 $(top_srcdir)/m4/extensions.m4 \ - $(top_srcdir)/m4/fchdir.m4 $(top_srcdir)/m4/fcntl-safer.m4 \ + $(top_srcdir)/m4/exitfail.m4 $(top_srcdir)/m4/exponentd.m4 \ + $(top_srcdir)/m4/exponentf.m4 $(top_srcdir)/m4/exponentl.m4 \ + $(top_srcdir)/m4/extensions.m4 $(top_srcdir)/m4/fchdir.m4 \ + $(top_srcdir)/m4/fclose.m4 $(top_srcdir)/m4/fcntl-safer.m4 \ $(top_srcdir)/m4/fcntl_h.m4 $(top_srcdir)/m4/fd-reopen.m4 \ - $(top_srcdir)/m4/file-type.m4 $(top_srcdir)/m4/fileblocks.m4 \ - $(top_srcdir)/m4/filemode.m4 $(top_srcdir)/m4/filenamecat.m4 \ - $(top_srcdir)/m4/flexmember.m4 $(top_srcdir)/m4/fnmatch.m4 \ - $(top_srcdir)/m4/fpending.m4 $(top_srcdir)/m4/fprintftime.m4 \ - $(top_srcdir)/m4/free.m4 $(top_srcdir)/m4/fstypename.m4 \ - $(top_srcdir)/m4/fsusage.m4 $(top_srcdir)/m4/ftruncate.m4 \ + $(top_srcdir)/m4/fflush.m4 $(top_srcdir)/m4/file-type.m4 \ + $(top_srcdir)/m4/fileblocks.m4 $(top_srcdir)/m4/filemode.m4 \ + $(top_srcdir)/m4/filenamecat.m4 $(top_srcdir)/m4/flexmember.m4 \ + $(top_srcdir)/m4/float_h.m4 $(top_srcdir)/m4/fnmatch.m4 \ + $(top_srcdir)/m4/fpending.m4 $(top_srcdir)/m4/fpieee.m4 \ + $(top_srcdir)/m4/fprintftime.m4 $(top_srcdir)/m4/fpurge.m4 \ + $(top_srcdir)/m4/freading.m4 $(top_srcdir)/m4/frexp.m4 \ + $(top_srcdir)/m4/frexpl.m4 $(top_srcdir)/m4/fseeko.m4 \ + $(top_srcdir)/m4/fstypename.m4 $(top_srcdir)/m4/fsusage.m4 \ + $(top_srcdir)/m4/ftello.m4 $(top_srcdir)/m4/ftruncate.m4 \ $(top_srcdir)/m4/fts.m4 $(top_srcdir)/m4/getaddrinfo.m4 \ $(top_srcdir)/m4/getcwd-abort-bug.m4 \ $(top_srcdir)/m4/getcwd-path-max.m4 $(top_srcdir)/m4/getcwd.m4 \ @@ -97,49 +105,65 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/absolute-header.m4 \ $(top_srcdir)/m4/gettime.m4 $(top_srcdir)/m4/gettimeofday.m4 \ $(top_srcdir)/m4/getugroups.m4 \ $(top_srcdir)/m4/getusershell.m4 $(top_srcdir)/m4/glibc21.m4 \ + $(top_srcdir)/m4/gmp.m4 $(top_srcdir)/m4/gnu-make.m4 \ $(top_srcdir)/m4/gnulib-common.m4 \ $(top_srcdir)/m4/gnulib-comp.m4 \ $(top_srcdir)/m4/group-member.m4 \ $(top_srcdir)/m4/hard-locale.m4 $(top_srcdir)/m4/hash.m4 \ - $(top_srcdir)/m4/host-os.m4 $(top_srcdir)/m4/human.m4 \ - $(top_srcdir)/m4/i-ring.m4 $(top_srcdir)/m4/iconv.m4 \ - $(top_srcdir)/m4/idcache.m4 $(top_srcdir)/m4/inet_ntop.m4 \ - $(top_srcdir)/m4/inline.m4 $(top_srcdir)/m4/intmax_t.m4 \ + $(top_srcdir)/m4/host-os.m4 $(top_srcdir)/m4/hostent.m4 \ + $(top_srcdir)/m4/human.m4 $(top_srcdir)/m4/i-ring.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/iconv_h.m4 \ + $(top_srcdir)/m4/iconv_open.m4 $(top_srcdir)/m4/idcache.m4 \ + $(top_srcdir)/m4/include-exclude-prog.m4 \ + $(top_srcdir)/m4/include_next.m4 $(top_srcdir)/m4/inet_ntop.m4 \ + $(top_srcdir)/m4/inet_pton.m4 $(top_srcdir)/m4/inline.m4 \ + $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/intmax_t.m4 \ $(top_srcdir)/m4/inttostr.m4 $(top_srcdir)/m4/inttypes-pri.m4 \ $(top_srcdir)/m4/inttypes.m4 $(top_srcdir)/m4/inttypes_h.m4 \ - $(top_srcdir)/m4/isapipe.m4 $(top_srcdir)/m4/jm-macros.m4 \ - $(top_srcdir)/m4/jm-winsz1.m4 $(top_srcdir)/m4/jm-winsz2.m4 \ - $(top_srcdir)/m4/lchmod.m4 $(top_srcdir)/m4/lchown.m4 \ + $(top_srcdir)/m4/isapipe.m4 $(top_srcdir)/m4/isnand.m4 \ + $(top_srcdir)/m4/isnanf.m4 $(top_srcdir)/m4/isnanl.m4 \ + $(top_srcdir)/m4/jm-macros.m4 $(top_srcdir)/m4/jm-winsz1.m4 \ + $(top_srcdir)/m4/jm-winsz2.m4 $(top_srcdir)/m4/lchmod.m4 \ + $(top_srcdir)/m4/lchown.m4 $(top_srcdir)/m4/ldexpl.m4 \ $(top_srcdir)/m4/lib-check.m4 $(top_srcdir)/m4/lib-ignore.m4 \ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/link-follow.m4 \ - $(top_srcdir)/m4/localcharset.m4 \ - $(top_srcdir)/m4/long-options.m4 \ - $(top_srcdir)/m4/longdouble.m4 $(top_srcdir)/m4/longlong.m4 \ - $(top_srcdir)/m4/ls-mntd-fs.m4 $(top_srcdir)/m4/lstat.m4 \ + $(top_srcdir)/m4/localcharset.m4 $(top_srcdir)/m4/locale-fr.m4 \ + $(top_srcdir)/m4/locale-ja.m4 $(top_srcdir)/m4/locale-tr.m4 \ + $(top_srcdir)/m4/locale-zh.m4 $(top_srcdir)/m4/long-options.m4 \ + $(top_srcdir)/m4/longlong.m4 $(top_srcdir)/m4/ls-mntd-fs.m4 \ + $(top_srcdir)/m4/lseek.m4 $(top_srcdir)/m4/lstat.m4 \ + $(top_srcdir)/m4/malloc.m4 $(top_srcdir)/m4/malloca.m4 \ + $(top_srcdir)/m4/manywarnings.m4 $(top_srcdir)/m4/math_h.m4 \ $(top_srcdir)/m4/mbchar.m4 $(top_srcdir)/m4/mbiter.m4 \ - $(top_srcdir)/m4/mbrtowc.m4 $(top_srcdir)/m4/mbscasecmp.m4 \ + $(top_srcdir)/m4/mbrlen.m4 $(top_srcdir)/m4/mbrtowc.m4 \ + $(top_srcdir)/m4/mbsinit.m4 $(top_srcdir)/m4/mbsrtowcs.m4 \ $(top_srcdir)/m4/mbstate_t.m4 $(top_srcdir)/m4/mbswidth.m4 \ $(top_srcdir)/m4/md5.m4 $(top_srcdir)/m4/memcasecmp.m4 \ $(top_srcdir)/m4/memchr.m4 $(top_srcdir)/m4/memcmp.m4 \ $(top_srcdir)/m4/memcoll.m4 $(top_srcdir)/m4/memcpy.m4 \ $(top_srcdir)/m4/memmove.m4 $(top_srcdir)/m4/mempcpy.m4 \ $(top_srcdir)/m4/memrchr.m4 $(top_srcdir)/m4/memset.m4 \ - $(top_srcdir)/m4/memxfrm.m4 $(top_srcdir)/m4/mkancesdirs.m4 \ - $(top_srcdir)/m4/mkdir-p.m4 $(top_srcdir)/m4/mkdir-slash.m4 \ - $(top_srcdir)/m4/mkstemp.m4 $(top_srcdir)/m4/mktime.m4 \ - $(top_srcdir)/m4/modechange.m4 $(top_srcdir)/m4/mountlist.m4 \ - $(top_srcdir)/m4/mpsort.m4 $(top_srcdir)/m4/nanosleep.m4 \ - $(top_srcdir)/m4/netinet_in_h.m4 $(top_srcdir)/m4/nls.m4 \ - $(top_srcdir)/m4/openat.m4 $(top_srcdir)/m4/pathmax.m4 \ - $(top_srcdir)/m4/perl.m4 $(top_srcdir)/m4/physmem.m4 \ - $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/posixtm.m4 \ - $(top_srcdir)/m4/posixver.m4 $(top_srcdir)/m4/prereq.m4 \ - $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/putenv.m4 \ - $(top_srcdir)/m4/quote.m4 $(top_srcdir)/m4/quotearg.m4 \ - $(top_srcdir)/m4/randint.m4 $(top_srcdir)/m4/randperm.m4 \ - $(top_srcdir)/m4/randread.m4 $(top_srcdir)/m4/readlink.m4 \ - $(top_srcdir)/m4/readtokens.m4 $(top_srcdir)/m4/readutmp.m4 \ + $(top_srcdir)/m4/memxfrm.m4 $(top_srcdir)/m4/mgetgroups.m4 \ + $(top_srcdir)/m4/mkancesdirs.m4 $(top_srcdir)/m4/mkdir-p.m4 \ + $(top_srcdir)/m4/mkdir-slash.m4 $(top_srcdir)/m4/mkstemp.m4 \ + $(top_srcdir)/m4/mktime.m4 $(top_srcdir)/m4/modechange.m4 \ + $(top_srcdir)/m4/mountlist.m4 $(top_srcdir)/m4/mpsort.m4 \ + $(top_srcdir)/m4/multiarch.m4 $(top_srcdir)/m4/nanosleep.m4 \ + $(top_srcdir)/m4/netdb_h.m4 $(top_srcdir)/m4/netinet_in_h.m4 \ + $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/nocrash.m4 \ + $(top_srcdir)/m4/open.m4 $(top_srcdir)/m4/openat.m4 \ + $(top_srcdir)/m4/pathmax.m4 $(top_srcdir)/m4/perl.m4 \ + $(top_srcdir)/m4/perror.m4 $(top_srcdir)/m4/physmem.m4 \ + $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/posix-shell.m4 \ + $(top_srcdir)/m4/posixtm.m4 $(top_srcdir)/m4/posixver.m4 \ + $(top_srcdir)/m4/prereq.m4 $(top_srcdir)/m4/printf-frexp.m4 \ + $(top_srcdir)/m4/printf-frexpl.m4 $(top_srcdir)/m4/printf.m4 \ + $(top_srcdir)/m4/priv-set.m4 $(top_srcdir)/m4/progtest.m4 \ + $(top_srcdir)/m4/putenv.m4 $(top_srcdir)/m4/quote.m4 \ + $(top_srcdir)/m4/quotearg.m4 $(top_srcdir)/m4/read-file.m4 \ + $(top_srcdir)/m4/readlink.m4 $(top_srcdir)/m4/readtokens.m4 \ + $(top_srcdir)/m4/readutmp.m4 $(top_srcdir)/m4/realloc.m4 \ $(top_srcdir)/m4/regex.m4 \ $(top_srcdir)/m4/rename-dest-slash.m4 \ $(top_srcdir)/m4/rename.m4 $(top_srcdir)/m4/rmdir-errno.m4 \ @@ -147,10 +171,17 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/absolute-header.m4 \ $(top_srcdir)/m4/rpmatch.m4 $(top_srcdir)/m4/safe-read.m4 \ $(top_srcdir)/m4/safe-write.m4 $(top_srcdir)/m4/same.m4 \ $(top_srcdir)/m4/save-cwd.m4 $(top_srcdir)/m4/savedir.m4 \ - $(top_srcdir)/m4/savewd.m4 $(top_srcdir)/m4/setenv.m4 \ + $(top_srcdir)/m4/savewd.m4 $(top_srcdir)/m4/select.m4 \ + $(top_srcdir)/m4/selinux-context-h.m4 \ + $(top_srcdir)/m4/selinux-selinux-h.m4 \ + $(top_srcdir)/m4/servent.m4 $(top_srcdir)/m4/setenv.m4 \ $(top_srcdir)/m4/settime.m4 $(top_srcdir)/m4/sha1.m4 \ $(top_srcdir)/m4/sha256.m4 $(top_srcdir)/m4/sha512.m4 \ - $(top_srcdir)/m4/sig2str.m4 $(top_srcdir)/m4/snprintf.m4 \ + $(top_srcdir)/m4/sig2str.m4 $(top_srcdir)/m4/sigaction.m4 \ + $(top_srcdir)/m4/signal_h.m4 \ + $(top_srcdir)/m4/signalblocking.m4 $(top_srcdir)/m4/signbit.m4 \ + $(top_srcdir)/m4/size_max.m4 $(top_srcdir)/m4/sleep.m4 \ + $(top_srcdir)/m4/snprintf.m4 $(top_srcdir)/m4/sockets.m4 \ $(top_srcdir)/m4/socklen.m4 $(top_srcdir)/m4/sockpfaf.m4 \ $(top_srcdir)/m4/ssize_t.m4 $(top_srcdir)/m4/st_dm_mode.m4 \ $(top_srcdir)/m4/stat-prog.m4 $(top_srcdir)/m4/stat-time.m4 \ @@ -158,66 +189,90 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/absolute-header.m4 \ $(top_srcdir)/m4/stdint.m4 $(top_srcdir)/m4/stdint_h.m4 \ $(top_srcdir)/m4/stdio-safer.m4 $(top_srcdir)/m4/stdio_h.m4 \ $(top_srcdir)/m4/stdlib-safer.m4 $(top_srcdir)/m4/stdlib_h.m4 \ - $(top_srcdir)/m4/stpcpy.m4 $(top_srcdir)/m4/strcspn.m4 \ - $(top_srcdir)/m4/strdup.m4 $(top_srcdir)/m4/strftime.m4 \ + $(top_srcdir)/m4/stpcpy.m4 $(top_srcdir)/m4/stpncpy.m4 \ + $(top_srcdir)/m4/strcspn.m4 $(top_srcdir)/m4/strdup.m4 \ + $(top_srcdir)/m4/strerror.m4 $(top_srcdir)/m4/strftime.m4 \ $(top_srcdir)/m4/string_h.m4 $(top_srcdir)/m4/strndup.m4 \ $(top_srcdir)/m4/strnlen.m4 $(top_srcdir)/m4/strnumcmp.m4 \ $(top_srcdir)/m4/strpbrk.m4 $(top_srcdir)/m4/strtod.m4 \ $(top_srcdir)/m4/strtoimax.m4 $(top_srcdir)/m4/strtol.m4 \ $(top_srcdir)/m4/strtoll.m4 $(top_srcdir)/m4/strtoul.m4 \ $(top_srcdir)/m4/strtoull.m4 $(top_srcdir)/m4/strtoumax.m4 \ - $(top_srcdir)/m4/strverscmp.m4 \ + $(top_srcdir)/m4/strverscmp.m4 $(top_srcdir)/m4/sys_ioctl_h.m4 \ + $(top_srcdir)/m4/sys_select_h.m4 \ $(top_srcdir)/m4/sys_socket_h.m4 \ $(top_srcdir)/m4/sys_stat_h.m4 $(top_srcdir)/m4/sys_time_h.m4 \ $(top_srcdir)/m4/tempname.m4 $(top_srcdir)/m4/time_h.m4 \ $(top_srcdir)/m4/time_r.m4 $(top_srcdir)/m4/timespec.m4 \ $(top_srcdir)/m4/tm_gmtoff.m4 $(top_srcdir)/m4/tzset.m4 \ - $(top_srcdir)/m4/unicodeio.m4 $(top_srcdir)/m4/unistd-safer.m4 \ - $(top_srcdir)/m4/unistd_h.m4 $(top_srcdir)/m4/unlink-busy.m4 \ - $(top_srcdir)/m4/unlinkdir.m4 $(top_srcdir)/m4/unlocked-io.m4 \ - $(top_srcdir)/m4/uptime.m4 $(top_srcdir)/m4/userspec.m4 \ - $(top_srcdir)/m4/utimbuf.m4 $(top_srcdir)/m4/utime.m4 \ + $(top_srcdir)/m4/ungetc.m4 $(top_srcdir)/m4/unicodeio.m4 \ + $(top_srcdir)/m4/unistd-safer.m4 $(top_srcdir)/m4/unistd_h.m4 \ + $(top_srcdir)/m4/unlink-busy.m4 $(top_srcdir)/m4/unlinkdir.m4 \ + $(top_srcdir)/m4/unlocked-io.m4 $(top_srcdir)/m4/uptime.m4 \ + $(top_srcdir)/m4/userspec.m4 $(top_srcdir)/m4/utimbuf.m4 \ $(top_srcdir)/m4/utimecmp.m4 $(top_srcdir)/m4/utimens.m4 \ - $(top_srcdir)/m4/utimes-null.m4 $(top_srcdir)/m4/utimes.m4 \ - $(top_srcdir)/m4/vasnprintf.m4 $(top_srcdir)/m4/vasprintf.m4 \ + $(top_srcdir)/m4/utimes.m4 $(top_srcdir)/m4/vasnprintf.m4 \ + $(top_srcdir)/m4/vasprintf-posix.m4 \ + $(top_srcdir)/m4/vasprintf.m4 \ + $(top_srcdir)/m4/vfprintf-posix.m4 \ + $(top_srcdir)/m4/vprintf-posix.m4 $(top_srcdir)/m4/warnings.m4 \ $(top_srcdir)/m4/wchar.m4 $(top_srcdir)/m4/wchar_t.m4 \ + $(top_srcdir)/m4/wcrtomb.m4 $(top_srcdir)/m4/wctob.m4 \ $(top_srcdir)/m4/wctype.m4 $(top_srcdir)/m4/wcwidth.m4 \ - $(top_srcdir)/m4/wint_t.m4 $(top_srcdir)/m4/xalloc.m4 \ - $(top_srcdir)/m4/xfts.m4 $(top_srcdir)/m4/xgetcwd.m4 \ - $(top_srcdir)/m4/xnanosleep.m4 $(top_srcdir)/m4/xstrndup.m4 \ + $(top_srcdir)/m4/wint_t.m4 $(top_srcdir)/m4/write-any-file.m4 \ + $(top_srcdir)/m4/write.m4 $(top_srcdir)/m4/xalloc.m4 \ + $(top_srcdir)/m4/xattr.m4 $(top_srcdir)/m4/xfts.m4 \ + $(top_srcdir)/m4/xgetcwd.m4 $(top_srcdir)/m4/xnanosleep.m4 \ + $(top_srcdir)/m4/xsize.m4 $(top_srcdir)/m4/xstrndup.m4 \ $(top_srcdir)/m4/xstrtod.m4 $(top_srcdir)/m4/xstrtol.m4 \ - $(top_srcdir)/m4/yesno.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/xvasprintf.m4 $(top_srcdir)/m4/yesno.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/lib/config.h CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) +am__v_GEN_0 = @echo " GEN " $@; +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) +am__v_at_0 = @ SOURCES = DIST_SOURCES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' man1dir = $(mandir)/man1 am__installdirs = "$(DESTDIR)$(man1dir)" NROFF = nroff -MANS = $(dist_man_MANS) +MANS = $(dist_man1_MANS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ABSOLUTE_DIRENT_H = @ABSOLUTE_DIRENT_H@ -ABSOLUTE_FCNTL_H = @ABSOLUTE_FCNTL_H@ -ABSOLUTE_INTTYPES_H = @ABSOLUTE_INTTYPES_H@ -ABSOLUTE_NETINET_IN_H = @ABSOLUTE_NETINET_IN_H@ -ABSOLUTE_STDINT_H = @ABSOLUTE_STDINT_H@ -ABSOLUTE_STDIO_H = @ABSOLUTE_STDIO_H@ -ABSOLUTE_STDLIB_H = @ABSOLUTE_STDLIB_H@ -ABSOLUTE_STRING_H = @ABSOLUTE_STRING_H@ -ABSOLUTE_SYS_SOCKET_H = @ABSOLUTE_SYS_SOCKET_H@ -ABSOLUTE_SYS_STAT_H = @ABSOLUTE_SYS_STAT_H@ -ABSOLUTE_SYS_TIME_H = @ABSOLUTE_SYS_TIME_H@ -ABSOLUTE_TIME_H = @ABSOLUTE_TIME_H@ -ABSOLUTE_UNISTD_H = @ABSOLUTE_UNISTD_H@ -ABSOLUTE_WCHAR_H = @ABSOLUTE_WCHAR_H@ -ABSOLUTE_WCTYPE_H = @ABSOLUTE_WCTYPE_H@ ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ ALLOCA_H = @ALLOCA_H@ AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@ ARPA_INET_H = @ARPA_INET_H@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -231,46 +286,122 @@ BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ +CONFIG_STATUS_DEPENDENCIES = @CONFIG_STATUS_DEPENDENCIES@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFAULT_POSIX2_VERSION = @DEFAULT_POSIX2_VERSION@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DF_PROG = @DF_PROG@ DIRENT_H = @DIRENT_H@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -EOVERFLOW = @EOVERFLOW@ +EMULTIHOP_HIDDEN = @EMULTIHOP_HIDDEN@ +EMULTIHOP_VALUE = @EMULTIHOP_VALUE@ +ENOLINK_HIDDEN = @ENOLINK_HIDDEN@ +ENOLINK_VALUE = @ENOLINK_VALUE@ +EOVERFLOW_HIDDEN = @EOVERFLOW_HIDDEN@ +EOVERFLOW_VALUE = @EOVERFLOW_VALUE@ +ERRNO_H = @ERRNO_H@ EXEEXT = @EXEEXT@ FCNTL_H = @FCNTL_H@ +FLOAT_H = @FLOAT_H@ FNMATCH_H = @FNMATCH_H@ +GETADDRINFO_LIB = @GETADDRINFO_LIB@ GETLOADAVG_LIBS = @GETLOADAVG_LIBS@ GETOPT_H = @GETOPT_H@ +GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GLIBC21 = @GLIBC21@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ +GNULIB_ACCEPT = @GNULIB_ACCEPT@ +GNULIB_ALPHASORT = @GNULIB_ALPHASORT@ +GNULIB_ATOLL = @GNULIB_ATOLL@ +GNULIB_BIND = @GNULIB_BIND@ +GNULIB_BTOWC = @GNULIB_BTOWC@ +GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@ +GNULIB_CEILF = @GNULIB_CEILF@ +GNULIB_CEILL = @GNULIB_CEILL@ GNULIB_CHOWN = @GNULIB_CHOWN@ +GNULIB_CLOSE = @GNULIB_CLOSE@ +GNULIB_CONNECT = @GNULIB_CONNECT@ +GNULIB_DIRFD = @GNULIB_DIRFD@ +GNULIB_DPRINTF = @GNULIB_DPRINTF@ GNULIB_DUP2 = @GNULIB_DUP2@ +GNULIB_ENVIRON = @GNULIB_ENVIRON@ +GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@ GNULIB_FCHDIR = @GNULIB_FCHDIR@ +GNULIB_FCLOSE = @GNULIB_FCLOSE@ +GNULIB_FFLUSH = @GNULIB_FFLUSH@ +GNULIB_FLOORF = @GNULIB_FLOORF@ +GNULIB_FLOORL = @GNULIB_FLOORL@ +GNULIB_FOPEN = @GNULIB_FOPEN@ +GNULIB_FPRINTF = @GNULIB_FPRINTF@ GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@ +GNULIB_FPUTC = @GNULIB_FPUTC@ +GNULIB_FPUTS = @GNULIB_FPUTS@ +GNULIB_FREOPEN = @GNULIB_FREOPEN@ +GNULIB_FREXP = @GNULIB_FREXP@ +GNULIB_FREXPL = @GNULIB_FREXPL@ +GNULIB_FSEEK = @GNULIB_FSEEK@ +GNULIB_FSEEKO = @GNULIB_FSEEKO@ +GNULIB_FSYNC = @GNULIB_FSYNC@ +GNULIB_FTELL = @GNULIB_FTELL@ +GNULIB_FTELLO = @GNULIB_FTELLO@ GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@ +GNULIB_FWRITE = @GNULIB_FWRITE@ +GNULIB_GETADDRINFO = @GNULIB_GETADDRINFO@ GNULIB_GETCWD = @GNULIB_GETCWD@ +GNULIB_GETDELIM = @GNULIB_GETDELIM@ +GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@ +GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@ +GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@ +GNULIB_GETLINE = @GNULIB_GETLINE@ +GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@ GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ +GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@ +GNULIB_GETPEERNAME = @GNULIB_GETPEERNAME@ +GNULIB_GETSOCKNAME = @GNULIB_GETSOCKNAME@ +GNULIB_GETSOCKOPT = @GNULIB_GETSOCKOPT@ GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ +GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@ GNULIB_IMAXABS = @GNULIB_IMAXABS@ GNULIB_IMAXDIV = @GNULIB_IMAXDIV@ +GNULIB_INET_NTOP = @GNULIB_INET_NTOP@ +GNULIB_INET_PTON = @GNULIB_INET_PTON@ +GNULIB_IOCTL = @GNULIB_IOCTL@ +GNULIB_ISFINITE = @GNULIB_ISFINITE@ +GNULIB_ISINF = @GNULIB_ISINF@ +GNULIB_ISNAN = @GNULIB_ISNAN@ +GNULIB_ISNAND = @GNULIB_ISNAND@ +GNULIB_ISNANF = @GNULIB_ISNANF@ +GNULIB_ISNANL = @GNULIB_ISNANL@ +GNULIB_LCHMOD = @GNULIB_LCHMOD@ +GNULIB_LCHOWN = @GNULIB_LCHOWN@ +GNULIB_LDEXPL = @GNULIB_LDEXPL@ +GNULIB_LINK = @GNULIB_LINK@ +GNULIB_LISTEN = @GNULIB_LISTEN@ +GNULIB_LSEEK = @GNULIB_LSEEK@ +GNULIB_LSTAT = @GNULIB_LSTAT@ +GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@ +GNULIB_MATHL = @GNULIB_MATHL@ +GNULIB_MBRLEN = @GNULIB_MBRLEN@ +GNULIB_MBRTOWC = @GNULIB_MBRTOWC@ GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@ GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@ GNULIB_MBSCHR = @GNULIB_MBSCHR@ GNULIB_MBSCSPN = @GNULIB_MBSCSPN@ +GNULIB_MBSINIT = @GNULIB_MBSINIT@ GNULIB_MBSLEN = @GNULIB_MBSLEN@ GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@ +GNULIB_MBSNLEN = @GNULIB_MBSNLEN@ +GNULIB_MBSNRTOWCS = @GNULIB_MBSNRTOWCS@ GNULIB_MBSPBRK = @GNULIB_MBSPBRK@ GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@ GNULIB_MBSRCHR = @GNULIB_MBSRCHR@ +GNULIB_MBSRTOWCS = @GNULIB_MBSRTOWCS@ GNULIB_MBSSEP = @GNULIB_MBSSEP@ GNULIB_MBSSPN = @GNULIB_MBSSPN@ GNULIB_MBSSTR = @GNULIB_MBSSTR@ @@ -280,82 +411,230 @@ GNULIB_MEMPCPY = @GNULIB_MEMPCPY@ GNULIB_MEMRCHR = @GNULIB_MEMRCHR@ GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ GNULIB_MKSTEMP = @GNULIB_MKSTEMP@ +GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@ +GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@ +GNULIB_OPEN = @GNULIB_OPEN@ +GNULIB_PERROR = @GNULIB_PERROR@ +GNULIB_PRINTF = @GNULIB_PRINTF@ GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@ +GNULIB_PUTC = @GNULIB_PUTC@ +GNULIB_PUTCHAR = @GNULIB_PUTCHAR@ +GNULIB_PUTENV = @GNULIB_PUTENV@ +GNULIB_PUTS = @GNULIB_PUTS@ +GNULIB_RANDOM_R = @GNULIB_RANDOM_R@ +GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@ GNULIB_READLINK = @GNULIB_READLINK@ +GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@ +GNULIB_RECV = @GNULIB_RECV@ +GNULIB_RECVFROM = @GNULIB_RECVFROM@ +GNULIB_ROUND = @GNULIB_ROUND@ +GNULIB_ROUNDF = @GNULIB_ROUNDF@ +GNULIB_ROUNDL = @GNULIB_ROUNDL@ +GNULIB_RPMATCH = @GNULIB_RPMATCH@ +GNULIB_SCANDIR = @GNULIB_SCANDIR@ +GNULIB_SELECT = @GNULIB_SELECT@ +GNULIB_SEND = @GNULIB_SEND@ +GNULIB_SENDTO = @GNULIB_SENDTO@ +GNULIB_SETENV = @GNULIB_SETENV@ +GNULIB_SETSOCKOPT = @GNULIB_SETSOCKOPT@ +GNULIB_SHUTDOWN = @GNULIB_SHUTDOWN@ +GNULIB_SIGACTION = @GNULIB_SIGACTION@ +GNULIB_SIGNAL_H_SIGPIPE = @GNULIB_SIGNAL_H_SIGPIPE@ +GNULIB_SIGNBIT = @GNULIB_SIGNBIT@ +GNULIB_SIGPROCMASK = @GNULIB_SIGPROCMASK@ +GNULIB_SLEEP = @GNULIB_SLEEP@ GNULIB_SNPRINTF = @GNULIB_SNPRINTF@ +GNULIB_SOCKET = @GNULIB_SOCKET@ GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@ +GNULIB_STDIO_H_SIGPIPE = @GNULIB_STDIO_H_SIGPIPE@ GNULIB_STPCPY = @GNULIB_STPCPY@ GNULIB_STPNCPY = @GNULIB_STPNCPY@ GNULIB_STRCASESTR = @GNULIB_STRCASESTR@ GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@ GNULIB_STRDUP = @GNULIB_STRDUP@ +GNULIB_STRERROR = @GNULIB_STRERROR@ GNULIB_STRNDUP = @GNULIB_STRNDUP@ GNULIB_STRNLEN = @GNULIB_STRNLEN@ GNULIB_STRPBRK = @GNULIB_STRPBRK@ GNULIB_STRSEP = @GNULIB_STRSEP@ +GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@ +GNULIB_STRSTR = @GNULIB_STRSTR@ +GNULIB_STRTOD = @GNULIB_STRTOD@ GNULIB_STRTOIMAX = @GNULIB_STRTOIMAX@ GNULIB_STRTOK_R = @GNULIB_STRTOK_R@ +GNULIB_STRTOLL = @GNULIB_STRTOLL@ +GNULIB_STRTOULL = @GNULIB_STRTOULL@ GNULIB_STRTOUMAX = @GNULIB_STRTOUMAX@ +GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@ +GNULIB_TRUNC = @GNULIB_TRUNC@ +GNULIB_TRUNCF = @GNULIB_TRUNCF@ +GNULIB_TRUNCL = @GNULIB_TRUNCL@ +GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@ +GNULIB_UNSETENV = @GNULIB_UNSETENV@ +GNULIB_VASPRINTF = @GNULIB_VASPRINTF@ +GNULIB_VDPRINTF = @GNULIB_VDPRINTF@ +GNULIB_VFPRINTF = @GNULIB_VFPRINTF@ GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@ +GNULIB_VPRINTF = @GNULIB_VPRINTF@ GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@ GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@ GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@ -GNU_PACKAGE = @GNU_PACKAGE@ +GNULIB_WCRTOMB = @GNULIB_WCRTOMB@ +GNULIB_WCSNRTOMBS = @GNULIB_WCSNRTOMBS@ +GNULIB_WCSRTOMBS = @GNULIB_WCSRTOMBS@ +GNULIB_WCTOB = @GNULIB_WCTOB@ +GNULIB_WCWIDTH = @GNULIB_WCWIDTH@ +GNULIB_WRITE = @GNULIB_WRITE@ GREP = @GREP@ +HAVE_ALPHASORT = @HAVE_ALPHASORT@ +HAVE_ARPA_INET_H = @HAVE_ARPA_INET_H@ +HAVE_ATOLL = @HAVE_ATOLL@ +HAVE_BTOWC = @HAVE_BTOWC@ +HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@ +HAVE_DECL_ACOSL = @HAVE_DECL_ACOSL@ +HAVE_DECL_ASINL = @HAVE_DECL_ASINL@ +HAVE_DECL_ATANL = @HAVE_DECL_ATANL@ +HAVE_DECL_COSL = @HAVE_DECL_COSL@ +HAVE_DECL_DIRFD = @HAVE_DECL_DIRFD@ +HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@ +HAVE_DECL_EXPL = @HAVE_DECL_EXPL@ +HAVE_DECL_FREEADDRINFO = @HAVE_DECL_FREEADDRINFO@ +HAVE_DECL_FREXPL = @HAVE_DECL_FREXPL@ +HAVE_DECL_GAI_STRERROR = @HAVE_DECL_GAI_STRERROR@ +HAVE_DECL_GETADDRINFO = @HAVE_DECL_GETADDRINFO@ +HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@ +HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@ +HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@ HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ +HAVE_DECL_GETNAMEINFO = @HAVE_DECL_GETNAMEINFO@ HAVE_DECL_IMAXABS = @HAVE_DECL_IMAXABS@ HAVE_DECL_IMAXDIV = @HAVE_DECL_IMAXDIV@ +HAVE_DECL_INET_NTOP = @HAVE_DECL_INET_NTOP@ +HAVE_DECL_INET_PTON = @HAVE_DECL_INET_PTON@ +HAVE_DECL_LDEXPL = @HAVE_DECL_LDEXPL@ +HAVE_DECL_LOGL = @HAVE_DECL_LOGL@ HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@ HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@ +HAVE_DECL_OBSTACK_PRINTF = @HAVE_DECL_OBSTACK_PRINTF@ +HAVE_DECL_SINL = @HAVE_DECL_SINL@ HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@ +HAVE_DECL_SQRTL = @HAVE_DECL_SQRTL@ HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@ -HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@ +HAVE_DECL_STRERROR = @HAVE_DECL_STRERROR@ HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@ HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@ +HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@ HAVE_DECL_STRTOIMAX = @HAVE_DECL_STRTOIMAX@ HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@ HAVE_DECL_STRTOUMAX = @HAVE_DECL_STRTOUMAX@ +HAVE_DECL_TANL = @HAVE_DECL_TANL@ +HAVE_DECL_TRUNC = @HAVE_DECL_TRUNC@ +HAVE_DECL_TRUNCF = @HAVE_DECL_TRUNCF@ HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@ +HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@ +HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@ +HAVE_DPRINTF = @HAVE_DPRINTF@ HAVE_DUP2 = @HAVE_DUP2@ +HAVE_EUIDACCESS = @HAVE_EUIDACCESS@ +HAVE_FSEEKO = @HAVE_FSEEKO@ +HAVE_FSYNC = @HAVE_FSYNC@ +HAVE_FTELLO = @HAVE_FTELLO@ HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ +HAVE_GETDOMAINNAME = @HAVE_GETDOMAINNAME@ +HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@ +HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@ +HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@ HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ +HAVE_GETUSERSHELL = @HAVE_GETUSERSHELL@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ +HAVE_ISNAND = @HAVE_ISNAND@ +HAVE_ISNANF = @HAVE_ISNANF@ +HAVE_ISNANL = @HAVE_ISNANL@ +HAVE_ISWCNTRL = @HAVE_ISWCNTRL@ +HAVE_LCHMOD = @HAVE_LCHMOD@ +HAVE_LINK = @HAVE_LINK@ HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ +HAVE_LSTAT = @HAVE_LSTAT@ +HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@ +HAVE_MBRLEN = @HAVE_MBRLEN@ +HAVE_MBRTOWC = @HAVE_MBRTOWC@ +HAVE_MBSINIT = @HAVE_MBSINIT@ +HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@ +HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@ HAVE_MEMPCPY = @HAVE_MEMPCPY@ HAVE_MKDTEMP = @HAVE_MKDTEMP@ +HAVE_NETDB_H = @HAVE_NETDB_H@ HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@ +HAVE_OS_H = @HAVE_OS_H@ +HAVE_POSIX_SIGNALBLOCKING = @HAVE_POSIX_SIGNALBLOCKING@ +HAVE_RANDOM_H = @HAVE_RANDOM_H@ +HAVE_RANDOM_R = @HAVE_RANDOM_R@ +HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@ HAVE_READLINK = @HAVE_READLINK@ +HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@ +HAVE_RPMATCH = @HAVE_RPMATCH@ +HAVE_SCANDIR = @HAVE_SCANDIR@ +HAVE_SETENV = @HAVE_SETENV@ +HAVE_SIGACTION = @HAVE_SIGACTION@ +HAVE_SIGINFO_T = @HAVE_SIGINFO_T@ HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@ HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@ HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@ +HAVE_SIGSET_T = @HAVE_SIGSET_T@ +HAVE_SLEEP = @HAVE_SLEEP@ HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE_STPCPY = @HAVE_STPCPY@ HAVE_STPNCPY = @HAVE_STPNCPY@ -HAVE_STRCASECMP = @HAVE_STRCASECMP@ HAVE_STRCASESTR = @HAVE_STRCASESTR@ HAVE_STRCHRNUL = @HAVE_STRCHRNUL@ HAVE_STRNDUP = @HAVE_STRNDUP@ HAVE_STRPBRK = @HAVE_STRPBRK@ HAVE_STRSEP = @HAVE_STRSEP@ +HAVE_STRTOD = @HAVE_STRTOD@ +HAVE_STRTOLL = @HAVE_STRTOLL@ +HAVE_STRTOULL = @HAVE_STRTOULL@ +HAVE_STRUCT_ADDRINFO = @HAVE_STRUCT_ADDRINFO@ +HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@ +HAVE_STRUCT_SIGACTION_SA_SIGACTION = @HAVE_STRUCT_SIGACTION_SA_SIGACTION@ HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@ +HAVE_STRVERSCMP = @HAVE_STRVERSCMP@ HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@ +HAVE_SYS_IOCTL_H = @HAVE_SYS_IOCTL_H@ +HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@ +HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@ +HAVE_SYS_SELECT_H = @HAVE_SYS_SELECT_H@ HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@ HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ +HAVE_TYPE_VOLATILE_SIG_ATOMIC_T = @HAVE_TYPE_VOLATILE_SIG_ATOMIC_T@ HAVE_UNISTD_H = @HAVE_UNISTD_H@ +HAVE_UNSETENV = @HAVE_UNSETENV@ HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ +HAVE_VASPRINTF = @HAVE_VASPRINTF@ +HAVE_VDPRINTF = @HAVE_VDPRINTF@ +HAVE_WCHAR_H = @HAVE_WCHAR_H@ +HAVE_WCRTOMB = @HAVE_WCRTOMB@ +HAVE_WCSNRTOMBS = @HAVE_WCSNRTOMBS@ +HAVE_WCSRTOMBS = @HAVE_WCSRTOMBS@ HAVE_WCTYPE_H = @HAVE_WCTYPE_H@ HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@ HAVE_WINT_T = @HAVE_WINT_T@ HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@ HAVE__BOOL = @HAVE__BOOL@ HELP2MAN = @HELP2MAN@ +HOSTENT_LIB = @HOSTENT_LIB@ +ICONV_H = @ICONV_H@ +INCLUDE_NEXT = @INCLUDE_NEXT@ +INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTALL_SU = @INSTALL_SU@ +INT32_MAX_LT_INTMAX_MAX = @INT32_MAX_LT_INTMAX_MAX@ +INT64_MAX_EQ_LONG_MAX = @INT64_MAX_EQ_LONG_MAX@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ INTTYPES_H = @INTTYPES_H@ @@ -367,15 +646,26 @@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ +LIBSOCKET = @LIBSOCKET@ +LIBTESTS_LIBDEPS = @LIBTESTS_LIBDEPS@ LIB_ACL = @LIB_ACL@ -LIB_ACL_TRIVIAL = @LIB_ACL_TRIVIAL@ +LIB_CAP = @LIB_CAP@ LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@ LIB_CRYPT = @LIB_CRYPT@ LIB_EACCESS = @LIB_EACCESS@ LIB_FDATASYNC = @LIB_FDATASYNC@ LIB_GETHRXTIME = @LIB_GETHRXTIME@ +LIB_GMP = @LIB_GMP@ LIB_NANOSLEEP = @LIB_NANOSLEEP@ +LIB_SELINUX = @LIB_SELINUX@ +LIB_XATTR = @LIB_XATTR@ LN_S = @LN_S@ +LOCALCHARSET_TESTS_ENVIRONMENT = @LOCALCHARSET_TESTS_ENVIRONMENT@ +LOCALE_FR = @LOCALE_FR@ +LOCALE_FR_UTF8 = @LOCALE_FR_UTF8@ +LOCALE_JA = @LOCALE_JA@ +LOCALE_TR_UTF8 = @LOCALE_TR_UTF8@ +LOCALE_ZH_CN = @LOCALE_ZH_CN@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ @@ -386,7 +676,34 @@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ NEED_SETGID = @NEED_SETGID@ +NETDB_H = @NETDB_H@ NETINET_IN_H = @NETINET_IN_H@ +NEXT_ARPA_INET_H = @NEXT_ARPA_INET_H@ +NEXT_DIRENT_H = @NEXT_DIRENT_H@ +NEXT_ERRNO_H = @NEXT_ERRNO_H@ +NEXT_FCNTL_H = @NEXT_FCNTL_H@ +NEXT_FLOAT_H = @NEXT_FLOAT_H@ +NEXT_ICONV_H = @NEXT_ICONV_H@ +NEXT_INTTYPES_H = @NEXT_INTTYPES_H@ +NEXT_MATH_H = @NEXT_MATH_H@ +NEXT_NETDB_H = @NEXT_NETDB_H@ +NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@ +NEXT_SIGNAL_H = @NEXT_SIGNAL_H@ +NEXT_STDARG_H = @NEXT_STDARG_H@ +NEXT_STDINT_H = @NEXT_STDINT_H@ +NEXT_STDIO_H = @NEXT_STDIO_H@ +NEXT_STDLIB_H = @NEXT_STDLIB_H@ +NEXT_STRING_H = @NEXT_STRING_H@ +NEXT_SYS_IOCTL_H = @NEXT_SYS_IOCTL_H@ +NEXT_SYS_SELECT_H = @NEXT_SYS_SELECT_H@ +NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_H@ +NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@ +NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@ +NEXT_TIME_H = @NEXT_TIME_H@ +NEXT_UNISTD_H = @NEXT_UNISTD_H@ +NEXT_WCHAR_H = @NEXT_WCHAR_H@ +NEXT_WCTYPE_H = @NEXT_WCTYPE_H@ +NO_INSTALL_PROGS_DEFAULT = @NO_INSTALL_PROGS_DEFAULT@ OBJEXT = @OBJEXT@ OPTIONAL_BIN_PROGS = @OPTIONAL_BIN_PROGS@ PACKAGE = @PACKAGE@ @@ -394,56 +711,142 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ +POSIX_SHELL = @POSIX_SHELL@ POSUB = @POSUB@ POW_LIB = @POW_LIB@ +PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@ +PREFERABLY_POSIX_SHELL = @PREFERABLY_POSIX_SHELL@ PRIPTR_PREFIX = @PRIPTR_PREFIX@ PRI_MACROS_BROKEN = @PRI_MACROS_BROKEN@ PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ RANLIB = @RANLIB@ +REPLACE_BTOWC = @REPLACE_BTOWC@ +REPLACE_CEILF = @REPLACE_CEILF@ +REPLACE_CEILL = @REPLACE_CEILL@ REPLACE_CHOWN = @REPLACE_CHOWN@ +REPLACE_CLOSE = @REPLACE_CLOSE@ +REPLACE_DPRINTF = @REPLACE_DPRINTF@ REPLACE_FCHDIR = @REPLACE_FCHDIR@ +REPLACE_FCLOSE = @REPLACE_FCLOSE@ +REPLACE_FFLUSH = @REPLACE_FFLUSH@ +REPLACE_FLOORF = @REPLACE_FLOORF@ +REPLACE_FLOORL = @REPLACE_FLOORL@ +REPLACE_FOPEN = @REPLACE_FOPEN@ REPLACE_FPRINTF = @REPLACE_FPRINTF@ +REPLACE_FREOPEN = @REPLACE_FREOPEN@ +REPLACE_FREXP = @REPLACE_FREXP@ +REPLACE_FREXPL = @REPLACE_FREXPL@ +REPLACE_FSEEK = @REPLACE_FSEEK@ +REPLACE_FSEEKO = @REPLACE_FSEEKO@ +REPLACE_FTELL = @REPLACE_FTELL@ +REPLACE_FTELLO = @REPLACE_FTELLO@ REPLACE_GETCWD = @REPLACE_GETCWD@ +REPLACE_GETLINE = @REPLACE_GETLINE@ +REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@ REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@ +REPLACE_HUGE_VAL = @REPLACE_HUGE_VAL@ +REPLACE_ICONV = @REPLACE_ICONV@ +REPLACE_ICONV_OPEN = @REPLACE_ICONV_OPEN@ +REPLACE_ICONV_UTF = @REPLACE_ICONV_UTF@ +REPLACE_ISFINITE = @REPLACE_ISFINITE@ +REPLACE_ISINF = @REPLACE_ISINF@ +REPLACE_ISNAN = @REPLACE_ISNAN@ +REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@ +REPLACE_LCHOWN = @REPLACE_LCHOWN@ +REPLACE_LDEXPL = @REPLACE_LDEXPL@ REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@ +REPLACE_LSEEK = @REPLACE_LSEEK@ +REPLACE_LSTAT = @REPLACE_LSTAT@ +REPLACE_MBRLEN = @REPLACE_MBRLEN@ +REPLACE_MBRTOWC = @REPLACE_MBRTOWC@ +REPLACE_MBSINIT = @REPLACE_MBSINIT@ +REPLACE_MBSNRTOWCS = @REPLACE_MBSNRTOWCS@ +REPLACE_MBSRTOWCS = @REPLACE_MBSRTOWCS@ +REPLACE_MBSTATE_T = @REPLACE_MBSTATE_T@ +REPLACE_MEMMEM = @REPLACE_MEMMEM@ +REPLACE_MKDIR = @REPLACE_MKDIR@ REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ +REPLACE_NAN = @REPLACE_NAN@ REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@ +REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@ +REPLACE_OPEN = @REPLACE_OPEN@ +REPLACE_PERROR = @REPLACE_PERROR@ REPLACE_PRINTF = @REPLACE_PRINTF@ +REPLACE_PUTENV = @REPLACE_PUTENV@ +REPLACE_ROUND = @REPLACE_ROUND@ +REPLACE_ROUNDF = @REPLACE_ROUNDF@ +REPLACE_ROUNDL = @REPLACE_ROUNDL@ +REPLACE_SELECT = @REPLACE_SELECT@ +REPLACE_SIGNBIT = @REPLACE_SIGNBIT@ +REPLACE_SIGNBIT_USING_GCC = @REPLACE_SIGNBIT_USING_GCC@ REPLACE_SNPRINTF = @REPLACE_SNPRINTF@ REPLACE_SPRINTF = @REPLACE_SPRINTF@ +REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@ +REPLACE_STRCASESTR = @REPLACE_STRCASESTR@ +REPLACE_STRDUP = @REPLACE_STRDUP@ +REPLACE_STRERROR = @REPLACE_STRERROR@ REPLACE_STRPTIME = @REPLACE_STRPTIME@ +REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@ +REPLACE_STRSTR = @REPLACE_STRSTR@ +REPLACE_STRTOD = @REPLACE_STRTOD@ REPLACE_TIMEGM = @REPLACE_TIMEGM@ +REPLACE_TRUNCL = @REPLACE_TRUNCL@ +REPLACE_VASPRINTF = @REPLACE_VASPRINTF@ +REPLACE_VDPRINTF = @REPLACE_VDPRINTF@ REPLACE_VFPRINTF = @REPLACE_VFPRINTF@ REPLACE_VPRINTF = @REPLACE_VPRINTF@ REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@ REPLACE_VSPRINTF = @REPLACE_VSPRINTF@ +REPLACE_WCRTOMB = @REPLACE_WCRTOMB@ +REPLACE_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@ +REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@ +REPLACE_WCTOB = @REPLACE_WCTOB@ +REPLACE_WCWIDTH = @REPLACE_WCWIDTH@ +REPLACE_WRITE = @REPLACE_WRITE@ +SELINUX_CONTEXT_H = @SELINUX_CONTEXT_H@ +SELINUX_SELINUX_H = @SELINUX_SELINUX_H@ SEQ_LIBM = @SEQ_LIBM@ +SERVENT_LIB = @SERVENT_LIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@ SIZE_T_SUFFIX = @SIZE_T_SUFFIX@ +STDARG_H = @STDARG_H@ STDBOOL_H = @STDBOOL_H@ STDINT_H = @STDINT_H@ STRIP = @STRIP@ +SYS_IOCTL_H = @SYS_IOCTL_H@ +SYS_IOCTL_H_HAVE_WINSOCK2_H = @SYS_IOCTL_H_HAVE_WINSOCK2_H@ +SYS_SELECT_H = @SYS_SELECT_H@ SYS_SOCKET_H = @SYS_SOCKET_H@ SYS_STAT_H = @SYS_STAT_H@ SYS_TIME_H = @SYS_TIME_H@ SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@ TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@ U = @U@ +UINT32_MAX_LT_UINTMAX_MAX = @UINT32_MAX_LT_UINTMAX_MAX@ +UINT64_MAX_EQ_ULONG_MAX = @UINT64_MAX_EQ_ULONG_MAX@ +UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@ +USE_ACL = @USE_ACL@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ +VOID_UNSETENV = @VOID_UNSETENV@ +WARN_CFLAGS = @WARN_CFLAGS@ WCHAR_H = @WCHAR_H@ WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ WCTYPE_H = @WCTYPE_H@ +WERROR_CFLAGS = @WERROR_CFLAGS@ WINT_T_SUFFIX = @WINT_T_SUFFIX@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ +XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ YACC = @YACC@ YFLAGS = @YFLAGS@ +abs_aux_dir = @abs_aux_dir@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ @@ -468,6 +871,8 @@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gl_LIBOBJS = @gl_LIBOBJS@ gl_LTLIBOBJS = @gl_LTLIBOBJS@ +gltests_LIBOBJS = @gltests_LIBOBJS@ +gltests_LTLIBOBJS = @gltests_LTLIBOBJS@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ @@ -493,38 +898,23 @@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -dist_man_MANS = \ - base64.1 basename.1 cat.1 chgrp.1 chmod.1 chown.1 cksum.1 comm.1 \ - cp.1 csplit.1 cut.1 date.1 dd.1 df.1 dir.1 dircolors.1 dirname.1 du.1 \ - echo.1 env.1 expand.1 expr.1 factor.1 false.1 fmt.1 fold.1 groups.1 \ - head.1 hostname.1 id.1 install.1 join.1 kill.1 \ - link.1 ln.1 logname.1 \ - ls.1 md5sum.1 mkdir.1 mkfifo.1 mknod.1 mv.1 nl.1 nohup.1 od.1 \ - paste.1 pathchk.1 pr.1 printenv.1 printf.1 ptx.1 pwd.1 readlink.1 \ - rm.1 rmdir.1 seq.1 sha1sum.1 sha224sum.1 sha256sum.1 sha384sum.1 sha512sum.1 \ - shred.1 shuf.1 sleep.1 sort.1 split.1 stat.1 \ - su.1 sum.1 sync.1 tac.1 tail.1 tee.1 test.1 touch.1 tr.1 true.1 tsort.1 \ - tty.1 unexpand.1 uniq.1 unlink.1 vdir.1 wc.1 \ - whoami.1 yes.1 $(MAN) +dist_man1_MANS = $(MAN) +man_aux = $(dist_man1_MANS:.1=.x) +EXTRA_DIST = $(man_aux) $(NO_INSTALL_PROGS_DEFAULT:%=%.x) help2man +MAINTAINERCLEANFILES = $(dist_man1_MANS) -optional_mans = \ - chroot.1 hostid.1 nice.1 pinky.1 stty.1 uname.1 uptime.1 users.1 who.1 - -man_aux = $(dist_man_MANS:.1=.x) $(optional_mans:.1=.x) -EXTRA_DIST = $(man_aux) help2man $(optional_mans) -MAINTAINERCLEANFILES = $(dist_man_MANS) - -# Depend on configure.ac to get version number changes. -common_dep = $(top_srcdir)/configure.ac +# Depend on ../.version to get version number changes. +common_dep = ../.version SUFFIXES = .x .1 # Ensure that help2man runs the ../src/ginstall binary as # `install' when creating install.1. # Similarly, ensure that it uses the ../src/[ binary to create test.1. t = $*.td -mapped_name = `echo $*|sed 's/install/ginstall/; s/test/[/'` +mapped_name = `echo $*|sed 's/^install$$/ginstall/; s/^test$$/[/'` # Sort in traditional ASCII order, regardless of the current locale; # otherwise we may get into trouble with distinct strings that the @@ -542,14 +932,14 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu man/Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu man/Makefile + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu man/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu man/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ @@ -567,51 +957,41 @@ $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -install-man1: $(man1_MANS) $(man_MANS) +$(am__aclocal_m4_deps): +install-man1: $(dist_man1_MANS) @$(NORMAL_INSTALL) test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)" - @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ - l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ - for i in $$l2; do \ - case "$$i" in \ - *.1*) list="$$list $$i" ;; \ - esac; \ + @list='$(dist_man1_MANS)'; test -n "$(man1dir)" || exit 0; \ + { for i in $$list; do echo "$$i"; done; \ + } | while read p; do \ + if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; echo "$$p"; \ + done | \ + sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ + sed 'N;N;s,\n, ,g' | { \ + list=; while read file base inst; do \ + if test "$$base" = "$$inst"; then list="$$list $$file"; else \ + echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ + $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ + fi; \ done; \ - for i in $$list; do \ - if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ - else file=$$i; fi; \ - ext=`echo $$i | sed -e 's/^.*\\.//'`; \ - case "$$ext" in \ - 1*) ;; \ - *) ext='1' ;; \ - esac; \ - inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ - inst=`echo $$inst | sed -e 's/^.*\///'`; \ - inst=`echo $$inst | sed '$(transform)'`.$$ext; \ - echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ - $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst"; \ - done + for i in $$list; do echo "$$i"; done | $(am__base_list) | \ + while read files; do \ + test -z "$$files" || { \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ + done; } + uninstall-man1: @$(NORMAL_UNINSTALL) - @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ - l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ - for i in $$l2; do \ - case "$$i" in \ - *.1*) list="$$list $$i" ;; \ - esac; \ - done; \ - for i in $$list; do \ - ext=`echo $$i | sed -e 's/^.*\\.//'`; \ - case "$$ext" in \ - 1*) ;; \ - *) ext='1' ;; \ - esac; \ - inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ - inst=`echo $$inst | sed -e 's/^.*\///'`; \ - inst=`echo $$inst | sed '$(transform)'`.$$ext; \ - echo " rm -f '$(DESTDIR)$(man1dir)/$$inst'"; \ - rm -f "$(DESTDIR)$(man1dir)/$$inst"; \ - done + @list='$(dist_man1_MANS)'; test -n "$(man1dir)" || exit 0; \ + files=`{ for i in $$list; do echo "$$i"; done; \ + } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ + test -n "$$files" || exit 0; \ + echo " ( cd '$(DESTDIR)$(man1dir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(man1dir)" && rm -f $$files tags: TAGS TAGS: @@ -620,6 +1000,19 @@ CTAGS: distdir: $(DISTFILES) + @list='$(MANS)'; if test -n "$$list"; then \ + list=`for p in $$list; do \ + if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ + if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \ + if test -n "$$list" && \ + grep 'ab help2man is required to generate this page' $$list >/dev/null; then \ + echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \ + grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \ + echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \ + echo " typically \`make maintainer-clean' will remove them" >&2; \ + exit 1; \ + else :; fi; \ + else :; fi @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ @@ -635,18 +1028,21 @@ distdir: $(DISTFILES) if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am - $(MAKE) $(AM_MAKEFLAGS) check-local check: check-am all-am: Makefile $(MANS) installdirs: @@ -673,6 +1069,7 @@ clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @@ -692,6 +1089,8 @@ dvi-am: html: html-am +html-am: + info: info-am info-am: @@ -700,18 +1099,28 @@ install-data-am: install-man install-dvi: install-dvi-am +install-dvi-am: + install-exec-am: install-html: install-html-am +install-html-am: + install-info: install-info-am +install-info-am: + install-man: install-man1 install-pdf: install-pdf-am +install-pdf-am: + install-ps: install-ps-am +install-ps-am: + installcheck-am: maintainer-clean: maintainer-clean-am @@ -736,21 +1145,25 @@ uninstall-man: uninstall-man1 .MAKE: install-am install-strip -.PHONY: all all-am check check-am check-local clean clean-generic \ - distclean distclean-generic distdir dvi dvi-am html html-am \ - info info-am install install-am install-data install-data-am \ - install-dvi install-dvi-am install-exec install-exec-am \ - install-html install-html-am install-info install-info-am \ - install-man install-man1 install-pdf install-pdf-am install-ps \ +.PHONY: all all-am check check-am clean clean-generic distclean \ + distclean-generic distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-man1 install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic pdf pdf-am ps ps-am uninstall \ uninstall-am uninstall-man uninstall-man1 +# Note that arch depends on uname.c +arch.1: $(common_dep) $(srcdir)/arch.x ../src/uname.c + base64.1: $(common_dep) $(srcdir)/base64.x ../src/base64.c basename.1: $(common_dep) $(srcdir)/basename.x ../src/basename.c cat.1: $(common_dep) $(srcdir)/cat.x ../src/cat.c +chcon.1: $(common_dep) $(srcdir)/chcon.x ../src/chcon.c chgrp.1: $(common_dep) $(srcdir)/chgrp.x ../src/chgrp.c chmod.1: $(common_dep) $(srcdir)/chmod.x ../src/chmod.c chown.1: $(common_dep) $(srcdir)/chown.x ../src/chown.c @@ -778,7 +1191,7 @@ factor.1: $(common_dep) $(srcdir)/factor.x ../src/factor.c false.1: $(common_dep) $(srcdir)/false.x ../src/false.c fmt.1: $(common_dep) $(srcdir)/fmt.x ../src/fmt.c fold.1: $(common_dep) $(srcdir)/fold.x ../src/fold.c -groups.1: $(common_dep) $(srcdir)/groups.x ../src/groups.sh +groups.1: $(common_dep) $(srcdir)/groups.x ../src/groups.c head.1: $(common_dep) $(srcdir)/head.x ../src/head.c hostid.1: $(common_dep) $(srcdir)/hostid.x ../src/hostid.c hostname.1: $(common_dep) $(srcdir)/hostname.x ../src/hostname.c @@ -794,6 +1207,7 @@ md5sum.1: $(common_dep) $(srcdir)/md5sum.x ../src/md5sum.c mkdir.1: $(common_dep) $(srcdir)/mkdir.x ../src/mkdir.c mkfifo.1: $(common_dep) $(srcdir)/mkfifo.x ../src/mkfifo.c mknod.1: $(common_dep) $(srcdir)/mknod.x ../src/mknod.c +mktemp.1: $(common_dep) $(srcdir)/mktemp.x ../src/mktemp.c mv.1: $(common_dep) $(srcdir)/mv.x ../src/mv.c nice.1: $(common_dep) $(srcdir)/nice.x ../src/nice.c nl.1: $(common_dep) $(srcdir)/nl.x ../src/nl.c @@ -810,6 +1224,7 @@ pwd.1: $(common_dep) $(srcdir)/pwd.x ../src/pwd.c readlink.1: $(common_dep) $(srcdir)/readlink.x ../src/readlink.c rm.1: $(common_dep) $(srcdir)/rm.x ../src/rm.c rmdir.1: $(common_dep) $(srcdir)/rmdir.x ../src/rmdir.c +runcon.1: $(common_dep) $(srcdir)/runcon.x ../src/runcon.c seq.1: $(common_dep) $(srcdir)/seq.x ../src/seq.c sha1sum.1: $(common_dep) $(srcdir)/sha1sum.x ../src/md5sum.c sha224sum.1: $(common_dep) $(srcdir)/sha224sum.x ../src/md5sum.c @@ -830,9 +1245,11 @@ tac.1: $(common_dep) $(srcdir)/tac.x ../src/tac.c tail.1: $(common_dep) $(srcdir)/tail.x ../src/tail.c tee.1: $(common_dep) $(srcdir)/tee.x ../src/tee.c test.1: $(common_dep) $(srcdir)/test.x ../src/test.c +timeout.1: $(common_dep) $(srcdir)/timeout.x ../src/timeout.c touch.1: $(common_dep) $(srcdir)/touch.x ../src/touch.c tr.1: $(common_dep) $(srcdir)/tr.x ../src/tr.c true.1: $(common_dep) $(srcdir)/true.x ../src/true.c +truncate.1: $(common_dep) $(srcdir)/truncate.x ../src/truncate.c tsort.1: $(common_dep) $(srcdir)/tsort.x ../src/tsort.c tty.1: $(common_dep) $(srcdir)/tty.x ../src/tty.c uname.1: $(common_dep) $(srcdir)/uname.x ../src/uname.c @@ -847,6 +1264,10 @@ who.1: $(common_dep) $(srcdir)/who.x ../src/who.c whoami.1: $(common_dep) $(srcdir)/whoami.x ../src/whoami.c yes.1: $(common_dep) $(srcdir)/yes.x ../src/yes.c +# This is required so that changes to e.g., emit_bug_reporting_address +# provoke regeneration of all $(MAN) files. +$(MAN): $(top_srcdir)/src/system.h + # Note the use of $t/$*, rather than just `$*' as in other packages. # That is necessary to avoid failures for programs that are also shell built-in # functions like echo, false, printf, pwd. @@ -859,30 +1280,32 @@ yes.1: $(common_dep) $(srcdir)/yes.x ../src/yes.c *) \ rm -f $@ \ && { echo "Updating man page $@"; \ - rm -rf $t; \ - mkdir $t; \ - (cd $t && $(LN_S) ../../src/$(mapped_name) $*); \ - $(PERL) -- $(srcdir)/help2man \ - --source='$(PACKAGE_STRING)' \ - --include=$(srcdir)/$*.x \ - --output=$t/$@ $t/$*; \ + rm -rf $t; \ + mkdir $t; \ + (cd $t && $(LN_S) ../../src/$(mapped_name) $*); \ + $(PERL) -- $(srcdir)/help2man \ + --source='$(PACKAGE_STRING)' \ + --include=$(srcdir)/$*.x \ + --output=$t/$@ $t/$*; \ } \ && sed 's|$*\.td/||g' $t/$@ > $@ \ - && chmod a-w $@ \ && rm -rf $t ;; \ esac -check-local: check-x-vs-1 check-programs-vs-x +distcheck-hook: check-x-vs-1 check-programs-vs-x # Ensure that for each .x file in this directory, there is a -# corresponding .1 file in the definition of $(dist_man_MANS) above. +# corresponding .1 file in the definition of $(dist_man1_MANS) above. +# But since that expansion usually lacks programs like su and arch, +# add them here manually. .PHONY: check-x-vs-1 check-x-vs-1: PATH=../src$(PATH_SEPARATOR)$$PATH; export PATH; \ t=ls-files.$$$$; \ (cd $(srcdir) && ls -1 *.x) | sed 's/\.x$$//' | $(ASSORT) > $$t;\ - echo $(dist_man_MANS) | tr -s ' ' '\n' | sed 's/\.1$$//' \ - | $(ASSORT) | diff - $$t || { rm $$t; exit 1; }; \ + (echo $(dist_man1_MANS) $(NO_INSTALL_PROGS_DEFAULT) \ + | tr -s ' ' '\n' | sed 's/\.1$$//') \ + | $(ASSORT) -u | diff - $$t || { rm $$t; exit 1; }; \ rm $$t .PHONY: check-programs-vs-x @@ -895,6 +1318,7 @@ check-programs-vs-x: || { echo missing $$p.x 1>&2; status=1; }; \ done; \ exit $$status + # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff --git a/src/bin/coreutils/man/arch.x b/src/bin/coreutils/man/arch.x new file mode 100644 index 0000000000..0a310b41f1 --- /dev/null +++ b/src/bin/coreutils/man/arch.x @@ -0,0 +1,6 @@ +[NAME] +arch \- print machine hardware name (same as uname -m) +[DESCRIPTION] +.\" Add any additional description here +[SEE ALSO] +uname(1), uname(2) diff --git a/src/bin/coreutils/man/base64.1 b/src/bin/coreutils/man/base64.1 index 6dc283f740..f8eae46089 100644 --- a/src/bin/coreutils/man/base64.1 +++ b/src/bin/coreutils/man/base64.1 @@ -1,10 +1,10 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -.TH BASE64 "1" "March 2007" "GNU coreutils 6.9" "User Commands" +.TH BASE64 "1" "May 2009" "GNU coreutils 7.4" "User Commands" .SH NAME base64 \- base64 encode/decode data and print to standard output .SH SYNOPSIS .B base64 -[\fIOPTION\fR] [\fIFILE\fR] +[\fIOPTION\fR]... [\fIFILE\fR] .SH DESCRIPTION .\" Add any additional description here .PP @@ -35,12 +35,16 @@ from any other non\-alphabet bytes in the encoded stream. .SH AUTHOR Written by Simon Josefsson. .SH "REPORTING BUGS" -Report bugs to . -.SH COPYRIGHT -Copyright \(co 2007 Free Software Foundation, Inc. +Report base64 bugs to bug\-coreutils@gnu.org .br -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License . +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" The full documentation for @@ -51,6 +55,6 @@ and .B base64 programs are properly installed at your site, the command .IP -.B info base64 +.B info coreutils \(aqbase64 invocation\(aq .PP should give you access to the complete manual. diff --git a/src/bin/coreutils/man/basename.1 b/src/bin/coreutils/man/basename.1 index eda27a098a..0e59ff9cd4 100644 --- a/src/bin/coreutils/man/basename.1 +++ b/src/bin/coreutils/man/basename.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -.TH BASENAME "1" "March 2007" "GNU coreutils 6.9" "User Commands" +.TH BASENAME "1" "May 2009" "GNU coreutils 7.4" "User Commands" .SH NAME basename \- strip directory and suffix from filenames .SH SYNOPSIS @@ -27,14 +27,18 @@ Output "sort". basename include/stdio.h .h Output "stdio". .SH AUTHOR -Written by FIXME unknown. +Written by David MacKenzie. .SH "REPORTING BUGS" -Report bugs to . -.SH COPYRIGHT -Copyright \(co 2007 Free Software Foundation, Inc. +Report basename bugs to bug\-coreutils@gnu.org .br -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License . +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" dirname(1), readlink(1) @@ -47,6 +51,6 @@ and .B basename programs are properly installed at your site, the command .IP -.B info basename +.B info coreutils \(aqbasename invocation\(aq .PP should give you access to the complete manual. diff --git a/src/bin/coreutils/man/cat.1 b/src/bin/coreutils/man/cat.1 index 24121cc2d9..6b7a80592e 100644 --- a/src/bin/coreutils/man/cat.1 +++ b/src/bin/coreutils/man/cat.1 @@ -1,10 +1,10 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -.TH CAT "1" "March 2007" "GNU coreutils 6.9" "User Commands" +.TH CAT "1" "May 2009" "GNU coreutils 7.4" "User Commands" .SH NAME cat \- concatenate files and print on the standard output .SH SYNOPSIS .B cat -[\fIOPTION\fR] [\fIFILE\fR]... +[\fIOPTION\fR]... [\fIFILE\fR]... .SH DESCRIPTION .\" Add any additional description here .PP @@ -14,7 +14,7 @@ Concatenate FILE(s), or standard input, to standard output. equivalent to \fB\-vET\fR .TP \fB\-b\fR, \fB\-\-number\-nonblank\fR -number nonblank output lines +number nonempty output lines .TP \fB\-e\fR equivalent to \fB\-vE\fR @@ -26,7 +26,7 @@ display $ at end of each line number all output lines .TP \fB\-s\fR, \fB\-\-squeeze\-blank\fR -never more than one single blank line +suppress repeated empty output lines .TP \fB\-t\fR equivalent to \fB\-vT\fR @@ -57,12 +57,16 @@ Copy standard input to standard output. .SH AUTHOR Written by Torbjorn Granlund and Richard M. Stallman. .SH "REPORTING BUGS" -Report bugs to . -.SH COPYRIGHT -Copyright \(co 2007 Free Software Foundation, Inc. +Report cat bugs to bug\-coreutils@gnu.org .br -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License . +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" The full documentation for @@ -73,6 +77,6 @@ and .B cat programs are properly installed at your site, the command .IP -.B info cat +.B info coreutils \(aqcat invocation\(aq .PP should give you access to the complete manual. diff --git a/src/bin/coreutils/man/chcon.1 b/src/bin/coreutils/man/chcon.1 new file mode 100644 index 0000000000..689bb2a1af --- /dev/null +++ b/src/bin/coreutils/man/chcon.1 @@ -0,0 +1,90 @@ +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. +.TH CHCON "1" "May 2009" "GNU coreutils 7.4" "User Commands" +.SH NAME +chcon \- change file security context +.SH SYNOPSIS +.B chcon +[\fIOPTION\fR]... \fICONTEXT FILE\fR... +.br +.B chcon +[\fIOPTION\fR]... [\fI-u USER\fR] [\fI-r ROLE\fR] [\fI-l RANGE\fR] [\fI-t TYPE\fR] \fIFILE\fR... +.br +.B chcon +[\fIOPTION\fR]... \fI--reference=RFILE FILE\fR... +.SH DESCRIPTION +.\" Add any additional description here +.PP +Change the security context of each FILE to CONTEXT. +With \fB\-\-reference\fR, change the security context of each FILE to that of RFILE. +.TP +\fB\-h\fR, \fB\-\-no\-dereference\fR +affect symbolic links instead of any referenced file +.TP +\fB\-\-reference\fR=\fIRFILE\fR +use RFILE's security context rather than specifying +a CONTEXT value +.TP +\fB\-R\fR, \fB\-\-recursive\fR +operate on files and directories recursively +.TP +\fB\-v\fR, \fB\-\-verbose\fR +output a diagnostic for every file processed +.TP +\fB\-u\fR, \fB\-\-user\fR=\fIUSER\fR +set user USER in the target security context +.TP +\fB\-r\fR, \fB\-\-role\fR=\fIROLE\fR +set role ROLE in the target security context +.TP +\fB\-t\fR, \fB\-\-type\fR=\fITYPE\fR +set type TYPE in the target security context +.TP +\fB\-l\fR, \fB\-\-range\fR=\fIRANGE\fR +set range RANGE in the target security context +.PP +The following options modify how a hierarchy is traversed when the \fB\-R\fR +option is also specified. If more than one is specified, only the final +one takes effect. +.TP +\fB\-H\fR +if a command line argument is a symbolic link +to a directory, traverse it +.TP +\fB\-L\fR +traverse every symbolic link to a directory +encountered +.TP +\fB\-P\fR +do not traverse any symbolic links (default) +.TP +\fB\-\-help\fR +display this help and exit +.TP +\fB\-\-version\fR +output version information and exit +.SH AUTHOR +Written by Russell Coker and Jim Meyering. +.SH "REPORTING BUGS" +Report chcon bugs to bug\-coreutils@gnu.org +.br +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. +There is NO WARRANTY, to the extent permitted by law. +.SH "SEE ALSO" +The full documentation for +.B chcon +is maintained as a Texinfo manual. If the +.B info +and +.B chcon +programs are properly installed at your site, the command +.IP +.B info coreutils \(aqchcon invocation\(aq +.PP +should give you access to the complete manual. diff --git a/src/bin/coreutils/man/chcon.x b/src/bin/coreutils/man/chcon.x new file mode 100644 index 0000000000..8c1ff6ff9c --- /dev/null +++ b/src/bin/coreutils/man/chcon.x @@ -0,0 +1,4 @@ +[NAME] +chcon \- change file security context +[DESCRIPTION] +.\" Add any additional description here diff --git a/src/bin/coreutils/man/chgrp.1 b/src/bin/coreutils/man/chgrp.1 index 85cebe61bb..8b8aecffb0 100644 --- a/src/bin/coreutils/man/chgrp.1 +++ b/src/bin/coreutils/man/chgrp.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -.TH CHGRP "1" "March 2007" "GNU coreutils 6.9" "User Commands" +.TH CHGRP "1" "May 2009" "GNU coreutils 7.4" "User Commands" .SH NAME chgrp \- change group ownership .SH SYNOPSIS @@ -75,12 +75,16 @@ Change the group of /u and subfiles to "staff". .SH AUTHOR Written by David MacKenzie and Jim Meyering. .SH "REPORTING BUGS" -Report bugs to . -.SH COPYRIGHT -Copyright \(co 2007 Free Software Foundation, Inc. +Report chgrp bugs to bug\-coreutils@gnu.org .br -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License . +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" The full documentation for @@ -91,6 +95,6 @@ and .B chgrp programs are properly installed at your site, the command .IP -.B info chgrp +.B info coreutils \(aqchgrp invocation\(aq .PP should give you access to the complete manual. diff --git a/src/bin/coreutils/man/chmod.1 b/src/bin/coreutils/man/chmod.1 index 18f1da795c..36446df309 100644 --- a/src/bin/coreutils/man/chmod.1 +++ b/src/bin/coreutils/man/chmod.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -.TH CHMOD "1" "March 2007" "GNU coreutils 6.9" "User Commands" +.TH CHMOD "1" "May 2009" "GNU coreutils 7.4" "User Commands" .SH NAME chmod \- change file mode bits .SH SYNOPSIS @@ -57,8 +57,7 @@ categories (\fBo\fP). .PP A numeric mode is from one to four octal digits (0\-7), derived by adding up the bits with values 4, 2, and 1. Omitted digits are -assumed to be leading zeros, except that if the first digit is -omitted, a directory's set user and group ID bits are not affected. +assumed to be leading zeros. The first digit selects the set user ID (4) and set group ID (2) and restricted deletion or sticky (1) attributes. The second digit selects permissions for the user who owns the file: read (4), write (2), @@ -78,6 +77,30 @@ In contrast, .B chmod ignores symbolic links encountered during recursive directory traversals. +.SH "SETUID AND SETGID BITS" +.B chmod +clears the set-group-ID bit of a +regular file if the file's group ID does not match the user's +effective group ID or one of the user's supplementary group IDs, +unless the user has appropriate privileges. Additional restrictions +may cause the set-user-ID and set-group-ID bits of +.I MODE +or +.I RFILE +to be ignored. This behavior depends on the policy and +functionality of the underlying +.B chmod +system call. When in +doubt, check the underlying system behavior. +.PP +.B chmod +preserves a directory's set-user-ID and set-group-ID bits unless you +explicitly specify otherwise. You can set or clear the bits with +symbolic modes like +.B u+s +and +.BR g\-s , +and you can set (but not clear) the bits with a numeric mode. .SH "RESTRICTED DELETION FLAG OR STICKY BIT" The restricted deletion flag or sticky bit is a single bit, whose interpretation depends on the file type. For directories, it prevents @@ -124,12 +147,16 @@ Each MODE is of the form `[ugoa]*([\-+=]([rwxXst]*|[ugo]))+'. .SH AUTHOR Written by David MacKenzie and Jim Meyering. .SH "REPORTING BUGS" -Report bugs to . -.SH COPYRIGHT -Copyright \(co 2007 Free Software Foundation, Inc. +Report chmod bugs to bug\-coreutils@gnu.org .br -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License . +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" chmod(2) @@ -142,6 +169,6 @@ and .B chmod programs are properly installed at your site, the command .IP -.B info chmod +.B info coreutils \(aqchmod invocation\(aq .PP should give you access to the complete manual. diff --git a/src/bin/coreutils/man/chmod.x b/src/bin/coreutils/man/chmod.x index 9a73cd535d..a2b0bb2d22 100644 --- a/src/bin/coreutils/man/chmod.x +++ b/src/bin/coreutils/man/chmod.x @@ -1,4 +1,4 @@ -'\" Copyright (C) 1998, 1999, 2001, 2006 Free Software Foundation, Inc. +'\" Copyright (C) 1998, 1999, 2001, 2006, 2007 Free Software Foundation, Inc. '\" '\" This is free software. You may redistribute copies of it under the terms '\" of the GNU General Public License . @@ -51,8 +51,7 @@ categories (\fBo\fP). .PP A numeric mode is from one to four octal digits (0\-7), derived by adding up the bits with values 4, 2, and 1. Omitted digits are -assumed to be leading zeros, except that if the first digit is -omitted, a directory's set user and group ID bits are not affected. +assumed to be leading zeros. The first digit selects the set user ID (4) and set group ID (2) and restricted deletion or sticky (1) attributes. The second digit selects permissions for the user who owns the file: read (4), write (2), @@ -72,6 +71,30 @@ In contrast, .B chmod ignores symbolic links encountered during recursive directory traversals. +.SH "SETUID AND SETGID BITS" +.B chmod +clears the set-group-ID bit of a +regular file if the file's group ID does not match the user's +effective group ID or one of the user's supplementary group IDs, +unless the user has appropriate privileges. Additional restrictions +may cause the set-user-ID and set-group-ID bits of +.I MODE +or +.I RFILE +to be ignored. This behavior depends on the policy and +functionality of the underlying +.B chmod +system call. When in +doubt, check the underlying system behavior. +.PP +.B chmod +preserves a directory's set-user-ID and set-group-ID bits unless you +explicitly specify otherwise. You can set or clear the bits with +symbolic modes like +.B u+s +and +.BR g\-s , +and you can set (but not clear) the bits with a numeric mode. .SH "RESTRICTED DELETION FLAG OR STICKY BIT" The restricted deletion flag or sticky bit is a single bit, whose interpretation depends on the file type. For directories, it prevents diff --git a/src/bin/coreutils/man/chown.1 b/src/bin/coreutils/man/chown.1 index fd9e54f781..d68fd1cfc1 100644 --- a/src/bin/coreutils/man/chown.1 +++ b/src/bin/coreutils/man/chown.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -.TH CHOWN "1" "March 2007" "GNU coreutils 6.9" "User Commands" +.TH CHOWN "1" "May 2009" "GNU coreutils 7.4" "User Commands" .SH NAME chown \- change file owner and group .SH SYNOPSIS @@ -107,12 +107,16 @@ Change the owner of /u and subfiles to "root". .SH AUTHOR Written by David MacKenzie and Jim Meyering. .SH "REPORTING BUGS" -Report bugs to . -.SH COPYRIGHT -Copyright \(co 2007 Free Software Foundation, Inc. +Report chown bugs to bug\-coreutils@gnu.org .br -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License . +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" chown(2) @@ -125,6 +129,6 @@ and .B chown programs are properly installed at your site, the command .IP -.B info chown +.B info coreutils \(aqchown invocation\(aq .PP should give you access to the complete manual. diff --git a/src/bin/coreutils/man/chroot.1 b/src/bin/coreutils/man/chroot.1 index 38c8029e87..4ac880aa85 100644 --- a/src/bin/coreutils/man/chroot.1 +++ b/src/bin/coreutils/man/chroot.1 @@ -1,10 +1,10 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -.TH CHROOT "1" "March 2007" "GNU coreutils 6.9" "User Commands" +.TH CHROOT "1" "May 2009" "GNU coreutils 7.4" "User Commands" .SH NAME chroot \- run command or interactive shell with special root directory .SH SYNOPSIS .B chroot -\fINEWROOT \fR[\fICOMMAND\fR...] +\fINEWROOT \fR[\fICOMMAND \fR[\fIARG\fR]...] .br .B chroot \fIOPTION\fR @@ -23,12 +23,16 @@ If no command is given, run ``${SHELL} \fB\-i\fR'' (default: /bin/sh). .SH AUTHOR Written by Roland McGrath. .SH "REPORTING BUGS" -Report bugs to . -.SH COPYRIGHT -Copyright \(co 2007 Free Software Foundation, Inc. +Report chroot bugs to bug\-coreutils@gnu.org .br -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License . +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" chroot(2) @@ -41,6 +45,6 @@ and .B chroot programs are properly installed at your site, the command .IP -.B info chroot +.B info coreutils \(aqchroot invocation\(aq .PP should give you access to the complete manual. diff --git a/src/bin/coreutils/man/cksum.1 b/src/bin/coreutils/man/cksum.1 index dae95d8d06..83571fb669 100644 --- a/src/bin/coreutils/man/cksum.1 +++ b/src/bin/coreutils/man/cksum.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -.TH CKSUM "1" "March 2007" "GNU coreutils 6.9" "User Commands" +.TH CKSUM "1" "May 2009" "GNU coreutils 7.4" "User Commands" .SH NAME cksum \- checksum and count the bytes in a file .SH SYNOPSIS @@ -21,12 +21,16 @@ output version information and exit .SH AUTHOR Written by Q. Frank Xia. .SH "REPORTING BUGS" -Report bugs to . -.SH COPYRIGHT -Copyright \(co 2007 Free Software Foundation, Inc. +Report cksum bugs to bug\-coreutils@gnu.org .br -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License . +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" The full documentation for @@ -37,6 +41,6 @@ and .B cksum programs are properly installed at your site, the command .IP -.B info cksum +.B info coreutils \(aqcksum invocation\(aq .PP should give you access to the complete manual. diff --git a/src/bin/coreutils/man/comm.1 b/src/bin/coreutils/man/comm.1 index 252aafdaaf..a4cb357671 100644 --- a/src/bin/coreutils/man/comm.1 +++ b/src/bin/coreutils/man/comm.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -.TH COMM "1" "March 2007" "GNU coreutils 6.9" "User Commands" +.TH COMM "1" "May 2009" "GNU coreutils 7.4" "User Commands" .SH NAME comm \- compare two sorted files line by line .SH SYNOPSIS @@ -23,20 +23,36 @@ suppress lines unique to FILE2 \fB\-3\fR suppress lines that appear in both files .TP +\fB\-\-check\-order\fR +check that the input is correctly sorted, even +if all input lines are pairable +.TP +\fB\-\-nocheck\-order\fR +do not check that the input is correctly sorted +.TP +\fB\-\-output\-delimiter\fR=\fISTR\fR +separate columns with STR +.TP \fB\-\-help\fR display this help and exit .TP \fB\-\-version\fR output version information and exit +.PP +Note, comparisons honor the rules specified by `LC_COLLATE'. .SH AUTHOR -Written by Richard Stallman and David MacKenzie. +Written by Richard M. Stallman and David MacKenzie. .SH "REPORTING BUGS" -Report bugs to . -.SH COPYRIGHT -Copyright \(co 2007 Free Software Foundation, Inc. +Report comm bugs to bug\-coreutils@gnu.org .br -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License . +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" The full documentation for @@ -47,6 +63,6 @@ and .B comm programs are properly installed at your site, the command .IP -.B info comm +.B info coreutils \(aqcomm invocation\(aq .PP should give you access to the complete manual. diff --git a/src/bin/coreutils/man/cp.1 b/src/bin/coreutils/man/cp.1 index 3a72496b49..3ff9b38a22 100644 --- a/src/bin/coreutils/man/cp.1 +++ b/src/bin/coreutils/man/cp.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -.TH CP "1" "March 2007" "GNU coreutils 6.9" "User Commands" +.TH CP "1" "May 2009" "GNU coreutils 7.4" "User Commands" .SH NAME cp \- copy files and directories .SH SYNOPSIS @@ -19,7 +19,7 @@ Copy SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY. Mandatory arguments to long options are mandatory for short options too. .TP \fB\-a\fR, \fB\-\-archive\fR -same as \fB\-dpPR\fR +same as \fB\-dR\fR \fB\-\-preserve\fR=\fIall\fR .TP \fB\-\-backup\fR[=\fICONTROL\fR] make a backup of each existing destination file @@ -31,26 +31,32 @@ like \fB\-\-backup\fR but does not accept an argument copy contents of special files when recursive .TP \fB\-d\fR -same as \fB\-\-no\-dereference\fR \fB\-\-preserve\fR=\fIlink\fR +same as \fB\-\-no\-dereference\fR \fB\-\-preserve\fR=\fIlinks\fR .TP \fB\-f\fR, \fB\-\-force\fR if an existing destination file cannot be -opened, remove it and try again +opened, remove it and try again (redundant if +the \fB\-n\fR option is used) .TP \fB\-i\fR, \fB\-\-interactive\fR -prompt before overwrite +prompt before overwrite (overrides a previous \fB\-n\fR +option) .TP \fB\-H\fR -follow command\-line symbolic links +follow command\-line symbolic links in SOURCE .TP \fB\-l\fR, \fB\-\-link\fR link files instead of copying .TP \fB\-L\fR, \fB\-\-dereference\fR -always follow symbolic links +always follow symbolic links in SOURCE +.TP +\fB\-n\fR, \fB\-\-no\-clobber\fR +do not overwrite an existing file (overrides +a previous \fB\-i\fR option) .TP \fB\-P\fR, \fB\-\-no\-dereference\fR -never follow symbolic links +never follow symbolic links in SOURCE .TP \fB\-p\fR same as \fB\-\-preserve\fR=\fImode\fR,ownership,timestamps @@ -58,7 +64,8 @@ same as \fB\-\-preserve\fR=\fImode\fR,ownership,timestamps \fB\-\-preserve\fR[=\fIATTR_LIST\fR] preserve the specified attributes (default: mode,ownership,timestamps), if possible -additional attributes: links, all +additional attributes: context, links, xattr, +all .TP \fB\-\-no\-preserve\fR=\fIATTR_LIST\fR don't preserve the specified attributes @@ -137,12 +144,16 @@ regular file. .SH AUTHOR Written by Torbjorn Granlund, David MacKenzie, and Jim Meyering. .SH "REPORTING BUGS" -Report bugs to . -.SH COPYRIGHT -Copyright \(co 2007 Free Software Foundation, Inc. +Report cp bugs to bug\-coreutils@gnu.org .br -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License . +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" The full documentation for @@ -153,6 +164,6 @@ and .B cp programs are properly installed at your site, the command .IP -.B info cp +.B info coreutils \(aqcp invocation\(aq .PP should give you access to the complete manual. diff --git a/src/bin/coreutils/man/csplit.1 b/src/bin/coreutils/man/csplit.1 index ffd4b5400d..b580bf8d99 100644 --- a/src/bin/coreutils/man/csplit.1 +++ b/src/bin/coreutils/man/csplit.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -.TH CSPLIT "1" "March 2007" "GNU coreutils 6.9" "User Commands" +.TH CSPLIT "1" "May 2009" "GNU coreutils 7.4" "User Commands" .SH NAME csplit \- split a file into sections determined by context lines .SH SYNOPSIS @@ -58,12 +58,16 @@ A line OFFSET is a required `+' or `\-' followed by a positive integer. .SH AUTHOR Written by Stuart Kemp and David MacKenzie. .SH "REPORTING BUGS" -Report bugs to . -.SH COPYRIGHT -Copyright \(co 2007 Free Software Foundation, Inc. +Report csplit bugs to bug\-coreutils@gnu.org .br -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License . +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" The full documentation for @@ -74,6 +78,6 @@ and .B csplit programs are properly installed at your site, the command .IP -.B info csplit +.B info coreutils \(aqcsplit invocation\(aq .PP should give you access to the complete manual. diff --git a/src/bin/coreutils/man/cut.1 b/src/bin/coreutils/man/cut.1 index 1424029a22..fefc670452 100644 --- a/src/bin/coreutils/man/cut.1 +++ b/src/bin/coreutils/man/cut.1 @@ -1,10 +1,10 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -.TH CUT "1" "March 2007" "GNU coreutils 6.9" "User Commands" +.TH CUT "1" "May 2009" "GNU coreutils 7.4" "User Commands" .SH NAME cut \- remove sections from each line of files .SH SYNOPSIS .B cut -[\fIOPTION\fR]... [\fIFILE\fR]... +\fIOPTION\fR... [\fIFILE\fR]... .SH DESCRIPTION .\" Add any additional description here .PP @@ -31,7 +31,7 @@ the \fB\-s\fR option is specified .TP \fB\-\-complement\fR complement the set of selected bytes, characters -or fields. +or fields .TP \fB\-s\fR, \fB\-\-only\-delimited\fR do not print lines not containing delimiters @@ -65,14 +65,18 @@ from first to M'th (included) byte, character or field .PP With no FILE, or when FILE is \-, read standard input. .SH AUTHOR -Written by David Ihnat, David MacKenzie, and Jim Meyering. +Written by David M. Ihnat, David MacKenzie, and Jim Meyering. .SH "REPORTING BUGS" -Report bugs to . -.SH COPYRIGHT -Copyright \(co 2007 Free Software Foundation, Inc. +Report cut bugs to bug\-coreutils@gnu.org .br -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License . +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" The full documentation for @@ -83,6 +87,6 @@ and .B cut programs are properly installed at your site, the command .IP -.B info cut +.B info coreutils \(aqcut invocation\(aq .PP should give you access to the complete manual. diff --git a/src/bin/coreutils/man/date.1 b/src/bin/coreutils/man/date.1 index b88152d2c6..8fe13b60f9 100644 --- a/src/bin/coreutils/man/date.1 +++ b/src/bin/coreutils/man/date.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -.TH DATE "1" "March 2007" "GNU coreutils 6.9" "User Commands" +.TH DATE "1" "May 2009" "GNU coreutils 7.4" "User Commands" .SH NAME date \- print or set the system date and time .SH SYNOPSIS @@ -45,8 +45,7 @@ display this help and exit \fB\-\-version\fR output version information and exit .PP -FORMAT controls the output. The only valid option for the second form -specifies Coordinated Universal Time. Interpreted sequences are: +FORMAT controls the output. Interpreted sequences are: .TP %% a literal % @@ -67,7 +66,7 @@ locale's full month name (e.g., January) locale's date and time (e.g., Thu Mar 3 23:05:25 2005) .TP %C -century; like %Y, except omit last two digits (e.g., 21) +century; like %Y, except omit last two digits (e.g., 20) .TP %d day of month (e.g, 01) @@ -205,15 +204,28 @@ After any flags comes an optional field width, as a decimal number; then an optional modifier, which is either E to use the locale's alternate representations if available, or O to use the locale's alternate numeric symbols if available. +.SH "DATE STRING" +.\" NOTE: keep this paragraph in sync with the one in touch.x +The --date=STRING is a mostly free format human readable date string +such as "Sun, 29 Feb 2004 16:21:42 -0800" or "2004-02-29 16:21:42" or +even "next Thursday". A date string may contain items indicating +calendar date, time of day, time zone, day of week, relative time, +relative date, and numbers. An empty string indicates the beginning +of the day. The date string format is more complex than is easily +documented here but is fully described in the info documentation. .SH AUTHOR Written by David MacKenzie. .SH "REPORTING BUGS" -Report bugs to . -.SH COPYRIGHT -Copyright \(co 2007 Free Software Foundation, Inc. +Report date bugs to bug\-coreutils@gnu.org .br -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License . +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" The full documentation for @@ -224,6 +236,6 @@ and .B date programs are properly installed at your site, the command .IP -.B info date +.B info coreutils \(aqdate invocation\(aq .PP should give you access to the complete manual. diff --git a/src/bin/coreutils/man/date.x b/src/bin/coreutils/man/date.x index bae08ac98c..bbcbafcb6b 100644 --- a/src/bin/coreutils/man/date.x +++ b/src/bin/coreutils/man/date.x @@ -2,3 +2,12 @@ date \- print or set the system date and time [DESCRIPTION] .\" Add any additional description here +[DATE STRING] +.\" NOTE: keep this paragraph in sync with the one in touch.x +The --date=STRING is a mostly free format human readable date string +such as "Sun, 29 Feb 2004 16:21:42 -0800" or "2004-02-29 16:21:42" or +even "next Thursday". A date string may contain items indicating +calendar date, time of day, time zone, day of week, relative time, +relative date, and numbers. An empty string indicates the beginning +of the day. The date string format is more complex than is easily +documented here but is fully described in the info documentation. diff --git a/src/bin/coreutils/man/dd.1 b/src/bin/coreutils/man/dd.1 index bd5a74abe6..98ebdd2ff4 100644 --- a/src/bin/coreutils/man/dd.1 +++ b/src/bin/coreutils/man/dd.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -.TH DD "1" "March 2007" "GNU coreutils 6.9" "User Commands" +.TH DD "1" "May 2009" "GNU coreutils 7.4" "User Commands" .SH NAME dd \- convert and copy a file .SH SYNOPSIS @@ -14,7 +14,7 @@ dd \- convert and copy a file Copy a file, converting and formatting according to the operands. .TP bs=BYTES -force ibs=BYTES and obs=BYTES +read and write BYTES bytes at a time (also see ibs=,obs=) .TP cbs=BYTES convert BYTES bytes at a time @@ -26,7 +26,7 @@ count=BLOCKS copy only BLOCKS input blocks .TP ibs=BYTES -read BYTES bytes at a time +read BYTES bytes at a time (default: 512) .TP if=FILE read from FILE instead of stdin @@ -35,7 +35,7 @@ iflag=FLAGS read as per the comma separated symbol list .TP obs=BYTES -write BYTES bytes at a time +write BYTES bytes at a time (default: 512) .TP of=FILE write to FILE instead of stdout @@ -53,8 +53,8 @@ status=noxfer suppress transfer statistics .PP BLOCKS and BYTES may be followed by the following multiplicative suffixes: -xM M, c 1, w 2, b 512, kB 1000, K 1024, MB 1000*1000, M 1024*1024, -GB 1000*1000*1000, G 1024*1024*1024, and so on for T, P, E, Z, Y. +c =1, w =2, b =512, kB =1000, K =1024, MB =1000*1000, M =1024*1024, xM =M +GB =1000*1000*1000, G =1024*1024*1024, and so on for T, P, E, Z, Y. .PP Each CONV symbol may be: .TP @@ -111,14 +111,30 @@ append mode (makes sense only for output; conv=notrunc suggested) .TP direct use direct I/O for data -.IP -directory fail unless a directory -dsync use synchronized I/O for data -sync likewise, but also for metadata -nonblock use non\-blocking I/O -noatime do not update access time -noctty do not assign controlling terminal from file -nofollow do not follow symlinks +.TP +directory +fail unless a directory +.TP +dsync +use synchronized I/O for data +.TP +sync +likewise, but also for metadata +.TP +fullblock +accumulate full blocks of input (iflag only) +.TP +nonblock +use non\-blocking I/O +.TP +noatime +do not update access time +.TP +noctty +do not assign controlling terminal from file +.TP +nofollow +do not follow symlinks .PP Sending a USR1 signal to a running `dd' process makes it print I/O statistics to standard error and then resume copying. @@ -141,12 +157,16 @@ output version information and exit .SH AUTHOR Written by Paul Rubin, David MacKenzie, and Stuart Kemp. .SH "REPORTING BUGS" -Report bugs to . -.SH COPYRIGHT -Copyright \(co 2007 Free Software Foundation, Inc. +Report dd bugs to bug\-coreutils@gnu.org .br -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License . +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" The full documentation for @@ -157,6 +177,6 @@ and .B dd programs are properly installed at your site, the command .IP -.B info dd +.B info coreutils \(aqdd invocation\(aq .PP should give you access to the complete manual. diff --git a/src/bin/coreutils/man/df.1 b/src/bin/coreutils/man/df.1 index 4ee8dc88cb..65445e64c8 100644 --- a/src/bin/coreutils/man/df.1 +++ b/src/bin/coreutils/man/df.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -.TH DF "1" "March 2007" "GNU coreutils 6.9" "User Commands" +.TH DF "1" "May 2009" "GNU coreutils 7.4" "User Commands" .SH NAME df \- report file system disk space usage .SH SYNOPSIS @@ -40,6 +40,9 @@ include dummy file systems \fB\-B\fR, \fB\-\-block\-size\fR=\fISIZE\fR use SIZE\-byte blocks .TP +\fB\-\-total\fR +produce a grand total +.TP \fB\-h\fR, \fB\-\-human\-readable\fR print sizes in human readable format (e.g., 1K 234M 2G) .TP @@ -87,12 +90,16 @@ kB 1000, K 1024, MB 1000*1000, M 1024*1024, and so on for G, T, P, E, Z, Y. .SH AUTHOR Written by Torbjorn Granlund, David MacKenzie, and Paul Eggert. .SH "REPORTING BUGS" -Report bugs to . -.SH COPYRIGHT -Copyright \(co 2007 Free Software Foundation, Inc. +Report df bugs to bug\-coreutils@gnu.org .br -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License . +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" The full documentation for @@ -103,6 +110,6 @@ and .B df programs are properly installed at your site, the command .IP -.B info df +.B info coreutils \(aqdf invocation\(aq .PP should give you access to the complete manual. diff --git a/src/bin/coreutils/man/dir.1 b/src/bin/coreutils/man/dir.1 index 71642a54ce..2cc104411d 100644 --- a/src/bin/coreutils/man/dir.1 +++ b/src/bin/coreutils/man/dir.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -.TH DIR "1" "March 2007" "GNU coreutils 6.9" "User Commands" +.TH DIR "1" "May 2009" "GNU coreutils 7.4" "User Commands" .SH NAME dir \- list directory contents .SH SYNOPSIS @@ -71,7 +71,10 @@ like \fB\-l\fR \fB\-\-time\-style\fR=\fIfull\-iso\fR like \fB\-l\fR, but do not list owner .TP \fB\-\-group\-directories\-first\fR -group directories before files +group directories before files. +.IP +augment with a \fB\-\-sort\fR option, but any +use of \fB\-\-sort\fR=\fInone\fR (\fB\-U\fR) disables grouping .TP \fB\-G\fR, \fB\-\-no\-group\fR in a long listing, don't print group names @@ -153,7 +156,7 @@ reverse order while sorting list subdirectories recursively .TP \fB\-s\fR, \fB\-\-size\fR -print the size of each file, in blocks +print the allocated size of each file, in blocks .TP \fB\-S\fR sort by file size @@ -192,7 +195,7 @@ otherwise: sort by access time do not sort; list entries in directory order .TP \fB\-v\fR -sort by version +natural sort of (version) numbers within text .TP \fB\-w\fR, \fB\-\-width\fR=\fICOLS\fR assume screen width instead of current value @@ -203,6 +206,9 @@ list entries by lines instead of by columns \fB\-X\fR sort alphabetically by entry extension .TP +\fB\-Z\fR, \fB\-\-context\fR +print any SELinux security context of each file +.TP \fB\-1\fR list one file per line .TP @@ -221,17 +227,29 @@ optional WHEN argument is equivalent to using \fB\-\-color\fR=\fIalways\fR. Wit \fB\-\-color\fR=\fIauto\fR, color codes are output only if standard output is connected to a terminal (tty). The environment variable LS_COLORS can influence the colors, and can be set easily by the dircolors command. -.PP -Exit status is 0 if OK, 1 if minor problems, 2 if serious trouble. +.SS "Exit status:" +.TP +0 +if OK, +.TP +1 +if minor problems (e.g., cannot access subdirectory), +.TP +2 +if serious trouble (e.g., cannot access command\-line argument). .SH AUTHOR -Written by Richard Stallman and David MacKenzie. +Written by Richard M. Stallman and David MacKenzie. .SH "REPORTING BUGS" -Report bugs to . -.SH COPYRIGHT -Copyright \(co 2007 Free Software Foundation, Inc. +Report dir bugs to bug\-coreutils@gnu.org .br -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License . +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" The full documentation for @@ -242,6 +260,6 @@ and .B dir programs are properly installed at your site, the command .IP -.B info dir +.B info coreutils \(aqdir invocation\(aq .PP should give you access to the complete manual. diff --git a/src/bin/coreutils/man/dircolors.1 b/src/bin/coreutils/man/dircolors.1 index 184e3f6643..3cb46bec1c 100644 --- a/src/bin/coreutils/man/dircolors.1 +++ b/src/bin/coreutils/man/dircolors.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -.TH DIRCOLORS "1" "March 2007" "GNU coreutils 6.9" "User Commands" +.TH DIRCOLORS "1" "May 2009" "GNU coreutils 7.4" "User Commands" .SH NAME dircolors \- color setup for ls .SH SYNOPSIS @@ -32,12 +32,16 @@ For details on the format of these files, run `dircolors \fB\-\-print\-database\ .SH AUTHOR Written by H. Peter Anvin. .SH "REPORTING BUGS" -Report bugs to . -.SH COPYRIGHT -Copyright \(co 2007 Free Software Foundation, Inc. +Report dircolors bugs to bug\-coreutils@gnu.org .br -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License . +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" The full documentation for @@ -48,6 +52,6 @@ and .B dircolors programs are properly installed at your site, the command .IP -.B info dircolors +.B info coreutils \(aqdircolors invocation\(aq .PP should give you access to the complete manual. diff --git a/src/bin/coreutils/man/dirname.1 b/src/bin/coreutils/man/dirname.1 index aa1d90f9e3..3fcdda2d5e 100644 --- a/src/bin/coreutils/man/dirname.1 +++ b/src/bin/coreutils/man/dirname.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -.TH DIRNAME "1" "March 2007" "GNU coreutils 6.9" "User Commands" +.TH DIRNAME "1" "May 2009" "GNU coreutils 7.4" "User Commands" .SH NAME dirname \- strip non-directory suffix from file name .SH SYNOPSIS @@ -29,12 +29,16 @@ Output ".". .SH AUTHOR Written by David MacKenzie and Jim Meyering. .SH "REPORTING BUGS" -Report bugs to . -.SH COPYRIGHT -Copyright \(co 2007 Free Software Foundation, Inc. +Report dirname bugs to bug\-coreutils@gnu.org .br -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License . +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" basename(1), readlink(1) @@ -47,6 +51,6 @@ and .B dirname programs are properly installed at your site, the command .IP -.B info dirname +.B info coreutils \(aqdirname invocation\(aq .PP should give you access to the complete manual. diff --git a/src/bin/coreutils/man/du.1 b/src/bin/coreutils/man/du.1 index 97c197dcbe..92cc3c8b58 100644 --- a/src/bin/coreutils/man/du.1 +++ b/src/bin/coreutils/man/du.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -.TH DU "1" "March 2007" "GNU coreutils 6.9" "User Commands" +.TH DU "1" "May 2009" "GNU coreutils 7.4" "User Commands" .SH NAME du \- estimate file space usage .SH SYNOPSIS @@ -34,15 +34,16 @@ equivalent to `\-\-apparent\-size \fB\-\-block\-size\fR=\fI1\fR' produce a grand total .TP \fB\-D\fR, \fB\-\-dereference\-args\fR -dereference FILEs that are symbolic links +dereference only symlinks that are listed on the +command line .TP \fB\-\-files0\-from\fR=\fIF\fR summarize disk usage of the NUL\-terminated file -names specified in file F +names specified in file F; +If F is \- then read names from standard input .TP \fB\-H\fR -like \fB\-\-si\fR, but also evokes a warning; will soon -change to be equivalent to \fB\-\-dereference\-args\fR (\fB\-D\fR) +equivalent to \fB\-\-dereference\-args\fR (\fB\-D\fR) .TP \fB\-h\fR, \fB\-\-human\-readable\fR print sizes in human readable format (e.g., 1K 234M 2G) @@ -77,11 +78,11 @@ display only a total for each argument \fB\-x\fR, \fB\-\-one\-file\-system\fR skip directories on different file systems .TP -\fB\-X\fR FILE, \fB\-\-exclude\-from\fR=\fIFILE\fR -Exclude files that match any pattern in FILE. +\fB\-X\fR, \fB\-\-exclude\-from\fR=\fIFILE\fR +exclude files that match any pattern in FILE .TP \fB\-\-exclude\fR=\fIPATTERN\fR -Exclude files that match PATTERN. +exclude files that match PATTERN .TP \fB\-\-max\-depth\fR=\fIN\fR print the total for a directory (or file, with \fB\-\-all\fR) @@ -122,7 +123,7 @@ will match any files whose names end in .BR .o . Therefore, the command .IP -.B du --exclude='*.o' +.B du --exclude=\(aq*.o\(aq .PP will skip all files and subdirectories ending in .BR .o @@ -130,14 +131,19 @@ will skip all files and subdirectories ending in .BR .o itself). .SH AUTHOR -Written by Torbjorn Granlund, David MacKenzie, Paul Eggert, and Jim Meyering. +Written by Torbjorn Granlund, David MacKenzie, Paul Eggert, +and Jim Meyering. .SH "REPORTING BUGS" -Report bugs to . -.SH COPYRIGHT -Copyright \(co 2007 Free Software Foundation, Inc. +Report du bugs to bug\-coreutils@gnu.org .br -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License . +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" The full documentation for @@ -148,6 +154,6 @@ and .B du programs are properly installed at your site, the command .IP -.B info du +.B info coreutils \(aqdu invocation\(aq .PP should give you access to the complete manual. diff --git a/src/bin/coreutils/man/du.x b/src/bin/coreutils/man/du.x index b170369742..85b9ff4491 100644 --- a/src/bin/coreutils/man/du.x +++ b/src/bin/coreutils/man/du.x @@ -19,7 +19,7 @@ will match any files whose names end in .BR .o . Therefore, the command .IP -.B du --exclude='*.o' +.B du --exclude=\(aq*.o\(aq .PP will skip all files and subdirectories ending in .BR .o diff --git a/src/bin/coreutils/man/echo.1 b/src/bin/coreutils/man/echo.1 index 95e8e36874..b2392f1cf3 100644 --- a/src/bin/coreutils/man/echo.1 +++ b/src/bin/coreutils/man/echo.1 @@ -1,10 +1,13 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -.TH ECHO "1" "March 2007" "GNU coreutils 6.9" "User Commands" +.TH ECHO "1" "May 2009" "GNU coreutils 7.4" "User Commands" .SH NAME echo \- display a line of text .SH SYNOPSIS .B echo -[\fIOPTION\fR]... [\fISTRING\fR]... +[\fISHORT-OPTION\fR]... [\fISTRING\fR]... +.br +.B echo +\fILONG-OPTION\fR .SH DESCRIPTION .\" Add any additional description here .PP @@ -40,7 +43,7 @@ alert (BEL) backspace .TP \ec -suppress trailing newline +produce no further output .TP \ef form feed @@ -61,14 +64,18 @@ NOTE: your shell may have its own version of echo, which usually supersedes the version described here. Please refer to your shell's documentation for details about the options it supports. .SH AUTHOR -Written by FIXME unknown. +Written by Brian Fox and Chet Ramey. .SH "REPORTING BUGS" -Report bugs to . -.SH COPYRIGHT -Copyright \(co 2007 Free Software Foundation, Inc. +Report echo bugs to bug\-coreutils@gnu.org .br -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License . +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" The full documentation for @@ -79,6 +86,6 @@ and .B echo programs are properly installed at your site, the command .IP -.B info echo +.B info coreutils \(aqecho invocation\(aq .PP should give you access to the complete manual. diff --git a/src/bin/coreutils/man/env.1 b/src/bin/coreutils/man/env.1 index 4361f71177..d44a553627 100644 --- a/src/bin/coreutils/man/env.1 +++ b/src/bin/coreutils/man/env.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -.TH ENV "1" "March 2007" "GNU coreutils 6.9" "User Commands" +.TH ENV "1" "May 2009" "GNU coreutils 7.4" "User Commands" .SH NAME env \- run a program in a modified environment .SH SYNOPSIS @@ -26,12 +26,16 @@ A mere \- implies \fB\-i\fR. If no COMMAND, print the resulting environment. .SH AUTHOR Written by Richard Mlynarik and David MacKenzie. .SH "REPORTING BUGS" -Report bugs to . -.SH COPYRIGHT -Copyright \(co 2007 Free Software Foundation, Inc. +Report env bugs to bug\-coreutils@gnu.org .br -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License . +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" The full documentation for @@ -42,6 +46,6 @@ and .B env programs are properly installed at your site, the command .IP -.B info env +.B info coreutils \(aqenv invocation\(aq .PP should give you access to the complete manual. diff --git a/src/bin/coreutils/man/expand.1 b/src/bin/coreutils/man/expand.1 index 464bc6c096..d5d83c9a49 100644 --- a/src/bin/coreutils/man/expand.1 +++ b/src/bin/coreutils/man/expand.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -.TH EXPAND "1" "March 2007" "GNU coreutils 6.9" "User Commands" +.TH EXPAND "1" "May 2009" "GNU coreutils 7.4" "User Commands" .SH NAME expand \- convert tabs to spaces .SH SYNOPSIS @@ -30,12 +30,16 @@ output version information and exit .SH AUTHOR Written by David MacKenzie. .SH "REPORTING BUGS" -Report bugs to . -.SH COPYRIGHT -Copyright \(co 2007 Free Software Foundation, Inc. +Report expand bugs to bug\-coreutils@gnu.org .br -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License . +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" unexpand(1) @@ -48,6 +52,6 @@ and .B expand programs are properly installed at your site, the command .IP -.B info expand +.B info coreutils \(aqexpand invocation\(aq .PP should give you access to the complete manual. diff --git a/src/bin/coreutils/man/expr.1 b/src/bin/coreutils/man/expr.1 index 3f1823e69e..1a1e142317 100644 --- a/src/bin/coreutils/man/expr.1 +++ b/src/bin/coreutils/man/expr.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -.TH EXPR "1" "March 2007" "GNU coreutils 6.9" "User Commands" +.TH EXPR "1" "May 2009" "GNU coreutils 7.4" "User Commands" .SH NAME expr \- evaluate expressions .SH SYNOPSIS @@ -90,14 +90,18 @@ Pattern matches return the string matched between \e( and \e) or null; if Exit status is 0 if EXPRESSION is neither null nor 0, 1 if EXPRESSION is null or 0, 2 if EXPRESSION is syntactically invalid, and 3 if an error occurred. .SH AUTHOR -Written by Mike Parker. +Written by Mike Parker, James Youngman, and Paul Eggert. .SH "REPORTING BUGS" -Report bugs to . -.SH COPYRIGHT -Copyright \(co 2007 Free Software Foundation, Inc. +Report expr bugs to bug\-coreutils@gnu.org .br -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License . +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" The full documentation for @@ -108,6 +112,6 @@ and .B expr programs are properly installed at your site, the command .IP -.B info expr +.B info coreutils \(aqexpr invocation\(aq .PP should give you access to the complete manual. diff --git a/src/bin/coreutils/man/factor.1 b/src/bin/coreutils/man/factor.1 index e97e626ce7..60be800f58 100644 --- a/src/bin/coreutils/man/factor.1 +++ b/src/bin/coreutils/man/factor.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -.TH FACTOR "1" "March 2007" "GNU coreutils 6.9" "User Commands" +.TH FACTOR "1" "May 2009" "GNU coreutils 7.4" "User Commands" .SH NAME factor \- factor numbers .SH SYNOPSIS @@ -11,25 +11,27 @@ factor \- factor numbers .SH DESCRIPTION .\" Add any additional description here .PP -Print the prime factors of each NUMBER. +Print the prime factors of each specified integer NUMBER. If none +are specified on the command line, read them from standard input. .TP \fB\-\-help\fR display this help and exit .TP \fB\-\-version\fR output version information and exit -.PP -Print the prime factors of all specified integer NUMBERs. If no arguments -are specified on the command line, they are read from standard input. .SH AUTHOR Written by Paul Rubin. .SH "REPORTING BUGS" -Report bugs to . -.SH COPYRIGHT -Copyright \(co 2007 Free Software Foundation, Inc. +Report factor bugs to bug\-coreutils@gnu.org .br -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License . +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" The full documentation for @@ -40,6 +42,6 @@ and .B factor programs are properly installed at your site, the command .IP -.B info factor +.B info coreutils \(aqfactor invocation\(aq .PP should give you access to the complete manual. diff --git a/src/bin/coreutils/man/false.1 b/src/bin/coreutils/man/false.1 index 5ab2adccd9..f1658a8c60 100644 --- a/src/bin/coreutils/man/false.1 +++ b/src/bin/coreutils/man/false.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -.TH FALSE "1" "March 2007" "GNU coreutils 6.9" "User Commands" +.TH FALSE "1" "May 2009" "GNU coreutils 7.4" "User Commands" .SH NAME false \- do nothing, unsuccessfully .SH SYNOPSIS @@ -25,12 +25,16 @@ for details about the options it supports. .SH AUTHOR Written by Jim Meyering. .SH "REPORTING BUGS" -Report bugs to . -.SH COPYRIGHT -Copyright \(co 2007 Free Software Foundation, Inc. +Report false bugs to bug\-coreutils@gnu.org .br -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License . +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" The full documentation for @@ -41,6 +45,6 @@ and .B false programs are properly installed at your site, the command .IP -.B info false +.B info coreutils \(aqfalse invocation\(aq .PP should give you access to the complete manual. diff --git a/src/bin/coreutils/man/fmt.1 b/src/bin/coreutils/man/fmt.1 index 9e46ca0e4f..ef48ec7526 100644 --- a/src/bin/coreutils/man/fmt.1 +++ b/src/bin/coreutils/man/fmt.1 @@ -1,15 +1,15 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -.TH FMT "1" "March 2007" "GNU coreutils 6.9" "User Commands" +.TH FMT "1" "May 2009" "GNU coreutils 7.4" "User Commands" .SH NAME fmt \- simple optimal text formatter .SH SYNOPSIS .B fmt -[\fI-DIGITS\fR] [\fIOPTION\fR]... [\fIFILE\fR]... +[\fI-WIDTH\fR] [\fIOPTION\fR]... [\fIFILE\fR]... .SH DESCRIPTION .\" Add any additional description here .PP Reformat each paragraph in the FILE(s), writing to standard output. -If no FILE or if FILE is `\-', read standard input. +The option \fB\-WIDTH\fR is an abbreviated form of \fB\-\-width\fR=\fIDIGITS\fR. .PP Mandatory arguments to long options are mandatory for short options too. .TP @@ -42,12 +42,16 @@ With no FILE, or when FILE is \-, read standard input. .SH AUTHOR Written by Ross Paterson. .SH "REPORTING BUGS" -Report bugs to . -.SH COPYRIGHT -Copyright \(co 2007 Free Software Foundation, Inc. +Report fmt bugs to bug\-coreutils@gnu.org .br -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License . +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" The full documentation for @@ -58,6 +62,6 @@ and .B fmt programs are properly installed at your site, the command .IP -.B info fmt +.B info coreutils \(aqfmt invocation\(aq .PP should give you access to the complete manual. diff --git a/src/bin/coreutils/man/fold.1 b/src/bin/coreutils/man/fold.1 index dce87bd0fa..eaf5b64c67 100644 --- a/src/bin/coreutils/man/fold.1 +++ b/src/bin/coreutils/man/fold.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -.TH FOLD "1" "March 2007" "GNU coreutils 6.9" "User Commands" +.TH FOLD "1" "May 2009" "GNU coreutils 7.4" "User Commands" .SH NAME fold \- wrap each input line to fit in specified width .SH SYNOPSIS @@ -30,12 +30,16 @@ output version information and exit .SH AUTHOR Written by David MacKenzie. .SH "REPORTING BUGS" -Report bugs to . -.SH COPYRIGHT -Copyright \(co 2007 Free Software Foundation, Inc. +Report fold bugs to bug\-coreutils@gnu.org .br -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License . +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" The full documentation for @@ -46,6 +50,6 @@ and .B fold programs are properly installed at your site, the command .IP -.B info fold +.B info coreutils \(aqfold invocation\(aq .PP should give you access to the complete manual. diff --git a/src/bin/coreutils/man/groups.1 b/src/bin/coreutils/man/groups.1 index 1d3b815f38..ca04aa38ea 100644 --- a/src/bin/coreutils/man/groups.1 +++ b/src/bin/coreutils/man/groups.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -.TH GROUPS "1" "March 2007" "GNU coreutils 6.9" "User Commands" +.TH GROUPS "1" "May 2009" "GNU coreutils 7.4" "User Commands" .SH NAME groups \- print the groups a user is in .SH SYNOPSIS @@ -7,23 +7,28 @@ groups \- print the groups a user is in [\fIOPTION\fR]... [\fIUSERNAME\fR]... .SH DESCRIPTION .\" Add any additional description here +.PP +Print group memberships for each USERNAME or, if no USERNAME is specified, for +the current process (which may differ if the groups database has changed). .TP \fB\-\-help\fR display this help and exit .TP \fB\-\-version\fR output version information and exit -.PP -Same as id \fB\-Gn\fR. If no USERNAME, use current process. .SH AUTHOR -Written by David MacKenzie. +Written by David MacKenzie and James Youngman. .SH "REPORTING BUGS" -Report bugs to . -.SH COPYRIGHT -Copyright \(co 2007 Free Software Foundation, Inc. +Report groups bugs to bug\-coreutils@gnu.org .br -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License . +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" The full documentation for @@ -34,6 +39,6 @@ and .B groups programs are properly installed at your site, the command .IP -.B info groups +.B info coreutils \(aqgroups invocation\(aq .PP should give you access to the complete manual. diff --git a/src/bin/coreutils/man/head.1 b/src/bin/coreutils/man/head.1 index ce0aa834af..2cbbe0dfb3 100644 --- a/src/bin/coreutils/man/head.1 +++ b/src/bin/coreutils/man/head.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -.TH HEAD "1" "March 2007" "GNU coreutils 6.9" "User Commands" +.TH HEAD "1" "May 2009" "GNU coreutils 7.4" "User Commands" .SH NAME head \- output the first part of files .SH SYNOPSIS @@ -36,16 +36,22 @@ display this help and exit \fB\-\-version\fR output version information and exit .PP -N may have a multiplier suffix: b 512, k 1024, m 1024*1024. +N may have a multiplier suffix: +b 512, kB 1000, K 1024, MB 1000*1000, M 1024*1024, +GB 1000*1000*1000, G 1024*1024*1024, and so on for T, P, E, Z, Y. .SH AUTHOR Written by David MacKenzie and Jim Meyering. .SH "REPORTING BUGS" -Report bugs to . -.SH COPYRIGHT -Copyright \(co 2007 Free Software Foundation, Inc. +Report head bugs to bug\-coreutils@gnu.org .br -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License . +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" The full documentation for @@ -56,6 +62,6 @@ and .B head programs are properly installed at your site, the command .IP -.B info head +.B info coreutils \(aqhead invocation\(aq .PP should give you access to the complete manual. diff --git a/src/bin/coreutils/man/help2man b/src/bin/coreutils/man/help2man index 192576c359..7b7ce7a4b0 100755 --- a/src/bin/coreutils/man/help2man +++ b/src/bin/coreutils/man/help2man @@ -1,13 +1,13 @@ #!/usr/bin/perl -w # Generate a short man page from --help and --version output. -# Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 +# Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2008, 2009 # Free Software Foundation, Inc. -# This program is free software; you can redistribute it and/or modify +# This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -15,8 +15,7 @@ # GNU General Public License for more details. # You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# along with this program. If not, see . # Written by Brendan O'Dea # Available from ftp://ftp.gnu.org/gnu/help2man/ @@ -35,7 +34,7 @@ my $have_gettext; BEGIN { eval { require Locale::gettext; - Locale::gettext->import; + Locale::gettext->import (qw(gettext textdomain)); $have_gettext = 1; }; @@ -135,7 +134,7 @@ die $help_info unless @ARGV == 1; die "$this_program: no locale support (Locale::gettext required)\n" unless $locale eq 'C' or $have_gettext; -# Set localisation of date and executable's ouput. +# Set localization of date and executable's output. delete @ENV{qw(LANGUAGE LC_MESSAGES LANG)}; setlocale LC_ALL, $ENV{LC_ALL} = $locale; @@ -369,7 +368,7 @@ s/^\./\x80/mg; s/^'/\x81/mg; s/\\/\x82/g; -my $PAT_BUGS = _('Report +bugs|Email +bug +reports +to'); +my $PAT_BUGS = _('Report +(?:\w+ +)?bugs|Email +bug +reports +to'); my $PAT_AUTHOR = _('Written +by'); my $PAT_OPTIONS = _('Options'); my $PAT_EXAMPLES = _('Examples'); @@ -568,7 +567,7 @@ and .B %s programs are properly installed at your site, the command .IP -.B info %s +.B info coreutils \(aq%s invocation\(aq .PP should give you access to the complete manual. EOT @@ -608,6 +607,9 @@ for my $sect (@pre, (grep ! /^($filter)$/o, @include), @post) # Convert some latin1 chars to troff equivalents s/\xa0/\\ /g; # non-breaking space + $sect eq 'REPORTING BUGS' + and s/\n(.)/\n.br\n$1/g; + print; } } diff --git a/src/bin/coreutils/man/hostid.1 b/src/bin/coreutils/man/hostid.1 index 4d1621a34f..06b97b6bbc 100644 --- a/src/bin/coreutils/man/hostid.1 +++ b/src/bin/coreutils/man/hostid.1 @@ -1,13 +1,10 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -.TH HOSTID "1" "March 2007" "GNU coreutils 6.9" "User Commands" +.TH HOSTID "1" "May 2009" "GNU coreutils 7.4" "User Commands" .SH NAME hostid \- print the numeric identifier for the current host .SH SYNOPSIS .B hostid - -.br -.B hostid -\fIOPTION\fR +[\fIOPTION\fR] .SH DESCRIPTION .\" Add any additional description here .PP @@ -21,12 +18,16 @@ output version information and exit .SH AUTHOR Written by Jim Meyering. .SH "REPORTING BUGS" -Report bugs to . -.SH COPYRIGHT -Copyright \(co 2007 Free Software Foundation, Inc. +Report hostid bugs to bug\-coreutils@gnu.org .br -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License . +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" The full documentation for @@ -37,6 +38,6 @@ and .B hostid programs are properly installed at your site, the command .IP -.B info hostid +.B info coreutils \(aqhostid invocation\(aq .PP should give you access to the complete manual. diff --git a/src/bin/coreutils/man/hostname.1 b/src/bin/coreutils/man/hostname.1 deleted file mode 100644 index cd74a137d7..0000000000 --- a/src/bin/coreutils/man/hostname.1 +++ /dev/null @@ -1,42 +0,0 @@ -.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -.TH HOSTNAME "1" "March 2007" "GNU coreutils 6.9" "User Commands" -.SH NAME -hostname \- set or print the name of the current host system -.SH SYNOPSIS -.B hostname -[\fINAME\fR] -.br -.B hostname -\fIOPTION\fR -.SH DESCRIPTION -.\" Add any additional description here -.PP -Print or set the hostname of the current system. -.TP -\fB\-\-help\fR -display this help and exit -.TP -\fB\-\-version\fR -output version information and exit -.SH AUTHOR -Written by Jim Meyering. -.SH "REPORTING BUGS" -Report bugs to . -.SH COPYRIGHT -Copyright \(co 2007 Free Software Foundation, Inc. -.br -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License . -There is NO WARRANTY, to the extent permitted by law. -.SH "SEE ALSO" -The full documentation for -.B hostname -is maintained as a Texinfo manual. If the -.B info -and -.B hostname -programs are properly installed at your site, the command -.IP -.B info hostname -.PP -should give you access to the complete manual. diff --git a/src/bin/coreutils/man/id.1 b/src/bin/coreutils/man/id.1 index b371dbb37c..053603e003 100644 --- a/src/bin/coreutils/man/id.1 +++ b/src/bin/coreutils/man/id.1 @@ -1,18 +1,22 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -.TH ID "1" "March 2007" "GNU coreutils 6.9" "User Commands" +.TH ID "1" "May 2009" "GNU coreutils 7.4" "User Commands" .SH NAME -id \- print user identity +id \- print real and effective user and group IDs .SH SYNOPSIS .B id [\fIOPTION\fR]... [\fIUSERNAME\fR] .SH DESCRIPTION .\" Add any additional description here .PP -Print information for USERNAME, or the current user. +Print user and group information for the specified USERNAME, +or (when USERNAME omitted) for the current user. .TP \fB\-a\fR ignore, for compatibility with other versions .TP +\fB\-Z\fR, \fB\-\-context\fR +print only the security context of the current user +.TP \fB\-g\fR, \fB\-\-group\fR print only the effective group ID .TP @@ -38,12 +42,16 @@ Without any OPTION, print some useful set of identified information. .SH AUTHOR Written by Arnold Robbins and David MacKenzie. .SH "REPORTING BUGS" -Report bugs to . -.SH COPYRIGHT -Copyright \(co 2007 Free Software Foundation, Inc. +Report id bugs to bug\-coreutils@gnu.org .br -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License . +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" The full documentation for @@ -54,6 +62,6 @@ and .B id programs are properly installed at your site, the command .IP -.B info id +.B info coreutils \(aqid invocation\(aq .PP should give you access to the complete manual. diff --git a/src/bin/coreutils/man/id.x b/src/bin/coreutils/man/id.x index 4c990ac299..d55b3262ce 100644 --- a/src/bin/coreutils/man/id.x +++ b/src/bin/coreutils/man/id.x @@ -1,4 +1,4 @@ [NAME] -id \- print user identity +id \- print real and effective user and group IDs [DESCRIPTION] .\" Add any additional description here diff --git a/src/bin/coreutils/man/install.1 b/src/bin/coreutils/man/install.1 index d5b565d7d6..8ac288d114 100644 --- a/src/bin/coreutils/man/install.1 +++ b/src/bin/coreutils/man/install.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -.TH INSTALL "1" "March 2007" "GNU coreutils 6.9" "User Commands" +.TH INSTALL "1" "May 2009" "GNU coreutils 7.4" "User Commands" .SH NAME install \- copy files and set attributes .SH SYNOPSIS @@ -17,6 +17,11 @@ install \- copy files and set attributes .SH DESCRIPTION .\" Add any additional description here .PP +This install program copies files (often just compiled) into destination +locations you choose. If you want to download and install a ready\-to\-use +package on a GNU/Linux system, you should instead be using a package manager +like yum(1) or apt\-get(1). +.PP In the first three forms, copy SOURCE to DEST or multiple SOURCE(s) to the existing DIRECTORY, while setting permission modes and owner/group. In the 4th form, create all components of the given DIRECTORY(ies). @@ -32,6 +37,10 @@ like \fB\-\-backup\fR but does not accept an argument \fB\-c\fR (ignored) .TP +\fB\-C\fR, \fB\-\-compare\fR +compare each pair of source and destination files, and +in some cases, do not modify the destination at all +.TP \fB\-d\fR, \fB\-\-directory\fR treat all arguments as directory names; create all components of the specified directories @@ -56,6 +65,9 @@ to corresponding destination files \fB\-s\fR, \fB\-\-strip\fR strip symbol tables .TP +\fB\-\-strip\-program\fR=\fIPROGRAM\fR +program used to strip binaries +.TP \fB\-S\fR, \fB\-\-suffix\fR=\fISUFFIX\fR override the usual backup suffix .TP @@ -68,6 +80,12 @@ treat DEST as a normal file \fB\-v\fR, \fB\-\-verbose\fR print the name of each directory as it is created .TP +\fB\-\-preserve\-context\fR +preserve SELinux security context +.TP +\fB\-Z\fR, \fB\-\-context\fR=\fICONTEXT\fR +set SELinux security context of files and directories +.TP \fB\-\-help\fR display this help and exit .TP @@ -92,12 +110,16 @@ always make simple backups .SH AUTHOR Written by David MacKenzie. .SH "REPORTING BUGS" -Report bugs to . -.SH COPYRIGHT -Copyright \(co 2007 Free Software Foundation, Inc. +Report install bugs to bug\-coreutils@gnu.org .br -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License . +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" The full documentation for @@ -108,6 +130,6 @@ and .B install programs are properly installed at your site, the command .IP -.B info install +.B info coreutils \(aqinstall invocation\(aq .PP should give you access to the complete manual. diff --git a/src/bin/coreutils/man/join.1 b/src/bin/coreutils/man/join.1 index 4aeedffa7a..2d1b919917 100644 --- a/src/bin/coreutils/man/join.1 +++ b/src/bin/coreutils/man/join.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -.TH JOIN "1" "March 2007" "GNU coreutils 6.9" "User Commands" +.TH JOIN "1" "May 2009" "GNU coreutils 7.4" "User Commands" .SH NAME join \- join lines of two files on a common field .SH SYNOPSIS @@ -40,6 +40,13 @@ join on this FIELD of file 1 \fB\-2\fR FIELD join on this FIELD of file 2 .TP +\fB\-\-check\-order\fR +check that the input is correctly sorted, even +if all input lines are pairable +.TP +\fB\-\-nocheck\-order\fR +do not check that the input is correctly sorted +.TP \fB\-\-help\fR display this help and exit .TP @@ -55,15 +62,22 @@ separated by CHAR. .PP Important: FILE1 and FILE2 must be sorted on the join fields. E.g., use `sort \fB\-k\fR 1b,1' if `join' has no options. +Note, comparisons honor the rules specified by `LC_COLLATE'. +If the input is not sorted and some lines cannot be joined, a +warning message will be given. .SH AUTHOR Written by Mike Haertel. .SH "REPORTING BUGS" -Report bugs to . -.SH COPYRIGHT -Copyright \(co 2007 Free Software Foundation, Inc. +Report join bugs to bug\-coreutils@gnu.org .br -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License . +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" The full documentation for @@ -74,6 +88,6 @@ and .B join programs are properly installed at your site, the command .IP -.B info join +.B info coreutils \(aqjoin invocation\(aq .PP should give you access to the complete manual. diff --git a/src/bin/coreutils/man/kill.1 b/src/bin/coreutils/man/kill.1 index ab7b7dbd99..a4287653a0 100644 --- a/src/bin/coreutils/man/kill.1 +++ b/src/bin/coreutils/man/kill.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -.TH KILL "1" "March 2007" "GNU coreutils 6.9" "User Commands" +.TH KILL "1" "May 2009" "GNU coreutils 7.4" "User Commands" .SH NAME kill \- send signals to processes, or list signals .SH SYNOPSIS @@ -35,7 +35,7 @@ display this help and exit output version information and exit .PP SIGNAL may be a signal name like `HUP', or a signal number like `1', -or an exit status of a process terminated by a signal. +or the exit status of a process terminated by a signal. PID is an integer; if negative it identifies a process group. .PP NOTE: your shell may have its own version of kill, which usually supersedes @@ -44,12 +44,16 @@ for details about the options it supports. .SH AUTHOR Written by Paul Eggert. .SH "REPORTING BUGS" -Report bugs to . -.SH COPYRIGHT -Copyright \(co 2007 Free Software Foundation, Inc. +Report kill bugs to bug\-coreutils@gnu.org .br -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License . +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" kill(2) @@ -62,6 +66,6 @@ and .B kill programs are properly installed at your site, the command .IP -.B info kill +.B info coreutils \(aqkill invocation\(aq .PP should give you access to the complete manual. diff --git a/src/bin/coreutils/man/link.1 b/src/bin/coreutils/man/link.1 index 7c91888bf7..bd4ba2f4f8 100644 --- a/src/bin/coreutils/man/link.1 +++ b/src/bin/coreutils/man/link.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -.TH LINK "1" "March 2007" "GNU coreutils 6.9" "User Commands" +.TH LINK "1" "May 2009" "GNU coreutils 7.4" "User Commands" .SH NAME link \- call the link function to create a link to a file .SH SYNOPSIS @@ -21,12 +21,16 @@ output version information and exit .SH AUTHOR Written by Michael Stone. .SH "REPORTING BUGS" -Report bugs to . -.SH COPYRIGHT -Copyright \(co 2007 Free Software Foundation, Inc. +Report link bugs to bug\-coreutils@gnu.org .br -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License . +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" link(2) @@ -39,6 +43,6 @@ and .B link programs are properly installed at your site, the command .IP -.B info link +.B info coreutils \(aqlink invocation\(aq .PP should give you access to the complete manual. diff --git a/src/bin/coreutils/man/ln.1 b/src/bin/coreutils/man/ln.1 index eb837ea6f7..6f9fe9f914 100644 --- a/src/bin/coreutils/man/ln.1 +++ b/src/bin/coreutils/man/ln.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -.TH LN "1" "March 2007" "GNU coreutils 6.9" "User Commands" +.TH LN "1" "May 2009" "GNU coreutils 7.4" "User Commands" .SH NAME ln \- make links between files .SH SYNOPSIS @@ -21,7 +21,9 @@ In the 1st form, create a link to TARGET with the name LINK_NAME. In the 2nd form, create a link to TARGET in the current directory. In the 3rd and 4th forms, create links to each TARGET in DIRECTORY. Create hard links by default, symbolic links with \fB\-\-symbolic\fR. -When creating hard links, each TARGET must exist. +When creating hard links, each TARGET must exist. Symbolic links +can hold arbitrary text; if later resolved, a relative link is +interpreted in relation to its parent directory. .PP Mandatory arguments to long options are mandatory for short options too. .TP @@ -86,12 +88,16 @@ always make simple backups .SH AUTHOR Written by Mike Parker and David MacKenzie. .SH "REPORTING BUGS" -Report bugs to . -.SH COPYRIGHT -Copyright \(co 2007 Free Software Foundation, Inc. +Report ln bugs to bug\-coreutils@gnu.org .br -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License . +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" link(2), symlink(2) @@ -104,6 +110,6 @@ and .B ln programs are properly installed at your site, the command .IP -.B info ln +.B info coreutils \(aqln invocation\(aq .PP should give you access to the complete manual. diff --git a/src/bin/coreutils/man/logname.1 b/src/bin/coreutils/man/logname.1 index 0e59e2fc81..873073fc84 100644 --- a/src/bin/coreutils/man/logname.1 +++ b/src/bin/coreutils/man/logname.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -.TH LOGNAME "1" "March 2007" "GNU coreutils 6.9" "User Commands" +.TH LOGNAME "1" "May 2009" "GNU coreutils 7.4" "User Commands" .SH NAME logname \- print user\'s login name .SH SYNOPSIS @@ -18,12 +18,16 @@ output version information and exit .SH AUTHOR Written by FIXME: unknown. .SH "REPORTING BUGS" -Report bugs to . -.SH COPYRIGHT -Copyright \(co 2007 Free Software Foundation, Inc. +Report logname bugs to bug\-coreutils@gnu.org .br -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License . +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" The full documentation for @@ -34,6 +38,6 @@ and .B logname programs are properly installed at your site, the command .IP -.B info logname +.B info coreutils \(aqlogname invocation\(aq .PP should give you access to the complete manual. diff --git a/src/bin/coreutils/man/ls.1 b/src/bin/coreutils/man/ls.1 index 95b08f4063..ebb2d49233 100644 --- a/src/bin/coreutils/man/ls.1 +++ b/src/bin/coreutils/man/ls.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -.TH LS "1" "March 2007" "GNU coreutils 6.9" "User Commands" +.TH LS "1" "May 2009" "GNU coreutils 7.4" "User Commands" .SH NAME ls \- list directory contents .SH SYNOPSIS @@ -71,7 +71,10 @@ like \fB\-l\fR \fB\-\-time\-style\fR=\fIfull\-iso\fR like \fB\-l\fR, but do not list owner .TP \fB\-\-group\-directories\-first\fR -group directories before files +group directories before files. +.IP +augment with a \fB\-\-sort\fR option, but any +use of \fB\-\-sort\fR=\fInone\fR (\fB\-U\fR) disables grouping .TP \fB\-G\fR, \fB\-\-no\-group\fR in a long listing, don't print group names @@ -153,7 +156,7 @@ reverse order while sorting list subdirectories recursively .TP \fB\-s\fR, \fB\-\-size\fR -print the size of each file, in blocks +print the allocated size of each file, in blocks .TP \fB\-S\fR sort by file size @@ -192,7 +195,7 @@ otherwise: sort by access time do not sort; list entries in directory order .TP \fB\-v\fR -sort by version +natural sort of (version) numbers within text .TP \fB\-w\fR, \fB\-\-width\fR=\fICOLS\fR assume screen width instead of current value @@ -203,6 +206,9 @@ list entries by lines instead of by columns \fB\-X\fR sort alphabetically by entry extension .TP +\fB\-Z\fR, \fB\-\-context\fR +print any SELinux security context of each file +.TP \fB\-1\fR list one file per line .TP @@ -221,17 +227,29 @@ optional WHEN argument is equivalent to using \fB\-\-color\fR=\fIalways\fR. Wit \fB\-\-color\fR=\fIauto\fR, color codes are output only if standard output is connected to a terminal (tty). The environment variable LS_COLORS can influence the colors, and can be set easily by the dircolors command. -.PP -Exit status is 0 if OK, 1 if minor problems, 2 if serious trouble. +.SS "Exit status:" +.TP +0 +if OK, +.TP +1 +if minor problems (e.g., cannot access subdirectory), +.TP +2 +if serious trouble (e.g., cannot access command\-line argument). .SH AUTHOR -Written by Richard Stallman and David MacKenzie. +Written by Richard M. Stallman and David MacKenzie. .SH "REPORTING BUGS" -Report bugs to . -.SH COPYRIGHT -Copyright \(co 2007 Free Software Foundation, Inc. +Report ls bugs to bug\-coreutils@gnu.org .br -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License . +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" The full documentation for @@ -242,6 +260,6 @@ and .B ls programs are properly installed at your site, the command .IP -.B info ls +.B info coreutils \(aqls invocation\(aq .PP should give you access to the complete manual. diff --git a/src/bin/coreutils/man/md5sum.1 b/src/bin/coreutils/man/md5sum.1 index 70848c4d26..921e61795e 100644 --- a/src/bin/coreutils/man/md5sum.1 +++ b/src/bin/coreutils/man/md5sum.1 @@ -1,10 +1,10 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -.TH MD5SUM "1" "March 2007" "GNU coreutils 6.9" "User Commands" +.TH MD5SUM "1" "May 2009" "GNU coreutils 7.4" "User Commands" .SH NAME md5sum \- compute and check MD5 message digest .SH SYNOPSIS .B md5sum -[\fIOPTION\fR] [\fIFILE\fR]... +[\fIOPTION\fR]... [\fIFILE\fR]... .SH DESCRIPTION .\" Add any additional description here .PP @@ -19,7 +19,10 @@ read MD5 sums from the FILEs and check them .TP \fB\-t\fR, \fB\-\-text\fR read in text mode (default) -.SS "The following two options are useful only when verifying checksums:" +.SS "The following three options are useful only when verifying checksums:" +.TP +\fB\-\-quiet\fR +don't print OK for each successfully verified file .TP \fB\-\-status\fR don't output anything, status code shows success @@ -40,12 +43,16 @@ text), and name for each FILE. .SH AUTHOR Written by Ulrich Drepper, Scott Miller, and David Madore. .SH "REPORTING BUGS" -Report bugs to . -.SH COPYRIGHT -Copyright \(co 2007 Free Software Foundation, Inc. +Report md5sum bugs to bug\-coreutils@gnu.org .br -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License . +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" The full documentation for @@ -56,6 +63,6 @@ and .B md5sum programs are properly installed at your site, the command .IP -.B info md5sum +.B info coreutils \(aqmd5sum invocation\(aq .PP should give you access to the complete manual. diff --git a/src/bin/coreutils/man/mkdir.1 b/src/bin/coreutils/man/mkdir.1 index 8d6c3861a4..42c02ea725 100644 --- a/src/bin/coreutils/man/mkdir.1 +++ b/src/bin/coreutils/man/mkdir.1 @@ -1,10 +1,10 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -.TH MKDIR "1" "March 2007" "GNU coreutils 6.9" "User Commands" +.TH MKDIR "1" "May 2009" "GNU coreutils 7.4" "User Commands" .SH NAME mkdir \- make directories .SH SYNOPSIS .B mkdir -[\fIOPTION\fR] \fIDIRECTORY\fR... +[\fIOPTION\fR]... \fIDIRECTORY\fR... .SH DESCRIPTION .\" Add any additional description here .PP @@ -21,6 +21,10 @@ no error if existing, make parent directories as needed \fB\-v\fR, \fB\-\-verbose\fR print a message for each created directory .TP +\fB\-Z\fR, \fB\-\-context\fR=\fICTX\fR +set the SELinux security context of each created +directory to CTX +.TP \fB\-\-help\fR display this help and exit .TP @@ -29,12 +33,16 @@ output version information and exit .SH AUTHOR Written by David MacKenzie. .SH "REPORTING BUGS" -Report bugs to . -.SH COPYRIGHT -Copyright \(co 2007 Free Software Foundation, Inc. +Report mkdir bugs to bug\-coreutils@gnu.org .br -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License . +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" mkdir(2) @@ -47,6 +55,6 @@ and .B mkdir programs are properly installed at your site, the command .IP -.B info mkdir +.B info coreutils \(aqmkdir invocation\(aq .PP should give you access to the complete manual. diff --git a/src/bin/coreutils/man/mkfifo.1 b/src/bin/coreutils/man/mkfifo.1 index 86ab15f8a6..0b1f67d776 100644 --- a/src/bin/coreutils/man/mkfifo.1 +++ b/src/bin/coreutils/man/mkfifo.1 @@ -1,10 +1,10 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -.TH MKFIFO "1" "March 2007" "GNU coreutils 6.9" "User Commands" +.TH MKFIFO "1" "May 2009" "GNU coreutils 7.4" "User Commands" .SH NAME mkfifo \- make FIFOs (named pipes) .SH SYNOPSIS .B mkfifo -[\fIOPTION\fR] \fINAME\fR... +[\fIOPTION\fR]... \fINAME\fR... .SH DESCRIPTION .\" Add any additional description here .PP @@ -15,6 +15,9 @@ Mandatory arguments to long options are mandatory for short options too. \fB\-m\fR, \fB\-\-mode\fR=\fIMODE\fR set file permission bits to MODE, not a=rw \- umask .TP +\fB\-Z\fR, \fB\-\-context\fR=\fICTX\fR +set the SELinux security context of each NAME to CTX +.TP \fB\-\-help\fR display this help and exit .TP @@ -23,12 +26,16 @@ output version information and exit .SH AUTHOR Written by David MacKenzie. .SH "REPORTING BUGS" -Report bugs to . -.SH COPYRIGHT -Copyright \(co 2007 Free Software Foundation, Inc. +Report mkfifo bugs to bug\-coreutils@gnu.org .br -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License . +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" mkfifo(3) @@ -41,6 +48,6 @@ and .B mkfifo programs are properly installed at your site, the command .IP -.B info mkfifo +.B info coreutils \(aqmkfifo invocation\(aq .PP should give you access to the complete manual. diff --git a/src/bin/coreutils/man/mknod.1 b/src/bin/coreutils/man/mknod.1 index b20deae535..7c9986c98b 100644 --- a/src/bin/coreutils/man/mknod.1 +++ b/src/bin/coreutils/man/mknod.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -.TH MKNOD "1" "March 2007" "GNU coreutils 6.9" "User Commands" +.TH MKNOD "1" "May 2009" "GNU coreutils 7.4" "User Commands" .SH NAME mknod \- make block or character special files .SH SYNOPSIS @@ -15,6 +15,9 @@ Mandatory arguments to long options are mandatory for short options too. \fB\-m\fR, \fB\-\-mode\fR=\fIMODE\fR set file permission bits to MODE, not a=rw \- umask .TP +\fB\-Z\fR, \fB\-\-context\fR=\fICTX\fR +set the SELinux security context of NAME to CTX +.TP \fB\-\-help\fR display this help and exit .TP @@ -34,15 +37,23 @@ create a character (unbuffered) special file .TP p create a FIFO +.PP +NOTE: your shell may have its own version of mknod, which usually supersedes +the version described here. Please refer to your shell's documentation +for details about the options it supports. .SH AUTHOR Written by David MacKenzie. .SH "REPORTING BUGS" -Report bugs to . -.SH COPYRIGHT -Copyright \(co 2007 Free Software Foundation, Inc. +Report mknod bugs to bug\-coreutils@gnu.org .br -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License . +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" mknod(2) @@ -55,6 +66,6 @@ and .B mknod programs are properly installed at your site, the command .IP -.B info mknod +.B info coreutils \(aqmknod invocation\(aq .PP should give you access to the complete manual. diff --git a/src/bin/coreutils/man/mktemp.1 b/src/bin/coreutils/man/mktemp.1 new file mode 100644 index 0000000000..f067e0b524 --- /dev/null +++ b/src/bin/coreutils/man/mktemp.1 @@ -0,0 +1,70 @@ +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. +.TH MKTEMP "1" "May 2009" "GNU coreutils 7.4" "User Commands" +.SH NAME +mktemp \- create a temporary file or directory +.SH SYNOPSIS +.B mktemp +[\fIOPTION\fR]... [\fITEMPLATE\fR] +.SH DESCRIPTION +.\" Add any additional description here +.PP +Create a temporary file or directory, safely, and print its name. +If TEMPLATE is not specified, use tmp.XXXXXXXXXX. +.TP +\fB\-d\fR, \fB\-\-directory\fR +create a directory, not a file +.TP +\fB\-q\fR, \fB\-\-quiet\fR +suppress diagnostics about file/dir\-creation failure +.TP +\fB\-u\fR, \fB\-\-dry\-run\fR +do not create anything; merely print a name (unsafe) +.TP +\fB\-\-tmpdir\fR[=\fIDIR\fR] +interpret TEMPLATE relative to DIR. If DIR is +not specified, use $TMPDIR if set, else /tmp. +With this option, TEMPLATE must not be an absolute name. +Unlike with \fB\-t\fR, TEMPLATE may contain slashes, but even +here, mktemp still creates only the final component. +.TP +\fB\-p\fR DIR +use DIR as a prefix; implies \fB\-t\fR [deprecated] +.TP +\fB\-t\fR +interpret TEMPLATE as a single file name component, +relative to a directory: $TMPDIR, if set; else the +directory specified via \fB\-p\fR; else /tmp [deprecated] +.TP +\fB\-\-help\fR +display this help and exit +.TP +\fB\-\-version\fR +output version information and exit +.SH AUTHOR +Written by Jim Meyering. +.SH "REPORTING BUGS" +Report mktemp bugs to bug\-coreutils@gnu.org +.br +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. +There is NO WARRANTY, to the extent permitted by law. +.SH "SEE ALSO" +mkstemp(3), mkdtemp(3), mktemp(3) +.PP +The full documentation for +.B mktemp +is maintained as a Texinfo manual. If the +.B info +and +.B mktemp +programs are properly installed at your site, the command +.IP +.B info coreutils \(aqmktemp invocation\(aq +.PP +should give you access to the complete manual. diff --git a/src/bin/coreutils/man/mktemp.x b/src/bin/coreutils/man/mktemp.x new file mode 100644 index 0000000000..393ca742b6 --- /dev/null +++ b/src/bin/coreutils/man/mktemp.x @@ -0,0 +1,6 @@ +[NAME] +mktemp \- create a temporary file or directory +[DESCRIPTION] +.\" Add any additional description here +[SEE ALSO] +mkstemp(3), mkdtemp(3), mktemp(3) diff --git a/src/bin/coreutils/man/mv.1 b/src/bin/coreutils/man/mv.1 index db7bdfb335..06f23e4ac8 100644 --- a/src/bin/coreutils/man/mv.1 +++ b/src/bin/coreutils/man/mv.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -.TH MV "1" "March 2007" "GNU coreutils 6.9" "User Commands" +.TH MV "1" "May 2009" "GNU coreutils 7.4" "User Commands" .SH NAME mv \- move (rename) files .SH SYNOPSIS @@ -30,6 +30,11 @@ do not prompt before overwriting \fB\-i\fR, \fB\-\-interactive\fR prompt before overwrite .TP +\fB\-n\fR, \fB\-\-no\-clobber\fR +do not overwrite an existing file +.PP +If you specify more than one of \fB\-i\fR, \fB\-f\fR, \fB\-n\fR, only the final one takes effect. +.TP \fB\-\-strip\-trailing\-slashes\fR remove any trailing slashes from each SOURCE argument @@ -75,12 +80,16 @@ always make simple backups .SH AUTHOR Written by Mike Parker, David MacKenzie, and Jim Meyering. .SH "REPORTING BUGS" -Report bugs to . -.SH COPYRIGHT -Copyright \(co 2007 Free Software Foundation, Inc. +Report mv bugs to bug\-coreutils@gnu.org .br -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License . +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" rename(2) @@ -93,6 +102,6 @@ and .B mv programs are properly installed at your site, the command .IP -.B info mv +.B info coreutils \(aqmv invocation\(aq .PP should give you access to the complete manual. diff --git a/src/bin/coreutils/man/nice.1 b/src/bin/coreutils/man/nice.1 index 20fb20883e..2ac3efbaf6 100644 --- a/src/bin/coreutils/man/nice.1 +++ b/src/bin/coreutils/man/nice.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -.TH NICE "1" "March 2007" "GNU coreutils 6.9" "User Commands" +.TH NICE "1" "May 2009" "GNU coreutils 7.4" "User Commands" .SH NAME nice \- run a program with modified scheduling priority .SH SYNOPSIS @@ -27,12 +27,16 @@ for details about the options it supports. .SH AUTHOR Written by David MacKenzie. .SH "REPORTING BUGS" -Report bugs to . -.SH COPYRIGHT -Copyright \(co 2007 Free Software Foundation, Inc. +Report nice bugs to bug\-coreutils@gnu.org .br -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License . +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" nice(2) @@ -45,6 +49,6 @@ and .B nice programs are properly installed at your site, the command .IP -.B info nice +.B info coreutils \(aqnice invocation\(aq .PP should give you access to the complete manual. diff --git a/src/bin/coreutils/man/nl.1 b/src/bin/coreutils/man/nl.1 index ffaf172df1..d3effa2fb0 100644 --- a/src/bin/coreutils/man/nl.1 +++ b/src/bin/coreutils/man/nl.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -.TH NL "1" "March 2007" "GNU coreutils 6.9" "User Commands" +.TH NL "1" "May 2009" "GNU coreutils 7.4" "User Commands" .SH NAME nl \- number lines of files .SH SYNOPSIS @@ -40,7 +40,7 @@ do not reset line numbers at logical pages \fB\-s\fR, \fB\-\-number\-separator\fR=\fISTRING\fR add STRING after (possible) line number .TP -\fB\-v\fR, \fB\-\-first\-page\fR=\fINUMBER\fR +\fB\-v\fR, \fB\-\-starting\-line\-number\fR=\fINUMBER\fR first line number on each logical page .TP \fB\-w\fR, \fB\-\-number\-width\fR=\fINUMBER\fR @@ -82,12 +82,16 @@ right justified, leading zeros .SH AUTHOR Written by Scott Bartram and David MacKenzie. .SH "REPORTING BUGS" -Report bugs to . -.SH COPYRIGHT -Copyright \(co 2007 Free Software Foundation, Inc. +Report nl bugs to bug\-coreutils@gnu.org .br -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License . +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" The full documentation for @@ -98,6 +102,6 @@ and .B nl programs are properly installed at your site, the command .IP -.B info nl +.B info coreutils \(aqnl invocation\(aq .PP should give you access to the complete manual. diff --git a/src/bin/coreutils/man/nohup.1 b/src/bin/coreutils/man/nohup.1 index 187ec3a833..706ce3623d 100644 --- a/src/bin/coreutils/man/nohup.1 +++ b/src/bin/coreutils/man/nohup.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -.TH NOHUP "1" "March 2007" "GNU coreutils 6.9" "User Commands" +.TH NOHUP "1" "May 2009" "GNU coreutils 7.4" "User Commands" .SH NAME nohup \- run a command immune to hangups, with output to a non-tty .SH SYNOPSIS @@ -19,18 +19,28 @@ display this help and exit \fB\-\-version\fR output version information and exit .PP +If standard input is a terminal, redirect it from /dev/null. +If standard output is a terminal, append output to `nohup.out' if possible, +`$HOME/nohup.out' otherwise. +If standard error is a terminal, redirect it to standard output. +To save output to FILE, use `nohup COMMAND > FILE'. +.PP NOTE: your shell may have its own version of nohup, which usually supersedes the version described here. Please refer to your shell's documentation for details about the options it supports. .SH AUTHOR Written by Jim Meyering. .SH "REPORTING BUGS" -Report bugs to . -.SH COPYRIGHT -Copyright \(co 2007 Free Software Foundation, Inc. +Report nohup bugs to bug\-coreutils@gnu.org .br -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License . +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" The full documentation for @@ -41,6 +51,6 @@ and .B nohup programs are properly installed at your site, the command .IP -.B info nohup +.B info coreutils \(aqnohup invocation\(aq .PP should give you access to the complete manual. diff --git a/src/bin/coreutils/man/od.1 b/src/bin/coreutils/man/od.1 index bbc3699561..fee6b0f289 100644 --- a/src/bin/coreutils/man/od.1 +++ b/src/bin/coreutils/man/od.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -.TH OD "1" "March 2007" "GNU coreutils 6.9" "User Commands" +.TH OD "1" "May 2009" "GNU coreutils 7.4" "User Commands" .SH NAME od \- dump files in octal and other formats .SH SYNOPSIS @@ -118,20 +118,26 @@ sizeof(long). If TYPE is f, SIZE may also be F for sizeof(float), D for sizeof(double) or L for sizeof(long double). .PP RADIX is d for decimal, o for octal, x for hexadecimal or n for none. -BYTES is hexadecimal with 0x or 0X prefix, it is multiplied by 512 -with b suffix, by 1024 with k and by 1048576 with m. Adding a z suffix to -any type adds a display of printable characters to the end of each line -of output. \fB\-\-string\fR without a number implies 3. \fB\-\-width\fR without a number -implies 32. By default, od uses \fB\-A\fR o \fB\-t\fR d2 \fB\-w16\fR. +BYTES is hexadecimal with 0x or 0X prefix, and may have a multiplier suffix: +b 512, kB 1000, K 1024, MB 1000*1000, M 1024*1024, +GB 1000*1000*1000, G 1024*1024*1024, and so on for T, P, E, Z, Y. +Adding a z suffix to any type displays printable characters at the end of each +output line. +Option \fB\-\-string\fR without a number implies 3; option \fB\-\-width\fR without a number +implies 32. By default, od uses \fB\-A\fR o \fB\-t\fR oS \fB\-w16\fR. .SH AUTHOR Written by Jim Meyering. .SH "REPORTING BUGS" -Report bugs to . -.SH COPYRIGHT -Copyright \(co 2007 Free Software Foundation, Inc. +Report od bugs to bug\-coreutils@gnu.org .br -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License . +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" The full documentation for @@ -142,6 +148,6 @@ and .B od programs are properly installed at your site, the command .IP -.B info od +.B info coreutils \(aqod invocation\(aq .PP should give you access to the complete manual. diff --git a/src/bin/coreutils/man/paste.1 b/src/bin/coreutils/man/paste.1 index 2ea2445fb2..79177e8b46 100644 --- a/src/bin/coreutils/man/paste.1 +++ b/src/bin/coreutils/man/paste.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -.TH PASTE "1" "March 2007" "GNU coreutils 6.9" "User Commands" +.TH PASTE "1" "May 2009" "GNU coreutils 7.4" "User Commands" .SH NAME paste \- merge lines of files .SH SYNOPSIS @@ -28,12 +28,16 @@ output version information and exit .SH AUTHOR Written by David M. Ihnat and David MacKenzie. .SH "REPORTING BUGS" -Report bugs to . -.SH COPYRIGHT -Copyright \(co 2007 Free Software Foundation, Inc. +Report paste bugs to bug\-coreutils@gnu.org .br -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License . +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" The full documentation for @@ -44,6 +48,6 @@ and .B paste programs are properly installed at your site, the command .IP -.B info paste +.B info coreutils \(aqpaste invocation\(aq .PP should give you access to the complete manual. diff --git a/src/bin/coreutils/man/pathchk.1 b/src/bin/coreutils/man/pathchk.1 index 2c17a1b872..28107acd12 100644 --- a/src/bin/coreutils/man/pathchk.1 +++ b/src/bin/coreutils/man/pathchk.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -.TH PATHCHK "1" "March 2007" "GNU coreutils 6.9" "User Commands" +.TH PATHCHK "1" "May 2009" "GNU coreutils 7.4" "User Commands" .SH NAME pathchk \- check whether file names are valid or portable .SH SYNOPSIS @@ -8,7 +8,7 @@ pathchk \- check whether file names are valid or portable .SH DESCRIPTION .\" Add any additional description here .PP -Diagnose unportable constructs in NAME. +Diagnose invalid or unportable file names. .TP \fB\-p\fR check for most POSIX systems @@ -27,12 +27,16 @@ output version information and exit .SH AUTHOR Written by Paul Eggert, David MacKenzie, and Jim Meyering. .SH "REPORTING BUGS" -Report bugs to . -.SH COPYRIGHT -Copyright \(co 2007 Free Software Foundation, Inc. +Report pathchk bugs to bug\-coreutils@gnu.org .br -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License . +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" The full documentation for @@ -43,6 +47,6 @@ and .B pathchk programs are properly installed at your site, the command .IP -.B info pathchk +.B info coreutils \(aqpathchk invocation\(aq .PP should give you access to the complete manual. diff --git a/src/bin/coreutils/man/pinky.1 b/src/bin/coreutils/man/pinky.1 index 8fdc71cbcf..fa5d250c16 100644 --- a/src/bin/coreutils/man/pinky.1 +++ b/src/bin/coreutils/man/pinky.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -.TH PINKY "1" "March 2007" "GNU coreutils 6.9" "User Commands" +.TH PINKY "1" "May 2009" "GNU coreutils 7.4" "User Commands" .SH NAME pinky \- lightweight finger .SH SYNOPSIS @@ -47,12 +47,16 @@ The utmp file will be /var/run/utmp. .SH AUTHOR Written by Joseph Arceneaux, David MacKenzie, and Kaveh Ghazi. .SH "REPORTING BUGS" -Report bugs to . -.SH COPYRIGHT -Copyright \(co 2007 Free Software Foundation, Inc. +Report pinky bugs to bug\-coreutils@gnu.org .br -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License . +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" The full documentation for @@ -63,6 +67,6 @@ and .B pinky programs are properly installed at your site, the command .IP -.B info pinky +.B info coreutils \(aqpinky invocation\(aq .PP should give you access to the complete manual. diff --git a/src/bin/coreutils/man/pr.1 b/src/bin/coreutils/man/pr.1 index 4ceec93160..7bfe995acd 100644 --- a/src/bin/coreutils/man/pr.1 +++ b/src/bin/coreutils/man/pr.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -.TH PR "1" "March 2007" "GNU coreutils 6.9" "User Commands" +.TH PR "1" "May 2009" "GNU coreutils 7.4" "User Commands" .SH NAME pr \- convert text files for printing .SH SYNOPSIS @@ -41,7 +41,7 @@ use form feeds instead of newlines to separate pages (by a 3\-line page header with \fB\-F\fR or a 5\-line header and trailer without \fB\-F\fR) .TP -\fB\-h\fR HEADER, \fB\-\-header\fR=\fIHEADER\fR +\fB\-h\fR, \fB\-\-header\fR=\fIHEADER\fR use a centered HEADER instead of filename in page header, \fB\-h\fR "" prints a blank line, don't use \fB\-h\fR"" .TP @@ -52,7 +52,7 @@ replace spaces with CHARs (TABs) to tab WIDTH (8) merge full lines, turns off \fB\-W\fR line truncation, no column alignment, \fB\-\-sep\-string\fR[=\fISTRING\fR] sets separators .TP -\fB\-l\fR PAGE_LENGTH, \fB\-\-length\fR=\fIPAGE_LENGTH\fR +\fB\-l\fR, \fB\-\-length\fR=\fIPAGE_LENGTH\fR set the page length to PAGE_LENGTH (66) lines (default number of lines of text 56, and with \fB\-F\fR 63) .TP @@ -64,11 +64,11 @@ truncate lines, but join lines of full length with \fB\-J\fR number lines, use DIGITS (5) digits, then SEP (TAB), default counting starts with 1st line of input file .TP -\fB\-N\fR NUMBER, \fB\-\-first\-line\-number\fR=\fINUMBER\fR +\fB\-N\fR, \fB\-\-first\-line\-number\fR=\fINUMBER\fR start counting with NUMBER at 1st line of first page printed (see +FIRST_PAGE) .TP -\fB\-o\fR MARGIN, \fB\-\-indent\fR=\fIMARGIN\fR +\fB\-o\fR, \fB\-\-indent\fR=\fIMARGIN\fR offset each line with MARGIN (zero) spaces, do not affect \fB\-w\fR or \fB\-W\fR, MARGIN will be added to PAGE_WIDTH .TP @@ -96,11 +96,11 @@ by form feeds set in input files \fB\-v\fR, \fB\-\-show\-nonprinting\fR use octal backslash notation .TP -\fB\-w\fR PAGE_WIDTH, \fB\-\-width\fR=\fIPAGE_WIDTH\fR +\fB\-w\fR, \fB\-\-width\fR=\fIPAGE_WIDTH\fR set page width to PAGE_WIDTH (72) characters for multiple text\-column output only, \fB\-s[char]\fR turns off (72) .TP -\fB\-W\fR PAGE_WIDTH, \fB\-\-page\-width\fR=\fIPAGE_WIDTH\fR +\fB\-W\fR, \fB\-\-page\-width\fR=\fIPAGE_WIDTH\fR set page width to PAGE_WIDTH (72) characters always, truncate lines, except \fB\-J\fR option is set, no interference with \fB\-S\fR or \fB\-s\fR @@ -111,17 +111,21 @@ display this help and exit \fB\-\-version\fR output version information and exit .PP -\fB\-T\fR implied by \fB\-l\fR nn when nn <= 10 or <= 3 with \fB\-F\fR. With no FILE, or when +\fB\-t\fR is implied if PAGE_LENGTH <= 10. With no FILE, or when FILE is \-, read standard input. .SH AUTHOR Written by Pete TerMaat and Roland Huebner. .SH "REPORTING BUGS" -Report bugs to . -.SH COPYRIGHT -Copyright \(co 2007 Free Software Foundation, Inc. +Report pr bugs to bug\-coreutils@gnu.org .br -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License . +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" The full documentation for @@ -132,6 +136,6 @@ and .B pr programs are properly installed at your site, the command .IP -.B info pr +.B info coreutils \(aqpr invocation\(aq .PP should give you access to the complete manual. diff --git a/src/bin/coreutils/man/printenv.1 b/src/bin/coreutils/man/printenv.1 index 633f5af780..9c35cbcc9b 100644 --- a/src/bin/coreutils/man/printenv.1 +++ b/src/bin/coreutils/man/printenv.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -.TH PRINTENV "1" "March 2007" "GNU coreutils 6.9" "User Commands" +.TH PRINTENV "1" "May 2009" "GNU coreutils 7.4" "User Commands" .SH NAME printenv \- print all or part of environment .SH SYNOPSIS @@ -11,7 +11,8 @@ printenv \- print all or part of environment .SH DESCRIPTION .\" Add any additional description here .PP -If no environment VARIABLE specified, print them all. +Print the values of the specified environment VARIABLE(s). +If no VARIABLE is specified, print name and value pairs for them all. .TP \fB\-\-help\fR display this help and exit @@ -25,12 +26,16 @@ for details about the options it supports. .SH AUTHOR Written by David MacKenzie and Richard Mlynarik. .SH "REPORTING BUGS" -Report bugs to . -.SH COPYRIGHT -Copyright \(co 2007 Free Software Foundation, Inc. +Report printenv bugs to bug\-coreutils@gnu.org .br -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License . +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" The full documentation for @@ -41,6 +46,6 @@ and .B printenv programs are properly installed at your site, the command .IP -.B info printenv +.B info coreutils \(aqprintenv invocation\(aq .PP should give you access to the complete manual. diff --git a/src/bin/coreutils/man/printf.1 b/src/bin/coreutils/man/printf.1 index 696ea7e1f6..93b83e7d57 100644 --- a/src/bin/coreutils/man/printf.1 +++ b/src/bin/coreutils/man/printf.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -.TH PRINTF "1" "March 2007" "GNU coreutils 6.9" "User Commands" +.TH PRINTF "1" "May 2009" "GNU coreutils 7.4" "User Commands" .SH NAME printf \- format and print data .SH SYNOPSIS @@ -11,7 +11,7 @@ printf \- format and print data .SH DESCRIPTION .\" Add any additional description here .PP -Print ARGUMENT(s) according to FORMAT. +Print ARGUMENT(s) according to FORMAT, or execute according to OPTION: .TP \fB\-\-help\fR display this help and exit @@ -79,14 +79,20 @@ for details about the options it supports. .SH AUTHOR Written by David MacKenzie. .SH "REPORTING BUGS" -Report bugs to . -.SH COPYRIGHT -Copyright \(co 2007 Free Software Foundation, Inc. +Report printf bugs to bug\-coreutils@gnu.org .br -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License . +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" +printf(3) +.PP The full documentation for .B printf is maintained as a Texinfo manual. If the @@ -95,6 +101,6 @@ and .B printf programs are properly installed at your site, the command .IP -.B info printf +.B info coreutils \(aqprintf invocation\(aq .PP should give you access to the complete manual. diff --git a/src/bin/coreutils/man/printf.x b/src/bin/coreutils/man/printf.x index 6489ec53ec..22fc5afdf5 100644 --- a/src/bin/coreutils/man/printf.x +++ b/src/bin/coreutils/man/printf.x @@ -2,3 +2,5 @@ printf \- format and print data [DESCRIPTION] .\" Add any additional description here +[SEE ALSO] +printf(3) diff --git a/src/bin/coreutils/man/ptx.1 b/src/bin/coreutils/man/ptx.1 index 5c623ec9b0..7a3bfc59fe 100644 --- a/src/bin/coreutils/man/ptx.1 +++ b/src/bin/coreutils/man/ptx.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -.TH PTX "1" "March 2007" "GNU coreutils 6.9" "User Commands" +.TH PTX "1" "May 2009" "GNU coreutils 7.4" "User Commands" .SH NAME ptx \- produce a permuted index of file contents .SH SYNOPSIS @@ -75,12 +75,16 @@ With no FILE or if FILE is \-, read Standard Input. `\-F /' by default. .SH AUTHOR Written by F. Pinard. .SH "REPORTING BUGS" -Report bugs to . -.SH COPYRIGHT -Copyright \(co 2007 Free Software Foundation, Inc. +Report ptx bugs to bug\-coreutils@gnu.org .br -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License . +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" The full documentation for @@ -91,6 +95,6 @@ and .B ptx programs are properly installed at your site, the command .IP -.B info ptx +.B info coreutils \(aqptx invocation\(aq .PP should give you access to the complete manual. diff --git a/src/bin/coreutils/man/pwd.1 b/src/bin/coreutils/man/pwd.1 index f7ae93f415..21cfdf6287 100644 --- a/src/bin/coreutils/man/pwd.1 +++ b/src/bin/coreutils/man/pwd.1 @@ -1,15 +1,21 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -.TH PWD "1" "March 2007" "GNU coreutils 6.9" "User Commands" +.TH PWD "1" "May 2009" "GNU coreutils 7.4" "User Commands" .SH NAME pwd \- print name of current/working directory .SH SYNOPSIS .B pwd -[\fIOPTION\fR] +[\fIOPTION\fR]... .SH DESCRIPTION .\" Add any additional description here .PP Print the full filename of the current working directory. .TP +\fB\-L\fR, \fB\-\-logical\fR +use PWD from environment, even if it contains symlinks +.TP +\fB\-P\fR, \fB\-\-physical\fR +avoid all symlinks +.TP \fB\-\-help\fR display this help and exit .TP @@ -22,12 +28,16 @@ for details about the options it supports. .SH AUTHOR Written by Jim Meyering. .SH "REPORTING BUGS" -Report bugs to . -.SH COPYRIGHT -Copyright \(co 2007 Free Software Foundation, Inc. +Report pwd bugs to bug\-coreutils@gnu.org .br -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License . +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" getcwd(3) @@ -40,6 +50,6 @@ and .B pwd programs are properly installed at your site, the command .IP -.B info pwd +.B info coreutils \(aqpwd invocation\(aq .PP should give you access to the complete manual. diff --git a/src/bin/coreutils/man/readlink.1 b/src/bin/coreutils/man/readlink.1 index d90c7580fd..d5ca9dcc3a 100644 --- a/src/bin/coreutils/man/readlink.1 +++ b/src/bin/coreutils/man/readlink.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -.TH READLINK "1" "March 2007" "GNU coreutils 6.9" "User Commands" +.TH READLINK "1" "May 2009" "GNU coreutils 7.4" "User Commands" .SH NAME readlink \- display value of a symbolic link .SH SYNOPSIS @@ -44,12 +44,16 @@ output version information and exit .SH AUTHOR Written by Dmitry V. Levin. .SH "REPORTING BUGS" -Report bugs to . -.SH COPYRIGHT -Copyright \(co 2007 Free Software Foundation, Inc. +Report readlink bugs to bug\-coreutils@gnu.org .br -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License . +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" readlink(2) @@ -62,6 +66,6 @@ and .B readlink programs are properly installed at your site, the command .IP -.B info readlink +.B info coreutils \(aqreadlink invocation\(aq .PP should give you access to the complete manual. diff --git a/src/bin/coreutils/man/rm.1 b/src/bin/coreutils/man/rm.1 index 3f9525e1cc..46c537e857 100644 --- a/src/bin/coreutils/man/rm.1 +++ b/src/bin/coreutils/man/rm.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -.TH RM "1" "March 2007" "GNU coreutils 6.9" "User Commands" +.TH RM "1" "May 2009" "GNU coreutils 7.4" "User Commands" .SH NAME rm \- remove files or directories .SH SYNOPSIS @@ -82,14 +82,19 @@ Note that if you use rm to remove a file, it is usually possible to recover the contents of that file. If you want more assurance that the contents are truly unrecoverable, consider using shred. .SH AUTHOR -Written by Paul Rubin, David MacKenzie, Richard Stallman, and Jim Meyering. +Written by Paul Rubin, David MacKenzie, Richard M. Stallman, +and Jim Meyering. .SH "REPORTING BUGS" -Report bugs to . -.SH COPYRIGHT -Copyright \(co 2007 Free Software Foundation, Inc. +Report rm bugs to bug\-coreutils@gnu.org .br -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License . +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" unlink(1), unlink(2), chattr(1), shred(1) @@ -102,6 +107,6 @@ and .B rm programs are properly installed at your site, the command .IP -.B info rm +.B info coreutils \(aqrm invocation\(aq .PP should give you access to the complete manual. diff --git a/src/bin/coreutils/man/rmdir.1 b/src/bin/coreutils/man/rmdir.1 index 803443043f..e15730a722 100644 --- a/src/bin/coreutils/man/rmdir.1 +++ b/src/bin/coreutils/man/rmdir.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -.TH RMDIR "1" "March 2007" "GNU coreutils 6.9" "User Commands" +.TH RMDIR "1" "May 2009" "GNU coreutils 7.4" "User Commands" .SH NAME rmdir \- remove empty directories .SH SYNOPSIS @@ -13,11 +13,12 @@ Remove the DIRECTORY(ies), if they are empty. \fB\-\-ignore\-fail\-on\-non\-empty\fR .IP ignore each failure that is solely because a directory +.IP is non\-empty .TP \fB\-p\fR, \fB\-\-parents\fR -Remove DIRECTORY and its ancestors. E.g., `rmdir \fB\-p\fR a/b/c' is -similar to `rmdir a/b/c a/b a'. +remove DIRECTORY and its ancestors; e.g., `rmdir \fB\-p\fR a/b/c' is +similar to `rmdir a/b/c a/b a' .TP \fB\-v\fR, \fB\-\-verbose\fR output a diagnostic for every directory processed @@ -30,12 +31,16 @@ output version information and exit .SH AUTHOR Written by David MacKenzie. .SH "REPORTING BUGS" -Report bugs to . -.SH COPYRIGHT -Copyright \(co 2007 Free Software Foundation, Inc. +Report rmdir bugs to bug\-coreutils@gnu.org .br -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License . +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" rmdir(2) @@ -48,6 +53,6 @@ and .B rmdir programs are properly installed at your site, the command .IP -.B info rmdir +.B info coreutils \(aqrmdir invocation\(aq .PP should give you access to the complete manual. diff --git a/src/bin/coreutils/man/runcon.1 b/src/bin/coreutils/man/runcon.1 new file mode 100644 index 0000000000..bc6a2c7330 --- /dev/null +++ b/src/bin/coreutils/man/runcon.1 @@ -0,0 +1,75 @@ +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. +.TH RUNCON "1" "May 2009" "GNU coreutils 7.4" "User Commands" +.SH NAME +runcon \- run command with specified security context +.SH SYNOPSIS +.B runcon +\fICONTEXT COMMAND \fR[\fIargs\fR] +.br +.B runcon +[ \fI-c \fR] [\fI-u USER\fR] [\fI-r ROLE\fR] [\fI-t TYPE\fR] [\fI-l RANGE\fR] \fICOMMAND \fR[\fIargs\fR] +.SH DESCRIPTION +Run COMMAND with completely-specified CONTEXT, or with current or +transitioned security context modified by one or more of LEVEL, +ROLE, TYPE, and USER. +.PP +If none of \fI-c\fR, \fI-t\fR, \fI-u\fR, \fI-r\fR, or \fI-l\fR, is specified, +the first argument is used as the complete context. Any additional +arguments after \fICOMMAND\fR are interpreted as arguments to the +command. +.PP +Note that only carefully-chosen contexts are likely to successfully +run. +.PP +Run a program in a different security context. +With neither CONTEXT nor COMMAND, print the current security context. +.TP +CONTEXT +Complete security context +.TP +\fB\-c\fR, \fB\-\-compute\fR +compute process transition context before modifying +.TP +\fB\-t\fR, \fB\-\-type\fR=\fITYPE\fR +type (for same role as parent) +.TP +\fB\-u\fR, \fB\-\-user\fR=\fIUSER\fR +user identity +.TP +\fB\-r\fR, \fB\-\-role\fR=\fIROLE\fR +role +.TP +\fB\-l\fR, \fB\-\-range\fR=\fIRANGE\fR +levelrange +.TP +\fB\-\-help\fR +display this help and exit +.TP +\fB\-\-version\fR +output version information and exit +.SH AUTHOR +Written by Russell Coker. +.SH "REPORTING BUGS" +Report runcon bugs to bug\-coreutils@gnu.org +.br +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. +There is NO WARRANTY, to the extent permitted by law. +.SH "SEE ALSO" +The full documentation for +.B runcon +is maintained as a Texinfo manual. If the +.B info +and +.B runcon +programs are properly installed at your site, the command +.IP +.B info coreutils \(aqruncon invocation\(aq +.PP +should give you access to the complete manual. diff --git a/src/bin/coreutils/man/runcon.x b/src/bin/coreutils/man/runcon.x new file mode 100644 index 0000000000..d2df13e24a --- /dev/null +++ b/src/bin/coreutils/man/runcon.x @@ -0,0 +1,14 @@ +[NAME] +runcon \- run command with specified security context +[DESCRIPTION] +Run COMMAND with completely-specified CONTEXT, or with current or +transitioned security context modified by one or more of LEVEL, +ROLE, TYPE, and USER. +.PP +If none of \fI-c\fR, \fI-t\fR, \fI-u\fR, \fI-r\fR, or \fI-l\fR, is specified, +the first argument is used as the complete context. Any additional +arguments after \fICOMMAND\fR are interpreted as arguments to the +command. +.PP +Note that only carefully-chosen contexts are likely to successfully +run. diff --git a/src/bin/coreutils/man/seq.1 b/src/bin/coreutils/man/seq.1 index df5bc3a2e6..5c4ccb17b2 100644 --- a/src/bin/coreutils/man/seq.1 +++ b/src/bin/coreutils/man/seq.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -.TH SEQ "1" "March 2007" "GNU coreutils 6.9" "User Commands" +.TH SEQ "1" "May 2009" "GNU coreutils 7.4" "User Commands" .SH NAME seq \- print a sequence of numbers .SH SYNOPSIS @@ -42,12 +42,16 @@ decimal numbers with maximum precision PREC, and to %g otherwise. .SH AUTHOR Written by Ulrich Drepper. .SH "REPORTING BUGS" -Report bugs to . -.SH COPYRIGHT -Copyright \(co 2007 Free Software Foundation, Inc. +Report seq bugs to bug\-coreutils@gnu.org .br -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License . +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" The full documentation for @@ -58,6 +62,6 @@ and .B seq programs are properly installed at your site, the command .IP -.B info seq +.B info coreutils \(aqseq invocation\(aq .PP should give you access to the complete manual. diff --git a/src/bin/coreutils/man/sha1sum.1 b/src/bin/coreutils/man/sha1sum.1 index 1ccf435430..5856270e2f 100644 --- a/src/bin/coreutils/man/sha1sum.1 +++ b/src/bin/coreutils/man/sha1sum.1 @@ -1,10 +1,10 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -.TH SHA1SUM "1" "March 2007" "GNU coreutils 6.9" "User Commands" +.TH SHA1SUM "1" "May 2009" "GNU coreutils 7.4" "User Commands" .SH NAME sha1sum \- compute and check SHA1 message digest .SH SYNOPSIS .B sha1sum -[\fIOPTION\fR] [\fIFILE\fR]... +[\fIOPTION\fR]... [\fIFILE\fR]... .SH DESCRIPTION .\" Add any additional description here .PP @@ -19,7 +19,10 @@ read SHA1 sums from the FILEs and check them .TP \fB\-t\fR, \fB\-\-text\fR read in text mode (default) -.SS "The following two options are useful only when verifying checksums:" +.SS "The following three options are useful only when verifying checksums:" +.TP +\fB\-\-quiet\fR +don't print OK for each successfully verified file .TP \fB\-\-status\fR don't output anything, status code shows success @@ -40,12 +43,16 @@ text), and name for each FILE. .SH AUTHOR Written by Ulrich Drepper, Scott Miller, and David Madore. .SH "REPORTING BUGS" -Report bugs to . -.SH COPYRIGHT -Copyright \(co 2007 Free Software Foundation, Inc. +Report sha1sum bugs to bug\-coreutils@gnu.org .br -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License . +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" The full documentation for @@ -56,6 +63,6 @@ and .B sha1sum programs are properly installed at your site, the command .IP -.B info sha1sum +.B info coreutils \(aqsha1sum invocation\(aq .PP should give you access to the complete manual. diff --git a/src/bin/coreutils/man/sha224sum.1 b/src/bin/coreutils/man/sha224sum.1 index 0271626596..85f7328f78 100644 --- a/src/bin/coreutils/man/sha224sum.1 +++ b/src/bin/coreutils/man/sha224sum.1 @@ -1,10 +1,10 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -.TH SHA224SUM "1" "March 2007" "GNU coreutils 6.9" "User Commands" +.TH SHA224SUM "1" "May 2009" "GNU coreutils 7.4" "User Commands" .SH NAME sha224sum \- compute and check SHA224 message digest .SH SYNOPSIS .B sha224sum -[\fIOPTION\fR] [\fIFILE\fR]... +[\fIOPTION\fR]... [\fIFILE\fR]... .SH DESCRIPTION .\" Add any additional description here .PP @@ -19,7 +19,10 @@ read SHA224 sums from the FILEs and check them .TP \fB\-t\fR, \fB\-\-text\fR read in text mode (default) -.SS "The following two options are useful only when verifying checksums:" +.SS "The following three options are useful only when verifying checksums:" +.TP +\fB\-\-quiet\fR +don't print OK for each successfully verified file .TP \fB\-\-status\fR don't output anything, status code shows success @@ -40,12 +43,16 @@ text), and name for each FILE. .SH AUTHOR Written by Ulrich Drepper, Scott Miller, and David Madore. .SH "REPORTING BUGS" -Report bugs to . -.SH COPYRIGHT -Copyright \(co 2007 Free Software Foundation, Inc. +Report sha224sum bugs to bug\-coreutils@gnu.org .br -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License . +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" The full documentation for @@ -56,6 +63,6 @@ and .B sha224sum programs are properly installed at your site, the command .IP -.B info sha224sum +.B info coreutils \(aqsha224sum invocation\(aq .PP should give you access to the complete manual. diff --git a/src/bin/coreutils/man/sha256sum.1 b/src/bin/coreutils/man/sha256sum.1 index ae35987419..9c8032dba8 100644 --- a/src/bin/coreutils/man/sha256sum.1 +++ b/src/bin/coreutils/man/sha256sum.1 @@ -1,10 +1,10 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -.TH SHA256SUM "1" "March 2007" "GNU coreutils 6.9" "User Commands" +.TH SHA256SUM "1" "May 2009" "GNU coreutils 7.4" "User Commands" .SH NAME sha256sum \- compute and check SHA256 message digest .SH SYNOPSIS .B sha256sum -[\fIOPTION\fR] [\fIFILE\fR]... +[\fIOPTION\fR]... [\fIFILE\fR]... .SH DESCRIPTION .\" Add any additional description here .PP @@ -19,7 +19,10 @@ read SHA256 sums from the FILEs and check them .TP \fB\-t\fR, \fB\-\-text\fR read in text mode (default) -.SS "The following two options are useful only when verifying checksums:" +.SS "The following three options are useful only when verifying checksums:" +.TP +\fB\-\-quiet\fR +don't print OK for each successfully verified file .TP \fB\-\-status\fR don't output anything, status code shows success @@ -40,12 +43,16 @@ text), and name for each FILE. .SH AUTHOR Written by Ulrich Drepper, Scott Miller, and David Madore. .SH "REPORTING BUGS" -Report bugs to . -.SH COPYRIGHT -Copyright \(co 2007 Free Software Foundation, Inc. +Report sha256sum bugs to bug\-coreutils@gnu.org .br -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License . +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" The full documentation for @@ -56,6 +63,6 @@ and .B sha256sum programs are properly installed at your site, the command .IP -.B info sha256sum +.B info coreutils \(aqsha256sum invocation\(aq .PP should give you access to the complete manual. diff --git a/src/bin/coreutils/man/sha384sum.1 b/src/bin/coreutils/man/sha384sum.1 index 94a3370514..6d84409df8 100644 --- a/src/bin/coreutils/man/sha384sum.1 +++ b/src/bin/coreutils/man/sha384sum.1 @@ -1,10 +1,10 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -.TH SHA384SUM "1" "March 2007" "GNU coreutils 6.9" "User Commands" +.TH SHA384SUM "1" "May 2009" "GNU coreutils 7.4" "User Commands" .SH NAME sha384sum \- compute and check SHA384 message digest .SH SYNOPSIS .B sha384sum -[\fIOPTION\fR] [\fIFILE\fR]... +[\fIOPTION\fR]... [\fIFILE\fR]... .SH DESCRIPTION .\" Add any additional description here .PP @@ -19,7 +19,10 @@ read SHA384 sums from the FILEs and check them .TP \fB\-t\fR, \fB\-\-text\fR read in text mode (default) -.SS "The following two options are useful only when verifying checksums:" +.SS "The following three options are useful only when verifying checksums:" +.TP +\fB\-\-quiet\fR +don't print OK for each successfully verified file .TP \fB\-\-status\fR don't output anything, status code shows success @@ -40,12 +43,16 @@ text), and name for each FILE. .SH AUTHOR Written by Ulrich Drepper, Scott Miller, and David Madore. .SH "REPORTING BUGS" -Report bugs to . -.SH COPYRIGHT -Copyright \(co 2007 Free Software Foundation, Inc. +Report sha384sum bugs to bug\-coreutils@gnu.org .br -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License . +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" The full documentation for @@ -56,6 +63,6 @@ and .B sha384sum programs are properly installed at your site, the command .IP -.B info sha384sum +.B info coreutils \(aqsha384sum invocation\(aq .PP should give you access to the complete manual. diff --git a/src/bin/coreutils/man/sha512sum.1 b/src/bin/coreutils/man/sha512sum.1 index 08bfc7ed8a..f0a94d1cab 100644 --- a/src/bin/coreutils/man/sha512sum.1 +++ b/src/bin/coreutils/man/sha512sum.1 @@ -1,10 +1,10 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -.TH SHA512SUM "1" "March 2007" "GNU coreutils 6.9" "User Commands" +.TH SHA512SUM "1" "May 2009" "GNU coreutils 7.4" "User Commands" .SH NAME sha512sum \- compute and check SHA512 message digest .SH SYNOPSIS .B sha512sum -[\fIOPTION\fR] [\fIFILE\fR]... +[\fIOPTION\fR]... [\fIFILE\fR]... .SH DESCRIPTION .\" Add any additional description here .PP @@ -19,7 +19,10 @@ read SHA512 sums from the FILEs and check them .TP \fB\-t\fR, \fB\-\-text\fR read in text mode (default) -.SS "The following two options are useful only when verifying checksums:" +.SS "The following three options are useful only when verifying checksums:" +.TP +\fB\-\-quiet\fR +don't print OK for each successfully verified file .TP \fB\-\-status\fR don't output anything, status code shows success @@ -40,12 +43,16 @@ text), and name for each FILE. .SH AUTHOR Written by Ulrich Drepper, Scott Miller, and David Madore. .SH "REPORTING BUGS" -Report bugs to . -.SH COPYRIGHT -Copyright \(co 2007 Free Software Foundation, Inc. +Report sha512sum bugs to bug\-coreutils@gnu.org .br -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License . +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" The full documentation for @@ -56,6 +63,6 @@ and .B sha512sum programs are properly installed at your site, the command .IP -.B info sha512sum +.B info coreutils \(aqsha512sum invocation\(aq .PP should give you access to the complete manual. diff --git a/src/bin/coreutils/man/shred.1 b/src/bin/coreutils/man/shred.1 index 7115829e97..d0cb112129 100644 --- a/src/bin/coreutils/man/shred.1 +++ b/src/bin/coreutils/man/shred.1 @@ -1,10 +1,10 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -.TH SHRED "1" "March 2007" "GNU coreutils 6.9" "User Commands" +.TH SHRED "1" "May 2009" "GNU coreutils 7.4" "User Commands" .SH NAME shred \- overwrite a file to hide its contents, and optionally delete it .SH SYNOPSIS .B shred -[\fIOPTIONS\fR] \fIFILE \fR[...] +[\fIOPTION\fR]... \fIFILE\fR... .SH DESCRIPTION .\" Add any additional description here .PP @@ -17,10 +17,10 @@ Mandatory arguments to long options are mandatory for short options too. change permissions to allow writing if necessary .TP \fB\-n\fR, \fB\-\-iterations\fR=\fIN\fR -Overwrite N times instead of the default (25) +overwrite N times instead of the default (3) .TP \fB\-\-random\-source\fR=\fIFILE\fR -get random bytes from FILE (default /dev/urandom) +get random bytes from FILE .TP \fB\-s\fR, \fB\-\-size\fR=\fIN\fR shred this many bytes (suffixes like K, M, G accepted) @@ -85,12 +85,16 @@ to be recovered later. .SH AUTHOR Written by Colin Plumb. .SH "REPORTING BUGS" -Report bugs to . -.SH COPYRIGHT -Copyright \(co 2007 Free Software Foundation, Inc. +Report shred bugs to bug\-coreutils@gnu.org .br -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License . +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" The full documentation for @@ -101,6 +105,6 @@ and .B shred programs are properly installed at your site, the command .IP -.B info shred +.B info coreutils \(aqshred invocation\(aq .PP should give you access to the complete manual. diff --git a/src/bin/coreutils/man/shuf.1 b/src/bin/coreutils/man/shuf.1 index 737ffcccd4..1a7c866da2 100644 --- a/src/bin/coreutils/man/shuf.1 +++ b/src/bin/coreutils/man/shuf.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -.TH SHUF "1" "March 2007" "GNU coreutils 6.9" "User Commands" +.TH SHUF "1" "May 2009" "GNU coreutils 7.4" "User Commands" .SH NAME shuf \- generate random permutations .SH SYNOPSIS @@ -24,14 +24,14 @@ treat each ARG as an input line \fB\-i\fR, \fB\-\-input\-range\fR=\fILO\-HI\fR treat each number LO through HI as an input line .TP -\fB\-n\fR, \fB\-\-head\-lines\fR=\fILINES\fR -output at most LINES lines +\fB\-n\fR, \fB\-\-head\-count\fR=\fICOUNT\fR +output at most COUNT lines .TP \fB\-o\fR, \fB\-\-output\fR=\fIFILE\fR write result to FILE instead of standard output .TP \fB\-\-random\-source\fR=\fIFILE\fR -get random bytes from FILE (default /dev/urandom) +get random bytes from FILE .TP \fB\-z\fR, \fB\-\-zero\-terminated\fR end lines with 0 byte, not newline @@ -46,12 +46,16 @@ With no FILE, or when FILE is \-, read standard input. .SH AUTHOR Written by Paul Eggert. .SH "REPORTING BUGS" -Report bugs to . -.SH COPYRIGHT -Copyright \(co 2007 Free Software Foundation, Inc. +Report shuf bugs to bug\-coreutils@gnu.org .br -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License . +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" The full documentation for @@ -62,6 +66,6 @@ and .B shuf programs are properly installed at your site, the command .IP -.B info shuf +.B info coreutils \(aqshuf invocation\(aq .PP should give you access to the complete manual. diff --git a/src/bin/coreutils/man/sleep.1 b/src/bin/coreutils/man/sleep.1 index 0d090bbf9a..f35f70e72f 100644 --- a/src/bin/coreutils/man/sleep.1 +++ b/src/bin/coreutils/man/sleep.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -.TH SLEEP "1" "March 2007" "GNU coreutils 6.9" "User Commands" +.TH SLEEP "1" "May 2009" "GNU coreutils 7.4" "User Commands" .SH NAME sleep \- delay for a specified amount of time .SH SYNOPSIS @@ -25,12 +25,16 @@ output version information and exit .SH AUTHOR Written by Jim Meyering and Paul Eggert. .SH "REPORTING BUGS" -Report bugs to . -.SH COPYRIGHT -Copyright \(co 2007 Free Software Foundation, Inc. +Report sleep bugs to bug\-coreutils@gnu.org .br -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License . +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" sleep(3) @@ -43,6 +47,6 @@ and .B sleep programs are properly installed at your site, the command .IP -.B info sleep +.B info coreutils \(aqsleep invocation\(aq .PP should give you access to the complete manual. diff --git a/src/bin/coreutils/man/sort.1 b/src/bin/coreutils/man/sort.1 index c2f55bb0bc..bdd08ed69a 100644 --- a/src/bin/coreutils/man/sort.1 +++ b/src/bin/coreutils/man/sort.1 @@ -1,10 +1,13 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -.TH SORT "1" "March 2007" "GNU coreutils 6.9" "User Commands" +.TH SORT "1" "May 2009" "GNU coreutils 7.4" "User Commands" .SH NAME sort \- sort lines of text files .SH SYNOPSIS .B sort [\fIOPTION\fR]... [\fIFILE\fR]... +.br +.B sort +[\fIOPTION\fR]... \fI--files0-from=F\fR .SH DESCRIPTION .\" Add any additional description here .PP @@ -38,13 +41,25 @@ compare according to string numerical value sort by random hash of keys .TP \fB\-\-random\-source\fR=\fIFILE\fR -get random bytes from FILE (default /dev/urandom) +get random bytes from FILE .TP \fB\-r\fR, \fB\-\-reverse\fR reverse the result of comparisons +.TP +\fB\-\-sort\fR=\fIWORD\fR +sort according to WORD: +general\-numeric \fB\-g\fR, month \fB\-M\fR, numeric \fB\-n\fR, +random \fB\-R\fR, version \fB\-V\fR +.TP +\fB\-V\fR, \fB\-\-version\-sort\fR +natural sort of (version) numbers within text .PP Other options: .TP +\fB\-\-batch\-size\fR=\fINMERGE\fR +merge at most NMERGE inputs at once; +for more use temp files +.TP \fB\-c\fR, \fB\-\-check\fR, \fB\-\-check\fR=\fIdiagnose\-first\fR check for sorted input; do not sort .TP @@ -55,8 +70,14 @@ like \fB\-c\fR, but do not report first bad line compress temporaries with PROG; decompress them with PROG \fB\-d\fR .TP +\fB\-\-files0\-from\fR=\fIF\fR +read input from the files specified by +NUL\-terminated names in file F; +If F is \- then read names from standard input +.TP \fB\-k\fR, \fB\-\-key\fR=\fIPOS1[\fR,POS2] -start a key at POS1, end it at POS2 (origin 1) +start a key at POS1 (origin 1), end it at POS2 +(default end of line) .TP \fB\-m\fR, \fB\-\-merge\fR merge already sorted files; do not sort @@ -108,12 +129,16 @@ native byte values. .SH AUTHOR Written by Mike Haertel and Paul Eggert. .SH "REPORTING BUGS" -Report bugs to . -.SH COPYRIGHT -Copyright \(co 2007 Free Software Foundation, Inc. +Report sort bugs to bug\-coreutils@gnu.org .br -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License . +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" The full documentation for @@ -124,6 +149,6 @@ and .B sort programs are properly installed at your site, the command .IP -.B info sort +.B info coreutils \(aqsort invocation\(aq .PP should give you access to the complete manual. diff --git a/src/bin/coreutils/man/split.1 b/src/bin/coreutils/man/split.1 index a761151350..dcd68e40f2 100644 --- a/src/bin/coreutils/man/split.1 +++ b/src/bin/coreutils/man/split.1 @@ -1,10 +1,10 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -.TH SPLIT "1" "March 2007" "GNU coreutils 6.9" "User Commands" +.TH SPLIT "1" "May 2009" "GNU coreutils 7.4" "User Commands" .SH NAME split \- split a file into pieces .SH SYNOPSIS .B split -[\fIOPTION\fR] [\fIINPUT \fR[\fIPREFIX\fR]] +[\fIOPTION\fR]... [\fIINPUT \fR[\fIPREFIX\fR]] .SH DESCRIPTION .\" Add any additional description here .PP @@ -30,8 +30,8 @@ use numeric suffixes instead of alphabetic put NUMBER lines per output file .TP \fB\-\-verbose\fR -print a diagnostic to standard error just -before each output file is opened +print a diagnostic just before each +output file is opened .TP \fB\-\-help\fR display this help and exit @@ -39,16 +39,22 @@ display this help and exit \fB\-\-version\fR output version information and exit .PP -SIZE may have a multiplier suffix: b for 512, k for 1K, m for 1 Meg. +SIZE may have a multiplier suffix: +b 512, kB 1000, K 1024, MB 1000*1000, M 1024*1024, +GB 1000*1000*1000, G 1024*1024*1024, and so on for T, P, E, Z, Y. .SH AUTHOR Written by Torbjorn Granlund and Richard M. Stallman. .SH "REPORTING BUGS" -Report bugs to . -.SH COPYRIGHT -Copyright \(co 2007 Free Software Foundation, Inc. +Report split bugs to bug\-coreutils@gnu.org .br -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License . +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" The full documentation for @@ -59,6 +65,6 @@ and .B split programs are properly installed at your site, the command .IP -.B info split +.B info coreutils \(aqsplit invocation\(aq .PP should give you access to the complete manual. diff --git a/src/bin/coreutils/man/stat.1 b/src/bin/coreutils/man/stat.1 index faa7ff2855..3bf39c466d 100644 --- a/src/bin/coreutils/man/stat.1 +++ b/src/bin/coreutils/man/stat.1 @@ -1,10 +1,10 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -.TH STAT "1" "March 2007" "GNU coreutils 6.9" "User Commands" +.TH STAT "1" "May 2009" "GNU coreutils 7.4" "User Commands" .SH NAME stat \- display file or file system status .SH SYNOPSIS .B stat -[\fIOPTION\fR] \fIFILE\fR... +[\fIOPTION\fR]... \fIFILE\fR... .SH DESCRIPTION .\" Add any additional description here .PP @@ -48,6 +48,9 @@ Number of blocks allocated (see %B) %B The size in bytes of each block reported by %b .TP +%C +SELinux security context string +.TP %d Device number in decimal .TP @@ -131,6 +134,9 @@ Free file nodes in file system %f Free blocks in file system .TP +%C +SELinux security context string +.TP %i File System ID in hex .TP @@ -158,12 +164,16 @@ for details about the options it supports. .SH AUTHOR Written by Michael Meskes. .SH "REPORTING BUGS" -Report bugs to . -.SH COPYRIGHT -Copyright \(co 2007 Free Software Foundation, Inc. +Report stat bugs to bug\-coreutils@gnu.org .br -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License . +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" stat(2) @@ -176,6 +186,6 @@ and .B stat programs are properly installed at your site, the command .IP -.B info stat +.B info coreutils \(aqstat invocation\(aq .PP should give you access to the complete manual. diff --git a/src/bin/coreutils/man/stty.1 b/src/bin/coreutils/man/stty.1 index de9166828f..4a6cbf1b4b 100644 --- a/src/bin/coreutils/man/stty.1 +++ b/src/bin/coreutils/man/stty.1 @@ -1,16 +1,16 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -.TH STTY "1" "March 2007" "GNU coreutils 6.9" "User Commands" +.TH STTY "1" "May 2009" "GNU coreutils 7.4" "User Commands" .SH NAME stty \- change and print terminal line settings .SH SYNOPSIS .B stty -[\fI-F DEVICE\fR] [\fI--file=DEVICE\fR] [\fISETTING\fR]... +[\fI-F DEVICE | --file=DEVICE\fR] [\fISETTING\fR]... .br .B stty -[\fI-F DEVICE\fR] [\fI--file=DEVICE\fR] [\fI-a|--all\fR] +[\fI-F DEVICE | --file=DEVICE\fR] [\fI-a|--all\fR] .br .B stty -[\fI-F DEVICE\fR] [\fI--file=DEVICE\fR] [\fI-g|--save\fR] +[\fI-F DEVICE | --file=DEVICE\fR] [\fI-g|--save\fR] .SH DESCRIPTION .\" Add any additional description here .PP @@ -375,7 +375,7 @@ same as cread \fB\-ignbrk\fR brkint \fB\-inlcr\fR \fB\-igncr\fR icrnl \fB\-iutf8 \fB\-onocr\fR \fB\-onlret\fR \fB\-ofill\fR \fB\-ofdel\fR nl0 cr0 tab0 bs0 vt0 ff0 isig icanon iexten echo echoe echok \fB\-echonl\fR \fB\-noflsh\fR \fB\-xcase\fR \fB\-tostop\fR \fB\-echoprt\fR echoctl echoke, all special -characters to their default values. +characters to their default values .PP Handle the tty line connected to standard input. Without arguments, prints baud rate, line discipline, and deviations from stty sane. In @@ -384,12 +384,16 @@ settings, CHAR is taken literally, or coded as in ^c, 0x37, 0177 or .SH AUTHOR Written by David MacKenzie. .SH "REPORTING BUGS" -Report bugs to . -.SH COPYRIGHT -Copyright \(co 2007 Free Software Foundation, Inc. +Report stty bugs to bug\-coreutils@gnu.org .br -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License . +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" The full documentation for @@ -400,6 +404,6 @@ and .B stty programs are properly installed at your site, the command .IP -.B info stty +.B info coreutils \(aqstty invocation\(aq .PP should give you access to the complete manual. diff --git a/src/bin/coreutils/man/su.1 b/src/bin/coreutils/man/su.1 deleted file mode 100644 index ce9d040cec..0000000000 --- a/src/bin/coreutils/man/su.1 +++ /dev/null @@ -1,59 +0,0 @@ -.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -.TH SU "1" "March 2007" "GNU coreutils 6.9" "User Commands" -.SH NAME -su \- run a shell with substitute user and group IDs -.SH SYNOPSIS -.B su -[\fIOPTION\fR]... [\fI-\fR] [\fIUSER \fR[\fIARG\fR]...] -.SH DESCRIPTION -.\" Add any additional description here -.PP -Change the effective user id and group id to that of USER. -.TP -\-, \fB\-l\fR, \fB\-\-login\fR -make the shell a login shell -.TP -\fB\-c\fR, \fB\-\-command\fR=\fICOMMAND\fR -pass a single COMMAND to the shell with \fB\-c\fR -.TP -\fB\-f\fR, \fB\-\-fast\fR -pass \fB\-f\fR to the shell (for csh or tcsh) -.TP -\fB\-m\fR, \fB\-\-preserve\-environment\fR -do not reset environment variables -.TP -\fB\-p\fR -same as \fB\-m\fR -.TP -\fB\-s\fR, \fB\-\-shell\fR=\fISHELL\fR -run SHELL if /etc/shells allows it -.TP -\fB\-\-help\fR -display this help and exit -.TP -\fB\-\-version\fR -output version information and exit -.PP -A mere \- implies \fB\-l\fR. If USER not given, assume root. -.SH AUTHOR -Written by David MacKenzie. -.SH "REPORTING BUGS" -Report bugs to . -.SH COPYRIGHT -Copyright \(co 2007 Free Software Foundation, Inc. -.br -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License . -There is NO WARRANTY, to the extent permitted by law. -.SH "SEE ALSO" -The full documentation for -.B su -is maintained as a Texinfo manual. If the -.B info -and -.B su -programs are properly installed at your site, the command -.IP -.B info su -.PP -should give you access to the complete manual. diff --git a/src/bin/coreutils/man/sum.1 b/src/bin/coreutils/man/sum.1 index 395c1f1f6d..4004d044ff 100644 --- a/src/bin/coreutils/man/sum.1 +++ b/src/bin/coreutils/man/sum.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -.TH SUM "1" "March 2007" "GNU coreutils 6.9" "User Commands" +.TH SUM "1" "May 2009" "GNU coreutils 7.4" "User Commands" .SH NAME sum \- checksum and count the blocks in a file .SH SYNOPSIS @@ -11,7 +11,7 @@ sum \- checksum and count the blocks in a file Print checksum and block counts for each FILE. .TP \fB\-r\fR -defeat \fB\-s\fR, use BSD sum algorithm, use 1K blocks +use BSD sum algorithm, use 1K blocks .TP \fB\-s\fR, \fB\-\-sysv\fR use System V sum algorithm, use 512 bytes blocks @@ -26,12 +26,16 @@ With no FILE, or when FILE is \-, read standard input. .SH AUTHOR Written by Kayvan Aghaiepour and David MacKenzie. .SH "REPORTING BUGS" -Report bugs to . -.SH COPYRIGHT -Copyright \(co 2007 Free Software Foundation, Inc. +Report sum bugs to bug\-coreutils@gnu.org .br -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License . +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" The full documentation for @@ -42,6 +46,6 @@ and .B sum programs are properly installed at your site, the command .IP -.B info sum +.B info coreutils \(aqsum invocation\(aq .PP should give you access to the complete manual. diff --git a/src/bin/coreutils/man/sync.1 b/src/bin/coreutils/man/sync.1 index a88c87bcbf..a1ae20d644 100644 --- a/src/bin/coreutils/man/sync.1 +++ b/src/bin/coreutils/man/sync.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -.TH SYNC "1" "March 2007" "GNU coreutils 6.9" "User Commands" +.TH SYNC "1" "May 2009" "GNU coreutils 7.4" "User Commands" .SH NAME sync \- flush file system buffers .SH SYNOPSIS @@ -18,12 +18,16 @@ output version information and exit .SH AUTHOR Written by Jim Meyering. .SH "REPORTING BUGS" -Report bugs to . -.SH COPYRIGHT -Copyright \(co 2007 Free Software Foundation, Inc. +Report sync bugs to bug\-coreutils@gnu.org .br -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License . +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" sync(2) @@ -36,6 +40,6 @@ and .B sync programs are properly installed at your site, the command .IP -.B info sync +.B info coreutils \(aqsync invocation\(aq .PP should give you access to the complete manual. diff --git a/src/bin/coreutils/man/tac.1 b/src/bin/coreutils/man/tac.1 index 49f800beeb..af4bf46e55 100644 --- a/src/bin/coreutils/man/tac.1 +++ b/src/bin/coreutils/man/tac.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -.TH TAC "1" "March 2007" "GNU coreutils 6.9" "User Commands" +.TH TAC "1" "May 2009" "GNU coreutils 7.4" "User Commands" .SH NAME tac \- concatenate and print files in reverse .SH SYNOPSIS @@ -30,12 +30,16 @@ output version information and exit .SH AUTHOR Written by Jay Lepreau and David MacKenzie. .SH "REPORTING BUGS" -Report bugs to . -.SH COPYRIGHT -Copyright \(co 2007 Free Software Foundation, Inc. +Report tac bugs to bug\-coreutils@gnu.org .br -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License . +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" The full documentation for @@ -46,6 +50,6 @@ and .B tac programs are properly installed at your site, the command .IP -.B info tac +.B info coreutils \(aqtac invocation\(aq .PP should give you access to the complete manual. diff --git a/src/bin/coreutils/man/tail.1 b/src/bin/coreutils/man/tail.1 index 7e5074b674..92e8631b01 100644 --- a/src/bin/coreutils/man/tail.1 +++ b/src/bin/coreutils/man/tail.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -.TH TAIL "1" "March 2007" "GNU coreutils 6.9" "User Commands" +.TH TAIL "1" "May 2009" "GNU coreutils 7.4" "User Commands" .SH NAME tail \- output the last part of files .SH SYNOPSIS @@ -14,12 +14,6 @@ With no FILE, or when FILE is \-, read standard input. .PP Mandatory arguments to long options are mandatory for short options too. .TP -\fB\-\-retry\fR -keep trying to open a file even if it is -inaccessible when tail starts or if it becomes -inaccessible later; useful when following by name, -i.e., with \fB\-\-follow\fR=\fIname\fR -.TP \fB\-c\fR, \fB\-\-bytes\fR=\fIN\fR output the last N bytes; alternatively, use +N to output bytes starting with the Nth of each file @@ -48,9 +42,14 @@ with \fB\-f\fR, terminate after process ID, PID dies \fB\-q\fR, \fB\-\-quiet\fR, \fB\-\-silent\fR never output headers giving file names .TP +\fB\-\-retry\fR +keep trying to open a file even when it is or +becomes inaccessible; useful when following by +name, i.e., with \fB\-\-follow\fR=\fIname\fR +.TP \fB\-s\fR, \fB\-\-sleep\-interval\fR=\fIS\fR with \fB\-f\fR, sleep for approximately S seconds -(default 1.0) between iterations. +(default 1.0) between iterations .TP \fB\-v\fR, \fB\-\-verbose\fR always output headers giving file names @@ -64,7 +63,8 @@ output version information and exit If the first character of N (the number of bytes or lines) is a `+', print beginning with the Nth item from the start of each file, otherwise, print the last N items in the file. N may have a multiplier suffix: -b 512, k 1024, m 1024*1024. +b 512, kB 1000, K 1024, MB 1000*1000, M 1024*1024, +GB 1000*1000*1000, G 1024*1024*1024, and so on for T, P, E, Z, Y. .PP With \fB\-\-follow\fR (\fB\-f\fR), tail defaults to following the file descriptor, which means that even if a tail'ed file is renamed, tail will continue to track @@ -74,14 +74,19 @@ rotation). Use \fB\-\-follow\fR=\fIname\fR in that case. That causes tail to t named file by reopening it periodically to see if it has been removed and recreated by some other program. .SH AUTHOR -Written by Paul Rubin, David MacKenzie, Ian Lance Taylor, and Jim Meyering. +Written by Paul Rubin, David MacKenzie, Ian Lance Taylor, +and Jim Meyering. .SH "REPORTING BUGS" -Report bugs to . -.SH COPYRIGHT -Copyright \(co 2007 Free Software Foundation, Inc. +Report tail bugs to bug\-coreutils@gnu.org .br -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License . +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" The full documentation for @@ -92,6 +97,6 @@ and .B tail programs are properly installed at your site, the command .IP -.B info tail +.B info coreutils \(aqtail invocation\(aq .PP should give you access to the complete manual. diff --git a/src/bin/coreutils/man/tee.1 b/src/bin/coreutils/man/tee.1 index 7735a241a4..45c832efb0 100644 --- a/src/bin/coreutils/man/tee.1 +++ b/src/bin/coreutils/man/tee.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -.TH TEE "1" "March 2007" "GNU coreutils 6.9" "User Commands" +.TH TEE "1" "May 2009" "GNU coreutils 7.4" "User Commands" .SH NAME tee \- read from standard input and write to standard output and files .SH SYNOPSIS @@ -26,12 +26,16 @@ If a FILE is \-, copy again to standard output. .SH AUTHOR Written by Mike Parker, Richard M. Stallman, and David MacKenzie. .SH "REPORTING BUGS" -Report bugs to . -.SH COPYRIGHT -Copyright \(co 2007 Free Software Foundation, Inc. +Report tee bugs to bug\-coreutils@gnu.org .br -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License . +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" The full documentation for @@ -42,6 +46,6 @@ and .B tee programs are properly installed at your site, the command .IP -.B info tee +.B info coreutils \(aqtee invocation\(aq .PP should give you access to the complete manual. diff --git a/src/bin/coreutils/man/test.1 b/src/bin/coreutils/man/test.1 index ffb6a7b09b..2f422bdc26 100644 --- a/src/bin/coreutils/man/test.1 +++ b/src/bin/coreutils/man/test.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -.TH TEST "1" "March 2007" "GNU coreutils 6.9" "User Commands" +.TH TEST "1" "May 2009" "GNU coreutils 7.4" "User Commands" .SH NAME test \- check file types and compare values .SH SYNOPSIS @@ -146,18 +146,25 @@ Except for \fB\-h\fR and \fB\-L\fR, all FILE\-related tests dereference symbolic Beware that parentheses need to be escaped (e.g., by backslashes) for shells. INTEGER may also be \fB\-l\fR STRING, which evaluates to the length of STRING. .PP +NOTE: [ honors the \fB\-\-help\fR and \fB\-\-version\fR options, but test does not. +test treats each of those as it treats any other nonempty STRING. +.PP NOTE: your shell may have its own version of test and/or [, which usually supersedes the version described here. Please refer to your shell's documentation for details about the options it supports. .SH AUTHOR Written by Kevin Braunsdorf and Matthew Bradburn. .SH "REPORTING BUGS" -Report bugs to . -.SH COPYRIGHT -Copyright \(co 2007 Free Software Foundation, Inc. +Report test bugs to bug\-coreutils@gnu.org .br -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License . +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" The full documentation for @@ -168,6 +175,6 @@ and .B test programs are properly installed at your site, the command .IP -.B info test +.B info coreutils \(aqtest invocation\(aq .PP should give you access to the complete manual. diff --git a/src/bin/coreutils/man/timeout.1 b/src/bin/coreutils/man/timeout.1 new file mode 100644 index 0000000000..2326be5667 --- /dev/null +++ b/src/bin/coreutils/man/timeout.1 @@ -0,0 +1,65 @@ +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. +.TH TIMEOUT "1" "May 2009" "GNU coreutils 7.4" "User Commands" +.SH NAME +timeout \- run a command with a time limit +.SH SYNOPSIS +.B timeout +[\fIOPTION\fR] \fINUMBER\fR[\fISUFFIX\fR] \fICOMMAND \fR[\fIARG\fR]... +.br +.B timeout +[\fIOPTION\fR] +.SH DESCRIPTION +.\" Add any additional description here +.PP +Start COMMAND, and kill it if still running after NUMBER seconds. +SUFFIX may be `s' for seconds (the default), `m' for minutes, +`h' for hours or `d' for days. +.PP +Mandatory arguments to long options are mandatory for short options too. +.HP +\fB\-s\fR, \fB\-\-signal\fR=\fISIGNAL\fR +.IP +specify the signal to be sent on timeout. +SIGNAL may be a name like `HUP' or a number. +See `kill \fB\-l\fR` for a list of signals +.TP +\fB\-\-help\fR +display this help and exit +.TP +\fB\-\-version\fR +output version information and exit +.PP +If the command times out, then we exit with status 124, +otherwise the normal exit status of the command is returned. +If no signal is specified, the TERM signal is sent. The TERM signal +will kill processes which do not catch this signal. For other processes, +it may be necessary to use the KILL (9) signal, since this signal cannot +be caught. +.SH AUTHOR +Written by Padraig Brady. +.SH "REPORTING BUGS" +Report timeout bugs to bug\-coreutils@gnu.org +.br +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. +There is NO WARRANTY, to the extent permitted by law. +.SH "SEE ALSO" +kill(1) +.PP +The full documentation for +.B timeout +is maintained as a Texinfo manual. If the +.B info +and +.B timeout +programs are properly installed at your site, the command +.IP +.B info coreutils \(aqtimeout invocation\(aq +.PP +should give you access to the complete manual. diff --git a/src/bin/coreutils/man/timeout.x b/src/bin/coreutils/man/timeout.x new file mode 100644 index 0000000000..19ebed38a8 --- /dev/null +++ b/src/bin/coreutils/man/timeout.x @@ -0,0 +1,6 @@ +[NAME] +timeout \- run a command with a time limit +[DESCRIPTION] +.\" Add any additional description here +[SEE ALSO] +kill(1) diff --git a/src/bin/coreutils/man/touch.1 b/src/bin/coreutils/man/touch.1 index 2130b9771c..c85c4bbf06 100644 --- a/src/bin/coreutils/man/touch.1 +++ b/src/bin/coreutils/man/touch.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -.TH TOUCH "1" "March 2007" "GNU coreutils 6.9" "User Commands" +.TH TOUCH "1" "May 2009" "GNU coreutils 7.4" "User Commands" .SH NAME touch \- change file timestamps .SH SYNOPSIS @@ -10,6 +10,11 @@ touch \- change file timestamps .PP Update the access and modification times of each FILE to the current time. .PP +A FILE argument that does not exist is created empty. +.PP +A FILE argument string of \- is handled specially and causes touch to +change the times of the file associated with standard output. +.PP Mandatory arguments to long options are mandatory for short options too. .TP \fB\-a\fR @@ -45,17 +50,29 @@ display this help and exit output version information and exit .PP Note that the \fB\-d\fR and \fB\-t\fR options accept different time\-date formats. -.PP -If a FILE is \-, touch standard output. +.SH "DATE STRING" +.\" NOTE: keep this paragraph in sync with the one in date.x +The --date=STRING is a mostly free format human readable date string +such as "Sun, 29 Feb 2004 16:21:42 -0800" or "2004-02-29 16:21:42" or +even "next Thursday". A date string may contain items indicating +calendar date, time of day, time zone, day of week, relative time, +relative date, and numbers. An empty string indicates the beginning +of the day. The date string format is more complex than is easily +documented here but is fully described in the info documentation. .SH AUTHOR -Written by Paul Rubin, Arnold Robbins, Jim Kingdon, David MacKenzie, and Randy Smith. +Written by Paul Rubin, Arnold Robbins, Jim Kingdon, +David MacKenzie, and Randy Smith. .SH "REPORTING BUGS" -Report bugs to . -.SH COPYRIGHT -Copyright \(co 2007 Free Software Foundation, Inc. +Report touch bugs to bug\-coreutils@gnu.org .br -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License . +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" The full documentation for @@ -66,6 +83,6 @@ and .B touch programs are properly installed at your site, the command .IP -.B info touch +.B info coreutils \(aqtouch invocation\(aq .PP should give you access to the complete manual. diff --git a/src/bin/coreutils/man/touch.x b/src/bin/coreutils/man/touch.x index 64b99dfa1c..6c3aac2998 100644 --- a/src/bin/coreutils/man/touch.x +++ b/src/bin/coreutils/man/touch.x @@ -2,3 +2,12 @@ touch \- change file timestamps [DESCRIPTION] .\" Add any additional description here +[DATE STRING] +.\" NOTE: keep this paragraph in sync with the one in date.x +The --date=STRING is a mostly free format human readable date string +such as "Sun, 29 Feb 2004 16:21:42 -0800" or "2004-02-29 16:21:42" or +even "next Thursday". A date string may contain items indicating +calendar date, time of day, time zone, day of week, relative time, +relative date, and numbers. An empty string indicates the beginning +of the day. The date string format is more complex than is easily +documented here but is fully described in the info documentation. diff --git a/src/bin/coreutils/man/tr.1 b/src/bin/coreutils/man/tr.1 index 8cd224c46f..c6ee55a957 100644 --- a/src/bin/coreutils/man/tr.1 +++ b/src/bin/coreutils/man/tr.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -.TH TR "1" "March 2007" "GNU coreutils 6.9" "User Commands" +.TH TR "1" "May 2009" "GNU coreutils 7.4" "User Commands" .SH NAME tr \- translate or delete characters .SH SYNOPSIS @@ -120,12 +120,16 @@ translation or deletion. .SH AUTHOR Written by Jim Meyering. .SH "REPORTING BUGS" -Report bugs to . -.SH COPYRIGHT -Copyright \(co 2007 Free Software Foundation, Inc. +Report tr bugs to bug\-coreutils@gnu.org .br -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License . +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" The full documentation for @@ -136,6 +140,6 @@ and .B tr programs are properly installed at your site, the command .IP -.B info tr +.B info coreutils \(aqtr invocation\(aq .PP should give you access to the complete manual. diff --git a/src/bin/coreutils/man/true.1 b/src/bin/coreutils/man/true.1 index 58f979fd55..9a2b0ff31a 100644 --- a/src/bin/coreutils/man/true.1 +++ b/src/bin/coreutils/man/true.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -.TH TRUE "1" "March 2007" "GNU coreutils 6.9" "User Commands" +.TH TRUE "1" "May 2009" "GNU coreutils 7.4" "User Commands" .SH NAME true \- do nothing, successfully .SH SYNOPSIS @@ -25,12 +25,16 @@ for details about the options it supports. .SH AUTHOR Written by Jim Meyering. .SH "REPORTING BUGS" -Report bugs to . -.SH COPYRIGHT -Copyright \(co 2007 Free Software Foundation, Inc. +Report true bugs to bug\-coreutils@gnu.org .br -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License . +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" The full documentation for @@ -41,6 +45,6 @@ and .B true programs are properly installed at your site, the command .IP -.B info true +.B info coreutils \(aqtrue invocation\(aq .PP should give you access to the complete manual. diff --git a/src/bin/coreutils/man/truncate.1 b/src/bin/coreutils/man/truncate.1 new file mode 100644 index 0000000000..e0bfb581f0 --- /dev/null +++ b/src/bin/coreutils/man/truncate.1 @@ -0,0 +1,74 @@ +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. +.TH TRUNCATE "1" "May 2009" "GNU coreutils 7.4" "User Commands" +.SH NAME +truncate \- shrink or extend the size of a file to the specified size +.SH SYNOPSIS +.B truncate +\fIOPTION\fR... \fIFILE\fR... +.SH DESCRIPTION +.\" Add any additional description here +.PP +Shrink or extend the size of each FILE to the specified size +.PP +A FILE argument that does not exist is created. +.PP +If a FILE is larger than the specified size, the extra data is lost. +If a FILE is shorter, it is extended and the extended part (hole) +reads as zero bytes. +.PP +Mandatory arguments to long options are mandatory for short options too. +.TP +\fB\-c\fR, \fB\-\-no\-create\fR +do not create any files +.TP +\fB\-o\fR, \fB\-\-io\-blocks\fR +Treat SIZE as number of IO blocks instead of bytes +.TP +\fB\-r\fR, \fB\-\-reference\fR=\fIFILE\fR +use this FILE's size +.TP +\fB\-s\fR, \fB\-\-size\fR=\fISIZE\fR +use this SIZE +.TP +\fB\-\-help\fR +display this help and exit +.TP +\fB\-\-version\fR +output version information and exit +.PP +SIZE is a number which may be followed by one of the following suffixes: +KB 1000, K 1024, MB 1000*1000, M 1024*1024, and so on for G, T, P, E, Z, Y. +.PP +SIZE may also be prefixed by one of the following modifying characters: +`+' extend by, `\-' reduce by, `<' at most, `>' at least, +`/' round down to multiple of, `%' round up to multiple of. +.PP +Note that the \fB\-r\fR and \fB\-s\fR options are mutually exclusive. +.SH AUTHOR +Written by Padraig Brady. +.SH "REPORTING BUGS" +Report truncate bugs to bug\-coreutils@gnu.org +.br +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. +There is NO WARRANTY, to the extent permitted by law. +.SH "SEE ALSO" +dd(1), truncate(2), ftruncate(2) +.PP +The full documentation for +.B truncate +is maintained as a Texinfo manual. If the +.B info +and +.B truncate +programs are properly installed at your site, the command +.IP +.B info coreutils \(aqtruncate invocation\(aq +.PP +should give you access to the complete manual. diff --git a/src/bin/coreutils/man/truncate.x b/src/bin/coreutils/man/truncate.x new file mode 100644 index 0000000000..27a54b97d2 --- /dev/null +++ b/src/bin/coreutils/man/truncate.x @@ -0,0 +1,6 @@ +[NAME] +truncate \- shrink or extend the size of a file to the specified size +[DESCRIPTION] +.\" Add any additional description here +[SEE ALSO] +dd(1), truncate(2), ftruncate(2) diff --git a/src/bin/coreutils/man/tsort.1 b/src/bin/coreutils/man/tsort.1 index 7735bb9ef2..d1b4b4ee21 100644 --- a/src/bin/coreutils/man/tsort.1 +++ b/src/bin/coreutils/man/tsort.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -.TH TSORT "1" "March 2007" "GNU coreutils 6.9" "User Commands" +.TH TSORT "1" "May 2009" "GNU coreutils 7.4" "User Commands" .SH NAME tsort \- perform topological sort .SH SYNOPSIS @@ -19,12 +19,16 @@ output version information and exit .SH AUTHOR Written by Mark Kettenis. .SH "REPORTING BUGS" -Report bugs to . -.SH COPYRIGHT -Copyright \(co 2007 Free Software Foundation, Inc. +Report tsort bugs to bug\-coreutils@gnu.org .br -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License . +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" The full documentation for @@ -35,6 +39,6 @@ and .B tsort programs are properly installed at your site, the command .IP -.B info tsort +.B info coreutils \(aqtsort invocation\(aq .PP should give you access to the complete manual. diff --git a/src/bin/coreutils/man/tty.1 b/src/bin/coreutils/man/tty.1 index 9586a24d10..4b7f78e7a9 100644 --- a/src/bin/coreutils/man/tty.1 +++ b/src/bin/coreutils/man/tty.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -.TH TTY "1" "March 2007" "GNU coreutils 6.9" "User Commands" +.TH TTY "1" "May 2009" "GNU coreutils 7.4" "User Commands" .SH NAME tty \- print the file name of the terminal connected to standard input .SH SYNOPSIS @@ -21,12 +21,16 @@ output version information and exit .SH AUTHOR Written by David MacKenzie. .SH "REPORTING BUGS" -Report bugs to . -.SH COPYRIGHT -Copyright \(co 2007 Free Software Foundation, Inc. +Report tty bugs to bug\-coreutils@gnu.org .br -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License . +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" The full documentation for @@ -37,6 +41,6 @@ and .B tty programs are properly installed at your site, the command .IP -.B info tty +.B info coreutils \(aqtty invocation\(aq .PP should give you access to the complete manual. diff --git a/src/bin/coreutils/man/uname.1 b/src/bin/coreutils/man/uname.1 index 66c3c31ceb..51310dba18 100644 --- a/src/bin/coreutils/man/uname.1 +++ b/src/bin/coreutils/man/uname.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -.TH UNAME "1" "March 2007" "GNU coreutils 6.9" "User Commands" +.TH UNAME "1" "May 2009" "GNU coreutils 7.4" "User Commands" .SH NAME uname \- print system information .SH SYNOPSIS @@ -46,15 +46,19 @@ output version information and exit .SH AUTHOR Written by David MacKenzie. .SH "REPORTING BUGS" -Report bugs to . -.SH COPYRIGHT -Copyright \(co 2007 Free Software Foundation, Inc. +Report uname bugs to bug\-coreutils@gnu.org .br -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License . +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" -uname(2) +arch(1), uname(2) .PP The full documentation for .B uname @@ -64,6 +68,6 @@ and .B uname programs are properly installed at your site, the command .IP -.B info uname +.B info coreutils \(aquname invocation\(aq .PP should give you access to the complete manual. diff --git a/src/bin/coreutils/man/uname.x b/src/bin/coreutils/man/uname.x index b019140ae6..b27e86f1d2 100644 --- a/src/bin/coreutils/man/uname.x +++ b/src/bin/coreutils/man/uname.x @@ -3,4 +3,4 @@ uname \- print system information [DESCRIPTION] .\" Add any additional description here [SEE ALSO] -uname(2) +arch(1), uname(2) diff --git a/src/bin/coreutils/man/unexpand.1 b/src/bin/coreutils/man/unexpand.1 index c5e1c19b20..866385ddd6 100644 --- a/src/bin/coreutils/man/unexpand.1 +++ b/src/bin/coreutils/man/unexpand.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -.TH UNEXPAND "1" "March 2007" "GNU coreutils 6.9" "User Commands" +.TH UNEXPAND "1" "May 2009" "GNU coreutils 7.4" "User Commands" .SH NAME unexpand \- convert spaces to tabs .SH SYNOPSIS @@ -33,12 +33,16 @@ output version information and exit .SH AUTHOR Written by David MacKenzie. .SH "REPORTING BUGS" -Report bugs to . -.SH COPYRIGHT -Copyright \(co 2007 Free Software Foundation, Inc. +Report unexpand bugs to bug\-coreutils@gnu.org .br -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License . +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" expand(1) @@ -51,6 +55,6 @@ and .B unexpand programs are properly installed at your site, the command .IP -.B info unexpand +.B info coreutils \(aqunexpand invocation\(aq .PP should give you access to the complete manual. diff --git a/src/bin/coreutils/man/uniq.1 b/src/bin/coreutils/man/uniq.1 index 881d448cca..9f6200733a 100644 --- a/src/bin/coreutils/man/uniq.1 +++ b/src/bin/coreutils/man/uniq.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -.TH UNIQ "1" "March 2007" "GNU coreutils 6.9" "User Commands" +.TH UNIQ "1" "May 2009" "GNU coreutils 7.4" "User Commands" .SH NAME uniq \- report or omit repeated lines .SH SYNOPSIS @@ -8,8 +8,10 @@ uniq \- report or omit repeated lines .SH DESCRIPTION .\" Add any additional description here .PP -Discard all but one of successive identical lines from INPUT (or -standard input), writing to OUTPUT (or standard output). +Filter adjacent matching lines from INPUT (or standard input), +writing to OUTPUT (or standard output). +.PP +With no options, matching lines are merged to the first occurrence. .PP Mandatory arguments to long options are mandatory for short options too. .TP @@ -36,6 +38,9 @@ avoid comparing the first N characters \fB\-u\fR, \fB\-\-unique\fR only print unique lines .TP +\fB\-z\fR, \fB\-\-zero\-terminated\fR +end lines with 0 byte, not newline +.TP \fB\-w\fR, \fB\-\-check\-chars\fR=\fIN\fR compare no more than N characters in lines .TP @@ -45,17 +50,25 @@ display this help and exit \fB\-\-version\fR output version information and exit .PP -A field is a run of whitespace, then non\-whitespace characters. -Fields are skipped before chars. +A field is a run of blanks (usually spaces and/or TABs), then non\-blank +characters. Fields are skipped before chars. +.PP +Note: 'uniq' does not detect repeated lines unless they are adjacent. +You may want to sort the input first, or use `sort \fB\-u\fR' without `uniq'. +Also, comparisons honor the rules specified by `LC_COLLATE'. .SH AUTHOR -Written by Richard Stallman and David MacKenzie. +Written by Richard M. Stallman and David MacKenzie. .SH "REPORTING BUGS" -Report bugs to . -.SH COPYRIGHT -Copyright \(co 2007 Free Software Foundation, Inc. +Report uniq bugs to bug\-coreutils@gnu.org .br -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License . +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" The full documentation for @@ -66,6 +79,6 @@ and .B uniq programs are properly installed at your site, the command .IP -.B info uniq +.B info coreutils \(aquniq invocation\(aq .PP should give you access to the complete manual. diff --git a/src/bin/coreutils/man/unlink.1 b/src/bin/coreutils/man/unlink.1 index d5f6f0e43d..8cd8f14eb9 100644 --- a/src/bin/coreutils/man/unlink.1 +++ b/src/bin/coreutils/man/unlink.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -.TH UNLINK "1" "March 2007" "GNU coreutils 6.9" "User Commands" +.TH UNLINK "1" "May 2009" "GNU coreutils 7.4" "User Commands" .SH NAME unlink \- call the unlink function to remove the specified file .SH SYNOPSIS @@ -21,12 +21,16 @@ output version information and exit .SH AUTHOR Written by Michael Stone. .SH "REPORTING BUGS" -Report bugs to . -.SH COPYRIGHT -Copyright \(co 2007 Free Software Foundation, Inc. +Report unlink bugs to bug\-coreutils@gnu.org .br -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License . +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" unlink(2) @@ -39,6 +43,6 @@ and .B unlink programs are properly installed at your site, the command .IP -.B info unlink +.B info coreutils \(aqunlink invocation\(aq .PP should give you access to the complete manual. diff --git a/src/bin/coreutils/man/uptime.1 b/src/bin/coreutils/man/uptime.1 index 17b274deb2..c045d13b95 100644 --- a/src/bin/coreutils/man/uptime.1 +++ b/src/bin/coreutils/man/uptime.1 @@ -1,16 +1,17 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -.TH UPTIME "1" "March 2007" "GNU coreutils 6.9" "User Commands" +.TH UPTIME "1" "May 2009" "GNU coreutils 7.4" "User Commands" .SH NAME uptime \- tell how long the system has been running .SH SYNOPSIS .B uptime -[\fIOPTION\fR]... [ \fIFILE \fR] +[\fIOPTION\fR]... [\fIFILE\fR] .SH DESCRIPTION .\" Add any additional description here .PP Print the current time, the length of time the system has been up, the number of users on the system, and the average number of jobs -in the run queue over the last 1, 5 and 15 minutes. +in the run queue over the last 1, 5 and 15 minutes. Processes in +an uninterruptible sleep state also contribute to the load average. If FILE is not specified, use /var/run/utmp. /var/log/wtmp as FILE is common. .TP \fB\-\-help\fR @@ -21,12 +22,16 @@ output version information and exit .SH AUTHOR Written by Joseph Arceneaux, David MacKenzie, and Kaveh Ghazi. .SH "REPORTING BUGS" -Report bugs to . -.SH COPYRIGHT -Copyright \(co 2007 Free Software Foundation, Inc. +Report uptime bugs to bug\-coreutils@gnu.org .br -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License . +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" The full documentation for @@ -37,6 +42,6 @@ and .B uptime programs are properly installed at your site, the command .IP -.B info uptime +.B info coreutils \(aquptime invocation\(aq .PP should give you access to the complete manual. diff --git a/src/bin/coreutils/man/users.1 b/src/bin/coreutils/man/users.1 index c8ca43b03e..36ece46b7b 100644 --- a/src/bin/coreutils/man/users.1 +++ b/src/bin/coreutils/man/users.1 @@ -1,10 +1,10 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -.TH USERS "1" "March 2007" "GNU coreutils 6.9" "User Commands" +.TH USERS "1" "May 2009" "GNU coreutils 7.4" "User Commands" .SH NAME users \- print the user names of users currently logged in to the current host .SH SYNOPSIS .B users -[\fIOPTION\fR]... [ \fIFILE \fR] +[\fIOPTION\fR]... [\fIFILE\fR] .SH DESCRIPTION .\" Add any additional description here .PP @@ -19,12 +19,16 @@ output version information and exit .SH AUTHOR Written by Joseph Arceneaux and David MacKenzie. .SH "REPORTING BUGS" -Report bugs to . -.SH COPYRIGHT -Copyright \(co 2007 Free Software Foundation, Inc. +Report users bugs to bug\-coreutils@gnu.org .br -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License . +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" The full documentation for @@ -35,6 +39,6 @@ and .B users programs are properly installed at your site, the command .IP -.B info users +.B info coreutils \(aqusers invocation\(aq .PP should give you access to the complete manual. diff --git a/src/bin/coreutils/man/vdir.1 b/src/bin/coreutils/man/vdir.1 index d6ca7fa175..5f2deff61c 100644 --- a/src/bin/coreutils/man/vdir.1 +++ b/src/bin/coreutils/man/vdir.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -.TH VDIR "1" "March 2007" "GNU coreutils 6.9" "User Commands" +.TH VDIR "1" "May 2009" "GNU coreutils 7.4" "User Commands" .SH NAME vdir \- list directory contents .SH SYNOPSIS @@ -71,7 +71,10 @@ like \fB\-l\fR \fB\-\-time\-style\fR=\fIfull\-iso\fR like \fB\-l\fR, but do not list owner .TP \fB\-\-group\-directories\-first\fR -group directories before files +group directories before files. +.IP +augment with a \fB\-\-sort\fR option, but any +use of \fB\-\-sort\fR=\fInone\fR (\fB\-U\fR) disables grouping .TP \fB\-G\fR, \fB\-\-no\-group\fR in a long listing, don't print group names @@ -153,7 +156,7 @@ reverse order while sorting list subdirectories recursively .TP \fB\-s\fR, \fB\-\-size\fR -print the size of each file, in blocks +print the allocated size of each file, in blocks .TP \fB\-S\fR sort by file size @@ -192,7 +195,7 @@ otherwise: sort by access time do not sort; list entries in directory order .TP \fB\-v\fR -sort by version +natural sort of (version) numbers within text .TP \fB\-w\fR, \fB\-\-width\fR=\fICOLS\fR assume screen width instead of current value @@ -203,6 +206,9 @@ list entries by lines instead of by columns \fB\-X\fR sort alphabetically by entry extension .TP +\fB\-Z\fR, \fB\-\-context\fR +print any SELinux security context of each file +.TP \fB\-1\fR list one file per line .TP @@ -221,17 +227,29 @@ optional WHEN argument is equivalent to using \fB\-\-color\fR=\fIalways\fR. Wit \fB\-\-color\fR=\fIauto\fR, color codes are output only if standard output is connected to a terminal (tty). The environment variable LS_COLORS can influence the colors, and can be set easily by the dircolors command. -.PP -Exit status is 0 if OK, 1 if minor problems, 2 if serious trouble. +.SS "Exit status:" +.TP +0 +if OK, +.TP +1 +if minor problems (e.g., cannot access subdirectory), +.TP +2 +if serious trouble (e.g., cannot access command\-line argument). .SH AUTHOR -Written by Richard Stallman and David MacKenzie. +Written by Richard M. Stallman and David MacKenzie. .SH "REPORTING BUGS" -Report bugs to . -.SH COPYRIGHT -Copyright \(co 2007 Free Software Foundation, Inc. +Report vdir bugs to bug\-coreutils@gnu.org .br -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License . +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" The full documentation for @@ -242,6 +260,6 @@ and .B vdir programs are properly installed at your site, the command .IP -.B info vdir +.B info coreutils \(aqvdir invocation\(aq .PP should give you access to the complete manual. diff --git a/src/bin/coreutils/man/wc.1 b/src/bin/coreutils/man/wc.1 index 475678fcd5..83586331c0 100644 --- a/src/bin/coreutils/man/wc.1 +++ b/src/bin/coreutils/man/wc.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -.TH WC "1" "March 2007" "GNU coreutils 6.9" "User Commands" +.TH WC "1" "May 2009" "GNU coreutils 7.4" "User Commands" .SH NAME wc \- print newline, word, and byte counts for each file .SH SYNOPSIS @@ -26,7 +26,8 @@ print the newline counts .TP \fB\-\-files0\-from\fR=\fIF\fR read input from the files specified by -NUL\-terminated names in file F +NUL\-terminated names in file F; +If F is \- then read names from standard input .TP \fB\-L\fR, \fB\-\-max\-line\-length\fR print the length of the longest line @@ -42,12 +43,16 @@ output version information and exit .SH AUTHOR Written by Paul Rubin and David MacKenzie. .SH "REPORTING BUGS" -Report bugs to . -.SH COPYRIGHT -Copyright \(co 2007 Free Software Foundation, Inc. +Report wc bugs to bug\-coreutils@gnu.org .br -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License . +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" The full documentation for @@ -58,6 +63,6 @@ and .B wc programs are properly installed at your site, the command .IP -.B info wc +.B info coreutils \(aqwc invocation\(aq .PP should give you access to the complete manual. diff --git a/src/bin/coreutils/man/who.1 b/src/bin/coreutils/man/who.1 index 733f62bb8b..21b948cb22 100644 --- a/src/bin/coreutils/man/who.1 +++ b/src/bin/coreutils/man/who.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -.TH WHO "1" "March 2007" "GNU coreutils 6.9" "User Commands" +.TH WHO "1" "May 2009" "GNU coreutils 7.4" "User Commands" .SH NAME who \- show who is logged on .SH SYNOPSIS @@ -7,6 +7,8 @@ who \- show who is logged on [\fIOPTION\fR]... [ \fIFILE | ARG1 ARG2 \fR] .SH DESCRIPTION .\" Add any additional description here +.PP +Print information about users who are currently logged in. .TP \fB\-a\fR, \fB\-\-all\fR same as \fB\-b\fR \fB\-d\fR \fB\-\-login\fR \fB\-p\fR \fB\-r\fR \fB\-t\fR \fB\-T\fR \fB\-u\fR @@ -67,12 +69,16 @@ If ARG1 ARG2 given, \fB\-m\fR presumed: `am i' or `mom likes' are usual. .SH AUTHOR Written by Joseph Arceneaux, David MacKenzie, and Michael Stone. .SH "REPORTING BUGS" -Report bugs to . -.SH COPYRIGHT -Copyright \(co 2007 Free Software Foundation, Inc. +Report who bugs to bug\-coreutils@gnu.org .br -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License . +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" The full documentation for @@ -83,6 +89,6 @@ and .B who programs are properly installed at your site, the command .IP -.B info who +.B info coreutils \(aqwho invocation\(aq .PP should give you access to the complete manual. diff --git a/src/bin/coreutils/man/whoami.1 b/src/bin/coreutils/man/whoami.1 index 9a37e024bb..35b1348210 100644 --- a/src/bin/coreutils/man/whoami.1 +++ b/src/bin/coreutils/man/whoami.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -.TH WHOAMI "1" "March 2007" "GNU coreutils 6.9" "User Commands" +.TH WHOAMI "1" "May 2009" "GNU coreutils 7.4" "User Commands" .SH NAME whoami \- print effective userid .SH SYNOPSIS @@ -19,12 +19,16 @@ output version information and exit .SH AUTHOR Written by Richard Mlynarik. .SH "REPORTING BUGS" -Report bugs to . -.SH COPYRIGHT -Copyright \(co 2007 Free Software Foundation, Inc. +Report whoami bugs to bug\-coreutils@gnu.org .br -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License . +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" The full documentation for @@ -35,6 +39,6 @@ and .B whoami programs are properly installed at your site, the command .IP -.B info whoami +.B info coreutils \(aqwhoami invocation\(aq .PP should give you access to the complete manual. diff --git a/src/bin/coreutils/man/yes.1 b/src/bin/coreutils/man/yes.1 index 127aaef4a4..9cbbf70cbb 100644 --- a/src/bin/coreutils/man/yes.1 +++ b/src/bin/coreutils/man/yes.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -.TH YES "1" "March 2007" "GNU coreutils 6.9" "User Commands" +.TH YES "1" "May 2009" "GNU coreutils 7.4" "User Commands" .SH NAME yes \- output a string repeatedly until killed .SH SYNOPSIS @@ -21,12 +21,16 @@ output version information and exit .SH AUTHOR Written by David MacKenzie. .SH "REPORTING BUGS" -Report bugs to . -.SH COPYRIGHT -Copyright \(co 2007 Free Software Foundation, Inc. +Report yes bugs to bug\-coreutils@gnu.org .br -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License . +GNU coreutils home page: +.br +General help using GNU software: +.SH COPYRIGHT +Copyright \(co 2009 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" The full documentation for @@ -37,6 +41,6 @@ and .B yes programs are properly installed at your site, the command .IP -.B info yes +.B info coreutils \(aqyes invocation\(aq .PP should give you access to the complete manual. diff --git a/src/bin/coreutils/src/Jamfile b/src/bin/coreutils/src/Jamfile index 38894e6d30..49bf75ee4e 100644 --- a/src/bin/coreutils/src/Jamfile +++ b/src/bin/coreutils/src/Jamfile @@ -31,10 +31,9 @@ StdBinCommands false.c fmt.c fold.c + getlimits.c head.c - id.c join.c - kill.c link.c ln.c logname.c @@ -50,7 +49,6 @@ StdBinCommands printf.c ptx.c readlink.c - rmdir.c seq.c shred.c shuf.c @@ -66,6 +64,7 @@ StdBinCommands touch.c tr.c true.c + truncate.c tsort.c tty.c unexpand.c @@ -86,7 +85,6 @@ MODE on su = 04755 ; StdBinCommands hostname.c tail.c - uname.c : libfetish.a $(TARGET_SELECT_UNAME_ETC_LIB) : $(coreutils_rsrc) ; #commands requiring something in libroot.so (getrlimit, fchdir...) @@ -95,7 +93,6 @@ StdBinCommands chmod.c chroot.c du.c - mkdir.c pwd.c sleep.c sort.c @@ -109,6 +106,12 @@ StdBinCommands BinCommand "[" : lbracket.c : libfetish.a : $(coreutils_rsrc) ; +BinCommand kill : kill.c operand2sig.c : libfetish.a : $(coreutils_rsrc) ; + +BinCommand id : id.c group-list.c : libfetish.a : $(coreutils_rsrc) ; + +BinCommand groups : groups.c [ FGristFiles group-list.o ] : libfetish.a : $(coreutils_rsrc) ; + BinCommand ls : ls.c ls-ls.c : libfetish.a : $(coreutils_rsrc) ; @@ -142,8 +145,13 @@ BinCommand vdir : BinCommand dir : [ FGristFiles ls.o ] ls-dir.c : libfetish.a : $(coreutils_rsrc) ; -BinCommand install : install.c [ FGristFiles copy.o cp-hash.o ] +BinCommand install : install.c prog-fprintf.c [ FGristFiles copy.o cp-hash.o ] : libfetish.a : $(coreutils_rsrc) ; -MakeLocatePlatform groups ; -Shell groups : groups.sh ; +BinCommand mkdir : mkdir.c [ FGristFiles prog-fprintf.o ] : libfetish.a libroot.so : $(coreutils_rsrc) ; + +BinCommand rmdir : rmdir.c [ FGristFiles prog-fprintf.o ] : libfetish.a libroot.so : $(coreutils_rsrc) ; + +BinCommand uname : uname.c uname-uname.c : libfetish.a $(TARGET_SELECT_UNAME_ETC_LIB) : $(coreutils_rsrc) ; + +BinCommand timeout : timeout.c [ FGristFiles operand2sig.o ] : libfetish.a : $(coreutils_rsrc) ; diff --git a/src/bin/coreutils/src/Makefile.am b/src/bin/coreutils/src/Makefile.am index 863a32b5aa..3bed7b1af6 100644 --- a/src/bin/coreutils/src/Makefile.am +++ b/src/bin/coreutils/src/Makefile.am @@ -1,37 +1,52 @@ ## Process this file with automake to produce Makefile.in -*-Makefile-*- -## Copyright (C) 1990, 1991, 1993-2007 Free Software Foundation, Inc. +## Copyright (C) 1990, 1991, 1993-2009 Free Software Foundation, Inc. -## This program is free software; you can redistribute it and/or modify +## This program is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2, or (at your option) -## any later version. - +## the Free Software Foundation, either version 3 of the License, or +## (at your option) any later version. +## ## This program is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. - +## ## You should have received a copy of the GNU General Public License -## along with this program; if not, write to the Free Software Foundation, -## Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +## along with this program. If not, see . -EXTRA_PROGRAMS = chroot df hostid nice pinky stty su uname uptime users who +# These are the names of programs that are not installed by default. +# This list is *not* intended for programs like who, nice, chroot, etc., +# that are built only when certain requisite system features are detected. +# Hence, if you want to install programs from this list anyway, say A and B, +# use --enable-install-program=A,B +no_install__progs = \ + arch hostname su -bin_SCRIPTS = groups -bin_PROGRAMS = [ chgrp chown chmod cp dd dircolors du \ +build_if_possible__progs = \ + chroot df hostid nice pinky stty su uname uptime users who + +AM_CFLAGS = $(WARN_CFLAGS) $(WERROR_CFLAGS) + +EXTRA_PROGRAMS = \ + $(no_install__progs) \ + $(build_if_possible__progs) \ + [ chcon chgrp chown chmod cp dd dircolors du \ ginstall link ln dir vdir ls mkdir \ - mkfifo mknod mv nohup readlink rm rmdir shred stat sync touch unlink \ - cat cksum comm csplit cut expand fmt fold head join md5sum \ + mkfifo mknod mktemp \ + mv nohup readlink rm rmdir shred stat sync touch unlink \ + cat cksum comm csplit cut expand fmt fold head join groups md5sum \ nl od paste pr ptx sha1sum sha224sum sha256sum sha384sum sha512sum \ shuf sort split sum tac tail tr tsort unexpand uniq wc \ basename date dirname echo env expr factor false \ - hostname id kill logname pathchk printenv printf pwd seq sleep tee \ - test true tty whoami yes \ - base64 \ - $(OPTIONAL_BIN_PROGS) $(DF_PROG) + id kill logname pathchk printenv printf pwd \ + runcon seq sleep tee \ + test timeout true truncate tty whoami yes \ + base64 -noinst_PROGRAMS = setuidgid +bin_PROGRAMS = $(OPTIONAL_BIN_PROGS) + +noinst_PROGRAMS = setuidgid getlimits noinst_HEADERS = \ chown-core.h \ @@ -39,30 +54,55 @@ noinst_HEADERS = \ cp-hash.h \ dircolors.h \ fs.h \ + group-list.h \ ls.h \ + operand2sig.h \ + prog-fprintf.h \ remove.h \ system.h \ wheel-size.h \ - wheel.h + wheel.h \ + uname.h EXTRA_DIST = dcgen dircolors.hin tac-pipe.c \ - groups.sh wheel-gen.pl extract-magic c99-to-c89.diff + wheel-gen.pl extract-magic c99-to-c89.diff BUILT_SOURCES = CLEANFILES = $(SCRIPTS) su +# Also remove these sometimes-built programs. +# For example, even when excluded, they're built via check-AUTHORS. +CLEANFILES += $(no_install__progs) + AM_CPPFLAGS = -I$(top_srcdir)/lib +noinst_LIBRARIES = libver.a +nodist_libver_a_SOURCES = version.c version.h + # Sometimes, the expansion of $(LIBINTL) includes -lc which may # include modules defining variables like `optind', so libcoreutils.a # must precede $(LIBINTL) in order to ensure we use GNU getopt. # But libcoreutils.a must also follow $(LIBINTL), since libintl uses # replacement functions defined in libcoreutils.a. -LDADD = ../lib/libcoreutils.a $(LIBINTL) ../lib/libcoreutils.a +LDADD = libver.a ../lib/libcoreutils.a $(LIBINTL) ../lib/libcoreutils.a + +cat_LDADD = $(LDADD) +df_LDADD = $(LDADD) +du_LDADD = $(LDADD) +getlimits_LDADD = $(LDADD) +ptx_LDADD = $(LDADD) +split_LDADD = $(LDADD) +timeout_LDADD = $(LDADD) +truncate_LDADD = $(LDADD) # for eaccess in lib/euidaccess.c. -cp_LDADD = $(LDADD) $(LIB_EACCESS) -ginstall_LDADD = $(LDADD) $(LIB_EACCESS) -mv_LDADD = $(LDADD) $(LIB_EACCESS) +chcon_LDADD = $(LDADD) $(LIB_SELINUX) +cp_LDADD = $(LDADD) $(LIB_EACCESS) $(LIB_SELINUX) +ginstall_LDADD = $(LDADD) $(LIB_EACCESS) $(LIB_SELINUX) +mkdir_LDADD = $(LDADD) $(LIB_SELINUX) +mkfifo_LDADD = $(LDADD) $(LIB_SELINUX) +mknod_LDADD = $(LDADD) $(LIB_SELINUX) +mv_LDADD = $(LDADD) $(LIB_EACCESS) $(LIB_SELINUX) +runcon_LDADD = $(LDADD) $(LIB_SELINUX) pathchk_LDADD = $(LDADD) $(LIB_EACCESS) rm_LDADD = $(LDADD) $(LIB_EACCESS) test_LDADD = $(LDADD) $(LIB_EACCESS) @@ -71,12 +111,15 @@ __LDADD = $(LDADD) $(LIB_EACCESS) # for clock_gettime and fdatasync dd_LDADD = $(LDADD) $(LIB_GETHRXTIME) $(LIB_FDATASYNC) -dir_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME) -ls_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME) +dir_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME) $(LIB_SELINUX) $(LIB_CAP) +id_LDADD = $(LDADD) $(LIB_SELINUX) +ls_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME) $(LIB_SELINUX) $(LIB_CAP) +mktemp_LDADD = $(LDADD) $(LIB_GETHRXTIME) pr_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME) shred_LDADD = $(LDADD) $(LIB_GETHRXTIME) $(LIB_FDATASYNC) shuf_LDADD = $(LDADD) $(LIB_GETHRXTIME) -vdir_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME) +tac_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME) +vdir_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME) $(LIB_SELINUX) $(LIB_CAP) ## If necessary, add -lm to resolve use of pow in lib/strtod.c. sort_LDADD = $(LDADD) $(POW_LIB) $(LIB_GETHRXTIME) @@ -96,6 +139,12 @@ seq_LDADD = $(LDADD) $(POW_LIB) # and the `nanosleep' reference in lib/xnanosleep.c. nanosec_libs = $(LDADD) $(POW_LIB) $(LIB_NANOSLEEP) +# for various GMP functions +expr_LDADD = $(LDADD) $(LIB_GMP) + +# for various GMP functions +factor_LDADD = $(LDADD) $(LIB_GMP) + sleep_LDADD = $(nanosec_libs) tail_LDADD = $(nanosec_libs) @@ -104,96 +153,124 @@ uptime_LDADD = $(LDADD) $(POW_LIB) $(GETLOADAVG_LIBS) su_LDADD = $(LDADD) $(LIB_CRYPT) -dir_LDADD += $(LIB_ACL_TRIVIAL) $(LIB_ACL) -ls_LDADD += $(LIB_ACL_TRIVIAL) $(LIB_ACL) -vdir_LDADD += $(LIB_ACL_TRIVIAL) $(LIB_ACL) -cp_LDADD += $(LIB_ACL) -mv_LDADD += $(LIB_ACL) -ginstall_LDADD += $(LIB_ACL) +dir_LDADD += $(LIB_ACL) +ls_LDADD += $(LIB_ACL) +vdir_LDADD += $(LIB_ACL) +cp_LDADD += $(LIB_ACL) $(LIB_XATTR) +mv_LDADD += $(LIB_ACL) $(LIB_XATTR) +ginstall_LDADD += $(LIB_ACL) $(LIB_XATTR) + +stat_LDADD = $(LDADD) $(LIB_SELINUX) + +# Append $(LIBICONV) to each program that uses proper_name_utf8. +cat_LDADD += $(LIBICONV) +cp_LDADD += $(LIBICONV) +df_LDADD += $(LIBICONV) +du_LDADD += $(LIBICONV) +getlimits_LDADD += $(LIBICONV) +ptx_LDADD += $(LIBICONV) +split_LDADD += $(LIBICONV) +timeout_LDADD += $(LIBICONV) +truncate_LDADD += $(LIBICONV) + +# programs that use getaddrinfo (e.g., via canon_host) +pinky_LDADD = $(LDADD) $(GETADDRINFO_LIB) +who_LDADD = $(LDADD) $(GETADDRINFO_LIB) $(PROGRAMS): ../lib/libcoreutils.a -SUFFIXES = .sh - # Get the release year from ../lib/version-etc.c. RELEASE_YEAR = \ `sed -n '/.*COPYRIGHT_YEAR = \([0-9][0-9][0-9][0-9]\) };/s//\1/p' \ $(top_srcdir)/lib/version-etc.c` -.sh: - rm -f $@ $@-t - sed \ - -e 's!@''bindir''@!$(bindir)!' \ - -e 's/@''RELEASE_YEAR'@/$(RELEASE_YEAR)/ \ - -e 's/@''GNU_PACKAGE''@/$(GNU_PACKAGE)/' \ - -e 's/@''PACKAGE_BUGREPORT''@/$(PACKAGE_BUGREPORT)/' \ - -e 's/@''VERSION''@/$(VERSION)/' $< > $@-t - chmod +x $@-t - mv $@-t $@ - all-local: su$(EXEEXT) installed_su = $(DESTDIR)$(bindir)/`echo su|sed '$(transform)'` setuid_root_mode = a=rx,u+s -INSTALL_SU = \ - p=su; \ - echo " $(INSTALL_PROGRAM) $$p $(installed_su)"; \ - $(INSTALL_PROGRAM) $$p $(installed_su); \ - echo " chown root $(installed_su)"; \ - chown root $(installed_su); \ - echo " chmod $(setuid_root_mode) $(installed_su)"; \ - chmod $(setuid_root_mode) $(installed_su) +install_su = \ + if test "$(INSTALL_SU)" = yes; then \ + p=su; \ + echo " $(INSTALL_PROGRAM) $$p $(installed_su)"; \ + $(INSTALL_PROGRAM) $$p $(installed_su); \ + echo " chown root $(installed_su)"; \ + chown root $(installed_su); \ + echo " chmod $(setuid_root_mode) $(installed_su)"; \ + chmod $(setuid_root_mode) $(installed_su); \ + else \ + :; \ + fi install-root: su$(EXEEXT) - @$(INSTALL_SU) + @$(install_su) -install-exec-local: su$(EXEEXT) - @TMPFILE=$(DESTDIR)$(bindir)/.su-$$$$; \ - rm -f $$TMPFILE; \ - echo > $$TMPFILE; \ +install-exec-hook: su$(EXEEXT) + @if test "$(INSTALL_SU)" = yes; then \ + TMPFILE=$(DESTDIR)$(bindir)/.su-$$$$; \ + rm -f $$TMPFILE; \ + echo > $$TMPFILE; \ ## See if we can create a setuid root executable in $(bindir). ## If not, then don't even try to install su. - can_create_suid_root_executable=no; \ - chown root $$TMPFILE > /dev/null 2>&1 \ - && chmod $(setuid_root_mode) $$TMPFILE > /dev/null 2>&1 \ - && can_create_suid_root_executable=yes; \ - rm -f $$TMPFILE; \ - if test $$can_create_suid_root_executable = yes; then \ - $(INSTALL_SU); \ - else \ - echo "WARNING: insufficient access; not installing su"; \ - echo "NOTE: to install su, run 'make install-root' as root"; \ + can_create_suid_root_executable=no; \ + chown root $$TMPFILE > /dev/null 2>&1 \ + && chmod $(setuid_root_mode) $$TMPFILE > /dev/null 2>&1 \ + && can_create_suid_root_executable=yes; \ + rm -f $$TMPFILE; \ + if test $$can_create_suid_root_executable = yes; then \ + $(install_su); \ + else \ + echo "WARNING: insufficient access; not installing su"; \ + echo "NOTE: to install su, run 'make install-root' as root"; \ + rm -f $(installed_su); \ + fi; \ + else :; \ fi uninstall-local: # Remove su only if it's one we installed. - @if grep '$(GNU_PACKAGE)' $(installed_su) > /dev/null 2>&1; then \ - echo " rm -f $(installed_su)"; \ - rm -f $(installed_su); \ - else :; fi + @if test "$(INSTALL_SU)" = yes; then \ + if grep '$(PACKAGE_NAME)' $(installed_su) > /dev/null 2>&1; then \ + echo " rm -f $(installed_su)"; \ + rm -f $(installed_su); \ + else :; \ + fi; \ + fi + +copy_sources = copy.c cp-hash.c # Use `ginstall' in the definition of PROGRAMS and in dependencies to avoid # confusion with the `install' target. The install rule transforms `ginstall' # to install before applying any user-specified name transformations. -transform = s/ginstall/install/; @program_transform_name@ -ginstall_SOURCES = install.c copy.c cp-hash.c +transform = s/ginstall/install/; $(program_transform_name) +ginstall_SOURCES = install.c prog-fprintf.c $(copy_sources) # This is for the '[' program. Automake transliterates '[' to '_'. __SOURCES = lbracket.c -cp_SOURCES = cp.c copy.c cp-hash.c +cp_SOURCES = cp.c $(copy_sources) dir_SOURCES = ls.c ls-dir.c vdir_SOURCES = ls.c ls-vdir.c +id_SOURCES = id.c group-list.c +groups_SOURCES = groups.c group-list.c +ln_SOURCES = ln.c ls_SOURCES = ls.c ls-ls.c chown_SOURCES = chown.c chown-core.c chgrp_SOURCES = chgrp.c chown-core.c +kill_SOURCES = kill.c operand2sig.c +timeout_SOURCES = timeout.c operand2sig.c -mv_SOURCES = mv.c copy.c cp-hash.c remove.c +mv_SOURCES = mv.c remove.c $(copy_sources) rm_SOURCES = rm.c remove.c +mkdir_SOURCES = mkdir.c prog-fprintf.c +rmdir_SOURCES = rmdir.c prog-fprintf.c + +uname_SOURCES = uname.c uname-uname.c +arch_SOURCES = uname.c uname-arch.c + md5sum_SOURCES = md5sum.c md5sum_CPPFLAGS = -DHASH_ALGO_MD5=1 $(AM_CPPFLAGS) sha1sum_SOURCES = md5sum.c @@ -207,30 +284,32 @@ sha384sum_CPPFLAGS = -DHASH_ALGO_SHA384=1 $(AM_CPPFLAGS) sha512sum_SOURCES = md5sum.c sha512sum_CPPFLAGS = -DHASH_ALGO_SHA512=1 $(AM_CPPFLAGS) +ginstall_CPPFLAGS = -DENABLE_MATCHPATHCON=1 $(AM_CPPFLAGS) + editpl = sed -e 's,@''PERL''@,$(PERL),g' BUILT_SOURCES += dircolors.h dircolors.h: dcgen dircolors.hin - @rm -f $@ $@-t - $(PERL) -w -- $(srcdir)/dcgen $(srcdir)/dircolors.hin > $@-t - @chmod a-w $@-t - mv $@-t $@ + $(AM_V_GEN)rm -f $@ $@-t + $(AM_V_at)$(PERL) -w -- $(srcdir)/dcgen $(srcdir)/dircolors.hin > $@-t + $(AM_V_at)chmod a-w $@-t + $(AM_V_at)mv $@-t $@ wheel_size = 5 BUILT_SOURCES += wheel-size.h wheel-size.h: Makefile.am - @rm -f $@ $@-t - echo '#define WHEEL_SIZE $(wheel_size)' > $@-t - @chmod a-w $@-t - mv $@-t $@ + $(AM_V_GEN)rm -f $@ $@-t + $(AM_V_at)echo '#define WHEEL_SIZE $(wheel_size)' > $@-t + $(AM_V_at)chmod a-w $@-t + $(AM_V_at)mv $@-t $@ BUILT_SOURCES += wheel.h wheel.h: wheel-gen.pl Makefile.am - @rm -f $@ $@-t - $(srcdir)/wheel-gen.pl $(wheel_size) > $@-t - @chmod a-w $@-t - mv $@-t $@ + $(AM_V_GEN)rm -f $@ $@-t + $(AM_V_at)$(srcdir)/wheel-gen.pl $(wheel_size) > $@-t + $(AM_V_at)chmod a-w $@-t + $(AM_V_at)mv $@-t $@ # false exits nonzero even with --help or --version. # test doesn't support --help or --version. @@ -239,11 +318,27 @@ AM_INSTALLCHECK_STD_OPTIONS_EXEMPT = false test BUILT_SOURCES += fs.h fs.h: stat.c extract-magic - rm -f $@ - $(PERL) $(srcdir)/extract-magic $(srcdir)/stat.c > $@t - @chmod a-w $@t - mv $@t $@ + $(AM_V_GEN)rm -f $@ + $(AM_V_at)$(PERL) $(srcdir)/extract-magic $(srcdir)/stat.c > $@t + $(AM_V_at)chmod a-w $@t + $(AM_V_at)mv $@t $@ +BUILT_SOURCES += version.c +version.c: Makefile + $(AM_V_GEN)rm -f $@ + $(AM_V_at)printf '#include \n' > $@t + $(AM_V_at)printf 'char const *Version = "$(PACKAGE_VERSION)";\n' >> $@t + $(AM_V_at)chmod a-w $@t + $(AM_V_at)mv $@t $@ + +BUILT_SOURCES += version.h +version.h: Makefile + $(AM_V_GEN)rm -f $@ + $(AM_V_at)printf 'extern char const *Version;\n' > $@t + $(AM_V_at)chmod a-w $@t + $(AM_V_at)mv $@t $@ + +DISTCLEANFILES = version.c version.h MAINTAINERCLEANFILES = $(BUILT_SOURCES) # Sort in traditional ASCII order, regardless of the current locale; @@ -256,6 +351,10 @@ all_programs = \ $(bin_SCRIPTS) \ $(EXTRA_PROGRAMS) +built_programs.list: + @echo $(bin_PROGRAMS) $(bin_SCRIPTS) | tr ' ' '\n' \ + | sed -e 's,$(EXEEXT)$$,,' | $(ASSORT) -u | tr '\n' ' ' + all_programs.list: @echo $(all_programs) | tr ' ' '\n' | sed -e 's,$(EXEEXT)$$,,' \ | $(ASSORT) -u @@ -264,23 +363,36 @@ pm = progs-makefile pr = progs-readme # Ensure that the list of programs in README matches the list # of programs we can build. -check: check-README check-misc +check: check-README check-duplicate-no-install check-AUTHORS .PHONY: check-README check-README: rm -rf $(pr) $(pm) echo $(all_programs) \ - | tr -s ' ' '\n' | sed -e 's,$(EXEEXT)$$,,' \ + | tr -s ' ' '\n' | sed -e 's,$(EXEEXT)$$,,;s/ginstall/install/' \ | $(ASSORT) -u > $(pm) && \ sed -n '/^The programs .* are:/,/^[a-zA-Z]/p' $(top_srcdir)/README \ | sed -n '/^ */s///p' | tr -s ' ' '\n' > $(pr) diff $(pm) $(pr) && rm -rf $(pr) $(pm) +# Ensure that a by-default-not-installed program (listed in +# $(no_install__progs) is not also listed in $(EXTRA_PROGRAMS), because +# if that were to happen, it *would* be installed by default. +.PHONY: check-duplicate-no-install +check-duplicate-no-install: tr + test -z "`echo '$(EXTRA_PROGRAMS)'| ./tr ' ' '\n' | uniq -d`" + # Ensure that the list of programs and author names is accurate. +# We need a UTF8 locale. If a lack of locale support or a missing +# translation inhibits printing of UTF-8 names, just skip this test. au_dotdot = authors-dotdot au_actual = authors-actual .PHONY: check-AUTHORS check-AUTHORS: $(all_programs) - rm -f $(au_actual) $(au_dotdot) + $(AM_V_GEN)locale=en_US.UTF-8; \ + LC_ALL="$$locale" ./cat --version \ + | grep ' Torbjorn ' > /dev/null \ + && { echo "$@: skipping this check"; exit 0; }; \ + rm -f $(au_actual) $(au_dotdot); \ for i in `ls $(all_programs) | sed -e 's,$(EXEEXT)$$,,' \ | $(ASSORT) -u`; do \ test "$$i" = '[' && continue; \ @@ -290,50 +402,14 @@ check-AUTHORS: $(all_programs) elif test "$$i" = test; then \ exe='['; \ fi; \ - ./$$exe --version \ - |sed -n '/Written by /{ s//'"$$i"': /; s/,* and /, /; s/\.$$//; p; }'; \ - done > $(au_actual) - sed -n '/:/p' $(top_srcdir)/AUTHORS > $(au_dotdot) + LC_ALL="$$locale" ./$$exe --version \ + | perl -0 -pi -e 's/,\n/, /gm' \ + | sed -n -e '/Written by /{ s//'"$$i"': /;' \ + -e 's/,* and /, /; s/\.$$//; p; }'; \ + done > $(au_actual) && \ + sed -n '/^[^ ][^ ]*:/p' $(top_srcdir)/AUTHORS > $(au_dotdot) && \ diff $(au_actual) $(au_dotdot) && rm -f $(au_actual) $(au_dotdot) -# Make sure we don't define any S_IS* macros in src/*.c files. -# Not a big deal, but they're already defined via system.h. -# -# Also make sure we don't use st_blocks. Use ST_NBLOCKS instead. -# This is a bit of a kludge, since it prevents use of the string -# even in comments, but for now it does the job with no false positives. -.PHONY: check-misc -check-misc: - cd $(srcdir); grep '^# *define *S_IS' $(SOURCES) && exit 1 || : - cd $(srcdir); grep st_blocks $(SOURCES) && exit 1 || : - cd $(srcdir); grep '^# *define .*defined' $(SOURCES) && exit 1 || : - -# Extract the list of authors from each file. -sed_filter = s/^ *//;s/N_ (//;s/^"//;s/")*$$// -# Sometimes the string is on the same line as the #define... -s1 = '/^\#define AUTHORS \([^\\]\)/{;s//\1/;$(sed_filter);p;q;}' -# Sometimes the string is on the backslash-continued line after the #define. -s2 = '/^\#define AUTHORS \\\\/{;n;$(sed_filter);p;q;}' -# FIXME: handle *.sh; and use $(all_programs), not $(SOURCES) -../AUTHORS: $(SOURCES) - rm -f $@-t - ( \ - set -e; \ - echo "Here are the names of the programs in this package,"; \ - echo "each followed by the name(s) of its author(s)."; \ - echo; \ - for i in $(SOURCES); do \ - a=`sed -n $(s1) $$i`; \ - test "$$a" && : \ - || a=`sed -n $(s2) $$i`; \ - if test "$$a"; then \ - prog=`echo $$i|sed 's/\.c$$//'`; \ - echo "$$prog: $$a"; \ - fi; \ - done | $(ASSORT) -u ) > $@-t - chmod a-w $@-t - mv $@-t $@ - # The following rule is not designed to be portable, # and relies on tools that not everyone has. @@ -344,22 +420,38 @@ s2 = '/^\#define AUTHORS \\\\/{;n;$(sed_filter);p;q;}' # # The second nm|grep checks for file-scope variables with `extern' scope. .PHONY: sc_tight_scope -sc_tight_scope: $(all_programs) - @t=exceptions-$$$$; \ +sc_tight_scope: $(bin_PROGRAMS) + $(AM_V_GEN)t=exceptions-$$$$; \ trap "s=$$?; rm -f $$t; exit $$s" 0 1 2 13 15; \ - ( printf '^main$$\n^usage$$\n'; \ - grep -h -A1 '^extern .*[^;]$$' $(SOURCES) \ - | grep -vE '^(extern |--)' |sed 's/^/^/;s/ .*/$$/' ) > $$t; \ + src=`for f in $(SOURCES); do \ + test -f $$f && d= || d=$(srcdir)/; echo $$d$$f; done`; \ + hdr=`for f in $(noinst_HEADERS); do \ + test -f $$f && d= || d=$(srcdir)/; echo $$d$$f; done`; \ + ( printf 'main\nusage\n'; \ + grep -h -A1 '^extern .*[^;]$$' $$src \ + | grep -vE '^(extern |--)' | sed 's/ .*//'; \ + perl -ne '/^extern \S+ (\S*) \(/ and print "$$1\n"' $$hdr; \ + ) | $(ASSORT) -u | sed 's/^/^/;s/$$/$$/' > $$t; \ nm -e *.$(OBJEXT) \ | sed -n 's/.* T //p' \ + | sed 's/^_//' \ | grep -Ev -f $$t && \ { echo 'the above functions should have static scope' 1>&2; \ exit 1; } || : ; \ ( printf '^program_name$$\n'; \ - sed -n 's/^extern int \([^ ][^ ]*\);$$/^\1$$/p' \ - $(noinst_HEADERS) ) > $$t; \ + perl -ne '/^extern .*?\**(\w+);/ and print "^$$1\$$\n"' \ + $$hdr *.h ) | $(ASSORT) -u > $$t; \ nm -e *.$(OBJEXT) \ | sed -n 's/.* [BD] //p' \ + | sed 's/^_//' \ | grep -Ev -f $$t && \ { echo 'the above variables should have static scope' 1>&2; \ exit 1; } || : + +# Use the just-built ./ginstall, when not cross-compiling. +if CROSS_COMPILING +cu_install_program = @INSTALL_PROGRAM@ +else +cu_install_program = ./ginstall +endif +INSTALL_PROGRAM = $(cu_install_program) diff --git a/src/bin/coreutils/src/Makefile.in b/src/bin/coreutils/src/Makefile.in index 18965a980a..3f845cba64 100644 --- a/src/bin/coreutils/src/Makefile.in +++ b/src/bin/coreutils/src/Makefile.in @@ -1,8 +1,9 @@ -# Makefile.in generated by automake 1.10 from Makefile.am. +# Makefile.in generated by automake 1.10c from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -18,8 +19,9 @@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c @@ -33,67 +35,74 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -EXTRA_PROGRAMS = chroot$(EXEEXT) df$(EXEEXT) hostid$(EXEEXT) \ - nice$(EXEEXT) pinky$(EXEEXT) stty$(EXEEXT) su$(EXEEXT) \ - uname$(EXEEXT) uptime$(EXEEXT) users$(EXEEXT) who$(EXEEXT) -bin_PROGRAMS = [$(EXEEXT) chgrp$(EXEEXT) chown$(EXEEXT) chmod$(EXEEXT) \ +EXTRA_PROGRAMS = $(am__EXEEXT_1) $(am__EXEEXT_2) [$(EXEEXT) \ + chcon$(EXEEXT) chgrp$(EXEEXT) chown$(EXEEXT) chmod$(EXEEXT) \ cp$(EXEEXT) dd$(EXEEXT) dircolors$(EXEEXT) du$(EXEEXT) \ ginstall$(EXEEXT) link$(EXEEXT) ln$(EXEEXT) dir$(EXEEXT) \ vdir$(EXEEXT) ls$(EXEEXT) mkdir$(EXEEXT) mkfifo$(EXEEXT) \ - mknod$(EXEEXT) mv$(EXEEXT) nohup$(EXEEXT) readlink$(EXEEXT) \ - rm$(EXEEXT) rmdir$(EXEEXT) shred$(EXEEXT) stat$(EXEEXT) \ - sync$(EXEEXT) touch$(EXEEXT) unlink$(EXEEXT) cat$(EXEEXT) \ - cksum$(EXEEXT) comm$(EXEEXT) csplit$(EXEEXT) cut$(EXEEXT) \ - expand$(EXEEXT) fmt$(EXEEXT) fold$(EXEEXT) head$(EXEEXT) \ - join$(EXEEXT) md5sum$(EXEEXT) nl$(EXEEXT) od$(EXEEXT) \ - paste$(EXEEXT) pr$(EXEEXT) ptx$(EXEEXT) sha1sum$(EXEEXT) \ - sha224sum$(EXEEXT) sha256sum$(EXEEXT) sha384sum$(EXEEXT) \ - sha512sum$(EXEEXT) shuf$(EXEEXT) sort$(EXEEXT) split$(EXEEXT) \ - sum$(EXEEXT) tac$(EXEEXT) tail$(EXEEXT) tr$(EXEEXT) \ - tsort$(EXEEXT) unexpand$(EXEEXT) uniq$(EXEEXT) wc$(EXEEXT) \ - basename$(EXEEXT) date$(EXEEXT) dirname$(EXEEXT) echo$(EXEEXT) \ - env$(EXEEXT) expr$(EXEEXT) factor$(EXEEXT) false$(EXEEXT) \ - hostname$(EXEEXT) id$(EXEEXT) kill$(EXEEXT) logname$(EXEEXT) \ - pathchk$(EXEEXT) printenv$(EXEEXT) printf$(EXEEXT) \ - pwd$(EXEEXT) seq$(EXEEXT) sleep$(EXEEXT) tee$(EXEEXT) \ - test$(EXEEXT) true$(EXEEXT) tty$(EXEEXT) whoami$(EXEEXT) \ - yes$(EXEEXT) base64$(EXEEXT) $(OPTIONAL_BIN_PROGS) $(DF_PROG) -noinst_PROGRAMS = setuidgid$(EXEEXT) + mknod$(EXEEXT) mktemp$(EXEEXT) mv$(EXEEXT) nohup$(EXEEXT) \ + readlink$(EXEEXT) rm$(EXEEXT) rmdir$(EXEEXT) shred$(EXEEXT) \ + stat$(EXEEXT) sync$(EXEEXT) touch$(EXEEXT) unlink$(EXEEXT) \ + cat$(EXEEXT) cksum$(EXEEXT) comm$(EXEEXT) csplit$(EXEEXT) \ + cut$(EXEEXT) expand$(EXEEXT) fmt$(EXEEXT) fold$(EXEEXT) \ + head$(EXEEXT) join$(EXEEXT) groups$(EXEEXT) md5sum$(EXEEXT) \ + nl$(EXEEXT) od$(EXEEXT) paste$(EXEEXT) pr$(EXEEXT) \ + ptx$(EXEEXT) sha1sum$(EXEEXT) sha224sum$(EXEEXT) \ + sha256sum$(EXEEXT) sha384sum$(EXEEXT) sha512sum$(EXEEXT) \ + shuf$(EXEEXT) sort$(EXEEXT) split$(EXEEXT) sum$(EXEEXT) \ + tac$(EXEEXT) tail$(EXEEXT) tr$(EXEEXT) tsort$(EXEEXT) \ + unexpand$(EXEEXT) uniq$(EXEEXT) wc$(EXEEXT) basename$(EXEEXT) \ + date$(EXEEXT) dirname$(EXEEXT) echo$(EXEEXT) env$(EXEEXT) \ + expr$(EXEEXT) factor$(EXEEXT) false$(EXEEXT) id$(EXEEXT) \ + kill$(EXEEXT) logname$(EXEEXT) pathchk$(EXEEXT) \ + printenv$(EXEEXT) printf$(EXEEXT) pwd$(EXEEXT) runcon$(EXEEXT) \ + seq$(EXEEXT) sleep$(EXEEXT) tee$(EXEEXT) test$(EXEEXT) \ + timeout$(EXEEXT) true$(EXEEXT) truncate$(EXEEXT) tty$(EXEEXT) \ + whoami$(EXEEXT) yes$(EXEEXT) base64$(EXEEXT) +noinst_PROGRAMS = setuidgid$(EXEEXT) getlimits$(EXEEXT) subdir = src DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/absolute-header.m4 \ +am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \ $(top_srcdir)/m4/acl.m4 $(top_srcdir)/m4/alloca.m4 \ - $(top_srcdir)/m4/allocsa.m4 $(top_srcdir)/m4/argmatch.m4 \ - $(top_srcdir)/m4/arpa_inet_h.m4 $(top_srcdir)/m4/assert.m4 \ - $(top_srcdir)/m4/atexit.m4 $(top_srcdir)/m4/autobuild.m4 \ - $(top_srcdir)/m4/backupfile.m4 $(top_srcdir)/m4/base64.m4 \ - $(top_srcdir)/m4/bison.m4 $(top_srcdir)/m4/boottime.m4 \ + $(top_srcdir)/m4/argmatch.m4 $(top_srcdir)/m4/arpa_inet_h.m4 \ + $(top_srcdir)/m4/assert.m4 $(top_srcdir)/m4/atexit.m4 \ + $(top_srcdir)/m4/autobuild.m4 $(top_srcdir)/m4/backupfile.m4 \ + $(top_srcdir)/m4/base64.m4 $(top_srcdir)/m4/bison.m4 \ + $(top_srcdir)/m4/boottime.m4 $(top_srcdir)/m4/btowc.m4 \ $(top_srcdir)/m4/c-strtod.m4 $(top_srcdir)/m4/calloc.m4 \ $(top_srcdir)/m4/canon-host.m4 \ $(top_srcdir)/m4/canonicalize.m4 \ $(top_srcdir)/m4/chdir-long.m4 $(top_srcdir)/m4/check-decl.m4 \ $(top_srcdir)/m4/chown.m4 $(top_srcdir)/m4/clock_time.m4 \ $(top_srcdir)/m4/cloexec.m4 $(top_srcdir)/m4/close-stream.m4 \ + $(top_srcdir)/m4/close.m4 $(top_srcdir)/m4/closein.m4 \ $(top_srcdir)/m4/closeout.m4 $(top_srcdir)/m4/codeset.m4 \ $(top_srcdir)/m4/config-h.m4 $(top_srcdir)/m4/cycle-check.m4 \ $(top_srcdir)/m4/d-ino.m4 $(top_srcdir)/m4/d-type.m4 \ - $(top_srcdir)/m4/dirfd.m4 $(top_srcdir)/m4/dirname.m4 \ - $(top_srcdir)/m4/dos.m4 $(top_srcdir)/m4/double-slash-root.m4 \ - $(top_srcdir)/m4/dup2.m4 $(top_srcdir)/m4/eealloc.m4 \ - $(top_srcdir)/m4/eoverflow.m4 $(top_srcdir)/m4/error.m4 \ + $(top_srcdir)/m4/dirent_h.m4 $(top_srcdir)/m4/dirfd.m4 \ + $(top_srcdir)/m4/dirname.m4 $(top_srcdir)/m4/dos.m4 \ + $(top_srcdir)/m4/double-slash-root.m4 $(top_srcdir)/m4/dup2.m4 \ + $(top_srcdir)/m4/eealloc.m4 $(top_srcdir)/m4/environ.m4 \ + $(top_srcdir)/m4/errno_h.m4 $(top_srcdir)/m4/error.m4 \ $(top_srcdir)/m4/euidaccess-stat.m4 \ $(top_srcdir)/m4/euidaccess.m4 $(top_srcdir)/m4/exclude.m4 \ - $(top_srcdir)/m4/exitfail.m4 $(top_srcdir)/m4/extensions.m4 \ - $(top_srcdir)/m4/fchdir.m4 $(top_srcdir)/m4/fcntl-safer.m4 \ + $(top_srcdir)/m4/exitfail.m4 $(top_srcdir)/m4/exponentd.m4 \ + $(top_srcdir)/m4/exponentf.m4 $(top_srcdir)/m4/exponentl.m4 \ + $(top_srcdir)/m4/extensions.m4 $(top_srcdir)/m4/fchdir.m4 \ + $(top_srcdir)/m4/fclose.m4 $(top_srcdir)/m4/fcntl-safer.m4 \ $(top_srcdir)/m4/fcntl_h.m4 $(top_srcdir)/m4/fd-reopen.m4 \ - $(top_srcdir)/m4/file-type.m4 $(top_srcdir)/m4/fileblocks.m4 \ - $(top_srcdir)/m4/filemode.m4 $(top_srcdir)/m4/filenamecat.m4 \ - $(top_srcdir)/m4/flexmember.m4 $(top_srcdir)/m4/fnmatch.m4 \ - $(top_srcdir)/m4/fpending.m4 $(top_srcdir)/m4/fprintftime.m4 \ - $(top_srcdir)/m4/free.m4 $(top_srcdir)/m4/fstypename.m4 \ - $(top_srcdir)/m4/fsusage.m4 $(top_srcdir)/m4/ftruncate.m4 \ + $(top_srcdir)/m4/fflush.m4 $(top_srcdir)/m4/file-type.m4 \ + $(top_srcdir)/m4/fileblocks.m4 $(top_srcdir)/m4/filemode.m4 \ + $(top_srcdir)/m4/filenamecat.m4 $(top_srcdir)/m4/flexmember.m4 \ + $(top_srcdir)/m4/float_h.m4 $(top_srcdir)/m4/fnmatch.m4 \ + $(top_srcdir)/m4/fpending.m4 $(top_srcdir)/m4/fpieee.m4 \ + $(top_srcdir)/m4/fprintftime.m4 $(top_srcdir)/m4/fpurge.m4 \ + $(top_srcdir)/m4/freading.m4 $(top_srcdir)/m4/frexp.m4 \ + $(top_srcdir)/m4/frexpl.m4 $(top_srcdir)/m4/fseeko.m4 \ + $(top_srcdir)/m4/fstypename.m4 $(top_srcdir)/m4/fsusage.m4 \ + $(top_srcdir)/m4/ftello.m4 $(top_srcdir)/m4/ftruncate.m4 \ $(top_srcdir)/m4/fts.m4 $(top_srcdir)/m4/getaddrinfo.m4 \ $(top_srcdir)/m4/getcwd-abort-bug.m4 \ $(top_srcdir)/m4/getcwd-path-max.m4 $(top_srcdir)/m4/getcwd.m4 \ @@ -106,49 +115,65 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/absolute-header.m4 \ $(top_srcdir)/m4/gettime.m4 $(top_srcdir)/m4/gettimeofday.m4 \ $(top_srcdir)/m4/getugroups.m4 \ $(top_srcdir)/m4/getusershell.m4 $(top_srcdir)/m4/glibc21.m4 \ + $(top_srcdir)/m4/gmp.m4 $(top_srcdir)/m4/gnu-make.m4 \ $(top_srcdir)/m4/gnulib-common.m4 \ $(top_srcdir)/m4/gnulib-comp.m4 \ $(top_srcdir)/m4/group-member.m4 \ $(top_srcdir)/m4/hard-locale.m4 $(top_srcdir)/m4/hash.m4 \ - $(top_srcdir)/m4/host-os.m4 $(top_srcdir)/m4/human.m4 \ - $(top_srcdir)/m4/i-ring.m4 $(top_srcdir)/m4/iconv.m4 \ - $(top_srcdir)/m4/idcache.m4 $(top_srcdir)/m4/inet_ntop.m4 \ - $(top_srcdir)/m4/inline.m4 $(top_srcdir)/m4/intmax_t.m4 \ + $(top_srcdir)/m4/host-os.m4 $(top_srcdir)/m4/hostent.m4 \ + $(top_srcdir)/m4/human.m4 $(top_srcdir)/m4/i-ring.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/iconv_h.m4 \ + $(top_srcdir)/m4/iconv_open.m4 $(top_srcdir)/m4/idcache.m4 \ + $(top_srcdir)/m4/include-exclude-prog.m4 \ + $(top_srcdir)/m4/include_next.m4 $(top_srcdir)/m4/inet_ntop.m4 \ + $(top_srcdir)/m4/inet_pton.m4 $(top_srcdir)/m4/inline.m4 \ + $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/intmax_t.m4 \ $(top_srcdir)/m4/inttostr.m4 $(top_srcdir)/m4/inttypes-pri.m4 \ $(top_srcdir)/m4/inttypes.m4 $(top_srcdir)/m4/inttypes_h.m4 \ - $(top_srcdir)/m4/isapipe.m4 $(top_srcdir)/m4/jm-macros.m4 \ - $(top_srcdir)/m4/jm-winsz1.m4 $(top_srcdir)/m4/jm-winsz2.m4 \ - $(top_srcdir)/m4/lchmod.m4 $(top_srcdir)/m4/lchown.m4 \ + $(top_srcdir)/m4/isapipe.m4 $(top_srcdir)/m4/isnand.m4 \ + $(top_srcdir)/m4/isnanf.m4 $(top_srcdir)/m4/isnanl.m4 \ + $(top_srcdir)/m4/jm-macros.m4 $(top_srcdir)/m4/jm-winsz1.m4 \ + $(top_srcdir)/m4/jm-winsz2.m4 $(top_srcdir)/m4/lchmod.m4 \ + $(top_srcdir)/m4/lchown.m4 $(top_srcdir)/m4/ldexpl.m4 \ $(top_srcdir)/m4/lib-check.m4 $(top_srcdir)/m4/lib-ignore.m4 \ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/link-follow.m4 \ - $(top_srcdir)/m4/localcharset.m4 \ - $(top_srcdir)/m4/long-options.m4 \ - $(top_srcdir)/m4/longdouble.m4 $(top_srcdir)/m4/longlong.m4 \ - $(top_srcdir)/m4/ls-mntd-fs.m4 $(top_srcdir)/m4/lstat.m4 \ + $(top_srcdir)/m4/localcharset.m4 $(top_srcdir)/m4/locale-fr.m4 \ + $(top_srcdir)/m4/locale-ja.m4 $(top_srcdir)/m4/locale-tr.m4 \ + $(top_srcdir)/m4/locale-zh.m4 $(top_srcdir)/m4/long-options.m4 \ + $(top_srcdir)/m4/longlong.m4 $(top_srcdir)/m4/ls-mntd-fs.m4 \ + $(top_srcdir)/m4/lseek.m4 $(top_srcdir)/m4/lstat.m4 \ + $(top_srcdir)/m4/malloc.m4 $(top_srcdir)/m4/malloca.m4 \ + $(top_srcdir)/m4/manywarnings.m4 $(top_srcdir)/m4/math_h.m4 \ $(top_srcdir)/m4/mbchar.m4 $(top_srcdir)/m4/mbiter.m4 \ - $(top_srcdir)/m4/mbrtowc.m4 $(top_srcdir)/m4/mbscasecmp.m4 \ + $(top_srcdir)/m4/mbrlen.m4 $(top_srcdir)/m4/mbrtowc.m4 \ + $(top_srcdir)/m4/mbsinit.m4 $(top_srcdir)/m4/mbsrtowcs.m4 \ $(top_srcdir)/m4/mbstate_t.m4 $(top_srcdir)/m4/mbswidth.m4 \ $(top_srcdir)/m4/md5.m4 $(top_srcdir)/m4/memcasecmp.m4 \ $(top_srcdir)/m4/memchr.m4 $(top_srcdir)/m4/memcmp.m4 \ $(top_srcdir)/m4/memcoll.m4 $(top_srcdir)/m4/memcpy.m4 \ $(top_srcdir)/m4/memmove.m4 $(top_srcdir)/m4/mempcpy.m4 \ $(top_srcdir)/m4/memrchr.m4 $(top_srcdir)/m4/memset.m4 \ - $(top_srcdir)/m4/memxfrm.m4 $(top_srcdir)/m4/mkancesdirs.m4 \ - $(top_srcdir)/m4/mkdir-p.m4 $(top_srcdir)/m4/mkdir-slash.m4 \ - $(top_srcdir)/m4/mkstemp.m4 $(top_srcdir)/m4/mktime.m4 \ - $(top_srcdir)/m4/modechange.m4 $(top_srcdir)/m4/mountlist.m4 \ - $(top_srcdir)/m4/mpsort.m4 $(top_srcdir)/m4/nanosleep.m4 \ - $(top_srcdir)/m4/netinet_in_h.m4 $(top_srcdir)/m4/nls.m4 \ - $(top_srcdir)/m4/openat.m4 $(top_srcdir)/m4/pathmax.m4 \ - $(top_srcdir)/m4/perl.m4 $(top_srcdir)/m4/physmem.m4 \ - $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/posixtm.m4 \ - $(top_srcdir)/m4/posixver.m4 $(top_srcdir)/m4/prereq.m4 \ - $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/putenv.m4 \ - $(top_srcdir)/m4/quote.m4 $(top_srcdir)/m4/quotearg.m4 \ - $(top_srcdir)/m4/randint.m4 $(top_srcdir)/m4/randperm.m4 \ - $(top_srcdir)/m4/randread.m4 $(top_srcdir)/m4/readlink.m4 \ - $(top_srcdir)/m4/readtokens.m4 $(top_srcdir)/m4/readutmp.m4 \ + $(top_srcdir)/m4/memxfrm.m4 $(top_srcdir)/m4/mgetgroups.m4 \ + $(top_srcdir)/m4/mkancesdirs.m4 $(top_srcdir)/m4/mkdir-p.m4 \ + $(top_srcdir)/m4/mkdir-slash.m4 $(top_srcdir)/m4/mkstemp.m4 \ + $(top_srcdir)/m4/mktime.m4 $(top_srcdir)/m4/modechange.m4 \ + $(top_srcdir)/m4/mountlist.m4 $(top_srcdir)/m4/mpsort.m4 \ + $(top_srcdir)/m4/multiarch.m4 $(top_srcdir)/m4/nanosleep.m4 \ + $(top_srcdir)/m4/netdb_h.m4 $(top_srcdir)/m4/netinet_in_h.m4 \ + $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/nocrash.m4 \ + $(top_srcdir)/m4/open.m4 $(top_srcdir)/m4/openat.m4 \ + $(top_srcdir)/m4/pathmax.m4 $(top_srcdir)/m4/perl.m4 \ + $(top_srcdir)/m4/perror.m4 $(top_srcdir)/m4/physmem.m4 \ + $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/posix-shell.m4 \ + $(top_srcdir)/m4/posixtm.m4 $(top_srcdir)/m4/posixver.m4 \ + $(top_srcdir)/m4/prereq.m4 $(top_srcdir)/m4/printf-frexp.m4 \ + $(top_srcdir)/m4/printf-frexpl.m4 $(top_srcdir)/m4/printf.m4 \ + $(top_srcdir)/m4/priv-set.m4 $(top_srcdir)/m4/progtest.m4 \ + $(top_srcdir)/m4/putenv.m4 $(top_srcdir)/m4/quote.m4 \ + $(top_srcdir)/m4/quotearg.m4 $(top_srcdir)/m4/read-file.m4 \ + $(top_srcdir)/m4/readlink.m4 $(top_srcdir)/m4/readtokens.m4 \ + $(top_srcdir)/m4/readutmp.m4 $(top_srcdir)/m4/realloc.m4 \ $(top_srcdir)/m4/regex.m4 \ $(top_srcdir)/m4/rename-dest-slash.m4 \ $(top_srcdir)/m4/rename.m4 $(top_srcdir)/m4/rmdir-errno.m4 \ @@ -156,10 +181,17 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/absolute-header.m4 \ $(top_srcdir)/m4/rpmatch.m4 $(top_srcdir)/m4/safe-read.m4 \ $(top_srcdir)/m4/safe-write.m4 $(top_srcdir)/m4/same.m4 \ $(top_srcdir)/m4/save-cwd.m4 $(top_srcdir)/m4/savedir.m4 \ - $(top_srcdir)/m4/savewd.m4 $(top_srcdir)/m4/setenv.m4 \ + $(top_srcdir)/m4/savewd.m4 $(top_srcdir)/m4/select.m4 \ + $(top_srcdir)/m4/selinux-context-h.m4 \ + $(top_srcdir)/m4/selinux-selinux-h.m4 \ + $(top_srcdir)/m4/servent.m4 $(top_srcdir)/m4/setenv.m4 \ $(top_srcdir)/m4/settime.m4 $(top_srcdir)/m4/sha1.m4 \ $(top_srcdir)/m4/sha256.m4 $(top_srcdir)/m4/sha512.m4 \ - $(top_srcdir)/m4/sig2str.m4 $(top_srcdir)/m4/snprintf.m4 \ + $(top_srcdir)/m4/sig2str.m4 $(top_srcdir)/m4/sigaction.m4 \ + $(top_srcdir)/m4/signal_h.m4 \ + $(top_srcdir)/m4/signalblocking.m4 $(top_srcdir)/m4/signbit.m4 \ + $(top_srcdir)/m4/size_max.m4 $(top_srcdir)/m4/sleep.m4 \ + $(top_srcdir)/m4/snprintf.m4 $(top_srcdir)/m4/sockets.m4 \ $(top_srcdir)/m4/socklen.m4 $(top_srcdir)/m4/sockpfaf.m4 \ $(top_srcdir)/m4/ssize_t.m4 $(top_srcdir)/m4/st_dm_mode.m4 \ $(top_srcdir)/m4/stat-prog.m4 $(top_srcdir)/m4/stat-time.m4 \ @@ -167,108 +199,142 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/absolute-header.m4 \ $(top_srcdir)/m4/stdint.m4 $(top_srcdir)/m4/stdint_h.m4 \ $(top_srcdir)/m4/stdio-safer.m4 $(top_srcdir)/m4/stdio_h.m4 \ $(top_srcdir)/m4/stdlib-safer.m4 $(top_srcdir)/m4/stdlib_h.m4 \ - $(top_srcdir)/m4/stpcpy.m4 $(top_srcdir)/m4/strcspn.m4 \ - $(top_srcdir)/m4/strdup.m4 $(top_srcdir)/m4/strftime.m4 \ + $(top_srcdir)/m4/stpcpy.m4 $(top_srcdir)/m4/stpncpy.m4 \ + $(top_srcdir)/m4/strcspn.m4 $(top_srcdir)/m4/strdup.m4 \ + $(top_srcdir)/m4/strerror.m4 $(top_srcdir)/m4/strftime.m4 \ $(top_srcdir)/m4/string_h.m4 $(top_srcdir)/m4/strndup.m4 \ $(top_srcdir)/m4/strnlen.m4 $(top_srcdir)/m4/strnumcmp.m4 \ $(top_srcdir)/m4/strpbrk.m4 $(top_srcdir)/m4/strtod.m4 \ $(top_srcdir)/m4/strtoimax.m4 $(top_srcdir)/m4/strtol.m4 \ $(top_srcdir)/m4/strtoll.m4 $(top_srcdir)/m4/strtoul.m4 \ $(top_srcdir)/m4/strtoull.m4 $(top_srcdir)/m4/strtoumax.m4 \ - $(top_srcdir)/m4/strverscmp.m4 \ + $(top_srcdir)/m4/strverscmp.m4 $(top_srcdir)/m4/sys_ioctl_h.m4 \ + $(top_srcdir)/m4/sys_select_h.m4 \ $(top_srcdir)/m4/sys_socket_h.m4 \ $(top_srcdir)/m4/sys_stat_h.m4 $(top_srcdir)/m4/sys_time_h.m4 \ $(top_srcdir)/m4/tempname.m4 $(top_srcdir)/m4/time_h.m4 \ $(top_srcdir)/m4/time_r.m4 $(top_srcdir)/m4/timespec.m4 \ $(top_srcdir)/m4/tm_gmtoff.m4 $(top_srcdir)/m4/tzset.m4 \ - $(top_srcdir)/m4/unicodeio.m4 $(top_srcdir)/m4/unistd-safer.m4 \ - $(top_srcdir)/m4/unistd_h.m4 $(top_srcdir)/m4/unlink-busy.m4 \ - $(top_srcdir)/m4/unlinkdir.m4 $(top_srcdir)/m4/unlocked-io.m4 \ - $(top_srcdir)/m4/uptime.m4 $(top_srcdir)/m4/userspec.m4 \ - $(top_srcdir)/m4/utimbuf.m4 $(top_srcdir)/m4/utime.m4 \ + $(top_srcdir)/m4/ungetc.m4 $(top_srcdir)/m4/unicodeio.m4 \ + $(top_srcdir)/m4/unistd-safer.m4 $(top_srcdir)/m4/unistd_h.m4 \ + $(top_srcdir)/m4/unlink-busy.m4 $(top_srcdir)/m4/unlinkdir.m4 \ + $(top_srcdir)/m4/unlocked-io.m4 $(top_srcdir)/m4/uptime.m4 \ + $(top_srcdir)/m4/userspec.m4 $(top_srcdir)/m4/utimbuf.m4 \ $(top_srcdir)/m4/utimecmp.m4 $(top_srcdir)/m4/utimens.m4 \ - $(top_srcdir)/m4/utimes-null.m4 $(top_srcdir)/m4/utimes.m4 \ - $(top_srcdir)/m4/vasnprintf.m4 $(top_srcdir)/m4/vasprintf.m4 \ + $(top_srcdir)/m4/utimes.m4 $(top_srcdir)/m4/vasnprintf.m4 \ + $(top_srcdir)/m4/vasprintf-posix.m4 \ + $(top_srcdir)/m4/vasprintf.m4 \ + $(top_srcdir)/m4/vfprintf-posix.m4 \ + $(top_srcdir)/m4/vprintf-posix.m4 $(top_srcdir)/m4/warnings.m4 \ $(top_srcdir)/m4/wchar.m4 $(top_srcdir)/m4/wchar_t.m4 \ + $(top_srcdir)/m4/wcrtomb.m4 $(top_srcdir)/m4/wctob.m4 \ $(top_srcdir)/m4/wctype.m4 $(top_srcdir)/m4/wcwidth.m4 \ - $(top_srcdir)/m4/wint_t.m4 $(top_srcdir)/m4/xalloc.m4 \ - $(top_srcdir)/m4/xfts.m4 $(top_srcdir)/m4/xgetcwd.m4 \ - $(top_srcdir)/m4/xnanosleep.m4 $(top_srcdir)/m4/xstrndup.m4 \ + $(top_srcdir)/m4/wint_t.m4 $(top_srcdir)/m4/write-any-file.m4 \ + $(top_srcdir)/m4/write.m4 $(top_srcdir)/m4/xalloc.m4 \ + $(top_srcdir)/m4/xattr.m4 $(top_srcdir)/m4/xfts.m4 \ + $(top_srcdir)/m4/xgetcwd.m4 $(top_srcdir)/m4/xnanosleep.m4 \ + $(top_srcdir)/m4/xsize.m4 $(top_srcdir)/m4/xstrndup.m4 \ $(top_srcdir)/m4/xstrtod.m4 $(top_srcdir)/m4/xstrtol.m4 \ - $(top_srcdir)/m4/yesno.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/xvasprintf.m4 $(top_srcdir)/m4/yesno.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/lib/config.h CONFIG_CLEAN_FILES = -am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)" -binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) +CONFIG_CLEAN_VPATH_FILES = +LIBRARIES = $(noinst_LIBRARIES) +AR = ar +ARFLAGS = cru +AM_V_AR = $(am__v_AR_$(V)) +am__v_AR_ = $(am__v_AR_$(AM_DEFAULT_VERBOSITY)) +am__v_AR_0 = @echo " AR " $@; +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) +am__v_at_0 = @ +libver_a_AR = $(AR) $(ARFLAGS) +libver_a_LIBADD = +nodist_libver_a_OBJECTS = version.$(OBJEXT) +libver_a_OBJECTS = $(nodist_libver_a_OBJECTS) +am__EXEEXT_1 = arch$(EXEEXT) hostname$(EXEEXT) su$(EXEEXT) +am__EXEEXT_2 = chroot$(EXEEXT) df$(EXEEXT) hostid$(EXEEXT) \ + nice$(EXEEXT) pinky$(EXEEXT) stty$(EXEEXT) su$(EXEEXT) \ + uname$(EXEEXT) uptime$(EXEEXT) users$(EXEEXT) who$(EXEEXT) +am__installdirs = "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS) am___OBJECTS = lbracket.$(OBJEXT) __OBJECTS = $(am___OBJECTS) am__DEPENDENCIES_1 = -am__DEPENDENCIES_2 = ../lib/libcoreutils.a $(am__DEPENDENCIES_1) \ - ../lib/libcoreutils.a +am__DEPENDENCIES_2 = libver.a ../lib/libcoreutils.a \ + $(am__DEPENDENCIES_1) ../lib/libcoreutils.a __DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) +am_arch_OBJECTS = uname.$(OBJEXT) uname-arch.$(OBJEXT) +arch_OBJECTS = $(am_arch_OBJECTS) +arch_LDADD = $(LDADD) +arch_DEPENDENCIES = libver.a ../lib/libcoreutils.a \ + $(am__DEPENDENCIES_1) ../lib/libcoreutils.a base64_SOURCES = base64.c base64_OBJECTS = base64.$(OBJEXT) base64_LDADD = $(LDADD) -base64_DEPENDENCIES = ../lib/libcoreutils.a $(am__DEPENDENCIES_1) \ - ../lib/libcoreutils.a +base64_DEPENDENCIES = libver.a ../lib/libcoreutils.a \ + $(am__DEPENDENCIES_1) ../lib/libcoreutils.a basename_SOURCES = basename.c basename_OBJECTS = basename.$(OBJEXT) basename_LDADD = $(LDADD) -basename_DEPENDENCIES = ../lib/libcoreutils.a $(am__DEPENDENCIES_1) \ - ../lib/libcoreutils.a +basename_DEPENDENCIES = libver.a ../lib/libcoreutils.a \ + $(am__DEPENDENCIES_1) ../lib/libcoreutils.a cat_SOURCES = cat.c cat_OBJECTS = cat.$(OBJEXT) -cat_LDADD = $(LDADD) -cat_DEPENDENCIES = ../lib/libcoreutils.a $(am__DEPENDENCIES_1) \ - ../lib/libcoreutils.a +cat_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) +chcon_SOURCES = chcon.c +chcon_OBJECTS = chcon.$(OBJEXT) +chcon_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) am_chgrp_OBJECTS = chgrp.$(OBJEXT) chown-core.$(OBJEXT) chgrp_OBJECTS = $(am_chgrp_OBJECTS) chgrp_LDADD = $(LDADD) -chgrp_DEPENDENCIES = ../lib/libcoreutils.a $(am__DEPENDENCIES_1) \ - ../lib/libcoreutils.a +chgrp_DEPENDENCIES = libver.a ../lib/libcoreutils.a \ + $(am__DEPENDENCIES_1) ../lib/libcoreutils.a chmod_SOURCES = chmod.c chmod_OBJECTS = chmod.$(OBJEXT) chmod_LDADD = $(LDADD) -chmod_DEPENDENCIES = ../lib/libcoreutils.a $(am__DEPENDENCIES_1) \ - ../lib/libcoreutils.a +chmod_DEPENDENCIES = libver.a ../lib/libcoreutils.a \ + $(am__DEPENDENCIES_1) ../lib/libcoreutils.a am_chown_OBJECTS = chown.$(OBJEXT) chown-core.$(OBJEXT) chown_OBJECTS = $(am_chown_OBJECTS) chown_LDADD = $(LDADD) -chown_DEPENDENCIES = ../lib/libcoreutils.a $(am__DEPENDENCIES_1) \ - ../lib/libcoreutils.a +chown_DEPENDENCIES = libver.a ../lib/libcoreutils.a \ + $(am__DEPENDENCIES_1) ../lib/libcoreutils.a chroot_SOURCES = chroot.c chroot_OBJECTS = chroot.$(OBJEXT) chroot_LDADD = $(LDADD) -chroot_DEPENDENCIES = ../lib/libcoreutils.a $(am__DEPENDENCIES_1) \ - ../lib/libcoreutils.a +chroot_DEPENDENCIES = libver.a ../lib/libcoreutils.a \ + $(am__DEPENDENCIES_1) ../lib/libcoreutils.a cksum_SOURCES = cksum.c cksum_OBJECTS = cksum.$(OBJEXT) cksum_LDADD = $(LDADD) -cksum_DEPENDENCIES = ../lib/libcoreutils.a $(am__DEPENDENCIES_1) \ - ../lib/libcoreutils.a +cksum_DEPENDENCIES = libver.a ../lib/libcoreutils.a \ + $(am__DEPENDENCIES_1) ../lib/libcoreutils.a comm_SOURCES = comm.c comm_OBJECTS = comm.$(OBJEXT) comm_LDADD = $(LDADD) -comm_DEPENDENCIES = ../lib/libcoreutils.a $(am__DEPENDENCIES_1) \ - ../lib/libcoreutils.a -am_cp_OBJECTS = cp.$(OBJEXT) copy.$(OBJEXT) cp-hash.$(OBJEXT) +comm_DEPENDENCIES = libver.a ../lib/libcoreutils.a \ + $(am__DEPENDENCIES_1) ../lib/libcoreutils.a +am__objects_1 = copy.$(OBJEXT) cp-hash.$(OBJEXT) +am_cp_OBJECTS = cp.$(OBJEXT) $(am__objects_1) cp_OBJECTS = $(am_cp_OBJECTS) cp_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) csplit_SOURCES = csplit.c csplit_OBJECTS = csplit.$(OBJEXT) csplit_LDADD = $(LDADD) -csplit_DEPENDENCIES = ../lib/libcoreutils.a $(am__DEPENDENCIES_1) \ - ../lib/libcoreutils.a +csplit_DEPENDENCIES = libver.a ../lib/libcoreutils.a \ + $(am__DEPENDENCIES_1) ../lib/libcoreutils.a cut_SOURCES = cut.c cut_OBJECTS = cut.$(OBJEXT) cut_LDADD = $(LDADD) -cut_DEPENDENCIES = ../lib/libcoreutils.a $(am__DEPENDENCIES_1) \ - ../lib/libcoreutils.a +cut_DEPENDENCIES = libver.a ../lib/libcoreutils.a \ + $(am__DEPENDENCIES_1) ../lib/libcoreutils.a date_SOURCES = date.c date_OBJECTS = date.$(OBJEXT) date_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) @@ -278,248 +344,246 @@ dd_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) df_SOURCES = df.c df_OBJECTS = df.$(OBJEXT) -df_LDADD = $(LDADD) -df_DEPENDENCIES = ../lib/libcoreutils.a $(am__DEPENDENCIES_1) \ - ../lib/libcoreutils.a +df_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) am_dir_OBJECTS = ls.$(OBJEXT) ls-dir.$(OBJEXT) dir_OBJECTS = $(am_dir_OBJECTS) dir_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) dircolors_SOURCES = dircolors.c dircolors_OBJECTS = dircolors.$(OBJEXT) dircolors_LDADD = $(LDADD) -dircolors_DEPENDENCIES = ../lib/libcoreutils.a $(am__DEPENDENCIES_1) \ - ../lib/libcoreutils.a +dircolors_DEPENDENCIES = libver.a ../lib/libcoreutils.a \ + $(am__DEPENDENCIES_1) ../lib/libcoreutils.a dirname_SOURCES = dirname.c dirname_OBJECTS = dirname.$(OBJEXT) dirname_LDADD = $(LDADD) -dirname_DEPENDENCIES = ../lib/libcoreutils.a $(am__DEPENDENCIES_1) \ - ../lib/libcoreutils.a +dirname_DEPENDENCIES = libver.a ../lib/libcoreutils.a \ + $(am__DEPENDENCIES_1) ../lib/libcoreutils.a du_SOURCES = du.c du_OBJECTS = du.$(OBJEXT) -du_LDADD = $(LDADD) -du_DEPENDENCIES = ../lib/libcoreutils.a $(am__DEPENDENCIES_1) \ - ../lib/libcoreutils.a +du_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) echo_SOURCES = echo.c echo_OBJECTS = echo.$(OBJEXT) echo_LDADD = $(LDADD) -echo_DEPENDENCIES = ../lib/libcoreutils.a $(am__DEPENDENCIES_1) \ - ../lib/libcoreutils.a +echo_DEPENDENCIES = libver.a ../lib/libcoreutils.a \ + $(am__DEPENDENCIES_1) ../lib/libcoreutils.a env_SOURCES = env.c env_OBJECTS = env.$(OBJEXT) env_LDADD = $(LDADD) -env_DEPENDENCIES = ../lib/libcoreutils.a $(am__DEPENDENCIES_1) \ - ../lib/libcoreutils.a +env_DEPENDENCIES = libver.a ../lib/libcoreutils.a \ + $(am__DEPENDENCIES_1) ../lib/libcoreutils.a expand_SOURCES = expand.c expand_OBJECTS = expand.$(OBJEXT) expand_LDADD = $(LDADD) -expand_DEPENDENCIES = ../lib/libcoreutils.a $(am__DEPENDENCIES_1) \ - ../lib/libcoreutils.a +expand_DEPENDENCIES = libver.a ../lib/libcoreutils.a \ + $(am__DEPENDENCIES_1) ../lib/libcoreutils.a expr_SOURCES = expr.c expr_OBJECTS = expr.$(OBJEXT) -expr_LDADD = $(LDADD) -expr_DEPENDENCIES = ../lib/libcoreutils.a $(am__DEPENDENCIES_1) \ - ../lib/libcoreutils.a +expr_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) factor_SOURCES = factor.c factor_OBJECTS = factor.$(OBJEXT) -factor_LDADD = $(LDADD) -factor_DEPENDENCIES = ../lib/libcoreutils.a $(am__DEPENDENCIES_1) \ - ../lib/libcoreutils.a +factor_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) false_SOURCES = false.c false_OBJECTS = false.$(OBJEXT) false_LDADD = $(LDADD) -false_DEPENDENCIES = ../lib/libcoreutils.a $(am__DEPENDENCIES_1) \ - ../lib/libcoreutils.a +false_DEPENDENCIES = libver.a ../lib/libcoreutils.a \ + $(am__DEPENDENCIES_1) ../lib/libcoreutils.a fmt_SOURCES = fmt.c fmt_OBJECTS = fmt.$(OBJEXT) fmt_LDADD = $(LDADD) -fmt_DEPENDENCIES = ../lib/libcoreutils.a $(am__DEPENDENCIES_1) \ - ../lib/libcoreutils.a +fmt_DEPENDENCIES = libver.a ../lib/libcoreutils.a \ + $(am__DEPENDENCIES_1) ../lib/libcoreutils.a fold_SOURCES = fold.c fold_OBJECTS = fold.$(OBJEXT) fold_LDADD = $(LDADD) -fold_DEPENDENCIES = ../lib/libcoreutils.a $(am__DEPENDENCIES_1) \ - ../lib/libcoreutils.a -am_ginstall_OBJECTS = install.$(OBJEXT) copy.$(OBJEXT) \ - cp-hash.$(OBJEXT) +fold_DEPENDENCIES = libver.a ../lib/libcoreutils.a \ + $(am__DEPENDENCIES_1) ../lib/libcoreutils.a +getlimits_SOURCES = getlimits.c +getlimits_OBJECTS = getlimits.$(OBJEXT) +getlimits_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) +am__objects_2 = ginstall-copy.$(OBJEXT) ginstall-cp-hash.$(OBJEXT) +am_ginstall_OBJECTS = ginstall-install.$(OBJEXT) \ + ginstall-prog-fprintf.$(OBJEXT) $(am__objects_2) ginstall_OBJECTS = $(am_ginstall_OBJECTS) ginstall_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) +am_groups_OBJECTS = groups.$(OBJEXT) group-list.$(OBJEXT) +groups_OBJECTS = $(am_groups_OBJECTS) +groups_LDADD = $(LDADD) +groups_DEPENDENCIES = libver.a ../lib/libcoreutils.a \ + $(am__DEPENDENCIES_1) ../lib/libcoreutils.a head_SOURCES = head.c head_OBJECTS = head.$(OBJEXT) head_LDADD = $(LDADD) -head_DEPENDENCIES = ../lib/libcoreutils.a $(am__DEPENDENCIES_1) \ - ../lib/libcoreutils.a +head_DEPENDENCIES = libver.a ../lib/libcoreutils.a \ + $(am__DEPENDENCIES_1) ../lib/libcoreutils.a hostid_SOURCES = hostid.c hostid_OBJECTS = hostid.$(OBJEXT) hostid_LDADD = $(LDADD) -hostid_DEPENDENCIES = ../lib/libcoreutils.a $(am__DEPENDENCIES_1) \ - ../lib/libcoreutils.a +hostid_DEPENDENCIES = libver.a ../lib/libcoreutils.a \ + $(am__DEPENDENCIES_1) ../lib/libcoreutils.a hostname_SOURCES = hostname.c hostname_OBJECTS = hostname.$(OBJEXT) hostname_LDADD = $(LDADD) -hostname_DEPENDENCIES = ../lib/libcoreutils.a $(am__DEPENDENCIES_1) \ - ../lib/libcoreutils.a -id_SOURCES = id.c -id_OBJECTS = id.$(OBJEXT) -id_LDADD = $(LDADD) -id_DEPENDENCIES = ../lib/libcoreutils.a $(am__DEPENDENCIES_1) \ - ../lib/libcoreutils.a +hostname_DEPENDENCIES = libver.a ../lib/libcoreutils.a \ + $(am__DEPENDENCIES_1) ../lib/libcoreutils.a +am_id_OBJECTS = id.$(OBJEXT) group-list.$(OBJEXT) +id_OBJECTS = $(am_id_OBJECTS) +id_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) join_SOURCES = join.c join_OBJECTS = join.$(OBJEXT) join_LDADD = $(LDADD) -join_DEPENDENCIES = ../lib/libcoreutils.a $(am__DEPENDENCIES_1) \ - ../lib/libcoreutils.a -kill_SOURCES = kill.c -kill_OBJECTS = kill.$(OBJEXT) +join_DEPENDENCIES = libver.a ../lib/libcoreutils.a \ + $(am__DEPENDENCIES_1) ../lib/libcoreutils.a +am_kill_OBJECTS = kill.$(OBJEXT) operand2sig.$(OBJEXT) +kill_OBJECTS = $(am_kill_OBJECTS) kill_LDADD = $(LDADD) -kill_DEPENDENCIES = ../lib/libcoreutils.a $(am__DEPENDENCIES_1) \ - ../lib/libcoreutils.a +kill_DEPENDENCIES = libver.a ../lib/libcoreutils.a \ + $(am__DEPENDENCIES_1) ../lib/libcoreutils.a link_SOURCES = link.c link_OBJECTS = link.$(OBJEXT) link_LDADD = $(LDADD) -link_DEPENDENCIES = ../lib/libcoreutils.a $(am__DEPENDENCIES_1) \ - ../lib/libcoreutils.a -ln_SOURCES = ln.c -ln_OBJECTS = ln.$(OBJEXT) +link_DEPENDENCIES = libver.a ../lib/libcoreutils.a \ + $(am__DEPENDENCIES_1) ../lib/libcoreutils.a +am_ln_OBJECTS = ln.$(OBJEXT) +ln_OBJECTS = $(am_ln_OBJECTS) ln_LDADD = $(LDADD) -ln_DEPENDENCIES = ../lib/libcoreutils.a $(am__DEPENDENCIES_1) \ +ln_DEPENDENCIES = libver.a ../lib/libcoreutils.a $(am__DEPENDENCIES_1) \ ../lib/libcoreutils.a logname_SOURCES = logname.c logname_OBJECTS = logname.$(OBJEXT) logname_LDADD = $(LDADD) -logname_DEPENDENCIES = ../lib/libcoreutils.a $(am__DEPENDENCIES_1) \ - ../lib/libcoreutils.a +logname_DEPENDENCIES = libver.a ../lib/libcoreutils.a \ + $(am__DEPENDENCIES_1) ../lib/libcoreutils.a am_ls_OBJECTS = ls.$(OBJEXT) ls-ls.$(OBJEXT) ls_OBJECTS = $(am_ls_OBJECTS) ls_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) am_md5sum_OBJECTS = md5sum-md5sum.$(OBJEXT) md5sum_OBJECTS = $(am_md5sum_OBJECTS) md5sum_LDADD = $(LDADD) -md5sum_DEPENDENCIES = ../lib/libcoreutils.a $(am__DEPENDENCIES_1) \ - ../lib/libcoreutils.a -mkdir_SOURCES = mkdir.c -mkdir_OBJECTS = mkdir.$(OBJEXT) -mkdir_LDADD = $(LDADD) -mkdir_DEPENDENCIES = ../lib/libcoreutils.a $(am__DEPENDENCIES_1) \ - ../lib/libcoreutils.a +md5sum_DEPENDENCIES = libver.a ../lib/libcoreutils.a \ + $(am__DEPENDENCIES_1) ../lib/libcoreutils.a +am_mkdir_OBJECTS = mkdir.$(OBJEXT) prog-fprintf.$(OBJEXT) +mkdir_OBJECTS = $(am_mkdir_OBJECTS) +mkdir_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) mkfifo_SOURCES = mkfifo.c mkfifo_OBJECTS = mkfifo.$(OBJEXT) -mkfifo_LDADD = $(LDADD) -mkfifo_DEPENDENCIES = ../lib/libcoreutils.a $(am__DEPENDENCIES_1) \ - ../lib/libcoreutils.a +mkfifo_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) mknod_SOURCES = mknod.c mknod_OBJECTS = mknod.$(OBJEXT) -mknod_LDADD = $(LDADD) -mknod_DEPENDENCIES = ../lib/libcoreutils.a $(am__DEPENDENCIES_1) \ - ../lib/libcoreutils.a -am_mv_OBJECTS = mv.$(OBJEXT) copy.$(OBJEXT) cp-hash.$(OBJEXT) \ - remove.$(OBJEXT) +mknod_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) +mktemp_SOURCES = mktemp.c +mktemp_OBJECTS = mktemp.$(OBJEXT) +mktemp_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) +am_mv_OBJECTS = mv.$(OBJEXT) remove.$(OBJEXT) $(am__objects_1) mv_OBJECTS = $(am_mv_OBJECTS) mv_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) nice_SOURCES = nice.c nice_OBJECTS = nice.$(OBJEXT) nice_LDADD = $(LDADD) -nice_DEPENDENCIES = ../lib/libcoreutils.a $(am__DEPENDENCIES_1) \ - ../lib/libcoreutils.a +nice_DEPENDENCIES = libver.a ../lib/libcoreutils.a \ + $(am__DEPENDENCIES_1) ../lib/libcoreutils.a nl_SOURCES = nl.c nl_OBJECTS = nl.$(OBJEXT) nl_LDADD = $(LDADD) -nl_DEPENDENCIES = ../lib/libcoreutils.a $(am__DEPENDENCIES_1) \ +nl_DEPENDENCIES = libver.a ../lib/libcoreutils.a $(am__DEPENDENCIES_1) \ ../lib/libcoreutils.a nohup_SOURCES = nohup.c nohup_OBJECTS = nohup.$(OBJEXT) nohup_LDADD = $(LDADD) -nohup_DEPENDENCIES = ../lib/libcoreutils.a $(am__DEPENDENCIES_1) \ - ../lib/libcoreutils.a +nohup_DEPENDENCIES = libver.a ../lib/libcoreutils.a \ + $(am__DEPENDENCIES_1) ../lib/libcoreutils.a od_SOURCES = od.c od_OBJECTS = od.$(OBJEXT) od_LDADD = $(LDADD) -od_DEPENDENCIES = ../lib/libcoreutils.a $(am__DEPENDENCIES_1) \ +od_DEPENDENCIES = libver.a ../lib/libcoreutils.a $(am__DEPENDENCIES_1) \ ../lib/libcoreutils.a paste_SOURCES = paste.c paste_OBJECTS = paste.$(OBJEXT) paste_LDADD = $(LDADD) -paste_DEPENDENCIES = ../lib/libcoreutils.a $(am__DEPENDENCIES_1) \ - ../lib/libcoreutils.a +paste_DEPENDENCIES = libver.a ../lib/libcoreutils.a \ + $(am__DEPENDENCIES_1) ../lib/libcoreutils.a pathchk_SOURCES = pathchk.c pathchk_OBJECTS = pathchk.$(OBJEXT) pathchk_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) pinky_SOURCES = pinky.c pinky_OBJECTS = pinky.$(OBJEXT) -pinky_LDADD = $(LDADD) -pinky_DEPENDENCIES = ../lib/libcoreutils.a $(am__DEPENDENCIES_1) \ - ../lib/libcoreutils.a +pinky_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) pr_SOURCES = pr.c pr_OBJECTS = pr.$(OBJEXT) pr_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) printenv_SOURCES = printenv.c printenv_OBJECTS = printenv.$(OBJEXT) printenv_LDADD = $(LDADD) -printenv_DEPENDENCIES = ../lib/libcoreutils.a $(am__DEPENDENCIES_1) \ - ../lib/libcoreutils.a +printenv_DEPENDENCIES = libver.a ../lib/libcoreutils.a \ + $(am__DEPENDENCIES_1) ../lib/libcoreutils.a printf_SOURCES = printf.c printf_OBJECTS = printf.$(OBJEXT) printf_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) ptx_SOURCES = ptx.c ptx_OBJECTS = ptx.$(OBJEXT) -ptx_LDADD = $(LDADD) -ptx_DEPENDENCIES = ../lib/libcoreutils.a $(am__DEPENDENCIES_1) \ - ../lib/libcoreutils.a +ptx_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) pwd_SOURCES = pwd.c pwd_OBJECTS = pwd.$(OBJEXT) pwd_LDADD = $(LDADD) -pwd_DEPENDENCIES = ../lib/libcoreutils.a $(am__DEPENDENCIES_1) \ - ../lib/libcoreutils.a +pwd_DEPENDENCIES = libver.a ../lib/libcoreutils.a \ + $(am__DEPENDENCIES_1) ../lib/libcoreutils.a readlink_SOURCES = readlink.c readlink_OBJECTS = readlink.$(OBJEXT) readlink_LDADD = $(LDADD) -readlink_DEPENDENCIES = ../lib/libcoreutils.a $(am__DEPENDENCIES_1) \ - ../lib/libcoreutils.a +readlink_DEPENDENCIES = libver.a ../lib/libcoreutils.a \ + $(am__DEPENDENCIES_1) ../lib/libcoreutils.a am_rm_OBJECTS = rm.$(OBJEXT) remove.$(OBJEXT) rm_OBJECTS = $(am_rm_OBJECTS) rm_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) -rmdir_SOURCES = rmdir.c -rmdir_OBJECTS = rmdir.$(OBJEXT) +am_rmdir_OBJECTS = rmdir.$(OBJEXT) prog-fprintf.$(OBJEXT) +rmdir_OBJECTS = $(am_rmdir_OBJECTS) rmdir_LDADD = $(LDADD) -rmdir_DEPENDENCIES = ../lib/libcoreutils.a $(am__DEPENDENCIES_1) \ - ../lib/libcoreutils.a +rmdir_DEPENDENCIES = libver.a ../lib/libcoreutils.a \ + $(am__DEPENDENCIES_1) ../lib/libcoreutils.a +runcon_SOURCES = runcon.c +runcon_OBJECTS = runcon.$(OBJEXT) +runcon_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) seq_SOURCES = seq.c seq_OBJECTS = seq.$(OBJEXT) seq_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) setuidgid_SOURCES = setuidgid.c setuidgid_OBJECTS = setuidgid.$(OBJEXT) setuidgid_LDADD = $(LDADD) -setuidgid_DEPENDENCIES = ../lib/libcoreutils.a $(am__DEPENDENCIES_1) \ - ../lib/libcoreutils.a +setuidgid_DEPENDENCIES = libver.a ../lib/libcoreutils.a \ + $(am__DEPENDENCIES_1) ../lib/libcoreutils.a am_sha1sum_OBJECTS = sha1sum-md5sum.$(OBJEXT) sha1sum_OBJECTS = $(am_sha1sum_OBJECTS) sha1sum_LDADD = $(LDADD) -sha1sum_DEPENDENCIES = ../lib/libcoreutils.a $(am__DEPENDENCIES_1) \ - ../lib/libcoreutils.a +sha1sum_DEPENDENCIES = libver.a ../lib/libcoreutils.a \ + $(am__DEPENDENCIES_1) ../lib/libcoreutils.a am_sha224sum_OBJECTS = sha224sum-md5sum.$(OBJEXT) sha224sum_OBJECTS = $(am_sha224sum_OBJECTS) sha224sum_LDADD = $(LDADD) -sha224sum_DEPENDENCIES = ../lib/libcoreutils.a $(am__DEPENDENCIES_1) \ - ../lib/libcoreutils.a +sha224sum_DEPENDENCIES = libver.a ../lib/libcoreutils.a \ + $(am__DEPENDENCIES_1) ../lib/libcoreutils.a am_sha256sum_OBJECTS = sha256sum-md5sum.$(OBJEXT) sha256sum_OBJECTS = $(am_sha256sum_OBJECTS) sha256sum_LDADD = $(LDADD) -sha256sum_DEPENDENCIES = ../lib/libcoreutils.a $(am__DEPENDENCIES_1) \ - ../lib/libcoreutils.a +sha256sum_DEPENDENCIES = libver.a ../lib/libcoreutils.a \ + $(am__DEPENDENCIES_1) ../lib/libcoreutils.a am_sha384sum_OBJECTS = sha384sum-md5sum.$(OBJEXT) sha384sum_OBJECTS = $(am_sha384sum_OBJECTS) sha384sum_LDADD = $(LDADD) -sha384sum_DEPENDENCIES = ../lib/libcoreutils.a $(am__DEPENDENCIES_1) \ - ../lib/libcoreutils.a +sha384sum_DEPENDENCIES = libver.a ../lib/libcoreutils.a \ + $(am__DEPENDENCIES_1) ../lib/libcoreutils.a am_sha512sum_OBJECTS = sha512sum-md5sum.$(OBJEXT) sha512sum_OBJECTS = $(am_sha512sum_OBJECTS) sha512sum_LDADD = $(LDADD) -sha512sum_DEPENDENCIES = ../lib/libcoreutils.a $(am__DEPENDENCIES_1) \ - ../lib/libcoreutils.a +sha512sum_DEPENDENCIES = libver.a ../lib/libcoreutils.a \ + $(am__DEPENDENCIES_1) ../lib/libcoreutils.a shred_SOURCES = shred.c shred_OBJECTS = shred.$(OBJEXT) shred_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \ @@ -538,91 +602,91 @@ sort_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) split_SOURCES = split.c split_OBJECTS = split.$(OBJEXT) -split_LDADD = $(LDADD) -split_DEPENDENCIES = ../lib/libcoreutils.a $(am__DEPENDENCIES_1) \ - ../lib/libcoreutils.a +split_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) stat_SOURCES = stat.c stat_OBJECTS = stat.$(OBJEXT) -stat_LDADD = $(LDADD) -stat_DEPENDENCIES = ../lib/libcoreutils.a $(am__DEPENDENCIES_1) \ - ../lib/libcoreutils.a +stat_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) stty_SOURCES = stty.c stty_OBJECTS = stty.$(OBJEXT) stty_LDADD = $(LDADD) -stty_DEPENDENCIES = ../lib/libcoreutils.a $(am__DEPENDENCIES_1) \ - ../lib/libcoreutils.a +stty_DEPENDENCIES = libver.a ../lib/libcoreutils.a \ + $(am__DEPENDENCIES_1) ../lib/libcoreutils.a su_SOURCES = su.c su_OBJECTS = su.$(OBJEXT) su_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) sum_SOURCES = sum.c sum_OBJECTS = sum.$(OBJEXT) sum_LDADD = $(LDADD) -sum_DEPENDENCIES = ../lib/libcoreutils.a $(am__DEPENDENCIES_1) \ - ../lib/libcoreutils.a +sum_DEPENDENCIES = libver.a ../lib/libcoreutils.a \ + $(am__DEPENDENCIES_1) ../lib/libcoreutils.a sync_SOURCES = sync.c sync_OBJECTS = sync.$(OBJEXT) sync_LDADD = $(LDADD) -sync_DEPENDENCIES = ../lib/libcoreutils.a $(am__DEPENDENCIES_1) \ - ../lib/libcoreutils.a +sync_DEPENDENCIES = libver.a ../lib/libcoreutils.a \ + $(am__DEPENDENCIES_1) ../lib/libcoreutils.a tac_SOURCES = tac.c tac_OBJECTS = tac.$(OBJEXT) -tac_LDADD = $(LDADD) -tac_DEPENDENCIES = ../lib/libcoreutils.a $(am__DEPENDENCIES_1) \ - ../lib/libcoreutils.a +tac_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) tail_SOURCES = tail.c tail_OBJECTS = tail.$(OBJEXT) tail_DEPENDENCIES = $(am__DEPENDENCIES_3) tee_SOURCES = tee.c tee_OBJECTS = tee.$(OBJEXT) tee_LDADD = $(LDADD) -tee_DEPENDENCIES = ../lib/libcoreutils.a $(am__DEPENDENCIES_1) \ - ../lib/libcoreutils.a +tee_DEPENDENCIES = libver.a ../lib/libcoreutils.a \ + $(am__DEPENDENCIES_1) ../lib/libcoreutils.a test_SOURCES = test.c test_OBJECTS = test.$(OBJEXT) test_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) +am_timeout_OBJECTS = timeout.$(OBJEXT) operand2sig.$(OBJEXT) +timeout_OBJECTS = $(am_timeout_OBJECTS) +timeout_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) touch_SOURCES = touch.c touch_OBJECTS = touch.$(OBJEXT) touch_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) tr_SOURCES = tr.c tr_OBJECTS = tr.$(OBJEXT) tr_LDADD = $(LDADD) -tr_DEPENDENCIES = ../lib/libcoreutils.a $(am__DEPENDENCIES_1) \ +tr_DEPENDENCIES = libver.a ../lib/libcoreutils.a $(am__DEPENDENCIES_1) \ ../lib/libcoreutils.a true_SOURCES = true.c true_OBJECTS = true.$(OBJEXT) true_LDADD = $(LDADD) -true_DEPENDENCIES = ../lib/libcoreutils.a $(am__DEPENDENCIES_1) \ - ../lib/libcoreutils.a +true_DEPENDENCIES = libver.a ../lib/libcoreutils.a \ + $(am__DEPENDENCIES_1) ../lib/libcoreutils.a +truncate_SOURCES = truncate.c +truncate_OBJECTS = truncate.$(OBJEXT) +truncate_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) tsort_SOURCES = tsort.c tsort_OBJECTS = tsort.$(OBJEXT) tsort_LDADD = $(LDADD) -tsort_DEPENDENCIES = ../lib/libcoreutils.a $(am__DEPENDENCIES_1) \ - ../lib/libcoreutils.a +tsort_DEPENDENCIES = libver.a ../lib/libcoreutils.a \ + $(am__DEPENDENCIES_1) ../lib/libcoreutils.a tty_SOURCES = tty.c tty_OBJECTS = tty.$(OBJEXT) tty_LDADD = $(LDADD) -tty_DEPENDENCIES = ../lib/libcoreutils.a $(am__DEPENDENCIES_1) \ - ../lib/libcoreutils.a -uname_SOURCES = uname.c -uname_OBJECTS = uname.$(OBJEXT) +tty_DEPENDENCIES = libver.a ../lib/libcoreutils.a \ + $(am__DEPENDENCIES_1) ../lib/libcoreutils.a +am_uname_OBJECTS = uname.$(OBJEXT) uname-uname.$(OBJEXT) +uname_OBJECTS = $(am_uname_OBJECTS) uname_LDADD = $(LDADD) -uname_DEPENDENCIES = ../lib/libcoreutils.a $(am__DEPENDENCIES_1) \ - ../lib/libcoreutils.a +uname_DEPENDENCIES = libver.a ../lib/libcoreutils.a \ + $(am__DEPENDENCIES_1) ../lib/libcoreutils.a unexpand_SOURCES = unexpand.c unexpand_OBJECTS = unexpand.$(OBJEXT) unexpand_LDADD = $(LDADD) -unexpand_DEPENDENCIES = ../lib/libcoreutils.a $(am__DEPENDENCIES_1) \ - ../lib/libcoreutils.a +unexpand_DEPENDENCIES = libver.a ../lib/libcoreutils.a \ + $(am__DEPENDENCIES_1) ../lib/libcoreutils.a uniq_SOURCES = uniq.c uniq_OBJECTS = uniq.$(OBJEXT) uniq_LDADD = $(LDADD) -uniq_DEPENDENCIES = ../lib/libcoreutils.a $(am__DEPENDENCIES_1) \ - ../lib/libcoreutils.a +uniq_DEPENDENCIES = libver.a ../lib/libcoreutils.a \ + $(am__DEPENDENCIES_1) ../lib/libcoreutils.a unlink_SOURCES = unlink.c unlink_OBJECTS = unlink.$(OBJEXT) unlink_LDADD = $(LDADD) -unlink_DEPENDENCIES = ../lib/libcoreutils.a $(am__DEPENDENCIES_1) \ - ../lib/libcoreutils.a +unlink_DEPENDENCIES = libver.a ../lib/libcoreutils.a \ + $(am__DEPENDENCIES_1) ../lib/libcoreutils.a uptime_SOURCES = uptime.c uptime_OBJECTS = uptime.$(OBJEXT) uptime_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \ @@ -630,73 +694,88 @@ uptime_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \ users_SOURCES = users.c users_OBJECTS = users.$(OBJEXT) users_LDADD = $(LDADD) -users_DEPENDENCIES = ../lib/libcoreutils.a $(am__DEPENDENCIES_1) \ - ../lib/libcoreutils.a +users_DEPENDENCIES = libver.a ../lib/libcoreutils.a \ + $(am__DEPENDENCIES_1) ../lib/libcoreutils.a am_vdir_OBJECTS = ls.$(OBJEXT) ls-vdir.$(OBJEXT) vdir_OBJECTS = $(am_vdir_OBJECTS) vdir_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) wc_SOURCES = wc.c wc_OBJECTS = wc.$(OBJEXT) wc_LDADD = $(LDADD) -wc_DEPENDENCIES = ../lib/libcoreutils.a $(am__DEPENDENCIES_1) \ +wc_DEPENDENCIES = libver.a ../lib/libcoreutils.a $(am__DEPENDENCIES_1) \ ../lib/libcoreutils.a who_SOURCES = who.c who_OBJECTS = who.$(OBJEXT) -who_LDADD = $(LDADD) -who_DEPENDENCIES = ../lib/libcoreutils.a $(am__DEPENDENCIES_1) \ - ../lib/libcoreutils.a +who_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) whoami_SOURCES = whoami.c whoami_OBJECTS = whoami.$(OBJEXT) whoami_LDADD = $(LDADD) -whoami_DEPENDENCIES = ../lib/libcoreutils.a $(am__DEPENDENCIES_1) \ - ../lib/libcoreutils.a +whoami_DEPENDENCIES = libver.a ../lib/libcoreutils.a \ + $(am__DEPENDENCIES_1) ../lib/libcoreutils.a yes_SOURCES = yes.c yes_OBJECTS = yes.$(OBJEXT) yes_LDADD = $(LDADD) -yes_DEPENDENCIES = ../lib/libcoreutils.a $(am__DEPENDENCIES_1) \ - ../lib/libcoreutils.a -binSCRIPT_INSTALL = $(INSTALL_SCRIPT) -SCRIPTS = $(bin_SCRIPTS) -DEFAULT_INCLUDES = -I. -I$(top_builddir)/lib@am__isrc@ +yes_DEPENDENCIES = libver.a ../lib/libcoreutils.a \ + $(am__DEPENDENCIES_1) ../lib/libcoreutils.a +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/lib depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp am__depfiles_maybe = depfiles +am__mv = mv -f +AM_V_lt = $(am__v_lt_$(V)) +am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) +am__v_lt_0 = --silent COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_$(V)) +am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) +am__v_CC_0 = @echo " CC " $@; CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -SOURCES = $(__SOURCES) base64.c basename.c cat.c $(chgrp_SOURCES) \ - chmod.c $(chown_SOURCES) chroot.c cksum.c comm.c $(cp_SOURCES) \ +AM_V_CCLD = $(am__v_CCLD_$(V)) +am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) +am__v_CCLD_0 = @echo " CCLD " $@; +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) +am__v_GEN_0 = @echo " GEN " $@; +SOURCES = $(nodist_libver_a_SOURCES) $(__SOURCES) $(arch_SOURCES) \ + base64.c basename.c cat.c chcon.c $(chgrp_SOURCES) chmod.c \ + $(chown_SOURCES) chroot.c cksum.c comm.c $(cp_SOURCES) \ csplit.c cut.c date.c dd.c df.c $(dir_SOURCES) dircolors.c \ dirname.c du.c echo.c env.c expand.c expr.c factor.c false.c \ - fmt.c fold.c $(ginstall_SOURCES) head.c hostid.c hostname.c \ - id.c join.c kill.c link.c ln.c logname.c $(ls_SOURCES) \ - $(md5sum_SOURCES) mkdir.c mkfifo.c mknod.c $(mv_SOURCES) \ + fmt.c fold.c getlimits.c $(ginstall_SOURCES) $(groups_SOURCES) \ + head.c hostid.c hostname.c $(id_SOURCES) join.c \ + $(kill_SOURCES) link.c $(ln_SOURCES) logname.c $(ls_SOURCES) \ + $(md5sum_SOURCES) $(mkdir_SOURCES) mkfifo.c mknod.c mktemp.c \ + $(mv_SOURCES) nice.c nl.c nohup.c od.c paste.c pathchk.c \ + pinky.c pr.c printenv.c printf.c ptx.c pwd.c readlink.c \ + $(rm_SOURCES) $(rmdir_SOURCES) runcon.c seq.c setuidgid.c \ + $(sha1sum_SOURCES) $(sha224sum_SOURCES) $(sha256sum_SOURCES) \ + $(sha384sum_SOURCES) $(sha512sum_SOURCES) shred.c shuf.c \ + sleep.c sort.c split.c stat.c stty.c su.c sum.c sync.c tac.c \ + tail.c tee.c test.c $(timeout_SOURCES) touch.c tr.c true.c \ + truncate.c tsort.c tty.c $(uname_SOURCES) unexpand.c uniq.c \ + unlink.c uptime.c users.c $(vdir_SOURCES) wc.c who.c whoami.c \ + yes.c +DIST_SOURCES = $(__SOURCES) $(arch_SOURCES) base64.c basename.c cat.c \ + chcon.c $(chgrp_SOURCES) chmod.c $(chown_SOURCES) chroot.c \ + cksum.c comm.c $(cp_SOURCES) csplit.c cut.c date.c dd.c df.c \ + $(dir_SOURCES) dircolors.c dirname.c du.c echo.c env.c \ + expand.c expr.c factor.c false.c fmt.c fold.c getlimits.c \ + $(ginstall_SOURCES) $(groups_SOURCES) head.c hostid.c \ + hostname.c $(id_SOURCES) join.c $(kill_SOURCES) link.c \ + $(ln_SOURCES) logname.c $(ls_SOURCES) $(md5sum_SOURCES) \ + $(mkdir_SOURCES) mkfifo.c mknod.c mktemp.c $(mv_SOURCES) \ nice.c nl.c nohup.c od.c paste.c pathchk.c pinky.c pr.c \ printenv.c printf.c ptx.c pwd.c readlink.c $(rm_SOURCES) \ - rmdir.c seq.c setuidgid.c $(sha1sum_SOURCES) \ + $(rmdir_SOURCES) runcon.c seq.c setuidgid.c $(sha1sum_SOURCES) \ $(sha224sum_SOURCES) $(sha256sum_SOURCES) $(sha384sum_SOURCES) \ $(sha512sum_SOURCES) shred.c shuf.c sleep.c sort.c split.c \ stat.c stty.c su.c sum.c sync.c tac.c tail.c tee.c test.c \ - touch.c tr.c true.c tsort.c tty.c uname.c unexpand.c uniq.c \ - unlink.c uptime.c users.c $(vdir_SOURCES) wc.c who.c whoami.c \ - yes.c -DIST_SOURCES = $(__SOURCES) base64.c basename.c cat.c $(chgrp_SOURCES) \ - chmod.c $(chown_SOURCES) chroot.c cksum.c comm.c $(cp_SOURCES) \ - csplit.c cut.c date.c dd.c df.c $(dir_SOURCES) dircolors.c \ - dirname.c du.c echo.c env.c expand.c expr.c factor.c false.c \ - fmt.c fold.c $(ginstall_SOURCES) head.c hostid.c hostname.c \ - id.c join.c kill.c link.c ln.c logname.c $(ls_SOURCES) \ - $(md5sum_SOURCES) mkdir.c mkfifo.c mknod.c $(mv_SOURCES) \ - nice.c nl.c nohup.c od.c paste.c pathchk.c pinky.c pr.c \ - printenv.c printf.c ptx.c pwd.c readlink.c $(rm_SOURCES) \ - rmdir.c seq.c setuidgid.c $(sha1sum_SOURCES) \ - $(sha224sum_SOURCES) $(sha256sum_SOURCES) $(sha384sum_SOURCES) \ - $(sha512sum_SOURCES) shred.c shuf.c sleep.c sort.c split.c \ - stat.c stty.c su.c sum.c sync.c tac.c tail.c tee.c test.c \ - touch.c tr.c true.c tsort.c tty.c uname.c unexpand.c uniq.c \ - unlink.c uptime.c users.c $(vdir_SOURCES) wc.c who.c whoami.c \ - yes.c + $(timeout_SOURCES) touch.c tr.c true.c truncate.c tsort.c \ + tty.c $(uname_SOURCES) unexpand.c uniq.c unlink.c uptime.c \ + users.c $(vdir_SOURCES) wc.c who.c whoami.c yes.c HEADERS = $(noinst_HEADERS) ETAGS = etags CTAGS = ctags @@ -705,26 +784,13 @@ DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) # Use `ginstall' in the definition of PROGRAMS and in dependencies to avoid # confusion with the `install' target. The install rule transforms `ginstall' # to install before applying any user-specified name transformations. -transform = s/ginstall/install/; @program_transform_name@ -ABSOLUTE_DIRENT_H = @ABSOLUTE_DIRENT_H@ -ABSOLUTE_FCNTL_H = @ABSOLUTE_FCNTL_H@ -ABSOLUTE_INTTYPES_H = @ABSOLUTE_INTTYPES_H@ -ABSOLUTE_NETINET_IN_H = @ABSOLUTE_NETINET_IN_H@ -ABSOLUTE_STDINT_H = @ABSOLUTE_STDINT_H@ -ABSOLUTE_STDIO_H = @ABSOLUTE_STDIO_H@ -ABSOLUTE_STDLIB_H = @ABSOLUTE_STDLIB_H@ -ABSOLUTE_STRING_H = @ABSOLUTE_STRING_H@ -ABSOLUTE_SYS_SOCKET_H = @ABSOLUTE_SYS_SOCKET_H@ -ABSOLUTE_SYS_STAT_H = @ABSOLUTE_SYS_STAT_H@ -ABSOLUTE_SYS_TIME_H = @ABSOLUTE_SYS_TIME_H@ -ABSOLUTE_TIME_H = @ABSOLUTE_TIME_H@ -ABSOLUTE_UNISTD_H = @ABSOLUTE_UNISTD_H@ -ABSOLUTE_WCHAR_H = @ABSOLUTE_WCHAR_H@ -ABSOLUTE_WCTYPE_H = @ABSOLUTE_WCTYPE_H@ +transform = s/ginstall/install/; $(program_transform_name) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ ALLOCA_H = @ALLOCA_H@ AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@ ARPA_INET_H = @ARPA_INET_H@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -738,46 +804,122 @@ BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ +CONFIG_STATUS_DEPENDENCIES = @CONFIG_STATUS_DEPENDENCIES@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFAULT_POSIX2_VERSION = @DEFAULT_POSIX2_VERSION@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DF_PROG = @DF_PROG@ DIRENT_H = @DIRENT_H@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -EOVERFLOW = @EOVERFLOW@ +EMULTIHOP_HIDDEN = @EMULTIHOP_HIDDEN@ +EMULTIHOP_VALUE = @EMULTIHOP_VALUE@ +ENOLINK_HIDDEN = @ENOLINK_HIDDEN@ +ENOLINK_VALUE = @ENOLINK_VALUE@ +EOVERFLOW_HIDDEN = @EOVERFLOW_HIDDEN@ +EOVERFLOW_VALUE = @EOVERFLOW_VALUE@ +ERRNO_H = @ERRNO_H@ EXEEXT = @EXEEXT@ FCNTL_H = @FCNTL_H@ +FLOAT_H = @FLOAT_H@ FNMATCH_H = @FNMATCH_H@ +GETADDRINFO_LIB = @GETADDRINFO_LIB@ GETLOADAVG_LIBS = @GETLOADAVG_LIBS@ GETOPT_H = @GETOPT_H@ +GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GLIBC21 = @GLIBC21@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ +GNULIB_ACCEPT = @GNULIB_ACCEPT@ +GNULIB_ALPHASORT = @GNULIB_ALPHASORT@ +GNULIB_ATOLL = @GNULIB_ATOLL@ +GNULIB_BIND = @GNULIB_BIND@ +GNULIB_BTOWC = @GNULIB_BTOWC@ +GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@ +GNULIB_CEILF = @GNULIB_CEILF@ +GNULIB_CEILL = @GNULIB_CEILL@ GNULIB_CHOWN = @GNULIB_CHOWN@ +GNULIB_CLOSE = @GNULIB_CLOSE@ +GNULIB_CONNECT = @GNULIB_CONNECT@ +GNULIB_DIRFD = @GNULIB_DIRFD@ +GNULIB_DPRINTF = @GNULIB_DPRINTF@ GNULIB_DUP2 = @GNULIB_DUP2@ +GNULIB_ENVIRON = @GNULIB_ENVIRON@ +GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@ GNULIB_FCHDIR = @GNULIB_FCHDIR@ +GNULIB_FCLOSE = @GNULIB_FCLOSE@ +GNULIB_FFLUSH = @GNULIB_FFLUSH@ +GNULIB_FLOORF = @GNULIB_FLOORF@ +GNULIB_FLOORL = @GNULIB_FLOORL@ +GNULIB_FOPEN = @GNULIB_FOPEN@ +GNULIB_FPRINTF = @GNULIB_FPRINTF@ GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@ +GNULIB_FPUTC = @GNULIB_FPUTC@ +GNULIB_FPUTS = @GNULIB_FPUTS@ +GNULIB_FREOPEN = @GNULIB_FREOPEN@ +GNULIB_FREXP = @GNULIB_FREXP@ +GNULIB_FREXPL = @GNULIB_FREXPL@ +GNULIB_FSEEK = @GNULIB_FSEEK@ +GNULIB_FSEEKO = @GNULIB_FSEEKO@ +GNULIB_FSYNC = @GNULIB_FSYNC@ +GNULIB_FTELL = @GNULIB_FTELL@ +GNULIB_FTELLO = @GNULIB_FTELLO@ GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@ +GNULIB_FWRITE = @GNULIB_FWRITE@ +GNULIB_GETADDRINFO = @GNULIB_GETADDRINFO@ GNULIB_GETCWD = @GNULIB_GETCWD@ +GNULIB_GETDELIM = @GNULIB_GETDELIM@ +GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@ +GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@ +GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@ +GNULIB_GETLINE = @GNULIB_GETLINE@ +GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@ GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ +GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@ +GNULIB_GETPEERNAME = @GNULIB_GETPEERNAME@ +GNULIB_GETSOCKNAME = @GNULIB_GETSOCKNAME@ +GNULIB_GETSOCKOPT = @GNULIB_GETSOCKOPT@ GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ +GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@ GNULIB_IMAXABS = @GNULIB_IMAXABS@ GNULIB_IMAXDIV = @GNULIB_IMAXDIV@ +GNULIB_INET_NTOP = @GNULIB_INET_NTOP@ +GNULIB_INET_PTON = @GNULIB_INET_PTON@ +GNULIB_IOCTL = @GNULIB_IOCTL@ +GNULIB_ISFINITE = @GNULIB_ISFINITE@ +GNULIB_ISINF = @GNULIB_ISINF@ +GNULIB_ISNAN = @GNULIB_ISNAN@ +GNULIB_ISNAND = @GNULIB_ISNAND@ +GNULIB_ISNANF = @GNULIB_ISNANF@ +GNULIB_ISNANL = @GNULIB_ISNANL@ +GNULIB_LCHMOD = @GNULIB_LCHMOD@ +GNULIB_LCHOWN = @GNULIB_LCHOWN@ +GNULIB_LDEXPL = @GNULIB_LDEXPL@ +GNULIB_LINK = @GNULIB_LINK@ +GNULIB_LISTEN = @GNULIB_LISTEN@ +GNULIB_LSEEK = @GNULIB_LSEEK@ +GNULIB_LSTAT = @GNULIB_LSTAT@ +GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@ +GNULIB_MATHL = @GNULIB_MATHL@ +GNULIB_MBRLEN = @GNULIB_MBRLEN@ +GNULIB_MBRTOWC = @GNULIB_MBRTOWC@ GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@ GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@ GNULIB_MBSCHR = @GNULIB_MBSCHR@ GNULIB_MBSCSPN = @GNULIB_MBSCSPN@ +GNULIB_MBSINIT = @GNULIB_MBSINIT@ GNULIB_MBSLEN = @GNULIB_MBSLEN@ GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@ +GNULIB_MBSNLEN = @GNULIB_MBSNLEN@ +GNULIB_MBSNRTOWCS = @GNULIB_MBSNRTOWCS@ GNULIB_MBSPBRK = @GNULIB_MBSPBRK@ GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@ GNULIB_MBSRCHR = @GNULIB_MBSRCHR@ +GNULIB_MBSRTOWCS = @GNULIB_MBSRTOWCS@ GNULIB_MBSSEP = @GNULIB_MBSSEP@ GNULIB_MBSSPN = @GNULIB_MBSSPN@ GNULIB_MBSSTR = @GNULIB_MBSSTR@ @@ -787,82 +929,230 @@ GNULIB_MEMPCPY = @GNULIB_MEMPCPY@ GNULIB_MEMRCHR = @GNULIB_MEMRCHR@ GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ GNULIB_MKSTEMP = @GNULIB_MKSTEMP@ +GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@ +GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@ +GNULIB_OPEN = @GNULIB_OPEN@ +GNULIB_PERROR = @GNULIB_PERROR@ +GNULIB_PRINTF = @GNULIB_PRINTF@ GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@ +GNULIB_PUTC = @GNULIB_PUTC@ +GNULIB_PUTCHAR = @GNULIB_PUTCHAR@ +GNULIB_PUTENV = @GNULIB_PUTENV@ +GNULIB_PUTS = @GNULIB_PUTS@ +GNULIB_RANDOM_R = @GNULIB_RANDOM_R@ +GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@ GNULIB_READLINK = @GNULIB_READLINK@ +GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@ +GNULIB_RECV = @GNULIB_RECV@ +GNULIB_RECVFROM = @GNULIB_RECVFROM@ +GNULIB_ROUND = @GNULIB_ROUND@ +GNULIB_ROUNDF = @GNULIB_ROUNDF@ +GNULIB_ROUNDL = @GNULIB_ROUNDL@ +GNULIB_RPMATCH = @GNULIB_RPMATCH@ +GNULIB_SCANDIR = @GNULIB_SCANDIR@ +GNULIB_SELECT = @GNULIB_SELECT@ +GNULIB_SEND = @GNULIB_SEND@ +GNULIB_SENDTO = @GNULIB_SENDTO@ +GNULIB_SETENV = @GNULIB_SETENV@ +GNULIB_SETSOCKOPT = @GNULIB_SETSOCKOPT@ +GNULIB_SHUTDOWN = @GNULIB_SHUTDOWN@ +GNULIB_SIGACTION = @GNULIB_SIGACTION@ +GNULIB_SIGNAL_H_SIGPIPE = @GNULIB_SIGNAL_H_SIGPIPE@ +GNULIB_SIGNBIT = @GNULIB_SIGNBIT@ +GNULIB_SIGPROCMASK = @GNULIB_SIGPROCMASK@ +GNULIB_SLEEP = @GNULIB_SLEEP@ GNULIB_SNPRINTF = @GNULIB_SNPRINTF@ +GNULIB_SOCKET = @GNULIB_SOCKET@ GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@ +GNULIB_STDIO_H_SIGPIPE = @GNULIB_STDIO_H_SIGPIPE@ GNULIB_STPCPY = @GNULIB_STPCPY@ GNULIB_STPNCPY = @GNULIB_STPNCPY@ GNULIB_STRCASESTR = @GNULIB_STRCASESTR@ GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@ GNULIB_STRDUP = @GNULIB_STRDUP@ +GNULIB_STRERROR = @GNULIB_STRERROR@ GNULIB_STRNDUP = @GNULIB_STRNDUP@ GNULIB_STRNLEN = @GNULIB_STRNLEN@ GNULIB_STRPBRK = @GNULIB_STRPBRK@ GNULIB_STRSEP = @GNULIB_STRSEP@ +GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@ +GNULIB_STRSTR = @GNULIB_STRSTR@ +GNULIB_STRTOD = @GNULIB_STRTOD@ GNULIB_STRTOIMAX = @GNULIB_STRTOIMAX@ GNULIB_STRTOK_R = @GNULIB_STRTOK_R@ +GNULIB_STRTOLL = @GNULIB_STRTOLL@ +GNULIB_STRTOULL = @GNULIB_STRTOULL@ GNULIB_STRTOUMAX = @GNULIB_STRTOUMAX@ +GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@ +GNULIB_TRUNC = @GNULIB_TRUNC@ +GNULIB_TRUNCF = @GNULIB_TRUNCF@ +GNULIB_TRUNCL = @GNULIB_TRUNCL@ +GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@ +GNULIB_UNSETENV = @GNULIB_UNSETENV@ +GNULIB_VASPRINTF = @GNULIB_VASPRINTF@ +GNULIB_VDPRINTF = @GNULIB_VDPRINTF@ +GNULIB_VFPRINTF = @GNULIB_VFPRINTF@ GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@ +GNULIB_VPRINTF = @GNULIB_VPRINTF@ GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@ GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@ GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@ -GNU_PACKAGE = @GNU_PACKAGE@ +GNULIB_WCRTOMB = @GNULIB_WCRTOMB@ +GNULIB_WCSNRTOMBS = @GNULIB_WCSNRTOMBS@ +GNULIB_WCSRTOMBS = @GNULIB_WCSRTOMBS@ +GNULIB_WCTOB = @GNULIB_WCTOB@ +GNULIB_WCWIDTH = @GNULIB_WCWIDTH@ +GNULIB_WRITE = @GNULIB_WRITE@ GREP = @GREP@ +HAVE_ALPHASORT = @HAVE_ALPHASORT@ +HAVE_ARPA_INET_H = @HAVE_ARPA_INET_H@ +HAVE_ATOLL = @HAVE_ATOLL@ +HAVE_BTOWC = @HAVE_BTOWC@ +HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@ +HAVE_DECL_ACOSL = @HAVE_DECL_ACOSL@ +HAVE_DECL_ASINL = @HAVE_DECL_ASINL@ +HAVE_DECL_ATANL = @HAVE_DECL_ATANL@ +HAVE_DECL_COSL = @HAVE_DECL_COSL@ +HAVE_DECL_DIRFD = @HAVE_DECL_DIRFD@ +HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@ +HAVE_DECL_EXPL = @HAVE_DECL_EXPL@ +HAVE_DECL_FREEADDRINFO = @HAVE_DECL_FREEADDRINFO@ +HAVE_DECL_FREXPL = @HAVE_DECL_FREXPL@ +HAVE_DECL_GAI_STRERROR = @HAVE_DECL_GAI_STRERROR@ +HAVE_DECL_GETADDRINFO = @HAVE_DECL_GETADDRINFO@ +HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@ +HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@ +HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@ HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ +HAVE_DECL_GETNAMEINFO = @HAVE_DECL_GETNAMEINFO@ HAVE_DECL_IMAXABS = @HAVE_DECL_IMAXABS@ HAVE_DECL_IMAXDIV = @HAVE_DECL_IMAXDIV@ +HAVE_DECL_INET_NTOP = @HAVE_DECL_INET_NTOP@ +HAVE_DECL_INET_PTON = @HAVE_DECL_INET_PTON@ +HAVE_DECL_LDEXPL = @HAVE_DECL_LDEXPL@ +HAVE_DECL_LOGL = @HAVE_DECL_LOGL@ HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@ HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@ +HAVE_DECL_OBSTACK_PRINTF = @HAVE_DECL_OBSTACK_PRINTF@ +HAVE_DECL_SINL = @HAVE_DECL_SINL@ HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@ +HAVE_DECL_SQRTL = @HAVE_DECL_SQRTL@ HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@ -HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@ +HAVE_DECL_STRERROR = @HAVE_DECL_STRERROR@ HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@ HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@ +HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@ HAVE_DECL_STRTOIMAX = @HAVE_DECL_STRTOIMAX@ HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@ HAVE_DECL_STRTOUMAX = @HAVE_DECL_STRTOUMAX@ +HAVE_DECL_TANL = @HAVE_DECL_TANL@ +HAVE_DECL_TRUNC = @HAVE_DECL_TRUNC@ +HAVE_DECL_TRUNCF = @HAVE_DECL_TRUNCF@ HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@ +HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@ +HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@ +HAVE_DPRINTF = @HAVE_DPRINTF@ HAVE_DUP2 = @HAVE_DUP2@ +HAVE_EUIDACCESS = @HAVE_EUIDACCESS@ +HAVE_FSEEKO = @HAVE_FSEEKO@ +HAVE_FSYNC = @HAVE_FSYNC@ +HAVE_FTELLO = @HAVE_FTELLO@ HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ +HAVE_GETDOMAINNAME = @HAVE_GETDOMAINNAME@ +HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@ +HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@ +HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@ HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ +HAVE_GETUSERSHELL = @HAVE_GETUSERSHELL@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ +HAVE_ISNAND = @HAVE_ISNAND@ +HAVE_ISNANF = @HAVE_ISNANF@ +HAVE_ISNANL = @HAVE_ISNANL@ +HAVE_ISWCNTRL = @HAVE_ISWCNTRL@ +HAVE_LCHMOD = @HAVE_LCHMOD@ +HAVE_LINK = @HAVE_LINK@ HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ +HAVE_LSTAT = @HAVE_LSTAT@ +HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@ +HAVE_MBRLEN = @HAVE_MBRLEN@ +HAVE_MBRTOWC = @HAVE_MBRTOWC@ +HAVE_MBSINIT = @HAVE_MBSINIT@ +HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@ +HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@ HAVE_MEMPCPY = @HAVE_MEMPCPY@ HAVE_MKDTEMP = @HAVE_MKDTEMP@ +HAVE_NETDB_H = @HAVE_NETDB_H@ HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@ +HAVE_OS_H = @HAVE_OS_H@ +HAVE_POSIX_SIGNALBLOCKING = @HAVE_POSIX_SIGNALBLOCKING@ +HAVE_RANDOM_H = @HAVE_RANDOM_H@ +HAVE_RANDOM_R = @HAVE_RANDOM_R@ +HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@ HAVE_READLINK = @HAVE_READLINK@ +HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@ +HAVE_RPMATCH = @HAVE_RPMATCH@ +HAVE_SCANDIR = @HAVE_SCANDIR@ +HAVE_SETENV = @HAVE_SETENV@ +HAVE_SIGACTION = @HAVE_SIGACTION@ +HAVE_SIGINFO_T = @HAVE_SIGINFO_T@ HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@ HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@ HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@ +HAVE_SIGSET_T = @HAVE_SIGSET_T@ +HAVE_SLEEP = @HAVE_SLEEP@ HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE_STPCPY = @HAVE_STPCPY@ HAVE_STPNCPY = @HAVE_STPNCPY@ -HAVE_STRCASECMP = @HAVE_STRCASECMP@ HAVE_STRCASESTR = @HAVE_STRCASESTR@ HAVE_STRCHRNUL = @HAVE_STRCHRNUL@ HAVE_STRNDUP = @HAVE_STRNDUP@ HAVE_STRPBRK = @HAVE_STRPBRK@ HAVE_STRSEP = @HAVE_STRSEP@ +HAVE_STRTOD = @HAVE_STRTOD@ +HAVE_STRTOLL = @HAVE_STRTOLL@ +HAVE_STRTOULL = @HAVE_STRTOULL@ +HAVE_STRUCT_ADDRINFO = @HAVE_STRUCT_ADDRINFO@ +HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@ +HAVE_STRUCT_SIGACTION_SA_SIGACTION = @HAVE_STRUCT_SIGACTION_SA_SIGACTION@ HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@ +HAVE_STRVERSCMP = @HAVE_STRVERSCMP@ HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@ +HAVE_SYS_IOCTL_H = @HAVE_SYS_IOCTL_H@ +HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@ +HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@ +HAVE_SYS_SELECT_H = @HAVE_SYS_SELECT_H@ HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@ HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ +HAVE_TYPE_VOLATILE_SIG_ATOMIC_T = @HAVE_TYPE_VOLATILE_SIG_ATOMIC_T@ HAVE_UNISTD_H = @HAVE_UNISTD_H@ +HAVE_UNSETENV = @HAVE_UNSETENV@ HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ +HAVE_VASPRINTF = @HAVE_VASPRINTF@ +HAVE_VDPRINTF = @HAVE_VDPRINTF@ +HAVE_WCHAR_H = @HAVE_WCHAR_H@ +HAVE_WCRTOMB = @HAVE_WCRTOMB@ +HAVE_WCSNRTOMBS = @HAVE_WCSNRTOMBS@ +HAVE_WCSRTOMBS = @HAVE_WCSRTOMBS@ HAVE_WCTYPE_H = @HAVE_WCTYPE_H@ HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@ HAVE_WINT_T = @HAVE_WINT_T@ HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@ HAVE__BOOL = @HAVE__BOOL@ HELP2MAN = @HELP2MAN@ +HOSTENT_LIB = @HOSTENT_LIB@ +ICONV_H = @ICONV_H@ +INCLUDE_NEXT = @INCLUDE_NEXT@ +INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_PROGRAM = $(cu_install_program) INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTALL_SU = @INSTALL_SU@ +INT32_MAX_LT_INTMAX_MAX = @INT32_MAX_LT_INTMAX_MAX@ +INT64_MAX_EQ_LONG_MAX = @INT64_MAX_EQ_LONG_MAX@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ INTTYPES_H = @INTTYPES_H@ @@ -874,15 +1164,26 @@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ +LIBSOCKET = @LIBSOCKET@ +LIBTESTS_LIBDEPS = @LIBTESTS_LIBDEPS@ LIB_ACL = @LIB_ACL@ -LIB_ACL_TRIVIAL = @LIB_ACL_TRIVIAL@ +LIB_CAP = @LIB_CAP@ LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@ LIB_CRYPT = @LIB_CRYPT@ LIB_EACCESS = @LIB_EACCESS@ LIB_FDATASYNC = @LIB_FDATASYNC@ LIB_GETHRXTIME = @LIB_GETHRXTIME@ +LIB_GMP = @LIB_GMP@ LIB_NANOSLEEP = @LIB_NANOSLEEP@ +LIB_SELINUX = @LIB_SELINUX@ +LIB_XATTR = @LIB_XATTR@ LN_S = @LN_S@ +LOCALCHARSET_TESTS_ENVIRONMENT = @LOCALCHARSET_TESTS_ENVIRONMENT@ +LOCALE_FR = @LOCALE_FR@ +LOCALE_FR_UTF8 = @LOCALE_FR_UTF8@ +LOCALE_JA = @LOCALE_JA@ +LOCALE_TR_UTF8 = @LOCALE_TR_UTF8@ +LOCALE_ZH_CN = @LOCALE_ZH_CN@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ @@ -893,7 +1194,34 @@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ NEED_SETGID = @NEED_SETGID@ +NETDB_H = @NETDB_H@ NETINET_IN_H = @NETINET_IN_H@ +NEXT_ARPA_INET_H = @NEXT_ARPA_INET_H@ +NEXT_DIRENT_H = @NEXT_DIRENT_H@ +NEXT_ERRNO_H = @NEXT_ERRNO_H@ +NEXT_FCNTL_H = @NEXT_FCNTL_H@ +NEXT_FLOAT_H = @NEXT_FLOAT_H@ +NEXT_ICONV_H = @NEXT_ICONV_H@ +NEXT_INTTYPES_H = @NEXT_INTTYPES_H@ +NEXT_MATH_H = @NEXT_MATH_H@ +NEXT_NETDB_H = @NEXT_NETDB_H@ +NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@ +NEXT_SIGNAL_H = @NEXT_SIGNAL_H@ +NEXT_STDARG_H = @NEXT_STDARG_H@ +NEXT_STDINT_H = @NEXT_STDINT_H@ +NEXT_STDIO_H = @NEXT_STDIO_H@ +NEXT_STDLIB_H = @NEXT_STDLIB_H@ +NEXT_STRING_H = @NEXT_STRING_H@ +NEXT_SYS_IOCTL_H = @NEXT_SYS_IOCTL_H@ +NEXT_SYS_SELECT_H = @NEXT_SYS_SELECT_H@ +NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_H@ +NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@ +NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@ +NEXT_TIME_H = @NEXT_TIME_H@ +NEXT_UNISTD_H = @NEXT_UNISTD_H@ +NEXT_WCHAR_H = @NEXT_WCHAR_H@ +NEXT_WCTYPE_H = @NEXT_WCTYPE_H@ +NO_INSTALL_PROGS_DEFAULT = @NO_INSTALL_PROGS_DEFAULT@ OBJEXT = @OBJEXT@ OPTIONAL_BIN_PROGS = @OPTIONAL_BIN_PROGS@ PACKAGE = @PACKAGE@ @@ -901,56 +1229,142 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ +POSIX_SHELL = @POSIX_SHELL@ POSUB = @POSUB@ POW_LIB = @POW_LIB@ +PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@ +PREFERABLY_POSIX_SHELL = @PREFERABLY_POSIX_SHELL@ PRIPTR_PREFIX = @PRIPTR_PREFIX@ PRI_MACROS_BROKEN = @PRI_MACROS_BROKEN@ PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ RANLIB = @RANLIB@ +REPLACE_BTOWC = @REPLACE_BTOWC@ +REPLACE_CEILF = @REPLACE_CEILF@ +REPLACE_CEILL = @REPLACE_CEILL@ REPLACE_CHOWN = @REPLACE_CHOWN@ +REPLACE_CLOSE = @REPLACE_CLOSE@ +REPLACE_DPRINTF = @REPLACE_DPRINTF@ REPLACE_FCHDIR = @REPLACE_FCHDIR@ +REPLACE_FCLOSE = @REPLACE_FCLOSE@ +REPLACE_FFLUSH = @REPLACE_FFLUSH@ +REPLACE_FLOORF = @REPLACE_FLOORF@ +REPLACE_FLOORL = @REPLACE_FLOORL@ +REPLACE_FOPEN = @REPLACE_FOPEN@ REPLACE_FPRINTF = @REPLACE_FPRINTF@ +REPLACE_FREOPEN = @REPLACE_FREOPEN@ +REPLACE_FREXP = @REPLACE_FREXP@ +REPLACE_FREXPL = @REPLACE_FREXPL@ +REPLACE_FSEEK = @REPLACE_FSEEK@ +REPLACE_FSEEKO = @REPLACE_FSEEKO@ +REPLACE_FTELL = @REPLACE_FTELL@ +REPLACE_FTELLO = @REPLACE_FTELLO@ REPLACE_GETCWD = @REPLACE_GETCWD@ +REPLACE_GETLINE = @REPLACE_GETLINE@ +REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@ REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@ +REPLACE_HUGE_VAL = @REPLACE_HUGE_VAL@ +REPLACE_ICONV = @REPLACE_ICONV@ +REPLACE_ICONV_OPEN = @REPLACE_ICONV_OPEN@ +REPLACE_ICONV_UTF = @REPLACE_ICONV_UTF@ +REPLACE_ISFINITE = @REPLACE_ISFINITE@ +REPLACE_ISINF = @REPLACE_ISINF@ +REPLACE_ISNAN = @REPLACE_ISNAN@ +REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@ +REPLACE_LCHOWN = @REPLACE_LCHOWN@ +REPLACE_LDEXPL = @REPLACE_LDEXPL@ REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@ +REPLACE_LSEEK = @REPLACE_LSEEK@ +REPLACE_LSTAT = @REPLACE_LSTAT@ +REPLACE_MBRLEN = @REPLACE_MBRLEN@ +REPLACE_MBRTOWC = @REPLACE_MBRTOWC@ +REPLACE_MBSINIT = @REPLACE_MBSINIT@ +REPLACE_MBSNRTOWCS = @REPLACE_MBSNRTOWCS@ +REPLACE_MBSRTOWCS = @REPLACE_MBSRTOWCS@ +REPLACE_MBSTATE_T = @REPLACE_MBSTATE_T@ +REPLACE_MEMMEM = @REPLACE_MEMMEM@ +REPLACE_MKDIR = @REPLACE_MKDIR@ REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ +REPLACE_NAN = @REPLACE_NAN@ REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@ +REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@ +REPLACE_OPEN = @REPLACE_OPEN@ +REPLACE_PERROR = @REPLACE_PERROR@ REPLACE_PRINTF = @REPLACE_PRINTF@ +REPLACE_PUTENV = @REPLACE_PUTENV@ +REPLACE_ROUND = @REPLACE_ROUND@ +REPLACE_ROUNDF = @REPLACE_ROUNDF@ +REPLACE_ROUNDL = @REPLACE_ROUNDL@ +REPLACE_SELECT = @REPLACE_SELECT@ +REPLACE_SIGNBIT = @REPLACE_SIGNBIT@ +REPLACE_SIGNBIT_USING_GCC = @REPLACE_SIGNBIT_USING_GCC@ REPLACE_SNPRINTF = @REPLACE_SNPRINTF@ REPLACE_SPRINTF = @REPLACE_SPRINTF@ +REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@ +REPLACE_STRCASESTR = @REPLACE_STRCASESTR@ +REPLACE_STRDUP = @REPLACE_STRDUP@ +REPLACE_STRERROR = @REPLACE_STRERROR@ REPLACE_STRPTIME = @REPLACE_STRPTIME@ +REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@ +REPLACE_STRSTR = @REPLACE_STRSTR@ +REPLACE_STRTOD = @REPLACE_STRTOD@ REPLACE_TIMEGM = @REPLACE_TIMEGM@ +REPLACE_TRUNCL = @REPLACE_TRUNCL@ +REPLACE_VASPRINTF = @REPLACE_VASPRINTF@ +REPLACE_VDPRINTF = @REPLACE_VDPRINTF@ REPLACE_VFPRINTF = @REPLACE_VFPRINTF@ REPLACE_VPRINTF = @REPLACE_VPRINTF@ REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@ REPLACE_VSPRINTF = @REPLACE_VSPRINTF@ +REPLACE_WCRTOMB = @REPLACE_WCRTOMB@ +REPLACE_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@ +REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@ +REPLACE_WCTOB = @REPLACE_WCTOB@ +REPLACE_WCWIDTH = @REPLACE_WCWIDTH@ +REPLACE_WRITE = @REPLACE_WRITE@ +SELINUX_CONTEXT_H = @SELINUX_CONTEXT_H@ +SELINUX_SELINUX_H = @SELINUX_SELINUX_H@ SEQ_LIBM = @SEQ_LIBM@ +SERVENT_LIB = @SERVENT_LIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@ SIZE_T_SUFFIX = @SIZE_T_SUFFIX@ +STDARG_H = @STDARG_H@ STDBOOL_H = @STDBOOL_H@ STDINT_H = @STDINT_H@ STRIP = @STRIP@ +SYS_IOCTL_H = @SYS_IOCTL_H@ +SYS_IOCTL_H_HAVE_WINSOCK2_H = @SYS_IOCTL_H_HAVE_WINSOCK2_H@ +SYS_SELECT_H = @SYS_SELECT_H@ SYS_SOCKET_H = @SYS_SOCKET_H@ SYS_STAT_H = @SYS_STAT_H@ SYS_TIME_H = @SYS_TIME_H@ SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@ TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@ U = @U@ +UINT32_MAX_LT_UINTMAX_MAX = @UINT32_MAX_LT_UINTMAX_MAX@ +UINT64_MAX_EQ_ULONG_MAX = @UINT64_MAX_EQ_ULONG_MAX@ +UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@ +USE_ACL = @USE_ACL@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ +VOID_UNSETENV = @VOID_UNSETENV@ +WARN_CFLAGS = @WARN_CFLAGS@ WCHAR_H = @WCHAR_H@ WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ WCTYPE_H = @WCTYPE_H@ +WERROR_CFLAGS = @WERROR_CFLAGS@ WINT_T_SUFFIX = @WINT_T_SUFFIX@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ +XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ YACC = @YACC@ YFLAGS = @YFLAGS@ +abs_aux_dir = @abs_aux_dir@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ @@ -975,6 +1389,8 @@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gl_LIBOBJS = @gl_LIBOBJS@ gl_LTLIBOBJS = @gl_LTLIBOBJS@ +gltests_LIBOBJS = @gltests_LIBOBJS@ +gltests_LTLIBOBJS = @gltests_LTLIBOBJS@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ @@ -1000,39 +1416,81 @@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -bin_SCRIPTS = groups + +# These are the names of programs that are not installed by default. +# This list is *not* intended for programs like who, nice, chroot, etc., +# that are built only when certain requisite system features are detected. +# Hence, if you want to install programs from this list anyway, say A and B, +# use --enable-install-program=A,B +no_install__progs = \ + arch hostname su + +build_if_possible__progs = \ + chroot df hostid nice pinky stty su uname uptime users who + +AM_CFLAGS = $(WARN_CFLAGS) $(WERROR_CFLAGS) +bin_PROGRAMS = $(OPTIONAL_BIN_PROGS) noinst_HEADERS = \ chown-core.h \ copy.h \ cp-hash.h \ dircolors.h \ fs.h \ + group-list.h \ ls.h \ + operand2sig.h \ + prog-fprintf.h \ remove.h \ system.h \ wheel-size.h \ - wheel.h + wheel.h \ + uname.h EXTRA_DIST = dcgen dircolors.hin tac-pipe.c \ - groups.sh wheel-gen.pl extract-magic c99-to-c89.diff + wheel-gen.pl extract-magic c99-to-c89.diff -BUILT_SOURCES = dircolors.h wheel-size.h wheel.h fs.h -CLEANFILES = $(SCRIPTS) su +BUILT_SOURCES = dircolors.h wheel-size.h wheel.h fs.h version.c \ + version.h + +# Also remove these sometimes-built programs. +# For example, even when excluded, they're built via check-AUTHORS. +CLEANFILES = $(SCRIPTS) su $(no_install__progs) AM_CPPFLAGS = -I$(top_srcdir)/lib +noinst_LIBRARIES = libver.a +nodist_libver_a_SOURCES = version.c version.h # Sometimes, the expansion of $(LIBINTL) includes -lc which may # include modules defining variables like `optind', so libcoreutils.a # must precede $(LIBINTL) in order to ensure we use GNU getopt. # But libcoreutils.a must also follow $(LIBINTL), since libintl uses # replacement functions defined in libcoreutils.a. -LDADD = ../lib/libcoreutils.a $(LIBINTL) ../lib/libcoreutils.a +LDADD = libver.a ../lib/libcoreutils.a $(LIBINTL) ../lib/libcoreutils.a + +# Append $(LIBICONV) to each program that uses proper_name_utf8. +cat_LDADD = $(LDADD) $(LIBICONV) +df_LDADD = $(LDADD) $(LIBICONV) +du_LDADD = $(LDADD) $(LIBICONV) +getlimits_LDADD = $(LDADD) $(LIBICONV) +ptx_LDADD = $(LDADD) $(LIBICONV) +split_LDADD = $(LDADD) $(LIBICONV) +timeout_LDADD = $(LDADD) $(LIBICONV) +truncate_LDADD = $(LDADD) $(LIBICONV) # for eaccess in lib/euidaccess.c. -cp_LDADD = $(LDADD) $(LIB_EACCESS) $(LIB_ACL) -ginstall_LDADD = $(LDADD) $(LIB_EACCESS) $(LIB_ACL) -mv_LDADD = $(LDADD) $(LIB_EACCESS) $(LIB_ACL) +chcon_LDADD = $(LDADD) $(LIB_SELINUX) +cp_LDADD = $(LDADD) $(LIB_EACCESS) $(LIB_SELINUX) $(LIB_ACL) \ + $(LIB_XATTR) $(LIBICONV) +ginstall_LDADD = $(LDADD) $(LIB_EACCESS) $(LIB_SELINUX) $(LIB_ACL) \ + $(LIB_XATTR) +mkdir_LDADD = $(LDADD) $(LIB_SELINUX) +mkfifo_LDADD = $(LDADD) $(LIB_SELINUX) +mknod_LDADD = $(LDADD) $(LIB_SELINUX) +mv_LDADD = $(LDADD) $(LIB_EACCESS) $(LIB_SELINUX) $(LIB_ACL) \ + $(LIB_XATTR) +runcon_LDADD = $(LDADD) $(LIB_SELINUX) pathchk_LDADD = $(LDADD) $(LIB_EACCESS) rm_LDADD = $(LDADD) $(LIB_EACCESS) test_LDADD = $(LDADD) $(LIB_EACCESS) @@ -1041,13 +1499,17 @@ __LDADD = $(LDADD) $(LIB_EACCESS) # for clock_gettime and fdatasync dd_LDADD = $(LDADD) $(LIB_GETHRXTIME) $(LIB_FDATASYNC) -dir_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME) $(LIB_ACL_TRIVIAL) \ +dir_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME) $(LIB_SELINUX) $(LIB_CAP) \ $(LIB_ACL) -ls_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME) $(LIB_ACL_TRIVIAL) $(LIB_ACL) +id_LDADD = $(LDADD) $(LIB_SELINUX) +ls_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME) $(LIB_SELINUX) $(LIB_CAP) \ + $(LIB_ACL) +mktemp_LDADD = $(LDADD) $(LIB_GETHRXTIME) pr_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME) shred_LDADD = $(LDADD) $(LIB_GETHRXTIME) $(LIB_FDATASYNC) shuf_LDADD = $(LDADD) $(LIB_GETHRXTIME) -vdir_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME) $(LIB_ACL_TRIVIAL) \ +tac_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME) +vdir_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME) $(LIB_SELINUX) $(LIB_CAP) \ $(LIB_ACL) sort_LDADD = $(LDADD) $(POW_LIB) $(LIB_GETHRXTIME) @@ -1065,13 +1527,23 @@ seq_LDADD = $(LDADD) $(POW_LIB) # If necessary, add libraries to resolve the `pow' reference in lib/strtod.c # and the `nanosleep' reference in lib/xnanosleep.c. nanosec_libs = $(LDADD) $(POW_LIB) $(LIB_NANOSLEEP) + +# for various GMP functions +expr_LDADD = $(LDADD) $(LIB_GMP) + +# for various GMP functions +factor_LDADD = $(LDADD) $(LIB_GMP) sleep_LDADD = $(nanosec_libs) tail_LDADD = $(nanosec_libs) # If necessary, add -lm to resolve use of pow in lib/strtod.c. uptime_LDADD = $(LDADD) $(POW_LIB) $(GETLOADAVG_LIBS) su_LDADD = $(LDADD) $(LIB_CRYPT) -SUFFIXES = .sh +stat_LDADD = $(LDADD) $(LIB_SELINUX) + +# programs that use getaddrinfo (e.g., via canon_host) +pinky_LDADD = $(LDADD) $(GETADDRINFO_LIB) +who_LDADD = $(LDADD) $(GETADDRINFO_LIB) # Get the release year from ../lib/version-etc.c. RELEASE_YEAR = \ @@ -1080,27 +1552,41 @@ RELEASE_YEAR = \ installed_su = $(DESTDIR)$(bindir)/`echo su|sed '$(transform)'` setuid_root_mode = a=rx,u+s -INSTALL_SU = \ - p=su; \ - echo " $(INSTALL_PROGRAM) $$p $(installed_su)"; \ - $(INSTALL_PROGRAM) $$p $(installed_su); \ - echo " chown root $(installed_su)"; \ - chown root $(installed_su); \ - echo " chmod $(setuid_root_mode) $(installed_su)"; \ - chmod $(setuid_root_mode) $(installed_su) +install_su = \ + if test "$(INSTALL_SU)" = yes; then \ + p=su; \ + echo " $(INSTALL_PROGRAM) $$p $(installed_su)"; \ + $(INSTALL_PROGRAM) $$p $(installed_su); \ + echo " chown root $(installed_su)"; \ + chown root $(installed_su); \ + echo " chmod $(setuid_root_mode) $(installed_su)"; \ + chmod $(setuid_root_mode) $(installed_su); \ + else \ + :; \ + fi -ginstall_SOURCES = install.c copy.c cp-hash.c +copy_sources = copy.c cp-hash.c +ginstall_SOURCES = install.c prog-fprintf.c $(copy_sources) # This is for the '[' program. Automake transliterates '[' to '_'. __SOURCES = lbracket.c -cp_SOURCES = cp.c copy.c cp-hash.c +cp_SOURCES = cp.c $(copy_sources) dir_SOURCES = ls.c ls-dir.c vdir_SOURCES = ls.c ls-vdir.c +id_SOURCES = id.c group-list.c +groups_SOURCES = groups.c group-list.c +ln_SOURCES = ln.c ls_SOURCES = ls.c ls-ls.c chown_SOURCES = chown.c chown-core.c chgrp_SOURCES = chgrp.c chown-core.c -mv_SOURCES = mv.c copy.c cp-hash.c remove.c +kill_SOURCES = kill.c operand2sig.c +timeout_SOURCES = timeout.c operand2sig.c +mv_SOURCES = mv.c remove.c $(copy_sources) rm_SOURCES = rm.c remove.c +mkdir_SOURCES = mkdir.c prog-fprintf.c +rmdir_SOURCES = rmdir.c prog-fprintf.c +uname_SOURCES = uname.c uname-uname.c +arch_SOURCES = uname.c uname-arch.c md5sum_SOURCES = md5sum.c md5sum_CPPFLAGS = -DHASH_ALGO_MD5=1 $(AM_CPPFLAGS) sha1sum_SOURCES = md5sum.c @@ -1113,6 +1599,7 @@ sha384sum_SOURCES = md5sum.c sha384sum_CPPFLAGS = -DHASH_ALGO_SHA384=1 $(AM_CPPFLAGS) sha512sum_SOURCES = md5sum.c sha512sum_CPPFLAGS = -DHASH_ALGO_SHA512=1 $(AM_CPPFLAGS) +ginstall_CPPFLAGS = -DENABLE_MATCHPATHCON=1 $(AM_CPPFLAGS) editpl = sed -e 's,@''PERL''@,$(PERL),g' wheel_size = 5 @@ -1120,6 +1607,7 @@ wheel_size = 5 # test doesn't support --help or --version. # Tell automake to exempt then from that installcheck test. AM_INSTALLCHECK_STD_OPTIONS_EXEMPT = false test +DISTCLEANFILES = version.c version.h MAINTAINERCLEANFILES = $(BUILT_SOURCES) # Sort in traditional ASCII order, regardless of the current locale; @@ -1135,32 +1623,31 @@ pm = progs-makefile pr = progs-readme # Ensure that the list of programs and author names is accurate. +# We need a UTF8 locale. If a lack of locale support or a missing +# translation inhibits printing of UTF-8 names, just skip this test. au_dotdot = authors-dotdot au_actual = authors-actual +@CROSS_COMPILING_FALSE@cu_install_program = ./ginstall -# Extract the list of authors from each file. -sed_filter = s/^ *//;s/N_ (//;s/^"//;s/")*$$// -# Sometimes the string is on the same line as the #define... -s1 = '/^\#define AUTHORS \([^\\]\)/{;s//\1/;$(sed_filter);p;q;}' -# Sometimes the string is on the backslash-continued line after the #define. -s2 = '/^\#define AUTHORS \\\\/{;n;$(sed_filter);p;q;}' +# Use the just-built ./ginstall, when not cross-compiling. +@CROSS_COMPILING_TRUE@cu_install_program = @INSTALL_PROGRAM@ all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: -.SUFFIXES: .sh .c .o .obj +.SUFFIXES: .c .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu src/Makefile + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu src/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ @@ -1178,26 +1665,48 @@ $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-noinstLIBRARIES: + -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) +libver.a: $(libver_a_OBJECTS) $(libver_a_DEPENDENCIES) + $(AM_V_at)-rm -f libver.a + $(AM_V_AR)$(libver_a_AR) libver.a $(libver_a_OBJECTS) $(libver_a_LIBADD) + $(AM_V_at)$(RANLIB) libver.a install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" - @list='$(bin_PROGRAMS)'; for p in $$list; do \ - p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ - if test -f $$p \ - ; then \ - f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ - echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ - $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ - else :; fi; \ - done + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + for p in $$list; do echo "$$p $$p"; done | \ + sed 's/$(EXEEXT)$$//' | \ + while read p p1; do if test -f $$p; \ + then echo "$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ + -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ + sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) files[d] = files[d] " " $$1; \ + else { print "f", $$3 "/" $$4, $$1; } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ + $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ + } \ + ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) - @list='$(bin_PROGRAMS)'; for p in $$list; do \ - f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ - echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ - rm -f "$(DESTDIR)$(bindir)/$$f"; \ - done + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ + -e 's/$$/$(EXEEXT)/' `; \ + test -n "$$list" || exit 0; \ + echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) > /dev/null 2>&1 || /bin/rm -f $(bin_PROGRAMS) @@ -1206,311 +1715,316 @@ clean-noinstPROGRAMS: -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS) [$(EXEEXT): $(__OBJECTS) $(__DEPENDENCIES) @rm -f [$(EXEEXT) - $(LINK) $(__OBJECTS) $(__LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(__OBJECTS) $(__LDADD) $(LIBS) +arch$(EXEEXT): $(arch_OBJECTS) $(arch_DEPENDENCIES) + @rm -f arch$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(arch_OBJECTS) $(arch_LDADD) $(LIBS) base64$(EXEEXT): $(base64_OBJECTS) $(base64_DEPENDENCIES) @rm -f base64$(EXEEXT) - $(LINK) $(base64_OBJECTS) $(base64_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(base64_OBJECTS) $(base64_LDADD) $(LIBS) basename$(EXEEXT): $(basename_OBJECTS) $(basename_DEPENDENCIES) @rm -f basename$(EXEEXT) - $(LINK) $(basename_OBJECTS) $(basename_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(basename_OBJECTS) $(basename_LDADD) $(LIBS) cat$(EXEEXT): $(cat_OBJECTS) $(cat_DEPENDENCIES) @rm -f cat$(EXEEXT) - $(LINK) $(cat_OBJECTS) $(cat_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(cat_OBJECTS) $(cat_LDADD) $(LIBS) +chcon$(EXEEXT): $(chcon_OBJECTS) $(chcon_DEPENDENCIES) + @rm -f chcon$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(chcon_OBJECTS) $(chcon_LDADD) $(LIBS) chgrp$(EXEEXT): $(chgrp_OBJECTS) $(chgrp_DEPENDENCIES) @rm -f chgrp$(EXEEXT) - $(LINK) $(chgrp_OBJECTS) $(chgrp_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(chgrp_OBJECTS) $(chgrp_LDADD) $(LIBS) chmod$(EXEEXT): $(chmod_OBJECTS) $(chmod_DEPENDENCIES) @rm -f chmod$(EXEEXT) - $(LINK) $(chmod_OBJECTS) $(chmod_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(chmod_OBJECTS) $(chmod_LDADD) $(LIBS) chown$(EXEEXT): $(chown_OBJECTS) $(chown_DEPENDENCIES) @rm -f chown$(EXEEXT) - $(LINK) $(chown_OBJECTS) $(chown_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(chown_OBJECTS) $(chown_LDADD) $(LIBS) chroot$(EXEEXT): $(chroot_OBJECTS) $(chroot_DEPENDENCIES) @rm -f chroot$(EXEEXT) - $(LINK) $(chroot_OBJECTS) $(chroot_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(chroot_OBJECTS) $(chroot_LDADD) $(LIBS) cksum$(EXEEXT): $(cksum_OBJECTS) $(cksum_DEPENDENCIES) @rm -f cksum$(EXEEXT) - $(LINK) $(cksum_OBJECTS) $(cksum_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(cksum_OBJECTS) $(cksum_LDADD) $(LIBS) comm$(EXEEXT): $(comm_OBJECTS) $(comm_DEPENDENCIES) @rm -f comm$(EXEEXT) - $(LINK) $(comm_OBJECTS) $(comm_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(comm_OBJECTS) $(comm_LDADD) $(LIBS) cp$(EXEEXT): $(cp_OBJECTS) $(cp_DEPENDENCIES) @rm -f cp$(EXEEXT) - $(LINK) $(cp_OBJECTS) $(cp_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(cp_OBJECTS) $(cp_LDADD) $(LIBS) csplit$(EXEEXT): $(csplit_OBJECTS) $(csplit_DEPENDENCIES) @rm -f csplit$(EXEEXT) - $(LINK) $(csplit_OBJECTS) $(csplit_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(csplit_OBJECTS) $(csplit_LDADD) $(LIBS) cut$(EXEEXT): $(cut_OBJECTS) $(cut_DEPENDENCIES) @rm -f cut$(EXEEXT) - $(LINK) $(cut_OBJECTS) $(cut_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(cut_OBJECTS) $(cut_LDADD) $(LIBS) date$(EXEEXT): $(date_OBJECTS) $(date_DEPENDENCIES) @rm -f date$(EXEEXT) - $(LINK) $(date_OBJECTS) $(date_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(date_OBJECTS) $(date_LDADD) $(LIBS) dd$(EXEEXT): $(dd_OBJECTS) $(dd_DEPENDENCIES) @rm -f dd$(EXEEXT) - $(LINK) $(dd_OBJECTS) $(dd_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(dd_OBJECTS) $(dd_LDADD) $(LIBS) df$(EXEEXT): $(df_OBJECTS) $(df_DEPENDENCIES) @rm -f df$(EXEEXT) - $(LINK) $(df_OBJECTS) $(df_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(df_OBJECTS) $(df_LDADD) $(LIBS) dir$(EXEEXT): $(dir_OBJECTS) $(dir_DEPENDENCIES) @rm -f dir$(EXEEXT) - $(LINK) $(dir_OBJECTS) $(dir_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(dir_OBJECTS) $(dir_LDADD) $(LIBS) dircolors$(EXEEXT): $(dircolors_OBJECTS) $(dircolors_DEPENDENCIES) @rm -f dircolors$(EXEEXT) - $(LINK) $(dircolors_OBJECTS) $(dircolors_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(dircolors_OBJECTS) $(dircolors_LDADD) $(LIBS) dirname$(EXEEXT): $(dirname_OBJECTS) $(dirname_DEPENDENCIES) @rm -f dirname$(EXEEXT) - $(LINK) $(dirname_OBJECTS) $(dirname_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(dirname_OBJECTS) $(dirname_LDADD) $(LIBS) du$(EXEEXT): $(du_OBJECTS) $(du_DEPENDENCIES) @rm -f du$(EXEEXT) - $(LINK) $(du_OBJECTS) $(du_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(du_OBJECTS) $(du_LDADD) $(LIBS) echo$(EXEEXT): $(echo_OBJECTS) $(echo_DEPENDENCIES) @rm -f echo$(EXEEXT) - $(LINK) $(echo_OBJECTS) $(echo_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(echo_OBJECTS) $(echo_LDADD) $(LIBS) env$(EXEEXT): $(env_OBJECTS) $(env_DEPENDENCIES) @rm -f env$(EXEEXT) - $(LINK) $(env_OBJECTS) $(env_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(env_OBJECTS) $(env_LDADD) $(LIBS) expand$(EXEEXT): $(expand_OBJECTS) $(expand_DEPENDENCIES) @rm -f expand$(EXEEXT) - $(LINK) $(expand_OBJECTS) $(expand_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(expand_OBJECTS) $(expand_LDADD) $(LIBS) expr$(EXEEXT): $(expr_OBJECTS) $(expr_DEPENDENCIES) @rm -f expr$(EXEEXT) - $(LINK) $(expr_OBJECTS) $(expr_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(expr_OBJECTS) $(expr_LDADD) $(LIBS) factor$(EXEEXT): $(factor_OBJECTS) $(factor_DEPENDENCIES) @rm -f factor$(EXEEXT) - $(LINK) $(factor_OBJECTS) $(factor_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(factor_OBJECTS) $(factor_LDADD) $(LIBS) false$(EXEEXT): $(false_OBJECTS) $(false_DEPENDENCIES) @rm -f false$(EXEEXT) - $(LINK) $(false_OBJECTS) $(false_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(false_OBJECTS) $(false_LDADD) $(LIBS) fmt$(EXEEXT): $(fmt_OBJECTS) $(fmt_DEPENDENCIES) @rm -f fmt$(EXEEXT) - $(LINK) $(fmt_OBJECTS) $(fmt_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(fmt_OBJECTS) $(fmt_LDADD) $(LIBS) fold$(EXEEXT): $(fold_OBJECTS) $(fold_DEPENDENCIES) @rm -f fold$(EXEEXT) - $(LINK) $(fold_OBJECTS) $(fold_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(fold_OBJECTS) $(fold_LDADD) $(LIBS) +getlimits$(EXEEXT): $(getlimits_OBJECTS) $(getlimits_DEPENDENCIES) + @rm -f getlimits$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(getlimits_OBJECTS) $(getlimits_LDADD) $(LIBS) ginstall$(EXEEXT): $(ginstall_OBJECTS) $(ginstall_DEPENDENCIES) @rm -f ginstall$(EXEEXT) - $(LINK) $(ginstall_OBJECTS) $(ginstall_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(ginstall_OBJECTS) $(ginstall_LDADD) $(LIBS) +groups$(EXEEXT): $(groups_OBJECTS) $(groups_DEPENDENCIES) + @rm -f groups$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(groups_OBJECTS) $(groups_LDADD) $(LIBS) head$(EXEEXT): $(head_OBJECTS) $(head_DEPENDENCIES) @rm -f head$(EXEEXT) - $(LINK) $(head_OBJECTS) $(head_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(head_OBJECTS) $(head_LDADD) $(LIBS) hostid$(EXEEXT): $(hostid_OBJECTS) $(hostid_DEPENDENCIES) @rm -f hostid$(EXEEXT) - $(LINK) $(hostid_OBJECTS) $(hostid_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(hostid_OBJECTS) $(hostid_LDADD) $(LIBS) hostname$(EXEEXT): $(hostname_OBJECTS) $(hostname_DEPENDENCIES) @rm -f hostname$(EXEEXT) - $(LINK) $(hostname_OBJECTS) $(hostname_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(hostname_OBJECTS) $(hostname_LDADD) $(LIBS) id$(EXEEXT): $(id_OBJECTS) $(id_DEPENDENCIES) @rm -f id$(EXEEXT) - $(LINK) $(id_OBJECTS) $(id_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(id_OBJECTS) $(id_LDADD) $(LIBS) join$(EXEEXT): $(join_OBJECTS) $(join_DEPENDENCIES) @rm -f join$(EXEEXT) - $(LINK) $(join_OBJECTS) $(join_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(join_OBJECTS) $(join_LDADD) $(LIBS) kill$(EXEEXT): $(kill_OBJECTS) $(kill_DEPENDENCIES) @rm -f kill$(EXEEXT) - $(LINK) $(kill_OBJECTS) $(kill_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(kill_OBJECTS) $(kill_LDADD) $(LIBS) link$(EXEEXT): $(link_OBJECTS) $(link_DEPENDENCIES) @rm -f link$(EXEEXT) - $(LINK) $(link_OBJECTS) $(link_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(link_OBJECTS) $(link_LDADD) $(LIBS) ln$(EXEEXT): $(ln_OBJECTS) $(ln_DEPENDENCIES) @rm -f ln$(EXEEXT) - $(LINK) $(ln_OBJECTS) $(ln_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(ln_OBJECTS) $(ln_LDADD) $(LIBS) logname$(EXEEXT): $(logname_OBJECTS) $(logname_DEPENDENCIES) @rm -f logname$(EXEEXT) - $(LINK) $(logname_OBJECTS) $(logname_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(logname_OBJECTS) $(logname_LDADD) $(LIBS) ls$(EXEEXT): $(ls_OBJECTS) $(ls_DEPENDENCIES) @rm -f ls$(EXEEXT) - $(LINK) $(ls_OBJECTS) $(ls_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(ls_OBJECTS) $(ls_LDADD) $(LIBS) md5sum$(EXEEXT): $(md5sum_OBJECTS) $(md5sum_DEPENDENCIES) @rm -f md5sum$(EXEEXT) - $(LINK) $(md5sum_OBJECTS) $(md5sum_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(md5sum_OBJECTS) $(md5sum_LDADD) $(LIBS) mkdir$(EXEEXT): $(mkdir_OBJECTS) $(mkdir_DEPENDENCIES) @rm -f mkdir$(EXEEXT) - $(LINK) $(mkdir_OBJECTS) $(mkdir_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(mkdir_OBJECTS) $(mkdir_LDADD) $(LIBS) mkfifo$(EXEEXT): $(mkfifo_OBJECTS) $(mkfifo_DEPENDENCIES) @rm -f mkfifo$(EXEEXT) - $(LINK) $(mkfifo_OBJECTS) $(mkfifo_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(mkfifo_OBJECTS) $(mkfifo_LDADD) $(LIBS) mknod$(EXEEXT): $(mknod_OBJECTS) $(mknod_DEPENDENCIES) @rm -f mknod$(EXEEXT) - $(LINK) $(mknod_OBJECTS) $(mknod_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(mknod_OBJECTS) $(mknod_LDADD) $(LIBS) +mktemp$(EXEEXT): $(mktemp_OBJECTS) $(mktemp_DEPENDENCIES) + @rm -f mktemp$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mktemp_OBJECTS) $(mktemp_LDADD) $(LIBS) mv$(EXEEXT): $(mv_OBJECTS) $(mv_DEPENDENCIES) @rm -f mv$(EXEEXT) - $(LINK) $(mv_OBJECTS) $(mv_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(mv_OBJECTS) $(mv_LDADD) $(LIBS) nice$(EXEEXT): $(nice_OBJECTS) $(nice_DEPENDENCIES) @rm -f nice$(EXEEXT) - $(LINK) $(nice_OBJECTS) $(nice_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(nice_OBJECTS) $(nice_LDADD) $(LIBS) nl$(EXEEXT): $(nl_OBJECTS) $(nl_DEPENDENCIES) @rm -f nl$(EXEEXT) - $(LINK) $(nl_OBJECTS) $(nl_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(nl_OBJECTS) $(nl_LDADD) $(LIBS) nohup$(EXEEXT): $(nohup_OBJECTS) $(nohup_DEPENDENCIES) @rm -f nohup$(EXEEXT) - $(LINK) $(nohup_OBJECTS) $(nohup_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(nohup_OBJECTS) $(nohup_LDADD) $(LIBS) od$(EXEEXT): $(od_OBJECTS) $(od_DEPENDENCIES) @rm -f od$(EXEEXT) - $(LINK) $(od_OBJECTS) $(od_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(od_OBJECTS) $(od_LDADD) $(LIBS) paste$(EXEEXT): $(paste_OBJECTS) $(paste_DEPENDENCIES) @rm -f paste$(EXEEXT) - $(LINK) $(paste_OBJECTS) $(paste_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(paste_OBJECTS) $(paste_LDADD) $(LIBS) pathchk$(EXEEXT): $(pathchk_OBJECTS) $(pathchk_DEPENDENCIES) @rm -f pathchk$(EXEEXT) - $(LINK) $(pathchk_OBJECTS) $(pathchk_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(pathchk_OBJECTS) $(pathchk_LDADD) $(LIBS) pinky$(EXEEXT): $(pinky_OBJECTS) $(pinky_DEPENDENCIES) @rm -f pinky$(EXEEXT) - $(LINK) $(pinky_OBJECTS) $(pinky_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(pinky_OBJECTS) $(pinky_LDADD) $(LIBS) pr$(EXEEXT): $(pr_OBJECTS) $(pr_DEPENDENCIES) @rm -f pr$(EXEEXT) - $(LINK) $(pr_OBJECTS) $(pr_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(pr_OBJECTS) $(pr_LDADD) $(LIBS) printenv$(EXEEXT): $(printenv_OBJECTS) $(printenv_DEPENDENCIES) @rm -f printenv$(EXEEXT) - $(LINK) $(printenv_OBJECTS) $(printenv_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(printenv_OBJECTS) $(printenv_LDADD) $(LIBS) printf$(EXEEXT): $(printf_OBJECTS) $(printf_DEPENDENCIES) @rm -f printf$(EXEEXT) - $(LINK) $(printf_OBJECTS) $(printf_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(printf_OBJECTS) $(printf_LDADD) $(LIBS) ptx$(EXEEXT): $(ptx_OBJECTS) $(ptx_DEPENDENCIES) @rm -f ptx$(EXEEXT) - $(LINK) $(ptx_OBJECTS) $(ptx_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(ptx_OBJECTS) $(ptx_LDADD) $(LIBS) pwd$(EXEEXT): $(pwd_OBJECTS) $(pwd_DEPENDENCIES) @rm -f pwd$(EXEEXT) - $(LINK) $(pwd_OBJECTS) $(pwd_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(pwd_OBJECTS) $(pwd_LDADD) $(LIBS) readlink$(EXEEXT): $(readlink_OBJECTS) $(readlink_DEPENDENCIES) @rm -f readlink$(EXEEXT) - $(LINK) $(readlink_OBJECTS) $(readlink_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(readlink_OBJECTS) $(readlink_LDADD) $(LIBS) rm$(EXEEXT): $(rm_OBJECTS) $(rm_DEPENDENCIES) - @rm -f rm$(EXEEXT) - $(LINK) $(rm_OBJECTS) $(rm_LDADD) $(LIBS) + @rm -f rm > /dev/null 2>&1 || /bin/rm -f rm$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(rm_OBJECTS) $(rm_LDADD) $(LIBS) rmdir$(EXEEXT): $(rmdir_OBJECTS) $(rmdir_DEPENDENCIES) @rm -f rmdir$(EXEEXT) - $(LINK) $(rmdir_OBJECTS) $(rmdir_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(rmdir_OBJECTS) $(rmdir_LDADD) $(LIBS) +runcon$(EXEEXT): $(runcon_OBJECTS) $(runcon_DEPENDENCIES) + @rm -f runcon$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(runcon_OBJECTS) $(runcon_LDADD) $(LIBS) seq$(EXEEXT): $(seq_OBJECTS) $(seq_DEPENDENCIES) @rm -f seq$(EXEEXT) - $(LINK) $(seq_OBJECTS) $(seq_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(seq_OBJECTS) $(seq_LDADD) $(LIBS) setuidgid$(EXEEXT): $(setuidgid_OBJECTS) $(setuidgid_DEPENDENCIES) @rm -f setuidgid$(EXEEXT) - $(LINK) $(setuidgid_OBJECTS) $(setuidgid_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(setuidgid_OBJECTS) $(setuidgid_LDADD) $(LIBS) sha1sum$(EXEEXT): $(sha1sum_OBJECTS) $(sha1sum_DEPENDENCIES) @rm -f sha1sum$(EXEEXT) - $(LINK) $(sha1sum_OBJECTS) $(sha1sum_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(sha1sum_OBJECTS) $(sha1sum_LDADD) $(LIBS) sha224sum$(EXEEXT): $(sha224sum_OBJECTS) $(sha224sum_DEPENDENCIES) @rm -f sha224sum$(EXEEXT) - $(LINK) $(sha224sum_OBJECTS) $(sha224sum_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(sha224sum_OBJECTS) $(sha224sum_LDADD) $(LIBS) sha256sum$(EXEEXT): $(sha256sum_OBJECTS) $(sha256sum_DEPENDENCIES) @rm -f sha256sum$(EXEEXT) - $(LINK) $(sha256sum_OBJECTS) $(sha256sum_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(sha256sum_OBJECTS) $(sha256sum_LDADD) $(LIBS) sha384sum$(EXEEXT): $(sha384sum_OBJECTS) $(sha384sum_DEPENDENCIES) @rm -f sha384sum$(EXEEXT) - $(LINK) $(sha384sum_OBJECTS) $(sha384sum_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(sha384sum_OBJECTS) $(sha384sum_LDADD) $(LIBS) sha512sum$(EXEEXT): $(sha512sum_OBJECTS) $(sha512sum_DEPENDENCIES) @rm -f sha512sum$(EXEEXT) - $(LINK) $(sha512sum_OBJECTS) $(sha512sum_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(sha512sum_OBJECTS) $(sha512sum_LDADD) $(LIBS) shred$(EXEEXT): $(shred_OBJECTS) $(shred_DEPENDENCIES) @rm -f shred$(EXEEXT) - $(LINK) $(shred_OBJECTS) $(shred_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(shred_OBJECTS) $(shred_LDADD) $(LIBS) shuf$(EXEEXT): $(shuf_OBJECTS) $(shuf_DEPENDENCIES) @rm -f shuf$(EXEEXT) - $(LINK) $(shuf_OBJECTS) $(shuf_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(shuf_OBJECTS) $(shuf_LDADD) $(LIBS) sleep$(EXEEXT): $(sleep_OBJECTS) $(sleep_DEPENDENCIES) @rm -f sleep$(EXEEXT) - $(LINK) $(sleep_OBJECTS) $(sleep_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(sleep_OBJECTS) $(sleep_LDADD) $(LIBS) sort$(EXEEXT): $(sort_OBJECTS) $(sort_DEPENDENCIES) @rm -f sort$(EXEEXT) - $(LINK) $(sort_OBJECTS) $(sort_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(sort_OBJECTS) $(sort_LDADD) $(LIBS) split$(EXEEXT): $(split_OBJECTS) $(split_DEPENDENCIES) @rm -f split$(EXEEXT) - $(LINK) $(split_OBJECTS) $(split_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(split_OBJECTS) $(split_LDADD) $(LIBS) stat$(EXEEXT): $(stat_OBJECTS) $(stat_DEPENDENCIES) @rm -f stat$(EXEEXT) - $(LINK) $(stat_OBJECTS) $(stat_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(stat_OBJECTS) $(stat_LDADD) $(LIBS) stty$(EXEEXT): $(stty_OBJECTS) $(stty_DEPENDENCIES) @rm -f stty$(EXEEXT) - $(LINK) $(stty_OBJECTS) $(stty_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(stty_OBJECTS) $(stty_LDADD) $(LIBS) su$(EXEEXT): $(su_OBJECTS) $(su_DEPENDENCIES) @rm -f su$(EXEEXT) - $(LINK) $(su_OBJECTS) $(su_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(su_OBJECTS) $(su_LDADD) $(LIBS) sum$(EXEEXT): $(sum_OBJECTS) $(sum_DEPENDENCIES) @rm -f sum$(EXEEXT) - $(LINK) $(sum_OBJECTS) $(sum_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(sum_OBJECTS) $(sum_LDADD) $(LIBS) sync$(EXEEXT): $(sync_OBJECTS) $(sync_DEPENDENCIES) @rm -f sync$(EXEEXT) - $(LINK) $(sync_OBJECTS) $(sync_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(sync_OBJECTS) $(sync_LDADD) $(LIBS) tac$(EXEEXT): $(tac_OBJECTS) $(tac_DEPENDENCIES) @rm -f tac$(EXEEXT) - $(LINK) $(tac_OBJECTS) $(tac_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(tac_OBJECTS) $(tac_LDADD) $(LIBS) tail$(EXEEXT): $(tail_OBJECTS) $(tail_DEPENDENCIES) @rm -f tail$(EXEEXT) - $(LINK) $(tail_OBJECTS) $(tail_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(tail_OBJECTS) $(tail_LDADD) $(LIBS) tee$(EXEEXT): $(tee_OBJECTS) $(tee_DEPENDENCIES) @rm -f tee$(EXEEXT) - $(LINK) $(tee_OBJECTS) $(tee_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(tee_OBJECTS) $(tee_LDADD) $(LIBS) test$(EXEEXT): $(test_OBJECTS) $(test_DEPENDENCIES) @rm -f test$(EXEEXT) - $(LINK) $(test_OBJECTS) $(test_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(test_OBJECTS) $(test_LDADD) $(LIBS) +timeout$(EXEEXT): $(timeout_OBJECTS) $(timeout_DEPENDENCIES) + @rm -f timeout$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(timeout_OBJECTS) $(timeout_LDADD) $(LIBS) touch$(EXEEXT): $(touch_OBJECTS) $(touch_DEPENDENCIES) @rm -f touch$(EXEEXT) - $(LINK) $(touch_OBJECTS) $(touch_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(touch_OBJECTS) $(touch_LDADD) $(LIBS) tr$(EXEEXT): $(tr_OBJECTS) $(tr_DEPENDENCIES) @rm -f tr$(EXEEXT) - $(LINK) $(tr_OBJECTS) $(tr_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(tr_OBJECTS) $(tr_LDADD) $(LIBS) true$(EXEEXT): $(true_OBJECTS) $(true_DEPENDENCIES) @rm -f true$(EXEEXT) - $(LINK) $(true_OBJECTS) $(true_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(true_OBJECTS) $(true_LDADD) $(LIBS) +truncate$(EXEEXT): $(truncate_OBJECTS) $(truncate_DEPENDENCIES) + @rm -f truncate$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(truncate_OBJECTS) $(truncate_LDADD) $(LIBS) tsort$(EXEEXT): $(tsort_OBJECTS) $(tsort_DEPENDENCIES) @rm -f tsort$(EXEEXT) - $(LINK) $(tsort_OBJECTS) $(tsort_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(tsort_OBJECTS) $(tsort_LDADD) $(LIBS) tty$(EXEEXT): $(tty_OBJECTS) $(tty_DEPENDENCIES) @rm -f tty$(EXEEXT) - $(LINK) $(tty_OBJECTS) $(tty_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(tty_OBJECTS) $(tty_LDADD) $(LIBS) uname$(EXEEXT): $(uname_OBJECTS) $(uname_DEPENDENCIES) @rm -f uname$(EXEEXT) - $(LINK) $(uname_OBJECTS) $(uname_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(uname_OBJECTS) $(uname_LDADD) $(LIBS) unexpand$(EXEEXT): $(unexpand_OBJECTS) $(unexpand_DEPENDENCIES) @rm -f unexpand$(EXEEXT) - $(LINK) $(unexpand_OBJECTS) $(unexpand_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(unexpand_OBJECTS) $(unexpand_LDADD) $(LIBS) uniq$(EXEEXT): $(uniq_OBJECTS) $(uniq_DEPENDENCIES) @rm -f uniq$(EXEEXT) - $(LINK) $(uniq_OBJECTS) $(uniq_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(uniq_OBJECTS) $(uniq_LDADD) $(LIBS) unlink$(EXEEXT): $(unlink_OBJECTS) $(unlink_DEPENDENCIES) @rm -f unlink$(EXEEXT) - $(LINK) $(unlink_OBJECTS) $(unlink_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(unlink_OBJECTS) $(unlink_LDADD) $(LIBS) uptime$(EXEEXT): $(uptime_OBJECTS) $(uptime_DEPENDENCIES) @rm -f uptime$(EXEEXT) - $(LINK) $(uptime_OBJECTS) $(uptime_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(uptime_OBJECTS) $(uptime_LDADD) $(LIBS) users$(EXEEXT): $(users_OBJECTS) $(users_DEPENDENCIES) @rm -f users$(EXEEXT) - $(LINK) $(users_OBJECTS) $(users_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(users_OBJECTS) $(users_LDADD) $(LIBS) vdir$(EXEEXT): $(vdir_OBJECTS) $(vdir_DEPENDENCIES) @rm -f vdir$(EXEEXT) - $(LINK) $(vdir_OBJECTS) $(vdir_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(vdir_OBJECTS) $(vdir_LDADD) $(LIBS) wc$(EXEEXT): $(wc_OBJECTS) $(wc_DEPENDENCIES) @rm -f wc$(EXEEXT) - $(LINK) $(wc_OBJECTS) $(wc_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(wc_OBJECTS) $(wc_LDADD) $(LIBS) who$(EXEEXT): $(who_OBJECTS) $(who_DEPENDENCIES) @rm -f who$(EXEEXT) - $(LINK) $(who_OBJECTS) $(who_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(who_OBJECTS) $(who_LDADD) $(LIBS) whoami$(EXEEXT): $(whoami_OBJECTS) $(whoami_DEPENDENCIES) @rm -f whoami$(EXEEXT) - $(LINK) $(whoami_OBJECTS) $(whoami_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(whoami_OBJECTS) $(whoami_LDADD) $(LIBS) yes$(EXEEXT): $(yes_OBJECTS) $(yes_DEPENDENCIES) @rm -f yes$(EXEEXT) - $(LINK) $(yes_OBJECTS) $(yes_LDADD) $(LIBS) -install-binSCRIPTS: $(bin_SCRIPTS) - @$(NORMAL_INSTALL) - test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" - @list='$(bin_SCRIPTS)'; for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - if test -f $$d$$p; then \ - f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ - echo " $(binSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(bindir)/$$f'"; \ - $(binSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(bindir)/$$f"; \ - else :; fi; \ - done - -uninstall-binSCRIPTS: - @$(NORMAL_UNINSTALL) - @list='$(bin_SCRIPTS)'; for p in $$list; do \ - f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ - echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ - rm -f "$(DESTDIR)$(bindir)/$$f"; \ - done + $(AM_V_CCLD)$(LINK) $(yes_OBJECTS) $(yes_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -1521,6 +2035,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/base64.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/basename.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chcon.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chgrp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chmod.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chown-core.Po@am__quote@ @@ -1547,11 +2062,17 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/false.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fmt.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fold.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getlimits.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ginstall-copy.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ginstall-cp-hash.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ginstall-install.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ginstall-prog-fprintf.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/group-list.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/groups.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/head.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hostid.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hostname.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/id.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/install.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/join.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kill.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lbracket.Po@am__quote@ @@ -1566,23 +2087,27 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mkdir.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mkfifo.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mknod.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mktemp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mv.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nice.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nl.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nohup.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/od.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/operand2sig.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/paste.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pathchk.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pinky.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/printenv.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/printf.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prog-fprintf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ptx.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pwd.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readlink.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/remove.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rm.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rmdir.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/runcon.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/seq.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setuidgid.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sha1sum-md5sum.Po@am__quote@ @@ -1604,116 +2129,199 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tail.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tee.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timeout.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/touch.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/true.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/truncate.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tsort.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tty.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uname-arch.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uname-uname.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uname.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unexpand.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uniq.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unlink.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uptime.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/users.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/version.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/who.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/whoami.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/yes.Po@am__quote@ .c.o: -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` +ginstall-install.o: install.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ginstall_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ginstall-install.o -MD -MP -MF $(DEPDIR)/ginstall-install.Tpo -c -o ginstall-install.o `test -f 'install.c' || echo '$(srcdir)/'`install.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ginstall-install.Tpo $(DEPDIR)/ginstall-install.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='install.c' object='ginstall-install.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ginstall_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ginstall-install.o `test -f 'install.c' || echo '$(srcdir)/'`install.c + +ginstall-install.obj: install.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ginstall_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ginstall-install.obj -MD -MP -MF $(DEPDIR)/ginstall-install.Tpo -c -o ginstall-install.obj `if test -f 'install.c'; then $(CYGPATH_W) 'install.c'; else $(CYGPATH_W) '$(srcdir)/install.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ginstall-install.Tpo $(DEPDIR)/ginstall-install.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='install.c' object='ginstall-install.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ginstall_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ginstall-install.obj `if test -f 'install.c'; then $(CYGPATH_W) 'install.c'; else $(CYGPATH_W) '$(srcdir)/install.c'; fi` + +ginstall-prog-fprintf.o: prog-fprintf.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ginstall_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ginstall-prog-fprintf.o -MD -MP -MF $(DEPDIR)/ginstall-prog-fprintf.Tpo -c -o ginstall-prog-fprintf.o `test -f 'prog-fprintf.c' || echo '$(srcdir)/'`prog-fprintf.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ginstall-prog-fprintf.Tpo $(DEPDIR)/ginstall-prog-fprintf.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='prog-fprintf.c' object='ginstall-prog-fprintf.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ginstall_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ginstall-prog-fprintf.o `test -f 'prog-fprintf.c' || echo '$(srcdir)/'`prog-fprintf.c + +ginstall-prog-fprintf.obj: prog-fprintf.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ginstall_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ginstall-prog-fprintf.obj -MD -MP -MF $(DEPDIR)/ginstall-prog-fprintf.Tpo -c -o ginstall-prog-fprintf.obj `if test -f 'prog-fprintf.c'; then $(CYGPATH_W) 'prog-fprintf.c'; else $(CYGPATH_W) '$(srcdir)/prog-fprintf.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ginstall-prog-fprintf.Tpo $(DEPDIR)/ginstall-prog-fprintf.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='prog-fprintf.c' object='ginstall-prog-fprintf.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ginstall_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ginstall-prog-fprintf.obj `if test -f 'prog-fprintf.c'; then $(CYGPATH_W) 'prog-fprintf.c'; else $(CYGPATH_W) '$(srcdir)/prog-fprintf.c'; fi` + +ginstall-copy.o: copy.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ginstall_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ginstall-copy.o -MD -MP -MF $(DEPDIR)/ginstall-copy.Tpo -c -o ginstall-copy.o `test -f 'copy.c' || echo '$(srcdir)/'`copy.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ginstall-copy.Tpo $(DEPDIR)/ginstall-copy.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='copy.c' object='ginstall-copy.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ginstall_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ginstall-copy.o `test -f 'copy.c' || echo '$(srcdir)/'`copy.c + +ginstall-copy.obj: copy.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ginstall_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ginstall-copy.obj -MD -MP -MF $(DEPDIR)/ginstall-copy.Tpo -c -o ginstall-copy.obj `if test -f 'copy.c'; then $(CYGPATH_W) 'copy.c'; else $(CYGPATH_W) '$(srcdir)/copy.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ginstall-copy.Tpo $(DEPDIR)/ginstall-copy.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='copy.c' object='ginstall-copy.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ginstall_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ginstall-copy.obj `if test -f 'copy.c'; then $(CYGPATH_W) 'copy.c'; else $(CYGPATH_W) '$(srcdir)/copy.c'; fi` + +ginstall-cp-hash.o: cp-hash.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ginstall_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ginstall-cp-hash.o -MD -MP -MF $(DEPDIR)/ginstall-cp-hash.Tpo -c -o ginstall-cp-hash.o `test -f 'cp-hash.c' || echo '$(srcdir)/'`cp-hash.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ginstall-cp-hash.Tpo $(DEPDIR)/ginstall-cp-hash.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cp-hash.c' object='ginstall-cp-hash.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ginstall_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ginstall-cp-hash.o `test -f 'cp-hash.c' || echo '$(srcdir)/'`cp-hash.c + +ginstall-cp-hash.obj: cp-hash.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ginstall_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ginstall-cp-hash.obj -MD -MP -MF $(DEPDIR)/ginstall-cp-hash.Tpo -c -o ginstall-cp-hash.obj `if test -f 'cp-hash.c'; then $(CYGPATH_W) 'cp-hash.c'; else $(CYGPATH_W) '$(srcdir)/cp-hash.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ginstall-cp-hash.Tpo $(DEPDIR)/ginstall-cp-hash.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cp-hash.c' object='ginstall-cp-hash.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ginstall_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ginstall-cp-hash.obj `if test -f 'cp-hash.c'; then $(CYGPATH_W) 'cp-hash.c'; else $(CYGPATH_W) '$(srcdir)/cp-hash.c'; fi` + md5sum-md5sum.o: md5sum.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(md5sum_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT md5sum-md5sum.o -MD -MP -MF $(DEPDIR)/md5sum-md5sum.Tpo -c -o md5sum-md5sum.o `test -f 'md5sum.c' || echo '$(srcdir)/'`md5sum.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/md5sum-md5sum.Tpo $(DEPDIR)/md5sum-md5sum.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(md5sum_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT md5sum-md5sum.o -MD -MP -MF $(DEPDIR)/md5sum-md5sum.Tpo -c -o md5sum-md5sum.o `test -f 'md5sum.c' || echo '$(srcdir)/'`md5sum.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/md5sum-md5sum.Tpo $(DEPDIR)/md5sum-md5sum.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='md5sum.c' object='md5sum-md5sum.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(md5sum_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o md5sum-md5sum.o `test -f 'md5sum.c' || echo '$(srcdir)/'`md5sum.c md5sum-md5sum.obj: md5sum.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(md5sum_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT md5sum-md5sum.obj -MD -MP -MF $(DEPDIR)/md5sum-md5sum.Tpo -c -o md5sum-md5sum.obj `if test -f 'md5sum.c'; then $(CYGPATH_W) 'md5sum.c'; else $(CYGPATH_W) '$(srcdir)/md5sum.c'; fi` -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/md5sum-md5sum.Tpo $(DEPDIR)/md5sum-md5sum.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(md5sum_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT md5sum-md5sum.obj -MD -MP -MF $(DEPDIR)/md5sum-md5sum.Tpo -c -o md5sum-md5sum.obj `if test -f 'md5sum.c'; then $(CYGPATH_W) 'md5sum.c'; else $(CYGPATH_W) '$(srcdir)/md5sum.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/md5sum-md5sum.Tpo $(DEPDIR)/md5sum-md5sum.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='md5sum.c' object='md5sum-md5sum.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(md5sum_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o md5sum-md5sum.obj `if test -f 'md5sum.c'; then $(CYGPATH_W) 'md5sum.c'; else $(CYGPATH_W) '$(srcdir)/md5sum.c'; fi` sha1sum-md5sum.o: md5sum.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sha1sum_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sha1sum-md5sum.o -MD -MP -MF $(DEPDIR)/sha1sum-md5sum.Tpo -c -o sha1sum-md5sum.o `test -f 'md5sum.c' || echo '$(srcdir)/'`md5sum.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/sha1sum-md5sum.Tpo $(DEPDIR)/sha1sum-md5sum.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sha1sum_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sha1sum-md5sum.o -MD -MP -MF $(DEPDIR)/sha1sum-md5sum.Tpo -c -o sha1sum-md5sum.o `test -f 'md5sum.c' || echo '$(srcdir)/'`md5sum.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sha1sum-md5sum.Tpo $(DEPDIR)/sha1sum-md5sum.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='md5sum.c' object='sha1sum-md5sum.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sha1sum_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sha1sum-md5sum.o `test -f 'md5sum.c' || echo '$(srcdir)/'`md5sum.c sha1sum-md5sum.obj: md5sum.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sha1sum_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sha1sum-md5sum.obj -MD -MP -MF $(DEPDIR)/sha1sum-md5sum.Tpo -c -o sha1sum-md5sum.obj `if test -f 'md5sum.c'; then $(CYGPATH_W) 'md5sum.c'; else $(CYGPATH_W) '$(srcdir)/md5sum.c'; fi` -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/sha1sum-md5sum.Tpo $(DEPDIR)/sha1sum-md5sum.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sha1sum_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sha1sum-md5sum.obj -MD -MP -MF $(DEPDIR)/sha1sum-md5sum.Tpo -c -o sha1sum-md5sum.obj `if test -f 'md5sum.c'; then $(CYGPATH_W) 'md5sum.c'; else $(CYGPATH_W) '$(srcdir)/md5sum.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sha1sum-md5sum.Tpo $(DEPDIR)/sha1sum-md5sum.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='md5sum.c' object='sha1sum-md5sum.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sha1sum_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sha1sum-md5sum.obj `if test -f 'md5sum.c'; then $(CYGPATH_W) 'md5sum.c'; else $(CYGPATH_W) '$(srcdir)/md5sum.c'; fi` sha224sum-md5sum.o: md5sum.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sha224sum_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sha224sum-md5sum.o -MD -MP -MF $(DEPDIR)/sha224sum-md5sum.Tpo -c -o sha224sum-md5sum.o `test -f 'md5sum.c' || echo '$(srcdir)/'`md5sum.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/sha224sum-md5sum.Tpo $(DEPDIR)/sha224sum-md5sum.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sha224sum_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sha224sum-md5sum.o -MD -MP -MF $(DEPDIR)/sha224sum-md5sum.Tpo -c -o sha224sum-md5sum.o `test -f 'md5sum.c' || echo '$(srcdir)/'`md5sum.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sha224sum-md5sum.Tpo $(DEPDIR)/sha224sum-md5sum.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='md5sum.c' object='sha224sum-md5sum.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sha224sum_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sha224sum-md5sum.o `test -f 'md5sum.c' || echo '$(srcdir)/'`md5sum.c sha224sum-md5sum.obj: md5sum.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sha224sum_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sha224sum-md5sum.obj -MD -MP -MF $(DEPDIR)/sha224sum-md5sum.Tpo -c -o sha224sum-md5sum.obj `if test -f 'md5sum.c'; then $(CYGPATH_W) 'md5sum.c'; else $(CYGPATH_W) '$(srcdir)/md5sum.c'; fi` -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/sha224sum-md5sum.Tpo $(DEPDIR)/sha224sum-md5sum.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sha224sum_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sha224sum-md5sum.obj -MD -MP -MF $(DEPDIR)/sha224sum-md5sum.Tpo -c -o sha224sum-md5sum.obj `if test -f 'md5sum.c'; then $(CYGPATH_W) 'md5sum.c'; else $(CYGPATH_W) '$(srcdir)/md5sum.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sha224sum-md5sum.Tpo $(DEPDIR)/sha224sum-md5sum.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='md5sum.c' object='sha224sum-md5sum.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sha224sum_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sha224sum-md5sum.obj `if test -f 'md5sum.c'; then $(CYGPATH_W) 'md5sum.c'; else $(CYGPATH_W) '$(srcdir)/md5sum.c'; fi` sha256sum-md5sum.o: md5sum.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sha256sum_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sha256sum-md5sum.o -MD -MP -MF $(DEPDIR)/sha256sum-md5sum.Tpo -c -o sha256sum-md5sum.o `test -f 'md5sum.c' || echo '$(srcdir)/'`md5sum.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/sha256sum-md5sum.Tpo $(DEPDIR)/sha256sum-md5sum.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sha256sum_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sha256sum-md5sum.o -MD -MP -MF $(DEPDIR)/sha256sum-md5sum.Tpo -c -o sha256sum-md5sum.o `test -f 'md5sum.c' || echo '$(srcdir)/'`md5sum.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sha256sum-md5sum.Tpo $(DEPDIR)/sha256sum-md5sum.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='md5sum.c' object='sha256sum-md5sum.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sha256sum_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sha256sum-md5sum.o `test -f 'md5sum.c' || echo '$(srcdir)/'`md5sum.c sha256sum-md5sum.obj: md5sum.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sha256sum_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sha256sum-md5sum.obj -MD -MP -MF $(DEPDIR)/sha256sum-md5sum.Tpo -c -o sha256sum-md5sum.obj `if test -f 'md5sum.c'; then $(CYGPATH_W) 'md5sum.c'; else $(CYGPATH_W) '$(srcdir)/md5sum.c'; fi` -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/sha256sum-md5sum.Tpo $(DEPDIR)/sha256sum-md5sum.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sha256sum_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sha256sum-md5sum.obj -MD -MP -MF $(DEPDIR)/sha256sum-md5sum.Tpo -c -o sha256sum-md5sum.obj `if test -f 'md5sum.c'; then $(CYGPATH_W) 'md5sum.c'; else $(CYGPATH_W) '$(srcdir)/md5sum.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sha256sum-md5sum.Tpo $(DEPDIR)/sha256sum-md5sum.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='md5sum.c' object='sha256sum-md5sum.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sha256sum_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sha256sum-md5sum.obj `if test -f 'md5sum.c'; then $(CYGPATH_W) 'md5sum.c'; else $(CYGPATH_W) '$(srcdir)/md5sum.c'; fi` sha384sum-md5sum.o: md5sum.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sha384sum_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sha384sum-md5sum.o -MD -MP -MF $(DEPDIR)/sha384sum-md5sum.Tpo -c -o sha384sum-md5sum.o `test -f 'md5sum.c' || echo '$(srcdir)/'`md5sum.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/sha384sum-md5sum.Tpo $(DEPDIR)/sha384sum-md5sum.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sha384sum_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sha384sum-md5sum.o -MD -MP -MF $(DEPDIR)/sha384sum-md5sum.Tpo -c -o sha384sum-md5sum.o `test -f 'md5sum.c' || echo '$(srcdir)/'`md5sum.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sha384sum-md5sum.Tpo $(DEPDIR)/sha384sum-md5sum.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='md5sum.c' object='sha384sum-md5sum.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sha384sum_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sha384sum-md5sum.o `test -f 'md5sum.c' || echo '$(srcdir)/'`md5sum.c sha384sum-md5sum.obj: md5sum.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sha384sum_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sha384sum-md5sum.obj -MD -MP -MF $(DEPDIR)/sha384sum-md5sum.Tpo -c -o sha384sum-md5sum.obj `if test -f 'md5sum.c'; then $(CYGPATH_W) 'md5sum.c'; else $(CYGPATH_W) '$(srcdir)/md5sum.c'; fi` -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/sha384sum-md5sum.Tpo $(DEPDIR)/sha384sum-md5sum.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sha384sum_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sha384sum-md5sum.obj -MD -MP -MF $(DEPDIR)/sha384sum-md5sum.Tpo -c -o sha384sum-md5sum.obj `if test -f 'md5sum.c'; then $(CYGPATH_W) 'md5sum.c'; else $(CYGPATH_W) '$(srcdir)/md5sum.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sha384sum-md5sum.Tpo $(DEPDIR)/sha384sum-md5sum.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='md5sum.c' object='sha384sum-md5sum.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sha384sum_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sha384sum-md5sum.obj `if test -f 'md5sum.c'; then $(CYGPATH_W) 'md5sum.c'; else $(CYGPATH_W) '$(srcdir)/md5sum.c'; fi` sha512sum-md5sum.o: md5sum.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sha512sum_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sha512sum-md5sum.o -MD -MP -MF $(DEPDIR)/sha512sum-md5sum.Tpo -c -o sha512sum-md5sum.o `test -f 'md5sum.c' || echo '$(srcdir)/'`md5sum.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/sha512sum-md5sum.Tpo $(DEPDIR)/sha512sum-md5sum.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sha512sum_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sha512sum-md5sum.o -MD -MP -MF $(DEPDIR)/sha512sum-md5sum.Tpo -c -o sha512sum-md5sum.o `test -f 'md5sum.c' || echo '$(srcdir)/'`md5sum.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sha512sum-md5sum.Tpo $(DEPDIR)/sha512sum-md5sum.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='md5sum.c' object='sha512sum-md5sum.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sha512sum_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sha512sum-md5sum.o `test -f 'md5sum.c' || echo '$(srcdir)/'`md5sum.c sha512sum-md5sum.obj: md5sum.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sha512sum_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sha512sum-md5sum.obj -MD -MP -MF $(DEPDIR)/sha512sum-md5sum.Tpo -c -o sha512sum-md5sum.obj `if test -f 'md5sum.c'; then $(CYGPATH_W) 'md5sum.c'; else $(CYGPATH_W) '$(srcdir)/md5sum.c'; fi` -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/sha512sum-md5sum.Tpo $(DEPDIR)/sha512sum-md5sum.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sha512sum_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sha512sum-md5sum.obj -MD -MP -MF $(DEPDIR)/sha512sum-md5sum.Tpo -c -o sha512sum-md5sum.obj `if test -f 'md5sum.c'; then $(CYGPATH_W) 'md5sum.c'; else $(CYGPATH_W) '$(srcdir)/md5sum.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sha512sum-md5sum.Tpo $(DEPDIR)/sha512sum-md5sum.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='md5sum.c' object='sha512sum-md5sum.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sha512sum_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sha512sum-md5sum.obj `if test -f 'md5sum.c'; then $(CYGPATH_W) 'md5sum.c'; else $(CYGPATH_W) '$(srcdir)/md5sum.c'; fi` @@ -1723,45 +2331,49 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) - tags=; \ + set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique + $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags @@ -1782,22 +2394,26 @@ distdir: $(DISTFILES) if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am -all-am: Makefile $(PROGRAMS) $(SCRIPTS) $(HEADERS) all-local +all-am: Makefile $(LIBRARIES) $(PROGRAMS) $(HEADERS) all-local installdirs: - for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)"; do \ + for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) @@ -1822,6 +2438,8 @@ clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @@ -1830,8 +2448,8 @@ maintainer-clean-generic: -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am -clean-am: clean-binPROGRAMS clean-generic clean-noinstPROGRAMS \ - mostlyclean-am +clean-am: clean-binPROGRAMS clean-generic clean-noinstLIBRARIES \ + clean-noinstPROGRAMS mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) @@ -1845,6 +2463,8 @@ dvi-am: html: html-am +html-am: + info: info-am info-am: @@ -1853,19 +2473,29 @@ install-data-am: install-dvi: install-dvi-am -install-exec-am: install-binPROGRAMS install-binSCRIPTS \ - install-exec-local +install-dvi-am: +install-exec-am: install-binPROGRAMS + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) install-exec-hook install-html: install-html-am +install-html-am: + install-info: install-info-am +install-info-am: + install-man: install-pdf: install-pdf-am +install-pdf-am: + install-ps: install-ps-am +install-ps-am: + installcheck-am: maintainer-clean: maintainer-clean-am @@ -1885,106 +2515,127 @@ ps: ps-am ps-am: -uninstall-am: uninstall-binPROGRAMS uninstall-binSCRIPTS \ - uninstall-local +uninstall-am: uninstall-binPROGRAMS uninstall-local -.MAKE: install-am install-strip +.MAKE: all check install install-am install-exec-am install-strip .PHONY: CTAGS GTAGS all all-am all-local check check-am clean \ - clean-binPROGRAMS clean-generic clean-noinstPROGRAMS ctags \ - distclean distclean-compile distclean-generic distclean-tags \ - distdir dvi dvi-am html html-am info info-am install \ - install-am install-binPROGRAMS install-binSCRIPTS install-data \ - install-data-am install-dvi install-dvi-am install-exec \ - install-exec-am install-exec-local install-html \ + clean-binPROGRAMS clean-generic clean-noinstLIBRARIES \ + clean-noinstPROGRAMS ctags distclean distclean-compile \ + distclean-generic distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-binPROGRAMS \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-exec-hook install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-binPROGRAMS \ - uninstall-binSCRIPTS uninstall-local + uninstall-local $(PROGRAMS): ../lib/libcoreutils.a -.sh: - rm -f $@ $@-t - sed \ - -e 's!@''bindir''@!$(bindir)!' \ - -e 's/@''RELEASE_YEAR'@/$(RELEASE_YEAR)/ \ - -e 's/@''GNU_PACKAGE''@/$(GNU_PACKAGE)/' \ - -e 's/@''PACKAGE_BUGREPORT''@/$(PACKAGE_BUGREPORT)/' \ - -e 's/@''VERSION''@/$(VERSION)/' $< > $@-t - chmod +x $@-t - mv $@-t $@ - all-local: su$(EXEEXT) install-root: su$(EXEEXT) - @$(INSTALL_SU) + @$(install_su) -install-exec-local: su$(EXEEXT) - @TMPFILE=$(DESTDIR)$(bindir)/.su-$$$$; \ - rm -f $$TMPFILE; \ - echo > $$TMPFILE; \ - can_create_suid_root_executable=no; \ - chown root $$TMPFILE > /dev/null 2>&1 \ - && chmod $(setuid_root_mode) $$TMPFILE > /dev/null 2>&1 \ - && can_create_suid_root_executable=yes; \ - rm -f $$TMPFILE; \ - if test $$can_create_suid_root_executable = yes; then \ - $(INSTALL_SU); \ - else \ - echo "WARNING: insufficient access; not installing su"; \ - echo "NOTE: to install su, run 'make install-root' as root"; \ +install-exec-hook: su$(EXEEXT) + @if test "$(INSTALL_SU)" = yes; then \ + TMPFILE=$(DESTDIR)$(bindir)/.su-$$$$; \ + rm -f $$TMPFILE; \ + echo > $$TMPFILE; \ + can_create_suid_root_executable=no; \ + chown root $$TMPFILE > /dev/null 2>&1 \ + && chmod $(setuid_root_mode) $$TMPFILE > /dev/null 2>&1 \ + && can_create_suid_root_executable=yes; \ + rm -f $$TMPFILE; \ + if test $$can_create_suid_root_executable = yes; then \ + $(install_su); \ + else \ + echo "WARNING: insufficient access; not installing su"; \ + echo "NOTE: to install su, run 'make install-root' as root"; \ + rm -f $(installed_su); \ + fi; \ + else :; \ fi uninstall-local: # Remove su only if it's one we installed. - @if grep '$(GNU_PACKAGE)' $(installed_su) > /dev/null 2>&1; then \ - echo " rm -f $(installed_su)"; \ - rm -f $(installed_su); \ - else :; fi + @if test "$(INSTALL_SU)" = yes; then \ + if grep '$(PACKAGE_NAME)' $(installed_su) > /dev/null 2>&1; then \ + echo " rm -f $(installed_su)"; \ + rm -f $(installed_su); \ + else :; \ + fi; \ + fi dircolors.h: dcgen dircolors.hin - @rm -f $@ $@-t - $(PERL) -w -- $(srcdir)/dcgen $(srcdir)/dircolors.hin > $@-t - @chmod a-w $@-t - mv $@-t $@ + $(AM_V_GEN)rm -f $@ $@-t + $(AM_V_at)$(PERL) -w -- $(srcdir)/dcgen $(srcdir)/dircolors.hin > $@-t + $(AM_V_at)chmod a-w $@-t + $(AM_V_at)mv $@-t $@ wheel-size.h: Makefile.am - @rm -f $@ $@-t - echo '#define WHEEL_SIZE $(wheel_size)' > $@-t - @chmod a-w $@-t - mv $@-t $@ + $(AM_V_GEN)rm -f $@ $@-t + $(AM_V_at)echo '#define WHEEL_SIZE $(wheel_size)' > $@-t + $(AM_V_at)chmod a-w $@-t + $(AM_V_at)mv $@-t $@ wheel.h: wheel-gen.pl Makefile.am - @rm -f $@ $@-t - $(srcdir)/wheel-gen.pl $(wheel_size) > $@-t - @chmod a-w $@-t - mv $@-t $@ + $(AM_V_GEN)rm -f $@ $@-t + $(AM_V_at)$(srcdir)/wheel-gen.pl $(wheel_size) > $@-t + $(AM_V_at)chmod a-w $@-t + $(AM_V_at)mv $@-t $@ fs.h: stat.c extract-magic - rm -f $@ - $(PERL) $(srcdir)/extract-magic $(srcdir)/stat.c > $@t - @chmod a-w $@t - mv $@t $@ + $(AM_V_GEN)rm -f $@ + $(AM_V_at)$(PERL) $(srcdir)/extract-magic $(srcdir)/stat.c > $@t + $(AM_V_at)chmod a-w $@t + $(AM_V_at)mv $@t $@ +version.c: Makefile + $(AM_V_GEN)rm -f $@ + $(AM_V_at)printf '#include \n' > $@t + $(AM_V_at)printf 'char const *Version = "$(PACKAGE_VERSION)";\n' >> $@t + $(AM_V_at)chmod a-w $@t + $(AM_V_at)mv $@t $@ +version.h: Makefile + $(AM_V_GEN)rm -f $@ + $(AM_V_at)printf 'extern char const *Version;\n' > $@t + $(AM_V_at)chmod a-w $@t + $(AM_V_at)mv $@t $@ + +built_programs.list: + @echo $(bin_PROGRAMS) $(bin_SCRIPTS) | tr ' ' '\n' \ + | sed -e 's,$(EXEEXT)$$,,' | $(ASSORT) -u | tr '\n' ' ' all_programs.list: @echo $(all_programs) | tr ' ' '\n' | sed -e 's,$(EXEEXT)$$,,' \ | $(ASSORT) -u # Ensure that the list of programs in README matches the list # of programs we can build. -check: check-README check-misc +check: check-README check-duplicate-no-install check-AUTHORS .PHONY: check-README check-README: rm -rf $(pr) $(pm) echo $(all_programs) \ - | tr -s ' ' '\n' | sed -e 's,$(EXEEXT)$$,,' \ + | tr -s ' ' '\n' | sed -e 's,$(EXEEXT)$$,,;s/ginstall/install/' \ | $(ASSORT) -u > $(pm) && \ sed -n '/^The programs .* are:/,/^[a-zA-Z]/p' $(top_srcdir)/README \ | sed -n '/^ */s///p' | tr -s ' ' '\n' > $(pr) diff $(pm) $(pr) && rm -rf $(pr) $(pm) + +# Ensure that a by-default-not-installed program (listed in +# $(no_install__progs) is not also listed in $(EXTRA_PROGRAMS), because +# if that were to happen, it *would* be installed by default. +.PHONY: check-duplicate-no-install +check-duplicate-no-install: tr + test -z "`echo '$(EXTRA_PROGRAMS)'| ./tr ' ' '\n' | uniq -d`" .PHONY: check-AUTHORS check-AUTHORS: $(all_programs) - rm -f $(au_actual) $(au_dotdot) + $(AM_V_GEN)locale=en_US.UTF-8; \ + LC_ALL="$$locale" ./cat --version \ + | grep ' Torbjorn ' > /dev/null \ + && { echo "$@: skipping this check"; exit 0; }; \ + rm -f $(au_actual) $(au_dotdot); \ for i in `ls $(all_programs) | sed -e 's,$(EXEEXT)$$,,' \ | $(ASSORT) -u`; do \ test "$$i" = '[' && continue; \ @@ -1994,43 +2645,14 @@ check-AUTHORS: $(all_programs) elif test "$$i" = test; then \ exe='['; \ fi; \ - ./$$exe --version \ - |sed -n '/Written by /{ s//'"$$i"': /; s/,* and /, /; s/\.$$//; p; }'; \ - done > $(au_actual) - sed -n '/:/p' $(top_srcdir)/AUTHORS > $(au_dotdot) + LC_ALL="$$locale" ./$$exe --version \ + | perl -0 -pi -e 's/,\n/, /gm' \ + | sed -n -e '/Written by /{ s//'"$$i"': /;' \ + -e 's/,* and /, /; s/\.$$//; p; }'; \ + done > $(au_actual) && \ + sed -n '/^[^ ][^ ]*:/p' $(top_srcdir)/AUTHORS > $(au_dotdot) && \ diff $(au_actual) $(au_dotdot) && rm -f $(au_actual) $(au_dotdot) -# Make sure we don't define any S_IS* macros in src/*.c files. -# Not a big deal, but they're already defined via system.h. -# -# Also make sure we don't use st_blocks. Use ST_NBLOCKS instead. -# This is a bit of a kludge, since it prevents use of the string -# even in comments, but for now it does the job with no false positives. -.PHONY: check-misc -check-misc: - cd $(srcdir); grep '^# *define *S_IS' $(SOURCES) && exit 1 || : - cd $(srcdir); grep st_blocks $(SOURCES) && exit 1 || : - cd $(srcdir); grep '^# *define .*defined' $(SOURCES) && exit 1 || : -# FIXME: handle *.sh; and use $(all_programs), not $(SOURCES) -../AUTHORS: $(SOURCES) - rm -f $@-t - ( \ - set -e; \ - echo "Here are the names of the programs in this package,"; \ - echo "each followed by the name(s) of its author(s)."; \ - echo; \ - for i in $(SOURCES); do \ - a=`sed -n $(s1) $$i`; \ - test "$$a" && : \ - || a=`sed -n $(s2) $$i`; \ - if test "$$a"; then \ - prog=`echo $$i|sed 's/\.c$$//'`; \ - echo "$$prog: $$a"; \ - fi; \ - done | $(ASSORT) -u ) > $@-t - chmod a-w $@-t - mv $@-t $@ - # The following rule is not designed to be portable, # and relies on tools that not everyone has. @@ -2041,25 +2663,34 @@ check-misc: # # The second nm|grep checks for file-scope variables with `extern' scope. .PHONY: sc_tight_scope -sc_tight_scope: $(all_programs) - @t=exceptions-$$$$; \ +sc_tight_scope: $(bin_PROGRAMS) + $(AM_V_GEN)t=exceptions-$$$$; \ trap "s=$$?; rm -f $$t; exit $$s" 0 1 2 13 15; \ - ( printf '^main$$\n^usage$$\n'; \ - grep -h -A1 '^extern .*[^;]$$' $(SOURCES) \ - | grep -vE '^(extern |--)' |sed 's/^/^/;s/ .*/$$/' ) > $$t; \ + src=`for f in $(SOURCES); do \ + test -f $$f && d= || d=$(srcdir)/; echo $$d$$f; done`; \ + hdr=`for f in $(noinst_HEADERS); do \ + test -f $$f && d= || d=$(srcdir)/; echo $$d$$f; done`; \ + ( printf 'main\nusage\n'; \ + grep -h -A1 '^extern .*[^;]$$' $$src \ + | grep -vE '^(extern |--)' | sed 's/ .*//'; \ + perl -ne '/^extern \S+ (\S*) \(/ and print "$$1\n"' $$hdr; \ + ) | $(ASSORT) -u | sed 's/^/^/;s/$$/$$/' > $$t; \ nm -e *.$(OBJEXT) \ | sed -n 's/.* T //p' \ + | sed 's/^_//' \ | grep -Ev -f $$t && \ { echo 'the above functions should have static scope' 1>&2; \ exit 1; } || : ; \ ( printf '^program_name$$\n'; \ - sed -n 's/^extern int \([^ ][^ ]*\);$$/^\1$$/p' \ - $(noinst_HEADERS) ) > $$t; \ + perl -ne '/^extern .*?\**(\w+);/ and print "^$$1\$$\n"' \ + $$hdr *.h ) | $(ASSORT) -u > $$t; \ nm -e *.$(OBJEXT) \ | sed -n 's/.* [BD] //p' \ + | sed 's/^_//' \ | grep -Ev -f $$t && \ { echo 'the above variables should have static scope' 1>&2; \ exit 1; } || : + # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff --git a/src/bin/coreutils/src/base64.c b/src/bin/coreutils/src/base64.c index 9f8ff417ce..b5c0f71d24 100644 --- a/src/bin/coreutils/src/base64.c +++ b/src/bin/coreutils/src/base64.c @@ -1,22 +1,20 @@ /* Base64 encode/decode strings or files. - Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc. + Copyright (C) 2004-2008 Free Software Foundation, Inc. This file is part of Base64. - Base64 is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. - Base64 is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with Base64; see the file COPYING. If not, write to the Free - Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, - MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Simon Josefsson . */ @@ -37,24 +35,20 @@ /* The official name of this program (e.g., no `g' prefix). */ #define PROGRAM_NAME "base64" -#define AUTHOR "Simon Josefsson" +#define AUTHORS proper_name ("Simon Josefsson") -/* The invocation name of this program. */ -char *program_name; - -static const struct option long_options[] = { +static struct option const long_options[] = +{ {"decode", no_argument, 0, 'd'}, {"wrap", required_argument, 0, 'w'}, {"ignore-garbage", no_argument, 0, 'i'}, - {"help", no_argument, 0, GETOPT_HELP_CHAR}, - {"version", no_argument, 0, GETOPT_VERSION_CHAR}, {GETOPT_HELP_OPTION_DECL}, {GETOPT_VERSION_OPTION_DECL}, {NULL, 0, NULL, 0} }; -static void +void usage (int status) { if (status != EXIT_SUCCESS) @@ -63,7 +57,7 @@ usage (int status) else { printf (_("\ -Usage: %s [OPTION] [FILE]\n\ +Usage: %s [OPTION]... [FILE]\n\ Base64 encode or decode FILE, or standard input, to standard output.\n\ \n"), program_name); fputs (_("\ @@ -87,7 +81,7 @@ When decoding, the input may contain newlines in addition to the bytes of\n\ the formal base64 alphabet. Use --ignore-garbage to attempt to recover\n\ from any other non-alphabet bytes in the encoded stream.\n"), stdout); - printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT); + emit_bug_reporting_address (); } exit (status); @@ -220,12 +214,12 @@ do_decode (FILE *in, FILE *out, bool ignore_garbage) However, when it processes the final input buffer, we want to iterate it one additional time, but with an indicator telling it to flush what is in CTX. */ - for (k = 0; k < 1 + feof (in); k++) + for (k = 0; k < 1 + !!feof (in); k++) { if (k == 1 && ctx.i == 0) break; n = BLOCKSIZE; - ok = base64_decode (&ctx, inbuf, (k == 0 ? sum : 0), outbuf, &n); + ok = base64_decode_ctx (&ctx, inbuf, (k == 0 ? sum : 0), outbuf, &n); if (fwrite (outbuf, 1, n, out) < n) error (EXIT_FAILURE, errno, _("write error")); @@ -244,22 +238,22 @@ main (int argc, char **argv) FILE *input_fh; const char *infile; - /* True if --decode has bene given and we should decode data. */ + /* True if --decode has been given and we should decode data. */ bool decode = false; - /* True if we should ignore non-alphabetic characters. */ + /* True if we should ignore non-base64-alphabetic characters. */ bool ignore_garbage = false; /* Wrap encoded base64 data around the 76:th column, by default. */ uintmax_t wrap_column = 76; initialize_main (&argc, &argv); - program_name = argv[0]; + set_program_name (argv[0]); setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); atexit (close_stdout); - while ((opt = getopt_long (argc, argv, "dqiw:", long_options, NULL)) != -1) + while ((opt = getopt_long (argc, argv, "diw:", long_options, NULL)) != -1) switch (opt) { case 'd': @@ -278,7 +272,7 @@ main (int argc, char **argv) case_GETOPT_HELP_CHAR; - case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHOR); + case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS); default: usage (EXIT_FAILURE); @@ -296,7 +290,7 @@ main (int argc, char **argv) else infile = "-"; - if (strcmp (infile, "-") == 0) + if (STREQ (infile, "-")) input_fh = stdin; else { @@ -312,7 +306,7 @@ main (int argc, char **argv) if (fclose (input_fh) == EOF) { - if (strcmp (infile, "-") == 0) + if (STREQ (infile, "-")) error (EXIT_FAILURE, errno, _("closing standard input")); else error (EXIT_FAILURE, errno, "%s", infile); diff --git a/src/bin/coreutils/src/basename.c b/src/bin/coreutils/src/basename.c index f2617b1ea3..ac2e01ec2b 100644 --- a/src/bin/coreutils/src/basename.c +++ b/src/bin/coreutils/src/basename.c @@ -1,10 +1,10 @@ /* basename -- strip directory and suffix from file names - Copyright (C) 1990-1997, 1999-2006 Free Software Foundation, Inc. + Copyright (C) 1990-1997, 1999-2008 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Usage: basename name [suffix] NAME is a file name; SUFFIX is a suffix to strip from it. @@ -38,10 +37,7 @@ /* The official name of this program (e.g., no `g' prefix). */ #define PROGRAM_NAME "basename" -#define AUTHORS "FIXME unknown" - -/* The name this program was run with. */ -char *program_name; +#define AUTHORS proper_name ("David MacKenzie") void usage (int status) @@ -70,7 +66,7 @@ Examples:\n\ %s include/stdio.h .h Output \"stdio\".\n\ "), program_name, program_name); - printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT); + emit_bug_reporting_address (); } exit (status); } @@ -100,14 +96,14 @@ main (int argc, char **argv) char *name; initialize_main (&argc, &argv); - program_name = argv[0]; + set_program_name (argv[0]); setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); atexit (close_stdout); - parse_long_options (argc, argv, PROGRAM_NAME, GNU_PACKAGE, VERSION, + parse_long_options (argc, argv, PROGRAM_NAME, PACKAGE_NAME, Version, usage, AUTHORS, (char const *) NULL); if (getopt_long (argc, argv, "+", NULL, NULL) != -1) usage (EXIT_FAILURE); diff --git a/src/bin/coreutils/src/c99-to-c89.diff b/src/bin/coreutils/src/c99-to-c89.diff index 5545f6a11e..51b0a42ca3 100644 --- a/src/bin/coreutils/src/c99-to-c89.diff +++ b/src/bin/coreutils/src/c99-to-c89.diff @@ -1,12 +1,7 @@ -Index: src/remove.c -=================================================================== -RCS file: /fetish/cu/src/remove.c,v -retrieving revision 1.158 -diff --git a/src/remove.c b/src/remove.c -index 4728bdd..7477da5 100644 ---- a/src/remove.c -+++ b/src/remove.c -@@ -236,9 +236,10 @@ pop_dir (Dirstack_state *ds) +diff -upr src/remove.c src/remove.c +--- src/remove.c 1970-01-01 00:00:00.000000000 +0000 ++++ src/remove.c 1970-01-01 00:00:00.000000000 +0000 +@@ -262,9 +262,10 @@ pop_dir (Dirstack_state *ds) { size_t n_lengths = obstack_object_size (&ds->len_stack) / sizeof (size_t); size_t *length = obstack_base (&ds->len_stack); @@ -18,7 +13,7 @@ index 4728bdd..7477da5 100644 assert (top_len >= 2); /* Pop the specified length of file name. */ -@@ -370,10 +371,11 @@ AD_stack_top (Dirstack_state const *ds) +@@ -422,10 +423,11 @@ AD_stack_top (Dirstack_state const *ds) static void AD_stack_pop (Dirstack_state *ds) { @@ -31,24 +26,39 @@ index 4728bdd..7477da5 100644 if (top->unremovable) hash_free (top->unremovable); obstack_blank (&ds->Active_dir, -(int) sizeof (struct AD_ent)); -@@ -815,6 +817,7 @@ prompt (int fd_cwd, Dirstack_state const *ds, char const *filename, +@@ -834,14 +836,13 @@ prompt (int fd_cwd, Dirstack_state const + { + int write_protected = 0; + int dirent_type = *pdirent_type; ++ int wp_errno = 0; - if (write_protected || x->interactive == RMI_ALWAYS) - { -+ char const *quoted_name = quote (full_filename (filename)); - if (write_protected <= 0 - && cache_fstatat (fd_cwd, filename, sbuf, AT_SYMLINK_NOFOLLOW) != 0) - { -@@ -832,8 +835,6 @@ prompt (int fd_cwd, Dirstack_state const *ds, char const *filename, - write_protected = EISDIR; - } + *is_empty = T_UNKNOWN; -- char const *quoted_name = quote (full_filename (filename)); + if (x->interactive == RMI_NEVER) + return RM_OK; + +- int wp_errno = 0; - - if (0 < write_protected) - { - error (0, write_protected, _("cannot remove %s"), quoted_name); -@@ -1487,6 +1488,7 @@ rm_1 (Dirstack_state *ds, char const *filename, + if (!x->ignore_missing_files + && ((x->interactive == RMI_ALWAYS) || x->stdin_tty) + && dirent_type != DT_LNK) +@@ -889,6 +890,7 @@ prompt (int fd_cwd, Dirstack_state const + break; + } + ++ { + char const *quoted_name = quote (full_filename (filename)); + + if (write_protected < 0) +@@ -928,6 +930,7 @@ prompt (int fd_cwd, Dirstack_state const + : _("%s: remove %s %s? ")), + program_name, file_type (sbuf), quoted_name); + } ++ } + + if (!yesno ()) + return RM_USER_DECLINED; +@@ -1547,6 +1550,7 @@ rm_1 (Dirstack_state *ds, char const *fi return RM_ERROR; } @@ -56,32 +66,27 @@ index 4728bdd..7477da5 100644 struct stat st; cache_stat_init (&st); cycle_check_init (&ds->cycle_check_state); -@@ -1509,6 +1511,7 @@ rm_1 (Dirstack_state *ds, char const *filename, +@@ -1569,6 +1573,7 @@ rm_1 (Dirstack_state *ds, char const *fi AD_push_initial (ds); AD_INIT_OTHER_MEMBERS (); + { - enum RM_status status = remove_entry (AT_FDCWD, ds, filename, &st, x, NULL); + enum RM_status status = remove_entry (AT_FDCWD, ds, filename, + DT_UNKNOWN, &st, x); if (status == RM_NONEMPTY_DIR) - { -@@ -1525,6 +1528,8 @@ rm_1 (Dirstack_state *ds, char const *filename, - +@@ -1587,6 +1592,8 @@ rm_1 (Dirstack_state *ds, char const *fi ds_clear (ds); return status; -+ } -+ } } ++ } ++} /* Remove all files and/or directories specified by N_FILES and FILE. -Index: src/rm.c -=================================================================== -RCS file: /fetish/cu/src/rm.c,v -retrieving revision 1.140 -diff --git a/src/rm.c b/src/rm.c -index 364a21c..7a24014 100644 ---- a/src/rm.c -+++ b/src/rm.c -@@ -355,6 +355,7 @@ main (int argc, char **argv) + Apply the options in X. */ +diff -upr src/rm.c src/rm.c +--- src/rm.c 1970-01-01 00:00:00.000000000 +0000 ++++ src/rm.c 1970-01-01 00:00:00.000000000 +0000 +@@ -354,6 +354,7 @@ main (int argc, char **argv) quote ("/")); } @@ -89,7 +94,7 @@ index 364a21c..7a24014 100644 size_t n_files = argc - optind; char const *const *file = (char const *const *) argv + optind; -@@ -368,7 +369,10 @@ main (int argc, char **argv) +@@ -367,7 +368,10 @@ main (int argc, char **argv) if (!yesno ()) exit (EXIT_SUCCESS); } @@ -100,14 +105,61 @@ index 364a21c..7a24014 100644 + } + } } -Index: src/shred.c -=================================================================== -RCS file: /fetish/cu/src/shred.c,v -retrieving revision 1.130 -diff -u -p -r1.130 shred.c ---- a/src/shred.c 3 Sep 2006 02:53:16 -0000 1.130 -+++ b/src/shred.c 3 Oct 2006 13:48:24 -0000 -@@ -464,7 +464,7 @@ dopass (int fd, char const *qname, off_t +diff -upr src/seq.c src/seq.c +--- src/seq.c 1970-01-01 00:00:00.000000000 +0000 ++++ src/seq.c 1970-01-01 00:00:00.000000000 +0000 +@@ -163,6 +163,7 @@ scan_arg (const char *arg) + : (decimal_point == arg /* .# -> 0.# */ + || ! ISDIGIT (decimal_point[-1]))); /* -.# -> 0.# */ + } ++ { + char const *e = strchr (arg, 'e'); + if (! e) + e = strchr (arg, 'E'); +@@ -171,6 +172,7 @@ scan_arg (const char *arg) + long exponent = strtol (e + 1, NULL, 10); + ret.precision += exponent < 0 ? -exponent : 0; + } ++ } + } + + return ret; +@@ -346,6 +348,7 @@ get_default_format (operand first, opera + size_t last_width = last.width + (prec - last.precision); + if (last.precision && prec == 0) + last_width--; /* don't include space for '.' */ ++ { + size_t width = MAX (first_width, last_width); + if (width <= INT_MAX) + { +@@ -353,6 +356,7 @@ get_default_format (operand first, opera + sprintf (format_buf, "%%0%d.%dLf", w, prec); + return format_buf; + } ++ } + } + else + { +@@ -441,6 +445,7 @@ main (int argc, char **argv) + if (format_str) + { + validate_format (format_str); ++ { + char const *f = long_double_format (format_str, &layout); + if (! f) + { +@@ -448,6 +453,7 @@ main (int argc, char **argv) + usage (EXIT_FAILURE); + } + format_str = f; ++ } + } + + last = scan_arg (argv[optind++]); +diff -upr src/shred.c src/shred.c +--- src/shred.c 1970-01-01 00:00:00.000000000 +0000 ++++ src/shred.c 1970-01-01 00:00:00.000000000 +0000 +@@ -468,7 +468,7 @@ dopass (int fd, char const *qname, off_t out. Thus, it shouldn't give up on bad blocks. This code works because lim is always a multiple of SECTOR_SIZE, except at the end. */ diff --git a/src/bin/coreutils/src/cat.c b/src/bin/coreutils/src/cat.c index 90a73c21ba..bdc011017b 100644 --- a/src/bin/coreutils/src/cat.c +++ b/src/bin/coreutils/src/cat.c @@ -1,10 +1,10 @@ /* cat -- concatenate files and print on the standard output. - Copyright (C) 88, 90, 91, 1995-2006 Free Software Foundation, Inc. + Copyright (C) 88, 90, 91, 1995-2009 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Differences from the Unix cat: * Always unbuffered, -u is ignored. @@ -38,21 +37,16 @@ #include "system.h" #include "error.h" #include "full-write.h" -#include "getpagesize.h" #include "quote.h" #include "safe-read.h" +#include "xfreopen.h" /* The official name of this program (e.g., no `g' prefix). */ #define PROGRAM_NAME "cat" -#define AUTHORS "Torbjorn Granlund", "Richard M. Stallman" - -/* Undefine, to avoid warning about redefinition on some systems. */ -#undef max -#define max(h,i) ((h) > (i) ? (h) : (i)) - -/* Name under which this program was invoked. */ -char *program_name; +#define AUTHORS \ + proper_name_utf8 ("Torbjorn Granlund", "Torbj\303\266rn Granlund"), \ + proper_name ("Richard M. Stallman") /* Name of input file. May be "-". */ static char const *infile; @@ -93,18 +87,18 @@ usage (int status) else { printf (_("\ -Usage: %s [OPTION] [FILE]...\n\ +Usage: %s [OPTION]... [FILE]...\n\ "), program_name); fputs (_("\ Concatenate FILE(s), or standard input, to standard output.\n\ \n\ -A, --show-all equivalent to -vET\n\ - -b, --number-nonblank number nonblank output lines\n\ + -b, --number-nonblank number nonempty output lines\n\ -e equivalent to -vE\n\ -E, --show-ends display $ at end of each line\n\ -n, --number number all output lines\n\ - -s, --squeeze-blank never more than one single blank line\n\ + -s, --squeeze-blank suppress repeated empty output lines\n\ "), stdout); fputs (_("\ -t equivalent to -vT\n\ @@ -125,7 +119,7 @@ Examples:\n\ %s Copy standard input to standard output.\n\ "), program_name, program_name); - printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT); + emit_bug_reporting_address (); } exit (status); } @@ -339,7 +333,7 @@ cat ( input_pending = true; #endif - if (input_pending) + if (!input_pending) write_pending (outbuf, &bpout); /* Read more input into INBUF. */ @@ -565,7 +559,7 @@ main (int argc, char **argv) }; initialize_main (&argc, &argv); - program_name = argv[0]; + set_program_name (argv[0]); setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); @@ -642,7 +636,7 @@ main (int argc, char **argv) if (fstat (STDOUT_FILENO, &stat_buf) < 0) error (EXIT_FAILURE, errno, _("standard output")); - outsize = ST_BLKSIZE (stat_buf); + outsize = io_blksize (stat_buf); /* Input file can be output file for non-regular files. fstat on pipes returns S_IFSOCK on some systems, S_IFIFO on others, so the checking should not be done for those types, @@ -667,7 +661,7 @@ main (int argc, char **argv) { file_open_mode |= O_BINARY; if (O_BINARY && ! isatty (STDOUT_FILENO)) - freopen (NULL, "wb", stdout); + xfreopen (NULL, "wb", stdout); } /* Check if any of the input files are the same as the output file. */ @@ -687,7 +681,7 @@ main (int argc, char **argv) have_read_stdin = true; input_desc = STDIN_FILENO; if ((file_open_mode & O_BINARY) && ! isatty (STDIN_FILENO)) - freopen (NULL, "rb", stdin); + xfreopen (NULL, "rb", stdin); } else { @@ -706,7 +700,7 @@ main (int argc, char **argv) ok = false; goto contin; } - insize = ST_BLKSIZE (stat_buf); + insize = io_blksize (stat_buf); /* Compare the device and i-node numbers of this input file with the corresponding values of the (output file associated with) @@ -728,7 +722,7 @@ main (int argc, char **argv) if (! (number | show_ends | show_nonprinting | show_tabs | squeeze_blank)) { - insize = max (insize, outsize); + insize = MAX (insize, outsize); inbuf = xmalloc (insize + page_size - 1); ok &= simple_cat (ptr_align (inbuf, page_size), insize); diff --git a/src/bin/coreutils/src/chcon.c b/src/bin/coreutils/src/chcon.c new file mode 100644 index 0000000000..022858ab78 --- /dev/null +++ b/src/bin/coreutils/src/chcon.c @@ -0,0 +1,566 @@ +/* chcon -- change security context of files + Copyright (C) 2005-2008 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#include +#include +#include +#include + +#include "system.h" +#include "dev-ino.h" +#include "error.h" +#include "quote.h" +#include "quotearg.h" +#include "root-dev-ino.h" +#include "selinux-at.h" +#include "xfts.h" + +/* The official name of this program (e.g., no `g' prefix). */ +#define PROGRAM_NAME "chcon" + +#define AUTHORS \ + proper_name ("Russell Coker"), \ + proper_name ("Jim Meyering") + +/* If nonzero, and the systems has support for it, change the context + of symbolic links rather than any files they point to. */ +static bool affect_symlink_referent; + +/* If true, change the modes of directories recursively. */ +static bool recurse; + +/* Level of verbosity. */ +static bool verbose; + +/* Pointer to the device and inode numbers of `/', when --recursive. + Otherwise NULL. */ +static struct dev_ino *root_dev_ino; + +/* The name of the context file is being given. */ +static char const *specified_context; + +/* Specific components of the context */ +static char const *specified_user; +static char const *specified_role; +static char const *specified_range; +static char const *specified_type; + +/* For long options that have no equivalent short option, use a + non-character as a pseudo short option, starting with CHAR_MAX + 1. */ +enum +{ + DEREFERENCE_OPTION = CHAR_MAX + 1, + NO_PRESERVE_ROOT, + PRESERVE_ROOT, + REFERENCE_FILE_OPTION +}; + +static struct option const long_options[] = +{ + {"recursive", no_argument, NULL, 'R'}, + {"dereference", no_argument, NULL, DEREFERENCE_OPTION}, + {"no-dereference", no_argument, NULL, 'h'}, + {"no-preserve-root", no_argument, NULL, NO_PRESERVE_ROOT}, + {"preserve-root", no_argument, NULL, PRESERVE_ROOT}, + {"reference", required_argument, NULL, REFERENCE_FILE_OPTION}, + {"user", required_argument, NULL, 'u'}, + {"role", required_argument, NULL, 'r'}, + {"type", required_argument, NULL, 't'}, + {"range", required_argument, NULL, 'l'}, + {"verbose", no_argument, NULL, 'v'}, + {GETOPT_HELP_OPTION_DECL}, + {GETOPT_VERSION_OPTION_DECL}, + {NULL, 0, NULL, 0} +}; + +/* Given a security context, CONTEXT, derive a context_t (*RET), + setting any portions selected via the global variables, specified_user, + specified_role, etc. */ +static int +compute_context_from_mask (security_context_t context, context_t *ret) +{ + bool ok = true; + context_t new_context = context_new (context); + if (!new_context) + { + error (0, errno, _("failed to create security context: %s"), + quotearg_colon (context)); + return 1; + } + +#define SET_COMPONENT(C, comp) \ + do \ + { \ + if (specified_ ## comp \ + && context_ ## comp ## _set ((C), specified_ ## comp)) \ + { \ + error (0, errno, \ + _("failed to set %s security context component to %s"), \ + #comp, quote (specified_ ## comp)); \ + ok = false; \ + } \ + } \ + while (0) + + SET_COMPONENT (new_context, user); + SET_COMPONENT (new_context, range); + SET_COMPONENT (new_context, role); + SET_COMPONENT (new_context, type); + + if (!ok) + { + int saved_errno = errno; + context_free (new_context); + errno = saved_errno; + return 1; + } + + *ret = new_context; + return 0; +} + +/* Change the context of FILE, using specified components. + If it is a directory and -R is given, recurse. + Return 0 if successful, 1 if errors occurred. */ + +static int +change_file_context (int fd, char const *file) +{ + security_context_t file_context = NULL; + context_t context; + security_context_t context_string; + int errors = 0; + + if (specified_context == NULL) + { + int status = (affect_symlink_referent + ? getfileconat (fd, file, &file_context) + : lgetfileconat (fd, file, &file_context)); + + if (status < 0 && errno != ENODATA) + { + error (0, errno, _("failed to get security context of %s"), + quote (file)); + return 1; + } + + /* If the file doesn't have a context, and we're not setting all of + the context components, there isn't really an obvious default. + Thus, we just give up. */ + if (file_context == NULL) + { + error (0, 0, _("can't apply partial context to unlabeled file %s"), + quote (file)); + return 1; + } + + if (compute_context_from_mask (file_context, &context)) + return 1; + } + else + { + /* FIXME: this should be done exactly once, in main. */ + context = context_new (specified_context); + if (!context) + abort (); + } + + context_string = context_str (context); + + if (file_context == NULL || ! STREQ (context_string, file_context)) + { + int fail = (affect_symlink_referent + ? setfileconat (fd, file, context_string) + : lsetfileconat (fd, file, context_string)); + + if (fail) + { + errors = 1; + error (0, errno, _("failed to change context of %s to %s"), + quote_n (0, file), quote_n (1, context_string)); + } + } + + context_free (context); + freecon (file_context); + + return errors; +} + +/* Change the context of FILE. + Return true if successful. This function is called + once for every file system object that fts encounters. */ + +static bool +process_file (FTS *fts, FTSENT *ent) +{ + char const *file_full_name = ent->fts_path; + char const *file = ent->fts_accpath; + const struct stat *file_stats = ent->fts_statp; + bool ok = true; + + switch (ent->fts_info) + { + case FTS_D: + if (recurse) + { + if (ROOT_DEV_INO_CHECK (root_dev_ino, ent->fts_statp)) + { + /* This happens e.g., with "chcon -R --preserve-root ... /" + and with "chcon -RH --preserve-root ... symlink-to-root". */ + ROOT_DEV_INO_WARN (file_full_name); + /* Tell fts not to traverse into this hierarchy. */ + fts_set (fts, ent, FTS_SKIP); + /* Ensure that we do not process "/" on the second visit. */ + ent = fts_read (fts); + return false; + } + return true; + } + break; + + case FTS_DP: + if (! recurse) + return true; + break; + + case FTS_NS: + /* For a top-level file or directory, this FTS_NS (stat failed) + indicator is determined at the time of the initial fts_open call. + With programs like chmod, chown, and chgrp, that modify + permissions, it is possible that the file in question is + accessible when control reaches this point. So, if this is + the first time we've seen the FTS_NS for this file, tell + fts_read to stat it "again". */ + if (ent->fts_level == 0 && ent->fts_number == 0) + { + ent->fts_number = 1; + fts_set (fts, ent, FTS_AGAIN); + return true; + } + error (0, ent->fts_errno, _("cannot access %s"), quote (file_full_name)); + ok = false; + break; + + case FTS_ERR: + error (0, ent->fts_errno, _("%s"), quote (file_full_name)); + ok = false; + break; + + case FTS_DNR: + error (0, ent->fts_errno, _("cannot read directory %s"), + quote (file_full_name)); + ok = false; + break; + + default: + break; + } + + if (ent->fts_info == FTS_DP + && ok && ROOT_DEV_INO_CHECK (root_dev_ino, file_stats)) + { + ROOT_DEV_INO_WARN (file_full_name); + ok = false; + } + + if (ok) + { + if (verbose) + printf (_("changing security context of %s\n"), + quote (file_full_name)); + + if (change_file_context (fts->fts_cwd_fd, file) != 0) + ok = false; + } + + if ( ! recurse) + fts_set (fts, ent, FTS_SKIP); + + return ok; +} + +/* Recursively operate on the specified FILES (the last entry + of which is NULL). BIT_FLAGS controls how fts works. + Return true if successful. */ + +static bool +process_files (char **files, int bit_flags) +{ + bool ok = true; + + FTS *fts = xfts_open (files, bit_flags, NULL); + + while (1) + { + FTSENT *ent; + + ent = fts_read (fts); + if (ent == NULL) + { + if (errno != 0) + { + /* FIXME: try to give a better message */ + error (0, errno, _("fts_read failed")); + ok = false; + } + break; + } + + ok &= process_file (fts, ent); + } + + /* Ignore failure, since the only way it can do so is in failing to + return to the original directory, and since we're about to exit, + that doesn't matter. */ + fts_close (fts); + + return ok; +} + +void +usage (int status) +{ + if (status != EXIT_SUCCESS) + fprintf (stderr, _("Try `%s --help' for more information.\n"), + program_name); + else + { + printf (_("\ +Usage: %s [OPTION]... CONTEXT FILE...\n\ + or: %s [OPTION]... [-u USER] [-r ROLE] [-l RANGE] [-t TYPE] FILE...\n\ + or: %s [OPTION]... --reference=RFILE FILE...\n\ +"), + program_name, program_name, program_name); + fputs (_("\ +Change the security context of each FILE to CONTEXT.\n\ +With --reference, change the security context of each FILE to that of RFILE.\n\ +\n\ + -h, --no-dereference affect symbolic links instead of any referenced file\n\ +"), stdout); + fputs (_("\ + --reference=RFILE use RFILE's security context rather than specifying\n\ + a CONTEXT value\n\ + -R, --recursive operate on files and directories recursively\n\ + -v, --verbose output a diagnostic for every file processed\n\ +"), stdout); + fputs (_("\ + -u, --user=USER set user USER in the target security context\n\ + -r, --role=ROLE set role ROLE in the target security context\n\ + -t, --type=TYPE set type TYPE in the target security context\n\ + -l, --range=RANGE set range RANGE in the target security context\n\ +\n\ +"), stdout); + fputs (_("\ +The following options modify how a hierarchy is traversed when the -R\n\ +option is also specified. If more than one is specified, only the final\n\ +one takes effect.\n\ +\n\ + -H if a command line argument is a symbolic link\n\ + to a directory, traverse it\n\ + -L traverse every symbolic link to a directory\n\ + encountered\n\ + -P do not traverse any symbolic links (default)\n\ +\n\ +"), stdout); + fputs (HELP_OPTION_DESCRIPTION, stdout); + fputs (VERSION_OPTION_DESCRIPTION, stdout); + emit_bug_reporting_address (); + } + exit (status); +} + +int +main (int argc, char **argv) +{ + security_context_t ref_context = NULL; + + /* Bit flags that control how fts works. */ + int bit_flags = FTS_PHYSICAL; + + /* 1 if --dereference, 0 if --no-dereference, -1 if neither has been + specified. */ + int dereference = -1; + + bool ok; + bool preserve_root = false; + bool component_specified = false; + char *reference_file = NULL; + int optc; + + initialize_main (&argc, &argv); + set_program_name (argv[0]); + setlocale (LC_ALL, ""); + bindtextdomain (PACKAGE, LOCALEDIR); + textdomain (PACKAGE); + + atexit (close_stdout); + + while ((optc = getopt_long (argc, argv, "HLPRhvu:r:t:l:", long_options, NULL)) + != -1) + { + switch (optc) + { + case 'H': /* Traverse command-line symlinks-to-directories. */ + bit_flags = FTS_COMFOLLOW | FTS_PHYSICAL; + break; + + case 'L': /* Traverse all symlinks-to-directories. */ + bit_flags = FTS_LOGICAL; + break; + + case 'P': /* Traverse no symlinks-to-directories. */ + bit_flags = FTS_PHYSICAL; + break; + + case 'h': /* --no-dereference: affect symlinks */ + dereference = 0; + break; + + case DEREFERENCE_OPTION: /* --dereference: affect the referent + of each symlink */ + dereference = 1; + break; + + case NO_PRESERVE_ROOT: + preserve_root = false; + break; + + case PRESERVE_ROOT: + preserve_root = true; + break; + + case REFERENCE_FILE_OPTION: + reference_file = optarg; + break; + + case 'R': + recurse = true; + break; + + case 'f': + /* ignore */ + break; + + case 'v': + verbose = true; + break; + + case 'u': + specified_user = optarg; + component_specified = true; + break; + + case 'r': + specified_role = optarg; + component_specified = true; + break; + + case 't': + specified_type = optarg; + component_specified = true; + break; + + case 'l': + specified_range = optarg; + component_specified = true; + break; + + case_GETOPT_HELP_CHAR; + case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS); + default: + usage (EXIT_FAILURE); + } + } + + if (recurse) + { + if (bit_flags == FTS_PHYSICAL) + { + if (dereference == 1) + error (EXIT_FAILURE, 0, + _("-R --dereference requires either -H or -L")); + affect_symlink_referent = false; + } + else + { + if (dereference == 0) + error (EXIT_FAILURE, 0, _("-R -h requires -P")); + affect_symlink_referent = true; + } + } + else + { + bit_flags = FTS_PHYSICAL; + affect_symlink_referent = (dereference != 0); + } + + if (argc - optind < (reference_file || component_specified ? 1 : 2)) + { + if (argc <= optind) + error (0, 0, _("missing operand")); + else + error (0, 0, _("missing operand after %s"), quote (argv[argc - 1])); + usage (EXIT_FAILURE); + } + + if (reference_file) + { + if (getfilecon (reference_file, &ref_context) < 0) + error (EXIT_FAILURE, errno, _("failed to get security context of %s"), + quote (reference_file)); + + specified_context = ref_context; + } + else if (component_specified) + { + /* FIXME: it's already null, so this is a no-op. */ + specified_context = NULL; + } + else + { + context_t context; + specified_context = argv[optind++]; + context = context_new (specified_context); + if (!context) + error (EXIT_FAILURE, 0, _("invalid context: %s"), + quotearg_colon (specified_context)); + context_free (context); + } + + if (reference_file && component_specified) + { + error (0, 0, _("conflicting security context specifiers given")); + usage (1); + } + + if (recurse & preserve_root) + { + static struct dev_ino dev_ino_buf; + root_dev_ino = get_root_dev_ino (&dev_ino_buf); + if (root_dev_ino == NULL) + error (EXIT_FAILURE, errno, _("failed to get attributes of %s"), + quote ("/")); + } + else + { + root_dev_ino = NULL; + } + + ok = process_files (argv + optind, bit_flags | FTS_NOSTAT); + + exit (ok ? EXIT_SUCCESS : EXIT_FAILURE); +} diff --git a/src/bin/coreutils/src/chgrp.c b/src/bin/coreutils/src/chgrp.c index faf58d36b5..0653a9033d 100644 --- a/src/bin/coreutils/src/chgrp.c +++ b/src/bin/coreutils/src/chgrp.c @@ -1,10 +1,10 @@ /* chgrp -- change group ownership of files - Copyright (C) 89, 90, 91, 1995-2006 Free Software Foundation, Inc. + Copyright (C) 89, 90, 91, 1995-2009 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by David MacKenzie . */ @@ -35,15 +34,14 @@ /* The official name of this program (e.g., no `g' prefix). */ #define PROGRAM_NAME "chgrp" -#define AUTHORS "David MacKenzie", "Jim Meyering" +#define AUTHORS \ + proper_name ("David MacKenzie"), \ + proper_name ("Jim Meyering") #if ! HAVE_ENDGRENT # define endgrent() ((void) 0) #endif -/* The name the program was run with. */ -char *program_name; - /* The argument to the --reference option. Use the group ID of this file. This file must exist. */ static char *reference_file; @@ -92,7 +90,7 @@ parse_group (const char *name) unsigned long int tmp; if (! (xstrtoul (name, NULL, 10, &tmp, "") == LONGINT_OK && tmp <= GID_T_MAX)) - error (EXIT_FAILURE, 0, _("invalid group %s"), quote (name)); + error (EXIT_FAILURE, 0, _("invalid group: %s"), quote (name)); gid = tmp; } endgrent (); /* Save a file descriptor. */ @@ -160,7 +158,7 @@ Examples:\n\ %s -hR staff /u Change the group of /u and subfiles to \"staff\".\n\ "), program_name, program_name); - printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT); + emit_bug_reporting_address (); } exit (status); } @@ -183,7 +181,7 @@ main (int argc, char **argv) int optc; initialize_main (&argc, &argv); - program_name = argv[0]; + set_program_name (argv[0]); setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); @@ -304,6 +302,7 @@ main (int argc, char **argv) quote ("/")); } + bit_flags |= FTS_DEFER_STAT; ok = chown_files (argv + optind, bit_flags, (uid_t) -1, gid, (uid_t) -1, (gid_t) -1, &chopt); diff --git a/src/bin/coreutils/src/chmod.c b/src/bin/coreutils/src/chmod.c index 028c882d01..91dfbc3aa5 100644 --- a/src/bin/coreutils/src/chmod.c +++ b/src/bin/coreutils/src/chmod.c @@ -1,10 +1,10 @@ /* chmod -- change permission modes of files - Copyright (C) 89, 90, 91, 1995-2006 Free Software Foundation, Inc. + Copyright (C) 89, 90, 91, 1995-2009 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by David MacKenzie */ @@ -27,7 +26,6 @@ #include "error.h" #include "filemode.h" #include "modechange.h" -#include "openat.h" #include "quote.h" #include "quotearg.h" #include "root-dev-ino.h" @@ -36,7 +34,9 @@ /* The official name of this program (e.g., no `g' prefix). */ #define PROGRAM_NAME "chmod" -#define AUTHORS "David MacKenzie", "Jim Meyering" +#define AUTHORS \ + proper_name ("David MacKenzie"), \ + proper_name ("Jim Meyering") enum Change_status { @@ -58,9 +58,6 @@ enum Verbosity V_off }; -/* The name the program was run with. */ -char *program_name; - /* The desired change to the mode. */ static struct mode_change *change; @@ -70,7 +67,7 @@ static mode_t umask_value; /* If true, change the modes of directories recursively. */ static bool recurse; -/* If true, force silence (no error messages). */ +/* If true, force silence (suppress most of error messages). */ static bool force_silent; /* If true, diagnose surprises from naive misuses like "chmod -r file". @@ -124,7 +121,7 @@ mode_changed (char const *file, mode_t old_mode, mode_t new_mode) if (stat (file, &new_stats) != 0) { - if (!force_silent) + if (! force_silent) error (0, errno, _("getting new attributes of %s"), quote (file)); return false; } @@ -206,21 +203,31 @@ process_file (FTS *fts, FTSENT *ent) fts_set (fts, ent, FTS_AGAIN); return true; } - error (0, ent->fts_errno, _("cannot access %s"), quote (file_full_name)); + if (! force_silent) + error (0, ent->fts_errno, _("cannot access %s"), + quote (file_full_name)); ok = false; break; case FTS_ERR: - error (0, ent->fts_errno, _("%s"), quote (file_full_name)); + if (! force_silent) + error (0, ent->fts_errno, _("%s"), quote (file_full_name)); ok = false; break; case FTS_DNR: - error (0, ent->fts_errno, _("cannot read directory %s"), - quote (file_full_name)); + if (! force_silent) + error (0, ent->fts_errno, _("cannot read directory %s"), + quote (file_full_name)); ok = false; break; + case FTS_SLNONE: + if (! force_silent) + error (0, 0, _("cannot operate on dangling symlink %s"), + quote (file_full_name)); + ok = false; + default: break; } @@ -317,7 +324,8 @@ process_files (char **files, int bit_flags) if (errno != 0) { /* FIXME: try to give a better message */ - error (0, errno, _("fts_read failed")); + if (! force_silent) + error (0, errno, _("fts_read failed")); ok = false; } break; @@ -369,7 +377,7 @@ Change the mode of each FILE to MODE.\n\ \n\ Each MODE is of the form `[ugoa]*([-+=]([rwxXst]*|[ugo]))+'.\n\ "), stdout); - printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT); + emit_bug_reporting_address (); } exit (status); } @@ -389,7 +397,7 @@ main (int argc, char **argv) int c; initialize_main (&argc, &argv); - program_name = argv[0]; + set_program_name (argv[0]); setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); @@ -526,7 +534,8 @@ main (int argc, char **argv) root_dev_ino = NULL; } - ok = process_files (argv + optind, FTS_COMFOLLOW | FTS_PHYSICAL); + ok = process_files (argv + optind, + FTS_COMFOLLOW | FTS_PHYSICAL | FTS_DEFER_STAT); exit (ok ? EXIT_SUCCESS : EXIT_FAILURE); } diff --git a/src/bin/coreutils/src/chown-core.c b/src/bin/coreutils/src/chown-core.c index bd987a8c18..587b26ebc1 100644 --- a/src/bin/coreutils/src/chown-core.c +++ b/src/bin/coreutils/src/chown-core.c @@ -1,10 +1,10 @@ /* chown-core.c -- core functions for changing ownership. - Copyright (C) 2000, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation. + Copyright (C) 2000, 2002-2008 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Extracted from chown.c/chgrp.c and librarified by Jim Meyering. */ @@ -26,8 +25,6 @@ #include "system.h" #include "chown-core.h" #include "error.h" -#include "inttostr.h" -#include "openat.h" #include "quote.h" #include "root-dev-ino.h" #include "xfts.h" @@ -299,18 +296,22 @@ change_file_owner (FTS *fts, FTSENT *ent, fts_set (fts, ent, FTS_AGAIN); return true; } - error (0, ent->fts_errno, _("cannot access %s"), quote (file_full_name)); + if (! chopt->force_silent) + error (0, ent->fts_errno, _("cannot access %s"), + quote (file_full_name)); ok = false; break; case FTS_ERR: - error (0, ent->fts_errno, _("%s"), quote (file_full_name)); + if (! chopt->force_silent) + error (0, ent->fts_errno, _("%s"), quote (file_full_name)); ok = false; break; case FTS_DNR: - error (0, ent->fts_errno, _("cannot read directory %s"), - quote (file_full_name)); + if (! chopt->force_silent) + error (0, ent->fts_errno, _("cannot read directory %s"), + quote (file_full_name)); ok = false; break; @@ -341,8 +342,9 @@ change_file_owner (FTS *fts, FTSENT *ent, { if (fstatat (fts->fts_cwd_fd, file, &stat_buf, 0) != 0) { - error (0, errno, _("cannot dereference %s"), - quote (file_full_name)); + if (! chopt->force_silent) + error (0, errno, _("cannot dereference %s"), + quote (file_full_name)); ok = false; } @@ -420,7 +422,7 @@ change_file_owner (FTS *fts, FTSENT *ent, } } - /* On some systems (e.g., Linux-2.4.x), + /* On some systems (e.g., GNU/Linux 2.4.x), the chown function resets the `special' permission bits. Do *not* restore those bits; doing so would open a window in which a malicious user, M, could subvert a chown command run @@ -495,7 +497,8 @@ chown_files (char **files, int bit_flags, if (errno != 0) { /* FIXME: try to give a better message */ - error (0, errno, _("fts_read failed")); + if (! chopt->force_silent) + error (0, errno, _("fts_read failed")); ok = false; } break; diff --git a/src/bin/coreutils/src/chown-core.h b/src/bin/coreutils/src/chown-core.h index 1c83cfc524..fe0b4dbe49 100644 --- a/src/bin/coreutils/src/chown-core.h +++ b/src/bin/coreutils/src/chown-core.h @@ -1,11 +1,11 @@ /* chown-core.h -- types and prototypes shared by chown and chgrp. - Copyright (C) 2000, 2003, 2004 Free Software Foundation. + Copyright (C) 2000, 2003-2005, 2007-2008 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ #ifndef CHOWN_CORE_H # define CHOWN_CORE_H diff --git a/src/bin/coreutils/src/chown.c b/src/bin/coreutils/src/chown.c index 63a32f5bff..00cdb242b3 100644 --- a/src/bin/coreutils/src/chown.c +++ b/src/bin/coreutils/src/chown.c @@ -1,10 +1,10 @@ /* chown -- change user and group ownership of files - Copyright (C) 89, 90, 91, 1995-2006 Free Software Foundation, Inc. + Copyright (C) 89, 90, 91, 1995-2009 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* | user @@ -44,10 +43,9 @@ /* The official name of this program (e.g., no `g' prefix). */ #define PROGRAM_NAME "chown" -#define AUTHORS "David MacKenzie", "Jim Meyering" - -/* The name the program was run with. */ -char *program_name; +#define AUTHORS \ + proper_name ("David MacKenzie"), \ + proper_name ("Jim Meyering") /* The argument to the --reference option. Use the owner and group IDs of this file. This file must exist. */ @@ -155,7 +153,7 @@ Examples:\n\ %s -hR root /u Change the owner of /u and subfiles to \"root\".\n\ "), program_name, program_name, program_name); - printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT); + emit_bug_reporting_address (); } exit (status); } @@ -185,7 +183,7 @@ main (int argc, char **argv) int optc; initialize_main (&argc, &argv); - program_name = argv[0]; + set_program_name (argv[0]); setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); @@ -239,7 +237,7 @@ main (int argc, char **argv) &required_uid, &required_gid, &u_dummy, &g_dummy); if (e) - error (EXIT_FAILURE, 0, "%s: %s", quote (optarg), e); + error (EXIT_FAILURE, 0, "%s: %s", e, quote (optarg)); break; } @@ -308,13 +306,13 @@ main (int argc, char **argv) const char *e = parse_user_spec (argv[optind], &uid, &gid, &chopt.user_name, &chopt.group_name); if (e) - error (EXIT_FAILURE, 0, "%s: %s", quote (argv[optind]), e); + error (EXIT_FAILURE, 0, "%s: %s", e, quote (argv[optind])); /* If a group is specified but no user, set the user name to the empty string so that diagnostics say "ownership :GROUP" rather than "group GROUP". */ if (!chopt.user_name && chopt.group_name) - chopt.user_name = ""; + chopt.user_name = bad_cast (""); optind++; } @@ -328,6 +326,7 @@ main (int argc, char **argv) quote ("/")); } + bit_flags |= FTS_DEFER_STAT; ok = chown_files (argv + optind, bit_flags, uid, gid, required_uid, required_gid, &chopt); diff --git a/src/bin/coreutils/src/chroot.c b/src/bin/coreutils/src/chroot.c index d2ae0e5802..6d3fddf772 100644 --- a/src/bin/coreutils/src/chroot.c +++ b/src/bin/coreutils/src/chroot.c @@ -1,10 +1,11 @@ /* chroot -- run command or shell with special root directory - Copyright (C) 95, 96, 1997, 1999-2004 Free Software Foundation, Inc. + Copyright (C) 95, 96, 1997, 1999-2004, 2007-2009 + Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Roland McGrath. */ @@ -30,10 +30,7 @@ /* The official name of this program (e.g., no `g' prefix). */ #define PROGRAM_NAME "chroot" -#define AUTHORS "Roland McGrath" - -/* The name this program was run with, for error messages. */ -char *program_name; +#define AUTHORS proper_name ("Roland McGrath") void usage (int status) @@ -44,7 +41,7 @@ usage (int status) else { printf (_("\ -Usage: %s NEWROOT [COMMAND...]\n\ +Usage: %s NEWROOT [COMMAND [ARG]...]\n\ or: %s OPTION\n\ "), program_name, program_name); fputs (_("\ @@ -57,7 +54,7 @@ Run COMMAND with root directory set to NEWROOT.\n\ \n\ If no command is given, run ``${SHELL} -i'' (default: /bin/sh).\n\ "), stdout); - printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT); + emit_bug_reporting_address (); } exit (status); } @@ -66,39 +63,40 @@ int main (int argc, char **argv) { initialize_main (&argc, &argv); - program_name = argv[0]; + set_program_name (argv[0]); setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); - initialize_exit_failure (EXIT_FAIL); + initialize_exit_failure (EXIT_FAILURE); atexit (close_stdout); - parse_long_options (argc, argv, PROGRAM_NAME, GNU_PACKAGE, VERSION, + parse_long_options (argc, argv, PROGRAM_NAME, PACKAGE_NAME, Version, usage, AUTHORS, (char const *) NULL); if (getopt_long (argc, argv, "+", NULL, NULL) != -1) - usage (EXIT_FAIL); + usage (EXIT_FAILURE); if (argc <= optind) { error (0, 0, _("missing operand")); - usage (EXIT_FAIL); + usage (EXIT_FAILURE); } if (chroot (argv[optind]) != 0) - error (EXIT_FAIL, errno, _("cannot change root directory to %s"), argv[1]); + error (EXIT_FAILURE, errno, _("cannot change root directory to %s"), + argv[optind]); if (chdir ("/")) - error (EXIT_FAIL, errno, _("cannot chdir to root directory")); + error (EXIT_FAILURE, errno, _("cannot chdir to root directory")); if (argc == optind + 1) { /* No command. Run an interactive shell. */ char *shell = getenv ("SHELL"); if (shell == NULL) - shell = "/bin/sh"; + shell = bad_cast ("/bin/sh"); argv[0] = shell; - argv[1] = "-i"; + argv[1] = bad_cast ("-i"); argv[2] = NULL; } else diff --git a/src/bin/coreutils/src/cksum.c b/src/bin/coreutils/src/cksum.c index d93877fa50..2893d303b6 100644 --- a/src/bin/coreutils/src/cksum.c +++ b/src/bin/coreutils/src/cksum.c @@ -1,10 +1,10 @@ /* cksum -- calculate and print POSIX checksums and sizes of files - Copyright (C) 92, 1995-2006 Free Software Foundation, Inc. + Copyright (C) 92, 1995-2006, 2008 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Q. Frank Xia, qx@math.columbia.edu. Cosmetic changes and reorganization by David MacKenzie, djm@gnu.ai.mit.edu. @@ -38,12 +37,13 @@ /* The official name of this program (e.g., no `g' prefix). */ #define PROGRAM_NAME "cksum" -#define AUTHORS "Q. Frank Xia" +#define AUTHORS proper_name ("Q. Frank Xia") #include #include #include #include "system.h" +#include "xfreopen.h" #ifdef CRCTAB @@ -109,14 +109,10 @@ main (void) # include # include "long-options.h" # include "error.h" -# include "inttostr.h" /* Number of bytes to read at once. */ # define BUFLEN (1 << 16) -/* The name this program was run with. */ -char *program_name; - static uint_fast32_t const crctab[256] = { 0x00000000, @@ -197,7 +193,7 @@ cksum (const char *file, bool print_name) fp = stdin; have_read_stdin = true; if (O_BINARY && ! isatty (STDIN_FILENO)) - freopen (NULL, "rb", stdin); + xfreopen (NULL, "rb", stdin); } else { @@ -273,7 +269,7 @@ Print CRC checksum and byte counts of each FILE.\n\ "), stdout); fputs (HELP_OPTION_DESCRIPTION, stdout); fputs (VERSION_OPTION_DESCRIPTION, stdout); - printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT); + emit_bug_reporting_address (); } exit (status); } @@ -285,14 +281,14 @@ main (int argc, char **argv) bool ok; initialize_main (&argc, &argv); - program_name = argv[0]; + set_program_name (argv[0]); setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); atexit (close_stdout); - parse_long_options (argc, argv, PROGRAM_NAME, PACKAGE, VERSION, + parse_long_options (argc, argv, PROGRAM_NAME, PACKAGE, Version, usage, AUTHORS, (char const *) NULL); if (getopt_long (argc, argv, "", NULL, NULL) != -1) usage (EXIT_FAILURE); diff --git a/src/bin/coreutils/src/comm.c b/src/bin/coreutils/src/comm.c index 9b7e03f1f9..3c5b09ad4d 100644 --- a/src/bin/coreutils/src/comm.c +++ b/src/bin/coreutils/src/comm.c @@ -1,10 +1,10 @@ /* comm -- compare two sorted files line by line. - Copyright (C) 86, 90, 91, 1995-2005 Free Software Foundation, Inc. + Copyright (C) 86, 90, 91, 1995-2005, 2008-2009 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Richard Stallman and David MacKenzie. */ @@ -24,23 +23,22 @@ #include "system.h" #include "linebuffer.h" #include "error.h" -#include "hard-locale.h" #include "quote.h" #include "stdio--.h" +#include "memcmp2.h" #include "xmemcoll.h" /* The official name of this program (e.g., no `g' prefix). */ #define PROGRAM_NAME "comm" -#define AUTHORS "Richard Stallman", "David MacKenzie" +#define AUTHORS \ + proper_name ("Richard M. Stallman"), \ + proper_name ("David MacKenzie") /* Undefine, to avoid warning about redefinition on some systems. */ #undef min #define min(x, y) ((x) < (y) ? (x) : (y)) -/* The name this program was run with. */ -char *program_name; - /* True if the LC_COLLATE locale is hard. */ static bool hard_LC_COLLATE; @@ -53,8 +51,39 @@ static bool only_file_2; /* If true, print lines that are found in both files. */ static bool both; +/* If nonzero, we have seen at least one unpairable line. */ +static bool seen_unpairable; + +/* If nonzero, we have warned about disorder in that file. */ +static bool issued_disorder_warning[2]; + +/* If nonzero, check that the input is correctly ordered. */ +static enum + { + CHECK_ORDER_DEFAULT, + CHECK_ORDER_ENABLED, + CHECK_ORDER_DISABLED + } check_input_order; + +/* Output columns will be delimited with this string, which may be set + on the command-line with --output-delimiter=STR. The default is a + single TAB character. */ +static char const *delimiter; + +/* For long options that have no equivalent short option, use a + non-character as a pseudo short option, starting with CHAR_MAX + 1. */ +enum +{ + CHECK_ORDER_OPTION = CHAR_MAX + 1, + NOCHECK_ORDER_OPTION, + OUTPUT_DELIMITER_OPTION +}; + static struct option const long_options[] = { + {"check-order", no_argument, NULL, CHECK_ORDER_OPTION}, + {"nocheck-order", no_argument, NULL, NOCHECK_ORDER_OPTION}, + {"output-delimiter", required_argument, NULL, OUTPUT_DELIMITER_OPTION}, {GETOPT_HELP_OPTION_DECL}, {GETOPT_VERSION_OPTION_DECL}, {NULL, 0, NULL, 0} @@ -88,10 +117,23 @@ and column three contains lines common to both files.\n\ -1 suppress lines unique to FILE1\n\ -2 suppress lines unique to FILE2\n\ -3 suppress lines that appear in both files\n\ +"), stdout); + fputs (_("\ +\n\ + --check-order check that the input is correctly sorted, even\n\ + if all input lines are pairable\n\ + --nocheck-order do not check that the input is correctly sorted\n\ +"), stdout); + fputs (_("\ + --output-delimiter=STR separate columns with STR\n\ "), stdout); fputs (HELP_OPTION_DESCRIPTION, stdout); fputs (VERSION_OPTION_DESCRIPTION, stdout); - printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT); + fputs (_("\ +\n\ +Note, comparisons honor the rules specified by `LC_COLLATE'.\n\ +"), stdout); + emit_bug_reporting_address (); } exit (status); } @@ -102,7 +144,7 @@ and column three contains lines common to both files.\n\ 2 for a line only in file 2, 3 for a line in both. */ static void -writeline (const struct linebuffer *line, FILE *stream, int class) +writeline (struct linebuffer const *line, FILE *stream, int class) { switch (class) { @@ -114,26 +156,71 @@ writeline (const struct linebuffer *line, FILE *stream, int class) case 2: if (!only_file_2) return; - /* Print a TAB if we are printing lines from file 1. */ + /* Print a delimiter if we are printing lines from file 1. */ if (only_file_1) - putc ('\t', stream); + fputs (delimiter, stream); break; case 3: if (!both) return; - /* Print a TAB if we are printing lines from file 1. */ + /* Print a delimiter if we are printing lines from file 1. */ if (only_file_1) - putc ('\t', stream); - /* Print a TAB if we are printing lines from file 2. */ + fputs (delimiter, stream); + /* Print a delimiter if we are printing lines from file 2. */ if (only_file_2) - putc ('\t', stream); + fputs (delimiter, stream); break; } fwrite (line->buffer, sizeof (char), line->length, stream); } +/* Check that successive input lines PREV and CURRENT from input file + WHATFILE are presented in order. + + If the user specified --nocheck-order, the check is not made. + If the user specified --check-order, the problem is fatal. + Otherwise (the default), the message is simply a warning. + + A message is printed at most once per input file. + + This funtion was copied (nearly) verbatim from `src/join.c'. */ + +static void +check_order (struct linebuffer const *prev, + struct linebuffer const *current, + int whatfile) +{ + + if (check_input_order != CHECK_ORDER_DISABLED + && ((check_input_order == CHECK_ORDER_ENABLED) || seen_unpairable)) + { + if (!issued_disorder_warning[whatfile - 1]) + { + int order; + + if (hard_LC_COLLATE) + order = xmemcoll (prev->buffer, prev->length - 1, + current->buffer, current->length - 1); + else + order = memcmp2 (prev->buffer, prev->length - 1, + current->buffer, current->length - 1); + + if (0 < order) + { + error ((check_input_order == CHECK_ORDER_ENABLED + ? EXIT_FAILURE : 0), + 0, _("file %d is not in sorted order"), whatfile); + + /* If we get to here, the message was just a warning, but we + want only to issue it once. */ + issued_disorder_warning[whatfile - 1] = true; + } + } + } +} + /* Compare INFILES[0] and INFILES[1]. If either is "-", use the standard input for that file. Assume that each input file is sorted; @@ -142,28 +229,42 @@ writeline (const struct linebuffer *line, FILE *stream, int class) static void compare_files (char **infiles) { - /* For each file, we have one linebuffer in lb1. */ - struct linebuffer lb1[2]; + /* For each file, we have four linebuffers in lba. */ + struct linebuffer lba[2][4]; /* thisline[i] points to the linebuffer holding the next available line in file i, or is NULL if there are no lines left in that file. */ struct linebuffer *thisline[2]; + /* all_line[i][alt[i][0]] also points to the linebuffer holding the + current line in file i. We keep two buffers of history around so we + can look two lines back when we get to the end of a file. */ + struct linebuffer *all_line[2][4]; + + /* This is used to rotate through the buffers for each input file. */ + int alt[2][3]; + /* streams[i] holds the input stream for file i. */ FILE *streams[2]; - int i; + int i, j; /* Initialize the storage. */ for (i = 0; i < 2; i++) { - initbuffer (&lb1[i]); - thisline[i] = &lb1[i]; + for (j = 0; j < 4; j++) + { + initbuffer (&lba[i][j]); + all_line[i][j] = &lba[i][j]; + } + alt[i][0] = 0; + alt[i][1] = 0; + alt[i][2] = 0; streams[i] = (STREQ (infiles[i], "-") ? stdin : fopen (infiles[i], "r")); if (!streams[i]) error (EXIT_FAILURE, errno, "%s", infiles[i]); - thisline[i] = readlinebuffer (thisline[i], streams[i]); + thisline[i] = readlinebuffer (all_line[i][alt[i][0]], streams[i]); if (ferror (streams[i])) error (EXIT_FAILURE, errno, "%s", infiles[i]); } @@ -171,6 +272,7 @@ compare_files (char **infiles) while (thisline[0] || thisline[1]) { int order; + bool fill_up[2] = { false, false }; /* Compare the next available lines of the two files. */ @@ -197,25 +299,47 @@ compare_files (char **infiles) /* Output the line that is lesser. */ if (order == 0) writeline (thisline[1], stdout, 3); - else if (order > 0) - writeline (thisline[1], stdout, 2); else - writeline (thisline[0], stdout, 1); + { + seen_unpairable = true; + if (order <= 0) + writeline (thisline[0], stdout, 1); + else + writeline (thisline[1], stdout, 2); + } /* Step the file the line came from. If the files match, step both files. */ - if (order >= 0) - { - thisline[1] = readlinebuffer (thisline[1], streams[1]); - if (ferror (streams[1])) - error (EXIT_FAILURE, errno, "%s", infiles[1]); - } + if (0 <= order) + fill_up[1] = true; if (order <= 0) - { - thisline[0] = readlinebuffer (thisline[0], streams[0]); - if (ferror (streams[0])) - error (EXIT_FAILURE, errno, "%s", infiles[0]); - } + fill_up[0] = true; + + for (i = 0; i < 2; i++) + if (fill_up[i]) + { + /* Rotate the buffers for this file. */ + alt[i][2] = alt[i][1]; + alt[i][1] = alt[i][0]; + alt[i][0] = (alt[i][0] + 1) & 0x03; + + thisline[i] = readlinebuffer (all_line[i][alt[i][0]], streams[i]); + + if (thisline[i]) + check_order (all_line[i][alt[i][1]], thisline[i], i + 1); + + /* If this is the end of the file we may need to re-check + the order of the previous two lines, since we might have + discovered an unpairable match since we checked before. */ + else if (all_line[i][alt[i][2]]->buffer) + check_order (all_line[i][alt[i][2]], + all_line[i][alt[i][1]], i + 1); + + if (ferror (streams[i])) + error (EXIT_FAILURE, errno, "%s", infiles[i]); + + fill_up[i] = false; + } } for (i = 0; i < 2; i++) @@ -229,7 +353,7 @@ main (int argc, char **argv) int c; initialize_main (&argc, &argv); - program_name = argv[0]; + set_program_name (argv[0]); setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); @@ -241,6 +365,10 @@ main (int argc, char **argv) only_file_2 = true; both = true; + seen_unpairable = false; + issued_disorder_warning[0] = issued_disorder_warning[1] = false; + check_input_order = CHECK_ORDER_DEFAULT; + while ((c = getopt_long (argc, argv, "123", long_options, NULL)) != -1) switch (c) { @@ -256,6 +384,25 @@ main (int argc, char **argv) both = false; break; + case NOCHECK_ORDER_OPTION: + check_input_order = CHECK_ORDER_DISABLED; + break; + + case CHECK_ORDER_OPTION: + check_input_order = CHECK_ORDER_ENABLED; + break; + + case OUTPUT_DELIMITER_OPTION: + if (delimiter && !STREQ (delimiter, optarg)) + error (EXIT_FAILURE, 0, _("multiple delimiters specified")); + delimiter = optarg; + if (!*delimiter) + { + error (EXIT_FAILURE, 0, _("empty %s not allowed"), + quote ("--output-delimiter")); + } + break; + case_GETOPT_HELP_CHAR; case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS); @@ -279,7 +426,14 @@ main (int argc, char **argv) usage (EXIT_FAILURE); } + /* The default delimiter is a TAB. */ + if (!delimiter) + delimiter = "\t"; + compare_files (argv + optind); - exit (EXIT_SUCCESS); + if (issued_disorder_warning[0] || issued_disorder_warning[1]) + exit (EXIT_FAILURE); + else + exit (EXIT_SUCCESS); } diff --git a/src/bin/coreutils/src/copy.c b/src/bin/coreutils/src/copy.c index 3bb080c357..184c130386 100644 --- a/src/bin/coreutils/src/copy.c +++ b/src/bin/coreutils/src/copy.c @@ -1,10 +1,10 @@ /* copy.c -- core functions for copying files and directories - Copyright (C) 89, 90, 91, 1995-2007 Free Software Foundation. + Copyright (C) 89, 90, 91, 1995-2009 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Extracted from cp.c and librarified by Jim Meyering. */ @@ -21,6 +20,7 @@ #include #include #include +#include #if HAVE_HURD_H # include @@ -35,43 +35,64 @@ #include "buffer-lcm.h" #include "copy.h" #include "cp-hash.h" -#include "euidaccess.h" #include "error.h" #include "fcntl--.h" +#include "file-set.h" #include "filemode.h" #include "filenamecat.h" #include "full-write.h" -#include "getpagesize.h" #include "hash.h" -#include "hash-pjw.h" -#include "lchmod.h" +#include "hash-triple.h" +#include "ignore-value.h" #include "quote.h" #include "same.h" #include "savedir.h" #include "stat-time.h" #include "utimecmp.h" #include "utimens.h" -#include "xreadlink.h" +#include "write-any-file.h" +#include "areadlink.h" #include "yesno.h" #if (defined(__BEOS__) || defined(__HAIKU__)) # include #endif +#if USE_XATTR +# include +# include +# include +# include "verror.h" +#endif + #ifndef HAVE_FCHOWN # define HAVE_FCHOWN false # define fchown(fd, uid, gid) (-1) #endif +#ifndef HAVE_LCHOWN +# define HAVE_LCHOWN false +# define lchown(name, uid, gid) chown (name, uid, gid) +#endif + +#ifndef HAVE_MKFIFO +static int +rpl_mkfifo (char const *file, mode_t mode) +{ + errno = ENOTSUP; + return -1; +} +# define mkfifo rpl_mkfifo +#endif + +#ifndef USE_ACL +# define USE_ACL 0 +#endif + #define SAME_OWNER(A, B) ((A).st_uid == (B).st_uid) #define SAME_GROUP(A, B) ((A).st_gid == (B).st_gid) #define SAME_OWNER_AND_GROUP(A, B) (SAME_OWNER (A, B) && SAME_GROUP (A, B)) -#define UNWRITABLE(File_name, File_mode) \ - ( /* euidaccess is not meaningful for symlinks */ \ - ! S_ISLNK (File_mode) \ - && euidaccess (File_name, W_OK) != 0) - struct dir_list { struct dir_list *parent; @@ -79,15 +100,7 @@ struct dir_list dev_t dev; }; -/* Describe a just-created or just-renamed destination file. */ -struct F_triple -{ - char *name; - ino_t st_ino; - dev_t st_dev; -}; - -/* Initial size of the above hash table. */ +/* Initial size of the cp.dest_info hash table. */ #define DEST_INFO_INITIAL_CAPACITY 61 static bool copy_internal (char const *src_name, char const *dst_name, @@ -95,17 +108,16 @@ static bool copy_internal (char const *src_name, char const *dst_name, struct dir_list *ancestors, const struct cp_options *x, bool command_line_arg, + bool *first_dir_created_per_command_line_arg, bool *copy_into_self, bool *rename_succeeded); +static bool owner_failure_ok (struct cp_options const *x); /* Pointers to the file names: they're used in the diagnostic that is issued when we detect the user is trying to copy a directory into itself. */ static char const *top_level_src_name; static char const *top_level_dst_name; -/* The invocation name of this program. */ -extern char *program_name; - /* FIXME: describe */ /* FIXME: rewrite this to use a hash table so we avoid the quadratic performance hit that's probably noticeable only on trees deeper @@ -185,18 +197,116 @@ copy_attributes_by_name(const char *from, const char *to, int resolveLinks) } +static bool +errno_unsupported (int err) +{ + return err == ENOTSUP || err == ENODATA; +} + +#if USE_XATTR +static void +copy_attr_error (struct error_context *ctx ATTRIBUTE_UNUSED, + char const *fmt, ...) +{ + int err = errno; + va_list ap; + + if (!errno_unsupported (errno)) + if (errno != ENOTSUP && errno != ENODATA) + { + /* use verror module to print error message */ + va_start (ap, fmt); + verror (0, err, fmt, ap); + va_end (ap); + } +} + +static void +copy_attr_allerror (struct error_context *ctx ATTRIBUTE_UNUSED, + char const *fmt, ...) +{ + int err = errno; + va_list ap; + + /* use verror module to print error message */ + va_start (ap, fmt); + verror (0, err, fmt, ap); + va_end (ap); +} + +static char const * +copy_attr_quote (struct error_context *ctx ATTRIBUTE_UNUSED, char const *str) +{ + return quote (str); +} + +static void +copy_attr_free (struct error_context *ctx ATTRIBUTE_UNUSED, + char const *str ATTRIBUTE_UNUSED) +{ +} + +static bool +copy_attr_by_fd (char const *src_path, int src_fd, + char const *dst_path, int dst_fd, const struct cp_options *x) +{ + struct error_context ctx = + { + .error = x->require_preserve_xattr ? copy_attr_allerror : copy_attr_error, + .quote = copy_attr_quote, + .quote_free = copy_attr_free + }; + return 0 == attr_copy_fd (src_path, src_fd, dst_path, dst_fd, 0, + (x->reduce_diagnostics + && !x->require_preserve_xattr)? NULL : &ctx); +} + +static bool +copy_attr_by_name (char const *src_path, char const *dst_path, + const struct cp_options *x) +{ + struct error_context ctx = + { + .error = x->require_preserve_xattr ? copy_attr_allerror : copy_attr_error, + .quote = copy_attr_quote, + .quote_free = copy_attr_free + }; + return 0 == attr_copy_file (src_path, dst_path, 0, + (x-> reduce_diagnostics + && !x->require_preserve_xattr) ? NULL : &ctx); +} +#else /* USE_XATTR */ + +static bool +copy_attr_by_fd (char const *src_path, int src_fd, + char const *dst_path, int dst_fd, const struct cp_options *x) +{ + return true; +} + +static bool +copy_attr_by_name (char const *src_path, char const *dst_path, + const struct cp_options *x) +{ + return true; +} +#endif /* USE_XATTR */ + /* Read the contents of the directory SRC_NAME_IN, and recursively copy the contents to DST_NAME_IN. NEW_DST is true if DST_NAME_IN is a directory that was created previously in the recursion. SRC_SB and ANCESTORS describe SRC_NAME_IN. Set *COPY_INTO_SELF if SRC_NAME_IN is a parent of + FIRST_DIR_CREATED_PER_COMMAND_LINE_ARG FIXME (or the same as) DST_NAME_IN; otherwise, clear it. Return true if successful. */ static bool copy_dir (char const *src_name_in, char const *dst_name_in, bool new_dst, const struct stat *src_sb, struct dir_list *ancestors, - const struct cp_options *x, bool *copy_into_self) + const struct cp_options *x, + bool *first_dir_created_per_command_line_arg, + bool *copy_into_self) { char *name_space; char *namep; @@ -230,12 +340,19 @@ copy_dir (char const *src_name_in, char const *dst_name_in, bool new_dst, ok &= copy_internal (src_name, dst_name, new_dst, src_sb->st_dev, ancestors, &non_command_line_options, false, + first_dir_created_per_command_line_arg, &local_copy_into_self, NULL); *copy_into_self |= local_copy_into_self; free (dst_name); free (src_name); + /* If we're copying into self, there's no point in continuing, + and in fact, that would even infloop, now that we record only + the first created directory per command line argument. */ + if (local_copy_into_self) + break; + namep += strlen (namep) + 1; } free (name_space); @@ -244,24 +361,73 @@ copy_dir (char const *src_name_in, char const *dst_name_in, bool new_dst, /* Set the owner and owning group of DEST_DESC to the st_uid and st_gid fields of SRC_SB. If DEST_DESC is undefined (-1), set - the owner and owning group of DST_NAME instead. DEST_DESC must + the owner and owning group of DST_NAME instead; for + safety prefer lchown if the system supports it since no + symbolic links should be involved. DEST_DESC must refer to the same file as DEST_NAME if defined. - Return 1 if the syscall succeeds, 0 if it fails but it's OK + Upon failure to set both UID and GID, try to set only the GID. + NEW_DST is true if the file was newly created; otherwise, + DST_SB is the status of the destination. + Return 1 if the initial syscall succeeds, 0 if it fails but it's OK not to preserve ownership, -1 otherwise. */ static int set_owner (const struct cp_options *x, char const *dst_name, int dest_desc, - uid_t uid, gid_t gid) + struct stat const *src_sb, bool new_dst, + struct stat const *dst_sb) { + uid_t uid = src_sb->st_uid; + gid_t gid = src_sb->st_gid; + + /* Naively changing the ownership of an already-existing file before + changing its permissions would create a window of vulnerability if + the file's old permissions are too generous for the new owner and + group. Avoid the window by first changing to a restrictive + temporary mode if necessary. */ + + if (!new_dst && (x->preserve_mode | x->move_mode | x->set_mode)) + { + mode_t old_mode = dst_sb->st_mode; + mode_t new_mode = + (x->preserve_mode | x->move_mode ? src_sb->st_mode : x->mode); + mode_t restrictive_temp_mode = old_mode & new_mode & S_IRWXU; + + if ((USE_ACL + || (old_mode & CHMOD_MODE_BITS + & (~new_mode | S_ISUID | S_ISGID | S_ISVTX))) + && qset_acl (dst_name, dest_desc, restrictive_temp_mode) != 0) + { + if (! owner_failure_ok (x)) + error (0, errno, _("clearing permissions for %s"), quote (dst_name)); + return -x->require_preserve; + } + } + if (HAVE_FCHOWN && dest_desc != -1) { if (fchown (dest_desc, uid, gid) == 0) return 1; + if (errno == EPERM || errno == EINVAL) + { + /* We've failed to set *both*. Now, try to set just the group + ID, but ignore any failure here, and don't change errno. */ + int saved_errno = errno; + ignore_value (fchown (dest_desc, -1, gid)); + errno = saved_errno; + } } else { - if (chown (dst_name, uid, gid) == 0) + if (lchown (dst_name, uid, gid) == 0) return 1; + if (errno == EPERM || errno == EINVAL) + { + /* We've failed to set *both*. Now, try to set just the group + ID, but ignore any failure here, and don't change errno. */ + int saved_errno = errno; + ignore_value (lchown (dst_name, -1, gid)); + errno = saved_errno; + } } if (! chown_failure_ok (x)) @@ -284,6 +450,9 @@ static void set_author (const char *dst_name, int dest_desc, const struct stat *src_sb) { #if HAVE_STRUCT_STAT_ST_AUTHOR + /* FIXME: Modify the following code so that it does not + follow symbolic links. */ + /* Preserve the st_author field. */ file_t file = (dest_desc < 0 ? file_name_lookup (dst_name, 0, 0) @@ -298,6 +467,10 @@ set_author (const char *dst_name, int dest_desc, const struct stat *src_sb) quote (dst_name)); mach_port_deallocate (mach_task_self (), file); } +#else + (void) dst_name; + (void) dest_desc; + (void) src_sb; #endif } @@ -334,14 +507,18 @@ copy_reg (char const *src_name, char const *dst_name, { char *buf; char *buf_alloc = NULL; + char *name_alloc = NULL; int dest_desc; + int dest_errno; int source_desc; mode_t src_mode = src_sb->st_mode; struct stat sb; struct stat src_open_sb; bool return_val = true; - source_desc = open (src_name, O_RDONLY | O_BINARY); + source_desc = open (src_name, + (O_RDONLY | O_BINARY + | (x->dereference == DEREF_NEVER ? O_NOFOLLOW : 0))); if (source_desc < 0) { error (0, errno, _("cannot open %s for reading"), quote (src_name)); @@ -371,6 +548,45 @@ copy_reg (char const *src_name, char const *dst_name, if (! *new_dst) { dest_desc = open (dst_name, O_WRONLY | O_TRUNC | O_BINARY); + dest_errno = errno; + + /* When using cp --preserve=context to copy to an existing destination, + use the default context rather than that of the source. Why? + 1) the src context may prohibit writing, and + 2) because it's more consistent to use the same context + that is used when the destination file doesn't already exist. */ + if (x->preserve_security_context && 0 <= dest_desc) + { + security_context_t con = NULL; + if (getfscreatecon (&con) < 0) + { + if (!x->reduce_diagnostics || x->require_preserve_context) + error (0, errno, _("failed to get file system create context")); + if (x->require_preserve_context) + { + return_val = false; + goto close_src_and_dst_desc; + } + } + + if (con) + { + if (fsetfilecon (dest_desc, con) < 0) + { + if (!x->reduce_diagnostics || x->require_preserve_context) + error (0, errno, + _("failed to set the security context of %s to %s"), + quote_n (0, dst_name), quote_n (1, con)); + if (x->require_preserve_context) + { + return_val = false; + freecon (con); + goto close_src_and_dst_desc; + } + } + freecon (con); + } + } if (dest_desc < 0 && x->unlink_dest_after_failed_open) { @@ -389,14 +605,50 @@ copy_reg (char const *src_name, char const *dst_name, } if (*new_dst) - dest_desc = open (dst_name, O_WRONLY | O_CREAT | O_EXCL | O_BINARY, - dst_mode & ~omitted_permissions); + { + int open_flags = O_WRONLY | O_CREAT | O_BINARY; + dest_desc = open (dst_name, open_flags | O_EXCL, + dst_mode & ~omitted_permissions); + dest_errno = errno; + + /* When trying to copy through a dangling destination symlink, + the above open fails with EEXIST. If that happens, and + lstat'ing the DST_NAME shows that it is a symlink, then we + have a problem: trying to resolve this dangling symlink to + a directory/destination-entry pair is fundamentally racy, + so punt. If POSIXLY_CORRECT is set, simply call open again, + but without O_EXCL (potentially dangerous). If not, fail + with a diagnostic. These shenanigans are necessary only + when copying, i.e., not in move_mode. */ + if (dest_desc < 0 && dest_errno == EEXIST && ! x->move_mode) + { + struct stat dangling_link_sb; + if (lstat (dst_name, &dangling_link_sb) == 0 + && S_ISLNK (dangling_link_sb.st_mode)) + { + if (x->open_dangling_dest_symlink) + { + dest_desc = open (dst_name, open_flags, + dst_mode & ~omitted_permissions); + dest_errno = errno; + } + else + { + error (0, 0, _("not writing through dangling symlink %s"), + quote (dst_name)); + return_val = false; + goto close_src_desc; + } + } + } + } else omitted_permissions = 0; if (dest_desc < 0) { - error (0, errno, _("cannot create regular file %s"), quote (dst_name)); + error (0, dest_errno, _("cannot create regular file %s"), + quote (dst_name)); return_val = false; goto close_src_desc; } @@ -408,179 +660,170 @@ copy_reg (char const *src_name, char const *dst_name, goto close_src_and_dst_desc; } - if (! (S_ISREG (src_open_sb.st_mode) && src_open_sb.st_size == 0)) - { - typedef uintptr_t word; - off_t n_read_total = 0; + { + typedef uintptr_t word; + off_t n_read_total = 0; - /* Choose a suitable buffer size; it may be adjusted later. */ - size_t buf_alignment = lcm (getpagesize (), sizeof (word)); - size_t buf_alignment_slop = sizeof (word) + buf_alignment - 1; - size_t buf_size = ST_BLKSIZE (sb); + /* Choose a suitable buffer size; it may be adjusted later. */ + size_t buf_alignment = lcm (getpagesize (), sizeof (word)); + size_t buf_alignment_slop = sizeof (word) + buf_alignment - 1; + size_t buf_size = io_blksize (sb); - /* Deal with sparse files. */ - bool last_write_made_hole = false; - bool make_holes = false; + /* Deal with sparse files. */ + bool last_write_made_hole = false; + bool make_holes = false; - if (S_ISREG (sb.st_mode)) - { - /* Even with --sparse=always, try to create holes only - if the destination is a regular file. */ - if (x->sparse_mode == SPARSE_ALWAYS) - make_holes = true; + if (S_ISREG (sb.st_mode)) + { + /* Even with --sparse=always, try to create holes only + if the destination is a regular file. */ + if (x->sparse_mode == SPARSE_ALWAYS) + make_holes = true; #if HAVE_STRUCT_STAT_ST_BLOCKS - /* Use a heuristic to determine whether SRC_NAME contains any sparse - blocks. If the file has fewer blocks than would normally be - needed for a file of its size, then at least one of the blocks in - the file is a hole. */ - if (x->sparse_mode == SPARSE_AUTO && S_ISREG (src_open_sb.st_mode) - && ST_NBLOCKS (src_open_sb) < src_open_sb.st_size / ST_NBLOCKSIZE) - make_holes = true; + /* Use a heuristic to determine whether SRC_NAME contains any sparse + blocks. If the file has fewer blocks than would normally be + needed for a file of its size, then at least one of the blocks in + the file is a hole. */ + if (x->sparse_mode == SPARSE_AUTO && S_ISREG (src_open_sb.st_mode) + && ST_NBLOCKS (src_open_sb) < src_open_sb.st_size / ST_NBLOCKSIZE) + make_holes = true; #endif - } + } - /* If not making a sparse file, try to use a more-efficient - buffer size. */ - if (! make_holes) - { - /* These days there's no point ever messing with buffers smaller - than 8 KiB. It would be nice to configure SMALL_BUF_SIZE - dynamically for this host and pair of files, but there doesn't - seem to be a good way to get readahead info portably. */ - enum { SMALL_BUF_SIZE = 8 * 1024 }; + /* If not making a sparse file, try to use a more-efficient + buffer size. */ + if (! make_holes) + { + /* Compute the least common multiple of the input and output + buffer sizes, adjusting for outlandish values. */ + size_t blcm_max = MIN (SIZE_MAX, SSIZE_MAX) - buf_alignment_slop; + size_t blcm = buffer_lcm (io_blksize (src_open_sb), buf_size, + blcm_max); - /* Compute the least common multiple of the input and output - buffer sizes, adjusting for outlandish values. */ - size_t blcm_max = MIN (SIZE_MAX, SSIZE_MAX) - buf_alignment_slop; - size_t blcm = buffer_lcm (ST_BLKSIZE (src_open_sb), buf_size, - blcm_max); + /* Do not bother with a buffer larger than the input file, plus one + byte to make sure the file has not grown while reading it. */ + if (S_ISREG (src_open_sb.st_mode) && src_open_sb.st_size < buf_size) + buf_size = src_open_sb.st_size + 1; - /* Do not use a block size that is too small. */ - buf_size = MAX (SMALL_BUF_SIZE, blcm); + /* However, stick with a block size that is a positive multiple of + blcm, overriding the above adjustments. Watch out for + overflow. */ + buf_size += blcm - 1; + buf_size -= buf_size % blcm; + if (buf_size == 0 || blcm_max < buf_size) + buf_size = blcm; + } - /* Do not bother with a buffer larger than the input file, plus one - byte to make sure the file has not grown while reading it. */ - if (S_ISREG (src_open_sb.st_mode) && src_open_sb.st_size < buf_size) - buf_size = src_open_sb.st_size + 1; + /* Make a buffer with space for a sentinel at the end. */ + buf_alloc = xmalloc (buf_size + buf_alignment_slop); + buf = ptr_align (buf_alloc, buf_alignment); - /* However, stick with a block size that is a positive multiple of - blcm, overriding the above adjustments. Watch out for - overflow. */ - buf_size += blcm - 1; - buf_size -= buf_size % blcm; - if (buf_size == 0 || blcm_max < buf_size) - buf_size = blcm; - } + for (;;) + { + word *wp = NULL; - /* Make a buffer with space for a sentinel at the end. */ - buf_alloc = xmalloc (buf_size + buf_alignment_slop); - buf = ptr_align (buf_alloc, buf_alignment); - - for (;;) - { - word *wp = NULL; - - ssize_t n_read = read (source_desc, buf, buf_size); - if (n_read < 0) - { + ssize_t n_read = read (source_desc, buf, buf_size); + if (n_read < 0) + { #ifdef EINTR - if (errno == EINTR) - continue; + if (errno == EINTR) + continue; #endif - error (0, errno, _("reading %s"), quote (src_name)); - return_val = false; - goto close_src_and_dst_desc; - } - if (n_read == 0) - break; + error (0, errno, _("reading %s"), quote (src_name)); + return_val = false; + goto close_src_and_dst_desc; + } + if (n_read == 0) + break; - n_read_total += n_read; + n_read_total += n_read; - if (make_holes) - { - char *cp; + if (make_holes) + { + char *cp; - /* Sentinel to stop loop. */ - buf[n_read] = '\1'; + /* Sentinel to stop loop. */ + buf[n_read] = '\1'; #ifdef lint - /* Usually, buf[n_read] is not the byte just before a "word" - (aka uintptr_t) boundary. In that case, the word-oriented - test below (*wp++ == 0) would read some uninitialized bytes - after the sentinel. To avoid false-positive reports about - this condition (e.g., from a tool like valgrind), set the - remaining bytes -- to any value. */ - memset (buf + n_read + 1, 0, sizeof (word) - 1); + /* Usually, buf[n_read] is not the byte just before a "word" + (aka uintptr_t) boundary. In that case, the word-oriented + test below (*wp++ == 0) would read some uninitialized bytes + after the sentinel. To avoid false-positive reports about + this condition (e.g., from a tool like valgrind), set the + remaining bytes -- to any value. */ + memset (buf + n_read + 1, 0, sizeof (word) - 1); #endif - /* Find first nonzero *word*, or the word with the sentinel. */ + /* Find first nonzero *word*, or the word with the sentinel. */ - wp = (word *) buf; - while (*wp++ == 0) - continue; + wp = (word *) buf; + while (*wp++ == 0) + continue; - /* Find the first nonzero *byte*, or the sentinel. */ + /* Find the first nonzero *byte*, or the sentinel. */ - cp = (char *) (wp - 1); - while (*cp++ == 0) - continue; + cp = (char *) (wp - 1); + while (*cp++ == 0) + continue; - if (cp <= buf + n_read) - /* Clear to indicate that a normal write is needed. */ - wp = NULL; - else - { - /* We found the sentinel, so the whole input block was zero. - Make a hole. */ - if (lseek (dest_desc, n_read, SEEK_CUR) < 0) - { - error (0, errno, _("cannot lseek %s"), quote (dst_name)); - return_val = false; - goto close_src_and_dst_desc; - } - last_write_made_hole = true; - } - } + if (cp <= buf + n_read) + /* Clear to indicate that a normal write is needed. */ + wp = NULL; + else + { + /* We found the sentinel, so the whole input block was zero. + Make a hole. */ + if (lseek (dest_desc, n_read, SEEK_CUR) < 0) + { + error (0, errno, _("cannot lseek %s"), quote (dst_name)); + return_val = false; + goto close_src_and_dst_desc; + } + last_write_made_hole = true; + } + } - if (!wp) - { - size_t n = n_read; - if (full_write (dest_desc, buf, n) != n) - { - error (0, errno, _("writing %s"), quote (dst_name)); - return_val = false; - goto close_src_and_dst_desc; - } - last_write_made_hole = false; + if (!wp) + { + size_t n = n_read; + if (full_write (dest_desc, buf, n) != n) + { + error (0, errno, _("writing %s"), quote (dst_name)); + return_val = false; + goto close_src_and_dst_desc; + } + last_write_made_hole = false; - /* A short read on a regular file means EOF. */ - if (n_read != buf_size && S_ISREG (src_open_sb.st_mode)) - break; - } - } + /* It is tempting to return early here upon a short read from a + regular file. That would save the final read syscall for each + file. Unfortunately that doesn't work for certain files in + /proc with linux kernels from at least 2.6.9 .. 2.6.29. */ + } + } - /* If the file ends with a `hole', we need to do something to record - the length of the file. On modern systems, calling ftruncate does - the job. On systems without native ftruncate support, we have to - write a byte at the ending position. Otherwise the kernel would - truncate the file at the end of the last write operation. */ + /* If the file ends with a `hole', we need to do something to record + the length of the file. On modern systems, calling ftruncate does + the job. On systems without native ftruncate support, we have to + write a byte at the ending position. Otherwise the kernel would + truncate the file at the end of the last write operation. */ - if (last_write_made_hole) - { - if (HAVE_FTRUNCATE - ? /* ftruncate sets the file size, - so there is no need for a write. */ - ftruncate (dest_desc, n_read_total) < 0 - : /* Seek backwards one character and write a null. */ - (lseek (dest_desc, (off_t) -1, SEEK_CUR) < 0L - || full_write (dest_desc, "", 1) != 1)) - { - error (0, errno, _("writing %s"), quote (dst_name)); - return_val = false; - goto close_src_and_dst_desc; - } - } - } + if (last_write_made_hole) + { + if (HAVE_FTRUNCATE + ? /* ftruncate sets the file size, + so there is no need for a write. */ + ftruncate (dest_desc, n_read_total) < 0 + : /* Seek backwards one character and write a null. */ + (lseek (dest_desc, (off_t) -1, SEEK_CUR) < 0L + || full_write (dest_desc, "", 1) != 1)) + { + error (0, errno, _("writing %s"), quote (dst_name)); + return_val = false; + goto close_src_and_dst_desc; + } + } + } if (x->preserve_timestamps) { @@ -588,7 +831,7 @@ copy_reg (char const *src_name, char const *dst_name, timespec[0] = get_stat_atime (src_sb); timespec[1] = get_stat_mtime (src_sb); - if (futimens (dest_desc, dst_name, timespec) != 0) + if (gl_futimens (dest_desc, dst_name, timespec) != 0) { error (0, errno, _("preserving times for %s"), quote (dst_name)); if (x->require_preserve) @@ -601,8 +844,7 @@ copy_reg (char const *src_name, char const *dst_name, if (x->preserve_ownership && ! SAME_OWNER_AND_GROUP (*src_sb, sb)) { - switch (set_owner (x, dst_name, dest_desc, - src_sb->st_uid, src_sb->st_gid)) + switch (set_owner (x, dst_name, dest_desc, src_sb, *new_dst, &sb)) { case -1: return_val = false; @@ -616,6 +858,11 @@ copy_reg (char const *src_name, char const *dst_name, set_author (dst_name, dest_desc, src_sb); + if (x->preserve_xattr && ! copy_attr_by_fd (src_name, source_desc, + dst_name, dest_desc, x) + && x->require_preserve_xattr) + return false; + if (x->preserve_mode || x->move_mode) { if (copy_acl (src_name, source_desc, dst_name, dest_desc, src_mode) != 0 @@ -659,6 +906,7 @@ close_src_desc: } free (buf_alloc); + free (name_alloc); return return_val; } @@ -868,10 +1116,20 @@ same_file_ok (char const *src_name, struct stat const *src_sb, return false; } +/* Return true if FILE, with mode MODE, is writable in the sense of 'mv'. + Always consider a symbolic link to be writable. */ +static bool +writable_destination (char const *file, mode_t mode) +{ + return (S_ISLNK (mode) + || can_write_any_file () + || euidaccess (file, W_OK) == 0); +} + static void overwrite_prompt (char const *dst_name, struct stat const *dst_sb) { - if (euidaccess (dst_name, W_OK) != 0) + if (! writable_destination (dst_name, dst_sb->st_mode)) { char perms[12]; /* "-rwxrwxrwx " ls-style modes. */ strmode (dst_sb->st_mode, perms); @@ -889,54 +1147,6 @@ overwrite_prompt (char const *dst_name, struct stat const *dst_sb) } } -/* Hash an F_triple. */ -static size_t -triple_hash (void const *x, size_t table_size) -{ - struct F_triple const *p = x; - - /* Also take the name into account, so that when moving N hard links to the - same file (all listed on the command line) all into the same directory, - we don't experience any N^2 behavior. */ - /* FIXME-maybe: is it worth the overhead of doing this - just to avoid N^2 in such an unusual case? N would have - to be very large to make the N^2 factor noticable, and - one would probably encounter a limit on the length of - a command line before it became a problem. */ - size_t tmp = hash_pjw (p->name, table_size); - - /* Ignoring the device number here should be fine. */ - return (tmp | p->st_ino) % table_size; -} - -/* Hash an F_triple. */ -static size_t -triple_hash_no_name (void const *x, size_t table_size) -{ - struct F_triple const *p = x; - - /* Ignoring the device number here should be fine. */ - return p->st_ino % table_size; -} - -/* Compare two F_triple structs. */ -static bool -triple_compare (void const *x, void const *y) -{ - struct F_triple const *a = x; - struct F_triple const *b = y; - return (SAME_INODE (*a, *b) && same_name (a->name, b->name)) ? true : false; -} - -/* Free an F_triple. */ -static void -triple_free (void *x) -{ - struct F_triple *a = x; - free (a->name); - free (a); -} - /* Initialize the hash table implementing a set of F_triple entries corresponding to destination files. */ extern void @@ -972,71 +1182,6 @@ src_info_init (struct cp_options *x) triple_free); } -/* Return true if there is an entry in hash table, HT, - for the file described by FILE and STATS. */ -static bool -seen_file (Hash_table const *ht, char const *file, - struct stat const *stats) -{ - struct F_triple new_ent; - - if (ht == NULL) - return false; - - new_ent.name = (char *) file; - new_ent.st_ino = stats->st_ino; - new_ent.st_dev = stats->st_dev; - - return !!hash_lookup (ht, &new_ent); -} - -/* Record destination file, FILE, and dev/ino from *STATS, - in the hash table, HT. If HT is NULL, return immediately. - If STATS is NULL, call lstat on FILE to get the device - and inode numbers. If that lstat fails, simply return. - If memory allocation fails, exit immediately. */ -static void -record_file (Hash_table *ht, char const *file, - struct stat const *stats) -{ - struct F_triple *ent; - - if (ht == NULL) - return; - - ent = xmalloc (sizeof *ent); - ent->name = xstrdup (file); - if (stats) - { - ent->st_ino = stats->st_ino; - ent->st_dev = stats->st_dev; - } - else - { - struct stat sb; - if (lstat (file, &sb) != 0) - return; - ent->st_ino = sb.st_ino; - ent->st_dev = sb.st_dev; - } - - { - struct F_triple *ent_from_table = hash_insert (ht, ent); - if (ent_from_table == NULL) - { - /* Insertion failed due to lack of memory. */ - xalloc_die (); - } - - if (ent_from_table != ent) - { - /* There was alread a matching entry in the table, so ENT was - not inserted. Free it. */ - triple_free (ent); - } - } -} - /* When effecting a move (e.g., for mv(1)), and given the name DST_NAME of the destination and a corresponding stat buffer, DST_SB, return true if the logical `move' operation should _not_ proceed. @@ -1053,7 +1198,7 @@ abandon_move (const struct cp_options *x, || ((x->interactive == I_ASK_USER || (x->interactive == I_UNSPECIFIED && x->stdin_tty - && UNWRITABLE (dst_name, dst_sb->st_mode))) + && ! writable_destination (dst_name, dst_sb->st_mode))) && (overwrite_prompt (dst_name, dst_sb), 1) && ! yesno ())); } @@ -1070,6 +1215,15 @@ emit_verbose (char const *src, char const *dst, char const *backup_dst_name) putchar ('\n'); } +/* A wrapper around "setfscreatecon (NULL)" that exits upon failure. */ +static void +restore_default_fscreatecon_or_die (void) +{ + if (setfscreatecon (NULL) != 0) + error (EXIT_FAILURE, errno, + _("failed to restore the default file creation context")); +} + /* Copy the file SRC_NAME to the file DST_NAME. The files may be of any type. NEW_DST should be true if the file DST_NAME cannot exist because its parent directory was just created; NEW_DST should @@ -1078,6 +1232,7 @@ emit_verbose (char const *src, char const *dst, char const *backup_dst_name) not known. ANCESTORS points to a linked, null terminated list of devices and inodes of parent directories of SRC_NAME. COMMAND_LINE_ARG is true iff SRC_NAME was specified on the command line. + FIRST_DIR_CREATED_PER_COMMAND_LINE_ARG is both input and output. Set *COPY_INTO_SELF if SRC_NAME is a parent of (or the same as) DST_NAME; otherwise, clear it. Return true if successful. */ @@ -1088,6 +1243,7 @@ copy_internal (char const *src_name, char const *dst_name, struct dir_list *ancestors, const struct cp_options *x, bool command_line_arg, + bool *first_dir_created_per_command_line_arg, bool *copy_into_self, bool *rename_succeeded) { @@ -1104,6 +1260,7 @@ copy_internal (char const *src_name, char const *dst_name, bool delayed_ok; bool copied_as_regular = false; bool preserve_metadata; + bool have_dst_lstat = false; if (x->move_mode && rename_succeeded) *rename_succeeded = false; @@ -1144,7 +1301,23 @@ copy_internal (char const *src_name, char const *dst_name, if (!new_dst) { - if (XSTAT (x, dst_name, &dst_sb) != 0) + /* Regular files can be created by writing through symbolic + links, but other files cannot. So use stat on the + destination when copying a regular file, and lstat otherwise. + However, if we intend to unlink or remove the destination + first, use lstat, since a copy won't actually be made to the + destination in that case. */ + bool use_stat = + ((S_ISREG (src_mode) + || (x->copy_as_regular + && ! (S_ISDIR (src_mode) || S_ISLNK (src_mode)))) + && ! (x->move_mode || x->symbolic_link || x->hard_link + || x->backup_type != no_backups + || x->unlink_dest_before_opening)); + if ((use_stat + ? stat (dst_name, &dst_sb) + : lstat (dst_name, &dst_sb)) + != 0) { if (errno != ENOENT) { @@ -1158,10 +1331,11 @@ copy_internal (char const *src_name, char const *dst_name, } else { /* Here, we know that dst_name exists, at least to the point - that it is XSTAT'able. */ + that it is stat'able or lstat'able. */ bool return_now; bool unlink_src; + have_dst_lstat = !use_stat; if (! same_file_ok (src_name, &src_sb, dst_name, &dst_sb, x, &return_now, &unlink_src)) { @@ -1170,6 +1344,30 @@ copy_internal (char const *src_name, char const *dst_name, return false; } + if (!S_ISDIR (src_mode) && x->update) + { + /* When preserving time stamps (but not moving within a file + system), don't worry if the destination time stamp is + less than the source merely because of time stamp + truncation. */ + int options = ((x->preserve_timestamps + && ! (x->move_mode + && dst_sb.st_dev == src_sb.st_dev)) + ? UTIMECMP_TRUNCATE_SOURCE + : 0); + + if (0 <= utimecmp (dst_name, &dst_sb, &src_sb, options)) + { + /* We're using --update and the destination is not older + than the source, so do not copy or move. Pretend the + rename succeeded, so the caller (if it's mv) doesn't + end up removing the source file. */ + if (rename_succeeded) + *rename_succeeded = true; + return true; + } + } + /* When there is an existing destination file, we may end up returning early, and hence not copying/moving the file. This may be due to an interactive `negative' reply to the @@ -1262,30 +1460,6 @@ copy_internal (char const *src_name, char const *dst_name, return false; } } - - if (x->update) - { - /* When preserving time stamps (but not moving within a file - system), don't worry if the destination time stamp is - less than the source merely because of time stamp - truncation. */ - int options = ((x->preserve_timestamps - && ! (x->move_mode - && dst_sb.st_dev == src_sb.st_dev)) - ? UTIMECMP_TRUNCATE_SOURCE - : 0); - - if (0 <= utimecmp (dst_name, &dst_sb, &src_sb, options)) - { - /* We're using --update and the destination is not older - than the source, so do not copy or move. Pretend the - rename succeeded, so the caller (if it's mv) doesn't - end up removing the source file. */ - if (rename_succeeded) - *rename_succeeded = true; - return true; - } - } } if (x->move_mode) @@ -1360,11 +1534,12 @@ copy_internal (char const *src_name, char const *dst_name, new_dst = true; } else if (! S_ISDIR (dst_sb.st_mode) + /* Never unlink dst_name when in move mode. */ + && ! x->move_mode && (x->unlink_dest_before_opening || (x->preserve_links && 1 < dst_sb.st_nlink) - || (!x->move_mode - && x->dereference == DEREF_NEVER - && S_ISLNK (src_sb.st_mode)) + || (x->dereference == DEREF_NEVER + && ! S_ISREG (src_sb.st_mode)) )) { if (unlink (dst_name) != 0 && errno != ENOENT) @@ -1379,6 +1554,41 @@ copy_internal (char const *src_name, char const *dst_name, } } + /* Ensure we don't try to copy through a symlink that was + created by a prior call to this function. */ + if (command_line_arg + && x->dest_info + && ! x->move_mode + && x->backup_type == no_backups) + { + bool lstat_ok = true; + struct stat tmp_buf; + struct stat *dst_lstat_sb; + + /* If we called lstat above, good: use that data. + Otherwise, call lstat here, in case dst_name is a symlink. */ + if (have_dst_lstat) + dst_lstat_sb = &dst_sb; + else + { + if (lstat (dst_name, &tmp_buf) == 0) + dst_lstat_sb = &tmp_buf; + else + lstat_ok = false; + } + + /* Never copy through a symlink we've just created. */ + if (lstat_ok + && S_ISLNK (dst_lstat_sb->st_mode) + && seen_file (x->dest_info, dst_name, dst_lstat_sb)) + { + error (0, 0, + _("will not copy %s through just-created symlink %s"), + quote_n (0, src_name), quote_n (1, dst_name)); + return false; + } + } + /* If the source is a directory, we don't always create the destination directory. So --verbose should not announce anything until we're sure we'll create a directory. */ @@ -1390,6 +1600,10 @@ copy_internal (char const *src_name, char const *dst_name, we can arrange to create a hard link between the corresponding names in the destination tree. + When using the --link (-l) option, there is no need to take special + measures, because (barring race conditions) files that are hard-linked + in the source tree will also be hard-linked in the destination tree. + Sometimes, when preserving links, we have to record dev/ino even though st_nlink == 1: - when in move_mode, since we may be moving a group of N hard-linked @@ -1408,27 +1622,29 @@ copy_internal (char const *src_name, char const *dst_name, - likewise for -L except that it applies to all files, not just command line arguments. - Also record directory dev/ino when using --recursive. We'll use that - info to detect this problem: cp -R dir dir. FIXME-maybe: ideally, - directory info would be recorded in a separate hash table, since - such entries are useful only while a single command line hierarchy - is being copied -- so that separate table could be cleared between - command line args. Using the same hash table to preserve hard - links means that it may not be cleared. */ + Also, with --recursive, record dev/ino of each command-line directory. + We'll use that info to detect this problem: cp -R dir dir. */ if (x->move_mode && src_sb.st_nlink == 1) { - earlier_file = src_to_dest_lookup (src_sb.st_ino, src_sb.st_dev); + earlier_file = src_to_dest_lookup (src_sb.st_ino, src_sb.st_dev); } - else if ((x->preserve_links - && (1 < src_sb.st_nlink - || (command_line_arg - && x->dereference == DEREF_COMMAND_LINE_ARGUMENTS) - || x->dereference == DEREF_ALWAYS)) - || (x->recursive && S_ISDIR (src_mode))) + else if (x->preserve_links + && !x->hard_link + && (1 < src_sb.st_nlink + || (command_line_arg + && x->dereference == DEREF_COMMAND_LINE_ARGUMENTS) + || x->dereference == DEREF_ALWAYS)) { earlier_file = remember_copied (dst_name, src_sb.st_ino, src_sb.st_dev); } + else if (x->recursive && S_ISDIR (src_mode)) + { + if (command_line_arg) + earlier_file = remember_copied (dst_name, src_sb.st_ino, src_sb.st_dev); + else + earlier_file = src_to_dest_lookup (src_sb.st_ino, src_sb.st_dev); + } /* Did we copy this inode somewhere else (in this command line argument) and therefore this is a second hard link to the inode? */ @@ -1616,6 +1832,40 @@ copy_internal (char const *src_name, char const *dst_name, delayed_ok = true; + if (x->preserve_security_context) + { + security_context_t con; + + if (0 <= lgetfilecon (src_name, &con)) + { + if (setfscreatecon (con) < 0) + { + if (!x->reduce_diagnostics || x->require_preserve_context) + error (0, errno, + _("failed to set default file creation context to %s"), + quote (con)); + if (x->require_preserve_context) + { + freecon (con); + return false; + } + } + freecon (con); + } + else + { + if (!errno_unsupported (errno) || x->require_preserve_context) + { + if (!x->reduce_diagnostics || x->require_preserve_context) + error (0, errno, + _("failed to get security context of %s"), + quote (src_name)); + if (x->require_preserve_context) + return false; + } + } + } + /* In certain modes (cp's --symbolic-link), and for certain file types (symlinks and hard links) it doesn't make sense to preserve metadata, or it's possible to preserve only some of it. @@ -1682,11 +1932,15 @@ copy_internal (char const *src_name, char const *dst_name, } } - /* Insert the created directory's inode and device - numbers into the search structure, so that we can - avoid copying it again. */ - - remember_copied (dst_name, dst_sb.st_ino, dst_sb.st_dev); + /* Record the created directory's inode and device numbers into + the search structure, so that we can avoid copying it again. + Do this only for the first directory that is created for each + source command line argument. */ + if (!*first_dir_created_per_command_line_arg) + { + remember_copied (dst_name, dst_sb.st_ino, dst_sb.st_dev); + *first_dir_created_per_command_line_arg = true; + } if (x->verbose) emit_verbose (src_name, dst_name, NULL); @@ -1705,6 +1959,7 @@ copy_internal (char const *src_name, char const *dst_name, in a source directory would cause the containing destination directory not to have owner/perms set properly. */ delayed_ok = copy_dir (src_name, dst_name, new_dst, &src_sb, dir, x, + first_dir_created_per_command_line_arg, copy_into_self); } } @@ -1789,9 +2044,7 @@ copy_internal (char const *src_name, char const *dst_name, does not. But fall back on mkfifo, because on some BSD systems, mknod always fails when asked to create a FIFO. */ if (mknod (dst_name, src_mode & ~omitted_permissions, 0) != 0) -#if HAVE_MKFIFO if (mkfifo (dst_name, src_mode & ~S_IFIFO & ~omitted_permissions) != 0) -#endif { error (0, errno, _("cannot create fifo %s"), quote (dst_name)); goto un_backup; @@ -1809,7 +2062,7 @@ copy_internal (char const *src_name, char const *dst_name, } else if (S_ISLNK (src_mode)) { - char *src_link_val = xreadlink_with_size (src_name, src_sb.st_size); + char *src_link_val = areadlink_with_size (src_name, src_sb.st_size); if (src_link_val == NULL) { error (0, errno, _("cannot read symbolic link %s"), quote (src_name)); @@ -1830,8 +2083,8 @@ copy_internal (char const *src_name, char const *dst_name, in some cases, e.g., if the destination symlink has the wrong ownership, permissions, or time stamps. */ char *dest_link_val = - xreadlink_with_size (dst_name, dst_sb.st_size); - if (STREQ (dest_link_val, src_link_val)) + areadlink_with_size (dst_name, dst_sb.st_size); + if (dest_link_val && STREQ (dest_link_val, src_link_val)) same_link = true; free (dest_link_val); } @@ -1845,6 +2098,9 @@ copy_internal (char const *src_name, char const *dst_name, } } + if (x->preserve_security_context) + restore_default_fscreatecon_or_die (); + /* There's no need to preserve timestamps or permissions. */ preserve_metadata = false; @@ -1852,20 +2108,21 @@ copy_internal (char const *src_name, char const *dst_name, { /* Preserve the owner and group of the just-`copied' symbolic link, if possible. */ -#if HAVE_LCHOWN - if (lchown (dst_name, src_sb.st_uid, src_sb.st_gid) != 0 + if (HAVE_LCHOWN + && lchown (dst_name, src_sb.st_uid, src_sb.st_gid) != 0 && ! chown_failure_ok (x)) { error (0, errno, _("failed to preserve ownership for %s"), dst_name); goto un_backup; } -#else - /* Can't preserve ownership of symlinks. - FIXME: maybe give a warning or even error for symlinks - in directories with the sticky bit set -- there, not - preserving owner/group is a potential security problem. */ -#endif + else + { + /* Can't preserve ownership of symlinks. + FIXME: maybe give a warning or even error for symlinks + in directories with the sticky bit set -- there, not + preserving owner/group is a potential security problem. */ + } } } else @@ -1874,8 +2131,14 @@ copy_internal (char const *src_name, char const *dst_name, goto un_backup; } - if (command_line_arg) - record_file (x->dest_info, dst_name, NULL); + if (command_line_arg && x->dest_info) + { + /* Now that the destination file is very likely to exist, + add its info to the set. */ + struct stat sb; + if (lstat (dst_name, &sb) == 0) + record_file (x->dest_info, dst_name, &sb); + } if ( ! preserve_metadata) return true; @@ -1913,7 +2176,7 @@ copy_internal (char const *src_name, char const *dst_name, if (x->preserve_ownership && (new_dst || !SAME_OWNER_AND_GROUP (src_sb, dst_sb))) { - switch (set_owner (x, dst_name, -1, src_sb.st_uid, src_sb.st_gid)) + switch (set_owner (x, dst_name, -1, &src_sb, new_dst, &dst_sb)) { case -1: return false; @@ -1926,6 +2189,10 @@ copy_internal (char const *src_name, char const *dst_name, set_author (dst_name, -1, &src_sb); + if (x->preserve_xattr && ! copy_attr_by_name (src_name, dst_name, x) + && x->require_preserve_xattr) + return false; + if (x->preserve_mode || x->move_mode) { if (copy_acl (src_name, -1, dst_name, -1, src_mode) != 0 @@ -1978,6 +2245,9 @@ copy_internal (char const *src_name, char const *dst_name, un_backup: + if (x->preserve_security_context) + restore_default_fscreatecon_or_die (); + /* We have failed to create the destination file. If we've just added a dev/ino entry via the remember_copied call above (i.e., unless we've just failed to create a hard link), @@ -2037,27 +2307,35 @@ copy (char const *src_name, char const *dst_name, top_level_src_name = src_name; top_level_dst_name = dst_name; + { + bool first_dir_created_per_command_line_arg = false; return copy_internal (src_name, dst_name, nonexistent_dst, 0, NULL, - options, true, copy_into_self, rename_succeeded); + options, true, + &first_dir_created_per_command_line_arg, + copy_into_self, rename_succeeded); + } } -/* Return true if this process has appropriate privileges to chown a - file whose owner is not the effective user ID. */ +/* Set *X to the default options for a value of type struct cp_options. */ -extern bool -chown_privileges (void) +extern void +cp_options_default (struct cp_options *x) { + memset (x, 0, sizeof *x); #ifdef PRIV_FILE_CHOWN - bool result; - priv_set_t *pset = priv_allocset (); - if (!pset) - xalloc_die (); - result = (getppriv (PRIV_EFFECTIVE, pset) == 0 - && priv_ismember (pset, PRIV_FILE_CHOWN)); - priv_freeset (pset); - return result; + { + priv_set_t *pset = priv_allocset (); + if (!pset) + xalloc_die (); + if (getppriv (PRIV_EFFECTIVE, pset) == 0) + { + x->chown_privileges = priv_ismember (pset, PRIV_FILE_CHOWN); + x->owner_privileges = priv_ismember (pset, PRIV_FILE_OWNER); + } + priv_freeset (pset); + } #else - return (geteuid () == 0); + x->chown_privileges = x->owner_privileges = (geteuid () == 0); #endif } @@ -2075,6 +2353,16 @@ chown_failure_ok (struct cp_options const *x) return ((errno == EPERM || errno == EINVAL) && !x->chown_privileges); } +/* Similarly, return true if it's OK for chmod and similar operations + to fail, where errno is the error number that chmod failed with and + X is the copying option set. */ + +static bool +owner_failure_ok (struct cp_options const *x) +{ + return ((errno == EPERM || errno == EINVAL) && !x->owner_privileges); +} + /* Return the user's umask, caching the result. */ extern mode_t diff --git a/src/bin/coreutils/src/copy.h b/src/bin/coreutils/src/copy.h index aad50e08a1..e1e054a706 100644 --- a/src/bin/coreutils/src/copy.h +++ b/src/bin/coreutils/src/copy.h @@ -1,10 +1,10 @@ /* core functions for copying files and directories - Copyright (C) 89, 90, 91, 1995-2005 Free Software Foundation. + Copyright (C) 89, 90, 91, 1995-2009 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Extracted from cp.c and librarified by Jim Meyering. */ @@ -22,7 +21,6 @@ # include # include "hash.h" -# include "lstat.h" /* Control creation of sparse files (files with holes). */ enum Sparse_type @@ -83,13 +81,25 @@ struct cp_options { enum backup_type backup_type; + /* How to handle symlinks in the source. */ + enum Dereference_symlink dereference; + + /* This value is used to determine whether to prompt before removing + each existing destination file. It works differently depending on + whether move_mode is set. See code/comments in copy.c. */ + enum Interactive interactive; + + /* Control creation of sparse files. */ + enum Sparse_type sparse_mode; + + /* Set the mode of the destination file to exactly this value + if SET_MODE is nonzero. */ + mode_t mode; + /* If true, copy all files except (directories and, if not dereferencing them, symbolic links,) as if they were regular files. */ bool copy_as_regular; - /* How to handle symlinks. */ - enum Dereference_symlink dereference; - /* If true, remove each existing destination nondirectory before trying to open it. */ bool unlink_dest_before_opening; @@ -105,11 +115,6 @@ struct cp_options Create destination directories as usual. */ bool hard_link; - /* This value is used to determine whether to prompt before removing - each existing destination file. It works differently depending on - whether move_mode is set. See code/comments in copy.c. */ - enum Interactive interactive; - /* If true, rather than copying, first attempt to use rename. If that fails, then resort to copying. */ bool move_mode; @@ -118,6 +123,13 @@ struct cp_options whose owner is not the effective user ID. */ bool chown_privileges; + /* Whether this process has appropriate privileges to do the + following operations on a file even when it is owned by some + other user: set the file's atime, mtime, mode, or ACL; remove or + rename an entry in the file even though it is a sticky directory, + or to mount on the file. */ + bool owner_privileges; + /* If true, when copying recursively, skip any subdirectories that are on different file systems from the one we started on. */ bool one_file_system; @@ -142,13 +154,47 @@ struct cp_options /* If true and any of the above (for preserve) file attributes cannot be applied to a destination file, treat it as a failure and return - nonzero immediately. E.g. cp -p requires this be nonzero, mv requires - it be zero. */ + nonzero immediately. E.g. for cp -p this must be true, for mv it + must be false. */ bool require_preserve; /* If nonzero, attributes will be ignored when copying. */ int ignore_attributes; + /* If true, attempt to preserve the SELinux security context, too. + Set this only if the kernel is SELinux enabled. */ + bool preserve_security_context; + + /* Useful only when preserve_security_context is true. + If true, a failed attempt to preserve a file's security context + propagates failure "out" to the caller. If false, a failure to + preserve a file's security context does not change the invoking + application's exit status. Give diagnostics for failed syscalls + regardless of this setting. For example, with "cp --preserve=context" + this flag is "true", while with "cp -a", it is false. That means + "cp -a" attempts to preserve any security context, but does not + fail if it is unable to do so. */ + bool require_preserve_context; + + /* If true, attempt to preserve extended attributes using libattr. + Ignored if coreutils are compiled without xattr support. */ + bool preserve_xattr; + + /* Useful only when preserve_xattr is true. + If true, a failed attempt to preserve file's extended attributes + propagates failure "out" to the caller. If false, a failure to + preserve file's extended attributes does not change the invoking + application's exit status. Give diagnostics for failed syscalls + regardless of this setting. For example, with "cp --preserve=xattr" + this flag is "true", while with "cp --preserve=all", it is false. */ + bool require_preserve_xattr; + + /* Used as difference boolean between cp -a and cp -dR --preserve=all. + If true, non-mandatory failure diagnostics are not displayed. This + should prevent poluting cp -a output. + */ + bool reduce_diagnostics; + /* If true, copy directories recursively and copy special files as themselves rather than copying their contents. */ bool recursive; @@ -157,13 +203,6 @@ struct cp_options set it based on current umask modified by UMASK_KILL. */ bool set_mode; - /* Set the mode of the destination file to exactly this value - if SET_MODE is nonzero. */ - mode_t mode; - - /* Control creation of sparse files. */ - enum Sparse_type sparse_mode; - /* If true, create symbolic links instead of copying files. Create destination directories as usual. */ bool symbolic_link; @@ -178,6 +217,11 @@ struct cp_options /* If true, stdin is a tty. */ bool stdin_tty; + /* If true, open a dangling destination symlink when not in move_mode. + Otherwise, copy_reg gives a diagnostic (it refuses to write through + such a symlink) and returns false. */ + bool open_dangling_dest_symlink; + /* This is a set of destination name/inode/dev triples. Each such triple represents a file we have created corresponding to a source file name that was specified on the command line. Use it to avoid clobbering @@ -214,7 +258,7 @@ bool copy (char const *src_name, char const *dst_name, void dest_info_init (struct cp_options *); void src_info_init (struct cp_options *); -bool chown_privileges (void); +void cp_options_default (struct cp_options *); bool chown_failure_ok (struct cp_options const *); mode_t cached_umask (void); diff --git a/src/bin/coreutils/src/cp-hash.c b/src/bin/coreutils/src/cp-hash.c index a4b51573f0..f23ecc135b 100644 --- a/src/bin/coreutils/src/cp-hash.c +++ b/src/bin/coreutils/src/cp-hash.c @@ -1,10 +1,10 @@ /* cp-hash.c -- file copying (hash search routines) - Copyright (C) 89, 90, 91, 1995-2005 Free Software Foundation. + Copyright (C) 89, 90, 91, 1995-2008 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,22 +12,18 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + along with this program. If not, see . Written by Torbjorn Granlund, Sweden (tege@sics.se). Rewritten to use lib/hash.c by Jim Meyering. */ #include -#include #include #include "system.h" #include "same.h" -#include "quote.h" #include "hash.h" -#include "error.h" #include "cp-hash.h" /* Use ST_DEV and ST_INO as the key, FILENAME as the value. @@ -98,24 +94,6 @@ forget_created (ino_t ino, dev_t dev) src_to_dest_free (ent); } -/* Add FILE to the list of files that we have created. - Return true if successful. */ - -extern bool -remember_created (char const *file) -{ - struct stat sb; - - if (stat (file, &sb) < 0) - { - error (0, errno, "%s", quote (file)); - return false; - } - - remember_copied (file, sb.st_ino, sb.st_dev); - return true; -} - /* If INO/DEV correspond to an already-copied source file, return the name of the corresponding destination file. Otherwise, return NULL. */ diff --git a/src/bin/coreutils/src/cp-hash.h b/src/bin/coreutils/src/cp-hash.h index d142925a42..c2c5085ab6 100644 --- a/src/bin/coreutils/src/cp-hash.h +++ b/src/bin/coreutils/src/cp-hash.h @@ -2,5 +2,4 @@ void hash_init (void); void forget_all (void); void forget_created (ino_t ino, dev_t dev); char *remember_copied (const char *node, ino_t ino, dev_t dev); -bool remember_created (char const *file); char *src_to_dest_lookup (ino_t ino, dev_t dev); diff --git a/src/bin/coreutils/src/cp.c b/src/bin/coreutils/src/cp.c index bb2ef5dc3b..07478ff630 100644 --- a/src/bin/coreutils/src/cp.c +++ b/src/bin/coreutils/src/cp.c @@ -1,10 +1,10 @@ /* cp.c -- file copying (main routines) - Copyright (C) 89, 90, 91, 1995-2007 Free Software Foundation. + Copyright (C) 89, 90, 91, 1995-2009 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + along with this program. If not, see . Written by Torbjorn Granlund, David MacKenzie, and Jim Meyering. */ @@ -21,6 +20,7 @@ #include #include #include +#include #include "system.h" #include "argmatch.h" @@ -29,13 +29,16 @@ #include "cp-hash.h" #include "error.h" #include "filenamecat.h" -#include "lchmod.h" +#include "ignore-value.h" #include "quote.h" -#include "quotearg.h" #include "stat-time.h" #include "utimens.h" #include "acl.h" +#if ! HAVE_LCHOWN +# define lchown(name, uid, gid) chown (name, uid, gid) +#endif + #define ASSIGN_BASENAME_STRDUPA(Dest, File_name) \ do \ { \ @@ -49,14 +52,17 @@ /* The official name of this program (e.g., no `g' prefix). */ #define PROGRAM_NAME "cp" -#define AUTHORS "Torbjorn Granlund", "David MacKenzie", "Jim Meyering" +#define AUTHORS \ + proper_name_utf8 ("Torbjorn Granlund", "Torbj\303\266rn Granlund"), \ + proper_name ("David MacKenzie"), \ + proper_name ("Jim Meyering") /* Used by do_copy, make_dir_parents_private, and re_protect to keep a list of leading directories whose protections need to be fixed after copying. */ struct dir_attr { - mode_t mode; + struct stat st; bool restore_mode; size_t slash_offset; struct dir_attr *next; @@ -71,20 +77,13 @@ enum NO_PRESERVE_ATTRIBUTES_OPTION, PARENTS_OPTION, PRESERVE_ATTRIBUTES_OPTION, - REPLY_OPTION, SPARSE_OPTION, STRIP_TRAILING_SLASHES_OPTION, UNLINK_DEST_BEFORE_OPENING }; -/* Initial number of entries in each hash table entry's table of inodes. */ -#define INITIAL_HASH_MODULE 100 - -/* Initial number of entries in the inode hash table. */ -#define INITIAL_ENTRY_TAB_SIZE 70 - -/* The invocation name of this program. */ -char *program_name; +/* True if the kernel is SELinux enabled. */ +static bool selinux_enabled; /* If true, the command "cp x/e_file e_dir" uses "e_dir/x/e_file" as its destination instead of the usual "e_dir/e_file." */ @@ -103,18 +102,6 @@ static enum Sparse_type const sparse_type[] = }; ARGMATCH_VERIFY (sparse_type_string, sparse_type); -/* Valid arguments to the `--reply' option. */ -static char const* const reply_args[] = -{ - "yes", "no", "query", NULL -}; -/* The values that correspond to the above strings. */ -static int const reply_vals[] = -{ - I_ALWAYS_YES, I_ALWAYS_NO, I_ASK_USER -}; -ARGMATCH_VERIFY (reply_args, reply_vals); - static struct option const long_opts[] = { {"archive", no_argument, NULL, 'a'}, @@ -125,6 +112,7 @@ static struct option const long_opts[] = {"ignore-attributes", no_argument, NULL, IGNORE_ATTRIBUTES}, {"interactive", no_argument, NULL, 'i'}, {"link", no_argument, NULL, 'l'}, + {"no-clobber", no_argument, NULL, 'n'}, {"no-dereference", no_argument, NULL, 'P'}, {"no-preserve", required_argument, NULL, NO_PRESERVE_ATTRIBUTES_OPTION}, {"no-target-directory", no_argument, NULL, 'T'}, @@ -134,8 +122,6 @@ static struct option const long_opts[] = {"preserve", optional_argument, NULL, PRESERVE_ATTRIBUTES_OPTION}, {"recursive", no_argument, NULL, 'R'}, {"remove-destination", no_argument, NULL, UNLINK_DEST_BEFORE_OPENING}, - {"reply", required_argument, NULL, REPLY_OPTION}, /* Deprecated 2005-07-03, - remove in 2008. */ {"sparse", required_argument, NULL, SPARSE_OPTION}, {"strip-trailing-slashes", no_argument, NULL, STRIP_TRAILING_SLASHES_OPTION}, {"suffix", required_argument, NULL, 'S'}, @@ -170,31 +156,36 @@ Copy SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY.\n\ Mandatory arguments to long options are mandatory for short options too.\n\ "), stdout); fputs (_("\ - -a, --archive same as -dpPR\n\ + -a, --archive same as -dR --preserve=all\n\ --backup[=CONTROL] make a backup of each existing destination file\n\ -b like --backup but does not accept an argument\n\ --copy-contents copy contents of special files when recursive\n\ - -d same as --no-dereference --preserve=link\n\ + -d same as --no-dereference --preserve=links\n\ "), stdout); fputs (_("\ -f, --force if an existing destination file cannot be\n\ - opened, remove it and try again\n\ + opened, remove it and try again (redundant if\n\ + the -n option is used)\n\ --ignore-attributes do not copy attributes\n\ - -i, --interactive prompt before overwrite\n\ - -H follow command-line symbolic links\n\ + -i, --interactive prompt before overwrite (overrides a previous -n\n\ + option)\n\ + -H follow command-line symbolic links in SOURCE\n\ "), stdout); fputs (_("\ -l, --link link files instead of copying\n\ - -L, --dereference always follow symbolic links\n\ + -L, --dereference always follow symbolic links in SOURCE\n\ "), stdout); fputs (_("\ - -P, --no-dereference never follow symbolic links\n\ + -n, --no-clobber do not overwrite an existing file (overrides\n\ + a previous -i option)\n\ + -P, --no-dereference never follow symbolic links in SOURCE\n\ "), stdout); fputs (_("\ -p same as --preserve=mode,ownership,timestamps\n\ --preserve[=ATTR_LIST] preserve the specified attributes (default:\n\ mode,ownership,timestamps), if possible\n\ - additional attributes: links, all\n\ + additional attributes: context, links, xattr,\n\ + all\n\ "), stdout); fputs (_("\ --no-preserve=ATTR_LIST don't preserve the specified attributes\n\ @@ -232,9 +223,9 @@ corresponding DEST file is made sparse as well. That is the behavior\n\ selected by --sparse=auto. Specify --sparse=always to create a sparse DEST\n\ file whenever the SOURCE file contains a long enough sequence of zero bytes.\n\ Use --sparse=never to inhibit creation of sparse files.\n\ -\n\ "), stdout); fputs (_("\ +\n\ The backup suffix is `~', unless set with --suffix or SIMPLE_BACKUP_SUFFIX.\n\ The version control method may be selected via the --backup option or through\n\ the VERSION_CONTROL environment variable. Here are the values:\n\ @@ -252,7 +243,7 @@ As a special case, cp makes a backup of SOURCE when the force and backup\n\ options are given and SOURCE and DEST are the same name for an existing,\n\ regular file.\n\ "), stdout); - printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT); + emit_bug_reporting_address (); } exit (status); } @@ -290,17 +281,8 @@ re_protect (char const *const_dst_name, size_t src_offset, for (p = attr_list; p; p = p->next) { - struct stat src_sb; - dst_name[p->slash_offset] = '\0'; - if (XSTAT (x, src_name, &src_sb)) - { - error (0, errno, _("failed to get attributes of %s"), - quote (src_name)); - return false; - } - /* Adjust the times (and if possible, ownership) for the copy. chown turns off set[ug]id bits for non-root, so do the chmod last. */ @@ -309,8 +291,8 @@ re_protect (char const *const_dst_name, size_t src_offset, { struct timespec timespec[2]; - timespec[0] = get_stat_atime (&src_sb); - timespec[1] = get_stat_mtime (&src_sb); + timespec[0] = get_stat_atime (&p->st); + timespec[1] = get_stat_mtime (&p->st); if (utimens (dst_name, timespec)) { @@ -322,23 +304,28 @@ re_protect (char const *const_dst_name, size_t src_offset, if (x->preserve_ownership) { - if (chown (dst_name, src_sb.st_uid, src_sb.st_gid) != 0 - && ! chown_failure_ok (x)) - { - error (0, errno, _("failed to preserve ownership for %s"), - quote (dst_name)); - return false; - } + if (lchown (dst_name, p->st.st_uid, p->st.st_gid) != 0) + { + if (! chown_failure_ok (x)) + { + error (0, errno, _("failed to preserve ownership for %s"), + quote (dst_name)); + return false; + } + /* Failing to preserve ownership is OK. Still, try to preserve + the group, but ignore the possible error. */ + ignore_value (lchown (dst_name, -1, p->st.st_gid)); + } } if (x->preserve_mode) { - if (copy_acl (src_name, -1, dst_name, -1, src_sb.st_mode)) + if (copy_acl (src_name, -1, dst_name, -1, p->st.st_mode) != 0) return false; } else if (p->restore_mode) { - if (lchmod (dst_name, p->mode) != 0) + if (lchmod (dst_name, p->st.st_mode) != 0) { error (0, errno, _("failed to preserve permissions for %s"), quote (dst_name)); @@ -393,7 +380,7 @@ make_dir_parents_private (char const *const_dir, size_t src_offset, *attr_list = NULL; - if (XSTAT (x, dst_dir, &stats)) + if (stat (dst_dir, &stats) != 0) { /* A parent of CONST_DIR does not exist. Make all missing intermediate directories. */ @@ -404,40 +391,51 @@ make_dir_parents_private (char const *const_dir, size_t src_offset, slash++; while ((slash = strchr (slash, '/'))) { - /* Add this directory to the list of directories whose modes need - fixing later. */ - struct dir_attr *new = xmalloc (sizeof *new); - new->slash_offset = slash - dir; - new->restore_mode = false; - new->next = *attr_list; - *attr_list = new; + struct dir_attr *new IF_LINT (= NULL); + bool missing_dir; *slash = '\0'; - if (XSTAT (x, dir, &stats)) - { - mode_t src_mode; - mode_t omitted_permissions; - mode_t mkdir_mode; - int src_errno; + missing_dir = (stat (dir, &stats) != 0); - /* This component does not exist. We must set - *new_dst and new->mode inside this loop because, - for example, in the command `cp --parents ../a/../b/c e_dir', - make_dir_parents_private creates only e_dir/../a if - ./b already exists. */ - *new_dst = true; - src_errno = (XSTAT (x, src, &stats) != 0 - ? errno - : S_ISDIR (stats.st_mode) - ? 0 - : ENOTDIR); + if (missing_dir | x->preserve_ownership | x->preserve_mode + | x->preserve_timestamps) + { + /* Add this directory to the list of directories whose + modes might need fixing later. */ + struct stat src_st; + int src_errno = (stat (src, &src_st) != 0 + ? errno + : S_ISDIR (src_st.st_mode) + ? 0 + : ENOTDIR); if (src_errno) { error (0, src_errno, _("failed to get attributes of %s"), quote (src)); return false; } - src_mode = stats.st_mode; + + new = xmalloc (sizeof *new); + new->st = src_st; + new->slash_offset = slash - dir; + new->restore_mode = false; + new->next = *attr_list; + *attr_list = new; + } + + if (missing_dir) + { + mode_t src_mode; + mode_t omitted_permissions; + mode_t mkdir_mode; + + /* This component does not exist. We must set + *new_dst and new->st.st_mode inside this loop because, + for example, in the command `cp --parents ../a/../b/c e_dir', + make_dir_parents_private creates only e_dir/../a if + ./b already exists. */ + *new_dst = true; + src_mode = new->st.st_mode; /* If the ownership or special mode bits might change, omit some permissions at first, so unauthorized users @@ -485,7 +483,7 @@ make_dir_parents_private (char const *const_dir, size_t src_offset, if (omitted_permissions & ~stats.st_mode || (stats.st_mode & S_IRWXU) != S_IRWXU) { - new->mode = stats.st_mode | omitted_permissions; + new->st.st_mode = stats.st_mode | omitted_permissions; new->restore_mode = true; } } @@ -582,7 +580,7 @@ do_copy (int n_files, char **file, const char *target_directory, { if (target_directory) error (EXIT_FAILURE, 0, - _("Cannot combine --target-directory (-t) " + _("cannot combine --target-directory (-t) " "and --no-target-directory (-T)")); if (2 < n_files) { @@ -684,6 +682,16 @@ do_copy (int n_files, char **file, const char *target_directory, attr_list, x); } + if (parents_option) + { + while (attr_list) + { + struct dir_attr *p = attr_list; + attr_list = attr_list->next; + free (p); + } + } + free (dst_name); } } @@ -738,13 +746,13 @@ do_copy (int n_files, char **file, const char *target_directory, static void cp_option_init (struct cp_options *x) { + cp_options_default (x); x->copy_as_regular = true; x->dereference = DEREF_UNDEFINED; x->unlink_dest_before_opening = false; x->unlink_dest_after_failed_open = false; x->hard_link = false; x->interactive = I_UNSPECIFIED; - x->chown_privileges = chown_privileges (); x->move_mode = false; x->one_file_system = false; @@ -752,6 +760,11 @@ cp_option_init (struct cp_options *x) x->preserve_links = false; x->preserve_mode = false; x->preserve_timestamps = false; + x->preserve_security_context = false; + x->require_preserve_context = false; + x->preserve_xattr = false; + x->reduce_diagnostics = false; + x->require_preserve_xattr = false; x->require_preserve = false; x->ignore_attributes = false; @@ -766,6 +779,13 @@ cp_option_init (struct cp_options *x) x->update = false; x->verbose = false; + + /* By default, refuse to open a dangling destination symlink, because + in general one cannot do that safely, give the current semantics of + open's O_EXCL flag, (which POSIX doesn't even allow cp to use, btw). + But POSIX requires it. */ + x->open_dangling_dest_symlink = getenv ("POSIXLY_CORRECT") != NULL; + x->dest_info = NULL; x->src_info = NULL; } @@ -781,18 +801,21 @@ decode_preserve_arg (char const *arg, struct cp_options *x, bool on_off) PRESERVE_TIMESTAMPS, PRESERVE_OWNERSHIP, PRESERVE_LINK, + PRESERVE_CONTEXT, + PRESERVE_XATTR, PRESERVE_ALL }; static enum File_attribute const preserve_vals[] = { PRESERVE_MODE, PRESERVE_TIMESTAMPS, - PRESERVE_OWNERSHIP, PRESERVE_LINK, PRESERVE_ALL + PRESERVE_OWNERSHIP, PRESERVE_LINK, PRESERVE_CONTEXT, PRESERVE_XATTR, + PRESERVE_ALL }; /* Valid arguments to the `--preserve' option. */ static char const* const preserve_args[] = { "mode", "timestamps", - "ownership", "links", "all", NULL + "ownership", "links", "context", "xattr", "all", NULL }; ARGMATCH_VERIFY (preserve_args, preserve_vals); @@ -828,11 +851,24 @@ decode_preserve_arg (char const *arg, struct cp_options *x, bool on_off) x->preserve_links = on_off; break; + case PRESERVE_CONTEXT: + x->preserve_security_context = on_off; + x->require_preserve_context = on_off; + break; + + case PRESERVE_XATTR: + x->preserve_xattr = on_off; + x->require_preserve_xattr = on_off; + break; + case PRESERVE_ALL: x->preserve_mode = on_off; x->preserve_timestamps = on_off; x->preserve_ownership = on_off; x->preserve_links = on_off; + if (selinux_enabled) + x->preserve_security_context = on_off; + x->preserve_xattr = on_off; break; default: @@ -859,20 +895,21 @@ main (int argc, char **argv) bool no_target_directory = false; initialize_main (&argc, &argv); - program_name = argv[0]; + set_program_name (argv[0]); setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); - atexit (close_stdout); + atexit (close_stdin); + selinux_enabled = (0 < is_selinux_enabled ()); cp_option_init (&x); /* FIXME: consider not calling getenv for SIMPLE_BACKUP_SUFFIX unless we'll actually use backup_suffix_string. */ backup_suffix_string = getenv ("SIMPLE_BACKUP_SUFFIX"); - while ((c = getopt_long (argc, argv, "abdfHilLprst:uvxPRS:T", + while ((c = getopt_long (argc, argv, "abdfHilLnprst:uvxPRS:T", long_opts, NULL)) != -1) { @@ -883,13 +920,17 @@ main (int argc, char **argv) sparse_type_string, sparse_type); break; - case 'a': /* Like -dpPR. */ + case 'a': /* Like -dR --preserve=all with reduced failure diagnostics. */ x.dereference = DEREF_NEVER; x.preserve_links = true; x.preserve_ownership = true; x.preserve_mode = true; x.preserve_timestamps = true; x.require_preserve = true; + if (selinux_enabled) + x.preserve_security_context = true; + x.preserve_xattr = true; + x.reduce_diagnostics = true; x.recursive = true; break; @@ -932,6 +973,10 @@ main (int argc, char **argv) x.dereference = DEREF_ALWAYS; break; + case 'n': + x.interactive = I_ALWAYS_NO; + break; + case 'P': x.dereference = DEREF_NEVER; break; @@ -968,13 +1013,6 @@ main (int argc, char **argv) x.recursive = true; break; - case REPLY_OPTION: /* Deprecated */ - x.interactive = XARGMATCH ("--reply", optarg, - reply_args, reply_vals); - error (0, 0, - _("the --reply option is deprecated; use -i or -f instead")); - break; - case UNLINK_DEST_BEFORE_OPENING: x.unlink_dest_before_opening = true; break; @@ -1039,6 +1077,13 @@ main (int argc, char **argv) usage (EXIT_FAILURE); } + if (make_backups && x.interactive == I_ALWAYS_NO) + { + error (0, 0, + _("options --backup and --no-clobber are mutually exclusive")); + usage (EXIT_FAILURE); + } + if (backup_suffix_string) simple_backup_suffix = xstrdup (backup_suffix_string); @@ -1056,9 +1101,6 @@ main (int argc, char **argv) x.dereference = DEREF_ALWAYS; } - /* The key difference between -d (--no-dereference) and not is the version - of `stat' to call. */ - if (x.recursive) x.copy_as_regular = copy_contents; @@ -1067,6 +1109,20 @@ main (int argc, char **argv) if (x.unlink_dest_after_failed_open & (x.hard_link | x.symbolic_link)) x.unlink_dest_before_opening = true; + if (x.preserve_security_context) + { + if (!selinux_enabled) + error (EXIT_FAILURE, 0, + _("cannot preserve security context " + "without an SELinux-enabled kernel")); + } + +#if !USE_XATTR + if (x.require_preserve_xattr) + error (EXIT_FAILURE, 0, _("cannot preserve extended attributes, cp is " + "built without xattr support")); +#endif + /* Allocate space for remembering copied and created files. */ hash_init (); diff --git a/src/bin/coreutils/src/csplit.c b/src/bin/coreutils/src/csplit.c index c2105bc076..4f0beb6c43 100644 --- a/src/bin/coreutils/src/csplit.c +++ b/src/bin/coreutils/src/csplit.c @@ -1,10 +1,10 @@ /* csplit - split a file into sections determined by context lines - Copyright (C) 91, 1995-2007 Free Software Foundation, Inc. + Copyright (C) 91, 1995-2009 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Stuart Kemp, cpsrk@groper.jcu.edu.au. Modified by David MacKenzie, djm@gnu.ai.mit.edu. */ @@ -30,30 +29,17 @@ #include "error.h" #include "fd-reopen.h" -#include "inttostr.h" #include "quote.h" #include "safe-read.h" #include "stdio--.h" #include "xstrtol.h" -/* Use SA_NOCLDSTOP as a proxy for whether the sigaction machinery is - present. */ -#ifndef SA_NOCLDSTOP -# define SA_NOCLDSTOP 0 -# define sigprocmask(How, Set, Oset) /* empty */ -# define sigset_t int -# if ! HAVE_SIGINTERRUPT -# define siginterrupt(sig, flag) /* empty */ -# endif -#endif - /* The official name of this program (e.g., no `g' prefix). */ #define PROGRAM_NAME "csplit" -#define AUTHORS "Stuart Kemp", "David MacKenzie" - -/* Increment size of area for control records. */ -#define ALLOC_SIZE 20 +#define AUTHORS \ + proper_name ("Stuart Kemp"), \ + proper_name ("David MacKenzie") /* The default prefix for output file names. */ #define DEFAULT_PREFIX "xx" @@ -127,9 +113,6 @@ static void delete_all_files (bool); static void save_line_to_file (const struct cstring *line); void usage (int status); -/* The name this program was run with. */ -char *program_name; - /* Start of buffer list. */ static struct buffer_record *head = NULL; @@ -241,12 +224,10 @@ xalloc_die (void) static void interrupt_handler (int sig) { - if (! SA_NOCLDSTOP) - signal (sig, SIG_IGN); - delete_all_files (true); - - signal (sig, SIG_DFL); + /* The signal has been reset to SIG_DFL, but blocked during this + handler. Force the default action of this signal once the + handler returns and the block is removed. */ raise (sig); } @@ -1329,7 +1310,7 @@ main (int argc, char **argv) unsigned long int val; initialize_main (&argc, &argv); - program_name = argv[0]; + set_program_name (argv[0]); setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); @@ -1424,7 +1405,6 @@ main (int argc, char **argv) }; enum { nsigs = sizeof sig / sizeof sig[0] }; -#if SA_NOCLDSTOP struct sigaction act; sigemptyset (&caught_signals); @@ -1437,19 +1417,11 @@ main (int argc, char **argv) act.sa_handler = interrupt_handler; act.sa_mask = caught_signals; - act.sa_flags = 0; + act.sa_flags = SA_NODEFER | SA_RESETHAND; for (i = 0; i < nsigs; i++) if (sigismember (&caught_signals, sig[i])) sigaction (sig[i], &act, NULL); -#else - for (i = 0; i < nsigs; i++) - if (signal (sig[i], SIG_IGN) != SIG_IGN) - { - signal (sig[i], interrupt_handler); - siginterrupt (sig[i], 1); - } -#endif } split_file (); @@ -1509,7 +1481,7 @@ Read standard input if FILE is -. Each PATTERN may be:\n\ \n\ A line OFFSET is a required `+' or `-' followed by a positive integer.\n\ "), stdout); - printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT); + emit_bug_reporting_address (); } exit (status); } diff --git a/src/bin/coreutils/src/cut.c b/src/bin/coreutils/src/cut.c index c9b83595aa..99d2eaad9b 100644 --- a/src/bin/coreutils/src/cut.c +++ b/src/bin/coreutils/src/cut.c @@ -1,11 +1,11 @@ /* cut - remove parts of lines of files - Copyright (C) 1997-2006 Free Software Foundation, Inc. + Copyright (C) 1997-2008 Free Software Foundation, Inc. Copyright (C) 1984 David M. Ihnat - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by David Ihnat. */ @@ -40,7 +39,10 @@ /* The official name of this program (e.g., no `g' prefix). */ #define PROGRAM_NAME "cut" -#define AUTHORS "David Ihnat", "David MacKenzie", "Jim Meyering" +#define AUTHORS \ + proper_name ("David M. Ihnat"), \ + proper_name ("David MacKenzie"), \ + proper_name ("Jim Meyering") #define FATAL_ERROR(Message) \ do \ @@ -57,6 +59,8 @@ #define ADD_RANGE_PAIR(rp, low, high) \ do \ { \ + if (low == 0 || high == 0) \ + FATAL_ERROR (_("fields and positions are numbered from 1")); \ if (n_rp >= n_rp_allocated) \ { \ (rp) = X2NREALLOC (rp, &n_rp_allocated); \ @@ -116,9 +120,6 @@ enum operating_mode field_mode }; -/* The name this program was run with. */ -char *program_name; - static enum operating_mode operating_mode; /* If true do not output lines containing no delimeter characters. @@ -186,7 +187,7 @@ usage (int status) else { printf (_("\ -Usage: %s [OPTION]... [FILE]...\n\ +Usage: %s OPTION... [FILE]...\n\ "), program_name); fputs (_("\ @@ -209,7 +210,7 @@ Mandatory arguments to long options are mandatory for short options too.\n\ "), stdout); fputs (_("\ --complement complement the set of selected bytes, characters\n\ - or fields.\n\ + or fields\n\ "), stdout); fputs (_("\ -s, --only-delimited do not print lines not containing delimiters\n\ @@ -234,7 +235,7 @@ Each range is one of:\n\ \n\ With no FILE, or when FILE is -, read standard input.\n\ "), stdout); - printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT); + emit_bug_reporting_address (); } exit (status); } @@ -342,6 +343,8 @@ set_fields (const char *fieldstr) { size_t initial = 1; /* Value of first number in a range. */ size_t value = 0; /* If nonzero, a number being accumulated. */ + bool lhs_specified = false; + bool rhs_specified = false; bool dash_found = false; /* True if a '-' is found in this field. */ bool field_found = false; /* True if at least one field spec has been processed. */ @@ -366,15 +369,11 @@ set_fields (const char *fieldstr) dash_found = true; fieldstr++; - if (value) - { - initial = value; - value = 0; - } - else - initial = 1; + initial = (lhs_specified ? value : 1); + value = 0; } - else if (*fieldstr == ',' || isblank (*fieldstr) || *fieldstr == '\0') + else if (*fieldstr == ',' || + isblank (to_uchar (*fieldstr)) || *fieldstr == '\0') { in_digits = false; /* Ending the string, or this field/byte sublist. */ @@ -382,9 +381,12 @@ set_fields (const char *fieldstr) { dash_found = false; - /* A range. Possibilites: -n, m-n, n-. + if (!lhs_specified && !rhs_specified) + FATAL_ERROR (_("invalid range with no endpoint: -")); + + /* A range. Possibilities: -n, m-n, n-. In any case, `initial' contains the start of the range. */ - if (value == 0) + if (!rhs_specified) { /* `n-'. From `initial' to end of line. */ eol_range_start = initial; @@ -394,7 +396,7 @@ set_fields (const char *fieldstr) { /* `m-n' or `-n' (1-n). */ if (value < initial) - FATAL_ERROR (_("invalid byte or field list")); + FATAL_ERROR (_("invalid decreasing range")); /* Is there already a range going to end of line? */ if (eol_range_start != 0) @@ -432,7 +434,7 @@ set_fields (const char *fieldstr) value = 0; } } - else if (value != 0) + else { /* A simple field number, not a range. */ ADD_RANGE_PAIR (rp, value, value); @@ -446,6 +448,8 @@ set_fields (const char *fieldstr) } fieldstr++; + lhs_specified = false; + rhs_specified = false; } else if (ISDIGIT (*fieldstr)) { @@ -456,10 +460,15 @@ set_fields (const char *fieldstr) num_start = fieldstr; in_digits = true; + if (dash_found) + rhs_specified = 1; + else + lhs_specified = 1; + /* Detect overflow. */ if (!DECIMAL_DIGIT_ACCUMULATE (value, *fieldstr - '0', size_t)) { - /* In case the user specified -c4294967296,22, + /* In case the user specified -c$(echo 2^64|bc),22, complain only about the first number. */ /* Determine the length of the offending number. */ size_t len = strspn (num_start, "0123456789"); @@ -750,7 +759,7 @@ main (int argc, char **argv) char *spec_list_string IF_LINT(= NULL); initialize_main (&argc, &argv); - program_name = argv[0]; + set_program_name (argv[0]); setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); diff --git a/src/bin/coreutils/src/date.c b/src/bin/coreutils/src/date.c index c64ab1c040..43e20057c6 100644 --- a/src/bin/coreutils/src/date.c +++ b/src/bin/coreutils/src/date.c @@ -1,10 +1,10 @@ /* date - print or set the system date and time - Copyright (C) 1989-2007 Free Software Foundation, Inc. + Copyright (C) 1989-2008 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + along with this program. If not, see . David MacKenzie */ @@ -29,8 +28,6 @@ #include "argmatch.h" #include "error.h" #include "getdate.h" -#include "getline.h" -#include "inttostr.h" #include "posixtm.h" #include "quote.h" #include "stat-time.h" @@ -39,9 +36,7 @@ /* The official name of this program (e.g., no `g' prefix). */ #define PROGRAM_NAME "date" -#define AUTHORS "David MacKenzie" - -int putenv (); +#define AUTHORS proper_name ("David MacKenzie") static bool show_date (const char *format, struct timespec when); @@ -79,9 +74,6 @@ ARGMATCH_VERIFY (time_spec_string, time_spec); /* A format suitable for Internet RFC 2822. */ static char const rfc_2822_format[] = "%a, %d %b %Y %H:%M:%S %z"; -/* The name this program was run with, for error messages. */ -char *program_name; - /* For long options that have no equivalent short option, use a non-character as a pseudo short option, starting with CHAR_MAX + 1. */ enum @@ -158,8 +150,7 @@ Display the current time in the given FORMAT, or set the system date.\n\ fputs (VERSION_OPTION_DESCRIPTION, stdout); fputs (_("\ \n\ -FORMAT controls the output. The only valid option for the second form\n\ -specifies Coordinated Universal Time. Interpreted sequences are:\n\ +FORMAT controls the output. Interpreted sequences are:\n\ \n\ %% a literal %\n\ %a locale's abbreviated weekday name (e.g., Sun)\n\ @@ -171,7 +162,7 @@ specifies Coordinated Universal Time. Interpreted sequences are:\n\ %c locale's date and time (e.g., Thu Mar 3 23:05:25 2005)\n\ "), stdout); fputs (_("\ - %C century; like %Y, except omit last two digits (e.g., 21)\n\ + %C century; like %Y, except omit last two digits (e.g., 20)\n\ %d day of month (e.g, 01)\n\ %D date; same as %m/%d/%y\n\ %e day of month, space padded; same as %_d\n\ @@ -245,7 +236,7 @@ then an optional modifier, which is either\n\ E to use the locale's alternate representations if available, or\n\ O to use the locale's alternate numeric symbols if available.\n\ "), stdout); - printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT); + emit_bug_reporting_address (); } exit (status); } @@ -327,7 +318,7 @@ main (int argc, char **argv) int option_specified_date; initialize_main (&argc, &argv); - program_name = argv[0]; + set_program_name (argv[0]); setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); @@ -392,7 +383,7 @@ main (int argc, char **argv) /* POSIX says that `date -u' is equivalent to setting the TZ environment variable, so this option should do nothing other than setting TZ. */ - if (putenv ("TZ=UTC0") != 0) + if (putenv (bad_cast ("TZ=UTC0")) != 0) xalloc_die (); TZSET; break; @@ -446,8 +437,8 @@ main (int argc, char **argv) { error (0, 0, _("the argument %s lacks a leading `+';\n" - "When using an option to specify date(s), any non-option\n" - "argument must be a format string beginning with `+'."), + "when using an option to specify date(s), any non-option\n" + "argument must be a format string beginning with `+'"), quote (argv[optind])); usage (EXIT_FAILURE); } @@ -545,10 +536,7 @@ show_date (const char *format, struct timespec when) if (! tm) { char buf[INT_BUFSIZE_BOUND (intmax_t)]; - error (0, 0, _("time %s is out of range"), - (TYPE_SIGNED (time_t) - ? imaxtostr (when.tv_sec, buf) - : umaxtostr (when.tv_sec, buf))); + error (0, 0, _("time %s is out of range"), timetostr (when.tv_sec, buf)); return false; } diff --git a/src/bin/coreutils/src/dcgen b/src/bin/coreutils/src/dcgen index 5df3c56b89..da221a786e 100755 --- a/src/bin/coreutils/src/dcgen +++ b/src/bin/coreutils/src/dcgen @@ -3,10 +3,10 @@ # Copyright (C) 1996, 1998, 2004, 2005, 2006 Free Software Foundation, Inc. -# This program is free software; you can redistribute it and/or modify +# This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,9 +14,7 @@ # GNU General Public License for more details. # You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -# 02110-1301, USA. +# along with this program. If not, see . # written by Jim Meyering diff --git a/src/bin/coreutils/src/dd.c b/src/bin/coreutils/src/dd.c index 27a4a08c45..0028b53e4e 100644 --- a/src/bin/coreutils/src/dd.c +++ b/src/bin/coreutils/src/dd.c @@ -1,10 +1,10 @@ /* dd -- convert a file while copying it. - Copyright (C) 85, 90, 91, 1995-2007 Free Software Foundation, Inc. + Copyright (C) 85, 90, 91, 1995-2009 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Paul Rubin, David MacKenzie, and Stuart Kemp. */ @@ -29,10 +28,10 @@ #include "error.h" #include "fd-reopen.h" #include "gethrxtime.h" -#include "getpagesize.h" #include "human.h" #include "long-options.h" #include "quote.h" +#include "quotearg.h" #include "xstrtol.h" #include "xtime.h" @@ -41,7 +40,10 @@ static void process_signals (void); /* The official name of this program (e.g., no `g' prefix). */ #define PROGRAM_NAME "dd" -#define AUTHORS "Paul Rubin", "David MacKenzie", "Stuart Kemp" +#define AUTHORS \ + proper_name ("Paul Rubin"), \ + proper_name ("David MacKenzie"), \ + proper_name ("Stuart Kemp") /* Use SA_NOCLDSTOP as a proxy for whether the sigaction machinery is present. SA_NODEFER and SA_RESETHAND are XSI extensions. */ @@ -64,11 +66,16 @@ static void process_signals (void); # define SIGINFO SIGUSR1 #endif +/* This may belong in GNULIB's fcntl module instead. + Define O_CIO to 0 if it is not supported by this OS. */ +#ifndef O_CIO +# define O_CIO 0 +#endif + #if ! HAVE_FDATASYNC # define fdatasync(fd) (errno = ENOSYS, -1) #endif -#define max(a, b) ((a) > (b) ? (a) : (b)) #define output_char(c) \ do \ { \ @@ -126,9 +133,6 @@ enum STATUS_NOXFER = 01 }; -/* The name this program was run with. */ -char *program_name; - /* The name of the input file, or NULL for the standard input. */ static char const *input_file = NULL; @@ -195,8 +199,7 @@ static bool input_seekable; static int input_seek_errno; /* File offset of the input, in bytes, along with a flag recording - whether it overflowed. The offset is valid only if the input is - seekable and if the offset has not overflowed. */ + whether it overflowed. */ static uintmax_t input_offset; static bool input_offset_overflow; @@ -226,6 +229,9 @@ static sig_atomic_t volatile interrupt_signal; /* A count of the number of pending info signals that have been received. */ static sig_atomic_t volatile info_signal_count; +/* Function used for read (to handle iflag=fullblock parameter). */ +static ssize_t (*iread_fnc) (int fd, char *buf, size_t size); + /* A longest symbol in the struct symbol_values tables below. */ #define LONGEST_SYMBOL "fdatasync" @@ -257,11 +263,43 @@ static struct symbol_value const conversions[] = {"", 0} }; +enum + { + /* Compute a value that's bitwise disjoint from the union + of all O_ values. */ + v = ~(0 + | O_APPEND + | O_BINARY + | O_CIO + | O_DIRECT + | O_DIRECTORY + | O_DSYNC + | O_NOATIME + | O_NOCTTY + | O_NOFOLLOW + | O_NOLINKS + | O_NONBLOCK + | O_SYNC + | O_TEXT + ), + /* Use its lowest bit. */ + O_FULLBLOCK = v ^ (v & (v - 1)) + }; + +/* Ensure that we got something. */ +verify (O_FULLBLOCK != 0); + +#define MULTIPLE_BITS_SET(i) (((i) & ((i) - 1)) != 0) + +/* Ensure that this is a single-bit value. */ +verify ( ! MULTIPLE_BITS_SET (O_FULLBLOCK)); + /* Flags, for iflag="..." and oflag="...". */ static struct symbol_value const flags[] = { {"append", O_APPEND}, {"binary", O_BINARY}, + {"cio", O_CIO}, {"direct", O_DIRECT}, {"directory", O_DIRECTORY}, {"dsync", O_DSYNC}, @@ -272,6 +310,7 @@ static struct symbol_value const flags[] = {"nonblock", O_NONBLOCK}, {"sync", O_SYNC}, {"text", O_TEXT}, + {"fullblock", O_FULLBLOCK}, /* Accumulate full blocks from input. */ {"", 0} }; @@ -393,6 +432,25 @@ static char const ebcdic_to_ascii[] = '\070', '\071', '\372', '\373', '\374', '\375', '\376', '\377' }; +/* True if we need to close the standard output *stream*. */ +static bool close_stdout_required = true; + +/* The only reason to close the standard output *stream* is if + parse_long_options fails (as it does for --help or --version). + In any other case, dd uses only the STDOUT_FILENO file descriptor, + and the "cleanup" function calls "close (STDOUT_FILENO)". + Closing the file descriptor and then letting the usual atexit-run + close_stdout function call "fclose (stdout)" would result in a + harmless failure of the close syscall (with errno EBADF). + This function serves solely to avoid the unnecessary close_stdout + call, once parse_long_options has succeeded. */ +static void +maybe_close_stdout (void) +{ + if (close_stdout_required) + close_stdout (); +} + void usage (int status) { @@ -409,16 +467,16 @@ Usage: %s [OPERAND]...\n\ fputs (_("\ Copy a file, converting and formatting according to the operands.\n\ \n\ - bs=BYTES force ibs=BYTES and obs=BYTES\n\ + bs=BYTES read and write BYTES bytes at a time (also see ibs=,obs=)\n\ cbs=BYTES convert BYTES bytes at a time\n\ conv=CONVS convert the file as per the comma separated symbol list\n\ count=BLOCKS copy only BLOCKS input blocks\n\ - ibs=BYTES read BYTES bytes at a time\n\ + ibs=BYTES read BYTES bytes at a time (default: 512)\n\ "), stdout); fputs (_("\ if=FILE read from FILE instead of stdin\n\ iflag=FLAGS read as per the comma separated symbol list\n\ - obs=BYTES write BYTES bytes at a time\n\ + obs=BYTES write BYTES bytes at a time (default: 512)\n\ of=FILE write to FILE instead of stdout\n\ oflag=FLAGS write as per the comma separated symbol list\n\ seek=BLOCKS skip BLOCKS obs-sized blocks at start of output\n\ @@ -428,8 +486,8 @@ Copy a file, converting and formatting according to the operands.\n\ fputs (_("\ \n\ BLOCKS and BYTES may be followed by the following multiplicative suffixes:\n\ -xM M, c 1, w 2, b 512, kB 1000, K 1024, MB 1000*1000, M 1024*1024,\n\ -GB 1000*1000*1000, G 1024*1024*1024, and so on for T, P, E, Z, Y.\n\ +c =1, w =2, b =512, kB =1000, K =1024, MB =1000*1000, M =1024*1024, xM =M\n\ +GB =1000*1000*1000, G =1024*1024*1024, and so on for T, P, E, Z, Y.\n\ \n\ Each CONV symbol may be:\n\ \n\ @@ -462,14 +520,18 @@ Each FLAG symbol may be:\n\ \n\ append append mode (makes sense only for output; conv=notrunc suggested)\n\ "), stdout); + if (O_CIO) + fputs (_(" cio use concurrent I/O for data\n"), stdout); if (O_DIRECT) fputs (_(" direct use direct I/O for data\n"), stdout); if (O_DIRECTORY) - fputs (_(" directory fail unless a directory\n"), stdout); + fputs (_(" directory fail unless a directory\n"), stdout); if (O_DSYNC) fputs (_(" dsync use synchronized I/O for data\n"), stdout); if (O_SYNC) fputs (_(" sync likewise, but also for metadata\n"), stdout); + fputs (_(" fullblock accumulate full blocks of input (iflag only)\n"), + stdout); if (O_NONBLOCK) fputs (_(" nonblock use non-blocking I/O\n"), stdout); if (O_NOATIME) @@ -507,7 +569,7 @@ Options are:\n\ fputs (HELP_OPTION_DESCRIPTION, stdout); fputs (VERSION_OPTION_DESCRIPTION, stdout); - printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT); + emit_bug_reporting_address (); } exit (status); } @@ -527,7 +589,7 @@ translate_charset (char const *new_trans) static inline bool multiple_bits_set (int i) { - return (i & (i - 1)) != 0; + return MULTIPLE_BITS_SET (i); } /* Print transfer statistics. */ @@ -611,7 +673,7 @@ cleanup (void) _("closing output file %s"), quote (output_file)); } -static inline void ATTRIBUTE_NORETURN +static void ATTRIBUTE_NORETURN quit (int code) { cleanup (); @@ -744,6 +806,27 @@ iread (int fd, char *buf, size_t size) } } +/* Wrapper around iread function to accumulate full blocks. */ +static ssize_t +iread_fullblock (int fd, char *buf, size_t size) +{ + ssize_t nread = 0; + + while (0 < size) + { + ssize_t ncurr = iread (fd, buf, size); + if (ncurr < 0) + return ncurr; + if (ncurr == 0) + break; + nread += ncurr; + buf += ncurr; + size -= ncurr; + } + + return nread; +} + /* Write to FD the buffer BUF of size SIZE, processing any signals that arrive. Return the number of bytes written, setting errno if this is less than SIZE. Keep trying if there are partial @@ -767,7 +850,7 @@ iwrite (int fd, char const *buf, size_t size) else if (nwritten == 0) { /* Some buggy drivers return 0 when one tries to write beyond - a device's end. (Example: Linux 1.2.13 on /dev/fd0.) + a device's end. (Example: Linux kernel 1.2.13 on /dev/fd0.) Set errno to ENOSPC so they get a sensible diagnostic. */ errno = ENOSPC; break; @@ -798,41 +881,50 @@ write_output (void) oc = 0; } +/* Return true if STR is of the form "PATTERN" or "PATTERNDELIM...". */ + +static bool +operand_matches (char const *str, char const *pattern, char delim) +{ + while (*pattern) + if (*str++ != *pattern++) + return false; + return !*str || *str == delim; +} + /* Interpret one "conv=..." or similar operand STR according to the symbols in TABLE, returning the flags specified. If the operand - cannot be parsed, use ERROR_MSGID to generate a diagnostic. - As a by product, this function replaces each `,' in STR with a NUL byte. */ + cannot be parsed, use ERROR_MSGID to generate a diagnostic. */ static int -parse_symbols (char *str, struct symbol_value const *table, +parse_symbols (char const *str, struct symbol_value const *table, char const *error_msgid) { int value = 0; - do + for (;;) { + char const *strcomma = strchr (str, ','); struct symbol_value const *entry; - char *new = strchr (str, ','); - if (new != NULL) - *new++ = '\0'; - for (entry = table; ; entry++) + + for (entry = table; + ! (operand_matches (str, entry->symbol, ',') && entry->value); + entry++) { if (! entry->symbol[0]) { - error (0, 0, _(error_msgid), quote (str)); + size_t slen = strcomma ? strcomma - str : strlen (str); + error (0, 0, "%s: %s", _(error_msgid), + quotearg_n_style_mem (0, locale_quoting_style, str, slen)); usage (EXIT_FAILURE); } - if (STREQ (entry->symbol, str)) - { - if (! entry->value) - error (EXIT_FAILURE, 0, _(error_msgid), quote (str)); - value |= entry->value; - break; - } } - str = new; + + value |= entry->value; + if (!strcomma) + break; + str = strcomma + 1; } - while (str); return value; } @@ -869,78 +961,82 @@ parse_integer (const char *str, bool *invalid) return n; } +/* OPERAND is of the form "X=...". Return true if X is NAME. */ + +static bool +operand_is (char const *operand, char const *name) +{ + return operand_matches (operand, name, '='); +} + static void -scanargs (int argc, char **argv) +scanargs (int argc, char *const *argv) { int i; size_t blocksize = 0; for (i = optind; i < argc; i++) { - char *name, *val; + char const *name = argv[i]; + char const *val = strchr (name, '='); - name = argv[i]; - val = strchr (name, '='); if (val == NULL) { error (0, 0, _("unrecognized operand %s"), quote (name)); usage (EXIT_FAILURE); } - *val++ = '\0'; + val++; - if (STREQ (name, "if")) + if (operand_is (name, "if")) input_file = val; - else if (STREQ (name, "of")) + else if (operand_is (name, "of")) output_file = val; - else if (STREQ (name, "conv")) + else if (operand_is (name, "conv")) conversions_mask |= parse_symbols (val, conversions, - N_("invalid conversion: %s")); - else if (STREQ (name, "iflag")) + N_("invalid conversion")); + else if (operand_is (name, "iflag")) input_flags |= parse_symbols (val, flags, - N_("invalid input flag: %s")); - else if (STREQ (name, "oflag")) + N_("invalid input flag")); + else if (operand_is (name, "oflag")) output_flags |= parse_symbols (val, flags, - N_("invalid output flag: %s")); - else if (STREQ (name, "status")) + N_("invalid output flag")); + else if (operand_is (name, "status")) status_flags |= parse_symbols (val, statuses, - N_("invalid status flag: %s")); + N_("invalid status flag")); else { bool invalid = false; uintmax_t n = parse_integer (val, &invalid); - if (STREQ (name, "ibs")) + if (operand_is (name, "ibs")) { invalid |= ! (0 < n && n <= MAX_BLOCKSIZE (INPUT_BLOCK_SLOP)); input_blocksize = n; - conversions_mask |= C_TWOBUFS; } - else if (STREQ (name, "obs")) + else if (operand_is (name, "obs")) { invalid |= ! (0 < n && n <= MAX_BLOCKSIZE (OUTPUT_BLOCK_SLOP)); output_blocksize = n; - conversions_mask |= C_TWOBUFS; } - else if (STREQ (name, "bs")) + else if (operand_is (name, "bs")) { invalid |= ! (0 < n && n <= MAX_BLOCKSIZE (INPUT_BLOCK_SLOP)); blocksize = n; } - else if (STREQ (name, "cbs")) + else if (operand_is (name, "cbs")) { invalid |= ! (0 < n && n <= SIZE_MAX); conversion_blocksize = n; } - else if (STREQ (name, "skip")) + else if (operand_is (name, "skip")) skip_records = n; - else if (STREQ (name, "seek")) + else if (operand_is (name, "seek")) seek_records = n; - else if (STREQ (name, "count")) + else if (operand_is (name, "count")) max_records = n; else { - error (0, 0, _("unrecognized operand %s=%s"), - quote_n (0, name), quote_n (1, val)); + error (0, 0, _("unrecognized operand %s"), quote (name)); usage (EXIT_FAILURE); } @@ -951,12 +1047,13 @@ scanargs (int argc, char **argv) if (blocksize) input_blocksize = output_blocksize = blocksize; + else + { + /* POSIX says dd aggregates short reads into + output_blocksize if bs= is not specified. */ + conversions_mask |= C_TWOBUFS; + } - /* If bs= was given, both `input_blocksize' and `output_blocksize' will - have been set to positive values. If either has not been set, - bs= was not given, so make sure two buffers are used. */ - if (input_blocksize == 0 || output_blocksize == 0) - conversions_mask |= C_TWOBUFS; if (input_blocksize == 0) input_blocksize = DEFAULT_BLOCKSIZE; if (output_blocksize == 0) @@ -967,6 +1064,16 @@ scanargs (int argc, char **argv) if (input_flags & (O_DSYNC | O_SYNC)) input_flags |= O_RSYNC; + if (output_flags & O_FULLBLOCK) + { + error (0, 0, "%s: %s", _("invalid output flag"), "'fullblock'"); + usage (EXIT_FAILURE); + } + iread_fnc = ((input_flags & O_FULLBLOCK) + ? iread_fullblock + : iread); + input_flags &= ~O_FULLBLOCK; + if (multiple_bits_set (conversions_mask & (C_ASCII | C_EBCDIC | C_IBM))) error (EXIT_FAILURE, 0, _("cannot combine any two of {ascii,ebcdic,ibm}")); if (multiple_bits_set (conversions_mask & (C_BLOCK | C_UNBLOCK))) @@ -1094,7 +1201,7 @@ advance_input_offset (uintmax_t offset) to indicate that lseek failed. The offending behavior has been confirmed with an Exabyte SCSI tape - drive accessed via /dev/nst0 on both Linux-2.2.17 and Linux-2.4.16. */ + drive accessed via /dev/nst0 on both Linux 2.2.17 and 2.4.16 kernels. */ #ifdef __linux__ @@ -1155,16 +1262,66 @@ skip (int fdesc, char const *file, uintmax_t records, size_t blocksize, && 0 <= skip_via_lseek (file, fdesc, offset, SEEK_CUR)) { if (fdesc == STDIN_FILENO) - advance_input_offset (offset); - return 0; + { + struct stat st; + if (fstat (STDIN_FILENO, &st) != 0) + error (EXIT_FAILURE, errno, _("cannot fstat %s"), quote (file)); + if (S_ISREG (st.st_mode) && st.st_size < (input_offset + offset)) + { + /* When skipping past EOF, return the number of _full_ blocks + * that are not skipped, and set offset to EOF, so the caller + * can determine the requested skip was not satisfied. */ + records = ( offset - st.st_size ) / blocksize; + offset = st.st_size - input_offset; + } + else + records = 0; + advance_input_offset (offset); + } + else + records = 0; + return records; } else { int lseek_errno = errno; + off_t soffset; + + /* The seek request may have failed above if it was too big + (> device size, > max file size, etc.) + Or it may not have been done at all (> OFF_T_MAX). + Therefore try to seek to the end of the file, + to avoid redundant reading. */ + if ((soffset = skip_via_lseek (file, fdesc, 0, SEEK_END)) >= 0) + { + /* File is seekable, and we're at the end of it, and + size <= OFF_T_MAX. So there's no point using read to advance. */ + + if (!lseek_errno) + { + /* The original seek was not attempted as offset > OFF_T_MAX. + We should error for write as can't get to the desired + location, even if OFF_T_MAX < max file size. + For read we're not going to read any data anyway, + so we should error for consistency. + It would be nice to not error for /dev/{zero,null} + for any offset, but that's not a significant issue. */ + lseek_errno = EOVERFLOW; + } + + if (fdesc == STDIN_FILENO) + error (0, lseek_errno, _("%s: cannot skip"), quote (file)); + else + error (0, lseek_errno, _("%s: cannot seek"), quote (file)); + /* If the file has a specific size and we've asked + to skip/seek beyond the max allowable, then quit. */ + quit (EXIT_FAILURE); + } + /* else file_size && offset > OFF_T_MAX or file ! seekable */ do { - ssize_t nread = iread (fdesc, buf, blocksize); + ssize_t nread = iread_fnc (fdesc, buf, blocksize); if (nread < 0) { if (fdesc == STDIN_FILENO) @@ -1408,7 +1565,7 @@ dd_copy (void) the input buffer; thus we allocate 2 pages of slop in the real buffer. 8k above the blocksize shouldn't bother anyone. - The page alignment is necessary on any linux system that supports + The page alignment is necessary on any Linux kernel that supports either the SGI raw I/O patch or Steven Tweedies raw I/O patch. It is necessary when accessing raw (i.e. character special) disk devices on Unixware or other SVR4-derived system. */ @@ -1433,10 +1590,22 @@ dd_copy (void) if (skip_records != 0) { - skip (STDIN_FILENO, input_file, skip_records, input_blocksize, ibuf); + uintmax_t us_bytes = input_offset + (skip_records * input_blocksize); + uintmax_t us_blocks = skip (STDIN_FILENO, input_file, + skip_records, input_blocksize, ibuf); + us_bytes -= input_offset; + /* POSIX doesn't say what to do when dd detects it has been - asked to skip past EOF, so I assume it's non-fatal if the - call to 'skip' returns nonzero. FIXME: maybe give a warning. */ + asked to skip past EOF, so I assume it's non-fatal. + There are 3 reasons why there might be unskipped blocks/bytes: + 1. file is too small + 2. pipe has not enough data + 3. short reads */ + if (us_blocks || (!input_offset_overflow && us_bytes)) + { + error (0, 0, + _("%s: cannot skip to specified offset"), quote (input_file)); + } } if (seek_records != 0) @@ -1475,7 +1644,7 @@ dd_copy (void) (conversions_mask & (C_BLOCK | C_UNBLOCK)) ? ' ' : '\0', input_blocksize); - nread = iread (STDIN_FILENO, ibuf, input_blocksize); + nread = iread_fnc (STDIN_FILENO, ibuf, input_blocksize); if (nread == 0) break; /* EOF. */ @@ -1635,18 +1804,20 @@ main (int argc, char **argv) off_t offset; initialize_main (&argc, &argv); - program_name = argv[0]; + set_program_name (argv[0]); setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); /* Arrange to close stdout if parse_long_options exits. */ - atexit (close_stdout); + atexit (maybe_close_stdout); page_size = getpagesize (); - parse_long_options (argc, argv, PROGRAM_NAME, PACKAGE, VERSION, + parse_long_options (argc, argv, PROGRAM_NAME, PACKAGE, Version, usage, AUTHORS, (char const *) NULL); + close_stdout_required = false; + if (getopt_long (argc, argv, "", NULL, NULL) != -1) usage (EXIT_FAILURE); @@ -1672,7 +1843,7 @@ main (int argc, char **argv) offset = lseek (STDIN_FILENO, 0, SEEK_CUR); input_seekable = (0 <= offset); - input_offset = offset; + input_offset = MAX(0, offset); input_seek_errno = errno; if (output_file == NULL) @@ -1716,7 +1887,7 @@ main (int argc, char **argv) /* Complain only when ftruncate fails on a regular file, a directory, or a shared memory object, as POSIX 1003.1-2004 specifies ftruncate's behavior only for these file types. - For example, do not complain when Linux 2.4 ftruncate + For example, do not complain when Linux kernel 2.4 ftruncate fails on /dev/fd0. */ int ftruncate_errno = errno; struct stat stdout_stat; diff --git a/src/bin/coreutils/src/df.c b/src/bin/coreutils/src/df.c index 609787eea2..070980e252 100644 --- a/src/bin/coreutils/src/df.c +++ b/src/bin/coreutils/src/df.c @@ -1,10 +1,10 @@ /* df - summarize free disk space - Copyright (C) 91, 1995-2007 Free Software Foundation, Inc. + Copyright (C) 91, 1995-2009 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by David MacKenzie . --human-readable and --megabyte options added by lm@sgi.com. @@ -29,7 +28,6 @@ #include "error.h" #include "fsusage.h" #include "human.h" -#include "inttostr.h" #include "mountlist.h" #include "quote.h" #include "save-cwd.h" @@ -39,10 +37,9 @@ #define PROGRAM_NAME "df" #define AUTHORS \ - "Torbjorn Granlund", "David MacKenzie", "Paul Eggert" - -/* Name this program was run with. */ -char *program_name; + proper_name_utf8 ("Torbjorn Granlund", "Torbj\303\266rn Granlund"), \ + proper_name ("David MacKenzie"), \ + proper_name ("Paul Eggert") /* If true, show inode information. */ static bool inode_format; @@ -73,7 +70,7 @@ static bool file_systems_processed; /* If true, invoke the `sync' system call before getting any usage data. Using this option can make df very slow, especially with many or very busy disks. Note that this may make a difference on some systems -- - SunOS 4.1.3, for one. It is *not* necessary on Linux. */ + SunOS 4.1.3, for one. It is *not* necessary on GNU/Linux. */ static bool require_sync; /* Desired exit status. */ @@ -111,13 +108,17 @@ static struct mount_entry *mount_list; /* If true, print file system type as well. */ static bool print_type; +/* If true, print a grand total at the end. */ +static bool print_grand_total; + +/* Grand total data. */ +static struct fs_usage grand_fsu; + /* For long options that have no equivalent short option, use a non-character as a pseudo short option, starting with CHAR_MAX + 1. */ enum { NO_SYNC_OPTION = CHAR_MAX + 1, - /* FIXME: --kilobytes is deprecated (but not -k); remove in late 2006 */ - KILOBYTES_LONG_OPTION, SYNC_OPTION }; @@ -128,13 +129,13 @@ static struct option const long_options[] = {"inodes", no_argument, NULL, 'i'}, {"human-readable", no_argument, NULL, 'h'}, {"si", no_argument, NULL, 'H'}, - {"kilobytes", no_argument, NULL, KILOBYTES_LONG_OPTION}, {"local", no_argument, NULL, 'l'}, {"megabytes", no_argument, NULL, 'm'}, /* obsolescent */ {"portability", no_argument, NULL, 'P'}, {"print-type", no_argument, NULL, 'T'}, {"sync", no_argument, NULL, SYNC_OPTION}, {"no-sync", no_argument, NULL, NO_SYNC_OPTION}, + {"total", no_argument, NULL, 'c'}, {"type", required_argument, NULL, 't'}, {"exclude-type", required_argument, NULL, 'x'}, {GETOPT_HELP_OPTION_DECL}, @@ -230,18 +231,28 @@ excluded_fstype (const char *fstype) return false; } +/* Return true if N is a known integer value. On many file systems, + UINTMAX_MAX represents an unknown value; on AIX, UINTMAX_MAX - 1 + represents unknown. Use a rule that works on AIX file systems, and + that almost-always works on other types. */ +static bool +known_value (uintmax_t n) +{ + return n < UINTMAX_MAX - 1; +} + /* Like human_readable (N, BUF, human_output_opts, INPUT_UNITS, OUTPUT_UNITS), except: - If NEGATIVE, then N represents a negative number, expressed in two's complement. - - Otherwise, return "-" if N is UINTMAX_MAX. */ + - Otherwise, return "-" if N is unknown. */ static char const * df_readable (bool negative, uintmax_t n, char *buf, uintmax_t input_units, uintmax_t output_units) { - if (n == UINTMAX_MAX && !negative) + if (! known_value (n) && !negative) return "-"; else { @@ -253,6 +264,41 @@ df_readable (bool negative, uintmax_t n, char *buf, } } +/* Logical equivalence */ +#define LOG_EQ(a, b) (!(a) == !(b)) + +/* Add integral value while using uintmax_t for value part and separate + negation flag. It adds value of SRC and SRC_NEG to DEST and DEST_NEG. + The result will be in DEST and DEST_NEG. See df_readable to understand + how the negation flag is used. */ +static void +add_uint_with_neg_flag (uintmax_t *dest, bool *dest_neg, + uintmax_t src, bool src_neg) +{ + if (LOG_EQ (*dest_neg, src_neg)) + { + *dest += src; + return; + } + + if (*dest_neg) + *dest = -*dest; + + if (src_neg) + src = -src; + + if (src < *dest) + *dest -= src; + else + { + *dest = src - *dest; + *dest_neg = src_neg; + } + + if (*dest_neg) + *dest = -*dest; +} + /* Display a space listing for the disk device with absolute file name DISK. If MOUNT_POINT is non-NULL, it is the name of the root of the file system on DISK. @@ -269,7 +315,8 @@ df_readable (bool negative, uintmax_t n, char *buf, static void show_dev (char const *disk, char const *mount_point, char const *stat_file, char const *fstype, - bool me_dummy, bool me_remote) + bool me_dummy, bool me_remote, + const struct fs_usage *force_fsu) { struct fs_usage fsu; char buf[3][LONGEST_HUMAN_READABLE + 2]; @@ -302,7 +349,9 @@ show_dev (char const *disk, char const *mount_point, if (!stat_file) stat_file = mount_point ? mount_point : disk; - if (get_fs_usage (stat_file, disk, &fsu)) + if (force_fsu) + fsu = *force_fsu; + else if (get_fs_usage (stat_file, disk, &fsu)) { error (0, errno, "%s", quote (stat_file)); exit_status = EXIT_FAILURE; @@ -353,6 +402,11 @@ show_dev (char const *disk, char const *mount_point, available = fsu.fsu_ffree; negate_available = false; available_to_root = available; + + if (known_value (total)) + grand_fsu.fsu_files += total; + if (known_value (available)) + grand_fsu.fsu_ffree += available; } else { @@ -377,13 +431,22 @@ show_dev (char const *disk, char const *mount_point, total = fsu.fsu_blocks; available = fsu.fsu_bavail; negate_available = (fsu.fsu_bavail_top_bit_set - & (available != UINTMAX_MAX)); + & known_value (available)); available_to_root = fsu.fsu_bfree; + + if (known_value (total)) + grand_fsu.fsu_blocks += input_units * total; + if (known_value (available_to_root)) + grand_fsu.fsu_bfree += input_units * available_to_root; + if (known_value (available)) + add_uint_with_neg_flag (&grand_fsu.fsu_bavail, + &grand_fsu.fsu_bavail_top_bit_set, + input_units * available, negate_available); } used = UINTMAX_MAX; negate_used = false; - if (total != UINTMAX_MAX && available_to_root != UINTMAX_MAX) + if (known_value (total) && known_value (available_to_root)) { used = total - available_to_root; negate_used = (total < available_to_root); @@ -398,7 +461,7 @@ show_dev (char const *disk, char const *mount_point, width, df_readable (negate_available, available, buf[2], input_units, output_units)); - if (used == UINTMAX_MAX || available == UINTMAX_MAX) + if (! known_value (used) || ! known_value (available)) ; else if (!negate_used && used <= TYPE_MAXIMUM (uintmax_t) / 100 @@ -556,7 +619,7 @@ show_disk (char const *disk) { show_dev (best_match->me_devname, best_match->me_mountdir, NULL, best_match->me_type, best_match->me_dummy, - best_match->me_remote); + best_match->me_remote, NULL); return true; } @@ -660,7 +723,8 @@ show_point (const char *point, const struct stat *statp) if (best_match) show_dev (best_match->me_devname, best_match->me_mountdir, point, - best_match->me_type, best_match->me_dummy, best_match->me_remote); + best_match->me_type, best_match->me_dummy, best_match->me_remote, + NULL); else { /* We couldn't find the mount entry corresponding to POINT. Go ahead and @@ -671,7 +735,7 @@ show_point (const char *point, const struct stat *statp) char *mp = find_mount_point (point, statp); if (mp) { - show_dev (NULL, mp, NULL, NULL, false, false); + show_dev (NULL, mp, NULL, NULL, false, false, NULL); free (mp); } } @@ -700,7 +764,7 @@ show_all_entries (void) for (me = mount_list; me; me = me->me_next) show_dev (me->me_devname, me->me_mountdir, NULL, me->me_type, - me->me_dummy, me->me_remote); + me->me_dummy, me->me_remote, NULL); } /* Add FSTYPE to the list of file system types to display. */ @@ -749,6 +813,7 @@ Mandatory arguments to long options are mandatory for short options too.\n\ fputs (_("\ -a, --all include dummy file systems\n\ -B, --block-size=SIZE use SIZE-byte blocks\n\ + --total produce a grand total\n\ -h, --human-readable print sizes in human readable format (e.g., 1K 234M 2G)\n\ -H, --si likewise, but use powers of 1000 not 1024\n\ "), stdout); @@ -772,7 +837,7 @@ Mandatory arguments to long options are mandatory for short options too.\n\ SIZE may be (or may be an integer optionally followed by) one of following:\n\ kB 1000, K 1024, MB 1000*1000, M 1024*1024, and so on for G, T, P, E, Z, Y.\n\ "), stdout); - printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT); + emit_bug_reporting_address (); } exit (status); } @@ -780,11 +845,10 @@ kB 1000, K 1024, MB 1000*1000, M 1024*1024, and so on for G, T, P, E, Z, Y.\n\ int main (int argc, char **argv) { - int c; struct stat *stats IF_LINT (= 0); initialize_main (&argc, &argv); - program_name = argv[0]; + set_program_name (argv[0]); setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); @@ -801,17 +865,29 @@ main (int argc, char **argv) file_systems_processed = false; posix_format = false; exit_status = EXIT_SUCCESS; + print_grand_total = false; + grand_fsu.fsu_blocksize = 1; - while ((c = getopt_long (argc, argv, "aB:iF:hHklmPTt:vx:", long_options, NULL)) - != -1) + for (;;) { + int oi = -1; + int c = getopt_long (argc, argv, "aB:iF:hHklmPTt:vx:", long_options, + &oi); + if (c == -1) + break; + switch (c) { case 'a': show_all_fs = true; break; case 'B': - human_output_opts = human_options (optarg, true, &output_block_size); + { + enum strtol_error e = human_options (optarg, &human_output_opts, + &output_block_size); + if (e != LONGINT_OK) + xstrtol_fatal (e, oi, c, long_options, optarg); + } break; case 'i': inode_format = true; @@ -824,10 +900,6 @@ main (int argc, char **argv) human_output_opts = human_autoscale | human_SI; output_block_size = 1; break; - case KILOBYTES_LONG_OPTION: - error (0, 0, - _("the --kilobytes option is deprecated; use -k instead")); - /* fall through */ case 'k': human_output_opts = 0; output_block_size = 1024; @@ -865,6 +937,10 @@ main (int argc, char **argv) add_excluded_fs_type (optarg); break; + case 'c': + print_grand_total = true; + break; + case_GETOPT_HELP_CHAR; case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS); @@ -881,8 +957,8 @@ main (int argc, char **argv) output_block_size = (getenv ("POSIXLY_CORRECT") ? 512 : 1024); } else - human_output_opts = human_options (getenv ("DF_BLOCK_SIZE"), false, - &output_block_size); + human_options (getenv ("DF_BLOCK_SIZE"), + &human_output_opts, &output_block_size); } /* Fail if the same file system type was both selected and excluded. */ @@ -912,17 +988,21 @@ main (int argc, char **argv) { int i; - /* stat all the given entries to make sure they get automounted, - if necessary, before reading the file system table. */ + /* Open each of the given entries to make sure any corresponding + partition is automounted. This must be done before reading the + file system table. */ stats = xnmalloc (argc - optind, sizeof *stats); for (i = optind; i < argc; ++i) { - if (stat (argv[i], &stats[i - optind])) + int fd = open (argv[i], O_RDONLY | O_NOCTTY); + if (fd < 0 || fstat (fd, &stats[i - optind])) { error (0, errno, "%s", quote (argv[i])); exit_status = EXIT_FAILURE; argv[i] = NULL; } + if (0 <= fd) + close (fd); } } @@ -937,10 +1017,10 @@ main (int argc, char **argv) /* Couldn't read the table of mounted file systems. Fail if df was invoked with no file name arguments; Otherwise, merely give a warning and proceed. */ + int status = (optind < argc ? 0 : EXIT_FAILURE); const char *warning = (optind < argc ? _("Warning: ") : ""); - int status = (optind < argc ? 0 : EXIT_FAILURE); - error (status, errno, - _("%scannot read table of mounted file systems"), warning); + error (status, errno, "%s%s", warning, + _("cannot read table of mounted file systems")); } if (require_sync) @@ -960,6 +1040,13 @@ main (int argc, char **argv) else show_all_entries (); + if (print_grand_total) + { + if (inode_format) + grand_fsu.fsu_blocks = 1; + show_dev ("total", NULL, NULL, NULL, false, false, &grand_fsu); + } + if (! file_systems_processed) error (EXIT_FAILURE, 0, _("no file systems processed")); diff --git a/src/bin/coreutils/src/dircolors.c b/src/bin/coreutils/src/dircolors.c index 82eb1e088f..7dad7fd9b8 100644 --- a/src/bin/coreutils/src/dircolors.c +++ b/src/bin/coreutils/src/dircolors.c @@ -1,11 +1,11 @@ /* dircolors - output commands to set the LS_COLOR environment variable - Copyright (C) 1996-2007 Free Software Foundation, Inc. + Copyright (C) 1996-2008 Free Software Foundation, Inc. Copyright (C) 1994, 1995, 1997, 1998, 1999, 2000 H. Peter Anvin - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ #include @@ -26,7 +25,6 @@ #include "dircolors.h" #include "c-strcase.h" #include "error.h" -#include "getline.h" #include "obstack.h" #include "quote.h" #include "xstrndup.h" @@ -34,7 +32,7 @@ /* The official name of this program (e.g., no `g' prefix). */ #define PROGRAM_NAME "dircolors" -#define AUTHORS "H. Peter Anvin" +#define AUTHORS proper_name ("H. Peter Anvin") #define obstack_chunk_alloc malloc #define obstack_chunk_free free @@ -61,18 +59,19 @@ static struct obstack lsc_obstack; static const char *const slack_codes[] = { - "NORMAL", "NORM", "FILE", "DIR", "LNK", "LINK", + "NORMAL", "NORM", "FILE", "RESET", "DIR", "LNK", "LINK", "SYMLINK", "ORPHAN", "MISSING", "FIFO", "PIPE", "SOCK", "BLK", "BLOCK", "CHR", "CHAR", "DOOR", "EXEC", "LEFT", "LEFTCODE", "RIGHT", "RIGHTCODE", "END", "ENDCODE", "SUID", "SETUID", "SGID", "SETGID", "STICKY", - "OTHER_WRITABLE", "OWR", "STICKY_OTHER_WRITABLE", "OWT", NULL + "OTHER_WRITABLE", "OWR", "STICKY_OTHER_WRITABLE", "OWT", "CAPABILITY", + "HARDLINK", "CLRTOEOL", NULL }; static const char *const ls_codes[] = { - "no", "no", "fi", "di", "ln", "ln", "ln", "or", "mi", "pi", "pi", + "no", "no", "fi", "rs", "di", "ln", "ln", "ln", "or", "mi", "pi", "pi", "so", "bd", "bd", "cd", "cd", "do", "ex", "lc", "lc", "rc", "rc", "ec", "ec", - "su", "su", "sg", "sg", "st", "ow", "ow", "tw", "tw", NULL + "su", "su", "sg", "sg", "st", "ow", "ow", "tw", "tw", "ca", "hl", "cl", NULL }; #define array_len(Array) (sizeof (Array) / sizeof *(Array)) verify (array_len (slack_codes) == array_len (ls_codes)); @@ -89,8 +88,6 @@ static struct option const long_options[] = {NULL, 0, NULL, 0} }; -char *program_name; - void usage (int status) { @@ -116,7 +113,7 @@ If FILE is specified, read it to determine which colors to use for which\n\ file types and extensions. Otherwise, a precompiled database is used.\n\ For details on the format of these files, run `dircolors --print-database'.\n\ "), stdout); - printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT); + emit_bug_reporting_address (); } exit (status); @@ -404,7 +401,7 @@ main (int argc, char **argv) bool print_database = false; initialize_main (&argc, &argv); - program_name = argv[0]; + set_program_name (argv[0]); setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); @@ -452,8 +449,8 @@ to select a shell syntax are mutually exclusive")); error (0, 0, _("extra operand %s"), quote (argv[!print_database])); if (print_database) fprintf (stderr, "%s\n", - _("File operands cannot be combined with " - "--print-database (-p).")); + _("file operands cannot be combined with " + "--print-database (-p)")); usage (EXIT_FAILURE); } diff --git a/src/bin/coreutils/src/dircolors.h b/src/bin/coreutils/src/dircolors.h index c74fb530c0..2a141ef25e 100644 --- a/src/bin/coreutils/src/dircolors.h +++ b/src/bin/coreutils/src/dircolors.h @@ -2,7 +2,7 @@ static char const G_line[] = { '#',' ','C','o','n','f','i','g','u','r','a','t','i','o','n',' ','f','i','l','e',' ','f','o','r',' ','d','i','r','c','o','l','o','r','s',',',' ','a',' ','u','t','i','l','i','t','y',' ','t','o',' ','h','e','l','p',' ','y','o','u',' ','s','e','t',' ','t','h','e',0, '#',' ','L','S','_','C','O','L','O','R','S',' ','e','n','v','i','r','o','n','m','e','n','t',' ','v','a','r','i','a','b','l','e',' ','u','s','e','d',' ','b','y',' ','G','N','U',' ','l','s',' ','w','i','t','h',' ','t','h','e',' ','-','-','c','o','l','o','r',' ','o','p','t','i','o','n','.',0, - '#',' ','C','o','p','y','r','i','g','h','t',' ','(','C',')',' ','1','9','9','6',',',' ','1','9','9','9',',',' ','2','0','0','0',',',' ','2','0','0','1',',',' ','2','0','0','2',',',' ','2','0','0','3',',',' ','2','0','0','4',',',' ','2','0','0','5',',',' ','2','0','0','6',0, + '#',' ','C','o','p','y','r','i','g','h','t',' ','(','C',')',' ','1','9','9','6',',',' ','1','9','9','9','-','2','0','0','8',0, '#',' ','F','r','e','e',' ','S','o','f','t','w','a','r','e',' ','F','o','u','n','d','a','t','i','o','n',',',' ','I','n','c','.',0, '#',' ','C','o','p','y','i','n','g',' ','a','n','d',' ','d','i','s','t','r','i','b','u','t','i','o','n',' ','o','f',' ','t','h','i','s',' ','f','i','l','e',',',' ','w','i','t','h',' ','o','r',' ','w','i','t','h','o','u','t',' ','m','o','d','i','f','i','c','a','t','i','o','n',',',0, '#',' ','a','r','e',' ','p','e','r','m','i','t','t','e','d',' ','p','r','o','v','i','d','e','d',' ','t','h','e',' ','c','o','p','y','r','i','g','h','t',' ','n','o','t','i','c','e',' ','a','n','d',' ','t','h','i','s',' ','n','o','t','i','c','e',' ','a','r','e',' ','p','r','e','s','e','r','v','e','d','.',0, @@ -26,7 +26,10 @@ static char const G_line[] = 'T','E','R','M',' ','c','o','n','s','o','l','e',0, 'T','E','R','M',' ','c','y','g','w','i','n',0, 'T','E','R','M',' ','d','t','t','e','r','m',0, + 'T','E','R','M',' ','e','t','e','r','m','-','c','o','l','o','r',0, 'T','E','R','M',' ','g','n','o','m','e',0, + 'T','E','R','M',' ','g','n','o','m','e','-','2','5','6','c','o','l','o','r',0, + 'T','E','R','M',' ','j','f','b','t','e','r','m',0, 'T','E','R','M',' ','k','o','n','s','o','l','e',0, 'T','E','R','M',' ','k','t','e','r','m',0, 'T','E','R','M',' ','l','i','n','u','x',0, @@ -39,12 +42,15 @@ static char const G_line[] = 'T','E','R','M',' ','r','x','v','t','-','c','y','g','w','i','n','-','n','a','t','i','v','e',0, 'T','E','R','M',' ','r','x','v','t','-','u','n','i','c','o','d','e',0, 'T','E','R','M',' ','s','c','r','e','e','n',0, + 'T','E','R','M',' ','s','c','r','e','e','n','-','2','5','6','c','o','l','o','r',0, 'T','E','R','M',' ','s','c','r','e','e','n','-','b','c','e',0, 'T','E','R','M',' ','s','c','r','e','e','n','-','w',0, 'T','E','R','M',' ','s','c','r','e','e','n','.','l','i','n','u','x',0, 'T','E','R','M',' ','v','t','1','0','0',0, 'T','E','R','M',' ','x','t','e','r','m',0, + 'T','E','R','M',' ','x','t','e','r','m','-','1','6','c','o','l','o','r',0, 'T','E','R','M',' ','x','t','e','r','m','-','2','5','6','c','o','l','o','r',0, + 'T','E','R','M',' ','x','t','e','r','m','-','8','8','c','o','l','o','r',0, 'T','E','R','M',' ','x','t','e','r','m','-','c','o','l','o','r',0, 'T','E','R','M',' ','x','t','e','r','m','-','d','e','b','i','a','n',0, '#',' ','B','e','l','o','w',' ','a','r','e',' ','t','h','e',' ','c','o','l','o','r',' ','i','n','i','t',' ','s','t','r','i','n','g','s',' ','f','o','r',' ','t','h','e',' ','b','a','s','i','c',' ','f','i','l','e',' ','t','y','p','e','s','.',' ','A',' ','c','o','l','o','r',' ','i','n','i','t',0, @@ -55,11 +61,13 @@ static char const G_line[] = '#',' ','3','0','=','b','l','a','c','k',' ','3','1','=','r','e','d',' ','3','2','=','g','r','e','e','n',' ','3','3','=','y','e','l','l','o','w',' ','3','4','=','b','l','u','e',' ','3','5','=','m','a','g','e','n','t','a',' ','3','6','=','c','y','a','n',' ','3','7','=','w','h','i','t','e',0, '#',' ','B','a','c','k','g','r','o','u','n','d',' ','c','o','l','o','r',' ','c','o','d','e','s',':',0, '#',' ','4','0','=','b','l','a','c','k',' ','4','1','=','r','e','d',' ','4','2','=','g','r','e','e','n',' ','4','3','=','y','e','l','l','o','w',' ','4','4','=','b','l','u','e',' ','4','5','=','m','a','g','e','n','t','a',' ','4','6','=','c','y','a','n',' ','4','7','=','w','h','i','t','e',0, - 'N','O','R','M','A','L',' ','0','0',' ','#',' ','g','l','o','b','a','l',' ','d','e','f','a','u','l','t',',',' ','a','l','t','h','o','u','g','h',' ','e','v','e','r','y','t','h','i','n','g',' ','s','h','o','u','l','d',' ','b','e',' ','s','o','m','e','t','h','i','n','g','.',0, - 'F','I','L','E',' ','0','0',' ','#',' ','n','o','r','m','a','l',' ','f','i','l','e',0, + '#','N','O','R','M','A','L',' ','0','0',' ','#',' ','n','o',' ','c','o','l','o','r',' ','c','o','d','e',' ','a','t',' ','a','l','l',0, + '#','F','I','L','E',' ','0','0',' ','#',' ','r','e','g','u','l','a','r',' ','f','i','l','e',':',' ','u','s','e',' ','n','o',' ','c','o','l','o','r',' ','a','t',' ','a','l','l',0, + 'R','E','S','E','T',' ','0',' ','#',' ','r','e','s','e','t',' ','t','o',' ','"','n','o','r','m','a','l','"',' ','c','o','l','o','r',0, 'D','I','R',' ','0','1',';','3','4',' ','#',' ','d','i','r','e','c','t','o','r','y',0, 'L','I','N','K',' ','0','1',';','3','6',' ','#',' ','s','y','m','b','o','l','i','c',' ','l','i','n','k','.',' ','(','I','f',' ','y','o','u',' ','s','e','t',' ','t','h','i','s',' ','t','o',' ','\'','t','a','r','g','e','t','\'',' ','i','n','s','t','e','a','d',' ','o','f',' ','a',0, ' ','#',' ','n','u','m','e','r','i','c','a','l',' ','v','a','l','u','e',',',' ','t','h','e',' ','c','o','l','o','r',' ','i','s',' ','a','s',' ','f','o','r',' ','t','h','e',' ','f','i','l','e',' ','p','o','i','n','t','e','d',' ','t','o','.',')',0, + 'H','A','R','D','L','I','N','K',' ','4','4',';','3','7',' ','#',' ','r','e','g','u','l','a','r',' ','f','i','l','e',' ','w','i','t','h',' ','m','o','r','e',' ','t','h','a','n',' ','o','n','e',' ','l','i','n','k',0, 'F','I','F','O',' ','4','0',';','3','3',' ','#',' ','p','i','p','e',0, 'S','O','C','K',' ','0','1',';','3','5',' ','#',' ','s','o','c','k','e','t',0, 'D','O','O','R',' ','0','1',';','3','5',' ','#',' ','d','o','o','r',0, @@ -68,6 +76,7 @@ static char const G_line[] = 'O','R','P','H','A','N',' ','4','0',';','3','1',';','0','1',' ','#',' ','s','y','m','l','i','n','k',' ','t','o',' ','n','o','n','e','x','i','s','t','e','n','t',' ','f','i','l','e',',',' ','o','r',' ','n','o','n','-','s','t','a','t','\'','a','b','l','e',' ','f','i','l','e',0, 'S','E','T','U','I','D',' ','3','7',';','4','1',' ','#',' ','f','i','l','e',' ','t','h','a','t',' ','i','s',' ','s','e','t','u','i','d',' ','(','u','+','s',')',0, 'S','E','T','G','I','D',' ','3','0',';','4','3',' ','#',' ','f','i','l','e',' ','t','h','a','t',' ','i','s',' ','s','e','t','g','i','d',' ','(','g','+','s',')',0, + 'C','A','P','A','B','I','L','I','T','Y',' ','3','0',';','4','1',' ','#',' ','f','i','l','e',' ','w','i','t','h',' ','c','a','p','a','b','i','l','i','t','y',0, 'S','T','I','C','K','Y','_','O','T','H','E','R','_','W','R','I','T','A','B','L','E',' ','3','0',';','4','2',' ','#',' ','d','i','r',' ','t','h','a','t',' ','i','s',' ','s','t','i','c','k','y',' ','a','n','d',' ','o','t','h','e','r','-','w','r','i','t','a','b','l','e',' ','(','+','t',',','o','+','w',')',0, 'O','T','H','E','R','_','W','R','I','T','A','B','L','E',' ','3','4',';','4','2',' ','#',' ','d','i','r',' ','t','h','a','t',' ','i','s',' ','o','t','h','e','r','-','w','r','i','t','a','b','l','e',' ','(','o','+','w',')',' ','a','n','d',' ','n','o','t',' ','s','t','i','c','k','y',0, 'S','T','I','C','K','Y',' ','3','7',';','4','4',' ','#',' ','d','i','r',' ','w','i','t','h',' ','t','h','e',' ','s','t','i','c','k','y',' ','b','i','t',' ','s','e','t',' ','(','+','t',')',' ','a','n','d',' ','n','o','t',' ','o','t','h','e','r','-','w','r','i','t','a','b','l','e',0, @@ -92,9 +101,11 @@ static char const G_line[] = '.','a','r','j',' ','0','1',';','3','1',0, '.','t','a','z',' ','0','1',';','3','1',0, '.','l','z','h',' ','0','1',';','3','1',0, + '.','l','z','m','a',' ','0','1',';','3','1',0, '.','z','i','p',' ','0','1',';','3','1',0, '.','z',' ','0','1',';','3','1',0, '.','Z',' ','0','1',';','3','1',0, + '.','d','z',' ','0','1',';','3','1',0, '.','g','z',' ','0','1',';','3','1',0, '.','b','z','2',' ','0','1',';','3','1',0, '.','b','z',' ','0','1',';','3','1',0, @@ -123,6 +134,8 @@ static char const G_line[] = '.','t','i','f',' ','0','1',';','3','5',0, '.','t','i','f','f',' ','0','1',';','3','5',0, '.','p','n','g',' ','0','1',';','3','5',0, + '.','s','v','g',' ','0','1',';','3','5',0, + '.','s','v','g','z',' ','0','1',';','3','5',0, '.','m','n','g',' ','0','1',';','3','5',0, '.','p','c','x',' ','0','1',';','3','5',0, '.','m','o','v',' ','0','1',';','3','5',0, @@ -144,11 +157,17 @@ static char const G_line[] = '.','f','l','c',' ','0','1',';','3','5',0, '.','a','v','i',' ','0','1',';','3','5',0, '.','f','l','i',' ','0','1',';','3','5',0, + '.','f','l','v',' ','0','1',';','3','5',0, '.','g','l',' ','0','1',';','3','5',0, '.','d','l',' ','0','1',';','3','5',0, '.','x','c','f',' ','0','1',';','3','5',0, '.','x','w','d',' ','0','1',';','3','5',0, '.','y','u','v',' ','0','1',';','3','5',0, + '#',' ','h','t','t','p',':','/','/','w','i','k','i','.','x','i','p','h','.','o','r','g','/','i','n','d','e','x','.','p','h','p','/','M','I','M','E','_','T','y','p','e','s','_','a','n','d','_','F','i','l','e','_','E','x','t','e','n','s','i','o','n','s',0, + '.','a','x','v',' ','0','1',';','3','5',0, + '.','a','n','x',' ','0','1',';','3','5',0, + '.','o','g','v',' ','0','1',';','3','5',0, + '.','o','g','x',' ','0','1',';','3','5',0, '#',' ','a','u','d','i','o',' ','f','o','r','m','a','t','s',0, '.','a','a','c',' ','0','0',';','3','6',0, '.','a','u',' ','0','0',';','3','6',0, @@ -161,4 +180,9 @@ static char const G_line[] = '.','o','g','g',' ','0','0',';','3','6',0, '.','r','a',' ','0','0',';','3','6',0, '.','w','a','v',' ','0','0',';','3','6',0, + '#',' ','h','t','t','p',':','/','/','w','i','k','i','.','x','i','p','h','.','o','r','g','/','i','n','d','e','x','.','p','h','p','/','M','I','M','E','_','T','y','p','e','s','_','a','n','d','_','F','i','l','e','_','E','x','t','e','n','s','i','o','n','s',0, + '.','a','x','a',' ','0','0',';','3','6',0, + '.','o','g','a',' ','0','0',';','3','6',0, + '.','s','p','x',' ','0','0',';','3','6',0, + '.','x','s','p','f',' ','0','0',';','3','6',0, }; diff --git a/src/bin/coreutils/src/dircolors.hin b/src/bin/coreutils/src/dircolors.hin index 8d550d1946..63af8cb1f7 100644 --- a/src/bin/coreutils/src/dircolors.hin +++ b/src/bin/coreutils/src/dircolors.hin @@ -1,7 +1,7 @@ # Configuration file for dircolors, a utility to help you set the # LS_COLORS environment variable used by GNU ls with the --color option. -# Copyright (C) 1996, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 +# Copyright (C) 1996, 1999-2008 # Free Software Foundation, Inc. # Copying and distribution of this file, with or without modification, # are permitted provided the copyright notice and this notice are preserved. @@ -27,7 +27,10 @@ TERM cons25 TERM console TERM cygwin TERM dtterm +TERM eterm-color TERM gnome +TERM gnome-256color +TERM jfbterm TERM konsole TERM kterm TERM linux @@ -40,12 +43,15 @@ TERM rxvt-cygwin TERM rxvt-cygwin-native TERM rxvt-unicode TERM screen +TERM screen-256color TERM screen-bce TERM screen-w TERM screen.linux TERM vt100 TERM xterm +TERM xterm-16color TERM xterm-256color +TERM xterm-88color TERM xterm-color TERM xterm-debian @@ -57,11 +63,13 @@ TERM xterm-debian # 30=black 31=red 32=green 33=yellow 34=blue 35=magenta 36=cyan 37=white # Background color codes: # 40=black 41=red 42=green 43=yellow 44=blue 45=magenta 46=cyan 47=white -NORMAL 00 # global default, although everything should be something. -FILE 00 # normal file +#NORMAL 00 # no color code at all +#FILE 00 # regular file: use no color at all +RESET 0 # reset to "normal" color DIR 01;34 # directory LINK 01;36 # symbolic link. (If you set this to 'target' instead of a # numerical value, the color is as for the file pointed to.) +HARDLINK 44;37 # regular file with more than one link FIFO 40;33 # pipe SOCK 01;35 # socket DOOR 01;35 # door @@ -70,6 +78,7 @@ CHR 40;33;01 # character device driver ORPHAN 40;31;01 # symlink to nonexistent file, or non-stat'able file SETUID 37;41 # file that is setuid (u+s) SETGID 30;43 # file that is setgid (g+s) +CAPABILITY 30;41 # file with capability STICKY_OTHER_WRITABLE 30;42 # dir that is sticky and other-writable (+t,o+w) OTHER_WRITABLE 34;42 # dir that is other-writable (o+w) and not sticky STICKY 37;44 # dir with the sticky bit set (+t) and not other-writable @@ -98,9 +107,11 @@ EXEC 01;32 .arj 01;31 .taz 01;31 .lzh 01;31 +.lzma 01;31 .zip 01;31 .z 01;31 .Z 01;31 +.dz 01;31 .gz 01;31 .bz2 01;31 .bz 01;31 @@ -130,6 +141,8 @@ EXEC 01;32 .tif 01;35 .tiff 01;35 .png 01;35 +.svg 01;35 +.svgz 01;35 .mng 01;35 .pcx 01;35 .mov 01;35 @@ -151,12 +164,19 @@ EXEC 01;32 .flc 01;35 .avi 01;35 .fli 01;35 +.flv 01;35 .gl 01;35 .dl 01;35 .xcf 01;35 .xwd 01;35 .yuv 01;35 +# http://wiki.xiph.org/index.php/MIME_Types_and_File_Extensions +.axv 01;35 +.anx 01;35 +.ogv 01;35 +.ogx 01;35 + # audio formats .aac 00;36 .au 00;36 @@ -169,3 +189,9 @@ EXEC 01;32 .ogg 00;36 .ra 00;36 .wav 00;36 + +# http://wiki.xiph.org/index.php/MIME_Types_and_File_Extensions +.axa 00;36 +.oga 00;36 +.spx 00;36 +.xspf 00;36 diff --git a/src/bin/coreutils/src/dirname.c b/src/bin/coreutils/src/dirname.c index 2253391cea..10926435ff 100644 --- a/src/bin/coreutils/src/dirname.c +++ b/src/bin/coreutils/src/dirname.c @@ -1,12 +1,12 @@ /* dirname -- strip suffix from file name - Copyright (C) 1990-1997, 1999-2002, 2004, 2005, 2006 Free Software + Copyright (C) 1990-1997, 1999-2002, 2004-2008 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by David MacKenzie and Jim Meyering. */ @@ -32,10 +31,9 @@ /* The official name of this program (e.g., no `g' prefix). */ #define PROGRAM_NAME "dirname" -#define AUTHORS "David MacKenzie", "Jim Meyering" - -/* The name this program was run with. */ -char *program_name; +#define AUTHORS \ + proper_name ("David MacKenzie"), \ + proper_name ("Jim Meyering") void usage (int status) @@ -64,7 +62,7 @@ Examples:\n\ %s stdio.h Output \".\".\n\ "), program_name, program_name); - printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT); + emit_bug_reporting_address (); } exit (status); } @@ -77,14 +75,14 @@ main (int argc, char **argv) size_t len; initialize_main (&argc, &argv); - program_name = argv[0]; + set_program_name (argv[0]); setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); atexit (close_stdout); - parse_long_options (argc, argv, PROGRAM_NAME, GNU_PACKAGE, VERSION, + parse_long_options (argc, argv, PROGRAM_NAME, PACKAGE_NAME, Version, usage, AUTHORS, (char const *) NULL); if (getopt_long (argc, argv, "+", NULL, NULL) != -1) usage (EXIT_FAILURE); diff --git a/src/bin/coreutils/src/du.c b/src/bin/coreutils/src/du.c index 206d31842b..fd580311a6 100644 --- a/src/bin/coreutils/src/du.c +++ b/src/bin/coreutils/src/du.c @@ -1,10 +1,10 @@ /* du -- summarize disk usage - Copyright (C) 1988-1991, 1995-2007 Free Software Foundation, Inc. + Copyright (C) 1988-1991, 1995-2009 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Differences from the Unix du: * Doesn't simply ignore the names of regular files given as arguments @@ -31,15 +30,14 @@ #include #include "system.h" #include "argmatch.h" +#include "argv-iter.h" #include "error.h" #include "exclude.h" #include "fprintftime.h" #include "hash.h" #include "human.h" -#include "inttostr.h" #include "quote.h" #include "quotearg.h" -#include "readtokens0.h" #include "same.h" #include "stat-time.h" #include "xfts.h" @@ -51,7 +49,10 @@ extern bool fts_debug; #define PROGRAM_NAME "du" #define AUTHORS \ - "Torbjorn Granlund", "David MacKenzie, Paul Eggert", "Jim Meyering" + proper_name_utf8 ("Torbjorn Granlund", "Torbj\303\266rn Granlund"), \ + proper_name ("David MacKenzie"), \ + proper_name ("Paul Eggert"), \ + proper_name ("Jim Meyering") #if DU_DEBUG # define FTS_CROSS_CHECK(Fts) fts_cross_check (Fts) @@ -124,9 +125,6 @@ struct dulevel struct duinfo subdir; }; -/* Name under which this program was invoked. */ -char *program_name; - /* If true, display counts for all files, not just directories. */ static bool opt_all = false; @@ -195,15 +193,8 @@ enum EXCLUDE_OPTION, FILES0_FROM_OPTION, HUMAN_SI_OPTION, - - /* FIXME: --kilobytes is deprecated (but not -k); remove in late 2006 */ - KILOBYTES_LONG_OPTION, - MAX_DEPTH_OPTION, - - /* FIXME: --megabytes is deprecated (but not -m); remove in late 2006 */ MEGABYTES_LONG_OPTION, - TIME_OPTION, TIME_STYLE_OPTION }; @@ -222,10 +213,8 @@ static struct option const long_options[] = {"files0-from", required_argument, NULL, FILES0_FROM_OPTION}, {"human-readable", no_argument, NULL, 'h'}, {"si", no_argument, NULL, HUMAN_SI_OPTION}, - {"kilobytes", no_argument, NULL, KILOBYTES_LONG_OPTION}, {"max-depth", required_argument, NULL, MAX_DEPTH_OPTION}, {"null", no_argument, NULL, '0'}, - {"megabytes", no_argument, NULL, MEGABYTES_LONG_OPTION}, {"no-dereference", no_argument, NULL, 'P'}, {"one-file-system", no_argument, NULL, 'x'}, {"separate-dirs", no_argument, NULL, 'S'}, @@ -298,13 +287,14 @@ Mandatory arguments to long options are mandatory for short options too.\n\ -B, --block-size=SIZE use SIZE-byte blocks\n\ -b, --bytes equivalent to `--apparent-size --block-size=1'\n\ -c, --total produce a grand total\n\ - -D, --dereference-args dereference FILEs that are symbolic links\n\ + -D, --dereference-args dereference only symlinks that are listed on the\n\ + command line\n\ "), stdout); fputs (_("\ --files0-from=F summarize disk usage of the NUL-terminated file\n\ - names specified in file F\n\ - -H like --si, but also evokes a warning; will soon\n\ - change to be equivalent to --dereference-args (-D)\n\ + names specified in file F;\n\ + If F is - then read names from standard input\n\ + -H equivalent to --dereference-args (-D)\n\ -h, --human-readable print sizes in human readable format (e.g., 1K 234M 2G)\n\ --si like -h, but use powers of 1000 not 1024\n\ "), stdout); @@ -321,9 +311,9 @@ Mandatory arguments to long options are mandatory for short options too.\n\ -s, --summarize display only a total for each argument\n\ "), stdout); fputs (_("\ - -x, --one-file-system skip directories on different file systems\n\ - -X FILE, --exclude-from=FILE Exclude files that match any pattern in FILE.\n\ - --exclude=PATTERN Exclude files that match PATTERN.\n\ + -x, --one-file-system skip directories on different file systems\n\ + -X, --exclude-from=FILE exclude files that match any pattern in FILE\n\ + --exclude=PATTERN exclude files that match PATTERN\n\ --max-depth=N print the total for a directory (or file, with --all)\n\ only if it is N or fewer levels below the command\n\ line argument; --max-depth=0 is the same as\n\ @@ -344,7 +334,7 @@ Mandatory arguments to long options are mandatory for short options too.\n\ SIZE may be (or may be an integer optionally followed by) one of following:\n\ kB 1000, K 1024, MB 1000*1000, M 1024*1024, and so on for G, T, P, E, Z, Y.\n\ "), stdout); - printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT); + emit_bug_reporting_address (); } exit (status); } @@ -422,10 +412,7 @@ show_date (const char *format, struct timespec when) if (! tm) { char buf[INT_BUFSIZE_BOUND (intmax_t)]; - error (0, 0, _("time %s is out of range"), - (TYPE_SIGNED (time_t) - ? imaxtostr (when.tv_sec, buf) - : umaxtostr (when.tv_sec, buf))); + error (0, 0, _("time %s is out of range"), timetostr (when.tv_sec, buf)); fputs (buf, stdout); return; } @@ -488,7 +475,7 @@ process_file (FTS *fts, FTSENT *ent) bool skip; /* If necessary, set FTS_SKIP before returning. */ - skip = excluded_file_name (exclude, ent->fts_path); + skip = excluded_file_name (exclude, file); if (skip) fts_set (fts, ent, FTS_SKIP); @@ -605,14 +592,9 @@ process_file (FTS *fts, FTSENT *ent) duinfo_add (&dulvl[level].ent, &dui); /* Even if this directory is unreadable or we can't chdir into it, - do let its size contribute to the total, ... */ + do let its size contribute to the total. */ duinfo_add (&tot_dui, &dui); - /* ... but don't print out a total for it, since without the size(s) - of any potential entries, it could be very misleading. */ - if (ent->fts_info == FTS_DNR) - return ok; - /* If we're not counting an entry, e.g., because it's a hard link to a file we've already counted (and --count-links), then don't print a line for it. */ @@ -666,25 +648,19 @@ du_files (char **files, int bit_flags) fts_close (fts); } - if (print_grand_total) - print_size (&tot_dui, _("total")); - return ok; } int main (int argc, char **argv) { - int c; char *cwd_only[2]; bool max_depth_specified = false; - char **files; bool ok = true; char *files_from = NULL; - struct Tokens tok; /* Bit flags that control how fts works. */ - int bit_flags = FTS_TIGHT_CYCLE_CHECK; + int bit_flags = FTS_TIGHT_CYCLE_CHECK | FTS_DEFER_STAT; /* Select one of the three FTS_ options that control if/when to follow a symlink. */ @@ -693,11 +669,13 @@ main (int argc, char **argv) /* If true, display only a total for each argument. */ bool opt_summarize_only = false; - cwd_only[0] = "."; + struct argv_iterator *ai; + + cwd_only[0] = bad_cast ("."); cwd_only[1] = NULL; initialize_main (&argc, &argv); - program_name = argv[0]; + set_program_name (argv[0]); setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); @@ -706,12 +684,17 @@ main (int argc, char **argv) exclude = new_exclude (); - human_output_opts = human_options (getenv ("DU_BLOCK_SIZE"), false, - &output_block_size); + human_options (getenv ("DU_BLOCK_SIZE"), + &human_output_opts, &output_block_size); - while ((c = getopt_long (argc, argv, DEBUG_OPT "0abchHklmsxB:DLPSX:", - long_options, NULL)) != -1) + for (;;) { + int oi = -1; + int c = getopt_long (argc, argv, DEBUG_OPT "0abchHklmsxB:DLPSX:", + long_options, &oi); + if (c == -1) + break; + switch (c) { #if DU_DEBUG @@ -747,20 +730,11 @@ main (int argc, char **argv) output_block_size = 1; break; - case 'H': /* FIXME: remove warning and move this "case 'H'" to - precede --dereference-args in late 2006. */ - error (0, 0, _("WARNING: use --si, not -H; the meaning of the -H\ - option will soon\nchange to be the same as that of --dereference-args (-D)")); - /* fall through */ case HUMAN_SI_OPTION: human_output_opts = human_autoscale | human_SI; output_block_size = 1; break; - case KILOBYTES_LONG_OPTION: - error (0, 0, - _("the --kilobytes option is deprecated; use -k instead")); - /* fall through */ case 'k': human_output_opts = 0; output_block_size = 1024; @@ -784,7 +758,7 @@ main (int argc, char **argv) } break; - case MEGABYTES_LONG_OPTION: + case MEGABYTES_LONG_OPTION: /* FIXME: remove in 2009 */ error (0, 0, _("the --megabytes option is deprecated; use -m instead")); /* fall through */ @@ -806,10 +780,16 @@ main (int argc, char **argv) break; case 'B': - human_output_opts = human_options (optarg, true, &output_block_size); + { + enum strtol_error e = human_options (optarg, &human_output_opts, + &output_block_size); + if (e != LONGINT_OK) + xstrtol_fatal (e, oi, c, long_options, optarg); + } break; - case 'D': /* This will eventually be 'H' (-H), too. */ + case 'H': /* NOTE: before 2008-12, -H was equivalent to --si. */ + case 'D': symlink_deref_bits = FTS_COMFOLLOW | FTS_PHYSICAL; break; @@ -946,7 +926,7 @@ main (int argc, char **argv) { error (0, 0, _("extra operand %s"), quote (argv[optind])); fprintf (stderr, "%s\n", - _("File operands cannot be combined with --files0-from.")); + _("file operands cannot be combined with --files0-from")); usage (EXIT_FAILURE); } @@ -954,66 +934,96 @@ main (int argc, char **argv) error (EXIT_FAILURE, errno, _("cannot open %s for reading"), quote (files_from)); - readtokens0_init (&tok); - - if (! readtokens0 (stdin, &tok) || fclose (stdin) != 0) - error (EXIT_FAILURE, 0, _("cannot read file names from %s"), - quote (files_from)); - - files = tok.tok; + ai = argv_iter_init_stream (stdin); } else { - files = (optind < argc ? argv + optind : cwd_only); + char **files = (optind < argc ? argv + optind : cwd_only); + ai = argv_iter_init_argv (files); } + if (!ai) + xalloc_die (); + /* Initialize the hash structure for inode numbers. */ hash_init (); - /* Report and filter out any empty file names before invoking fts. - This works around a glitch in fts, which fails immediately - (without looking at the other file names) when given an empty - file name. */ - { - size_t i = 0; - size_t j; - - for (j = 0; ; j++) - { - if (i != j) - files[i] = files[j]; - - if ( ! files[i]) - break; - - if (files[i][0]) - i++; - else - { - if (files_from) - { - /* Using the standard `filename:line-number:' prefix here is - not totally appropriate, since NUL is the separator, not NL, - but it might be better than nothing. */ - unsigned long int file_number = j + 1; - error (0, 0, "%s:%lu: %s", quotearg_colon (files_from), - file_number, _("invalid zero-length file name")); - } - else - error (0, 0, "%s", _("invalid zero-length file name")); - } - } - - ok = (i == j); - } - bit_flags |= symlink_deref_bits; - ok &= du_files (files, bit_flags); - /* This isn't really necessary, but it does ensure we - exercise this function. */ - if (files_from) - readtokens0_free (&tok); + while (true) + { + static char *temp_argv[] = { NULL, NULL }; + bool skip_file = false; + enum argv_iter_err ai_err; + char *file_name = argv_iter (ai, &ai_err); + if (ai_err == AI_ERR_EOF) + break; + if (!file_name) + { + switch (ai_err) + { + case AI_ERR_READ: + error (0, errno, _("%s: read error"), quote (files_from)); + skip_file = true; + continue; + + case AI_ERR_MEM: + xalloc_die (); + + default: + assert (!"unexpected error code from argv_iter"); + } + } + if (files_from && STREQ (files_from, "-") && STREQ (file_name, "-")) + { + /* Give a better diagnostic in an unusual case: + printf - | du --files0-from=- */ + error (0, 0, _("when reading file names from stdin, " + "no file name of %s allowed"), + quote (file_name)); + skip_file = true; + } + + /* Report and skip any empty file names before invoking fts. + This works around a glitch in fts, which fails immediately + (without looking at the other file names) when given an empty + file name. */ + if (!file_name[0]) + { + /* Diagnose a zero-length file name. When it's one + among many, knowing the record number may help. + FIXME: currently print the record number only with + --files0-from=FILE. Maybe do it for argv, too? */ + if (files_from == NULL) + error (0, 0, "%s", _("invalid zero-length file name")); + else + { + /* Using the standard `filename:line-number:' prefix here is + not totally appropriate, since NUL is the separator, not NL, + but it might be better than nothing. */ + unsigned long int file_number = argv_iter_n_args (ai); + error (0, 0, "%s:%lu: %s", quotearg_colon (files_from), + file_number, _("invalid zero-length file name")); + } + skip_file = true; + } + + if (skip_file) + ok = false; + else + { + temp_argv[0] = file_name; + ok &= du_files (temp_argv, bit_flags); + } + } + + argv_iter_free (ai); + + if (files_from && (ferror (stdin) || fclose (stdin) != 0)) + error (EXIT_FAILURE, 0, _("error reading %s"), quote (files_from)); + + if (print_grand_total) + print_size (&tot_dui, _("total")); hash_free (htab); diff --git a/src/bin/coreutils/src/echo.c b/src/bin/coreutils/src/echo.c index 5f8582cc0f..7b069e0e52 100644 --- a/src/bin/coreutils/src/echo.c +++ b/src/bin/coreutils/src/echo.c @@ -1,10 +1,11 @@ /* echo.c, derived from code echo.c in Bash. - Copyright (C) 87,89, 1991-1997, 1999-2005 Free Software Foundation, Inc. + Copyright (C) 87,89, 1991-1997, 1999-2005, 2007-2009 Free Software + Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,47 +13,25 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ #include #include #include #include "system.h" -#include "long-options.h" /* The official name of this program (e.g., no `g' prefix). */ #define PROGRAM_NAME "echo" -#define AUTHORS "FIXME unknown" - -/* echo [-neE] [arg ...] -Output the ARGs. If -n is specified, the trailing newline is -suppressed. If the -e option is given, interpretation of the -following backslash-escaped characters is turned on: - \a alert (bell) - \b backspace - \c suppress trailing newline - \f form feed - \n new line - \r carriage return - \t horizontal tab - \v vertical tab - \\ backslash - \0NNN the character whose ASCII code is NNN (octal). - -You can explicitly turn off the interpretation of the above characters -on System V systems with the -E option. -*/ +#define AUTHORS \ + proper_name ("Brian Fox"), \ + proper_name ("Chet Ramey") /* If true, interpret backslash escapes by default. */ #ifndef DEFAULT_ECHO_TO_XPG enum { DEFAULT_ECHO_TO_XPG = false }; #endif -/* The name this program was run with. */ -char *program_name; - void usage (int status) { @@ -61,19 +40,22 @@ usage (int status) program_name); else { - printf (_("Usage: %s [OPTION]... [STRING]...\n"), program_name); + printf (_("\ +Usage: %s [SHORT-OPTION]... [STRING]...\n\ + or: %s LONG-OPTION\n\ +"), program_name, program_name); fputs (_("\ Echo the STRING(s) to standard output.\n\ \n\ -n do not output the trailing newline\n\ "), stdout); fputs (_(DEFAULT_ECHO_TO_XPG - ? "\ + ? N_("\ -e enable interpretation of backslash escapes (default)\n\ - -E disable interpretation of backslash escapes\n" - : "\ + -E disable interpretation of backslash escapes\n") + : N_("\ -e enable interpretation of backslash escapes\n\ - -E disable interpretation of backslash escapes (default)\n"), + -E disable interpretation of backslash escapes (default)\n")), stdout); fputs (HELP_OPTION_DESCRIPTION, stdout); fputs (VERSION_OPTION_DESCRIPTION, stdout); @@ -87,7 +69,7 @@ If -e is in effect, the following sequences are recognized:\n\ \\b backspace\n\ "), stdout); fputs (_("\ - \\c suppress trailing newline\n\ + \\c produce no further output\n\ \\f form feed\n\ \\n new line\n\ \\r carriage return\n\ @@ -95,7 +77,7 @@ If -e is in effect, the following sequences are recognized:\n\ \\v vertical tab\n\ "), stdout); printf (USAGE_BUILTIN_WARNING, PROGRAM_NAME); - printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT); + emit_bug_reporting_address (); } exit (status); } @@ -134,16 +116,27 @@ main (int argc, char **argv) bool do_v9 = DEFAULT_ECHO_TO_XPG; initialize_main (&argc, &argv); - program_name = argv[0]; + set_program_name (argv[0]); setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); atexit (close_stdout); - if (allow_options) - parse_long_options (argc, argv, PROGRAM_NAME, GNU_PACKAGE, VERSION, - usage, AUTHORS, (char const *) NULL); + /* We directly parse options, rather than use parse_long_options, in + order to avoid accepting abbreviations. */ + if (allow_options && argc == 2) + { + if (STREQ (argv[1], "--help")) + usage (EXIT_SUCCESS); + + if (STREQ (argv[1], "--version")) + { + version_etc (stdout, PROGRAM_NAME, PACKAGE_NAME, Version, AUTHORS, + (char *) NULL); + exit (EXIT_SUCCESS); + } + } --argc; ++argv; diff --git a/src/bin/coreutils/src/env.c b/src/bin/coreutils/src/env.c index d95ebfd7e7..fb9d7932d4 100644 --- a/src/bin/coreutils/src/env.c +++ b/src/bin/coreutils/src/env.c @@ -1,10 +1,10 @@ /* env - run a program in a modified environment - Copyright (C) 1986, 1991-2005, 2007 Free Software Foundation, Inc. + Copyright (C) 1986, 1991-2005, 2007-2008 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Richard Mlynarik and David MacKenzie */ @@ -79,7 +78,6 @@ #include #include -#include #include #include @@ -89,15 +87,12 @@ /* The official name of this program (e.g., no `g' prefix). */ #define PROGRAM_NAME "env" -#define AUTHORS "Richard Mlynarik", "David MacKenzie" - -int putenv (); +#define AUTHORS \ + proper_name ("Richard Mlynarik"), \ + proper_name ("David MacKenzie") extern char **environ; -/* The name by which this program was run. */ -char *program_name; - static struct option const longopts[] = { {"ignore-environment", no_argument, NULL, 'i'}, @@ -130,7 +125,7 @@ Set each NAME to VALUE in the environment and run COMMAND.\n\ \n\ A mere - implies -i. If no COMMAND, print the resulting environment.\n\ "), stdout); - printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT); + emit_bug_reporting_address (); } exit (status); } @@ -142,12 +137,12 @@ main (int argc, char **argv) bool ignore_environment = false; initialize_main (&argc, &argv); - program_name = argv[0]; + set_program_name (argv[0]); setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); - initialize_exit_failure (EXIT_FAIL); + initialize_exit_failure (EXIT_FAILURE); atexit (close_stdout); while ((optc = getopt_long (argc, argv, "+iu:", longopts, NULL)) != -1) @@ -162,7 +157,7 @@ main (int argc, char **argv) case_GETOPT_HELP_CHAR; case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS); default: - usage (EXIT_FAIL); + usage (EXIT_FAILURE); } } diff --git a/src/bin/coreutils/src/expand.c b/src/bin/coreutils/src/expand.c index 5645203763..10f36430d0 100644 --- a/src/bin/coreutils/src/expand.c +++ b/src/bin/coreutils/src/expand.c @@ -1,10 +1,10 @@ /* expand - convert tabs to spaces - Copyright (C) 89, 91, 1995-2006 Free Software Foundation, Inc. + Copyright (C) 89, 91, 1995-2006, 2008-2009 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* By default, convert all tabs to spaces. Preserves backspace characters in the output; they decrement the @@ -46,14 +45,7 @@ /* The official name of this program (e.g., no `g' prefix). */ #define PROGRAM_NAME "expand" -#define AUTHORS "David MacKenzie" - -/* The number of bytes added at a time to the amount of memory - allocated for the output line. */ -#define OUTPUT_BLOCK 256 - -/* The name this program was run with. */ -char *program_name; +#define AUTHORS proper_name ("David MacKenzie") /* If true, convert blanks even after nonblank characters have been read on the line. */ @@ -80,7 +72,7 @@ static char **file_list; /* Default for `file_list' if no files are given on the command line. */ static char *stdin_argv[] = { - "-", NULL + (char *) "-", NULL }; /* True if we have ever read standard input. */ @@ -129,7 +121,7 @@ Mandatory arguments to long options are mandatory for short options too.\n\ "), stdout); fputs (HELP_OPTION_DESCRIPTION, stdout); fputs (VERSION_OPTION_DESCRIPTION, stdout); - printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT); + emit_bug_reporting_address (); } exit (status); } @@ -371,7 +363,7 @@ main (int argc, char **argv) int c; initialize_main (&argc, &argv); - program_name = argv[0]; + set_program_name (argv[0]); setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); diff --git a/src/bin/coreutils/src/expr.c b/src/bin/coreutils/src/expr.c index 352c80cc68..65e74af9f4 100644 --- a/src/bin/coreutils/src/expr.c +++ b/src/bin/coreutils/src/expr.c @@ -1,10 +1,10 @@ /* expr -- evaluate expressions. - Copyright (C) 86, 1991-1997, 1999-2006 Free Software Foundation, Inc. + Copyright (C) 86, 1991-1997, 1999-2008 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,10 +12,10 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Author: Mike Parker. + Modified for arbitrary-precision calculation by James Youngman. This program evaluates expressions. Each token (operator, operand, parenthesis) of the expression must be a seperate argument. The @@ -34,18 +34,121 @@ #include "system.h" #include -#include "long-options.h" #include "error.h" -#include "inttostr.h" -#include "quote.h" +#include "long-options.h" #include "quotearg.h" #include "strnumcmp.h" #include "xstrtol.h" +/* Various parts of this code assume size_t fits into unsigned long + int, the widest unsigned type that GMP supports. */ +verify (SIZE_MAX <= ULONG_MAX); + +static void integer_overflow (char) ATTRIBUTE_NORETURN; + +#ifndef HAVE_GMP +# define HAVE_GMP 0 +#endif + +#if HAVE_GMP +# include +#else +/* Approximate gmp.h well enough for expr.c's purposes. */ +typedef intmax_t mpz_t[1]; +static void mpz_clear (mpz_t z) {} +static void mpz_init_set_ui (mpz_t z, unsigned long int i) { z[0] = i; } +static int +mpz_init_set_str (mpz_t z, char *s, int base) +{ + return xstrtoimax (s, NULL, base, z, NULL) == LONGINT_OK ? 0 : -1; +} +static void +mpz_add (mpz_t r, mpz_t a0, mpz_t b0) +{ + intmax_t a = a0[0]; + intmax_t b = b0[0]; + intmax_t val = a + b; + if ((val < a) != (b < 0)) + integer_overflow ('+'); + r[0] = val; +} +static void +mpz_sub (mpz_t r, mpz_t a0, mpz_t b0) +{ + intmax_t a = a0[0]; + intmax_t b = b0[0]; + intmax_t val = a - b; + if ((a < val) != (b < 0)) + integer_overflow ('-'); + r[0] = val; +} +static void +mpz_mul (mpz_t r, mpz_t a0, mpz_t b0) +{ + intmax_t a = a0[0]; + intmax_t b = b0[0]; + intmax_t val = a * b; + if (! (a == 0 || b == 0 + || ((val < 0) == ((a < 0) ^ (b < 0)) && val / a == b))) + integer_overflow ('*'); + r[0] = val; +} +static void +mpz_tdiv_q (mpz_t r, mpz_t a0, mpz_t b0) +{ + intmax_t a = a0[0]; + intmax_t b = b0[0]; + + /* Some x86-style hosts raise an exception for INT_MIN / -1. */ + if (a < - INTMAX_MAX && b == -1) + integer_overflow ('/'); + r[0] = a / b; +} +static void +mpz_tdiv_r (mpz_t r, mpz_t a0, mpz_t b0) +{ + intmax_t a = a0[0]; + intmax_t b = b0[0]; + + /* Some x86-style hosts raise an exception for INT_MIN % -1. */ + r[0] = a < - INTMAX_MAX && b == -1 ? 0 : a % b; +} +static char * +mpz_get_str (char const *str, int base, mpz_t z) +{ + char buf[INT_BUFSIZE_BOUND (intmax_t)]; + return xstrdup (imaxtostr (z[0], buf)); +} +static int +mpz_sgn (mpz_t z) +{ + return z[0] < 0 ? -1 : 0 < z[0]; +} +static int +mpz_fits_ulong_p (mpz_t z) +{ + return 0 <= z[0] && z[0] <= ULONG_MAX; +} +static unsigned long int +mpz_get_ui (mpz_t z) +{ + return z[0]; +} +static int +mpz_out_str (FILE *stream, int base, mpz_t z) +{ + char buf[INT_BUFSIZE_BOUND (intmax_t)]; + return fputs (imaxtostr (z[0], buf), stream) != EOF; +} +#endif + /* The official name of this program (e.g., no `g' prefix). */ #define PROGRAM_NAME "expr" -#define AUTHORS "Mike Parker" +#define AUTHORS \ + proper_name ("Mike Parker"), \ + proper_name ("James Youngman"), \ + proper_name ("Paul Eggert") /* Exit statuses. */ enum @@ -74,7 +177,7 @@ struct valinfo TYPE type; /* Which kind. */ union { /* The value itself. */ - intmax_t i; + mpz_t i; char *s; } u; }; @@ -83,9 +186,6 @@ typedef struct valinfo VALUE; /* The arguments given to the program, minus the program name. */ static char **args; -/* The name this program was run with. */ -char *program_name; - static VALUE *eval (bool); static bool nomoreargs (void); static bool null (VALUE *v); @@ -130,6 +230,8 @@ separates increasing precedence groups. EXPRESSION may be:\n\ ARG1 + ARG2 arithmetic sum of ARG1 and ARG2\n\ ARG1 - ARG2 arithmetic difference of ARG1 and ARG2\n\ "), stdout); + /* Tell xgettext that the "% A" below is not a printf-style + format string: xgettext:no-c-format */ fputs (_("\ \n\ ARG1 * ARG2 arithmetic product of ARG1 and ARG2\n\ @@ -163,7 +265,7 @@ Pattern matches return the string matched between \\( and \\) or null; if\n\ Exit status is 0 if EXPRESSION is neither null nor 0, 1 if EXPRESSION is null\n\ or 0, 2 if EXPRESSION is syntactically invalid, and 3 if an error occurred.\n\ "), stdout); - printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT); + emit_bug_reporting_address (); } exit (status); } @@ -180,6 +282,16 @@ static void integer_overflow (char op) { error (EXPR_FAILURE, ERANGE, "%c", op); + abort (); /* notreached */ +} + +static void die (int errno_val, char const *msg) + ATTRIBUTE_NORETURN; +static void +die (int errno_val, char const *msg) +{ + error (EXPR_FAILURE, errno_val, "%s", msg); + abort (); /* notreached */ } int @@ -188,7 +300,7 @@ main (int argc, char **argv) VALUE *v; initialize_main (&argc, &argv); - program_name = argv[0]; + set_program_name (argv[0]); setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); @@ -196,7 +308,7 @@ main (int argc, char **argv) initialize_exit_failure (EXPR_FAILURE); atexit (close_stdout); - parse_long_options (argc, argv, PROGRAM_NAME, GNU_PACKAGE, VERSION, + parse_long_options (argc, argv, PROGRAM_NAME, PACKAGE_NAME, VERSION, usage, AUTHORS, (char const *) NULL); /* The above handles --help and --version. Since there is no other invocation of getopt, handle `--' here. */ @@ -225,11 +337,11 @@ main (int argc, char **argv) /* Return a VALUE for I. */ static VALUE * -int_value (intmax_t i) +int_value (unsigned long int i) { VALUE *v = xmalloc (sizeof *v); v->type = integer; - v->u.i = i; + mpz_init_set_ui (v->u.i, i); return v; } @@ -251,6 +363,8 @@ freev (VALUE *v) { if (v->type == string) free (v->u.s); + else + mpz_clear (v->u.i); free (v); } @@ -259,22 +373,18 @@ freev (VALUE *v) static void printv (VALUE *v) { - char *p; - char buf[INT_BUFSIZE_BOUND (intmax_t)]; - switch (v->type) { case integer: - p = imaxtostr (v->u.i, buf); + mpz_out_str (stdout, 10, v->u.i); + putchar ('\n'); break; case string: - p = v->u.s; + puts (v->u.s); break; default: abort (); } - - puts (p); } /* Return true if V is a null-string or zero-number. */ @@ -285,7 +395,7 @@ null (VALUE *v) switch (v->type) { case integer: - return v->u.i == 0; + return mpz_sgn (v->u.i) == 0; case string: { char const *cp = v->u.s; @@ -328,13 +438,15 @@ looks_like_integer (char const *cp) static void tostring (VALUE *v) { - char buf[INT_BUFSIZE_BOUND (intmax_t)]; - switch (v->type) { case integer: - v->u.s = xstrdup (imaxtostr (v->u.i, buf)); - v->type = string; + { + char *s = mpz_get_str (NULL, 10, v->u.i); + mpz_clear (v->u.i); + v->u.s = s; + v->type = string; + } break; case string: break; @@ -354,14 +466,13 @@ toarith (VALUE *v) return true; case string: { - intmax_t value; + char *s = v->u.s; - if (! looks_like_integer (v->u.s)) + if (! looks_like_integer (s)) return false; - if (xstrtoimax (v->u.s, NULL, 10, &value, NULL) != LONGINT_OK) - error (EXPR_FAILURE, ERANGE, "%s", v->u.s); - free (v->u.s); - v->u.i = value; + if (mpz_init_set_str (v->u.i, s, 10) != 0 && !HAVE_GMP) + error (EXPR_FAILURE, ERANGE, "%s", s); + free (s); v->type = integer; return true; } @@ -370,6 +481,23 @@ toarith (VALUE *v) } } +/* Extract a size_t value from a integer value I. + If the value is negative, return SIZE_MAX. + If the value is too large, return SIZE_MAX - 1. */ +static size_t +getsize (mpz_t i) +{ + if (mpz_sgn (i) < 0) + return SIZE_MAX; + if (mpz_fits_ulong_p (i)) + { + unsigned long int ul = mpz_get_ui (i); + if (ul < SIZE_MAX) + return ul; + } + return SIZE_MAX - 1; +} + /* Return true and advance if the next token matches STR exactly. STR must not be NULL. */ @@ -548,13 +676,14 @@ eval6 (bool evaluate) } else if (nextarg ("index")) { + size_t pos; + l = eval6 (evaluate); r = eval6 (evaluate); tostring (l); tostring (r); - v = int_value (strcspn (l->u.s, r->u.s) + 1); - if (v->u.i == strlen (l->u.s) + 1) - v->u.i = 0; + pos = strcspn (l->u.s, r->u.s); + v = int_value (l->u.s[pos] ? pos + 1 : 0); freev (l); freev (r); return v; @@ -567,19 +696,26 @@ eval6 (bool evaluate) i2 = eval6 (evaluate); tostring (l); llen = strlen (l->u.s); - if (!toarith (i1) || !toarith (i2) - || llen < i1->u.i - || i1->u.i <= 0 || i2->u.i <= 0) + + if (!toarith (i1) || !toarith (i2)) v = str_value (""); else { - size_t vlen = MIN (i2->u.i, llen - i1->u.i + 1); - char *vlim; - v = xmalloc (sizeof *v); - v->type = string; - v->u.s = xmalloc (vlen + 1); - vlim = mempcpy (v->u.s, l->u.s + i1->u.i - 1, vlen); - *vlim = '\0'; + size_t pos = getsize (i1->u.i); + size_t len = getsize (i2->u.i); + + if (llen < pos || pos == 0 || len == 0 || len == SIZE_MAX) + v = str_value (""); + else + { + size_t vlen = MIN (len, llen - pos + 1); + char *vlim; + v = xmalloc (sizeof *v); + v->type = string; + v->u.s = xmalloc (vlen + 1); + vlim = mempcpy (v->u.s, l->u.s + pos - 1, vlen); + *vlim = '\0'; + } } freev (l); freev (i1); @@ -630,7 +766,6 @@ eval4 (bool evaluate) VALUE *l; VALUE *r; enum { multiply, divide, mod } fxn; - intmax_t val = 0; #ifdef EVAL_TRACE trace ("eval4"); @@ -651,34 +786,14 @@ eval4 (bool evaluate) { if (!toarith (l) || !toarith (r)) error (EXPR_INVALID, 0, _("non-numeric argument")); - if (fxn == multiply) - { - val = l->u.i * r->u.i; - if (! (l->u.i == 0 || r->u.i == 0 - || ((val < 0) == ((l->u.i < 0) ^ (r->u.i < 0)) - && val / l->u.i == r->u.i))) - integer_overflow ('*'); - } - else - { - if (r->u.i == 0) - error (EXPR_INVALID, 0, _("division by zero")); - if (l->u.i < - INTMAX_MAX && r->u.i == -1) - { - /* Some x86-style hosts raise an exception for - INT_MIN / -1 and INT_MIN % -1, so handle these - problematic cases specially. */ - if (fxn == divide) - integer_overflow ('/'); - val = 0; - } - else - val = fxn == divide ? l->u.i / r->u.i : l->u.i % r->u.i; - } + if (fxn != multiply && mpz_sgn (r->u.i) == 0) + error (EXPR_INVALID, 0, _("division by zero")); + ((fxn == multiply ? mpz_mul + : fxn == divide ? mpz_tdiv_q + : mpz_tdiv_r) + (l->u.i, l->u.i, r->u.i)); } - freev (l); freev (r); - l = int_value (val); } } @@ -690,7 +805,6 @@ eval3 (bool evaluate) VALUE *l; VALUE *r; enum { plus, minus } fxn; - intmax_t val = 0; #ifdef EVAL_TRACE trace ("eval3"); @@ -709,22 +823,9 @@ eval3 (bool evaluate) { if (!toarith (l) || !toarith (r)) error (EXPR_INVALID, 0, _("non-numeric argument")); - if (fxn == plus) - { - val = l->u.i + r->u.i; - if ((val < l->u.i) != (r->u.i < 0)) - integer_overflow ('+'); - } - else - { - val = l->u.i - r->u.i; - if ((l->u.i < val) != (r->u.i < 0)) - integer_overflow ('-'); - } + (fxn == plus ? mpz_add : mpz_sub) (l->u.i, l->u.i, r->u.i); } - freev (l); freev (r); - l = int_value (val); } } @@ -780,9 +881,9 @@ eval2 (bool evaluate) if (errno) { error (0, errno, _("string comparison failed")); - error (0, 0, _("Set LC_ALL='C' to work around the problem.")); + error (0, 0, _("set LC_ALL='C' to work around the problem")); error (EXPR_INVALID, 0, - _("The strings compared were %s and %s."), + _("the strings compared were %s and %s"), quotearg_n_style (0, locale_quoting_style, l->u.s), quotearg_n_style (1, locale_quoting_style, r->u.s)); } diff --git a/src/bin/coreutils/src/extract-magic b/src/bin/coreutils/src/extract-magic index 2e9e871d3a..6a0ac7f2e2 100644 --- a/src/bin/coreutils/src/extract-magic +++ b/src/bin/coreutils/src/extract-magic @@ -3,10 +3,10 @@ # Copyright (C) 2003, 2005 Free Software Foundation, Inc. -# This program is free software; you can redistribute it and/or modify +# This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ # GNU General Public License for more details. # You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# along with this program. If not, see . use strict; diff --git a/src/bin/coreutils/src/factor.c b/src/bin/coreutils/src/factor.c index dc8f1cc876..47273a2bc6 100644 --- a/src/bin/coreutils/src/factor.c +++ b/src/bin/coreutils/src/factor.c @@ -1,10 +1,10 @@ /* factor -- print prime factors of n. - Copyright (C) 86, 1995-2005 Free Software Foundation, Inc. + Copyright (C) 86, 1995-2005, 2007-2009 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,24 +12,27 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Paul Rubin . - Adapted for GNU, fixed to factor UINT_MAX by Jim Meyering. */ + Adapted for GNU, fixed to factor UINT_MAX by Jim Meyering. + Arbitrary-precision code adapted by James Youngman from Torbjörn + Granlund's factorize.c, from GNU MP version 4.2.2. +*/ #include #include +#include #include #include +#if HAVE_GMP +#include +#endif #include -#define NDEBUG 1 #include "system.h" #include "error.h" -#include "inttostr.h" -#include "long-options.h" #include "quote.h" #include "readtokens.h" #include "xstrtol.h" @@ -37,11 +40,232 @@ /* The official name of this program (e.g., no `g' prefix). */ #define PROGRAM_NAME "factor" -#define AUTHORS "Paul Rubin" +#define AUTHORS proper_name ("Paul Rubin") /* Token delimiters when reading from a file. */ #define DELIM "\n\t " +static bool verbose = false; + +#if HAVE_GMP +static mpz_t *factor = NULL; +static size_t nfactors_found = 0; +static size_t nfactors_allocated = 0; + +static void +debug (char const *fmt, ...) +{ + if (verbose) + { + va_list ap; + va_start (ap, fmt); + vfprintf (stderr, fmt, ap); + } +} + +static void +emit_factor (mpz_t n) +{ + if (nfactors_found == nfactors_allocated) + factor = x2nrealloc (factor, &nfactors_allocated, sizeof *factor); + mpz_init (factor[nfactors_found]); + mpz_set (factor[nfactors_found], n); + ++nfactors_found; +} + +static void +emit_ul_factor (unsigned long int i) +{ + mpz_t t; + mpz_init (t); + mpz_set_ui (t, i); + emit_factor (t); + mpz_clear (t); +} + +static void +factor_using_division (mpz_t t, unsigned int limit) +{ + mpz_t q, r; + unsigned long int f; + int ai; + static unsigned int const add[] = {4, 2, 4, 2, 4, 6, 2, 6}; + unsigned int const *addv = add; + unsigned int failures; + + debug ("[trial division (%u)] ", limit); + + mpz_init (q); + mpz_init (r); + + f = mpz_scan1 (t, 0); + mpz_div_2exp (t, t, f); + while (f) + { + emit_ul_factor (2); + --f; + } + + for (;;) + { + mpz_tdiv_qr_ui (q, r, t, 3); + if (mpz_cmp_ui (r, 0) != 0) + break; + mpz_set (t, q); + emit_ul_factor (3); + } + + for (;;) + { + mpz_tdiv_qr_ui (q, r, t, 5); + if (mpz_cmp_ui (r, 0) != 0) + break; + mpz_set (t, q); + emit_ul_factor (5); + } + + failures = 0; + f = 7; + ai = 0; + while (mpz_cmp_ui (t, 1) != 0) + { + mpz_tdiv_qr_ui (q, r, t, f); + if (mpz_cmp_ui (r, 0) != 0) + { + f += addv[ai]; + if (mpz_cmp_ui (q, f) < 0) + break; + ai = (ai + 1) & 7; + failures++; + if (failures > limit) + break; + } + else + { + mpz_swap (t, q); + emit_ul_factor (f); + failures = 0; + } + } + + mpz_clear (q); + mpz_clear (r); +} + +static void +factor_using_pollard_rho (mpz_t n, int a_int) +{ + mpz_t x, x1, y, P; + mpz_t a; + mpz_t g; + mpz_t t1, t2; + int k, l, c, i; + + debug ("[pollard-rho (%d)] ", a_int); + + mpz_init (g); + mpz_init (t1); + mpz_init (t2); + + mpz_init_set_si (a, a_int); + mpz_init_set_si (y, 2); + mpz_init_set_si (x, 2); + mpz_init_set_si (x1, 2); + k = 1; + l = 1; + mpz_init_set_ui (P, 1); + c = 0; + + while (mpz_cmp_ui (n, 1) != 0) + { +S2: + mpz_mul (x, x, x); mpz_add (x, x, a); mpz_mod (x, x, n); + + mpz_sub (t1, x1, x); mpz_mul (t2, P, t1); mpz_mod (P, t2, n); + c++; + if (c == 20) + { + c = 0; + mpz_gcd (g, P, n); + if (mpz_cmp_ui (g, 1) != 0) + goto S4; + mpz_set (y, x); + } + + k--; + if (k > 0) + goto S2; + + mpz_gcd (g, P, n); + if (mpz_cmp_ui (g, 1) != 0) + goto S4; + + mpz_set (x1, x); + k = l; + l = 2 * l; + for (i = 0; i < k; i++) + { + mpz_mul (x, x, x); mpz_add (x, x, a); mpz_mod (x, x, n); + } + mpz_set (y, x); + c = 0; + goto S2; +S4: + do + { + mpz_mul (y, y, y); mpz_add (y, y, a); mpz_mod (y, y, n); + mpz_sub (t1, x1, y); mpz_gcd (g, t1, n); + } + while (mpz_cmp_ui (g, 1) == 0); + + mpz_div (n, n, g); /* divide by g, before g is overwritten */ + + if (!mpz_probab_prime_p (g, 3)) + { + do + { + mp_limb_t a_limb; + mpn_random (&a_limb, (mp_size_t) 1); + a_int = (int) a_limb; + } + while (a_int == -2 || a_int == 0); + + debug ("[composite factor--restarting pollard-rho] "); + factor_using_pollard_rho (g, a_int); + } + else + { + emit_factor (g); + } + mpz_mod (x, x, n); + mpz_mod (x1, x1, n); + mpz_mod (y, y, n); + if (mpz_probab_prime_p (n, 3)) + { + emit_factor (n); + break; + } + } + + mpz_clear (g); + mpz_clear (P); + mpz_clear (t2); + mpz_clear (t1); + mpz_clear (a); + mpz_clear (x1); + mpz_clear (x); + mpz_clear (y); +} + +#else + +static void +debug (char const *fmt ATTRIBUTE_UNUSED, ...) +{ +} + +#endif + /* The maximum number of factors, including -1, for negative numbers. */ #define MAX_N_FACTORS (sizeof (uintmax_t) * CHAR_BIT) @@ -60,42 +284,10 @@ static const unsigned char wheel_tab[] = #define WHEEL_START (wheel_tab + WHEEL_SIZE) #define WHEEL_END (wheel_tab + (sizeof wheel_tab / sizeof wheel_tab[0])) -/* The name this program was run with. */ -char *program_name; - -void -usage (int status) -{ - if (status != EXIT_SUCCESS) - fprintf (stderr, _("Try `%s --help' for more information.\n"), - program_name); - else - { - printf (_("\ -Usage: %s [NUMBER]...\n\ - or: %s OPTION\n\ -"), - program_name, program_name); - fputs (_("\ -Print the prime factors of each NUMBER.\n\ -\n\ -"), stdout); - fputs (HELP_OPTION_DESCRIPTION, stdout); - fputs (VERSION_OPTION_DESCRIPTION, stdout); - fputs (_("\ -\n\ -Print the prime factors of all specified integer NUMBERs. If no arguments\n\ -are specified on the command line, they are read from standard input.\n\ -"), stdout); - printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT); - } - exit (status); -} - /* FIXME: comment */ static size_t -factor (uintmax_t n0, size_t max_n_factors, uintmax_t *factors) +factor_wheel (uintmax_t n0, size_t max_n_factors, uintmax_t *factors) { uintmax_t n = n0, d, q; size_t n_factors = 0; @@ -138,32 +330,181 @@ factor (uintmax_t n0, size_t max_n_factors, uintmax_t *factors) return n_factors; } -/* FIXME: comment */ - -static bool -print_factors (const char *s) +/* Single-precision factoring */ +static void +print_factors_single (uintmax_t n) { uintmax_t factors[MAX_N_FACTORS]; - uintmax_t n; - size_t n_factors; + size_t n_factors = factor_wheel (n, MAX_N_FACTORS, factors); size_t i; char buf[INT_BUFSIZE_BOUND (uintmax_t)]; - strtol_error err; - if ((err = xstrtoumax (s, NULL, 10, &n, "")) != LONGINT_OK) - { - if (err == LONGINT_OVERFLOW) - error (0, 0, _("%s is too large"), quote (s)); - else - error (0, 0, _("%s is not a valid positive integer"), quote (s)); - return false; - } - n_factors = factor (n, MAX_N_FACTORS, factors); printf ("%s:", umaxtostr (n, buf)); for (i = 0; i < n_factors; i++) printf (" %s", umaxtostr (factors[i], buf)); putchar ('\n'); - return true; +} + +#if HAVE_GMP +static int +mpcompare (const void *av, const void *bv) +{ + mpz_t *const *a = av; + mpz_t *const *b = bv; + return mpz_cmp (**a, **b); +} + +static void +sort_and_print_factors (void) +{ + mpz_t **faclist; + size_t i; + + faclist = xcalloc (nfactors_found, sizeof *faclist); + for (i = 0; i < nfactors_found; ++i) + { + faclist[i] = &factor[i]; + } + qsort (faclist, nfactors_found, sizeof *faclist, mpcompare); + + for (i = 0; i < nfactors_found; ++i) + { + fputc (' ', stdout); + mpz_out_str (stdout, 10, *faclist[i]); + } + putchar ('\n'); + free (faclist); +} + +static void +free_factors (void) +{ + size_t i; + + for (i = 0; i < nfactors_found; ++i) + { + mpz_clear (factor[i]); + } + /* Don't actually free factor[] because in the case where we are + reading numbers from stdin, we may be about to use it again. */ + nfactors_found = 0; +} + +/* Arbitrary-precision factoring */ +static void +print_factors_multi (mpz_t t) +{ + mpz_out_str (stdout, 10, t); + putchar (':'); + + if (mpz_sgn (t) != 0) + { + /* Set the trial division limit according to the size of t. */ + size_t n_bits = mpz_sizeinbase (t, 2); + unsigned int division_limit = MIN (n_bits, 1000); + division_limit *= division_limit; + + factor_using_division (t, division_limit); + + if (mpz_cmp_ui (t, 1) != 0) + { + debug ("[is number prime?] "); + if (mpz_probab_prime_p (t, 3)) + emit_factor (t); + else + factor_using_pollard_rho (t, 1); + } + } + + mpz_clear (t); + sort_and_print_factors (); + free_factors (); +} +#endif + + +/* Emit the factors of the indicated number. If we have the option of using + either algorithm, we select on the basis of the length of the number. + For longer numbers, we prefer the MP algorithm even if the native algorithm + has enough digits, because the algorithm is better. The turnover point + depends on the value. */ +static bool +print_factors (char const *s) +{ + uintmax_t n; + strtol_error err = xstrtoumax (s, NULL, 10, &n, ""); + +#if HAVE_GMP + enum { GMP_TURNOVER_POINT = 100000 }; + + if (err == LONGINT_OVERFLOW + || (err == LONGINT_OK && GMP_TURNOVER_POINT <= n)) + { + mpz_t t; + mpz_init (t); + if (gmp_sscanf (s, "%Zd", t) == 1) + { + debug ("[%s]", _("using arbitrary-precision arithmetic")); + print_factors_multi (t); + return true; + } + err = LONGINT_INVALID; + } +#endif + + switch (err) + { + case LONGINT_OK: + debug ("[%s]", _("using single-precision arithmetic")); + print_factors_single (n); + return true; + + case LONGINT_OVERFLOW: + error (0, 0, _("%s is too large"), quote (s)); + return false; + + default: + error (0, 0, _("%s is not a valid positive integer"), quote (s)); + return false; + } +} + +enum +{ + VERBOSE_OPTION = CHAR_MAX + 1 +}; + +static struct option const long_options[] = +{ + {"verbose", no_argument, NULL, VERBOSE_OPTION}, + {GETOPT_HELP_OPTION_DECL}, + {GETOPT_VERSION_OPTION_DECL}, + {NULL, 0, NULL, 0} +}; + +void +usage (int status) +{ + if (status != EXIT_SUCCESS) + fprintf (stderr, _("Try `%s --help' for more information.\n"), + program_name); + else + { + printf (_("\ +Usage: %s [NUMBER]...\n\ + or: %s OPTION\n\ +"), + program_name, program_name); + fputs (_("\ +Print the prime factors of each specified integer NUMBER. If none\n\ +are specified on the command line, read them from standard input.\n\ +\n\ +"), stdout); + fputs (HELP_OPTION_DESCRIPTION, stdout); + fputs (VERSION_OPTION_DESCRIPTION, stdout); + emit_bug_reporting_address (); + } + exit (status); } static bool @@ -191,19 +532,32 @@ int main (int argc, char **argv) { bool ok; + int c; initialize_main (&argc, &argv); - program_name = argv[0]; + set_program_name (argv[0]); setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); atexit (close_stdout); - parse_long_options (argc, argv, PROGRAM_NAME, GNU_PACKAGE, VERSION, - usage, AUTHORS, (char const *) NULL); - if (getopt_long (argc, argv, "", NULL, NULL) != -1) - usage (EXIT_FAILURE); + while ((c = getopt_long (argc, argv, "", long_options, NULL)) != -1) + { + switch (c) + { + case VERBOSE_OPTION: + verbose = true; + break; + + case_GETOPT_HELP_CHAR; + + case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS); + + default: + usage (EXIT_FAILURE); + } + } if (argc <= optind) ok = do_stdin (); @@ -215,6 +569,8 @@ main (int argc, char **argv) if (! print_factors (argv[i])) ok = false; } - +#if HAVE_GMP + free (factor); +#endif exit (ok ? EXIT_SUCCESS : EXIT_FAILURE); } diff --git a/src/bin/coreutils/src/fmt.c b/src/bin/coreutils/src/fmt.c index 5ccc8c44ad..60faac9ef0 100644 --- a/src/bin/coreutils/src/fmt.c +++ b/src/bin/coreutils/src/fmt.c @@ -1,10 +1,10 @@ /* GNU fmt -- simple text formatter. - Copyright (C) 1994-2006 Free Software Foundation, Inc. + Copyright (C) 1994-2006, 2008 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Ross Paterson . */ @@ -34,7 +33,7 @@ /* The official name of this program (e.g., no `g' prefix). */ #define PROGRAM_NAME "fmt" -#define AUTHORS "Ross Paterson" +#define AUTHORS proper_name ("Ross Paterson") /* The following parameters represent the program's idea of what is "best". Adjust to taste, subject to the caveats given. */ @@ -168,9 +167,6 @@ static void put_line (WORD *w, int indent); static void put_word (WORD *w); static void put_space (int space); -/* The name this program was run with. */ -const char *program_name; - /* Option values. */ /* If true, first 2 lines may have different indent (default false). */ @@ -270,10 +266,10 @@ usage (int status) program_name); else { - printf (_("Usage: %s [-DIGITS] [OPTION]... [FILE]...\n"), program_name); + printf (_("Usage: %s [-WIDTH] [OPTION]... [FILE]...\n"), program_name); fputs (_("\ Reformat each paragraph in the FILE(s), writing to standard output.\n\ -If no FILE or if FILE is `-', read standard input.\n\ +The option -WIDTH is an abbreviated form of --width=DIGITS.\n\ \n\ "), stdout); fputs (_("\ @@ -297,14 +293,14 @@ Mandatory arguments to long options are mandatory for short options too.\n\ \n\ With no FILE, or when FILE is -, read standard input.\n"), stdout); - printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT); + emit_bug_reporting_address (); } exit (status); } /* Decode options and launch execution. */ -static const struct option long_options[] = +static struct option const long_options[] = { {"crown-margin", no_argument, NULL, 'c'}, {"prefix", required_argument, NULL, 'p'}, @@ -325,7 +321,7 @@ main (int argc, char **argv) char const *max_width_option = NULL; initialize_main (&argc, &argv); - program_name = argv[0]; + set_program_name (argv[0]); setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); diff --git a/src/bin/coreutils/src/fold.c b/src/bin/coreutils/src/fold.c index 0d4ea58608..57ff123c72 100644 --- a/src/bin/coreutils/src/fold.c +++ b/src/bin/coreutils/src/fold.c @@ -1,10 +1,10 @@ /* fold -- wrap each input line to fit in specified width. - Copyright (C) 91, 1995-2006 Free Software Foundation, Inc. + Copyright (C) 91, 1995-2006, 2008 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by David MacKenzie, djm@gnu.ai.mit.edu. */ @@ -33,10 +32,7 @@ /* The official name of this program (e.g., no `g' prefix). */ #define PROGRAM_NAME "fold" -#define AUTHORS "David MacKenzie" - -/* The name this program was run with. */ -char *program_name; +#define AUTHORS proper_name ("David MacKenzie") /* If nonzero, try to break on whitespace. */ static bool break_spaces; @@ -86,7 +82,7 @@ Mandatory arguments to long options are mandatory for short options too.\n\ "), stdout); fputs (HELP_OPTION_DESCRIPTION, stdout); fputs (VERSION_OPTION_DESCRIPTION, stdout); - printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT); + emit_bug_reporting_address (); } exit (status); } @@ -248,7 +244,7 @@ main (int argc, char **argv) bool ok; initialize_main (&argc, &argv); - program_name = argv[0]; + set_program_name (argv[0]); setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); diff --git a/src/bin/coreutils/src/fs.h b/src/bin/coreutils/src/fs.h index 5ceea5b496..da751a6721 100644 --- a/src/bin/coreutils/src/fs.h +++ b/src/bin/coreutils/src/fs.h @@ -3,41 +3,61 @@ This file is generated automatically from ./stat.c. */ #if defined __linux__ +# define S_MAGIC_ADFS 0xADF5 # define S_MAGIC_AFFS 0xADFF +# define S_MAGIC_AUTOFS 0x187 +# define S_MAGIC_BEFS 0x42465331 +# define S_MAGIC_BFS 0x1BADFACE +# define S_MAGIC_BINFMT_MISC 0x42494e4d +# define S_MAGIC_CODA 0x73757245 +# define S_MAGIC_COH 0x012FF7B7 +# define S_MAGIC_CRAMFS 0x28CD3D45 +# define S_MAGIC_DEVFS 0x1373 # define S_MAGIC_DEVPTS 0x1CD1 +# define S_MAGIC_EFS 0x414A53 # define S_MAGIC_EXT 0x137D -# define S_MAGIC_EXT2_OLD 0xEF51 # define S_MAGIC_EXT2 0xEF53 -# define S_MAGIC_JFS 0x3153464a -# define S_MAGIC_XFS 0x58465342 +# define S_MAGIC_EXT2_OLD 0xEF51 +# define S_MAGIC_FAT 0x4006 +# define S_MAGIC_FUSECTL 0x65735543 # define S_MAGIC_HPFS 0xF995E849 +# define S_MAGIC_HUGETLBFS 0x958458f6 # define S_MAGIC_ISOFS 0x9660 -# define S_MAGIC_ISOFS_WIN 0x4000 # define S_MAGIC_ISOFS_R_WIN 0x4004 +# define S_MAGIC_ISOFS_WIN 0x4000 +# define S_MAGIC_JFFS2 0x72B6 +# define S_MAGIC_JFFS 0x07C0 +# define S_MAGIC_JFS 0x3153464A +# define S_MAGIC_LUSTRE 0x0BD00BD0 # define S_MAGIC_MINIX 0x137F # define S_MAGIC_MINIX_30 0x138F # define S_MAGIC_MINIX_V2 0x2468 # define S_MAGIC_MINIX_V2_30 0x2478 -# define S_MAGIC_MSDOS 0x4d44 -# define S_MAGIC_FAT 0x4006 -# define S_MAGIC_NCP 0x564c +# define S_MAGIC_MSDOS 0x4D44 +# define S_MAGIC_NCP 0x564C # define S_MAGIC_NFS 0x6969 -# define S_MAGIC_PROC 0x9fa0 -# define S_MAGIC_SMB 0x517B -# define S_MAGIC_XENIX 0x012FF7B4 -# define S_MAGIC_SYSV4 0x012FF7B5 -# define S_MAGIC_SYSV2 0x012FF7B6 -# define S_MAGIC_COH 0x012FF7B7 -# define S_MAGIC_UFS 0x00011954 -# define S_MAGIC_XIAFS 0x012FD16D -# define S_MAGIC_NTFS 0x5346544e -# define S_MAGIC_TMPFS 0x1021994 +# define S_MAGIC_NFSD 0x6E667364 +# define S_MAGIC_NTFS 0x5346544E +# define S_MAGIC_OPENPROM 0x9fa1 +# define S_MAGIC_PROC 0x9FA0 +# define S_MAGIC_QNX4 0x002F +# define S_MAGIC_RAMFS 0x858458F6 # define S_MAGIC_REISERFS 0x52654973 -# define S_MAGIC_CRAMFS 0x28cd3d45 # define S_MAGIC_ROMFS 0x7275 -# define S_MAGIC_RAMFS 0x858458f6 +# define S_MAGIC_SMB 0x517B # define S_MAGIC_SQUASHFS 0x73717368 # define S_MAGIC_SYSFS 0x62656572 +# define S_MAGIC_SYSV2 0x012FF7B6 +# define S_MAGIC_SYSV4 0x012FF7B5 +# define S_MAGIC_TMPFS 0x1021994 +# define S_MAGIC_UDF 0x15013346 +# define S_MAGIC_UFS 0x00011954 +# define S_MAGIC_UFS_BYTESWAPPED 0x54190100 +# define S_MAGIC_USBDEVFS 0x9FA2 +# define S_MAGIC_VXFS 0xA501FCF5 +# define S_MAGIC_XENIX 0x012FF7B4 +# define S_MAGIC_XFS 0x58465342 +# define S_MAGIC_XIAFS 0x012FD16D #elif defined __GNU__ # include #endif diff --git a/src/bin/coreutils/src/getlimits.c b/src/bin/coreutils/src/getlimits.c new file mode 100644 index 0000000000..2fd6e39a81 --- /dev/null +++ b/src/bin/coreutils/src/getlimits.c @@ -0,0 +1,180 @@ +/* getlimits - print various platform dependent limits. + Copyright (C) 2008 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* Written by Pádraig Brady */ + +#include /* sets _FILE_OFFSET_BITS=64 etc. */ +#include +#include + +#include "system.h" +#include "c-ctype.h" +#include "long-options.h" + +#define PROGRAM_NAME "getlimits" + +#define AUTHORS proper_name_utf8 ("Padraig Brady", "P\303\241draig Brady") + +#ifndef TIME_T_MAX +# define TIME_T_MAX TYPE_MAXIMUM (time_t) +#endif + +#ifndef TIME_T_MIN +# define TIME_T_MIN TYPE_MINIMUM (time_t) +#endif + +#ifndef SSIZE_MIN +# define SSIZE_MIN TYPE_MINIMUM (ssize_t) +#endif + +#ifndef PID_T_MIN +# define PID_T_MIN TYPE_MINIMUM (pid_t) +#endif + +/* These are not interesting to print. + * Instead of these defines it would be nice to be able to do + * #ifdef (TYPE##_MIN) in function macro below. */ +#define SIZE_MIN 0 +#define UCHAR_MIN 0 +#define UINT_MIN 0 +#define ULONG_MIN 0 +#define UINTMAX_MIN 0 +#define UID_T_MIN 0 +#define GID_T_MIN 0 + +void +usage (int status) +{ + if (status != EXIT_SUCCESS) + fprintf (stderr, _("Try `%s --help' for more information.\n"), + program_name); + else + { + printf (_("\ +Usage: %s\n\ +"), program_name); + + fputs (_("\ +Output platform dependent limits in a format useful for shell scripts.\n\ +\n\ +"), stdout); + fputs (HELP_OPTION_DESCRIPTION, stdout); + fputs (VERSION_OPTION_DESCRIPTION, stdout); + emit_bug_reporting_address (); + } + exit (status); +} + +/* Add absolute values of ascii decimal strings. + * Strings can have leading spaces. + * If any string has a '-' it's preserved in the output: + * I.E. + * 1 + 1 -> 2 + * -1 + -1 -> -2 + * -1 + 1 -> -2 + * 1 + -1 -> -2 + */ +static char * +decimal_ascii_add (const char *str1, const char *str2) +{ + int len1 = strlen (str1); + int len2 = strlen (str2); + int rlen = MAX (len1, len2) + 3; /* space for extra digit or sign + NUL */ + char *result = xmalloc (rlen); + char *rp = result + rlen - 1; + const char *d1 = str1 + len1 - 1; + const char *d2 = str2 + len2 - 1; + int carry = 0; + *rp = '\0'; + + while (1) + { + char c1 = (d1 < str1 ? ' ' : (*d1 == '-' ? ' ' : *d1--)); + char c2 = (d2 < str2 ? ' ' : (*d2 == '-' ? ' ' : *d2--)); + char t1 = c1 + c2 + carry; /* ASCII digits are BCD */ + if (!c_isdigit (c1) && !c_isdigit (c2) && !carry) + break; + carry = t1 > '0' + '9' || t1 == ' ' + '9' + 1; + t1 += 6 * carry; + *--rp = (t1 & 0x0F) | 0x30; /* top nibble to ASCII */ + } + if ((d1 >= str1 && *d1 == '-') || (d2 >= str2 && (*d2 == '-'))) + *--rp = '-'; + + if (rp != result) + memmove (result, rp, rlen - (rp - result)); + + return result; +} + +int +main (int argc, char **argv) +{ + char limit[64]; /* big enough for 128 bit at least */ + char *oflow; + + initialize_main (&argc, &argv); + set_program_name (argv[0]); + setlocale (LC_ALL, ""); + bindtextdomain (PACKAGE, LOCALEDIR); + textdomain (PACKAGE); + + initialize_exit_failure (EXIT_FAILURE); + atexit (close_stdout); + + parse_long_options (argc, argv, PROGRAM_NAME, PACKAGE_NAME, VERSION, + usage, AUTHORS, (char const *) NULL); + +#define print_int(TYPE) \ + snprintf (limit, sizeof(limit), "%"PRIuMAX, (uintmax_t)TYPE##_MAX); \ + printf (#TYPE"_MAX=%s\n", limit); \ + oflow = decimal_ascii_add (limit, "1"); \ + printf (#TYPE"_OFLOW=%s\n", oflow); \ + free (oflow); \ + if (TYPE##_MIN) \ + { \ + snprintf (limit, sizeof(limit), "%"PRIdMAX, (intmax_t)TYPE##_MIN); \ + printf (#TYPE"_MIN=%s\n", limit); \ + oflow = decimal_ascii_add (limit, "-1"); \ + printf (#TYPE"_UFLOW=%s\n", oflow); \ + free (oflow); \ + } + + /* Variable sized ints */ + print_int (CHAR); + print_int (SCHAR); + print_int (UCHAR); + print_int (SHRT); + print_int (INT); + print_int (UINT); + print_int (LONG); + print_int (ULONG); + print_int (SIZE); + print_int (SSIZE); + print_int (TIME_T); + print_int (UID_T); + print_int (GID_T); + print_int (PID_T); + print_int (OFF_T); + print_int (INTMAX); + print_int (UINTMAX); +} + +/* + * Local variables: + * indent-tabs-mode: nil + * End: + */ diff --git a/src/bin/coreutils/src/group-list.c b/src/bin/coreutils/src/group-list.c new file mode 100644 index 0000000000..46895b4745 --- /dev/null +++ b/src/bin/coreutils/src/group-list.c @@ -0,0 +1,121 @@ +/* group-list.c --Print a list of group IDs or names. + Copyright (C) 1989-2009 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* Written by Arnold Robbins. + Major rewrite by David MacKenzie, djm@gnu.ai.mit.edu. + Extracted from id.c by James Youngman. */ + +#include +#include +#include +#include +#include + +#include "system.h" +#include "error.h" +#include "mgetgroups.h" +#include "quote.h" +#include "group-list.h" + + +/* Print all of the distinct groups the user is in. */ +extern bool +print_group_list (const char *username, + uid_t ruid, gid_t rgid, gid_t egid, + bool use_names) +{ + bool ok = true; + struct passwd *pwd; + + pwd = getpwuid (ruid); + if (pwd == NULL) + ok = false; + + if (!print_group (rgid, use_names)) + ok = false; + + if (egid != rgid) + { + putchar (' '); + if (!print_group (egid, use_names)) + ok = false; + } + +#if HAVE_GETGROUPS + { + GETGROUPS_T *groups; + int i; + + int n_groups = mgetgroups (username, (pwd ? pwd->pw_gid : (gid_t) -1), + &groups); + if (n_groups < 0) + { + if (username) + { + error (0, errno, _("failed to get groups for user %s"), + quote (username)); + } + else + { + error (0, errno, _("failed to get groups for the current process")); + } + return false; + } + + for (i = 0; i < n_groups; i++) + if (groups[i] != rgid && groups[i] != egid) + { + putchar (' '); + if (!print_group (groups[i], use_names)) + ok = false; + } + free (groups); + } +#endif /* HAVE_GETGROUPS */ + return ok; +} + + +/* Print the name or value of group ID GID. */ +extern bool +print_group (gid_t gid, bool use_name) +{ + struct group *grp = NULL; + bool ok = true; + + if (use_name) + { + grp = getgrgid (gid); + if (grp == NULL) + { + error (0, 0, _("cannot find name for group ID %lu"), + (unsigned long int) gid); + ok = false; + } + } + + if (grp == NULL) + printf ("%lu", (unsigned long int) gid); + else + printf ("%s", grp->gr_name); + return ok; +} + +/* + * Local variables: + * indent-tabs-mode: nil + * End: + */ diff --git a/src/bin/coreutils/src/group-list.h b/src/bin/coreutils/src/group-list.h new file mode 100644 index 0000000000..dc5f3f24be --- /dev/null +++ b/src/bin/coreutils/src/group-list.h @@ -0,0 +1,19 @@ +/* group-list.h -- prototypes shared by id and groups. + + Copyright (C) 2008 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +bool print_group (gid_t, bool); +bool print_group_list (const char *, uid_t, gid_t, gid_t, bool); diff --git a/src/bin/coreutils/src/groups.c b/src/bin/coreutils/src/groups.c new file mode 100644 index 0000000000..907af1cbe0 --- /dev/null +++ b/src/bin/coreutils/src/groups.c @@ -0,0 +1,132 @@ +/* groups -- print the groups a user is in + Copyright (C) 1989-2008 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* Written by James Youngman based on id.c and groups.sh, + which were written by Arnold Robbins and David MacKenzie. */ + +#include +#include +#include +#include +#include +#include + +#include "system.h" +#include "error.h" +#include "group-list.h" + +/* The official name of this program (e.g., no `g' prefix). */ +#define PROGRAM_NAME "groups" + +#define AUTHORS \ + proper_name ("David MacKenzie"), \ + proper_name ("James Youngman") + + +static struct option const longopts[] = +{ + {GETOPT_HELP_OPTION_DECL}, + {GETOPT_VERSION_OPTION_DECL}, + {NULL, 0, NULL, 0} +}; + +void +usage (int status) +{ + if (status != EXIT_SUCCESS) + fprintf (stderr, _("Try `%s --help' for more information.\n"), + program_name); + else + { + printf (_("Usage: %s [OPTION]... [USERNAME]...\n"), program_name); + fputs (_("\ +Print group memberships for each USERNAME or, if no USERNAME is specified, for\n\ +the current process (which may differ if the groups database has changed).\n"), + stdout); + fputs (HELP_OPTION_DESCRIPTION, stdout); + fputs (VERSION_OPTION_DESCRIPTION, stdout); + emit_bug_reporting_address (); + } + exit (status); +} + +int +main (int argc, char **argv) +{ + int optc; + bool ok = true; + gid_t rgid, egid; + uid_t ruid; + + initialize_main (&argc, &argv); + set_program_name (argv[0]); + setlocale (LC_ALL, ""); + bindtextdomain (PACKAGE, LOCALEDIR); + textdomain (PACKAGE); + + atexit (close_stdout); + + /* Processing the arguments this way makes groups.c behave differently to + * groups.sh if one of the arguments is "--". + */ + while ((optc = getopt_long (argc, argv, "", longopts, NULL)) != -1) + { + switch (optc) + { + case_GETOPT_HELP_CHAR; + case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS); + default: + usage (EXIT_FAILURE); + } + } + + if (optind == argc) + { + /* No arguments. Divulge the details of the current process. */ + ruid = getuid (); + egid = getegid (); + rgid = getgid (); + + if (!print_group_list (NULL, ruid, rgid, egid, true)) + ok = false; + putchar ('\n'); + } + else + { + /* At least one argument. Divulge the details of the specified users. */ + while (optind < argc) + { + struct passwd *pwd = getpwnam (argv[optind]); + if (pwd == NULL) + error (EXIT_FAILURE, 0, _("%s: No such user"), argv[optind]); + ruid = pwd->pw_uid; + rgid = egid = pwd->pw_gid; + + printf ("%s : ", argv[optind]); + if (!print_group_list (argv[optind++], ruid, rgid, egid, true)) + ok = false; + putchar ('\n'); + } + } + + exit (ok ? EXIT_SUCCESS : EXIT_FAILURE); +} + +/* + * Local variables: + * indent-tabs-mode: nil + * End: + */ diff --git a/src/bin/coreutils/src/groups.sh b/src/bin/coreutils/src/groups.sh deleted file mode 100755 index dd32c63c54..0000000000 --- a/src/bin/coreutils/src/groups.sh +++ /dev/null @@ -1,83 +0,0 @@ -#!/bin/sh -# groups -- print the groups a user is in -# Copyright (C) 1991, 1997, 2000, 2002, 2004-2007 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - -# Written by David MacKenzie . - -# Make sure we get GNU id, if possible; also allow -# it to be somewhere else in PATH if not installed yet. -PATH=@bindir@:$PATH - -usage="Usage: $0 [OPTION]... [USERNAME]... - - --help display this help and exit - --version output version information and exit - -Same as id -Gn. If no USERNAME, use current process. - -Report bugs to <@PACKAGE_BUGREPORT@>." - -version='groups (@GNU_PACKAGE@) @VERSION@ -Copyright (C) @RELEASE_YEAR@ Free Software Foundation, Inc. -This is free software. You may redistribute copies of it under the terms of -the GNU General Public License . -There is NO WARRANTY, to the extent permitted by law. - -Written by David MacKenzie.' - - -for arg -do - case $arg in - --help | --hel | --he | --h) - exec echo "$usage" ;; - --version | --versio | --versi | --vers | --ver | --ve | --v) - exec echo "$version" ;; - --) - shift - break ;; - -*) - echo "$0: invalid option: $arg" >&2 - exit 1 ;; - esac -done - -# With fewer than two arguments, simply exec "id". -case $# in - 0|1) exec id -Gn -- "$@" ;; -esac - -# With more, we need a loop, and be sure to exit nonzero upon failure. -status=0 -write_error=0 - -for name -do - if groups=`id -Gn -- "$name"`; then - echo "$name : $groups" || { - status=$? - if test $write_error = 0; then - echo "$0: write error" >&2 - write_error=1 - fi - } - else - status=$? - fi -done - -exit $status diff --git a/src/bin/coreutils/src/head.c b/src/bin/coreutils/src/head.c index 4038722b0d..7f90d4b29e 100644 --- a/src/bin/coreutils/src/head.c +++ b/src/bin/coreutils/src/head.c @@ -1,10 +1,10 @@ /* head -- output first part of file(s) - Copyright (C) 89, 90, 91, 1995-2006 Free Software Foundation, Inc. + Copyright (C) 89, 90, 91, 1995-2006, 2008 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Options: (see usage) Reads from standard input if no files are given or when a filename of @@ -35,15 +34,17 @@ #include "error.h" #include "full-write.h" #include "full-read.h" -#include "inttostr.h" #include "quote.h" #include "safe-read.h" +#include "xfreopen.h" #include "xstrtol.h" /* The official name of this program (e.g., no `g' prefix). */ #define PROGRAM_NAME "head" -#define AUTHORS "David MacKenzie", "Jim Meyering" +#define AUTHORS \ + proper_name ("David MacKenzie"), \ + proper_name ("Jim Meyering") /* Number of lines/chars/blocks to head. */ #define DEFAULT_NUMBER 10 @@ -63,9 +64,6 @@ enum header_mode multiple_files, always, never }; -/* The name this program was run with. */ -char *program_name; - /* Have we ever read standard input? */ static bool have_read_stdin; @@ -135,9 +133,11 @@ Mandatory arguments to long options are mandatory for short options too.\n\ fputs (VERSION_OPTION_DESCRIPTION, stdout); fputs (_("\ \n\ -N may have a multiplier suffix: b 512, k 1024, m 1024*1024.\n\ +N may have a multiplier suffix:\n\ +b 512, kB 1000, K 1024, MB 1000*1000, M 1024*1024,\n\ +GB 1000*1000*1000, G 1024*1024*1024, and so on for T, P, E, Z, Y.\n\ "), stdout); - printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT); + emit_bug_reporting_address (); } exit (status); } @@ -839,7 +839,7 @@ head_file (const char *filename, uintmax_t n_units, bool count_lines, fd = STDIN_FILENO; filename = _("standard input"); if (O_BINARY && ! isatty (STDIN_FILENO)) - freopen (NULL, "rb", stdin); + xfreopen (NULL, "rb", stdin); } else { @@ -860,8 +860,8 @@ head_file (const char *filename, uintmax_t n_units, bool count_lines, return ok; } -/* Convert a string of decimal digits, N_STRING, with a single, optional suffix - character (b, k, or m) to an integral value. Upon successful conversion, +/* Convert a string of decimal digits, N_STRING, with an optional suffinx + to an integral value. Upon successful conversion, return that value. If it cannot be converted, give a diagnostic and exit. COUNT_LINES indicates whether N_STRING is a number of bytes or a number of lines. It is used solely to give a more specific diagnostic. */ @@ -872,7 +872,7 @@ string_to_integer (bool count_lines, const char *n_string) strtol_error s_err; uintmax_t n; - s_err = xstrtoumax (n_string, NULL, 10, &n, "bkm"); + s_err = xstrtoumax (n_string, NULL, 10, &n, "bkKmMGTPEZY0"); if (s_err == LONGINT_OVERFLOW) { @@ -917,7 +917,7 @@ main (int argc, char **argv) char const *const *file_list; initialize_main (&argc, &argv); - program_name = argv[0]; + set_program_name (argv[0]); setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); @@ -1052,7 +1052,7 @@ main (int argc, char **argv) : default_file_list); if (O_BINARY && ! isatty (STDOUT_FILENO)) - freopen (NULL, "wb", stdout); + xfreopen (NULL, "wb", stdout); for (i = 0; file_list[i]; ++i) ok &= head_file (file_list[i], n_units, count_lines, elide_from_end); diff --git a/src/bin/coreutils/src/hostid.c b/src/bin/coreutils/src/hostid.c index 090b8a04c6..1da5a0c5ce 100644 --- a/src/bin/coreutils/src/hostid.c +++ b/src/bin/coreutils/src/hostid.c @@ -1,12 +1,12 @@ /* print the hexadecimal identifier for the current host - Copyright (C) 1997, 1999, 2000, 2001, 2002, 2003, 2004 Free + Copyright (C) 1997, 1999, 2000, 2001, 2002, 2003, 2004, 2007-2009 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Jim Meyering. */ @@ -32,10 +31,7 @@ /* The official name of this program (e.g., no `g' prefix). */ #define PROGRAM_NAME "hostid" -#define AUTHORS "Jim Meyering" - -/* The name this program was run with, for error messages. */ -char *program_name; +#define AUTHORS proper_name ("Jim Meyering") void usage (int status) @@ -46,15 +42,13 @@ usage (int status) else { printf (_("\ -Usage: %s\n\ - or: %s OPTION\n\ +Usage: %s [OPTION]\n\ Print the numeric identifier (in hexadecimal) for the current host.\n\ \n\ -"), - program_name, program_name); +"), program_name); fputs (HELP_OPTION_DESCRIPTION, stdout); fputs (VERSION_OPTION_DESCRIPTION, stdout); - printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT); + emit_bug_reporting_address (); } exit (status); } @@ -65,14 +59,14 @@ main (int argc, char **argv) unsigned int id; initialize_main (&argc, &argv); - program_name = argv[0]; + set_program_name (argv[0]); setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); atexit (close_stdout); - parse_long_options (argc, argv, PROGRAM_NAME, GNU_PACKAGE, VERSION, + parse_long_options (argc, argv, PROGRAM_NAME, PACKAGE_NAME, Version, usage, AUTHORS, (char const *) NULL); if (getopt_long (argc, argv, "", NULL, NULL) != -1) usage (EXIT_FAILURE); diff --git a/src/bin/coreutils/src/hostname.c b/src/bin/coreutils/src/hostname.c index f6748a66d8..89cc568e83 100644 --- a/src/bin/coreutils/src/hostname.c +++ b/src/bin/coreutils/src/hostname.c @@ -1,10 +1,10 @@ /* hostname - set or print the name of current host system - Copyright (C) 1994-1997, 1999-2005 Free Software Foundation, Inc. + Copyright (C) 1994-1997, 1999-2005, 2007-2008 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Jim Meyering. */ @@ -31,17 +30,13 @@ /* The official name of this program (e.g., no `g' prefix). */ #define PROGRAM_NAME "hostname" -#define AUTHORS "Jim Meyering" - -#if HAVE_SETHOSTNAME && !defined sethostname -int sethostname (); -#endif +#define AUTHORS proper_name ("Jim Meyering") #if !defined HAVE_SETHOSTNAME && defined HAVE_SYSINFO && \ defined HAVE_SYS_SYSTEMINFO_H # include -int +static int sethostname (char *name, size_t namelen) { /* Using sysinfo() is the SVR4 mechanism to set a hostname. */ @@ -51,9 +46,6 @@ sethostname (char *name, size_t namelen) # define HAVE_SETHOSTNAME 1 /* Now we have it... */ #endif -/* The name this program was run with. */ -char *program_name; - void usage (int status) { @@ -71,7 +63,7 @@ Print or set the hostname of the current system.\n\ program_name, program_name); fputs (HELP_OPTION_DESCRIPTION, stdout); fputs (VERSION_OPTION_DESCRIPTION, stdout); - printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT); + emit_bug_reporting_address (); } exit (status); } @@ -82,14 +74,14 @@ main (int argc, char **argv) char *hostname; initialize_main (&argc, &argv); - program_name = argv[0]; + set_program_name (argv[0]); setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); atexit (close_stdout); - parse_long_options (argc, argv, PROGRAM_NAME, GNU_PACKAGE, VERSION, + parse_long_options (argc, argv, PROGRAM_NAME, PACKAGE_NAME, Version, usage, AUTHORS, (char const *) NULL); if (getopt_long (argc, argv, "", NULL, NULL) != -1) usage (EXIT_FAILURE); diff --git a/src/bin/coreutils/src/id.c b/src/bin/coreutils/src/id.c index 7abb3e50ca..78f78e058f 100644 --- a/src/bin/coreutils/src/id.c +++ b/src/bin/coreutils/src/id.c @@ -1,10 +1,10 @@ /* id -- print real and effective UIDs and GIDs - Copyright (C) 1989-2005 Free Software Foundation, Inc. + Copyright (C) 1989-2009 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,39 +12,38 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Arnold Robbins. Major rewrite by David MacKenzie, djm@gnu.ai.mit.edu. */ #include #include -#include #include #include #include #include +#include #include "system.h" #include "error.h" +#include "mgetgroups.h" #include "quote.h" +#include "group-list.h" /* The official name of this program (e.g., no `g' prefix). */ #define PROGRAM_NAME "id" -#define AUTHORS "Arnold Robbins", "David MacKenzie" +#define AUTHORS \ + proper_name ("Arnold Robbins"), \ + proper_name ("David MacKenzie") -int getugroups (); +/* If nonzero, output only the SELinux context. -Z */ +static int just_context = 0; static void print_user (uid_t uid); -static void print_group (gid_t gid); -static void print_group_list (const char *username); static void print_full_info (const char *username); -/* The name this program was run with. */ -char *program_name; - /* If true, output user/group name instead of ID number. -n */ static bool use_name = false; @@ -55,8 +54,13 @@ static gid_t rgid, egid; /* True unless errors have been encountered. */ static bool ok = true; +/* The SELinux context. Start with a known invalid value so print_full_info + knows when `context' has not been set to a meaningful value. */ +static security_context_t context = NULL; + static struct option const longopts[] = { + {"context", no_argument, NULL, 'Z'}, {"group", no_argument, NULL, 'g'}, {"groups", no_argument, NULL, 'G'}, {"name", no_argument, NULL, 'n'}, @@ -77,9 +81,11 @@ usage (int status) { printf (_("Usage: %s [OPTION]... [USERNAME]\n"), program_name); fputs (_("\ -Print information for USERNAME, or the current user.\n\ +Print user and group information for the specified USERNAME,\n\ +or (when USERNAME omitted) for the current user.\n\ \n\ -a ignore, for compatibility with other versions\n\ + -Z, --context print only the security context of the current user\n\ -g, --group print only the effective group ID\n\ -G, --groups print all group IDs\n\ -n, --name print a name instead of a number, for -ugG\n\ @@ -92,7 +98,7 @@ Print information for USERNAME, or the current user.\n\ \n\ Without any OPTION, print some useful set of identified information.\n\ "), stdout); - printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT); + emit_bug_reporting_address (); } exit (status); } @@ -101,6 +107,7 @@ int main (int argc, char **argv) { int optc; + int selinux_enabled = (is_selinux_enabled () > 0); /* If true, output the list of all group IDs. -G */ bool just_group_list = false; @@ -112,20 +119,29 @@ main (int argc, char **argv) bool just_user = false; initialize_main (&argc, &argv); - program_name = argv[0]; + set_program_name (argv[0]); setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); atexit (close_stdout); - while ((optc = getopt_long (argc, argv, "agnruG", longopts, NULL)) != -1) + while ((optc = getopt_long (argc, argv, "agnruGZ", longopts, NULL)) != -1) { switch (optc) { case 'a': /* Ignore -a, for compatibility with SVR4. */ break; + + case 'Z': + /* politely decline if we're not on a selinux-enabled kernel. */ + if (!selinux_enabled) + error (EXIT_FAILURE, 0, + _("--context (-Z) works only on an SELinux-enabled kernel")); + just_context = 1; + break; + case 'g': just_group = true; break; @@ -148,19 +164,33 @@ main (int argc, char **argv) } } - if (just_user + just_group + just_group_list > 1) - error (EXIT_FAILURE, 0, _("cannot print only user and only group")); - - if (just_user + just_group + just_group_list == 0 && (use_real | use_name)) - error (EXIT_FAILURE, 0, - _("cannot print only names or real IDs in default format")); - - if (argc - optind > 1) + if (1 < argc - optind) { error (0, 0, _("extra operand %s"), quote (argv[optind + 1])); usage (EXIT_FAILURE); } + if (argc - optind == 1 && just_context) + error (EXIT_FAILURE, 0, + _("cannot print security context when user specified")); + + /* If we are on a selinux-enabled kernel and no user is specified, + get our context. Otherwise, leave the context variable alone - + it has been initialized known invalid value and will be not + displayed in print_full_info() */ + if (selinux_enabled && argc == optind) + { + if (getcon (&context) && just_context) + error (EXIT_FAILURE, 0, _("can't get process context")); + } + + if (just_user + just_group + just_group_list + just_context > 1) + error (EXIT_FAILURE, 0, _("cannot print \"only\" of more than one choice")); + + if (just_user + just_group + just_group_list == 0 && (use_real | use_name)) + error (EXIT_FAILURE, 0, + _("cannot print only names or real IDs in default format")); + if (argc - optind == 1) { struct passwd *pwd = getpwnam (argv[optind]); @@ -178,13 +208,27 @@ main (int argc, char **argv) } if (just_user) - print_user (use_real ? ruid : euid); + { + print_user (use_real ? ruid : euid); + } else if (just_group) - print_group (use_real ? rgid : egid); + { + if (!print_group (use_real ? rgid : egid, use_name)) + ok = false; + } else if (just_group_list) - print_group_list (argv[optind]); + { + if (!print_group_list (argv[optind], ruid, rgid, egid, use_name)) + ok = false; + } + else if (just_context) + { + fputs (context, stdout); + } else - print_full_info (argv[optind]); + { + print_full_info (argv[optind]); + } putchar ('\n'); exit (ok ? EXIT_SUCCESS : EXIT_FAILURE); @@ -214,116 +258,6 @@ print_user (uid_t uid) printf ("%s", pwd->pw_name); } -/* Print the name or value of group ID GID. */ - -static void -print_group (gid_t gid) -{ - struct group *grp = NULL; - - if (use_name) - { - grp = getgrgid (gid); - if (grp == NULL) - { - error (0, 0, _("cannot find name for group ID %lu"), - (unsigned long int) gid); - ok = false; - } - } - - if (grp == NULL) - printf ("%lu", (unsigned long int) gid); - else - printf ("%s", grp->gr_name); -} - -#if HAVE_GETGROUPS - -/* FIXME: document */ - -static bool -xgetgroups (const char *username, gid_t gid, int *n_groups, - GETGROUPS_T **groups) -{ - int max_n_groups; - int ng; - GETGROUPS_T *g = NULL; - - if (!username) - max_n_groups = getgroups (0, NULL); - else - max_n_groups = getugroups (0, NULL, username, gid); - - if (max_n_groups < 0) - ng = -1; - else - { - g = xnmalloc (max_n_groups, sizeof *g); - if (!username) - ng = getgroups (max_n_groups, g); - else - ng = getugroups (max_n_groups, g, username, gid); - } - - if (ng < 0) - { - error (0, errno, _("cannot get supplemental group list")); - free (g); - return false; - } - else - { - *n_groups = ng; - *groups = g; - return true; - } -} - -#endif /* HAVE_GETGROUPS */ - -/* Print all of the distinct groups the user is in. */ - -static void -print_group_list (const char *username) -{ - struct passwd *pwd; - - pwd = getpwuid (ruid); - if (pwd == NULL) - ok = false; - - print_group (rgid); - if (egid != rgid) - { - putchar (' '); - print_group (egid); - } - -#if HAVE_GETGROUPS - { - int n_groups; - GETGROUPS_T *groups; - int i; - - if (! xgetgroups (username, (pwd ? pwd->pw_gid : (gid_t) -1), - &n_groups, &groups)) - { - ok = false; - return; - } - - for (i = 0; i < n_groups; i++) - if (groups[i] != rgid && groups[i] != egid) - { - putchar (' '); - print_group (groups[i]); - } - free (groups); - } -#endif /* HAVE_GETGROUPS */ -} - /* Print all of the info about the user's user and group IDs. */ static void @@ -332,19 +266,19 @@ print_full_info (const char *username) struct passwd *pwd; struct group *grp; - printf ("uid=%lu", (unsigned long int) ruid); + printf (_("uid=%lu"), (unsigned long int) ruid); pwd = getpwuid (ruid); if (pwd) printf ("(%s)", pwd->pw_name); - printf (" gid=%lu", (unsigned long int) rgid); + printf (_(" gid=%lu"), (unsigned long int) rgid); grp = getgrgid (rgid); if (grp) printf ("(%s)", grp->gr_name); if (euid != ruid) { - printf (" euid=%lu", (unsigned long int) euid); + printf (_(" euid=%lu"), (unsigned long int) euid); pwd = getpwuid (euid); if (pwd) printf ("(%s)", pwd->pw_name); @@ -352,7 +286,7 @@ print_full_info (const char *username) if (egid != rgid) { - printf (" egid=%lu", (unsigned long int) egid); + printf (_(" egid=%lu"), (unsigned long int) egid); grp = getgrgid (egid); if (grp) printf ("(%s)", grp->gr_name); @@ -360,13 +294,22 @@ print_full_info (const char *username) #if HAVE_GETGROUPS { - int n_groups; GETGROUPS_T *groups; int i; - if (! xgetgroups (username, (pwd ? pwd->pw_gid : (gid_t) -1), - &n_groups, &groups)) + int n_groups = mgetgroups (username, (pwd ? pwd->pw_gid : (gid_t) -1), + &groups); + if (n_groups < 0) { + if (username) + { + error (0, errno, _("failed to get groups for user %s"), + quote (username)); + } + else + { + error (0, errno, _("failed to get groups for the current process")); + } ok = false; return; } @@ -385,4 +328,6 @@ print_full_info (const char *username) free (groups); } #endif /* HAVE_GETGROUPS */ + if (context != NULL) + printf (_(" context=%s"), context); } diff --git a/src/bin/coreutils/src/install.c b/src/bin/coreutils/src/install.c index 04577518ce..fd8f71ef36 100644 --- a/src/bin/coreutils/src/install.c +++ b/src/bin/coreutils/src/install.c @@ -1,10 +1,10 @@ /* install - copy files and set attributes - Copyright (C) 89, 90, 91, 1995-2007 Free Software Foundation, Inc. + Copyright (C) 89, 90, 91, 1995-2009 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by David MacKenzie */ @@ -24,6 +23,7 @@ #include #include #include +#include #include "system.h" #include "backupfile.h" @@ -31,10 +31,13 @@ #include "cp-hash.h" #include "copy.h" #include "filenamecat.h" +#include "full-read.h" #include "mkancesdirs.h" #include "mkdir-p.h" #include "modechange.h" +#include "prog-fprintf.h" #include "quote.h" +#include "quotearg.h" #include "savewd.h" #include "stat-time.h" #include "utimens.h" @@ -43,12 +46,15 @@ /* The official name of this program (e.g., no `g' prefix). */ #define PROGRAM_NAME "install" -#define AUTHORS "David MacKenzie" +#define AUTHORS proper_name ("David MacKenzie") #if HAVE_SYS_WAIT_H # include #endif +static int selinux_enabled = 0; +static bool use_default_selinux_context = true; + #if ! HAVE_ENDGRENT # define endgrent() ((void) 0) #endif @@ -57,14 +63,13 @@ # define endpwent() ((void) 0) #endif -/* Initial number of entries in each hash table entry's table of inodes. */ -#define INITIAL_HASH_MODULE 100 +#if ! HAVE_LCHOWN +# define lchown(name, uid, gid) chown (name, uid, gid) +#endif -/* Initial number of entries in the inode hash table. */ -#define INITIAL_ENTRY_TAB_SIZE 70 - -/* Number of bytes of a file to copy at a time. */ -#define READ_SIZE (32 * 1024) +#if ! HAVE_MATCHPATHCON_INIT_PREFIX +# define matchpathcon_init_prefix(a, p) /* empty */ +#endif static bool change_timestamps (struct stat const *from_sb, char const *to); static bool change_attributes (char const *name); @@ -83,9 +88,6 @@ static int make_ancestor (char const *dir, char const *component, void *options); void usage (int status); -/* The name this program was run with, for error messages. */ -char *program_name; - /* The user name that will own the files, or NULL to make the owner the current user ID. */ static char *owner_name; @@ -115,22 +117,44 @@ static mode_t dir_mode = DEFAULT_MODE; or S_ISGID bits. */ static mode_t dir_mode_bits = CHMOD_MODE_BITS; +/* Compare files before installing (-C) */ +static bool copy_only_if_needed; + /* If true, strip executable files after copying them. */ static bool strip_files; /* If true, install a directory instead of a regular file. */ static bool dir_arg; +/* Program used to strip binaries, "strip" is default */ +static char const *strip_program = "strip"; + +/* For long options that have no equivalent short option, use a + non-character as a pseudo short option, starting with CHAR_MAX + 1. */ +enum +{ + PRESERVE_CONTEXT_OPTION = CHAR_MAX + 1, + PRESERVE_CONTEXT_OPTION_DEPRECATED, + STRIP_PROGRAM_OPTION +}; + static struct option const long_options[] = { {"backup", optional_argument, NULL, 'b'}, + {"compare", no_argument, NULL, 'C'}, + {GETOPT_SELINUX_CONTEXT_OPTION_DECL}, {"directory", no_argument, NULL, 'd'}, {"group", required_argument, NULL, 'g'}, {"mode", required_argument, NULL, 'm'}, {"no-target-directory", no_argument, NULL, 'T'}, {"owner", required_argument, NULL, 'o'}, {"preserve-timestamps", no_argument, NULL, 'p'}, + {"preserve-context", no_argument, NULL, PRESERVE_CONTEXT_OPTION}, + /* --preserve_context was silently supported until Apr 2009. + FIXME: disable altogether in a year or so. */ + {"preserve_context", no_argument, NULL, PRESERVE_CONTEXT_OPTION_DEPRECATED}, {"strip", no_argument, NULL, 's'}, + {"strip-program", required_argument, NULL, STRIP_PROGRAM_OPTION}, {"suffix", required_argument, NULL, 'S'}, {"target-directory", required_argument, NULL, 't'}, {"verbose", no_argument, NULL, 'v'}, @@ -139,9 +163,111 @@ static struct option const long_options[] = {NULL, 0, NULL, 0} }; +/* Compare content of opened files using file descriptors A_FD and B_FD. Return + true if files are equal. */ +static bool +have_same_content (int a_fd, int b_fd) +{ + enum { CMP_BLOCK_SIZE = 4096 }; + static char a_buff[CMP_BLOCK_SIZE]; + static char b_buff[CMP_BLOCK_SIZE]; + + size_t size; + while (0 < (size = full_read (a_fd, a_buff, sizeof a_buff))) { + if (size != full_read (b_fd, b_buff, sizeof b_buff)) + return false; + + if (memcmp (a_buff, b_buff, size) != 0) + return false; + } + + return size == 0; +} + +/* Return true for mode with non-permission bits. */ +static bool +extra_mode (mode_t input) +{ + const mode_t mask = ~S_IRWXUGO & ~S_IFMT; + return input & mask; +} + +/* Return true if copy of file SRC_NAME to file DEST_NAME is necessary. */ +static bool +need_copy (const char *src_name, const char *dest_name, + const struct cp_options *x) +{ + struct stat src_sb, dest_sb; + int src_fd, dest_fd; + bool content_match; + + if (extra_mode (mode)) + return true; + + /* compare files using stat */ + if (lstat (src_name, &src_sb) != 0) + return true; + + if (lstat (dest_name, &dest_sb) != 0) + return true; + + if (!S_ISREG (src_sb.st_mode) || !S_ISREG (dest_sb.st_mode) + || extra_mode (src_sb.st_mode) || extra_mode (dest_sb.st_mode)) + return true; + + if (src_sb.st_size != dest_sb.st_size + || (dest_sb.st_mode & CHMOD_MODE_BITS) != mode + || dest_sb.st_uid != (owner_id == (uid_t) -1 ? getuid () : owner_id) + || dest_sb.st_gid != (group_id == (gid_t) -1 ? getgid () : group_id)) + return true; + + /* compare SELinux context if preserving */ + if (selinux_enabled && x->preserve_security_context) + { + security_context_t file_scontext = NULL; + security_context_t to_scontext = NULL; + bool scontext_match; + + if (getfilecon (src_name, &file_scontext) == -1) + return true; + + if (getfilecon (dest_name, &to_scontext) == -1) + { + freecon (file_scontext); + return true; + } + + scontext_match = STREQ (file_scontext, to_scontext); + + freecon (file_scontext); + freecon (to_scontext); + if (!scontext_match) + return true; + } + + /* compare files content */ + src_fd = open (src_name, O_RDONLY | O_BINARY); + if (src_fd < 0) + return true; + + dest_fd = open (dest_name, O_RDONLY | O_BINARY); + if (dest_fd < 0) + { + close (src_fd); + return true; + } + + content_match = have_same_content (src_fd, dest_fd); + + close (src_fd); + close (dest_fd); + return !content_match; +} + static void cp_option_init (struct cp_options *x) { + cp_options_default (x); x->copy_as_regular = true; x->dereference = DEREF_ALWAYS; x->unlink_dest_before_opening = true; @@ -149,13 +275,15 @@ cp_option_init (struct cp_options *x) x->hard_link = false; x->interactive = I_UNSPECIFIED; x->move_mode = false; - x->chown_privileges = chown_privileges (); x->one_file_system = false; x->preserve_ownership = false; x->preserve_links = false; x->preserve_mode = false; x->preserve_timestamps = false; + x->reduce_diagnostics=false; x->require_preserve = false; + x->require_preserve_context = false; + x->require_preserve_xattr = false; x->recursive = false; x->sparse_mode = SPARSE_AUTO; x->symbolic_link = false; @@ -168,12 +296,97 @@ cp_option_init (struct cp_options *x) x->mode = S_IRUSR | S_IWUSR; x->stdin_tty = false; + x->open_dangling_dest_symlink = false; x->update = false; + x->preserve_security_context = false; + x->preserve_xattr = false; x->verbose = false; x->dest_info = NULL; x->src_info = NULL; } +#ifdef ENABLE_MATCHPATHCON +/* Modify file context to match the specified policy. + If an error occurs the file will remain with the default directory + context. */ +static void +setdefaultfilecon (char const *file) +{ + struct stat st; + security_context_t scontext = NULL; + static bool first_call = true; + + if (selinux_enabled != 1) + { + /* Indicate no context found. */ + return; + } + if (lstat (file, &st) != 0) + return; + + if (first_call && IS_ABSOLUTE_FILE_NAME (file)) + { + /* Calling matchpathcon_init_prefix (NULL, "/first_component/") + is an optimization to minimize the expense of the following + matchpathcon call. Do it only once, just before the first + matchpathcon call. We *could* call matchpathcon_fini after + the final matchpathcon call, but that's not necessary, since + by then we're about to exit, and besides, the buffers it + would free are still reachable. */ + char const *p0; + char const *p = file + 1; + while (ISSLASH (*p)) + ++p; + + /* Record final leading slash, for when FILE starts with two or more. */ + p0 = p - 1; + + if (*p) + { + char *prefix; + do + { + ++p; + } + while (*p && !ISSLASH (*p)); + + prefix = malloc (p - p0 + 2); + if (prefix) + { + stpcpy (stpncpy (prefix, p0, p - p0), "/"); + matchpathcon_init_prefix (NULL, prefix); + free (prefix); + } + } + } + first_call = false; + + /* If there's an error determining the context, or it has none, + return to allow default context */ + if ((matchpathcon (file, st.st_mode, &scontext) != 0) || + STREQ (scontext, "<>")) + { + if (scontext != NULL) + freecon (scontext); + return; + } + + if (lsetfilecon (file, scontext) < 0 && errno != ENOTSUP) + error (0, errno, + _("warning: %s: failed to change context to %s"), + quotearg_colon (file), scontext); + + freecon (scontext); + return; +} +#else +static void +setdefaultfilecon (char const *file) +{ + (void) file; +} +#endif + /* FILE is the last operand of this command. Return true if FILE is a directory. But report an error there is a problem accessing FILE, or if FILE does not exist but would have to refer to an existing @@ -222,14 +435,18 @@ main (int argc, char **argv) bool no_target_directory = false; int n_files; char **file; + bool strip_program_specified = false; + security_context_t scontext = NULL; + /* set iff kernel has extra selinux system calls */ + selinux_enabled = (0 < is_selinux_enabled ()); initialize_main (&argc, &argv); - program_name = argv[0]; + set_program_name (argv[0]); setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); - atexit (close_stdout); + atexit (close_stdin); cp_option_init (&x); @@ -243,7 +460,7 @@ main (int argc, char **argv) we'll actually use backup_suffix_string. */ backup_suffix_string = getenv ("SIMPLE_BACKUP_SUFFIX"); - while ((optc = getopt_long (argc, argv, "bcsDdg:m:o:pt:TvS:", long_options, + while ((optc = getopt_long (argc, argv, "bcCsDdg:m:o:pt:TvS:Z:", long_options, NULL)) != -1) { switch (optc) @@ -255,6 +472,9 @@ main (int argc, char **argv) break; case 'c': break; + case 'C': + copy_only_if_needed = true; + break; case 's': strip_files = true; #ifdef SIGCHLD @@ -262,6 +482,10 @@ main (int argc, char **argv) signal (SIGCHLD, SIG_DFL); #endif break; + case STRIP_PROGRAM_OPTION: + strip_program = xstrdup (optarg); + strip_program_specified = true; + break; case 'd': dir_arg = true; break; @@ -305,6 +529,31 @@ main (int argc, char **argv) case 'T': no_target_directory = true; break; + + case PRESERVE_CONTEXT_OPTION_DEPRECATED: + error (0, 0, _("WARNING: --preserve_context is deprecated; " + "use --preserve-context instead")); + /* fall through */ + case PRESERVE_CONTEXT_OPTION: + if ( ! selinux_enabled) + { + error (0, 0, _("WARNING: ignoring --preserve-context; " + "this kernel is not SELinux-enabled")); + break; + } + x.preserve_security_context = true; + use_default_selinux_context = false; + break; + case 'Z': + if ( ! selinux_enabled) + { + error (0, 0, _("WARNING: ignoring --context (-Z); " + "this kernel is not SELinux-enabled")); + break; + } + scontext = optarg; + use_default_selinux_context = false; + break; case_GETOPT_HELP_CHAR; case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS); default: @@ -320,6 +569,11 @@ main (int argc, char **argv) error (EXIT_FAILURE, 0, _("target directory not allowed when installing a directory")); + if (x.preserve_security_context && scontext != NULL) + error (EXIT_FAILURE, 0, + _("cannot force target context to %s and preserve it"), + quote (scontext)); + if (backup_suffix_string) simple_backup_suffix = xstrdup (backup_suffix_string); @@ -328,6 +582,11 @@ main (int argc, char **argv) version_control_string) : no_backups); + if (scontext && setfscreatecon (scontext) < 0) + error (EXIT_FAILURE, errno, + _("failed to set default file creation context to %s"), + quote (scontext)); + n_files = argc - optind; file = argv + optind; @@ -345,7 +604,7 @@ main (int argc, char **argv) { if (target_directory) error (EXIT_FAILURE, 0, - _("Cannot combine --target-directory (-t) " + _("cannot combine --target-directory (-t) " "and --no-target-directory (-T)")); if (2 < n_files) { @@ -372,6 +631,28 @@ main (int argc, char **argv) free (change); } + if (strip_program_specified && !strip_files) + error (0, 0, _("WARNING: ignoring --strip-program option as -s option was " + "not specified")); + + if (copy_only_if_needed && x.preserve_timestamps) + { + error (0, 0, _("options --compare (-C) and --preserve-timestamps are " + "mutually exclusive")); + usage (EXIT_FAILURE); + } + + if (copy_only_if_needed && strip_files) + { + error (0, 0, _("options --compare (-C) and --strip are mutually " + "exclusive")); + usage (EXIT_FAILURE); + } + + if (copy_only_if_needed && extra_mode (mode)) + error (0, 0, _("the --compare (-C) option is ignored when you" + " specify a mode with non-permission bits")); + get_ids (); if (dir_arg) @@ -488,6 +769,9 @@ copy_file (const char *from, const char *to, const struct cp_options *x) { bool copy_into_self; + if (copy_only_if_needed && !need_copy (from, to, x)) + return true; + /* Allow installing from non-regular files like /dev/null. Charles Karney reported that some Sun version of install allows that and that sendmail's installation process relies on the behavior. @@ -503,6 +787,7 @@ copy_file (const char *from, const char *to, const struct cp_options *x) static bool change_attributes (char const *name) { + bool ok = false; /* chown must precede chmod because on some systems, chown clears the set[ug]id bits for non-superusers, resulting in incorrect permissions. @@ -516,14 +801,17 @@ change_attributes (char const *name) want to know. */ if (! (owner_id == (uid_t) -1 && group_id == (gid_t) -1) - && chown (name, owner_id, group_id) != 0) + && lchown (name, owner_id, group_id) != 0) error (0, errno, _("cannot change ownership of %s"), quote (name)); else if (chmod (name, mode) != 0) error (0, errno, _("cannot change permissions of %s"), quote (name)); else - return true; + ok = true; - return false; + if (use_default_selinux_context) + setdefaultfilecon (name); + + return ok; } /* Set the timestamps of file TO to match those of file FROM. @@ -562,8 +850,8 @@ strip (char const *name) error (EXIT_FAILURE, errno, _("fork system call failed")); break; case 0: /* Child. */ - execlp ("strip", "strip", name, NULL); - error (EXIT_FAILURE, errno, _("cannot run strip")); + execlp (strip_program, strip_program, name, NULL); + error (EXIT_FAILURE, errno, _("cannot run %s"), strip_program); break; default: /* Parent. */ if (waitpid (pid, &status, 0) < 0) @@ -625,7 +913,7 @@ announce_mkdir (char const *dir, void *options) { struct cp_options const *x = options; if (x->verbose) - error (0, 0, _("creating directory %s"), quote (dir)); + prog_fprintf (stdout, _("creating directory %s"), quote (dir)); } /* Make ancestor directory DIR, whose last file name component is @@ -656,6 +944,12 @@ Usage: %s [OPTION]... [-T] SOURCE DEST\n\ "), program_name, program_name, program_name, program_name); fputs (_("\ +\n\ +This install program copies files (often just compiled) into destination\n\ +locations you choose. If you want to download and install a ready-to-use\n\ +package on a GNU/Linux system, you should instead be using a package manager\n\ +like yum(1) or apt-get(1).\n\ +\n\ In the first three forms, copy SOURCE to DEST or multiple SOURCE(s) to\n\ the existing DIRECTORY, while setting permission modes and owner/group.\n\ In the 4th form, create all components of the given DIRECTORY(ies).\n\ @@ -668,6 +962,8 @@ Mandatory arguments to long options are mandatory for short options too.\n\ --backup[=CONTROL] make a backup of each existing destination file\n\ -b like --backup but does not accept an argument\n\ -c (ignored)\n\ + -C, --compare compare each pair of source and destination files, and\n\ + in some cases, do not modify the destination at all\n\ -d, --directory treat all arguments as directory names; create all\n\ components of the specified directories\n\ "), stdout); @@ -682,11 +978,17 @@ Mandatory arguments to long options are mandatory for short options too.\n\ -p, --preserve-timestamps apply access/modification times of SOURCE files\n\ to corresponding destination files\n\ -s, --strip strip symbol tables\n\ + --strip-program=PROGRAM program used to strip binaries\n\ -S, --suffix=SUFFIX override the usual backup suffix\n\ -t, --target-directory=DIRECTORY copy all SOURCE arguments into DIRECTORY\n\ -T, --no-target-directory treat DEST as a normal file\n\ -v, --verbose print the name of each directory as it is created\n\ "), stdout); + fputs (_("\ + --preserve-context preserve SELinux security context\n\ + -Z, --context=CONTEXT set SELinux security context of files and directories\n\ +"), stdout); + fputs (HELP_OPTION_DESCRIPTION, stdout); fputs (VERSION_OPTION_DESCRIPTION, stdout); fputs (_("\ @@ -702,7 +1004,7 @@ the VERSION_CONTROL environment variable. Here are the values:\n\ existing, nil numbered if numbered backups exist, simple otherwise\n\ simple, never always make simple backups\n\ "), stdout); - printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT); + emit_bug_reporting_address (); } exit (status); } diff --git a/src/bin/coreutils/src/join.c b/src/bin/coreutils/src/join.c index b113c543b1..c71669893f 100644 --- a/src/bin/coreutils/src/join.c +++ b/src/bin/coreutils/src/join.c @@ -1,10 +1,10 @@ /* join - join lines of two files on a common field - Copyright (C) 91, 1995-2006 Free Software Foundation, Inc. + Copyright (C) 91, 1995-2006, 2008 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + along with this program. If not, see . Written by Mike Haertel, mike@gnu.ai.mit.edu. */ @@ -25,21 +24,27 @@ #include "system.h" #include "error.h" -#include "hard-locale.h" #include "linebuffer.h" #include "memcasecmp.h" #include "quote.h" #include "stdio--.h" #include "xmemcoll.h" #include "xstrtol.h" +#include "argmatch.h" /* The official name of this program (e.g., no `g' prefix). */ #define PROGRAM_NAME "join" -#define AUTHORS "Mike Haertel" +#define AUTHORS proper_name ("Mike Haertel") #define join system_join +#define SWAPLINES(a, b) do { \ + struct line *tmp = a; \ + a = b; \ + b = tmp; \ +} while (0); + /* An element of the list identifying which fields to print for each output line. */ struct outlist @@ -76,11 +81,16 @@ struct seq { size_t count; /* Elements used in `lines'. */ size_t alloc; /* Elements allocated in `lines'. */ - struct line *lines; + struct line **lines; }; -/* The name this program was run with. */ -char *program_name; +/* The previous line read from each file. */ +static struct line *prevline[2] = {NULL, NULL}; + +/* This provides an extra line buffer for each file. We need these if we + try to read two consecutive lines into the same buffer, since we don't + want to overwrite the previous buffer before we check order. */ +static struct line *spareline[2] = {NULL, NULL}; /* True if the LC_COLLATE locale is hard. */ static bool hard_LC_COLLATE; @@ -91,6 +101,12 @@ static bool print_unpairables_1, print_unpairables_2; /* If nonzero, print pairable lines. */ static bool print_pairables; +/* If nonzero, we have seen at least one unpairable line. */ +static bool seen_unpairable; + +/* If nonzero, we have warned about disorder in that file. */ +static bool issued_disorder_warning[2]; + /* Empty output field filler. */ static char const *empty_filler; @@ -109,9 +125,26 @@ static struct outlist *outlist_end = &outlist_head; tab character whose value (when cast to unsigned char) equals TAB. */ static int tab = -1; +/* If nonzero, check that the input is correctly ordered. */ +static enum + { + CHECK_ORDER_DEFAULT, + CHECK_ORDER_ENABLED, + CHECK_ORDER_DISABLED + } check_input_order; + +enum +{ + CHECK_ORDER_OPTION = CHAR_MAX + 1, + NOCHECK_ORDER_OPTION +}; + + static struct option const longopts[] = { {"ignore-case", no_argument, NULL, 'i'}, + {"check-order", no_argument, NULL, CHECK_ORDER_OPTION}, + {"nocheck-order", no_argument, NULL, NOCHECK_ORDER_OPTION}, {GETOPT_HELP_OPTION_DECL}, {GETOPT_VERSION_OPTION_DECL}, {NULL, 0, NULL, 0} @@ -154,6 +187,9 @@ by whitespace. When FILE1 or FILE2 (not both) is -, read standard input.\n\ -v FILENUM like -a FILENUM, but suppress joined output lines\n\ -1 FIELD join on this FIELD of file 1\n\ -2 FIELD join on this FIELD of file 2\n\ + --check-order check that the input is correctly sorted, even\n\ + if all input lines are pairable\n\ + --nocheck-order do not check that the input is correctly sorted\n\ "), stdout); fputs (HELP_OPTION_DESCRIPTION, stdout); fputs (VERSION_OPTION_DESCRIPTION, stdout); @@ -168,8 +204,11 @@ separated by CHAR.\n\ \n\ Important: FILE1 and FILE2 must be sorted on the join fields.\n\ E.g., use `sort -k 1b,1' if `join' has no options.\n\ +Note, comparisons honor the rules specified by `LC_COLLATE'.\n\ +If the input is not sorted and some lines cannot be joined, a\n\ +warning message will be given.\n\ "), stdout); - printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT); + emit_bug_reporting_address (); } exit (status); } @@ -229,30 +268,6 @@ xfields (struct line *line) extract_field (line, ptr, lim - ptr); } -/* Read a line from FP into LINE and split it into fields. - Return true if successful. */ - -static bool -get_line (FILE *fp, struct line *line) -{ - initbuffer (&line->buf); - - if (! readlinebuffer (&line->buf, fp)) - { - if (ferror (fp)) - error (EXIT_FAILURE, errno, _("read error")); - free (line->buf.buffer); - line->buf.buffer = NULL; - return false; - } - - line->nfields_allocated = 0; - line->nfields = 0; - line->fields = NULL; - xfields (line); - return true; -} - static void freeline (struct line *line) { @@ -261,46 +276,14 @@ freeline (struct line *line) line->buf.buffer = NULL; } -static void -initseq (struct seq *seq) -{ - seq->count = 0; - seq->alloc = 0; - seq->lines = NULL; -} - -/* Read a line from FP and add it to SEQ. Return true if successful. */ - -static bool -getseq (FILE *fp, struct seq *seq) -{ - if (seq->count == seq->alloc) - seq->lines = X2NREALLOC (seq->lines, &seq->alloc); - - if (get_line (fp, &seq->lines[seq->count])) - { - ++seq->count; - return true; - } - return false; -} - -static void -delseq (struct seq *seq) -{ - size_t i; - for (i = 0; i < seq->count; i++) - if (seq->lines[i].buf.buffer) - freeline (&seq->lines[i]); - free (seq->lines); -} - /* Return <0 if the join field in LINE1 compares less than the one in LINE2; >0 if it compares greater; 0 if it compares equal. - Report an error and exit if the comparison fails. */ + Report an error and exit if the comparison fails. + Use join fields JF_1 and JF_2 respectively. */ static int -keycmp (struct line const *line1, struct line const *line2) +keycmp (struct line const *line1, struct line const *line2, + size_t jf_1, size_t jf_2) { /* Start of field to compare in each file. */ char *beg1; @@ -310,10 +293,10 @@ keycmp (struct line const *line1, struct line const *line2) size_t len2; /* Length of fields to compare. */ int diff; - if (join_field_1 < line1->nfields) + if (jf_1 < line1->nfields) { - beg1 = line1->fields[join_field_1].beg; - len1 = line1->fields[join_field_1].len; + beg1 = line1->fields[jf_1].beg; + len1 = line1->fields[jf_1].len; } else { @@ -321,10 +304,10 @@ keycmp (struct line const *line1, struct line const *line2) len1 = 0; } - if (join_field_2 < line2->nfields) + if (jf_2 < line2->nfields) { - beg2 = line2->fields[join_field_2].beg; - len2 = line2->fields[join_field_2].len; + beg2 = line2->fields[jf_2].beg; + len2 = line2->fields[jf_2].len; } else { @@ -355,6 +338,163 @@ keycmp (struct line const *line1, struct line const *line2) return len1 < len2 ? -1 : len1 != len2; } +/* Check that successive input lines PREV and CURRENT from input file + WHATFILE are presented in order, unless the user may be relying on + the GNU extension that input lines may be out of order if no input + lines are unpairable. + + If the user specified --nocheck-order, the check is not made. + If the user specified --check-order, the problem is fatal. + Otherwise (the default), the message is simply a warning. + + A message is printed at most once per input file. */ + +static void +check_order (const struct line *prev, + const struct line *current, + int whatfile) +{ + if (check_input_order != CHECK_ORDER_DISABLED + && ((check_input_order == CHECK_ORDER_ENABLED) || seen_unpairable)) + { + if (!issued_disorder_warning[whatfile-1]) + { + size_t join_field = whatfile == 1 ? join_field_1 : join_field_2; + if (keycmp (prev, current, join_field, join_field) > 0) + { + error ((check_input_order == CHECK_ORDER_ENABLED + ? EXIT_FAILURE : 0), + 0, _("file %d is not in sorted order"), whatfile); + + /* If we get to here, the message was just a warning, but we + want only to issue it once. */ + issued_disorder_warning[whatfile-1] = true; + } + } + } +} + +static inline void +reset_line (struct line *line) +{ + line->nfields = 0; +} + +static struct line * +init_linep (struct line **linep) +{ + struct line *line = xmalloc (sizeof *line); + memset (line, '\0', sizeof *line); + *linep = line; + return line; +} + +/* Read a line from FP into LINE and split it into fields. + Return true if successful. */ + +static bool +get_line (FILE *fp, struct line **linep, int which) +{ + struct line *line = *linep; + + if (line == prevline[which - 1]) + { + SWAPLINES (line, spareline[which - 1]); + *linep = line; + } + + if (line) + reset_line (line); + else + line = init_linep (linep); + + if (! readlinebuffer (&line->buf, fp)) + { + if (ferror (fp)) + error (EXIT_FAILURE, errno, _("read error")); + freeline (line); + return false; + } + + xfields (line); + + if (prevline[which - 1]) + check_order (prevline[which - 1], line, which); + + prevline[which - 1] = line; + return true; +} + +static void +free_spareline (void) +{ + size_t i; + + for (i = 0; i < ARRAY_CARDINALITY (spareline); i++) + { + if (spareline[i]) + { + freeline (spareline[i]); + free (spareline[i]); + } + } +} + +static void +initseq (struct seq *seq) +{ + seq->count = 0; + seq->alloc = 0; + seq->lines = NULL; +} + +/* Read a line from FP and add it to SEQ. Return true if successful. */ + +static bool +getseq (FILE *fp, struct seq *seq, int whichfile) +{ + if (seq->count == seq->alloc) + { + size_t i; + seq->lines = X2NREALLOC (seq->lines, &seq->alloc); + for (i = seq->count; i < seq->alloc; i++) + seq->lines[i] = NULL; + } + + if (get_line (fp, &seq->lines[seq->count], whichfile)) + { + ++seq->count; + return true; + } + return false; +} + +/* Read a line from FP and add it to SEQ, as the first item if FIRST is + true, else as the next. */ +static bool +advance_seq (FILE *fp, struct seq *seq, bool first, int whichfile) +{ + if (first) + seq->count = 0; + + return getseq (fp, seq, whichfile); +} + +static void +delseq (struct seq *seq) +{ + size_t i; + for (i = 0; i < seq->alloc; i++) + if (seq->lines[i]) + { + if (seq->lines[i]->buf.buffer) + freeline (seq->lines[i]); + free (seq->lines[i]); + } + free (seq->lines); +} + + /* Print field N of LINE if it exists and is nonempty, otherwise `empty_filler' if it is nonempty. */ @@ -463,36 +603,37 @@ static void join (FILE *fp1, FILE *fp2) { struct seq seq1, seq2; - struct line line; + struct line **linep = xmalloc (sizeof *linep); int diff; - bool eof1, eof2; + bool eof1, eof2, checktail; + + *linep = NULL; /* Read the first line of each file. */ initseq (&seq1); - getseq (fp1, &seq1); + getseq (fp1, &seq1, 1); initseq (&seq2); - getseq (fp2, &seq2); + getseq (fp2, &seq2, 2); while (seq1.count && seq2.count) { size_t i; - diff = keycmp (&seq1.lines[0], &seq2.lines[0]); + diff = keycmp (seq1.lines[0], seq2.lines[0], + join_field_1, join_field_2); if (diff < 0) { if (print_unpairables_1) - prjoin (&seq1.lines[0], &uni_blank); - freeline (&seq1.lines[0]); - seq1.count = 0; - getseq (fp1, &seq1); + prjoin (seq1.lines[0], &uni_blank); + advance_seq (fp1, &seq1, true, 1); + seen_unpairable = true; continue; } if (diff > 0) { if (print_unpairables_2) - prjoin (&uni_blank, &seq2.lines[0]); - freeline (&seq2.lines[0]); - seq2.count = 0; - getseq (fp2, &seq2); + prjoin (&uni_blank, seq2.lines[0]); + advance_seq (fp2, &seq2, true, 2); + seen_unpairable = true; continue; } @@ -500,25 +641,27 @@ join (FILE *fp1, FILE *fp2) match the current line from file2. */ eof1 = false; do - if (!getseq (fp1, &seq1)) + if (!advance_seq (fp1, &seq1, false, 1)) { eof1 = true; ++seq1.count; break; } - while (!keycmp (&seq1.lines[seq1.count - 1], &seq2.lines[0])); + while (!keycmp (seq1.lines[seq1.count - 1], seq2.lines[0], + join_field_1, join_field_2)); /* Keep reading lines from file2 as long as they continue to match the current line from file1. */ eof2 = false; do - if (!getseq (fp2, &seq2)) + if (!advance_seq (fp2, &seq2, false, 2)) { eof2 = true; ++seq2.count; break; } - while (!keycmp (&seq1.lines[0], &seq2.lines[seq2.count - 1])); + while (!keycmp (seq1.lines[0], seq2.lines[seq2.count - 1], + join_field_1, join_field_2)); if (print_pairables) { @@ -526,53 +669,68 @@ join (FILE *fp1, FILE *fp2) { size_t j; for (j = 0; j < seq2.count - 1; ++j) - prjoin (&seq1.lines[i], &seq2.lines[j]); + prjoin (seq1.lines[i], seq2.lines[j]); } } - for (i = 0; i < seq1.count - 1; ++i) - freeline (&seq1.lines[i]); if (!eof1) { - seq1.lines[0] = seq1.lines[seq1.count - 1]; + SWAPLINES (seq1.lines[0], seq1.lines[seq1.count - 1]); seq1.count = 1; } else seq1.count = 0; - for (i = 0; i < seq2.count - 1; ++i) - freeline (&seq2.lines[i]); if (!eof2) { - seq2.lines[0] = seq2.lines[seq2.count - 1]; + SWAPLINES (seq2.lines[0], seq2.lines[seq2.count - 1]); seq2.count = 1; } else seq2.count = 0; } - if (print_unpairables_1 && seq1.count) + /* If the user did not specify --check-order, and the we read the + tail ends of both inputs to verify that they are in order. We + skip the rest of the tail once we have issued a warning for that + file, unless we actually need to print the unpairable lines. */ + if (check_input_order != CHECK_ORDER_DISABLED + && !(issued_disorder_warning[0] && issued_disorder_warning[1])) + checktail = true; + else + checktail = false; + + if ((print_unpairables_1 || checktail) && seq1.count) { - prjoin (&seq1.lines[0], &uni_blank); - freeline (&seq1.lines[0]); - while (get_line (fp1, &line)) + if (print_unpairables_1) + prjoin (seq1.lines[0], &uni_blank); + seen_unpairable = true; + while (get_line (fp1, linep, 1)) { - prjoin (&line, &uni_blank); - freeline (&line); + if (print_unpairables_1) + prjoin (*linep, &uni_blank); + if (issued_disorder_warning[0] && !print_unpairables_1) + break; } } - if (print_unpairables_2 && seq2.count) + if ((print_unpairables_2 || checktail) && seq2.count) { - prjoin (&uni_blank, &seq2.lines[0]); - freeline (&seq2.lines[0]); - while (get_line (fp2, &line)) + if (print_unpairables_2) + prjoin (&uni_blank, seq2.lines[0]); + seen_unpairable = true; + while (get_line (fp2, linep, 2)) { - prjoin (&uni_blank, &line); - freeline (&line); + if (print_unpairables_2) + prjoin (&uni_blank, *linep); + if (issued_disorder_warning[1] && !print_unpairables_2) + break; } } + free (*linep); + + free (linep); delseq (&seq1); delseq (&seq2); } @@ -781,15 +939,19 @@ main (int argc, char **argv) int i; initialize_main (&argc, &argv); - program_name = argv[0]; + set_program_name (argv[0]); setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); hard_LC_COLLATE = hard_locale (LC_COLLATE); atexit (close_stdout); + atexit (free_spareline); print_pairables = true; + seen_unpairable = false; + issued_disorder_warning[0] = issued_disorder_warning[1] = false; + check_input_order = CHECK_ORDER_DEFAULT; while ((optc = getopt_long (argc, argv, "-a:e:i1:2:j:o:t:v:", longopts, NULL)) @@ -876,6 +1038,14 @@ main (int argc, char **argv) } break; + case NOCHECK_ORDER_OPTION: + check_input_order = CHECK_ORDER_DISABLED; + break; + + case CHECK_ORDER_OPTION: + check_input_order = CHECK_ORDER_ENABLED; + break; + case 1: /* Non-option argument. */ add_file_name (optarg, names, operand_status, joption_count, &nfiles, &prev_optc_status, &optc_status); @@ -936,5 +1106,8 @@ main (int argc, char **argv) if (fclose (fp2) != 0) error (EXIT_FAILURE, errno, "%s", names[1]); - exit (EXIT_SUCCESS); + if (issued_disorder_warning[0] || issued_disorder_warning[1]) + exit (EXIT_FAILURE); + else + exit (EXIT_SUCCESS); } diff --git a/src/bin/coreutils/src/kill.c b/src/bin/coreutils/src/kill.c index c59025fa04..52cf5dad46 100644 --- a/src/bin/coreutils/src/kill.c +++ b/src/bin/coreutils/src/kill.c @@ -1,10 +1,10 @@ /* kill -- send a signal to a process - Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 2002, 2003, 2004, 2005, 2008 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Paul Eggert. */ @@ -36,11 +35,12 @@ #include "system.h" #include "error.h" #include "sig2str.h" +#include "operand2sig.h" /* The official name of this program (e.g., no `g' prefix). */ #define PROGRAM_NAME "kill" -#define AUTHORS "Paul Eggert" +#define AUTHORS proper_name ("Paul Eggert") #if ! (HAVE_DECL_STRSIGNAL || defined strsignal) # if ! (HAVE_DECL_SYS_SIGLIST || defined sys_siglist) @@ -60,9 +60,6 @@ # endif #endif -/* The name this program was run with, for error messages. */ -char *program_name; - static char const short_options[] = "0::1::2::3::4::5::6::7::8::9::" "A::B::C::D::E::F::G::H::I::J::K::L::M::" @@ -110,61 +107,15 @@ Mandatory arguments to long options are mandatory for short options too.\n\ fputs (VERSION_OPTION_DESCRIPTION, stdout); fputs (_("\n\ SIGNAL may be a signal name like `HUP', or a signal number like `1',\n\ -or an exit status of a process terminated by a signal.\n\ +or the exit status of a process terminated by a signal.\n\ PID is an integer; if negative it identifies a process group.\n\ "), stdout); printf (USAGE_BUILTIN_WARNING, PROGRAM_NAME); - printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT); + emit_bug_reporting_address (); } exit (status); } -/* Convert OPERAND to a signal number with printable representation SIGNAME. - Return the signal number, or -1 if unsuccessful. */ - -static int -operand2sig (char const *operand, char *signame) -{ - int signum; - - if (ISDIGIT (*operand)) - { - char *endp; - long int l = (errno = 0, strtol (operand, &endp, 10)); - int i = l; - signum = (operand == endp || *endp || errno || i != l ? -1 - : WIFSIGNALED (i) ? WTERMSIG (i) - : i); - } - else - { - /* Convert signal to upper case in the C locale, not in the - current locale. Don't assume ASCII; it might be EBCDIC. */ - char *upcased = xstrdup (operand); - char *p; - for (p = upcased; *p; p++) - if (strchr ("abcdefghijklmnopqrstuvwxyz", *p)) - *p += 'A' - 'a'; - - /* Look for the signal name, possibly prefixed by "SIG", - and possibly lowercased. */ - if (! (str2sig (upcased, &signum) == 0 - || (upcased[0] == 'S' && upcased[1] == 'I' && upcased[2] == 'G' - && str2sig (upcased + 3, &signum) == 0))) - signum = -1; - - free (upcased); - } - - if (signum < 0 || sig2str (signum, signame) != 0) - { - error (0, 0, _("%s: invalid signal"), operand); - return -1; - } - - return signum; -} - /* Print a row of `kill -t' output. NUM_WIDTH is the maximum signal number width, and SIGNUM is the signal number to print. The maximum name width is NAME_WIDTH, and SIGNAME is the name to print. */ @@ -287,7 +238,7 @@ main (int argc, char **argv) char signame[SIG2STR_MAX]; initialize_main (&argc, &argv); - program_name = argv[0]; + set_program_name (argv[0]); setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); diff --git a/src/bin/coreutils/src/link.c b/src/bin/coreutils/src/link.c index 277cf23524..d155291f0b 100644 --- a/src/bin/coreutils/src/link.c +++ b/src/bin/coreutils/src/link.c @@ -1,10 +1,10 @@ /* link utility for GNU. - Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc. + Copyright (C) 2001, 2002, 2004, 2007-2008 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Michael Stone */ @@ -34,10 +33,7 @@ /* The official name of this program (e.g., no `g' prefix). */ #define PROGRAM_NAME "link" -#define AUTHORS "Michael Stone" - -/* Name this program was run with. */ -char *program_name; +#define AUTHORS proper_name ("Michael Stone") void usage (int status) @@ -55,7 +51,7 @@ Usage: %s FILE1 FILE2\n\ stdout); fputs (HELP_OPTION_DESCRIPTION, stdout); fputs (VERSION_OPTION_DESCRIPTION, stdout); - printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT); + emit_bug_reporting_address (); } exit (status); } @@ -64,14 +60,14 @@ int main (int argc, char **argv) { initialize_main (&argc, &argv); - program_name = argv[0]; + set_program_name (argv[0]); setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); atexit (close_stdout); - parse_long_options (argc, argv, PROGRAM_NAME, GNU_PACKAGE, VERSION, + parse_long_options (argc, argv, PROGRAM_NAME, PACKAGE_NAME, Version, usage, AUTHORS, (char const *) NULL); if (getopt_long (argc, argv, "", NULL, NULL) != -1) usage (EXIT_FAILURE); diff --git a/src/bin/coreutils/src/ln.c b/src/bin/coreutils/src/ln.c index fae370807b..d0f92669de 100644 --- a/src/bin/coreutils/src/ln.c +++ b/src/bin/coreutils/src/ln.c @@ -1,10 +1,10 @@ /* `ln' program to create links between files. - Copyright (C) 1986, 1989-1991, 1995-2006 Free Software Foundation, Inc. + Copyright (C) 1986, 1989-1991, 1995-2009 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Mike Parker and David MacKenzie. */ @@ -23,17 +22,22 @@ #include #include "system.h" -#include "same.h" #include "backupfile.h" #include "error.h" #include "filenamecat.h" +#include "file-set.h" +#include "hash.h" +#include "hash-triple.h" #include "quote.h" +#include "same.h" #include "yesno.h" /* The official name of this program (e.g., no `g' prefix). */ #define PROGRAM_NAME "ln" -#define AUTHORS "Mike Parker", "David MacKenzie" +#define AUTHORS \ + proper_name ("Mike Parker"), \ + proper_name ("David MacKenzie") #ifndef ENABLE_HARD_LINK_TO_SYMLINK_WARNING # define ENABLE_HARD_LINK_TO_SYMLINK_WARNING 0 @@ -53,9 +57,6 @@ lstat (File, Stat_buf) #endif -/* The name by which the program was run, for error messages. */ -char *program_name; - /* FIXME: document */ static enum backup_type backup_type; @@ -83,6 +84,15 @@ static bool hard_dir_link; symlink-to-dir before creating the new link. */ static bool dereference_dest_dir_symlinks = true; +/* This is a set of destination name/inode/dev triples for hard links + created by ln. Use this data structure to avoid data loss via a + sequence of commands like this: + rm -rf a b c; mkdir a b c; touch a/f b/f; ln -f a/f b/f c && rm -r a b */ +static Hash_table *dest_set; + +/* Initial size of the dest_set hash table. */ +enum { DEST_INFO_INITIAL_CAPACITY = 61 }; + static struct option const long_options[] = { {"backup", optional_argument, NULL, 'b'}, @@ -179,6 +189,18 @@ do_link (const char *source, const char *dest) } } + /* If the current target was created as a hard link to another + source file, then refuse to unlink it. */ + if (dest_lstat_ok + && dest_set != NULL + && seen_file (dest_set, dest, &dest_stats)) + { + error (0, 0, + _("will not overwrite just-created %s with %s"), + quote_n (0, dest), quote_n (1, source)); + return false; + } + /* If --force (-f) has been specified without --backup, then before making a link ln must remove the destination file if it exists. (with --backup, it just renames any existing destination file) @@ -279,6 +301,10 @@ do_link (const char *source, const char *dest) if (ok) { + /* Right after creating a hard link, do this: (note dest name and + source_stats, which are also the just-linked-destinations stats) */ + record_file (dest_set, dest, &source_stats); + if (verbose) { if (dest_backup) @@ -333,7 +359,9 @@ In the 1st form, create a link to TARGET with the name LINK_NAME.\n\ In the 2nd form, create a link to TARGET in the current directory.\n\ In the 3rd and 4th forms, create links to each TARGET in DIRECTORY.\n\ Create hard links by default, symbolic links with --symbolic.\n\ -When creating hard links, each TARGET must exist.\n\ +When creating hard links, each TARGET must exist. Symbolic links\n\ +can hold arbitrary text; if later resolved, a relative link is\n\ +interpreted in relation to its parent directory.\n\ \n\ "), stdout); fputs (_("\ @@ -375,7 +403,7 @@ the VERSION_CONTROL environment variable. Here are the values:\n\ existing, nil numbered if numbered backups exist, simple otherwise\n\ simple, never always make simple backups\n\ "), stdout); - printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT); + emit_bug_reporting_address (); } exit (status); } @@ -394,12 +422,12 @@ main (int argc, char **argv) char **file; initialize_main (&argc, &argv); - program_name = argv[0]; + set_program_name (argv[0]); setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); - atexit (close_stdout); + atexit (close_stdin); /* FIXME: consider not calling getenv for SIMPLE_BACKUP_SUFFIX unless we'll actually use backup_suffix_string. */ @@ -481,7 +509,7 @@ main (int argc, char **argv) { if (target_directory) error (EXIT_FAILURE, 0, - _("Cannot combine --target-directory " + _("cannot combine --target-directory " "and --no-target-directory")); if (n_files != 2) { @@ -515,6 +543,29 @@ main (int argc, char **argv) if (target_directory) { int i; + + /* Create the data structure we'll use to record which hard links we + create. Used to ensure that ln detects an obscure corner case that + might result in user data loss. Create it only if needed. */ + if (2 <= n_files + && remove_existing_files + /* Don't bother trying to protect symlinks, since ln clobbering + a just-created symlink won't ever lead to real data loss. */ + && ! symbolic_link + /* No destination hard link can be clobbered when making + numbered backups. */ + && backup_type != numbered_backups) + + { + dest_set = hash_initialize (DEST_INFO_INITIAL_CAPACITY, + NULL, + triple_hash, + triple_compare, + triple_free); + if (dest_set == NULL) + xalloc_die (); + } + ok = true; for (i = 0; i < n_files; ++i) { diff --git a/src/bin/coreutils/src/logname.c b/src/bin/coreutils/src/logname.c index dc82967164..9cf0d9fae0 100644 --- a/src/bin/coreutils/src/logname.c +++ b/src/bin/coreutils/src/logname.c @@ -1,10 +1,10 @@ /* logname -- print user's login name - Copyright (C) 1990-1997, 1999-2005 Free Software Foundation, Inc. + Copyright (C) 1990-1997, 1999-2005, 2007-2008 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ #include #include @@ -28,10 +27,7 @@ /* The official name of this program (e.g., no `g' prefix). */ #define PROGRAM_NAME "logname" -#define AUTHORS "FIXME: unknown" - -/* The name this program was run with. */ -char *program_name; +#define AUTHORS proper_name ("FIXME: unknown") void usage (int status) @@ -48,7 +44,7 @@ Print the name of the current user.\n\ "), stdout); fputs (HELP_OPTION_DESCRIPTION, stdout); fputs (VERSION_OPTION_DESCRIPTION, stdout); - printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT); + emit_bug_reporting_address (); } exit (status); } @@ -59,14 +55,14 @@ main (int argc, char **argv) char *cp; initialize_main (&argc, &argv); - program_name = argv[0]; + set_program_name (argv[0]); setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); atexit (close_stdout); - parse_long_options (argc, argv, PROGRAM_NAME, GNU_PACKAGE, VERSION, + parse_long_options (argc, argv, PROGRAM_NAME, PACKAGE_NAME, Version, usage, AUTHORS, (char const *) NULL); if (getopt_long (argc, argv, "", NULL, NULL) != -1) usage (EXIT_FAILURE); diff --git a/src/bin/coreutils/src/ls.c b/src/bin/coreutils/src/ls.c index c9764e1040..79d35dca08 100644 --- a/src/bin/coreutils/src/ls.c +++ b/src/bin/coreutils/src/ls.c @@ -1,10 +1,10 @@ /* `dir', `vdir' and `ls' directory listing programs for GNU. - Copyright (C) 85, 88, 90, 91, 1995-2007 Free Software Foundation, Inc. + Copyright (C) 85, 88, 90, 91, 1995-2009 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* If ls_mode is LS_MULTI_COL, the multi-column format is the default regardless @@ -39,6 +38,10 @@ #include #include +#ifdef HAVE_CAP +# include +#endif + #if HAVE_TERMIOS_H # include #endif @@ -61,6 +64,12 @@ #include #include #include +#include +#include + +#if HAVE_LANGINFO_CODESET +# include +#endif /* Use SA_NOCLDSTOP as a proxy for whether the sigaction machinery is present. */ @@ -82,16 +91,14 @@ #include "acl.h" #include "argmatch.h" #include "dev-ino.h" -#include "dirfd.h" #include "error.h" #include "filenamecat.h" -#include "hard-locale.h" #include "hash.h" #include "human.h" #include "filemode.h" -#include "inttostr.h" +#include "filevercmp.h" +#include "idcache.h" #include "ls.h" -#include "lstat.h" #include "mbswidth.h" #include "mpsort.h" #include "obstack.h" @@ -100,16 +107,17 @@ #include "same.h" #include "stat-time.h" #include "strftime.h" -#include "strverscmp.h" -#include "wcwidth.h" #include "xstrtol.h" -#include "xreadlink.h" +#include "areadlink.h" +#include "mbsalign.h" #define PROGRAM_NAME (ls_mode == LS_LS ? "ls" \ : (ls_mode == LS_MULTI_COL \ ? "dir" : "vdir")) -#define AUTHORS "Richard Stallman", "David MacKenzie" +#define AUTHORS \ + proper_name ("Richard M. Stallman"), \ + proper_name ("David MacKenzie") #define obstack_chunk_alloc malloc #define obstack_chunk_free free @@ -150,6 +158,12 @@ verify (sizeof filetype_letter - 1 == arg_directory + 1); C_LINK, C_SOCK, C_FILE, C_DIR \ } +enum acl_type + { + ACL_T_NONE, + ACL_T_SELINUX_ONLY, + ACL_T_YES + }; struct fileinfo { @@ -167,24 +181,20 @@ struct fileinfo zero. */ mode_t linkmode; + /* SELinux security context. */ + security_context_t scontext; + bool stat_ok; /* For symbolic link and color printing, true if linked-to file exists, otherwise false. */ bool linkok; -#if USE_ACL - /* For long listings, true if the file has an access control list. */ - bool have_acl; -#endif + /* For long listings, true if the file has an access control list, + or an SELinux security context. */ + enum acl_type acl_type; }; -#if USE_ACL -# define FILE_HAS_ACL(F) ((F)->have_acl) -#else -# define FILE_HAS_ACL(F) 0 -#endif - #define LEN_STR_PAIR(s) sizeof (s) - 1, s /* Null is a valid character in a color indicator (think about Epson @@ -197,9 +207,6 @@ struct bin_str const char *string; /* Pointer to the same */ }; -char *getgroup (); -char *getuser (); - #if ! HAVE_TCGETPGRP # define tcgetpgrp(Fd) 0 #endif @@ -213,8 +220,9 @@ static bool file_ignored (char const *name); static uintmax_t gobble_file (char const *name, enum filetype type, ino_t inode, bool command_line_arg, char const *dirname); -static void print_color_indicator (const char *name, mode_t mode, int linkok, - bool stat_ok, enum filetype type); +static bool print_color_indicator (const char *name, mode_t mode, int linkok, + bool stat_ok, enum filetype type, + nlink_t nlink); static void put_indicator (const struct bin_str *ind); static void add_ignore_pattern (const char *pattern); static void attach (char *dest, const char *dirname, const char *name); @@ -228,18 +236,21 @@ static size_t calculate_columns (bool by_columns); static void print_current_files (void); static void print_dir (char const *name, char const *realname, bool command_line_arg); -static void print_file_name_and_frills (const struct fileinfo *f); +static size_t print_file_name_and_frills (const struct fileinfo *f, + size_t start_col); static void print_horizontal (void); static int format_user_width (uid_t u); static int format_group_width (gid_t g); static void print_long_format (const struct fileinfo *f); static void print_many_per_line (void); -static void print_name_with_quoting (const char *p, mode_t mode, - int linkok, bool stat_ok, - enum filetype type, - struct obstack *stack); +static size_t print_name_with_quoting (const char *p, mode_t mode, + int linkok, bool stat_ok, + enum filetype type, + struct obstack *stack, + nlink_t nlink, + size_t start_col); static void prep_non_filename_text (void); -static void print_type_indicator (bool stat_ok, mode_t mode, +static bool print_type_indicator (bool stat_ok, mode_t mode, enum filetype type); static void print_with_commas (void); static void queue_directory (char const *name, char const *realname, @@ -248,9 +259,6 @@ static void sort_files (void); static void parse_ls_color (void); void usage (int status); -/* The name this program was run with. */ -char *program_name; - /* Initial size of hash table. Most hierarchies are likely to be shallower than this. */ #define INITIAL_TABLE_SIZE 30 @@ -317,17 +325,15 @@ static struct pending *pending_dirs; /* Current time in seconds and nanoseconds since 1970, updated as needed when deciding whether a file is recent. */ -static time_t current_time = TYPE_MINIMUM (time_t); -static int current_time_ns = -1; +static struct timespec current_time; + +static bool print_scontext; +static char UNKNOWN_SECURITY_CONTEXT[] = "?"; /* Whether any of the files has an ACL. This affects the width of the mode column. */ -#if USE_ACL static bool any_has_acl; -#else -enum { any_has_acl = false }; -#endif /* The number of columns to use for columns containing inode numbers, block sizes, link counts, owners, groups, authors, major device @@ -336,6 +342,7 @@ enum { any_has_acl = false }; static int inode_number_width; static int block_size_width; static int nlink_width; +static int scontext_width; static int owner_width; static int group_width; static int author_width; @@ -495,6 +502,12 @@ ARGMATCH_VERIFY (indicator_style_args, indicator_style_types); static bool print_with_color; +/* Whether we used any colors in the output so far. If so, we will + need to restore the default color later. If not, we will need to + call prep_non_filename_text before using color for the first time. */ + +static bool used_color = false; + enum color_type { color_never, /* 0: default or --color=never */ @@ -513,16 +526,18 @@ enum Dereference_symlink enum indicator_no { - C_LEFT, C_RIGHT, C_END, C_NORM, C_FILE, C_DIR, C_LINK, C_FIFO, C_SOCK, + C_LEFT, C_RIGHT, C_END, C_RESET, C_NORM, C_FILE, C_DIR, C_LINK, + C_FIFO, C_SOCK, C_BLK, C_CHR, C_MISSING, C_ORPHAN, C_EXEC, C_DOOR, C_SETUID, C_SETGID, - C_STICKY, C_OTHER_WRITABLE, C_STICKY_OTHER_WRITABLE + C_STICKY, C_OTHER_WRITABLE, C_STICKY_OTHER_WRITABLE, C_CAP, C_HARDLINK, + C_CLR_TO_EOL }; static const char *const indicator_name[]= { - "lc", "rc", "ec", "no", "fi", "di", "ln", "pi", "so", + "lc", "rc", "ec", "rs", "no", "fi", "di", "ln", "pi", "so", "bd", "cd", "mi", "or", "ex", "do", "su", "sg", "st", - "ow", "tw", NULL + "ow", "tw", "ca", "hl", "cl", NULL }; struct color_ext_type @@ -537,8 +552,9 @@ static struct bin_str color_indicator[] = { LEN_STR_PAIR ("\033[") }, /* lc: Left of color sequence */ { LEN_STR_PAIR ("m") }, /* rc: Right of color sequence */ { 0, NULL }, /* ec: End color (replaces lc+no+rc) */ - { LEN_STR_PAIR ("0") }, /* no: Normal */ - { LEN_STR_PAIR ("0") }, /* fi: File: default */ + { LEN_STR_PAIR ("0") }, /* rs: Reset to ordinary colors */ + { 0, NULL }, /* no: Normal */ + { 0, NULL }, /* fi: File: default */ { LEN_STR_PAIR ("01;34") }, /* di: Directory: bright blue */ { LEN_STR_PAIR ("01;36") }, /* ln: Symlink: bright cyan */ { LEN_STR_PAIR ("33") }, /* pi: Pipe: yellow/brown */ @@ -554,6 +570,9 @@ static struct bin_str color_indicator[] = { LEN_STR_PAIR ("37;44") }, /* st: sticky: black on blue */ { LEN_STR_PAIR ("34;42") }, /* ow: other-writable: blue on green */ { LEN_STR_PAIR ("30;42") }, /* tw: ow w/ sticky: black on green */ + { LEN_STR_PAIR ("30;41") }, /* ca: black on red */ + { LEN_STR_PAIR ("44;37") }, /* hl: white on blue */ + { LEN_STR_PAIR ("\033[K") }, /* cl: clear to end of line */ }; /* FIXME: comment */ @@ -686,6 +705,11 @@ static char const *long_time_format[2] = screen columns small, because many people work in windows with only 80 columns. But make this as wide as the other string below, for recent files. */ + /* TRANSLATORS: ls output needs to be aligned for ease of reading, + so be wary of using variable width fields from the locale. + Note %b is handled specially by ls and aligned correctly. + Note also that specifying a width as in %5b is erroneous as strftime + will count bytes rather than characters in multibyte locales. */ N_("%b %e %Y"), /* strftime format for recent files (younger than 6 months), in -l output. This should contain the month, day and time (at @@ -694,6 +718,11 @@ static char const *long_time_format[2] = screen columns small, because many people work in windows with only 80 columns. But make this as wide as the other string above, for non-recent files. */ + /* TRANSLATORS: ls output needs to be aligned for ease of reading, + so be wary of using variable width fields from the locale. + Note %b is handled specially by ls and aligned correctly. + Note also that specifying a width as in %5b is erroneous as strftime + will count bytes rather than characters in multibyte locales. */ N_("%b %e %H:%M") }; @@ -716,11 +745,14 @@ static int exit_status; /* Exit statuses. */ enum { - /* "ls" had a minor problem (e.g., it could not stat a directory - entry). */ + /* "ls" had a minor problem. E.g., while processing a directory, + ls obtained the name of an entry via readdir, yet was later + unable to stat that name. This happens when listing a directory + in which entries are actively being removed or renamed. */ LS_MINOR_PROBLEM = 1, - /* "ls" had more serious trouble. */ + /* "ls" had more serious trouble (e.g., memory exhausted, invalid + option or failure to stat a command line argument. */ LS_FAILURE = 2 }; @@ -738,10 +770,6 @@ enum GROUP_DIRECTORIES_FIRST_OPTION, HIDE_OPTION, INDICATOR_STYLE_OPTION, - - /* FIXME: --kilobytes is deprecated (but not -k); remove in late 2006 */ - KILOBYTES_LONG_OPTION, - QUOTING_STYLE_OPTION, SHOW_CONTROL_CHARS_OPTION, SI_OPTION, @@ -761,7 +789,6 @@ static struct option const long_options[] = GROUP_DIRECTORIES_FIRST_OPTION}, {"human-readable", no_argument, NULL, 'h'}, {"inode", no_argument, NULL, 'i'}, - {"kilobytes", no_argument, NULL, KILOBYTES_LONG_OPTION}, {"numeric-uid-gid", no_argument, NULL, 'n'}, {"no-group", no_argument, NULL, 'G'}, {"hide-control-chars", no_argument, NULL, 'q'}, @@ -792,6 +819,7 @@ static struct option const long_options[] = {"time-style", required_argument, NULL, TIME_STYLE_OPTION}, {"color", optional_argument, NULL, COLOR_OPTION}, {"block-size", required_argument, NULL, BLOCK_SIZE_OPTION}, + {"context", no_argument, 0, 'Z'}, {"author", no_argument, NULL, AUTHOR_OPTION}, {GETOPT_HELP_OPTION_DECL}, {GETOPT_VERSION_OPTION_DECL}, @@ -935,6 +963,7 @@ dev_ino_pop (void) return *(struct dev_ino *) obstack_next_free (&dev_ino_obstack); } +/* Note the use commented out below: #define ASSERT_MATCHING_DEV_INO(Name, Di) \ do \ { \ @@ -945,7 +974,7 @@ dev_ino_pop (void) assert (sb.st_ino == Di.st_ino); \ } \ while (0) - +*/ /* Write to standard output PREFIX, followed by the quoting style and a space-separated list of the integers stored in OS all on one line. */ @@ -969,6 +998,56 @@ dired_dump_obstack (const char *prefix, struct obstack *os) } } +/* Read the abbreviated month names from the locale, to align them + and to determine the max width of the field and to truncate names + greater than our max allowed. + Note even though this handles multibyte locales correctly + it's not restricted to them as single byte locales can have + variable width abbreviated months and also precomputing/caching + the names was seen to increase the performance of ls significantly. */ + +/* max number of display cells to use */ +enum { MAX_MON_WIDTH = 5 }; +/* In the unlikely event that the abmon[] storage is not big enough + an error message will be displayed, and we revert to using + unmodified abbreviated month names from the locale database. */ +static char abmon[12][MAX_MON_WIDTH * 2 * MB_LEN_MAX + 1]; +/* minimum width needed to align %b, 0 => don't use precomputed values. */ +static size_t required_mon_width; + +static size_t +abmon_init (void) +{ +#ifdef HAVE_NL_LANGINFO + required_mon_width = MAX_MON_WIDTH; + size_t curr_max_width; + do + { + curr_max_width = required_mon_width; + required_mon_width = 0; + for (int i = 0; i < 12; i++) + { + size_t width = curr_max_width; + + size_t req = mbsalign (nl_langinfo (ABMON_1 + i), + abmon[i], sizeof (abmon[i]), + &width, MBS_ALIGN_LEFT, 0); + + if (req == (size_t) -1 || req >= sizeof (abmon[i])) + { + required_mon_width = 0; /* ignore precomputed strings. */ + return required_mon_width; + } + + required_mon_width = MAX (required_mon_width, width); + } + } + while (curr_max_width > required_mon_width); +#endif + + return required_mon_width; +} + static size_t dev_ino_hash (void const *x, size_t table_size) { @@ -1087,7 +1166,8 @@ process_signals (void) int stops; sigset_t oldset; - restore_default_color (); + if (used_color) + restore_default_color (); fflush (stdout); sigprocmask (SIG_BLOCK, &caught_signals, &oldset); @@ -1155,7 +1235,7 @@ main (int argc, char **argv) #endif initialize_main (&argc, &argv); - program_name = argv[0]; + set_program_name (argv[0]); setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); @@ -1170,6 +1250,9 @@ main (int argc, char **argv) print_dir_name = true; pending_dirs = NULL; + current_time.tv_sec = TYPE_MINIMUM (time_t); + current_time.tv_nsec = -1; + i = decode_switches (argc, argv); if (print_with_color) @@ -1181,7 +1264,7 @@ main (int argc, char **argv) { /* Avoid following symbolic links when possible. */ if (is_colored (C_ORPHAN) - || is_colored (C_EXEC) + || (is_colored (C_EXEC) && color_symlink_as_referent) || (is_colored (C_MISSING) && format == long_format)) check_symlink_color = true; @@ -1224,8 +1307,6 @@ main (int argc, char **argv) } #endif } - - prep_non_filename_text (); } if (dereference == DEREF_UNDEFINED) @@ -1251,6 +1332,7 @@ main (int argc, char **argv) format_needs_stat = sort_type == sort_time || sort_type == sort_size || format == long_format + || print_scontext || print_block_size; format_needs_type = (! format_needs_stat && (recursive @@ -1339,7 +1421,8 @@ main (int argc, char **argv) { int j; - restore_default_color (); + if (used_color) + restore_default_color (); fflush (stdout); /* Restore the default signal handling. */ @@ -1388,7 +1471,6 @@ main (int argc, char **argv) static int decode_switches (int argc, char **argv) { - int c; char *time_style_option = NULL; /* Record whether there is an option specifying sort type. */ @@ -1444,6 +1526,7 @@ decode_switches (int argc, char **argv) ignore_mode = IGNORE_DEFAULT; ignore_patterns = NULL; hide_patterns = NULL; + print_scontext = false; /* FIXME: put this in a function. */ { @@ -1462,8 +1545,8 @@ decode_switches (int argc, char **argv) { char const *ls_block_size = getenv ("LS_BLOCK_SIZE"); - human_output_opts = human_options (ls_block_size, false, - &output_block_size); + human_options (ls_block_size, + &human_output_opts, &output_block_size); if (ls_block_size || getenv ("BLOCK_SIZE")) file_output_block_size = output_block_size; } @@ -1518,10 +1601,15 @@ decode_switches (int argc, char **argv) } } - while ((c = getopt_long (argc, argv, - "abcdfghiklmnopqrstuvw:xABCDFGHI:LNQRST:UX1", - long_options, NULL)) != -1) + for (;;) { + int oi = -1; + int c = getopt_long (argc, argv, + "abcdfghiklmnopqrstuvw:xABCDFGHI:LNQRST:UXZ1", + long_options, &oi); + if (c == -1) + break; + switch (c) { case 'a': @@ -1570,10 +1658,6 @@ decode_switches (int argc, char **argv) print_inode = true; break; - case KILOBYTES_LONG_OPTION: - error (0, 0, - _("the --kilobytes option is deprecated; use -k instead")); - /* fall through */ case 'k': human_output_opts = 0; file_output_block_size = output_block_size = 1024; @@ -1760,7 +1844,7 @@ decode_switches (int argc, char **argv) case FULL_TIME_OPTION: format = long_format; - time_style_option = "full-iso"; + time_style_option = bad_cast ("full-iso"); break; case COLOR_OPTION: @@ -1809,8 +1893,13 @@ decode_switches (int argc, char **argv) break; case BLOCK_SIZE_OPTION: - human_output_opts = human_options (optarg, true, &output_block_size); - file_output_block_size = output_block_size; + { + enum strtol_error e = human_options (optarg, &human_output_opts, + &output_block_size); + if (e != LONGINT_OK) + xstrtol_fatal (e, oi, 0, long_options, optarg); + file_output_block_size = output_block_size; + } break; case SI_OPTION: @@ -1818,6 +1907,10 @@ decode_switches (int argc, char **argv) file_output_block_size = output_block_size = 1; break; + case 'Z': + print_scontext = true; + break; + case_GETOPT_HELP_CHAR; case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS); @@ -1869,7 +1962,7 @@ decode_switches (int argc, char **argv) if (! style) if (! (style = getenv ("TIME_STYLE"))) - style = "locale"; + style = bad_cast ("locale"); while (strncmp (style, posix_prefix, sizeof posix_prefix - 1) == 0) { @@ -1930,6 +2023,10 @@ decode_switches (int argc, char **argv) } } } + /* Note we leave %5b etc. alone so user widths/flags are honored. */ + if (strstr (long_time_format[0],"%b") || strstr (long_time_format[1],"%b")) + if (!abmon_init ()) + error (0, 0, _("error initializing month strings")); } return optind; @@ -2398,6 +2495,20 @@ print_dir (char const *name, char const *realname, bool command_line_arg) #endif total_blocks += gobble_file (next->d_name, type, D_INO (next), false, name); + + /* In this narrow case, print out each name right away, so + ls uses constant memory while processing the entries of + this directory. Useful when there are many (millions) + of entries in a directory. */ + if (format == one_per_line && sort_type == sort_none) + { + /* We must call sort_files in spite of + "sort_type == sort_none" for its initialization + of the sorted_file vector. */ + sort_files (); + print_current_files (); + clear_files (); + } } } else if (errno != 0) @@ -2521,18 +2632,19 @@ clear_files (void) struct fileinfo *f = sorted_file[i]; free (f->name); free (f->linkname); + if (f->scontext != UNKNOWN_SECURITY_CONTEXT) + freecon (f->scontext); } cwd_n_used = 0; -#if USE_ACL any_has_acl = false; -#endif inode_number_width = 0; block_size_width = 0; nlink_width = 0; owner_width = 0; group_width = 0; author_width = 0; + scontext_width = 0; major_device_number_width = 0; minor_device_number_width = 0; file_size_width = 0; @@ -2575,7 +2687,8 @@ gobble_file (char const *name, enum filetype type, ino_t inode, || ((print_inode || format_needs_type) && (type == symbolic_link || type == unknown) && (dereference == DEREF_ALWAYS - || (command_line_arg && dereference != DEREF_NEVER))) + || (command_line_arg && dereference != DEREF_NEVER) + || color_symlink_as_referent || check_symlink_color)) /* Command line dereferences are already taken care of by the above assertion that the inode number is not yet known. */ || (print_inode && inode == NOT_AN_INODE_NUMBER) @@ -2596,7 +2709,7 @@ gobble_file (char const *name, enum filetype type, ino_t inode, { /* Absolute name of this file. */ char *absolute_name; - + bool do_deref; int err; if (name[0] == '/' || dirname[0] == 0) @@ -2611,6 +2724,7 @@ gobble_file (char const *name, enum filetype type, ino_t inode, { case DEREF_ALWAYS: err = stat (absolute_name, &f->stat); + do_deref = true; break; case DEREF_COMMAND_LINE_ARGUMENTS: @@ -2619,6 +2733,7 @@ gobble_file (char const *name, enum filetype type, ino_t inode, { bool need_lstat; err = stat (absolute_name, &f->stat); + do_deref = true; if (dereference == DEREF_COMMAND_LINE_ARGUMENTS) break; @@ -2637,6 +2752,7 @@ gobble_file (char const *name, enum filetype type, ino_t inode, default: /* DEREF_NEVER */ err = lstat (absolute_name, &f->stat); + do_deref = false; break; } @@ -2658,16 +2774,57 @@ gobble_file (char const *name, enum filetype type, ino_t inode, f->stat_ok = true; -#if USE_ACL - if (format == long_format) + if (format == long_format || print_scontext) { - int n = file_has_acl (absolute_name, &f->stat); - f->have_acl = (0 < n); - any_has_acl |= f->have_acl; - if (n < 0) + bool have_selinux = false; + bool have_acl = false; + int attr_len = (do_deref + ? getfilecon (absolute_name, &f->scontext) + : lgetfilecon (absolute_name, &f->scontext)); + err = (attr_len < 0); + + /* Contrary to its documented API, getfilecon may return 0, + yet set f->scontext to NULL (on at least Debian's libselinux1 + 2.0.15-2+b1), so work around that bug. + FIXME: remove this work-around in 2011, or whenever affected + versions of libselinux are long gone. */ + if (attr_len == 0) + { + err = 0; + f->scontext = xstrdup ("unlabeled"); + } + + if (err == 0) + have_selinux = ! STREQ ("unlabeled", f->scontext); + else + { + f->scontext = UNKNOWN_SECURITY_CONTEXT; + + /* When requesting security context information, don't make + ls fail just because the file (even a command line argument) + isn't on the right type of file system. I.e., a getfilecon + failure isn't in the same class as a stat failure. */ + if (errno == ENOTSUP || errno == EOPNOTSUPP || errno == ENODATA) + err = 0; + } + + if (err == 0 && format == long_format) + { + int n = file_has_acl (absolute_name, &f->stat); + err = (n < 0); + have_acl = (0 < n); + } + + f->acl_type = (!have_selinux && !have_acl + ? ACL_T_NONE + : (have_selinux && !have_acl + ? ACL_T_SELINUX_ONLY + : ACL_T_YES)); + any_has_acl |= f->acl_type != ACL_T_NONE; + + if (err) error (0, errno, "%s", quotearg_colon (absolute_name)); } -#endif if (S_ISLNK (f->stat.st_mode) && (format == long_format || check_symlink_color)) @@ -2700,6 +2857,12 @@ gobble_file (char const *name, enum filetype type, ino_t inode, free (linkname); } + /* When not distinguishing types of symlinks, pretend we know that + it is stat'able, so that it will be colored as a regular symlink, + and not as an orphan. */ + if (S_ISLNK (f->stat.st_mode) && !check_symlink_color) + f->linkok = true; + if (S_ISLNK (f->stat.st_mode)) f->filetype = symbolic_link; else if (S_ISDIR (f->stat.st_mode)) @@ -2713,65 +2876,77 @@ gobble_file (char const *name, enum filetype type, ino_t inode, f->filetype = normal; blocks = ST_NBLOCKS (f->stat); - { - char buf[LONGEST_HUMAN_READABLE + 1]; - int len = mbswidth (human_readable (blocks, buf, human_output_opts, - ST_NBLOCKSIZE, output_block_size), - 0); - if (block_size_width < len) - block_size_width = len; - } - - if (print_owner) - { - int len = format_user_width (f->stat.st_uid); - if (owner_width < len) - owner_width = len; - } - - if (print_group) - { - int len = format_group_width (f->stat.st_gid); - if (group_width < len) - group_width = len; - } - - if (print_author) - { - int len = format_user_width (f->stat.st_author); - if (author_width < len) - author_width = len; - } - - { - char buf[INT_BUFSIZE_BOUND (uintmax_t)]; - int len = strlen (umaxtostr (f->stat.st_nlink, buf)); - if (nlink_width < len) - nlink_width = len; - } - - if (S_ISCHR (f->stat.st_mode) || S_ISBLK (f->stat.st_mode)) - { - char buf[INT_BUFSIZE_BOUND (uintmax_t)]; - int len = strlen (umaxtostr (major (f->stat.st_rdev), buf)); - if (major_device_number_width < len) - major_device_number_width = len; - len = strlen (umaxtostr (minor (f->stat.st_rdev), buf)); - if (minor_device_number_width < len) - minor_device_number_width = len; - len = major_device_number_width + 2 + minor_device_number_width; - if (file_size_width < len) - file_size_width = len; - } - else + if (format == long_format || print_block_size) { char buf[LONGEST_HUMAN_READABLE + 1]; - uintmax_t size = unsigned_file_size (f->stat.st_size); - int len = mbswidth (human_readable (size, buf, human_output_opts, - 1, file_output_block_size), + int len = mbswidth (human_readable (blocks, buf, human_output_opts, + ST_NBLOCKSIZE, output_block_size), 0); - if (file_size_width < len) - file_size_width = len; + if (block_size_width < len) + block_size_width = len; + } + + if (format == long_format) + { + if (print_owner) + { + int len = format_user_width (f->stat.st_uid); + if (owner_width < len) + owner_width = len; + } + + if (print_group) + { + int len = format_group_width (f->stat.st_gid); + if (group_width < len) + group_width = len; + } + + if (print_author) + { + int len = format_user_width (f->stat.st_author); + if (author_width < len) + author_width = len; + } + } + + if (print_scontext) + { + int len = strlen (f->scontext); + if (scontext_width < len) + scontext_width = len; + } + + if (format == long_format) + { + char b[INT_BUFSIZE_BOUND (uintmax_t)]; + int b_len = strlen (umaxtostr (f->stat.st_nlink, b)); + if (nlink_width < b_len) + nlink_width = b_len; + + if (S_ISCHR (f->stat.st_mode) || S_ISBLK (f->stat.st_mode)) + { + char buf[INT_BUFSIZE_BOUND (uintmax_t)]; + int len = strlen (umaxtostr (major (f->stat.st_rdev), buf)); + if (major_device_number_width < len) + major_device_number_width = len; + len = strlen (umaxtostr (minor (f->stat.st_rdev), buf)); + if (minor_device_number_width < len) + minor_device_number_width = len; + len = major_device_number_width + 2 + minor_device_number_width; + if (file_size_width < len) + file_size_width = len; + } + else + { + char buf[LONGEST_HUMAN_READABLE + 1]; + uintmax_t size = unsigned_file_size (f->stat.st_size); + int len = mbswidth (human_readable (size, buf, human_output_opts, + 1, file_output_block_size), + 0); + if (file_size_width < len) + file_size_width = len; + } } } @@ -2803,7 +2978,7 @@ is_directory (const struct fileinfo *f) static void get_link_name (char const *filename, struct fileinfo *f, bool command_line_arg) { - f->linkname = xreadlink_with_size (filename, f->stat.st_size); + f->linkname = areadlink_with_size (filename, f->stat.st_size); if (f->linkname == NULL) file_failure (command_line_arg, _("cannot read symbolic link %s"), filename); @@ -3042,8 +3217,9 @@ DEFINE_SORT_FUNCTIONS (extension, cmp_extension) /* Compare file versions. Unlike all other compare functions above, cmp_version depends only - on strverscmp, which does not fail (even for locale reasons), and does not - need a secondary sort key. + on filevercmp, which does not fail (even for locale reasons), and does not + need a secondary sort key. See lib/filevercmp.h for function description. + All the other sort options, in fact, need xstrcoll and strcmp variants, because they all use a string comparison (either as the primary or secondary sort key), and xstrcoll has the ability to do a longjmp if strcoll fails for @@ -3052,7 +3228,7 @@ DEFINE_SORT_FUNCTIONS (extension, cmp_extension) static inline int cmp_version (struct fileinfo const *a, struct fileinfo const *b) { - return strverscmp (a->name, b->name); + return filevercmp (a->name, b->name); } static int xstrcoll_version (V a, V b) @@ -3087,7 +3263,7 @@ static int rev_xstrcoll_df_version (V a, V b) } \ } -static qsortFunc sort_functions[][2][2][2] = +static qsortFunc const sort_functions[][2][2][2] = { LIST_SORTFUNCTION_VARIANTS (name), LIST_SORTFUNCTION_VARIANTS (extension), @@ -3188,7 +3364,7 @@ print_current_files (void) case one_per_line: for (i = 0; i < cwd_n_used; i++) { - print_file_name_and_frills (sorted_file[i]); + print_file_name_and_frills (sorted_file[i], 0); putchar ('\n'); } break; @@ -3215,6 +3391,34 @@ print_current_files (void) } } +/* Replace the first %b with precomputed aligned month names. + Note on glibc-2.7 at least, this speeds up the whole `ls -lU` + process by around 17%, compared to letting strftime() handle the %b. */ + +static size_t +align_nstrftime (char *buf, size_t size, char const *fmt, struct tm const *tm, + int __utc, int __ns) +{ + const char *nfmt = fmt; + /* In the unlikely event that rpl_fmt below is not large enough, + the replacement is not done. A malloc here slows ls down by 2% */ + char rpl_fmt[sizeof (abmon[0]) + 100]; + const char *pb; + if (required_mon_width && (pb = strstr (fmt, "%b"))) + { + if (strlen (fmt) < (sizeof (rpl_fmt) - sizeof (abmon[0]) + 2)) + { + char *pfmt = rpl_fmt; + nfmt = rpl_fmt; + + pfmt = mempcpy (pfmt, fmt, pb - fmt); + pfmt = stpcpy (pfmt, abmon[tm->tm_mon]); + strcpy (pfmt, pb + 2); + } + } + return nstrftime (buf, size, nfmt, tm, __utc, __ns); +} + /* Return the expected number of columns in a long-format time stamp, or zero if it cannot be calculated. */ @@ -3239,7 +3443,7 @@ long_time_expected_width (void) if (tm) { size_t len = - nstrftime (buf, sizeof buf, long_time_format[0], tm, 0, 0); + align_nstrftime (buf, sizeof buf, long_time_format[0], tm, 0, 0); if (len != 0) width = mbsnwidth (buf, len, 0); } @@ -3251,42 +3455,6 @@ long_time_expected_width (void) return width; } -/* Get the current time. */ - -static void -get_current_time (void) -{ -#if HAVE_CLOCK_GETTIME && defined CLOCK_REALTIME - { - struct timespec timespec; - if (clock_gettime (CLOCK_REALTIME, ×pec) == 0) - { - current_time = timespec.tv_sec; - current_time_ns = timespec.tv_nsec; - return; - } - } -#endif - - /* The clock does not have nanosecond resolution, so get the maximum - possible value for the current time that is consistent with the - reported clock. That way, files are not considered to be in the - future merely because their time stamps have higher resolution - than the clock resolution. */ - -#if HAVE_GETTIMEOFDAY - { - struct timeval timeval; - gettimeofday (&timeval, NULL); - current_time = timeval.tv_sec; - current_time_ns = timeval.tv_usec * 1000 + 999; - } -#else - current_time = time (NULL); - current_time_ns = 999999999; -#endif -} - /* Print the user or group name NAME, with numeric id ID, using a print width of WIDTH columns. */ @@ -3386,13 +3554,11 @@ print_long_format (const struct fileinfo *f) ]; size_t s; char *p; - time_t when; - int when_ns; struct timespec when_timespec; struct tm *when_local; /* Compute the mode string, except remove the trailing space if no - files in this directory have ACLs. */ + file in this directory has an ACL or SELinux security context. */ if (f->stat_ok) filemodestring (&f->stat, modebuf); else @@ -3403,7 +3569,9 @@ print_long_format (const struct fileinfo *f) } if (! any_has_acl) modebuf[10] = '\0'; - else if (FILE_HAS_ACL (f)) + else if (f->acl_type == ACL_T_SELINUX_ONLY) + modebuf[10] = '.'; + else if (f->acl_type == ACL_T_YES) modebuf[10] = '+'; switch (time_type) @@ -3421,9 +3589,6 @@ print_long_format (const struct fileinfo *f) abort (); } - when = when_timespec.tv_sec; - when_ns = when_timespec.tv_nsec; - p = buf; if (print_inode) @@ -3468,7 +3633,7 @@ print_long_format (const struct fileinfo *f) DIRED_INDENT (); - if (print_owner | print_group | print_author) + if (print_owner | print_group | print_author | print_scontext) { DIRED_FPUTS (buf, stdout, p - buf); @@ -3481,6 +3646,9 @@ print_long_format (const struct fileinfo *f) if (print_author) format_user (f->stat.st_author, author_width, f->stat_ok); + if (print_scontext) + format_user_or_group (f->scontext, 0, scontext_width); + p = buf; } @@ -3523,35 +3691,37 @@ print_long_format (const struct fileinfo *f) if (f->stat_ok && when_local) { - time_t six_months_ago; + struct timespec six_months_ago; bool recent; char const *fmt; /* If the file appears to be in the future, update the current time, in case the file happens to have been modified since the last time we checked the clock. */ - if (current_time < when - || (current_time == when && current_time_ns < when_ns)) + if (timespec_cmp (current_time, when_timespec) < 0) { - /* Note that get_current_time calls gettimeofday which, on some non- + /* Note that gettime may call gettimeofday which, on some non- compliant systems, clobbers the buffer used for localtime's result. But it's ok here, because we use a gettimeofday wrapper that saves and restores the buffer around the gettimeofday call. */ - get_current_time (); + gettime (¤t_time); } /* Consider a time to be recent if it is within the past six months. A Gregorian year has 365.2425 * 24 * 60 * 60 == 31556952 seconds on the average. Write this value as an integer constant to avoid floating point hassles. */ - six_months_ago = current_time - 31556952 / 2; - recent = (six_months_ago <= when - && (when < current_time - || (when == current_time && when_ns <= current_time_ns))); + six_months_ago.tv_sec = current_time.tv_sec - 31556952 / 2; + six_months_ago.tv_nsec = current_time.tv_nsec; + + recent = (timespec_cmp (six_months_ago, when_timespec) < 0 + && (timespec_cmp (when_timespec, current_time) < 0)); fmt = long_time_format[recent]; - s = nstrftime (p, TIME_STAMP_LEN_MAXIMUM + 1, fmt, - when_local, 0, when_ns); + /* We assume here that all time zones are offset from UTC by a + whole number of seconds. */ + s = align_nstrftime (p, TIME_STAMP_LEN_MAXIMUM + 1, fmt, + when_local, 0, when_timespec.tv_nsec); } if (s || !*p) @@ -3570,15 +3740,16 @@ print_long_format (const struct fileinfo *f) sprintf (p, "%*s ", long_time_expected_width (), (! f->stat_ok ? "?" - : (TYPE_SIGNED (time_t) - ? imaxtostr (when, hbuf) - : umaxtostr (when, hbuf)))); + : timetostr (when_timespec.tv_sec, hbuf))); + /* FIXME: (maybe) We discarded when_timespec.tv_nsec. */ p += strlen (p); } DIRED_FPUTS (buf, stdout, p - buf); - print_name_with_quoting (f->name, FILE_OR_LINK_MODE (f), f->linkok, - f->stat_ok, f->filetype, &dired_obstack); + { + size_t w = print_name_with_quoting (f->name, FILE_OR_LINK_MODE (f), f->linkok, + f->stat_ok, f->filetype, &dired_obstack, + f->stat.st_nlink, p - buf); if (f->filetype == symbolic_link) { @@ -3586,13 +3757,15 @@ print_long_format (const struct fileinfo *f) { DIRED_FPUTS_LITERAL (" -> ", stdout); print_name_with_quoting (f->linkname, f->linkmode, f->linkok - 1, - f->stat_ok, f->filetype, NULL); + f->stat_ok, f->filetype, NULL, + f->stat.st_nlink, (p - buf) + w + 4); if (indicator_style != none) print_type_indicator (true, f->linkmode, unknown); } } else if (indicator_style != none) print_type_indicator (f->stat_ok, f->stat.st_mode, f->filetype); + } } /* Output to OUT a quoted representation of the file name NAME, @@ -3620,7 +3793,6 @@ quote_name (FILE *out, const char *name, struct quoting_options const *options, if (qmark_funny_chars) { -#if HAVE_MBRTOWC if (MB_CUR_MAX > 1) { char const *p = buf; @@ -3660,7 +3832,7 @@ quote_name (FILE *out, const char *name, struct quoting_options const *options, reach its end, replacing each non-printable multibyte character with a single question mark. */ { - mbstate_t mbstate = { 0, }; + DECLARE_ZEROED_AGGREGATE (mbstate_t, mbstate); do { wchar_t wc; @@ -3723,7 +3895,6 @@ quote_name (FILE *out, const char *name, struct quoting_options const *options, len = q - buf; } else -#endif { char *p = buf; char const *plimit = buf + len; @@ -3739,11 +3910,9 @@ quote_name (FILE *out, const char *name, struct quoting_options const *options, } else if (width != NULL) { -#if HAVE_MBRTOWC if (MB_CUR_MAX > 1) displayed_width = mbsnwidth (buf, len, 0); else -#endif { char const *p = buf; char const *plimit = buf + len; @@ -3765,27 +3934,35 @@ quote_name (FILE *out, const char *name, struct quoting_options const *options, return len; } -static void +static size_t print_name_with_quoting (const char *p, mode_t mode, int linkok, bool stat_ok, enum filetype type, - struct obstack *stack) + struct obstack *stack, nlink_t nlink, + size_t start_col) { - if (print_with_color) - print_color_indicator (p, mode, linkok, stat_ok, type); + size_t width; + bool used_color_this_time + = (print_with_color + && print_color_indicator (p, mode, linkok, stat_ok, type, nlink)); if (stack) PUSH_CURRENT_DIRED_POS (stack); - dired_pos += quote_name (stdout, p, filename_quoting_options, NULL); + width = quote_name (stdout, p, filename_quoting_options, NULL); + dired_pos += width; if (stack) PUSH_CURRENT_DIRED_POS (stack); - if (print_with_color) + if (used_color_this_time) { process_signals (); prep_non_filename_text (); + if (start_col / line_length != (start_col + width - 1) / line_length) + put_indicator (&color_indicator[C_CLR_TO_EOL]); } + + return width; } static void @@ -3796,7 +3973,7 @@ prep_non_filename_text (void) else { put_indicator (&color_indicator[C_LEFT]); - put_indicator (&color_indicator[C_NORM]); + put_indicator (&color_indicator[C_RESET]); put_indicator (&color_indicator[C_RIGHT]); } } @@ -3805,8 +3982,8 @@ prep_non_filename_text (void) Also print file size, inode number, and filetype indicator character, as requested by switches. */ -static void -print_file_name_and_frills (const struct fileinfo *f) +static size_t +print_file_name_and_frills (const struct fileinfo *f, size_t start_col) { char buf[MAX (LONGEST_HUMAN_READABLE + 1, INT_BUFSIZE_BOUND (uintmax_t))]; @@ -3819,11 +3996,18 @@ print_file_name_and_frills (const struct fileinfo *f) human_readable (ST_NBLOCKS (f->stat), buf, human_output_opts, ST_NBLOCKSIZE, output_block_size)); - print_name_with_quoting (f->name, FILE_OR_LINK_MODE (f), f->linkok, - f->stat_ok, f->filetype, NULL); + if (print_scontext) + printf ("%*s ", format == with_commas ? 0 : scontext_width, f->scontext); + { + size_t width = print_name_with_quoting (f->name, FILE_OR_LINK_MODE (f), + f->linkok, f->stat_ok, f->filetype, + NULL, f->stat.st_nlink, start_col); if (indicator_style != none) - print_type_indicator (f->stat_ok, f->stat.st_mode, f->filetype); + width += print_type_indicator (f->stat_ok, f->stat.st_mode, f->filetype); + + return width; + } } /* Given these arguments describing a file, return the single-byte @@ -3860,17 +4044,51 @@ get_type_indicator (bool stat_ok, mode_t mode, enum filetype type) return c; } -static void +static bool print_type_indicator (bool stat_ok, mode_t mode, enum filetype type) { char c = get_type_indicator (stat_ok, mode, type); if (c) DIRED_PUTCHAR (c); + return !!c; } -static void +#ifdef HAVE_CAP +/* Return true if NAME has a capability (see linux/capability.h) */ +static bool +has_capability (char const *name) +{ + char *result; + bool has_cap; + + cap_t cap_d = cap_get_file (name); + if (cap_d == NULL) + return false; + + result = cap_to_text (cap_d, NULL); + cap_free (cap_d); + if (!result) + return false; + + /* check if human-readable capability string is empty */ + has_cap = !!*result; + + cap_free (result); + return has_cap; +} +#else +static bool +has_capability (char const *name ATTRIBUTE_UNUSED) +{ + return false; +} +#endif + +/* Returns whether any color sequence was printed. */ +static bool print_color_indicator (const char *name, mode_t mode, int linkok, - bool stat_ok, enum filetype filetype) + bool stat_ok, enum filetype filetype, + nlink_t nlink) { int type; struct color_ext_type *ext; /* Color extension */ @@ -3894,8 +4112,12 @@ print_color_indicator (const char *name, mode_t mode, int linkok, type = C_SETUID; else if ((mode & S_ISGID) != 0) type = C_SETGID; + else if (is_colored (C_CAP) && has_capability (name)) + type = C_CAP; else if ((mode & S_IXUGO) != 0) type = C_EXEC; + else if (is_colored (C_HARDLINK) && (1 < nlink)) + type = C_HARDLINK; } else if (S_ISDIR (mode)) { @@ -3945,22 +4167,32 @@ print_color_indicator (const char *name, mode_t mode, int linkok, } } - put_indicator (&color_indicator[C_LEFT]); - put_indicator (ext ? &(ext->seq) : &color_indicator[type]); - put_indicator (&color_indicator[C_RIGHT]); + { + const struct bin_str *const s + = ext ? &(ext->seq) : &color_indicator[type]; + if (s->string != NULL) + { + put_indicator (&color_indicator[C_LEFT]); + put_indicator (s); + put_indicator (&color_indicator[C_RIGHT]); + return true; + } + else + return false; + } } /* Output a color indicator (which may contain nulls). */ static void put_indicator (const struct bin_str *ind) { - size_t i; - const char *p; + if (! used_color) + { + used_color = true; + prep_non_filename_text (); + } - p = ind->string; - - for (i = ind->len; i != 0; --i) - putchar (*(p++)); + fwrite (ind->string, ind->len, 1, stdout); } static size_t @@ -3982,6 +4214,9 @@ length_of_file_name_and_frills (const struct fileinfo *f) output_block_size)) : block_size_width); + if (print_scontext) + len += 1 + (format == with_commas ? strlen (f->scontext) : scontext_width); + quote_name (NULL, f->name, filename_quoting_options, &name_width); len += name_width; @@ -4017,7 +4252,7 @@ print_many_per_line (void) struct fileinfo const *f = sorted_file[filesno]; size_t name_length = length_of_file_name_and_frills (f); size_t max_name_length = line_fmt->col_arr[col++]; - print_file_name_and_frills (f); + print_file_name_and_frills (f, pos); filesno += rows; if (filesno >= cwd_n_used) @@ -4037,16 +4272,16 @@ print_horizontal (void) size_t pos = 0; size_t cols = calculate_columns (false); struct column_info const *line_fmt = &column_info[cols - 1]; - size_t name_length = length_of_file_name_and_frills (cwd_file); + struct fileinfo const *f = sorted_file[0]; + size_t name_length = length_of_file_name_and_frills (f); size_t max_name_length = line_fmt->col_arr[0]; /* Print first entry. */ - print_file_name_and_frills (cwd_file); + print_file_name_and_frills (f, 0); /* Now the rest. */ for (filesno = 1; filesno < cwd_n_used; ++filesno) { - struct fileinfo const *f; size_t col = filesno % cols; if (col == 0) @@ -4061,7 +4296,7 @@ print_horizontal (void) } f = sorted_file[filesno]; - print_file_name_and_frills (f); + print_file_name_and_frills (f, pos); name_length = length_of_file_name_and_frills (f); max_name_length = line_fmt->col_arr[col]; @@ -4099,7 +4334,7 @@ print_with_commas (void) putchar (separator); } - print_file_name_and_frills (f); + print_file_name_and_frills (f, pos); pos += len; } putchar ('\n'); @@ -4324,7 +4559,9 @@ Mandatory arguments to long options are mandatory for short options too.\n\ "), stdout); fputs (_("\ --group-directories-first\n\ - group directories before files\n\ + group directories before files.\n\ + augment with a --sort option, but any\n\ + use of --sort=none (-U) disables grouping\n\ "), stdout); fputs (_("\ -G, --no-group in a long listing, don't print group names\n\ @@ -4375,7 +4612,7 @@ Mandatory arguments to long options are mandatory for short options too.\n\ fputs (_("\ -r, --reverse reverse order while sorting\n\ -R, --recursive list subdirectories recursively\n\ - -s, --size print the size of each file, in blocks\n\ + -s, --size print the allocated size of each file, in blocks\n\ "), stdout); fputs (_("\ -S sort by file size\n\ @@ -4404,12 +4641,13 @@ Mandatory arguments to long options are mandatory for short options too.\n\ with -l: show access time and sort by name\n\ otherwise: sort by access time\n\ -U do not sort; list entries in directory order\n\ - -v sort by version\n\ + -v natural sort of (version) numbers within text\n\ "), stdout); fputs (_("\ -w, --width=COLS assume screen width instead of current value\n\ -x list entries by lines instead of by columns\n\ -X sort alphabetically by entry extension\n\ + -Z, --context print any SELinux security context of each file\n\ -1 list one file per line\n\ "), stdout); fputs (HELP_OPTION_DESCRIPTION, stdout); @@ -4429,9 +4667,12 @@ colors, and can be set easily by the dircolors command.\n\ "), stdout); fputs (_("\ \n\ -Exit status is 0 if OK, 1 if minor problems, 2 if serious trouble.\n\ +Exit status:\n\ + 0 if OK,\n\ + 1 if minor problems (e.g., cannot access subdirectory),\n\ + 2 if serious trouble (e.g., cannot access command-line argument).\n\ "), stdout); - printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT); + emit_bug_reporting_address (); } exit (status); } diff --git a/src/bin/coreutils/src/md5sum.c b/src/bin/coreutils/src/md5sum.c index a8ce1cf272..969cc71756 100644 --- a/src/bin/coreutils/src/md5sum.c +++ b/src/bin/coreutils/src/md5sum.c @@ -1,10 +1,10 @@ /* Compute MD5, SHA1, SHA224, SHA256, SHA384 or SHA512 checksum of files or strings - Copyright (C) 1995-2006 Free Software Foundation, Inc. + Copyright (C) 1995-2008 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Ulrich Drepper . */ @@ -36,10 +35,9 @@ #if HASH_ALGO_SHA512 || HASH_ALGO_SHA384 # include "sha512.h" #endif -#include "getline.h" #include "error.h" -#include "quote.h" #include "stdio--.h" +#include "xfreopen.h" /* The official name of this program (e.g., no `g' prefix). */ #if HASH_ALGO_MD5 @@ -91,7 +89,10 @@ #define DIGEST_HEX_BYTES (DIGEST_BITS / 4) #define DIGEST_BIN_BYTES (DIGEST_BITS / 8) -#define AUTHORS "Ulrich Drepper", "Scott Miller", "David Madore" +#define AUTHORS \ + proper_name ("Ulrich Drepper"), \ + proper_name ("Scott Miller"), \ + proper_name ("David Madore") /* The minimum length of a valid digest line. This length does not include any newline character at the end of a line. */ @@ -117,20 +118,22 @@ static bool status_only = false; improperly formatted checksum line. */ static bool warn = false; -/* The name this program was run with. */ -char *program_name; +/* With --check, suppress the "OK" printed for each verified file. */ +static bool quiet = false; /* For long options that have no equivalent short option, use a non-character as a pseudo short option, starting with CHAR_MAX + 1. */ enum { - STATUS_OPTION = CHAR_MAX + 1 + STATUS_OPTION = CHAR_MAX + 1, + QUIET_OPTION }; -static const struct option long_options[] = +static struct option const long_options[] = { { "binary", no_argument, NULL, 'b' }, { "check", no_argument, NULL, 'c' }, + { "quiet", no_argument, NULL, QUIET_OPTION }, { "status", no_argument, NULL, STATUS_OPTION }, { "text", no_argument, NULL, 't' }, { "warn", no_argument, NULL, 'w' }, @@ -148,7 +151,7 @@ usage (int status) else { printf (_("\ -Usage: %s [OPTION] [FILE]...\n\ +Usage: %s [OPTION]... [FILE]...\n\ Print or check %s (%d-bit) checksums.\n\ With no FILE, or when FILE is -, read standard input.\n\ \n\ @@ -177,7 +180,8 @@ With no FILE, or when FILE is -, read standard input.\n\ "), stdout); fputs (_("\ \n\ -The following two options are useful only when verifying checksums:\n\ +The following three options are useful only when verifying checksums:\n\ + --quiet don't print OK for each successfully verified file\n\ --status don't output anything, status code shows success\n\ -w, --warn warn about improperly formatted checksum lines\n\ \n\ @@ -191,7 +195,7 @@ should be a former output of this program. The default mode is to print\n\ a line with checksum, a character indicating type (`*' for binary, ` ' for\n\ text), and name for each FILE.\n"), DIGEST_REFERENCE); - printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT); + emit_bug_reporting_address (); } exit (status); @@ -208,6 +212,9 @@ bsd_split_3 (char *s, size_t s_len, unsigned char **hex_digest, char **file_name { size_t i; + if (s_len == 0) + return false; + *file_name = s; /* Find end of filename. The BSD 'md5' and 'sha1' commands do not escape @@ -343,16 +350,19 @@ split_3 (char *s, size_t s_len, return true; } +/* Return true if S is a NUL-terminated string of DIGEST_HEX_BYTES hex digits. + Otherwise, return false. */ static bool hex_digits (unsigned char const *s) { - while (*s) + unsigned int i; + for (i = 0; i < digest_hex_bytes; i++) { if (!isxdigit (*s)) return false; ++s; } - return true; + return *s == '\0'; } /* An interface to the function, DIGEST_STREAM. @@ -382,7 +392,7 @@ digest_file (const char *filename, int *binary, unsigned char *bin_result) if (*binary < 0) *binary = ! isatty (STDIN_FILENO); if (*binary) - freopen (NULL, "rb", stdin); + xfreopen (NULL, "rb", stdin); } } else @@ -449,7 +459,7 @@ digest_check (const char *checkfile_name) line_chars_allocated = 0; do { - char *filename; + char *filename IF_LINT (= NULL); int binary; unsigned char *hex_digest IF_LINT (= NULL); ssize_t line_length; @@ -524,8 +534,10 @@ digest_check (const char *checkfile_name) if (!status_only) { - printf ("%s: %s\n", filename, - (cnt != digest_bin_bytes ? _("FAILED") : _("OK"))); + if (cnt != digest_bin_bytes) + printf ("%s: %s\n", filename, _("FAILED")); + else if (!quiet) + printf ("%s: %s\n", filename, _("OK")); fflush (stdout); } } @@ -599,7 +611,7 @@ main (int argc, char **argv) /* Setting values of global variables. */ initialize_main (&argc, &argv); - program_name = argv[0]; + set_program_name (argv[0]); setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); @@ -618,6 +630,7 @@ main (int argc, char **argv) case STATUS_OPTION: status_only = true; warn = false; + quiet = false; break; case 't': binary = 0; @@ -625,6 +638,12 @@ main (int argc, char **argv) case 'w': status_only = false; warn = true; + quiet = false; + break; + case QUIET_OPTION: + status_only = false; + warn = false; + quiet = true; break; case_GETOPT_HELP_CHAR; case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS); @@ -656,11 +675,18 @@ main (int argc, char **argv) usage (EXIT_FAILURE); } + if (quiet & !do_check) + { + error (0, 0, + _("the --quiet option is meaningful only when verifying checksums")); + usage (EXIT_FAILURE); + } + if (!O_BINARY && binary < 0) binary = 0; if (optind == argc) - argv[argc++] = "-"; + argv[argc++] = bad_cast ("-"); for (; optind < argc; ++optind) { diff --git a/src/bin/coreutils/src/mkdir.c b/src/bin/coreutils/src/mkdir.c index 6fa0ac21d1..ca543aa6fc 100644 --- a/src/bin/coreutils/src/mkdir.c +++ b/src/bin/coreutils/src/mkdir.c @@ -1,10 +1,10 @@ /* mkdir -- make directories - Copyright (C) 90, 1995-2002, 2004, 2005, 2006 Free Software Foundation, Inc. + Copyright (C) 90, 1995-2002, 2004-2008 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* David MacKenzie */ @@ -21,25 +20,24 @@ #include #include #include +#include #include "system.h" #include "error.h" -#include "lchmod.h" #include "mkdir-p.h" #include "modechange.h" +#include "prog-fprintf.h" #include "quote.h" #include "savewd.h" /* The official name of this program (e.g., no `g' prefix). */ #define PROGRAM_NAME "mkdir" -#define AUTHORS "David MacKenzie" - -/* The name this program was run with. */ -char *program_name; +#define AUTHORS proper_name ("David MacKenzie") static struct option const longopts[] = { + {GETOPT_SELINUX_CONTEXT_OPTION_DECL}, {"mode", required_argument, NULL, 'm'}, {"parents", no_argument, NULL, 'p'}, {"verbose", no_argument, NULL, 'v'}, @@ -56,7 +54,7 @@ usage (int status) program_name); else { - printf (_("Usage: %s [OPTION] DIRECTORY...\n"), program_name); + printf (_("Usage: %s [OPTION]... DIRECTORY...\n"), program_name); fputs (_("\ Create the DIRECTORY(ies), if they do not already exist.\n\ \n\ @@ -68,10 +66,12 @@ Mandatory arguments to long options are mandatory for short options too.\n\ -m, --mode=MODE set file mode (as in chmod), not a=rwx - umask\n\ -p, --parents no error if existing, make parent directories as needed\n\ -v, --verbose print a message for each created directory\n\ + -Z, --context=CTX set the SELinux security context of each created\n\ + directory to CTX\n\ "), stdout); fputs (HELP_OPTION_DESCRIPTION, stdout); fputs (VERSION_OPTION_DESCRIPTION, stdout); - printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT); + emit_bug_reporting_address (); } exit (status); } @@ -102,7 +102,7 @@ announce_mkdir (char const *dir, void *options) { struct mkdir_options const *o = options; if (o->created_directory_format) - error (0, 0, o->created_directory_format, quote (dir)); + prog_fprintf (stdout, o->created_directory_format, quote (dir)); } /* Make ancestor directory DIR, whose last component is COMPONENT, @@ -140,21 +140,23 @@ main (int argc, char **argv) { const char *specified_mode = NULL; int optc; + security_context_t scontext = NULL; struct mkdir_options options; + options.make_ancestor_function = NULL; options.mode = S_IRWXUGO; options.mode_bits = 0; options.created_directory_format = NULL; initialize_main (&argc, &argv); - program_name = argv[0]; + set_program_name (argv[0]); setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); atexit (close_stdout); - while ((optc = getopt_long (argc, argv, "pm:v", longopts, NULL)) != -1) + while ((optc = getopt_long (argc, argv, "pm:vZ:", longopts, NULL)) != -1) { switch (optc) { @@ -167,6 +169,9 @@ main (int argc, char **argv) case 'v': /* --verbose */ options.created_directory_format = _("created directory %s"); break; + case 'Z': + scontext = optarg; + break; case_GETOPT_HELP_CHAR; case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS); default: @@ -180,6 +185,11 @@ main (int argc, char **argv) usage (EXIT_FAILURE); } + if (scontext && setfscreatecon (scontext) < 0) + error (EXIT_FAILURE, errno, + _("failed to set default file creation context to %s"), + quote (scontext)); + if (options.make_ancestor_function || specified_mode) { mode_t umask_value = umask (0); diff --git a/src/bin/coreutils/src/mkfifo.c b/src/bin/coreutils/src/mkfifo.c index d329b79b8b..04b6b4f29a 100644 --- a/src/bin/coreutils/src/mkfifo.c +++ b/src/bin/coreutils/src/mkfifo.c @@ -1,10 +1,10 @@ /* mkfifo -- make fifo's (named pipes) - Copyright (C) 90, 91, 1995-2006 Free Software Foundation, Inc. + Copyright (C) 90, 91, 1995-2008 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* David MacKenzie */ @@ -21,6 +20,7 @@ #include #include #include +#include #include "system.h" #include "error.h" @@ -30,13 +30,11 @@ /* The official name of this program (e.g., no `g' prefix). */ #define PROGRAM_NAME "mkfifo" -#define AUTHORS "David MacKenzie" - -/* The name this program was run with. */ -char *program_name; +#define AUTHORS proper_name ("David MacKenzie") static struct option const longopts[] = { + {GETOPT_SELINUX_CONTEXT_OPTION_DECL}, {"mode", required_argument, NULL, 'm'}, {GETOPT_HELP_OPTION_DECL}, {GETOPT_VERSION_OPTION_DECL}, @@ -51,7 +49,7 @@ usage (int status) program_name); else { - printf (_("Usage: %s [OPTION] NAME...\n"), program_name); + printf (_("Usage: %s [OPTION]... NAME...\n"), program_name); fputs (_("\ Create named pipes (FIFOs) with the given NAMEs.\n\ \n\ @@ -60,11 +58,14 @@ Create named pipes (FIFOs) with the given NAMEs.\n\ Mandatory arguments to long options are mandatory for short options too.\n\ "), stdout); fputs (_("\ - -m, --mode=MODE set file permission bits to MODE, not a=rw - umask\n\ + -m, --mode=MODE set file permission bits to MODE, not a=rw - umask\n\ +"), stdout); + fputs (_("\ + -Z, --context=CTX set the SELinux security context of each NAME to CTX\n\ "), stdout); fputs (HELP_OPTION_DESCRIPTION, stdout); fputs (VERSION_OPTION_DESCRIPTION, stdout); - printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT); + emit_bug_reporting_address (); } exit (status); } @@ -76,22 +77,26 @@ main (int argc, char **argv) char const *specified_mode = NULL; int exit_status = EXIT_SUCCESS; int optc; + security_context_t scontext = NULL; initialize_main (&argc, &argv); - program_name = argv[0]; + set_program_name (argv[0]); setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); atexit (close_stdout); - while ((optc = getopt_long (argc, argv, "m:", longopts, NULL)) != -1) + while ((optc = getopt_long (argc, argv, "m:Z:", longopts, NULL)) != -1) { switch (optc) { case 'm': specified_mode = optarg; break; + case 'Z': + scontext = optarg; + break; case_GETOPT_HELP_CHAR; case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS); default: @@ -105,6 +110,11 @@ main (int argc, char **argv) usage (EXIT_FAILURE); } + if (scontext && setfscreatecon (scontext) < 0) + error (EXIT_FAILURE, errno, + _("failed to set default file creation context to %s"), + quote (scontext)); + newmode = (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH); if (specified_mode) { diff --git a/src/bin/coreutils/src/mknod.c b/src/bin/coreutils/src/mknod.c index 43a1b9dcc7..13f730e67f 100644 --- a/src/bin/coreutils/src/mknod.c +++ b/src/bin/coreutils/src/mknod.c @@ -1,10 +1,10 @@ /* mknod -- make special files - Copyright (C) 90, 91, 1995-2006 Free Software Foundation, Inc. + Copyright (C) 90, 91, 1995-2008 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by David MacKenzie */ @@ -21,6 +20,7 @@ #include #include #include +#include #include "system.h" #include "error.h" @@ -31,13 +31,11 @@ /* The official name of this program (e.g., no `g' prefix). */ #define PROGRAM_NAME "mknod" -#define AUTHORS "David MacKenzie" - -/* The name this program was run with. */ -char *program_name; +#define AUTHORS proper_name ("David MacKenzie") static struct option const longopts[] = { + {GETOPT_SELINUX_CONTEXT_OPTION_DECL}, {"mode", required_argument, NULL, 'm'}, {GETOPT_HELP_OPTION_DECL}, {GETOPT_VERSION_OPTION_DECL}, @@ -62,7 +60,10 @@ Create the special file NAME of the given TYPE.\n\ Mandatory arguments to long options are mandatory for short options too.\n\ "), stdout); fputs (_("\ - -m, --mode=MODE set file permission bits to MODE, not a=rw - umask\n\ + -m, --mode=MODE set file permission bits to MODE, not a=rw - umask\n\ +"), stdout); + fputs (_("\ + -Z, --context=CTX set the SELinux security context of NAME to CTX\n\ "), stdout); fputs (HELP_OPTION_DESCRIPTION, stdout); fputs (VERSION_OPTION_DESCRIPTION, stdout); @@ -79,7 +80,8 @@ otherwise, as decimal. TYPE may be:\n\ c, u create a character (unbuffered) special file\n\ p create a FIFO\n\ "), stdout); - printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT); + printf (USAGE_BUILTIN_WARNING, PROGRAM_NAME); + emit_bug_reporting_address (); } exit (status); } @@ -92,22 +94,26 @@ main (int argc, char **argv) int optc; int expected_operands; mode_t node_type; + security_context_t scontext = NULL; initialize_main (&argc, &argv); - program_name = argv[0]; + set_program_name (argv[0]); setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); atexit (close_stdout); - while ((optc = getopt_long (argc, argv, "m:", longopts, NULL)) != -1) + while ((optc = getopt_long (argc, argv, "m:Z:", longopts, NULL)) != -1) { switch (optc) { case 'm': specified_mode = optarg; break; + case 'Z': + scontext = optarg; + break; case_GETOPT_HELP_CHAR; case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS); default: @@ -157,6 +163,11 @@ main (int argc, char **argv) usage (EXIT_FAILURE); } + if (scontext && setfscreatecon (scontext) < 0) + error (EXIT_FAILURE, errno, + _("failed to set default file creation context to %s"), + quote (scontext)); + /* Only check the first character, to allow mnemonic usage like `mknod /dev/rst0 character 18 0'. */ diff --git a/src/bin/coreutils/src/mktemp.c b/src/bin/coreutils/src/mktemp.c new file mode 100644 index 0000000000..2e6dc7b855 --- /dev/null +++ b/src/bin/coreutils/src/mktemp.c @@ -0,0 +1,294 @@ +/* Create a temporary file or directory, safely. + Copyright (C) 2007-2008 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* Written by Jim Meyering. */ + +#include +#include +#include +#include + +#include "system.h" + +#include "error.h" +#include "filenamecat.h" +#include "quote.h" +#include "tempname.h" + +/* The official name of this program (e.g., no `g' prefix). */ +#define PROGRAM_NAME "mktemp" + +#define AUTHORS proper_name ("Jim Meyering") + +static const char *default_template = "tmp.XXXXXXXXXX"; + +/* For long options that have no equivalent short option, use a + non-character as a pseudo short option, starting with CHAR_MAX + 1. */ +enum +{ + TMPDIR_OPTION = CHAR_MAX + 1 +}; + +static struct option const longopts[] = +{ + {"directory", no_argument, NULL, 'd'}, + {"quiet", no_argument, NULL, 'q'}, + {"dry-run", no_argument, NULL, 'u'}, + {"tmpdir", optional_argument, NULL, TMPDIR_OPTION}, + {GETOPT_HELP_OPTION_DECL}, + {GETOPT_VERSION_OPTION_DECL}, + {NULL, 0, NULL, 0} +}; + +void +usage (int status) +{ + if (status != EXIT_SUCCESS) + fprintf (stderr, _("Try `%s --help' for more information.\n"), + program_name); + else + { + printf (_("Usage: %s [OPTION]... [TEMPLATE]\n"), program_name); + fputs (_("\ +Create a temporary file or directory, safely, and print its name.\n\ +If TEMPLATE is not specified, use tmp.XXXXXXXXXX.\n\ +"), stdout); + fputs ("\n", stdout); + fputs (_("\ + -d, --directory create a directory, not a file\n\ +"), stdout); + fputs (_("\ + -q, --quiet suppress diagnostics about file/dir-creation failure\n\ +"), stdout); + fputs (_("\ + -u, --dry-run do not create anything; merely print a name (unsafe)\n\ +"), stdout); + fputs (_("\ + --tmpdir[=DIR] interpret TEMPLATE relative to DIR. If DIR is\n\ + not specified, use $TMPDIR if set, else /tmp.\n\ + With this option, TEMPLATE must not be an absolute name.\n\ + Unlike with -t, TEMPLATE may contain slashes, but even\n\ + here, mktemp still creates only the final component.\n\ +"), stdout); + fputs ("\n", stdout); + fputs (_("\ + -p DIR use DIR as a prefix; implies -t [deprecated]\n\ +"), stdout); + fputs (_("\ + -t interpret TEMPLATE as a single file name component,\n\ + relative to a directory: $TMPDIR, if set; else the\n\ + directory specified via -p; else /tmp [deprecated]\n\ +"), stdout); + fputs ("\n", stdout); + fputs (HELP_OPTION_DESCRIPTION, stdout); + fputs (VERSION_OPTION_DESCRIPTION, stdout); + emit_bug_reporting_address (); + } + + exit (status); +} + +static size_t +count_trailing_X_s (const char *s) +{ + size_t len = strlen (s); + size_t n = 0; + for ( ; len && s[len-1] == 'X'; len--) + ++n; + return n; +} + +static int +mkstemp_len (char *tmpl, size_t suff_len, bool dry_run) +{ + return gen_tempname_len (tmpl, dry_run ? GT_NOCREATE : GT_FILE, suff_len); +} + +static int +mkdtemp_len (char *tmpl, size_t suff_len, bool dry_run) +{ + return gen_tempname_len (tmpl, dry_run ? GT_NOCREATE : GT_DIR, suff_len); +} + +int +main (int argc, char **argv) +{ + char const *dest_dir; + char const *dest_dir_arg = NULL; + bool suppress_stderr = false; + int c; + unsigned int n_args; + char *template; + bool use_dest_dir = false; + bool deprecated_t_option = false; + bool create_directory = false; + bool dry_run = false; + int status = EXIT_SUCCESS; + size_t x_count; + char *dest_name; + + initialize_main (&argc, &argv); + set_program_name (argv[0]); + setlocale (LC_ALL, ""); + bindtextdomain (PACKAGE, LOCALEDIR); + textdomain (PACKAGE); + + atexit (close_stdout); + + while ((c = getopt_long (argc, argv, "dp:qtuV", longopts, NULL)) != -1) + { + switch (c) + { + case 'd': + create_directory = true; + break; + case 'p': + dest_dir_arg = optarg; + use_dest_dir = true; + break; + case 'q': + suppress_stderr = true; + break; + case 't': + use_dest_dir = true; + deprecated_t_option = true; + break; + case 'u': + dry_run = true; + break; + + case TMPDIR_OPTION: + use_dest_dir = true; + dest_dir_arg = optarg; + break; + + case_GETOPT_HELP_CHAR; + + case 'V': + case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS); + default: + usage (EXIT_FAILURE); + } + } + + if (suppress_stderr) + { + /* From here on, redirect stderr to /dev/null. + A diagnostic from getopt_long, above, would still go to stderr. */ + if (!freopen ("/dev/null", "wb", stderr)) + error (EXIT_FAILURE, errno, + _("failed to redirect stderr to /dev/null")); + } + + n_args = argc - optind; + if (2 <= n_args) + { + error (0, 0, _("too many templates")); + usage (EXIT_FAILURE); + } + + if (n_args == 0) + { + use_dest_dir = true; + template = (char *) default_template; + } + else + { + template = argv[optind]; + } + + x_count = count_trailing_X_s (template); + if (x_count < 3) + error (EXIT_FAILURE, 0, _("too few X's in template %s"), quote (template)); + + if (use_dest_dir) + { + if (deprecated_t_option) + { + char *env = getenv ("TMPDIR"); + dest_dir = (env && *env + ? env + : (dest_dir_arg ? dest_dir_arg : "/tmp")); + + if (last_component (template) != template) + error (EXIT_FAILURE, 0, + _("invalid template, %s, contains directory separator"), + quote (template)); + } + else + { + if (dest_dir_arg && *dest_dir_arg) + dest_dir = dest_dir_arg; + else + { + char *env = getenv ("TMPDIR"); + dest_dir = (env && *env ? env : "/tmp"); + } + if (IS_ABSOLUTE_FILE_NAME (template)) + error (EXIT_FAILURE, 0, + _("invalid template, %s; with --tmpdir," + " it may not be absolute"), + quote (template)); + } + + template = file_name_concat (dest_dir, template, NULL); + } + else + { + template = xstrdup (template); + } + + /* Make a copy to be used in case of diagnostic, since failing + mkstemp may leave the buffer in an undefined state. */ + dest_name = xstrdup (template); + + if (create_directory) + { + int err = mkdtemp_len (dest_name, x_count, dry_run); + if (err != 0) + { + error (0, errno, _("failed to create directory via template %s"), + quote (template)); + status = EXIT_FAILURE; + } + } + else + { + int fd = mkstemp_len (dest_name, x_count, dry_run); + if (fd < 0 || (!dry_run && close (fd) != 0)) + { + error (0, errno, _("failed to create file via template %s"), + quote (template)); + status = EXIT_FAILURE; + } + } + + if (status == EXIT_SUCCESS) + puts (dest_name); + +#ifdef lint + free (dest_name); + free (template); +#endif + + exit (status); +} + +/* + * Local variables: + * indent-tabs-mode: nil + * End: + */ diff --git a/src/bin/coreutils/src/mv.c b/src/bin/coreutils/src/mv.c index e8b20610e8..132598a87d 100644 --- a/src/bin/coreutils/src/mv.c +++ b/src/bin/coreutils/src/mv.c @@ -1,10 +1,10 @@ /* mv -- move or rename files - Copyright (C) 86, 89, 90, 91, 1995-2007 Free Software Foundation, Inc. + Copyright (C) 86, 89, 90, 91, 1995-2009 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Mike Parker, David MacKenzie, and Jim Meyering */ @@ -22,9 +21,9 @@ #include #include #include +#include #include "system.h" -#include "argmatch.h" #include "backupfile.h" #include "copy.h" #include "cp-hash.h" @@ -32,52 +31,34 @@ #include "filenamecat.h" #include "quote.h" #include "remove.h" +#include "root-dev-ino.h" +#include "priv-set.h" /* The official name of this program (e.g., no `g' prefix). */ #define PROGRAM_NAME "mv" -#define AUTHORS "Mike Parker", "David MacKenzie", "Jim Meyering" - -/* Initial number of entries in each hash table entry's table of inodes. */ -#define INITIAL_HASH_MODULE 100 - -/* Initial number of entries in the inode hash table. */ -#define INITIAL_ENTRY_TAB_SIZE 70 +#define AUTHORS \ + proper_name ("Mike Parker"), \ + proper_name ("David MacKenzie"), \ + proper_name ("Jim Meyering") /* For long options that have no equivalent short option, use a non-character as a pseudo short option, starting with CHAR_MAX + 1. */ enum { - REPLY_OPTION = CHAR_MAX + 1, - STRIP_TRAILING_SLASHES_OPTION + STRIP_TRAILING_SLASHES_OPTION = CHAR_MAX + 1 }; -/* The name this program was run with. */ -char *program_name; - /* Remove any trailing slashes from each SOURCE argument. */ static bool remove_trailing_slashes; -/* Valid arguments to the `--reply' option. */ -static char const* const reply_args[] = -{ - "yes", "no", "query", NULL -}; - -/* The values that correspond to the above strings. */ -static int const reply_vals[] = -{ - I_ALWAYS_YES, I_ALWAYS_NO, I_ASK_USER -}; - static struct option const long_options[] = { {"backup", optional_argument, NULL, 'b'}, {"force", no_argument, NULL, 'f'}, {"interactive", no_argument, NULL, 'i'}, + {"no-clobber", no_argument, NULL, 'n'}, {"no-target-directory", no_argument, NULL, 'T'}, - {"reply", required_argument, NULL, REPLY_OPTION}, /* Deprecated 2005-07-03, - remove in 2008. */ {"strip-trailing-slashes", no_argument, NULL, STRIP_TRAILING_SLASHES_OPTION}, {"suffix", required_argument, NULL, 'S'}, {"target-directory", required_argument, NULL, 't'}, @@ -92,7 +73,6 @@ static void rm_option_init (struct rm_options *x) { x->ignore_missing_files = false; - x->root_dev_ino = NULL; x->recursive = true; x->one_file_system = false; @@ -108,11 +88,22 @@ rm_option_init (struct rm_options *x) the initial working directory, in case one of those is a `.'-relative name. */ x->require_restore_cwd = true; + + { + static struct dev_ino dev_ino_buf; + x->root_dev_ino = get_root_dev_ino (&dev_ino_buf); + if (x->root_dev_ino == NULL) + error (EXIT_FAILURE, errno, _("failed to get attributes of %s"), + quote ("/")); + } } static void cp_option_init (struct cp_options *x) { + bool selinux_enabled = (0 < is_selinux_enabled ()); + + cp_options_default (x); x->copy_as_regular = false; /* FIXME: maybe make this an option */ x->dereference = DEREF_NEVER; x->unlink_dest_before_opening = false; @@ -120,14 +111,18 @@ cp_option_init (struct cp_options *x) x->hard_link = false; x->interactive = I_UNSPECIFIED; x->move_mode = true; - x->chown_privileges = chown_privileges (); x->one_file_system = false; x->preserve_ownership = true; x->preserve_links = true; x->preserve_mode = true; x->preserve_timestamps = true; + x->preserve_security_context = selinux_enabled; + x->reduce_diagnostics = false; x->require_preserve = false; /* FIXME: maybe make this an option */ x->ignore_attributes = false; + x->require_preserve_context = false; + x->preserve_xattr = true; + x->require_preserve_xattr = false; x->recursive = true; x->sparse_mode = SPARSE_AUTO; /* FIXME: maybe make this an option */ x->symbolic_link = false; @@ -135,6 +130,7 @@ cp_option_init (struct cp_options *x) x->mode = 0; x->stdin_tty = isatty (STDIN_FILENO); + x->open_dangling_dest_symlink = false; x->update = false; x->verbose = false; x->dest_info = NULL; @@ -249,9 +245,9 @@ movefile (char *source, char *dest, bool dest_is_dir, /* This code was introduced to handle the ambiguity in the semantics of mv that is induced by the varying semantics of the rename function. - Some systems (e.g., Linux) have a rename function that honors a + Some systems (e.g., GNU/Linux) have a rename function that honors a trailing slash, while others (like Solaris 5,6,7) have a rename - function that ignores a trailing slash. I believe the Linux + function that ignores a trailing slash. I believe the GNU/Linux rename semantics are POSIX and susv2 compliant. */ if (remove_trailing_slashes) @@ -300,6 +296,8 @@ Mandatory arguments to long options are mandatory for short options too.\n\ -b like --backup but does not accept an argument\n\ -f, --force do not prompt before overwriting\n\ -i, --interactive prompt before overwrite\n\ + -n, --no-clobber do not overwrite an existing file\n\ +If you specify more than one of -i, -f, -n, only the final one takes effect.\n\ "), stdout); fputs (_("\ --strip-trailing-slashes remove any trailing slashes from each SOURCE\n\ @@ -329,7 +327,7 @@ the VERSION_CONTROL environment variable. Here are the values:\n\ existing, nil numbered if numbered backups exist, simple otherwise\n\ simple, never always make simple backups\n\ "), stdout); - printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT); + emit_bug_reporting_address (); } exit (status); } @@ -349,20 +347,23 @@ main (int argc, char **argv) char **file; initialize_main (&argc, &argv); - program_name = argv[0]; + set_program_name (argv[0]); setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); - atexit (close_stdout); + atexit (close_stdin); cp_option_init (&x); + /* Try to disable the ability to unlink a directory. */ + priv_set_remove_linkdir (); + /* FIXME: consider not calling getenv for SIMPLE_BACKUP_SUFFIX unless we'll actually use backup_suffix_string. */ backup_suffix_string = getenv ("SIMPLE_BACKUP_SUFFIX"); - while ((c = getopt_long (argc, argv, "bfit:uvS:T", long_options, NULL)) + while ((c = getopt_long (argc, argv, "bfint:uvS:T", long_options, NULL)) != -1) { switch (c) @@ -378,11 +379,8 @@ main (int argc, char **argv) case 'i': x.interactive = I_ASK_USER; break; - case REPLY_OPTION: /* Deprecated */ - x.interactive = XARGMATCH ("--reply", optarg, - reply_args, reply_vals); - error (0, 0, - _("the --reply option is deprecated; use -i or -f instead")); + case 'n': + x.interactive = I_ALWAYS_NO; break; case STRIP_TRAILING_SLASHES_OPTION: remove_trailing_slashes = true; @@ -438,7 +436,7 @@ main (int argc, char **argv) { if (target_directory) error (EXIT_FAILURE, 0, - _("Cannot combine --target-directory (-t) " + _("cannot combine --target-directory (-t) " "and --no-target-directory (-T)")); if (2 < n_files) { @@ -456,6 +454,13 @@ main (int argc, char **argv) quote (file[n_files - 1])); } + if (make_backups && x.interactive == I_ALWAYS_NO) + { + error (0, 0, + _("options --backup and --no-clobber are mutually exclusive")); + usage (EXIT_FAILURE); + } + if (backup_suffix_string) simple_backup_suffix = xstrdup (backup_suffix_string); diff --git a/src/bin/coreutils/src/nice.c b/src/bin/coreutils/src/nice.c index 19b38bc342..ee8cc866e8 100644 --- a/src/bin/coreutils/src/nice.c +++ b/src/bin/coreutils/src/nice.c @@ -1,10 +1,10 @@ /* nice -- run a program with modified niceness - Copyright (C) 1990-2005 Free Software Foundation, Inc. + Copyright (C) 1990-2005, 2007-2008 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* David MacKenzie */ @@ -38,7 +37,7 @@ /* The official name of this program (e.g., no `g' prefix). */ #define PROGRAM_NAME "nice" -#define AUTHORS "David MacKenzie" +#define AUTHORS proper_name ("David MacKenzie") #if HAVE_NICE # define GET_NICENESS() nice (0) @@ -56,9 +55,6 @@ # define NZERO 20 #endif -/* The name this program was run with. */ -char *program_name; - static struct option const longopts[] = { {"adjustment", required_argument, NULL, 'n'}, @@ -85,7 +81,7 @@ With no COMMAND, print the current niceness. Nicenesses range from\n\ fputs (HELP_OPTION_DESCRIPTION, stdout); fputs (VERSION_OPTION_DESCRIPTION, stdout); printf (USAGE_BUILTIN_WARNING, PROGRAM_NAME); - printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT); + emit_bug_reporting_address (); } exit (status); } @@ -100,15 +96,15 @@ main (int argc, char **argv) int i; initialize_main (&argc, &argv); - program_name = argv[0]; + set_program_name (argv[0]); setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); - initialize_exit_failure (EXIT_FAIL); + initialize_exit_failure (EXIT_FAILURE); atexit (close_stdout); - parse_long_options (argc, argv, PROGRAM_NAME, GNU_PACKAGE, VERSION, + parse_long_options (argc, argv, PROGRAM_NAME, PACKAGE_NAME, Version, usage, AUTHORS, (char const *) NULL); for (i = 1; i < argc; /* empty */) @@ -127,7 +123,7 @@ main (int argc, char **argv) char **fake_argv = argv + (i - 1); /* Ensure that any getopt diagnostics use the right name. */ - fake_argv[0] = program_name; + fake_argv[0] = argv[0]; /* Initialize getopt_long's internal state. */ optind = 0; @@ -136,7 +132,7 @@ main (int argc, char **argv) i += optind - 1; if (optc == '?') - usage (EXIT_FAIL); + usage (EXIT_FAILURE); else if (optc == 'n') adjustment_given = optarg; else /* optc == -1 */ @@ -152,7 +148,7 @@ main (int argc, char **argv) enum { MIN_ADJUSTMENT = 1 - 2 * NZERO, MAX_ADJUSTMENT = 2 * NZERO - 1 }; long int tmp; if (LONGINT_OVERFLOW < xstrtol (adjustment_given, NULL, 10, &tmp, "")) - error (EXIT_FAIL, 0, _("invalid adjustment %s"), + error (EXIT_FAILURE, 0, _("invalid adjustment %s"), quote (adjustment_given)); adjustment = MAX (MIN_ADJUSTMENT, MIN (tmp, MAX_ADJUSTMENT)); } @@ -162,13 +158,13 @@ main (int argc, char **argv) if (adjustment_given) { error (0, 0, _("a command must be given with an adjustment")); - usage (EXIT_FAIL); + usage (EXIT_FAILURE); } /* No command given; print the niceness. */ errno = 0; current_niceness = GET_NICENESS (); if (current_niceness == -1 && errno != 0) - error (EXIT_FAIL, errno, _("cannot get niceness")); + error (EXIT_FAILURE, errno, _("cannot get niceness")); printf ("%d\n", current_niceness); exit (EXIT_SUCCESS); } @@ -179,11 +175,11 @@ main (int argc, char **argv) #else current_niceness = GET_NICENESS (); if (current_niceness == -1 && errno != 0) - error (EXIT_FAIL, errno, _("cannot get niceness")); + error (EXIT_FAILURE, errno, _("cannot get niceness")); ok = (setpriority (PRIO_PROCESS, 0, current_niceness + adjustment) == 0); #endif if (!ok) - error (errno == EPERM ? 0 : EXIT_FAIL, errno, _("cannot set niceness")); + error (errno == EPERM ? 0 : EXIT_FAILURE, errno, _("cannot set niceness")); execvp (argv[i], &argv[i]); diff --git a/src/bin/coreutils/src/nl.c b/src/bin/coreutils/src/nl.c index 04c81183a2..56d5a3998c 100644 --- a/src/bin/coreutils/src/nl.c +++ b/src/bin/coreutils/src/nl.c @@ -1,10 +1,10 @@ /* nl -- number lines of files - Copyright (C) 89, 92, 1995-2007 Free Software Foundation, Inc. + Copyright (C) 89, 92, 1995-2009 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Scott Bartram (nancy!scott@uunet.uu.net) Revised by David MacKenzie (djm@gnu.ai.mit.edu) */ @@ -36,7 +35,9 @@ /* The official name of this program (e.g., no `g' prefix). */ #define PROGRAM_NAME "nl" -#define AUTHORS "Scott Bartram", "David MacKenzie" +#define AUTHORS \ + proper_name ("Scott Bartram"), \ + proper_name ("David MacKenzie") /* Line-number formats. They are given an int width, an intmax_t value, and a string separator. */ @@ -60,9 +61,6 @@ enum section Header, Body, Footer, Text }; -/* The name this program was run with. */ -char *program_name; - /* Format of body lines (-b). */ static char const *body_type = "t"; @@ -200,7 +198,7 @@ Mandatory arguments to long options are mandatory for short options too.\n\ -s, --number-separator=STRING add STRING after (possible) line number\n\ "), stdout); fputs (_("\ - -v, --first-page=NUMBER first line number on each logical page\n\ + -v, --starting-line-number=NUMBER first line number on each logical page\n\ -w, --number-width=NUMBER use NUMBER columns for line numbers\n\ "), stdout); fputs (HELP_OPTION_DESCRIPTION, stdout); @@ -226,7 +224,7 @@ FORMAT is one of:\n\ rz right justified, leading zeros\n\ \n\ "), stdout); - printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT); + emit_bug_reporting_address (); } exit (status); } @@ -459,7 +457,7 @@ main (int argc, char **argv) bool ok = true; initialize_main (&argc, &argv); - program_name = argv[0]; + set_program_name (argv[0]); setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); diff --git a/src/bin/coreutils/src/nohup.c b/src/bin/coreutils/src/nohup.c index 1f8e62bc4f..3364e9191a 100644 --- a/src/bin/coreutils/src/nohup.c +++ b/src/bin/coreutils/src/nohup.c @@ -1,10 +1,10 @@ /* nohup -- run a command immune to hangups, with output to a non-tty - Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 2003, 2004, 2005, 2007-2008 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Jim Meyering */ @@ -35,7 +34,7 @@ #define PROGRAM_NAME "nohup" -#define AUTHORS "Jim Meyering" +#define AUTHORS proper_name ("Jim Meyering") /* Exit statuses. */ enum @@ -44,8 +43,6 @@ enum NOHUP_FAILURE = 127 }; -char *program_name; - void usage (int status) { @@ -66,8 +63,15 @@ Run COMMAND, ignoring hangup signals.\n\ "), stdout); fputs (HELP_OPTION_DESCRIPTION, stdout); fputs (VERSION_OPTION_DESCRIPTION, stdout); + printf (_("\n\ +If standard input is a terminal, redirect it from /dev/null.\n\ +If standard output is a terminal, append output to `nohup.out' if possible,\n\ +`$HOME/nohup.out' otherwise.\n\ +If standard error is a terminal, redirect it to standard output.\n\ +To save output to FILE, use `%s COMMAND > FILE'.\n"), + program_name); printf (USAGE_BUILTIN_WARNING, PROGRAM_NAME); - printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT); + emit_bug_reporting_address (); } exit (status); } @@ -83,7 +87,7 @@ main (int argc, char **argv) bool redirecting_stderr; initialize_main (&argc, &argv); - program_name = argv[0]; + set_program_name (argv[0]); setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); @@ -91,7 +95,7 @@ main (int argc, char **argv) initialize_exit_failure (NOHUP_FAILURE); atexit (close_stdout); - parse_long_options (argc, argv, PROGRAM_NAME, GNU_PACKAGE, VERSION, + parse_long_options (argc, argv, PROGRAM_NAME, PACKAGE_NAME, Version, usage, AUTHORS, (char const *) NULL); if (getopt_long (argc, argv, "+", NULL, NULL) != -1) usage (NOHUP_FAILURE); @@ -158,8 +162,8 @@ main (int argc, char **argv) umask (umask_value); error (0, 0, _(ignoring_input - ? "ignoring input and appending output to %s" - : "appending output to %s"), + ? N_("ignoring input and appending output to %s") + : N_("appending output to %s")), quote (file)); free (in_home); } @@ -181,8 +185,8 @@ main (int argc, char **argv) if (!redirecting_stdout) error (0, 0, _(ignoring_input - ? "ignoring input and redirecting stderr to stdout" - : "redirecting stderr to stdout")); + ? N_("ignoring input and redirecting stderr to stdout") + : N_("redirecting stderr to stdout"))); if (dup2 (out_fd, STDERR_FILENO) < 0) error (NOHUP_FAILURE, errno, _("failed to redirect standard error")); diff --git a/src/bin/coreutils/src/od.c b/src/bin/coreutils/src/od.c index 706a46925e..2dcb398377 100644 --- a/src/bin/coreutils/src/od.c +++ b/src/bin/coreutils/src/od.c @@ -1,10 +1,10 @@ /* od -- dump files in octal and other formats - Copyright (C) 92, 1995-2006 Free Software Foundation, Inc. + Copyright (C) 92, 1995-2008 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Jim Meyering. */ @@ -26,21 +25,17 @@ #include "system.h" #include "error.h" #include "quote.h" +#include "xfreopen.h" +#include "xprintf.h" #include "xstrtol.h" /* The official name of this program (e.g., no `g' prefix). */ #define PROGRAM_NAME "od" -#define AUTHORS "Jim Meyering" +#define AUTHORS proper_name ("Jim Meyering") #include -#ifdef HAVE_LONG_DOUBLE -typedef long double LONG_DOUBLE; -#else -typedef double LONG_DOUBLE; -#endif - /* The default number of input bytes per output line. */ #define DEFAULT_BYTES_PER_BLOCK 16 @@ -54,11 +49,6 @@ typedef double LONG_DOUBLE; # define DBL_DIG 15 #endif -/* The number of decimal digits of precision in a long double. */ -#ifndef LDBL_DIG -# define LDBL_DIG DBL_DIG -#endif - #if HAVE_UNSIGNED_LONG_LONG_INT typedef unsigned long long int unsigned_long_long_int; #else @@ -93,35 +83,46 @@ enum output_format CHARACTER }; -/* The maximum number of bytes needed for a format string, - including the trailing null. */ +#define MAX_INTEGRAL_TYPE_SIZE sizeof (unsigned_long_long_int) + +/* The maximum number of bytes needed for a format string, including + the trailing nul. Each format string expects a variable amount of + padding (guaranteed to be at least 1 plus the field width), then an + element that will be formatted in the field. */ enum { FMT_BYTES_ALLOCATED = - MAX ((sizeof " %0" - 1 + INT_STRLEN_BOUND (int) + MAX ((sizeof "%*.99" - 1 + MAX (sizeof "ld", MAX (sizeof PRIdMAX, MAX (sizeof PRIoMAX, MAX (sizeof PRIuMAX, sizeof PRIxMAX))))), - sizeof " %.Le" + 2 * INT_STRLEN_BOUND (int)) + sizeof "%*.99Le") }; +/* Ensure that our choice for FMT_BYTES_ALLOCATED is reasonable. */ +verify (LDBL_DIG <= 99); +verify (MAX_INTEGRAL_TYPE_SIZE * CHAR_BIT / 3 <= 99); + /* Each output format specification (from `-t spec' or from old-style options) is represented by one of these structures. */ struct tspec { enum output_format fmt; - enum size_spec size; - void (*print_function) (size_t, void const *, char const *); - char fmt_string[FMT_BYTES_ALLOCATED]; + enum size_spec size; /* Type of input object. */ + /* FIELDS is the number of fields per line, BLANK is the number of + fields to leave blank. WIDTH is width of one field, excluding + leading space, and PAD is total pad to divide among FIELDS. + PAD is at least as large as FIELDS. */ + void (*print_function) (size_t fields, size_t blank, void const *data, + char const *fmt, int width, int pad); + char fmt_string[FMT_BYTES_ALLOCATED]; /* Of the style "%*d". */ bool hexl_mode_trailer; - int field_width; + int field_width; /* Minimum width of a field, excluding leading space. */ + int pad_width; /* Total padding to be divided among fields. */ }; -/* The name this program was run with. */ -char *program_name; - /* Convert the number of 8-bit bytes of a binary representation to the number of characters (digits + sign if the type is signed) required to represent the same quantity in the specified base/type. @@ -144,8 +145,6 @@ static unsigned int const bytes_to_unsigned_dec_digits[] = static unsigned int const bytes_to_hex_digits[] = {0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32}; -#define MAX_INTEGRAL_TYPE_SIZE sizeof (unsigned_long_long_int) - /* It'll be a while before we see integral types wider than 16 bytes, but if/when it happens, this check will catch it. Without this check, a wider type would provoke a buffer overrun. */ @@ -168,7 +167,7 @@ static const int width_bytes[] = sizeof (unsigned_long_long_int), sizeof (float), sizeof (double), - sizeof (LONG_DOUBLE) + sizeof (long double) }; /* Ensure that for each member of `enum size_spec' there is an @@ -176,7 +175,7 @@ static const int width_bytes[] = verify (sizeof width_bytes / sizeof width_bytes[0] == N_SIZE_SPECS); /* Names for some non-printing characters. */ -static const char *const charname[33] = +static char const charname[33][4] = { "nul", "soh", "stx", "etx", "eot", "enq", "ack", "bel", "bs", "ht", "nl", "vt", "ff", "cr", "so", "si", @@ -196,7 +195,10 @@ static int address_base; /* Width of a normal address. */ static int address_pad_len; +/* Minimum length when detecting --strings. */ static size_t string_min; + +/* True when in --strings mode. */ static bool flag_dump_strings; /* True if we should recognize the older non-option arguments @@ -268,7 +270,7 @@ static bool have_read_stdin; /* Map the size in bytes to a type identifier. */ static enum size_spec integral_type_size[MAX_INTEGRAL_TYPE_SIZE + 1]; -#define MAX_FP_TYPE_SIZE sizeof (LONG_DOUBLE) +#define MAX_FP_TYPE_SIZE sizeof (long double) static enum size_spec fp_type_size[MAX_FP_TYPE_SIZE + 1]; static char const short_options[] = "A:aBbcDdeFfHhIij:LlN:OoS:st:vw::Xx"; @@ -383,113 +385,51 @@ for sizeof(double) or L for sizeof(long double).\n\ fputs (_("\ \n\ RADIX is d for decimal, o for octal, x for hexadecimal or n for none.\n\ -BYTES is hexadecimal with 0x or 0X prefix, it is multiplied by 512\n\ -with b suffix, by 1024 with k and by 1048576 with m. Adding a z suffix to\n\ -any type adds a display of printable characters to the end of each line\n\ -of output. \ +BYTES is hexadecimal with 0x or 0X prefix, and may have a multiplier suffix:\n\ +b 512, kB 1000, K 1024, MB 1000*1000, M 1024*1024,\n\ +GB 1000*1000*1000, G 1024*1024*1024, and so on for T, P, E, Z, Y.\n\ +Adding a z suffix to any type displays printable characters at the end of each\n\ +output line.\n\ "), stdout); fputs (_("\ ---string without a number implies 3. --width without a number\n\ -implies 32. By default, od uses -A o -t d2 -w16.\n\ +Option --string without a number implies 3; option --width without a number\n\ +implies 32. By default, od uses -A o -t oS -w16.\n\ "), stdout); - printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT); + emit_bug_reporting_address (); } exit (status); } /* Define the print functions. */ -static void -print_s_char (size_t n_bytes, void const *block, char const *fmt_string) -{ - signed char const *p = block; - size_t i; - for (i = n_bytes / sizeof *p; i != 0; i--) - printf (fmt_string, *p++); +#define PRINT_TYPE(N, T) \ +static void \ +N (size_t fields, size_t blank, void const *block, \ + char const *fmt_string, int width, int pad) \ +{ \ + T const *p = block; \ + size_t i; \ + int pad_remaining = pad; \ + for (i = fields; blank < i; i--) \ + { \ + int next_pad = pad * (i - 1) / fields; \ + xprintf (fmt_string, pad_remaining - next_pad + width, *p++); \ + pad_remaining = next_pad; \ + } \ } -static void -print_char (size_t n_bytes, void const *block, char const *fmt_string) -{ - unsigned char const *p = block; - size_t i; - for (i = n_bytes / sizeof *p; i != 0; i--) - printf (fmt_string, *p++); -} +PRINT_TYPE (print_s_char, signed char) +PRINT_TYPE (print_char, unsigned char) +PRINT_TYPE (print_s_short, short int) +PRINT_TYPE (print_short, unsigned short int) +PRINT_TYPE (print_int, unsigned int) +PRINT_TYPE (print_long, unsigned long int) +PRINT_TYPE (print_long_long, unsigned_long_long_int) +PRINT_TYPE (print_float, float) +PRINT_TYPE (print_double, double) +PRINT_TYPE (print_long_double, long double) -static void -print_s_short (size_t n_bytes, void const *block, char const *fmt_string) -{ - short int const *p = block; - size_t i; - for (i = n_bytes / sizeof *p; i != 0; i--) - printf (fmt_string, *p++); -} - -static void -print_short (size_t n_bytes, void const *block, char const *fmt_string) -{ - unsigned short int const *p = block; - size_t i; - for (i = n_bytes / sizeof *p; i != 0; i--) - printf (fmt_string, *p++); -} - -static void -print_int (size_t n_bytes, void const *block, char const *fmt_string) -{ - unsigned int const *p = block; - size_t i; - for (i = n_bytes / sizeof *p; i != 0; i--) - printf (fmt_string, *p++); -} - -static void -print_long (size_t n_bytes, void const *block, char const *fmt_string) -{ - unsigned long int const *p = block; - size_t i; - for (i = n_bytes / sizeof *p; i != 0; i--) - printf (fmt_string, *p++); -} - -static void -print_long_long (size_t n_bytes, void const *block, char const *fmt_string) -{ - unsigned_long_long_int const *p = block; - size_t i; - for (i = n_bytes / sizeof *p; i != 0; i--) - printf (fmt_string, *p++); -} - -static void -print_float (size_t n_bytes, void const *block, char const *fmt_string) -{ - float const *p = block; - size_t i; - for (i = n_bytes / sizeof *p; i != 0; i--) - printf (fmt_string, *p++); -} - -static void -print_double (size_t n_bytes, void const *block, char const *fmt_string) -{ - double const *p = block; - size_t i; - for (i = n_bytes / sizeof *p; i != 0; i--) - printf (fmt_string, *p++); -} - -#ifdef HAVE_LONG_DOUBLE -static void -print_long_double (size_t n_bytes, void const *block, char const *fmt_string) -{ - long double const *p = block; - size_t i; - for (i = n_bytes / sizeof *p; i != 0; i--) - printf (fmt_string, *p++); -} -#endif +#undef PRINT_TYPE static void dump_hexl_mode_trailer (size_t n_bytes, const char *block) @@ -506,16 +446,19 @@ dump_hexl_mode_trailer (size_t n_bytes, const char *block) } static void -print_named_ascii (size_t n_bytes, void const *block, - const char *unused_fmt_string ATTRIBUTE_UNUSED) +print_named_ascii (size_t fields, size_t blank, void const *block, + const char *unused_fmt_string ATTRIBUTE_UNUSED, + int width, int pad) { unsigned char const *p = block; size_t i; - for (i = n_bytes; i > 0; i--) + int pad_remaining = pad; + for (i = fields; blank < i; i--) { + int next_pad = pad * (i - 1) / fields; int masked_c = *p++ & 0x7f; const char *s; - char buf[5]; + char buf[2]; if (masked_c == 127) s = "del"; @@ -523,66 +466,72 @@ print_named_ascii (size_t n_bytes, void const *block, s = charname[masked_c]; else { - sprintf (buf, " %c", masked_c); + buf[0] = masked_c; + buf[1] = 0; s = buf; } - printf (" %3s", s); + xprintf ("%*s", pad_remaining - next_pad + width, s); + pad_remaining = next_pad; } } static void -print_ascii (size_t n_bytes, void const *block, - const char *unused_fmt_string ATTRIBUTE_UNUSED) +print_ascii (size_t fields, size_t blank, void const *block, + const char *unused_fmt_string ATTRIBUTE_UNUSED, int width, + int pad) { unsigned char const *p = block; size_t i; - for (i = n_bytes; i > 0; i--) + int pad_remaining = pad; + for (i = fields; blank < i; i--) { + int next_pad = pad * (i - 1) / fields; unsigned char c = *p++; const char *s; - char buf[5]; + char buf[4]; switch (c) { case '\0': - s = " \\0"; + s = "\\0"; break; case '\a': - s = " \\a"; + s = "\\a"; break; case '\b': - s = " \\b"; + s = "\\b"; break; case '\f': - s = " \\f"; + s = "\\f"; break; case '\n': - s = " \\n"; + s = "\\n"; break; case '\r': - s = " \\r"; + s = "\\r"; break; case '\t': - s = " \\t"; + s = "\\t"; break; case '\v': - s = " \\v"; + s = "\\v"; break; default: - sprintf (buf, (isprint (c) ? " %c" : "%03o"), c); + sprintf (buf, (isprint (c) ? "%c" : "%03o"), c); s = buf; } - printf (" %3s", s); + xprintf ("%*s", pad_remaining - next_pad + width, s); + pad_remaining = next_pad; } } @@ -622,8 +571,11 @@ simple_strtoul (const char *s, const char **p, unsigned long int *val) fmt = SIGNED_DECIMAL; size = INT or LONG; (whichever integral_type_size[4] resolves to) print_function = print_int; (assuming size == INT) - fmt_string = "%011d%c"; + field_width = 11; + fmt_string = "%*d"; } + pad_width is determined later, but is at least as large as the + number of fields printed per row. S_ORIG is solely for reporting errors. It should be the full format string argument. */ @@ -636,7 +588,8 @@ decode_one_format (const char *s_orig, const char *s, const char **next, unsigned long int size; enum output_format fmt; const char *pre_fmt_string; - void (*print_function) (size_t, void const *, char const *); + void (*print_function) (size_t, size_t, void const *, char const *, + int, int); const char *p; char c; int field_width; @@ -710,28 +663,28 @@ this system doesn't provide a %lu-byte integral type"), quote (s_orig), size); { case 'd': fmt = SIGNED_DECIMAL; - sprintf (tspec->fmt_string, " %%%d%s", - (field_width = bytes_to_signed_dec_digits[size]), + field_width = bytes_to_signed_dec_digits[size]; + sprintf (tspec->fmt_string, "%%*%s", ISPEC_TO_FORMAT (size_spec, "d", "ld", PRIdMAX)); break; case 'o': fmt = OCTAL; - sprintf (tspec->fmt_string, " %%0%d%s", + sprintf (tspec->fmt_string, "%%*.%d%s", (field_width = bytes_to_oct_digits[size]), ISPEC_TO_FORMAT (size_spec, "o", "lo", PRIoMAX)); break; case 'u': fmt = UNSIGNED_DECIMAL; - sprintf (tspec->fmt_string, " %%%d%s", - (field_width = bytes_to_unsigned_dec_digits[size]), + field_width = bytes_to_unsigned_dec_digits[size]; + sprintf (tspec->fmt_string, "%%*%s", ISPEC_TO_FORMAT (size_spec, "u", "lu", PRIuMAX)); break; case 'x': fmt = HEXADECIMAL; - sprintf (tspec->fmt_string, " %%0%d%s", + sprintf (tspec->fmt_string, "%%*.%d%s", (field_width = bytes_to_hex_digits[size]), ISPEC_TO_FORMAT (size_spec, "x", "lx", PRIxMAX)); break; @@ -790,7 +743,7 @@ this system doesn't provide a %lu-byte integral type"), quote (s_orig), size); case 'L': ++s; - size = sizeof (LONG_DOUBLE); + size = sizeof (long double); break; default: @@ -824,31 +777,30 @@ this system doesn't provide a %lu-byte floating point type"), { case FLOAT_SINGLE: print_function = print_float; - /* Don't use %#e; not all systems support it. */ - pre_fmt_string = " %%%d.%de"; + /* FIXME - should we use %g instead of %e? */ + pre_fmt_string = "%%*.%de"; precision = FLT_DIG; break; case FLOAT_DOUBLE: print_function = print_double; - pre_fmt_string = " %%%d.%de"; + pre_fmt_string = "%%*.%de"; precision = DBL_DIG; break; -#ifdef HAVE_LONG_DOUBLE case FLOAT_LONG_DOUBLE: print_function = print_long_double; - pre_fmt_string = " %%%d.%dLe"; + pre_fmt_string = "%%*.%dLe"; precision = LDBL_DIG; break; -#endif default: abort (); } field_width = precision + 8; - sprintf (tspec->fmt_string, pre_fmt_string, field_width, precision); + sprintf (tspec->fmt_string, pre_fmt_string, precision); + assert (strlen (tspec->fmt_string) < FMT_BYTES_ALLOCATED); break; case 'a': @@ -913,7 +865,7 @@ open_next_file (void) in_stream = stdin; have_read_stdin = true; if (O_BINARY && ! isatty (STDIN_FILENO)) - freopen (NULL, "rb", stdin); + xfreopen (NULL, "rb", stdin); } else { @@ -1034,13 +986,14 @@ skip (uintmax_t n_skip) { /* The st_size field is valid only for regular files (and for symbolic links, which cannot occur here). - If the number of bytes left to skip is at least - as large as the size of the current file, we can - decrement n_skip and go on to the next file. */ - - if (S_ISREG (file_stats.st_mode) && 0 <= file_stats.st_size) + If the number of bytes left to skip is larger than + the size of the current file, we can decrement n_skip + and go on to the next file. Skip this optimization also + when st_size is 0, because some kernels report that + nonempty files in /proc have st_size == 0. */ + if (S_ISREG (file_stats.st_mode) && 0 < file_stats.st_size) { - if ((uintmax_t) file_stats.st_size <= n_skip) + if ((uintmax_t) file_stats.st_size < n_skip) n_skip -= file_stats.st_size; else { @@ -1167,8 +1120,7 @@ format_address_label (uintmax_t address, char c) for a sequence of identical input blocks is the output for the first block followed by an asterisk alone on a line. It is valid to compare the blocks PREV_BLOCK and CURR_BLOCK only when N_BYTES == BYTES_PER_BLOCK. - That condition may be false only for the last input block -- and then - only when it has not been padded to length BYTES_PER_BLOCK. */ + That condition may be false only for the last input block. */ static void write_block (uintmax_t current_offset, size_t n_bytes, @@ -1201,18 +1153,23 @@ write_block (uintmax_t current_offset, size_t n_bytes, prev_pair_equal = false; for (i = 0; i < n_specs; i++) { + int datum_width = width_bytes[spec[i].size]; + int fields_per_block = bytes_per_block / datum_width; + int blank_fields = (bytes_per_block - n_bytes) / datum_width; if (i == 0) format_address (current_offset, '\0'); else printf ("%*s", address_pad_len, ""); - (*spec[i].print_function) (n_bytes, curr_block, spec[i].fmt_string); + (*spec[i].print_function) (fields_per_block, blank_fields, + curr_block, spec[i].fmt_string, + spec[i].field_width, spec[i].pad_width); if (spec[i].hexl_mode_trailer) { /* space-pad out to full line width, then dump the trailer */ - int datum_width = width_bytes[spec[i].size]; - int blank_fields = (bytes_per_block - n_bytes) / datum_width; - int field_width = spec[i].field_width + 1; - printf ("%*s", blank_fields * field_width, ""); + int field_width = spec[i].field_width; + int pad_width = (spec[i].pad_width * blank_fields + / fields_per_block); + printf ("%*s", blank_fields * field_width + pad_width, ""); dump_hexl_mode_trailer (n_bytes, curr_block); } putchar ('\n'); @@ -1416,13 +1373,12 @@ dump (void) l_c_m = get_lcm (); - /* Make bytes_to_write the smallest multiple of l_c_m that + /* Ensure zero-byte padding up to the smallest multiple of l_c_m that is at least as large as n_bytes_read. */ bytes_to_write = l_c_m * ((n_bytes_read + l_c_m - 1) / l_c_m); memset (block[idx] + n_bytes_read, 0, bytes_to_write - n_bytes_read); - write_block (current_offset, bytes_to_write, - block[!idx], block[idx]); + write_block (current_offset, n_bytes_read, block[!idx], block[idx]); current_offset += n_bytes_read; } @@ -1555,7 +1511,6 @@ dump_strings (void) int main (int argc, char **argv) { - int c; int n_files; size_t i; int l_c_m; @@ -1563,13 +1518,15 @@ main (int argc, char **argv) bool modern = false; bool width_specified = false; bool ok = true; + size_t width_per_block = 0; + static char const multipliers[] = "bEGKkMmPTYZ0"; /* The old-style `pseudo starting address' to be printed in parentheses after any true address. */ uintmax_t pseudo_start IF_LINT (= 0); initialize_main (&argc, &argv); - program_name = argv[0]; + set_program_name (argv[0]); setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); @@ -1593,10 +1550,10 @@ main (int argc, char **argv) fp_type_size[i] = NO_SIZE; fp_type_size[sizeof (float)] = FLOAT_SINGLE; - /* The array entry for `double' is filled in after that for LONG_DOUBLE - so that if `long double' is the same type or if long double isn't - supported FLOAT_LONG_DOUBLE will never be used. */ - fp_type_size[sizeof (LONG_DOUBLE)] = FLOAT_LONG_DOUBLE; + /* The array entry for `double' is filled in after that for `long double' + so that if they are the same size, we avoid any overhead of + long double computation in libc. */ + fp_type_size[sizeof (long double)] = FLOAT_LONG_DOUBLE; fp_type_size[sizeof (double)] = FLOAT_DOUBLE; n_specs = 0; @@ -1608,11 +1565,14 @@ main (int argc, char **argv) address_pad_len = 7; flag_dump_strings = false; - while ((c = getopt_long (argc, argv, short_options, long_options, NULL)) - != -1) + for (;;) { uintmax_t tmp; enum strtol_error s_err; + int oi = -1; + int c = getopt_long (argc, argv, short_options, long_options, &oi); + if (c == -1) + break; switch (c) { @@ -1650,18 +1610,19 @@ it must be one character from [doxn]"), case 'j': modern = true; - s_err = xstrtoumax (optarg, NULL, 0, &n_bytes_to_skip, "bkm"); + s_err = xstrtoumax (optarg, NULL, 0, &n_bytes_to_skip, multipliers); if (s_err != LONGINT_OK) - STRTOL_FATAL_ERROR (optarg, _("skip argument"), s_err); + xstrtol_fatal (s_err, oi, c, long_options, optarg); break; case 'N': modern = true; limit_bytes_to_format = true; - s_err = xstrtoumax (optarg, NULL, 0, &max_bytes_to_format, "bkm"); + s_err = xstrtoumax (optarg, NULL, 0, &max_bytes_to_format, + multipliers); if (s_err != LONGINT_OK) - STRTOL_FATAL_ERROR (optarg, _("limit argument"), s_err); + xstrtol_fatal (s_err, oi, c, long_options, optarg); break; case 'S': @@ -1670,9 +1631,9 @@ it must be one character from [doxn]"), string_min = 3; else { - s_err = xstrtoumax (optarg, NULL, 0, &tmp, "bkm"); + s_err = xstrtoumax (optarg, NULL, 0, &tmp, multipliers); if (s_err != LONGINT_OK) - STRTOL_FATAL_ERROR (optarg, _("minimum string length"), s_err); + xstrtol_fatal (s_err, oi, c, long_options, optarg); /* The minimum string length may be no larger than SIZE_MAX, since we may allocate a buffer of this size. */ @@ -1744,7 +1705,7 @@ it must be one character from [doxn]"), uintmax_t w_tmp; s_err = xstrtoumax (optarg, NULL, 10, &w_tmp, ""); if (s_err != LONGINT_OK) - STRTOL_FATAL_ERROR (optarg, _("width specification"), s_err); + xstrtol_fatal (s_err, oi, c, long_options, optarg); if (SIZE_MAX < w_tmp) error (EXIT_FAILURE, 0, _("%s is too large"), optarg); desired_width = w_tmp; @@ -1841,7 +1802,7 @@ it must be one character from [doxn]"), { error (0, 0, _("extra operand %s"), quote (argv[optind + 1])); error (0, 0, "%s\n", - _("Compatibility mode supports at most one file.")); + _("compatibility mode supports at most one file")); usage (EXIT_FAILURE); } } @@ -1918,11 +1879,31 @@ it must be one character from [doxn]"), bytes_per_block = l_c_m; } -#ifdef DEBUG + /* Compute padding necessary to align output block. */ for (i = 0; i < n_specs; i++) { - printf (_("%d: fmt=\"%s\" width=%d\n"), - i, spec[i].fmt_string, width_bytes[spec[i].size]); + int fields_per_block = bytes_per_block / width_bytes[spec[i].size]; + int block_width = (spec[i].field_width + 1) * fields_per_block; + if (width_per_block < block_width) + width_per_block = block_width; + } + for (i = 0; i < n_specs; i++) + { + int fields_per_block = bytes_per_block / width_bytes[spec[i].size]; + int block_width = spec[i].field_width * fields_per_block; + spec[i].pad_width = width_per_block - block_width; + } + +#ifdef DEBUG + printf ("lcm=%d, width_per_block=%zu\n", l_c_m, width_per_block); + for (i = 0; i < n_specs; i++) + { + int fields_per_block = bytes_per_block / width_bytes[spec[i].size]; + assert (bytes_per_block % width_bytes[spec[i].size] == 0); + assert (1 <= spec[i].pad_width / fields_per_block); + printf ("%d: fmt=\"%s\" in_width=%d out_width=%d pad=%d\n", + i, spec[i].fmt_string, width_bytes[spec[i].size], + spec[i].field_width, spec[i].pad_width); } #endif diff --git a/src/bin/coreutils/src/operand2sig.c b/src/bin/coreutils/src/operand2sig.c new file mode 100644 index 0000000000..23f44bc6df --- /dev/null +++ b/src/bin/coreutils/src/operand2sig.c @@ -0,0 +1,83 @@ +/* operand2sig.c -- common function for parsing signal specifications + Copyright (C) 2008, 2009 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* Extracted from kill.c/timeout.c by Pádraig Brady. + FIXME: Move this to gnulib/str2sig.c */ + + +/* Convert OPERAND to a signal number with printable representation SIGNAME. + Return the signal number, or -1 if unsuccessful. */ + +#include +#include +#include + +#if HAVE_SYS_WAIT_H +# include +#endif +#ifndef WIFSIGNALED +# define WIFSIGNALED(s) (((s) & 0xFFFF) - 1 < (unsigned int) 0xFF) +#endif +#ifndef WTERMSIG +# define WTERMSIG(s) ((s) & 0x7F) +#endif + +#include "system.h" +#include "error.h" +#include "sig2str.h" +#include "operand2sig.h" + +extern int +operand2sig (char const *operand, char *signame) +{ + int signum; + + if (ISDIGIT (*operand)) + { + char *endp; + long int l = (errno = 0, strtol (operand, &endp, 10)); + int i = l; + signum = (operand == endp || *endp || errno || i != l ? -1 + : WIFSIGNALED (i) ? WTERMSIG (i) : i); + } + else + { + /* Convert signal to upper case in the C locale, not in the + current locale. Don't assume ASCII; it might be EBCDIC. */ + char *upcased = xstrdup (operand); + char *p; + for (p = upcased; *p; p++) + if (strchr ("abcdefghijklmnopqrstuvwxyz", *p)) + *p += 'A' - 'a'; + + /* Look for the signal name, possibly prefixed by "SIG", + and possibly lowercased. */ + if (!(str2sig (upcased, &signum) == 0 + || (upcased[0] == 'S' && upcased[1] == 'I' && upcased[2] == 'G' + && str2sig (upcased + 3, &signum) == 0))) + signum = -1; + + free (upcased); + } + + if (signum < 0 || sig2str (signum, signame) != 0) + { + error (0, 0, _("%s: invalid signal"), operand); + return -1; + } + + return signum; +} diff --git a/src/bin/coreutils/src/operand2sig.h b/src/bin/coreutils/src/operand2sig.h new file mode 100644 index 0000000000..165e6cbb82 --- /dev/null +++ b/src/bin/coreutils/src/operand2sig.h @@ -0,0 +1,18 @@ +/* operand2sig.h -- prototype for signal specification function + + Copyright (C) 2008 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +extern int operand2sig (char const *operand, char *signame); diff --git a/src/bin/coreutils/src/paste.c b/src/bin/coreutils/src/paste.c index 414fb88303..f04bcc3b1e 100644 --- a/src/bin/coreutils/src/paste.c +++ b/src/bin/coreutils/src/paste.c @@ -1,11 +1,11 @@ /* paste - merge lines of files - Copyright (C) 1997-2005 Free Software Foundation, Inc. + Copyright (C) 1997-2005, 2008 Free Software Foundation, Inc. Copyright (C) 1984 David M. Ihnat - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by David Ihnat. */ @@ -43,18 +42,18 @@ #include #include "system.h" #include "error.h" +#include "quotearg.h" /* The official name of this program (e.g., no `g' prefix). */ #define PROGRAM_NAME "paste" -#define AUTHORS "David M. Ihnat", "David MacKenzie" +#define AUTHORS \ + proper_name ("David M. Ihnat"), \ + proper_name ("David MacKenzie") /* Indicates that no delimiter should be added in the current position. */ #define EMPTY_DELIM '\0' -/* Name this program was run with. */ -char *program_name; - /* If nonzero, we have read standard input at some point. */ static bool have_read_stdin; @@ -80,12 +79,17 @@ static struct option const longopts[] = /* Set globals delims and delim_end. Copy STRPTR to DELIMS, converting backslash representations of special characters in STRPTR to their actual values. The set of possible backslash characters has been expanded beyond - that recognized by the Unix version. */ + that recognized by the Unix version. + Return 0 upon success. + If the string ends in an odd number of backslashes, ignore the + final backslash and return nonzero. */ -static void +static int collapse_escapes (char const *strptr) { char *strout = xstrdup (strptr); + bool backslash_at_end = false; + delims = strout; while (*strptr) @@ -124,6 +128,14 @@ collapse_escapes (char const *strptr) *strout++ = '\v'; break; + case '\\': + *strout++ = '\\'; + break; + + case '\0': + backslash_at_end = true; + goto done; + default: *strout++ = *strptr; break; @@ -131,7 +143,11 @@ collapse_escapes (char const *strptr) strptr++; } } + + done:; + delim_end = strout; + return backslash_at_end ? 1 : 0; } /* Report a write error and exit. */ @@ -434,7 +450,7 @@ Mandatory arguments to long options are mandatory for short options too.\n\ fputs (HELP_OPTION_DESCRIPTION, stdout); fputs (VERSION_OPTION_DESCRIPTION, stdout); /* FIXME: add a couple of examples. */ - printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT); + emit_bug_reporting_address (); } exit (status); } @@ -447,7 +463,7 @@ main (int argc, char **argv) char const *delim_arg = "\t"; initialize_main (&argc, &argv); - program_name = argv[0]; + set_program_name (argv[0]); setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); @@ -480,9 +496,17 @@ main (int argc, char **argv) } if (optind == argc) - argv[argc++] = "-"; + argv[argc++] = bad_cast ("-"); - collapse_escapes (delim_arg); + if (collapse_escapes (delim_arg)) + { + /* Don't use the default quoting style, because that would double the + number of displayed backslashes, making the diagnostic look bogus. */ + set_quoting_style (NULL, escape_quoting_style); + error (EXIT_FAILURE, 0, + _("delimiter list ends with an unescaped backslash: %s"), + quotearg_colon (delim_arg)); + } if (!serial_merge) ok = paste_parallel (argc - optind, &argv[optind]); diff --git a/src/bin/coreutils/src/pathchk.c b/src/bin/coreutils/src/pathchk.c index 2fc55d3467..526134507b 100644 --- a/src/bin/coreutils/src/pathchk.c +++ b/src/bin/coreutils/src/pathchk.c @@ -1,10 +1,10 @@ /* pathchk -- check whether file names are valid or portable - Copyright (C) 1991-2006 Free Software Foundation, Inc. + Copyright (C) 1991-2009 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ #include #include @@ -25,7 +24,6 @@ #include "system.h" #include "error.h" -#include "euidaccess.h" #include "quote.h" #include "quotearg.h" @@ -37,7 +35,10 @@ /* The official name of this program (e.g., no `g' prefix). */ #define PROGRAM_NAME "pathchk" -#define AUTHORS "Paul Eggert", "David MacKenzie", "Jim Meyering" +#define AUTHORS \ + proper_name ("Paul Eggert"), \ + proper_name ("David MacKenzie"), \ + proper_name ("Jim Meyering") #ifndef _POSIX_PATH_MAX # define _POSIX_PATH_MAX 256 @@ -70,9 +71,6 @@ static bool validate_file_name (char *, bool, bool); -/* The name this program was run with. */ -char *program_name; - /* For long options that have no equivalent short option, use a non-character as a pseudo short option, starting with CHAR_MAX + 1. */ enum @@ -98,7 +96,7 @@ usage (int status) { printf (_("Usage: %s [OPTION]... NAME...\n"), program_name); fputs (_("\ -Diagnose unportable constructs in NAME.\n\ +Diagnose invalid or unportable file names.\n\ \n\ -p check for most POSIX systems\n\ -P check for empty names and leading \"-\"\n\ @@ -106,7 +104,7 @@ Diagnose unportable constructs in NAME.\n\ "), stdout); fputs (HELP_OPTION_DESCRIPTION, stdout); fputs (VERSION_OPTION_DESCRIPTION, stdout); - printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT); + emit_bug_reporting_address (); } exit (status); } @@ -120,7 +118,7 @@ main (int argc, char **argv) int optc; initialize_main (&argc, &argv); - program_name = argv[0]; + set_program_name (argv[0]); setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); @@ -200,7 +198,7 @@ portable_chars_only (char const *file, size_t filelen) if (*invalid) { - mbstate_t mbstate = { 0, }; + DECLARE_ZEROED_AGGREGATE (mbstate_t, mbstate); size_t charlen = mbrlen (invalid, filelen - validlen, &mbstate); error (0, 0, _("nonportable character %s in file name %s"), @@ -325,7 +323,7 @@ validate_file_name (char *file, bool check_basic_portability, dir); return false; } - maxsize = MIN (size, SIZE_MAX); + maxsize = MIN (size, SSIZE_MAX); } if (maxsize <= filelen) @@ -387,7 +385,7 @@ validate_file_name (char *file, bool check_basic_portability, len = pathconf (dir, _PC_NAME_MAX); *start = c; if (0 <= len) - name_max = MIN (len, SIZE_MAX); + name_max = MIN (len, SSIZE_MAX); else switch (errno) { diff --git a/src/bin/coreutils/src/pinky.c b/src/bin/coreutils/src/pinky.c index 885012b3dd..9575923023 100644 --- a/src/bin/coreutils/src/pinky.c +++ b/src/bin/coreutils/src/pinky.c @@ -1,10 +1,10 @@ /* GNU's pinky. - Copyright (C) 1992-1997, 1999-2006 Free Software Foundation, Inc. + Copyright (C) 1992-1997, 1999-2006, 2008 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Created by hacking who.c by Kaveh Ghazi ghazi@caip.rutgers.edu */ @@ -27,23 +26,21 @@ #include "canon-host.h" #include "error.h" -#include "hard-locale.h" -#include "inttostr.h" #include "readutmp.h" /* The official name of this program (e.g., no `g' prefix). */ #define PROGRAM_NAME "pinky" -#define AUTHORS "Joseph Arceneaux", "David MacKenzie", "Kaveh Ghazi" +#define AUTHORS \ + proper_name ("Joseph Arceneaux"), \ + proper_name ("David MacKenzie"), \ + proper_name ("Kaveh Ghazi") #ifndef MAXHOSTNAMELEN # define MAXHOSTNAMELEN 64 #endif -char *ttyname (); - -/* The name this program was run with. */ -const char *program_name; +char *ttyname (int); /* If true, display the hours:minutes since each user has touched the keyboard, or blank if within the last minute, or days followed @@ -198,7 +195,7 @@ time_string (const STRUCT_UTMP *utmp_ent) return buf; } else - return TYPE_SIGNED (time_t) ? imaxtostr (t, buf) : umaxtostr (t, buf); + return timetostr (t, buf); } /* Display a line of information about UTMP_ENT. */ @@ -252,7 +249,8 @@ print_entry (const STRUCT_UTMP *utmp_ent) name[UT_USER_SIZE] = '\0'; pw = getpwnam (name); if (pw == NULL) - printf (" %19s", " ???"); + /* TRANSLATORS: Real name is unknown; at most 19 characters. */ + printf (" %19s", _(" ???")); else { char *const comma = strchr (pw->pw_gecos, ','); @@ -275,7 +273,8 @@ print_entry (const STRUCT_UTMP *utmp_ent) if (last_change) printf (" %-6s", idle_string (last_change)); else - printf (" %-6s", "???"); + /* TRANSLATORS: Idle time is unknown; at most 5 characters. */ + printf (" %-6s", _("?????")); } printf (" %s", time_string (utmp_ent)); @@ -330,6 +329,7 @@ print_long_entry (const char name[]) printf (_("In real life: ")); if (pw == NULL) { + /* TRANSLATORS: Real name is unknown; no hard limit. */ printf (" %s", _("???\n")); return; } @@ -530,7 +530,7 @@ usage (int status) A lightweight `finger' program; print user information.\n\ The utmp file will be %s.\n\ "), UTMP_FILE); - printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT); + emit_bug_reporting_address (); } exit (status); } @@ -542,7 +542,7 @@ main (int argc, char **argv) int n_users; initialize_main (&argc, &argv); - program_name = argv[0]; + set_program_name (argv[0]); setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); diff --git a/src/bin/coreutils/src/pr.c b/src/bin/coreutils/src/pr.c index e0aea224e4..f0910eb305 100644 --- a/src/bin/coreutils/src/pr.c +++ b/src/bin/coreutils/src/pr.c @@ -1,10 +1,10 @@ /* pr -- convert text files for printing. - Copyright (C) 88, 91, 1995-2007 Free Software Foundation, Inc. + Copyright (C) 88, 91, 1995-2009 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* By Pete TerMaat, with considerable refinement by Roland Huebner. */ @@ -74,7 +73,7 @@ The interference of the POSIX-compliant small letter options -w and -s: (`interference' means `setting a _separator_ with -s switches off the - column sturctur and the default - not generally - page_width, + column structure and the default - not generally - page_width, acts on -w option') options: text form / separator: equivalent new options: -w l -s[x] @@ -93,7 +92,7 @@ Options: Including version 1.22i: - Some SMALL LETTER options has been redefined with the object of a + Some SMALL LETTER options have been redefined with the object of a better POSIX compliance. The output of some further cases has been adapted to other UNIXes. A violation of downward compatibility has to be accepted. @@ -315,8 +314,6 @@ #include #include "system.h" #include "error.h" -#include "hard-locale.h" -#include "inttostr.h" #include "mbswidth.h" #include "quote.h" #include "stat-time.h" @@ -327,7 +324,9 @@ /* The official name of this program (e.g., no `g' prefix). */ #define PROGRAM_NAME "pr" -#define AUTHORS "Pete TerMaat", "Roland Huebner" +#define AUTHORS \ + proper_name ("Pete TerMaat"), \ + proper_name ("Roland Huebner") /* Used with start_position in the struct COLUMN described below. If start_position == ANYWHERE, we aren't truncating columns and @@ -414,8 +413,6 @@ struct COLUMN typedef struct COLUMN COLUMN; -#define NULLCOL (COLUMN *)0 - static int char_to_clump (char c); static bool read_line (COLUMN *p); static bool print_page (void); @@ -445,9 +442,6 @@ static void cleanup (void); static void print_sep_string (void); static void separator_string (const char *optarg_S); -/* The name under which this program was invoked. */ -char *program_name; - /* All of the columns to print. */ static COLUMN *column_vector; @@ -459,7 +453,7 @@ static char *buff; /* Index of the position in buff where the next character will be stored. */ -static int buff_current; +static unsigned int buff_current; /* The number of characters in buff. Used for allocation of buff and to detect overflow of buff. */ @@ -536,9 +530,9 @@ static int lines_per_page = 66; /* Number of lines in the header and footer can be reset to 0 using the -t flag. */ -static int lines_per_header = 5; +enum { lines_per_header = 5 }; static int lines_per_body; -static int lines_per_footer = 5; +enum { lines_per_footer = 5 }; /* (-w|-W) Width in characters of the page. Does not include the width of the margin. */ @@ -694,10 +688,10 @@ static bool use_col_separator = false; /* String used to separate columns if the -S option has been specified. Default without -S but together with one of the column options -a|COLUMN|-m is a `space' and with the -J option a `tab'. */ -static char *col_sep_string = ""; +static char *col_sep_string = (char *) ""; static int col_sep_length = 0; -static char *column_separator = " "; -static char *line_separator = "\t"; +static char *column_separator = (char *) " "; +static char *line_separator = (char *) "\t"; /* Number of separator characters waiting to be printed as soon as we know that we have any input remaining to be printed. */ @@ -797,14 +791,14 @@ cols_ready_to_print (void) using option +FIRST_PAGE:LAST_PAGE */ static bool -first_last_page (char const *pages) +first_last_page (int oi, char c, char const *pages) { char *p; uintmax_t first; uintmax_t last = UINTMAX_MAX; strtol_error err = xstrtoumax (pages, &p, 10, &first, ""); if (err != LONGINT_OK && err != LONGINT_INVALID_SUFFIX_CHAR) - _STRTOL_ERROR (EXIT_FAILURE, pages, _("page range"), err); + xstrtol_fatal (err, oi, c, long_options, pages); if (p == pages || !first) return false; @@ -814,7 +808,7 @@ first_last_page (char const *pages) char const *p1 = p + 1; err = xstrtoumax (p1, &p, 10, &last, ""); if (err != LONGINT_OK) - _STRTOL_ERROR (EXIT_FAILURE, pages, _("page range"), err); + xstrtol_fatal (err, oi, c, long_options, pages); if (p1 == p || last < first) return false; } @@ -857,7 +851,6 @@ separator_string (const char *optarg_S) int main (int argc, char **argv) { - int c; int n_files; bool old_options = false; bool old_w = false; @@ -870,7 +863,7 @@ main (int argc, char **argv) size_t n_alloc = 0; initialize_main (&argc, &argv); - program_name = argv[0]; + set_program_name (argv[0]); setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); @@ -882,9 +875,13 @@ main (int argc, char **argv) ? xmalloc ((argc - 1) * sizeof (char *)) : NULL); - while ((c = getopt_long (argc, argv, short_options, long_options, NULL)) - != -1) + for (;;) { + int oi = -1; + int c = getopt_long (argc, argv, short_options, long_options, &oi); + if (c == -1) + break; + if (ISDIGIT (c)) { /* Accumulate column-count digits specified via old-style options. */ @@ -903,7 +900,7 @@ main (int argc, char **argv) case 1: /* Non-option argument. */ /* long option --page dominates old `+FIRST_PAGE ...'. */ if (! (first_page_number == 0 - && *optarg == '+' && first_last_page (optarg + 1))) + && *optarg == '+' && first_last_page (-2, '+', optarg + 1))) file_names[n_files++] = optarg; break; @@ -912,8 +909,8 @@ main (int argc, char **argv) if (! optarg) error (EXIT_FAILURE, 0, _("`--pages=FIRST_PAGE[:LAST_PAGE]' missing argument")); - else if (! first_last_page (optarg)) - error (EXIT_FAILURE, 0, _("Invalid page range %s"), + else if (! first_last_page (oi, 0, optarg)) + error (EXIT_FAILURE, 0, _("invalid page range %s"), quote (optarg)); break; } @@ -1030,7 +1027,7 @@ main (int argc, char **argv) case 'S': old_s = false; /* Reset an additional input of -s, -S dominates -s */ - col_sep_string = ""; + col_sep_string = bad_cast (""); col_sep_length = 0; use_col_separator = true; if (optarg) @@ -1099,11 +1096,11 @@ main (int argc, char **argv) if (parallel_files & explicit_columns) error (EXIT_FAILURE, 0, - _("Cannot specify number of columns when printing in parallel.")); + _("cannot specify number of columns when printing in parallel")); if (parallel_files & print_across_flag) error (EXIT_FAILURE, 0, - _("Cannot specify both printing across and printing in parallel.")); + _("cannot specify both printing across and printing in parallel")); /* Translate some old short options to new/long options. To meet downward compatibility with other UNIX pr utilities @@ -1214,12 +1211,6 @@ init_parameters (int number_of_files) { int chars_used_by_number = 0; - if (use_form_feed) - { - lines_per_header = 3; - lines_per_footer = 0; - } - lines_per_body = lines_per_page - lines_per_header - lines_per_footer; if (lines_per_body <= 0) { @@ -1951,8 +1942,8 @@ static void store_columns (void) { int i, j; - int line = 0; - int buff_start; + unsigned int line = 0; + unsigned int buff_start; int last_col; /* The rightmost column which will be saved in buff */ COLUMN *p; @@ -2395,15 +2386,12 @@ print_header (void) int lhs_spaces; int rhs_spaces; - if (!use_form_feed) - printf ("\n\n"); - output_position = 0; pad_across_to (chars_per_margin); print_white_space (); if (page_number == 0) - error (EXIT_FAILURE, 0, _("Page number overflow")); + error (EXIT_FAILURE, 0, _("page number overflow")); /* The translator must ensure that formatting the translation of "Page %"PRIuMAX does not generate more than (sizeof page_text - 1) @@ -2414,8 +2402,10 @@ print_header (void) lhs_spaces = available_width >> 1; rhs_spaces = available_width - lhs_spaces; - printf ("%s%*s%s%*s%s\n\n\n", - date_text, lhs_spaces, " ", file_text, rhs_spaces, " ", page_text); + printf ("\n\n%*.*s%s%*.*s%s%*.*s%s\n\n\n", + chars_per_margin, chars_per_margin, " ", + date_text, lhs_spaces, lhs_spaces, " ", + file_text, rhs_spaces, rhs_spaces, " ", page_text); print_a_header = false; output_position = 0; @@ -2734,7 +2724,17 @@ char_to_clump (char c) *s = c; } - input_position += width; + /* Too many backspaces must put us in position 0 -- never negative. */ + if (width < 0 && input_position == 0) + { + chars = 0; + input_position = 0; + } + else if (width < 0 && input_position <= -width) + input_position = 0; + else + input_position += width; + return chars; } @@ -2803,7 +2803,7 @@ Mandatory arguments to long options are mandatory for short options too.\n\ and trailer without -F)\n\ "), stdout); fputs (_("\ - -h HEADER, --header=HEADER\n\ + -h, --header=HEADER\n\ use a centered HEADER instead of filename in page header,\n\ -h \"\" prints a blank line, don't use -h\"\"\n\ -i[CHAR[WIDTH]], --output-tabs[=CHAR[WIDTH]]\n\ @@ -2812,7 +2812,7 @@ Mandatory arguments to long options are mandatory for short options too.\n\ alignment, --sep-string[=STRING] sets separators\n\ "), stdout); fputs (_("\ - -l PAGE_LENGTH, --length=PAGE_LENGTH\n\ + -l, --length=PAGE_LENGTH\n\ set the page length to PAGE_LENGTH (66) lines\n\ (default number of lines of text 56, and with -F 63)\n\ -m, --merge print all files in parallel, one in each column,\n\ @@ -2822,12 +2822,12 @@ Mandatory arguments to long options are mandatory for short options too.\n\ -n[SEP[DIGITS]], --number-lines[=SEP[DIGITS]]\n\ number lines, use DIGITS (5) digits, then SEP (TAB),\n\ default counting starts with 1st line of input file\n\ - -N NUMBER, --first-line-number=NUMBER\n\ + -N, --first-line-number=NUMBER\n\ start counting with NUMBER at 1st line of first\n\ page printed (see +FIRST_PAGE)\n\ "), stdout); fputs (_("\ - -o MARGIN, --indent=MARGIN\n\ + -o, --indent=MARGIN\n\ offset each line with MARGIN (zero) spaces, do not\n\ affect -w or -W, MARGIN will be added to PAGE_WIDTH\n\ -r, --no-file-warnings\n\ @@ -2842,8 +2842,6 @@ Mandatory arguments to long options are mandatory for short options too.\n\ "), stdout); fputs (_("\ -SSTRING, --sep-string[=STRING]\n\ -"), stdout); - fputs (_("\ separate columns by STRING,\n\ without -S: Default separator with -J and \n\ otherwise (same as -S\" \"), no effect on column options\n\ @@ -2855,12 +2853,12 @@ Mandatory arguments to long options are mandatory for short options too.\n\ by form feeds set in input files\n\ -v, --show-nonprinting\n\ use octal backslash notation\n\ - -w PAGE_WIDTH, --width=PAGE_WIDTH\n\ + -w, --width=PAGE_WIDTH\n\ set page width to PAGE_WIDTH (72) characters for\n\ multiple text-column output only, -s[char] turns off (72)\n\ "), stdout); fputs (_("\ - -W PAGE_WIDTH, --page-width=PAGE_WIDTH\n\ + -W, --page-width=PAGE_WIDTH\n\ set page width to PAGE_WIDTH (72) characters always,\n\ truncate lines, except -J option is set, no interference\n\ with -S or -s\n\ @@ -2869,10 +2867,10 @@ Mandatory arguments to long options are mandatory for short options too.\n\ fputs (VERSION_OPTION_DESCRIPTION, stdout); fputs (_("\ \n\ --T implied by -l nn when nn <= 10 or <= 3 with -F. With no FILE, or when\n\ +-t is implied if PAGE_LENGTH <= 10. With no FILE, or when\n\ FILE is -, read standard input.\n\ "), stdout); - printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT); + emit_bug_reporting_address (); } exit (status); } diff --git a/src/bin/coreutils/src/printenv.c b/src/bin/coreutils/src/printenv.c index e06b704e2a..3033fd4b92 100644 --- a/src/bin/coreutils/src/printenv.c +++ b/src/bin/coreutils/src/printenv.c @@ -1,10 +1,10 @@ /* printenv -- print all or part of environment - Copyright (C) 1989-1997, 1999-2005 Free Software Foundation, Inc. + Copyright (C) 1989-1997, 1999-2005, 2007-2008 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Usage: printenv [variable...] @@ -34,7 +33,6 @@ #include #include "system.h" -#include "error.h" #include "long-options.h" /* Exit status for syntax errors, etc. */ @@ -43,10 +41,9 @@ enum { PRINTENV_FAILURE = 2 }; /* The official name of this program (e.g., no `g' prefix). */ #define PROGRAM_NAME "printenv" -#define AUTHORS "David MacKenzie", "Richard Mlynarik" - -/* The name this program was run with. */ -char *program_name; +#define AUTHORS \ + proper_name ("David MacKenzie"), \ + proper_name ("Richard Mlynarik") extern char **environ; @@ -61,14 +58,15 @@ usage (int status) printf (_("\ Usage: %s [VARIABLE]...\n\ or: %s OPTION\n\ -If no environment VARIABLE specified, print them all.\n\ +Print the values of the specified environment VARIABLE(s).\n\ +If no VARIABLE is specified, print name and value pairs for them all.\n\ \n\ "), program_name, program_name); fputs (HELP_OPTION_DESCRIPTION, stdout); fputs (VERSION_OPTION_DESCRIPTION, stdout); printf (USAGE_BUILTIN_WARNING, PROGRAM_NAME); - printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT); + emit_bug_reporting_address (); } exit (status); } @@ -82,7 +80,7 @@ main (int argc, char **argv) bool ok; initialize_main (&argc, &argv); - program_name = argv[0]; + set_program_name (argv[0]); setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); @@ -90,7 +88,7 @@ main (int argc, char **argv) initialize_exit_failure (PRINTENV_FAILURE); atexit (close_stdout); - parse_long_options (argc, argv, PROGRAM_NAME, GNU_PACKAGE, VERSION, + parse_long_options (argc, argv, PROGRAM_NAME, PACKAGE_NAME, Version, usage, AUTHORS, (char const *) NULL); if (getopt_long (argc, argv, "+", NULL, NULL) != -1) usage (PRINTENV_FAILURE); diff --git a/src/bin/coreutils/src/printf.c b/src/bin/coreutils/src/printf.c index 6205153bd0..89fa45628a 100644 --- a/src/bin/coreutils/src/printf.c +++ b/src/bin/coreutils/src/printf.c @@ -1,10 +1,10 @@ /* printf - format and print data - Copyright (C) 1990-2007 Free Software Foundation, Inc. + Copyright (C) 1990-2009 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Usage: printf format [argument...] @@ -49,19 +48,18 @@ #include #include #include -#include #include "system.h" #include "c-strtod.h" #include "error.h" -#include "long-options.h" #include "quote.h" #include "unicodeio.h" +#include "xprintf.h" /* The official name of this program (e.g., no `g' prefix). */ #define PROGRAM_NAME "printf" -#define AUTHORS "David MacKenzie" +#define AUTHORS proper_name ("David MacKenzie") #define isodigit(c) ((c) >= '0' && (c) <= '7') #define hextobin(c) ((c) >= 'a' && (c) <= 'f' ? (c) - 'a' + 10 : \ @@ -79,9 +77,6 @@ static bool posixly_correct; static char const *const cfcc_msg = N_("warning: %s: character(s) following character constant have been ignored"); -/* The name this program was run with. */ -char *program_name; - void usage (int status) { @@ -96,7 +91,7 @@ Usage: %s FORMAT [ARGUMENT]...\n\ "), program_name, program_name); fputs (_("\ -Print ARGUMENT(s) according to FORMAT.\n\ +Print ARGUMENT(s) according to FORMAT, or execute according to OPTION:\n\ \n\ "), stdout); fputs (HELP_OPTION_DESCRIPTION, stdout); @@ -135,7 +130,7 @@ and all C format specifications ending with one of diouxXfeEgGcs, with\n\ ARGUMENTs converted to proper type first. Variable widths are handled.\n\ "), stdout); printf (USAGE_BUILTIN_WARNING, PROGRAM_NAME); - printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT); + emit_bug_reporting_address (); } exit (status); } @@ -374,16 +369,16 @@ print_direc (const char *start, size_t length, char conversion, if (!have_field_width) { if (!have_precision) - printf (p, arg); + xprintf (p, arg); else - printf (p, precision, arg); + xprintf (p, precision, arg); } else { if (!have_precision) - printf (p, field_width, arg); + xprintf (p, field_width, arg); else - printf (p, field_width, precision, arg); + xprintf (p, field_width, precision, arg); } } break; @@ -397,16 +392,16 @@ print_direc (const char *start, size_t length, char conversion, if (!have_field_width) { if (!have_precision) - printf (p, arg); + xprintf (p, arg); else - printf (p, precision, arg); + xprintf (p, precision, arg); } else { if (!have_precision) - printf (p, field_width, arg); + xprintf (p, field_width, arg); else - printf (p, field_width, precision, arg); + xprintf (p, field_width, precision, arg); } } break; @@ -424,41 +419,41 @@ print_direc (const char *start, size_t length, char conversion, if (!have_field_width) { if (!have_precision) - printf (p, arg); + xprintf (p, arg); else - printf (p, precision, arg); + xprintf (p, precision, arg); } else { if (!have_precision) - printf (p, field_width, arg); + xprintf (p, field_width, arg); else - printf (p, field_width, precision, arg); + xprintf (p, field_width, precision, arg); } } break; case 'c': if (!have_field_width) - printf (p, *argument); + xprintf (p, *argument); else - printf (p, field_width, *argument); + xprintf (p, field_width, *argument); break; case 's': if (!have_field_width) { if (!have_precision) - printf (p, argument); + xprintf (p, argument); else - printf (p, precision, argument); + xprintf (p, precision, argument); } else { if (!have_precision) - printf (p, field_width, argument); + xprintf (p, field_width, argument); else - printf (p, field_width, precision, argument); + xprintf (p, field_width, precision, argument); } break; } @@ -638,7 +633,7 @@ main (int argc, char **argv) int args_used; initialize_main (&argc, &argv); - program_name = argv[0]; + set_program_name (argv[0]); setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); @@ -649,8 +644,20 @@ main (int argc, char **argv) posixly_correct = (getenv ("POSIXLY_CORRECT") != NULL); - parse_long_options (argc, argv, PROGRAM_NAME, GNU_PACKAGE, VERSION, - usage, AUTHORS, (char const *) NULL); + /* We directly parse options, rather than use parse_long_options, in + order to avoid accepting abbreviations. */ + if (argc == 2) + { + if (STREQ (argv[1], "--help")) + usage (EXIT_SUCCESS); + + if (STREQ (argv[1], "--version")) + { + version_etc (stdout, PROGRAM_NAME, PACKAGE_NAME, Version, AUTHORS, + (char *) NULL); + exit (EXIT_SUCCESS); + } + } /* The above handles --help and --version. Since there is no other invocation of getopt, handle `--' here. */ diff --git a/src/bin/coreutils/src/prog-fprintf.c b/src/bin/coreutils/src/prog-fprintf.c new file mode 100644 index 0000000000..cbf7becc61 --- /dev/null +++ b/src/bin/coreutils/src/prog-fprintf.c @@ -0,0 +1,37 @@ +/* prog-fprintf.c - common formating output functions and definitions + Copyright (C) 2008 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#include +#include +#include + +#include "system.h" + +#include "prog-fprintf.h" + +/* Display program name followed by variable list. + Used for e.g. verbose output */ +void +prog_fprintf (FILE *fp, char const *fmt, ...) +{ + va_list ap; + fputs (program_name, fp); + fputs (": ", fp); + va_start (ap, fmt); + vfprintf (fp, fmt, ap); + va_end (ap); + fputc ('\n', fp); +} diff --git a/src/bin/coreutils/src/prog-fprintf.h b/src/bin/coreutils/src/prog-fprintf.h new file mode 100644 index 0000000000..98029ab9ce --- /dev/null +++ b/src/bin/coreutils/src/prog-fprintf.h @@ -0,0 +1,25 @@ +/* prog-fprintf.h - common formating output functions and definitions + Copyright (C) 2008-2009 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#ifndef PROG_FPRINTF_H +# define PROG_FPRINTF_H + +# include + +extern void prog_fprintf (FILE *fp, char const *fmt, ...) + __attribute__ ((__format__ (__printf__, 2, 3))); + +#endif diff --git a/src/bin/coreutils/src/ptx.c b/src/bin/coreutils/src/ptx.c index 9c35596fc0..5d29bd1458 100644 --- a/src/bin/coreutils/src/ptx.c +++ b/src/bin/coreutils/src/ptx.c @@ -1,20 +1,19 @@ /* Permuted index for GNU, with keywords in their context. - Copyright (C) 1990, 1991, 1993, 1998-2006 Free Software Foundation, Inc. + Copyright (C) 1990, 1991, 1993, 1998-2009 Free Software Foundation, Inc. François Pinard , 1988. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + along with this program. If not, see . François Pinard */ @@ -35,10 +34,10 @@ /* The official name of this program (e.g., no `g' prefix). */ #define PROGRAM_NAME "ptx" -/* Note to translator: Please translate "F. Pinard" to "François - Pinard" if "ç" (c-with-cedilla) is available in the - translation's character set and encoding. */ -#define AUTHORS _("F. Pinard") +/* TRANSLATORS: Please translate "F. Pinard" to "François Pinard" + if "ç" (c-with-cedilla) is available in the translation's character + set and encoding. */ +#define AUTHORS proper_name_utf8 ("F. Pinard", "Fran\xc3\xa7ois Pinard") /* Number of possible characters in a byte. */ #define CHAR_SET_SIZE 256 @@ -66,12 +65,6 @@ the actual reallocation step, but its base two logarithm. */ #define SWALLOW_REALLOC_LOG 12 -/* Imported from "regex.c". */ -#define Sword 1 - -/* The name this program was run with. */ -char *program_name; - /* Program options. */ enum Format @@ -311,91 +304,97 @@ copy_unescaped_string (const char *string) cursor = result; while (*string) - if (*string == '\\') - { - string++; - switch (*string) - { - case 'x': /* \xhhh escape, 3 chars maximum */ - value = 0; - for (length = 0, string++; - length < 3 && isxdigit (to_uchar (*string)); - length++, string++) - value = value * 16 + HEXTOBIN (*string); - if (length == 0) - { - *cursor++ = '\\'; - *cursor++ = 'x'; - } - else + { + if (*string == '\\') + { + string++; + switch (*string) + { + case 'x': /* \xhhh escape, 3 chars maximum */ + value = 0; + for (length = 0, string++; + length < 3 && isxdigit (to_uchar (*string)); + length++, string++) + value = value * 16 + HEXTOBIN (*string); + if (length == 0) + { + *cursor++ = '\\'; + *cursor++ = 'x'; + } + else + *cursor++ = value; + break; + + case '0': /* \0ooo escape, 3 chars maximum */ + value = 0; + for (length = 0, string++; + length < 3 && ISODIGIT (*string); + length++, string++) + value = value * 8 + OCTTOBIN (*string); *cursor++ = value; - break; + break; - case '0': /* \0ooo escape, 3 chars maximum */ - value = 0; - for (length = 0, string++; - length < 3 && ISODIGIT (*string); - length++, string++) - value = value * 8 + OCTTOBIN (*string); - *cursor++ = value; - break; - - case 'a': /* alert */ + case 'a': /* alert */ #if __STDC__ - *cursor++ = '\a'; + *cursor++ = '\a'; #else - *cursor++ = 7; + *cursor++ = 7; #endif - string++; - break; - - case 'b': /* backspace */ - *cursor++ = '\b'; - string++; - break; - - case 'c': /* cancel the rest of the output */ - while (*string) string++; - break; + break; - case 'f': /* form feed */ - *cursor++ = '\f'; - string++; - break; + case 'b': /* backspace */ + *cursor++ = '\b'; + string++; + break; - case 'n': /* new line */ - *cursor++ = '\n'; - string++; - break; + case 'c': /* cancel the rest of the output */ + while (*string) + string++; + break; - case 'r': /* carriage return */ - *cursor++ = '\r'; - string++; - break; + case 'f': /* form feed */ + *cursor++ = '\f'; + string++; + break; - case 't': /* horizontal tab */ - *cursor++ = '\t'; - string++; - break; + case 'n': /* new line */ + *cursor++ = '\n'; + string++; + break; - case 'v': /* vertical tab */ + case 'r': /* carriage return */ + *cursor++ = '\r'; + string++; + break; + + case 't': /* horizontal tab */ + *cursor++ = '\t'; + string++; + break; + + case 'v': /* vertical tab */ #if __STDC__ - *cursor++ = '\v'; + *cursor++ = '\v'; #else - *cursor++ = 11; + *cursor++ = 11; #endif - string++; - break; + string++; + break; - default: - *cursor++ = '\\'; - *cursor++ = *string++; - break; - } - } - else - *cursor++ = *string++; + case '\0': /* lone backslash at end of string */ + /* ignore it */ + break; + + default: + *cursor++ = '\\'; + *cursor++ = *string++; + break; + } + } + else + *cursor++ = *string++; + } *cursor = '\0'; return result; @@ -1351,6 +1350,8 @@ fix_output_parameters (void) right side, or one on either side. */ before_max_width -= 2 * truncation_string_length; + if (before_max_width < 0) + before_max_width = 0; keyafter_max_width -= 2 * truncation_string_length; } else @@ -1922,7 +1923,7 @@ Mandatory arguments to long options are mandatory for short options too.\n\ \n\ With no FILE or if FILE is -, read Standard Input. `-F /' by default.\n\ "), stdout); - printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT); + emit_bug_reporting_address (); } exit (status); } @@ -1933,11 +1934,10 @@ With no FILE or if FILE is -, read Standard Input. `-F /' by default.\n\ `----------------------------------------------------------------------*/ /* Long options equivalences. */ -static const struct option long_options[] = +static struct option const long_options[] = { {"auto-reference", no_argument, NULL, 'A'}, {"break-file", required_argument, NULL, 'b'}, - {"copyright", no_argument, NULL, 'C'}, /* Deprecated, remove in 2007. */ {"flag-truncation", required_argument, NULL, 'F'}, {"ignore-case", no_argument, NULL, 'f'}, {"gap-size", required_argument, NULL, 'g'}, @@ -1976,7 +1976,7 @@ main (int argc, char **argv) /* Decode program options. */ initialize_main (&argc, &argv); - program_name = argv[0]; + set_program_name (argv[0]); setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); @@ -1987,7 +1987,7 @@ main (int argc, char **argv) setchrclass (NULL); #endif - while (optchar = getopt_long (argc, argv, "ACF:GM:ORS:TW:b:i:fg:o:trw:", + while (optchar = getopt_long (argc, argv, "AF:GM:ORS:TW:b:i:fg:o:trw:", long_options, NULL), optchar != EOF) { @@ -2085,11 +2085,6 @@ main (int argc, char **argv) format_args, format_vals); case_GETOPT_HELP_CHAR; - case 'C': - error (0, 0, _("\ -the --copyright option is deprecated; use --version instead")); - /* fallthrough */ - case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS); } } @@ -2116,11 +2111,10 @@ the --copyright option is deprecated; use --version instead")); for (file_index = 0; file_index < number_input_files; file_index++) { - input_file_name[file_index] = argv[optind]; if (!*argv[optind] || STREQ (argv[optind], "-")) - input_file_name[0] = NULL; + input_file_name[file_index] = NULL; else - input_file_name[0] = argv[optind]; + input_file_name[file_index] = argv[optind]; optind++; } } diff --git a/src/bin/coreutils/src/pwd.c b/src/bin/coreutils/src/pwd.c index 4f16b738e2..47c0c42836 100644 --- a/src/bin/coreutils/src/pwd.c +++ b/src/bin/coreutils/src/pwd.c @@ -1,10 +1,10 @@ /* pwd - print current directory - Copyright (C) 1994-1997, 1999-2006 Free Software Foundation, Inc. + Copyright (C) 1994-1997, 1999-2009 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ #include #include @@ -21,9 +20,7 @@ #include #include "system.h" -#include "dirfd.h" #include "error.h" -#include "long-options.h" #include "quote.h" #include "root-dev-ino.h" #include "xgetcwd.h" @@ -31,7 +28,7 @@ /* The official name of this program (e.g., no `g' prefix). */ #define PROGRAM_NAME "pwd" -#define AUTHORS "Jim Meyering" +#define AUTHORS proper_name ("Jim Meyering") struct file_name { @@ -40,8 +37,14 @@ struct file_name char *start; }; -/* The name this program was run with. */ -char *program_name; +static struct option const longopts[] = +{ + {"logical", no_argument, NULL, 'L'}, + {"physical", no_argument, NULL, 'P'}, + {GETOPT_HELP_OPTION_DECL}, + {GETOPT_VERSION_OPTION_DECL}, + {NULL, 0, NULL, 0} +}; void usage (int status) @@ -51,15 +54,19 @@ usage (int status) program_name); else { - printf (_("Usage: %s [OPTION]\n"), program_name); + printf (_("Usage: %s [OPTION]...\n"), program_name); fputs (_("\ Print the full filename of the current working directory.\n\ \n\ +"), stdout); + fputs (_("\ + -L, --logical use PWD from environment, even if it contains symlinks\n\ + -P, --physical avoid all symlinks\n\ "), stdout); fputs (HELP_OPTION_DESCRIPTION, stdout); fputs (VERSION_OPTION_DESCRIPTION, stdout); printf (USAGE_BUILTIN_WARNING, PROGRAM_NAME); - printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT); + emit_bug_reporting_address (); } exit (status); } @@ -237,7 +244,7 @@ find_dir_entry (struct stat *dot_sb, struct file_name *file_name, The getcwd function performs nearly the same task, but is typically unable to handle names longer than PATH_MAX. This function has no such limitation. However, this function *can* fail due to - permission problems or a lack of memory, while Linux's getcwd + permission problems or a lack of memory, while GNU/Linux's getcwd function works regardless of restricted permissions on parent directories. Upon failure, give a diagnostic and exit nonzero. @@ -284,27 +291,87 @@ robust_getcwd (struct file_name *file_name) file_name_prepend (file_name, "", 0); } + +/* Return PWD from the environment if it is acceptable for 'pwd -L' + output, otherwise NULL. */ +static char * +logical_getcwd (void) +{ + struct stat st1; + struct stat st2; + char *wd = getenv ("PWD"); + char *p; + + /* Textual validation first. */ + if (!wd || wd[0] != '/') + return NULL; + p = wd; + while ((p = strstr (p, "/."))) + { + if (!p[2] || p[2] == '/' + || (p[2] == '.' && (!p[3] || p[3] == '/'))) + return NULL; + p++; + } + + /* System call validation. */ + if (stat (wd, &st1) == 0 && stat (".", &st2) == 0 && SAME_INODE(st1, st2)) + return wd; + return NULL; +} + + int main (int argc, char **argv) { char *wd; + /* POSIX requires a default of -L, but most scripts expect -P. */ + bool logical = (getenv ("POSIXLY_CORRECT") != NULL); initialize_main (&argc, &argv); - program_name = argv[0]; + set_program_name (argv[0]); setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); atexit (close_stdout); - parse_long_options (argc, argv, PROGRAM_NAME, GNU_PACKAGE, VERSION, - usage, AUTHORS, (char const *) NULL); - if (getopt_long (argc, argv, "", NULL, NULL) != -1) - usage (EXIT_FAILURE); + while (1) + { + int c = getopt_long (argc, argv, "LP", longopts, NULL); + if (c == -1) + break; + switch (c) + { + case 'L': + logical = true; + break; + case 'P': + logical = false; + break; + + case_GETOPT_HELP_CHAR; + + case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS); + + default: + usage (EXIT_FAILURE); + } + } if (optind < argc) error (0, 0, _("ignoring non-option arguments")); + if (logical) + { + wd = logical_getcwd (); + if (wd) + { + puts (wd); + exit (EXIT_SUCCESS); + } + } + wd = xgetcwd (); if (wd != NULL) { diff --git a/src/bin/coreutils/src/readlink.c b/src/bin/coreutils/src/readlink.c index 121c7ffcf4..98a955c0ca 100644 --- a/src/bin/coreutils/src/readlink.c +++ b/src/bin/coreutils/src/readlink.c @@ -1,10 +1,10 @@ /* readlink -- display value of a symbolic link. - Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. + Copyright (C) 2002-2008 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Dmitry V. Levin */ @@ -25,16 +24,13 @@ #include "system.h" #include "canonicalize.h" #include "error.h" -#include "xreadlink.h" +#include "areadlink.h" #include "quote.h" /* The official name of this program (e.g., no `g' prefix). */ #define PROGRAM_NAME "readlink" -#define AUTHORS "Dmitry V. Levin" - -/* Name this program was run with. */ -char *program_name; +#define AUTHORS proper_name ("Dmitry V. Levin") /* If true, do not output the trailing newline. */ static bool no_newline; @@ -86,7 +82,7 @@ usage (int status) "), stdout); fputs (HELP_OPTION_DESCRIPTION, stdout); fputs (VERSION_OPTION_DESCRIPTION, stdout); - printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT); + emit_bug_reporting_address (); } exit (status); } @@ -106,7 +102,7 @@ main (int argc, char **argv) int optc; initialize_main (&argc, &argv); - program_name = argv[0]; + set_program_name (argv[0]); setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); @@ -159,7 +155,7 @@ main (int argc, char **argv) value = (can_mode != -1 ? canonicalize_filename_mode (fname, can_mode) - : xreadlink (fname)); + : areadlink_with_size (fname, 63)); if (value) { printf ("%s%s", value, (no_newline ? "" : "\n")); diff --git a/src/bin/coreutils/src/remove.c b/src/bin/coreutils/src/remove.c index 43f54e8367..0290b33a11 100644 --- a/src/bin/coreutils/src/remove.c +++ b/src/bin/coreutils/src/remove.c @@ -1,10 +1,10 @@ /* remove.c -- core functions for removing files and directories - Copyright (C) 88, 90, 91, 1994-2007 Free Software Foundation, Inc. + Copyright (C) 88, 90, 91, 1994-2008 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Extracted from rm.c and librarified, then rewritten by Jim Meyering. */ @@ -25,20 +24,17 @@ #include "system.h" #include "cycle-check.h" -#include "dirfd.h" #include "error.h" -#include "euidaccess.h" #include "euidaccess-stat.h" #include "file-type.h" #include "hash.h" #include "hash-pjw.h" -#include "lstat.h" #include "obstack.h" -#include "openat.h" #include "quote.h" #include "remove.h" #include "root-dev-ino.h" #include "unlinkdir.h" +#include "write-any-file.h" #include "yesno.h" /* Avoid shadowing warnings because these are functions declared @@ -46,9 +42,6 @@ #define dir_name rm_dir_name #define dir_len rm_dir_len -#define obstack_chunk_alloc malloc -#define obstack_chunk_free free - /* This is the maximum number of consecutive readdir/unlink calls that can be made (with no intervening rewinddir or closedir/opendir) before triggering a bug that makes readdir return NULL even though some @@ -64,6 +57,14 @@ enum CONSECUTIVE_READDIR_UNLINK_THRESHOLD = 10 }; +/* If the heuristics in preprocess_dir suggest that there + are fewer than this many entries in a directory, then it + skips the preprocessing altogether. */ +enum +{ + INODE_SORT_DIR_ENTRIES_THRESHOLD = 10000 +}; + /* FIXME: in 2009, or whenever Darwin 7.9.0 (aka MacOS X 10.3.9) is no longer relevant, remove this work-around code. Then, there will be no need to perform the extra rewinddir call, ever. */ @@ -112,7 +113,22 @@ struct AD_ent struct dev_ino dev_ino; }; -extern char *program_name; +/* D_TYPE(D) is the type of directory entry D if known, DT_UNKNOWN + otherwise. */ +#if HAVE_STRUCT_DIRENT_D_TYPE +# define D_TYPE(d) ((d)->d_type) +#else +# define D_TYPE(d) DT_UNKNOWN + +/* Any int values will do here, so long as they're distinct. + Undef any existing macros out of the way. */ +# undef DT_UNKNOWN +# undef DT_DIR +# undef DT_LNK +# define DT_UNKNOWN 0 +# define DT_DIR 1 +# define DT_LNK 2 +#endif struct dirstack_state { @@ -148,6 +164,11 @@ struct dirstack_state }; typedef struct dirstack_state Dirstack_state; +/* A static buffer and its allocated size, these variables are used by + xfull_filename and full_filename to form full, relative file names. */ +static char *g_buf; +static size_t g_n_allocated; + /* Like fstatat, but cache the result. If ST->st_size is -1, the status has not been gotten yet. If less than -1, fstatat failed with errno == ST->st_ino. Otherwise, the status has already @@ -159,7 +180,7 @@ cache_fstatat (int fd, char const *file, struct stat *st, int flag) { st->st_size = -2; st->st_ino = errno; - } + } if (0 <= st->st_size) return 0; errno = (int) st->st_ino; @@ -201,11 +222,33 @@ hash_compare_strings (void const *x, void const *y) return STREQ (x, y) ? true : false; } +/* Obstack allocator: longjump on failure. */ +static void * +rm_malloc (void *v_jumpbuf, long size) +{ + jmp_buf *jumpbuf = v_jumpbuf; + void *p = malloc (size); + if (p) + return p; + longjmp (*jumpbuf, 1); +} + +/* With the 2-arg allocator, we must also provide a two-argument freer. */ +static void +rm_free (void *v_jumpbuf ATTRIBUTE_UNUSED, void *ptr) +{ + free (ptr); +} + static inline void push_dir (Dirstack_state *ds, const char *dir_name) { size_t len = strlen (dir_name); + /* Don't copy trailing slashes. */ + while (1 < len && dir_name[len - 1] == '/') + --len; + /* Append the string onto the stack. */ obstack_grow (&ds->dir_stack, dir_name, len); @@ -222,13 +265,15 @@ push_dir (Dirstack_state *ds, const char *dir_name) /* Return the entry name of the directory on the top of the stack in malloc'd storage. */ static inline char * -top_dir (Dirstack_state const *ds) +top_dir (Dirstack_state *ds) { size_t n_lengths = obstack_object_size (&ds->len_stack) / sizeof (size_t); size_t *length = obstack_base (&ds->len_stack); size_t top_len = length[n_lengths - 1]; char const *p = obstack_next_free (&ds->dir_stack) - top_len; - char *q = xmalloc (top_len); + char *q = malloc (top_len); + if (q == NULL) + longjmp (ds->current_arg_jumpbuf, 1); memcpy (q, p, top_len - 1); q[top_len - 1] = 0; return q; @@ -285,79 +330,105 @@ right_justify (char *dst, size_t dst_len, const char *src, size_t src_len, return dst_len - src_len; } -/* Using the global directory name obstack, create the full name FILENAME. +/* Using the global directory name obstack, create the full name of FILENAME. Return it in sometimes-realloc'd space that should not be freed by the - caller. Realloc as necessary. If realloc fails, use a static buffer - and put as long a suffix in that buffer as possible. */ + caller. Realloc as necessary. If realloc fails, return NULL. */ -#define full_filename(Filename) full_filename_ (ds, Filename) static char * -full_filename_ (Dirstack_state const *ds, const char *filename) +full_filename0 (Dirstack_state const *ds, const char *filename) { - static char *buf = NULL; - static size_t n_allocated = 0; - size_t dir_len = obstack_object_size (&ds->dir_stack); char *dir_name = obstack_base (&ds->dir_stack); - size_t n_bytes_needed; - size_t filename_len; + size_t filename_len = strlen (filename); + size_t n_bytes_needed = dir_len + filename_len + 1; - filename_len = strlen (filename); - n_bytes_needed = dir_len + filename_len + 1; - - if (n_allocated < n_bytes_needed) + if (g_n_allocated < n_bytes_needed) { - /* This code requires that realloc accept NULL as the first arg. - This function must not use xrealloc. Otherwise, an out-of-memory - error involving a file name to be expanded here wouldn't ever - be issued. Use realloc and fall back on using a static buffer - if memory allocation fails. */ - char *new_buf = realloc (buf, n_bytes_needed); - n_allocated = n_bytes_needed; - + char *new_buf = realloc (g_buf, n_bytes_needed); if (new_buf == NULL) - { -#define SBUF_SIZE 512 -#define ELLIPSES_PREFIX "[...]" - static char static_buf[SBUF_SIZE]; - bool truncated; - size_t len; - char *p; + return NULL; - free (buf); - len = right_justify (static_buf, SBUF_SIZE, filename, - filename_len + 1, &p, &truncated); - right_justify (static_buf, len, dir_name, dir_len, &p, &truncated); - if (truncated) - { - memcpy (static_buf, ELLIPSES_PREFIX, - sizeof (ELLIPSES_PREFIX) - 1); - } - return p; - } - - buf = new_buf; + g_buf = new_buf; + g_n_allocated = n_bytes_needed; } - if (filename_len == 1 && *filename == '.' && dir_len) + if (STREQ (filename, ".") && dir_len) { /* FILENAME is just `.' and dir_len is nonzero. Copy the directory part, omitting the trailing slash, and append a trailing zero byte. */ - char *p = mempcpy (buf, dir_name, dir_len - 1); + char *p = mempcpy (g_buf, dir_name, dir_len - 1); *p = 0; } else { /* Copy the directory part, including trailing slash, and then append the filename part, including a trailing zero byte. */ - memcpy (mempcpy (buf, dir_name, dir_len), filename, filename_len + 1); - assert (strlen (buf) + 1 == n_bytes_needed); + memcpy (mempcpy (g_buf, dir_name, dir_len), filename, filename_len + 1); + assert (strlen (g_buf) + 1 == n_bytes_needed); } + return g_buf; +} + +/* Using the global directory name obstack, create the full name of FILENAME. + Return it in sometimes-realloc'd space that should not be freed by the + caller. Realloc as necessary. If realloc fails, die. */ + +static char * +xfull_filename (Dirstack_state const *ds, const char *filename) +{ + char *buf = full_filename0 (ds, filename); + if (buf == NULL) + xalloc_die (); return buf; } +/* Using the global directory name obstack, create the full name FILENAME. + Return it in sometimes-realloc'd space that should not be freed by the + caller. Realloc as necessary. If realloc fails, use a static buffer + and put as long a suffix in that buffer as possible. Be careful not + to change errno. */ + +#define full_filename(Filename) full_filename_ (ds, Filename) +static char * +full_filename_ (Dirstack_state const *ds, const char *filename) +{ + int saved_errno = errno; + char *full_name = full_filename0 (ds, filename); + if (full_name) + { + errno = saved_errno; + return full_name; + } + + { +#define SBUF_SIZE 512 +#define ELLIPSES_PREFIX "[...]" + static char static_buf[SBUF_SIZE]; + bool file_truncated; + bool dir_truncated; + size_t n_bytes_remaining; + char *p; + char *dir_name = obstack_base (&ds->dir_stack); + size_t dir_len = obstack_object_size (&ds->dir_stack); + + free (g_buf); + n_bytes_remaining = right_justify (static_buf, SBUF_SIZE, filename, + strlen (filename) + 1, &p, + &file_truncated); + right_justify (static_buf, n_bytes_remaining, dir_name, dir_len, + &p, &dir_truncated); + if (file_truncated || dir_truncated) + { + memcpy (static_buf, ELLIPSES_PREFIX, + sizeof (ELLIPSES_PREFIX) - 1); + } + errno = saved_errno; + return p; + } +} + static inline size_t AD_stack_height (Dirstack_state const *ds) { @@ -393,14 +464,32 @@ AD_stack_clear (Dirstack_state *ds) } } -static Dirstack_state * -ds_init (void) +/* Initialize obstack O just enough so that it may be freed + with obstack_free. */ +static void +obstack_init_minimal (struct obstack *o) { - Dirstack_state *ds = xmalloc (sizeof *ds); - obstack_init (&ds->dir_stack); - obstack_init (&ds->len_stack); - obstack_init (&ds->Active_dir); - return ds; + o->chunk = NULL; +} + +static void +ds_init (Dirstack_state *ds) +{ + unsigned int i; + struct obstack *o[3]; + o[0] = &ds->dir_stack; + o[1] = &ds->len_stack; + o[2] = &ds->Active_dir; + + /* Ensure each of these is NULL, in case init/allocation + fails and we end up calling ds_free on all three while only + one or two has been initialized. */ + for (i = 0; i < 3; i++) + obstack_init_minimal (o[i]); + + for (i = 0; i < 3; i++) + obstack_specify_allocation_with_arg + (o[i], 0, 0, rm_malloc, rm_free, &ds->current_arg_jumpbuf); } static void @@ -419,7 +508,6 @@ ds_free (Dirstack_state *ds) obstack_free (&ds->dir_stack, NULL); obstack_free (&ds->len_stack, NULL); obstack_free (&ds->Active_dir, NULL); - free (ds); } /* Pop the active directory (AD) stack and prepare to move `up' one level, @@ -492,7 +580,7 @@ AD_pop_and_chdir (DIR *dirp, int *fdp, Dirstack_state *ds) searchable, when using Solaris' openat. Without this openat call, tests/rm2 would fail to remove directories a/2 and a/3. */ if (fd < 0) - fd = openat (AT_FDCWD, full_filename ("."), O_RDONLY); + fd = openat (AT_FDCWD, xfull_filename (ds, "."), O_RDONLY); if (fd < 0) { @@ -679,39 +767,9 @@ AD_is_removable (Dirstack_state const *ds, char const *file) return ! (top->unremovable && hash_lookup (top->unremovable, file)); } -/* Return true if DIR is determined to be an empty directory. */ -static bool -is_empty_dir (int fd_cwd, char const *dir) -{ - DIR *dirp; - struct dirent const *dp; - int saved_errno; - int fd = openat (fd_cwd, dir, - (O_RDONLY | O_DIRECTORY - | O_NOCTTY | O_NOFOLLOW | O_NONBLOCK)); - - if (fd < 0) - return false; - - dirp = fdopendir (fd); - if (dirp == NULL) - { - close (fd); - return false; - } - - errno = 0; - dp = readdir_ignoring_dot_and_dotdot (dirp); - saved_errno = errno; - closedir (dirp); - if (dp != NULL) - return false; - return saved_errno == 0 ? true : false; -} - -/* Return 1 if FILE is an unwritable non-symlink, 0 if it is writable or some - other type of file. - Returns -1 and sets errno if there is some problem in determining the answer. +/* Return 1 if FILE is an unwritable non-symlink, + 0 if it is writable or some other type of file, + -1 and set errno if there is some problem in determining the answer. Set *BUF to the file status. This is to avoid calling euidaccess when FILE is a symlink. */ static int @@ -720,6 +778,8 @@ write_protected_non_symlink (int fd_cwd, Dirstack_state const *ds, struct stat *buf) { + if (can_write_any_file ()) + return 0; if (cache_fstatat (fd_cwd, file, buf, AT_SYMLINK_NOFOLLOW) != 0) return -1; if (S_ISLNK (buf->st_mode)) @@ -743,13 +803,13 @@ write_protected_non_symlink (int fd_cwd, Disadvantage: changes working directory (not reentrant) and can't work if save_cwd fails. - 3) if (euidaccess (full_filename (file), W_OK) == 0) - Disadvantage: doesn't work if full_filename is too long. + 3) if (euidaccess (xfull_filename (file), W_OK) == 0) + Disadvantage: doesn't work if xfull_filename is too long. Inefficient for very deep trees (O(Depth^2)). 4) If the full pathname is sufficiently short (say, less than PATH_MAX or 8192 bytes, whichever is shorter): - use method (3) (i.e., euidaccess (full_filename (file), W_OK)); + use method (3) (i.e., euidaccess (xfull_filename (file), W_OK)); Otherwise: vfork, fchdir in the child, run euidaccess in the child, then the child exits with a status that tells the parent whether euidaccess succeeded. @@ -763,7 +823,7 @@ write_protected_non_symlink (int fd_cwd, 5) If the full file name is sufficiently short (say, less than PATH_MAX or 8192 bytes, whichever is shorter): - use method (3) (i.e., euidaccess (full_filename (file), W_OK)); + use method (3) (i.e., euidaccess (xfull_filename (file), W_OK)); Otherwise: look just at the file bits. Perhaps issue a warning the first time this occurs. @@ -778,13 +838,13 @@ write_protected_non_symlink (int fd_cwd, = obstack_object_size (&ds->dir_stack) + strlen (file); if (MIN (PATH_MAX, 8192) <= file_name_len) - return !euidaccess_stat (buf, W_OK); - if (euidaccess (full_filename (file), W_OK) == 0) + return ! euidaccess_stat (buf, W_OK); + if (euidaccess (xfull_filename (ds, file), W_OK) == 0) return 0; if (errno == EACCES) { - errno = 0; - return 1; + errno = 0; + return 1; } /* Perhaps some other process has removed the file, or perhaps this @@ -799,6 +859,9 @@ write_protected_non_symlink (int fd_cwd, return RM_USER_DECLINED. If not ignoring missing files and we cannot lstat FILENAME, then return RM_ERROR. + *PDIRENT_TYPE is the type of the directory entry; update it to DT_DIR + or DT_LNK as needed. *SBUF is the file's status. + Depending on MODE, ask whether to `descend into' or to `remove' the directory FILENAME. MODE is ignored when FILENAME is not a directory. Set *IS_EMPTY to T_YES if FILENAME is an empty directory, and it is @@ -806,11 +869,13 @@ write_protected_non_symlink (int fd_cwd, Don't even try to set *IS_EMPTY when MODE == PA_REMOVE_DIR. */ static enum RM_status prompt (int fd_cwd, Dirstack_state const *ds, char const *filename, - struct stat *sbuf, + int *pdirent_type, struct stat *sbuf, struct rm_options const *x, enum Prompt_action mode, Ternary *is_empty) { int write_protected = 0; + int dirent_type = *pdirent_type; + int wp_errno = 0; *is_empty = T_UNKNOWN; @@ -820,31 +885,58 @@ prompt (int fd_cwd, Dirstack_state const *ds, char const *filename, errno = 0; if (!x->ignore_missing_files - & ((x->interactive == RMI_ALWAYS) | x->stdin_tty)) - write_protected = write_protected_non_symlink (fd_cwd, filename, ds, sbuf); + && ((x->interactive == RMI_ALWAYS) || x->stdin_tty) + && dirent_type != DT_LNK) + { + write_protected = write_protected_non_symlink (fd_cwd, filename, ds, sbuf); + wp_errno = errno; + } if (write_protected || errno || x->interactive == RMI_ALWAYS) { + if (0 <= write_protected && dirent_type == DT_UNKNOWN) + { + if (cache_fstatat (fd_cwd, filename, sbuf, AT_SYMLINK_NOFOLLOW) == 0) + { + if (S_ISLNK (sbuf->st_mode)) + dirent_type = DT_LNK; + else if (S_ISDIR (sbuf->st_mode)) + dirent_type = DT_DIR; + /* Otherwise it doesn't matter, so leave it DT_UNKNOWN. */ + *pdirent_type = dirent_type; + } + else + { + /* This happens, e.g., with `rm '''. */ + write_protected = -1; + wp_errno = errno; + } + } + + if (0 <= write_protected) + switch (dirent_type) + { + case DT_LNK: + /* Using permissions doesn't make sense for symlinks. */ + if (x->interactive != RMI_ALWAYS) + return RM_OK; + break; + + case DT_DIR: + if (!x->recursive) + { + write_protected = -1; + wp_errno = EISDIR; + } + break; + } + + { char const *quoted_name = quote (full_filename (filename)); - if (errno == 0) - { - /* May fail for, e.g., with `rm '''. */ - cache_fstatat (fd_cwd, filename, sbuf, AT_SYMLINK_NOFOLLOW); - } - if (errno == 0) + if (write_protected < 0) { - /* Using permissions doesn't make sense for symlinks. */ - if (S_ISLNK (sbuf->st_mode) && x->interactive != RMI_ALWAYS) - return RM_OK; - - if (S_ISDIR (sbuf->st_mode) && !x->recursive) - errno = EISDIR; - } - - if (errno != 0) - { - error (0, errno, _("cannot remove %s"), quoted_name); + error (0, wp_errno, _("cannot remove %s"), quoted_name); return RM_ERROR; } @@ -852,8 +944,7 @@ prompt (int fd_cwd, Dirstack_state const *ds, char const *filename, /* FIXME: use a variant of error (instead of fprintf) that doesn't append a newline. Then we won't have to declare program_name in this file. */ - if (S_ISDIR (sbuf->st_mode) - && x->recursive + if (dirent_type == DT_DIR && mode == PA_DESCEND_INTO_DIR && ((*is_empty = (is_empty_dir (fd_cwd, filename) ? T_YES : T_NO)) == T_NO)) @@ -864,16 +955,23 @@ prompt (int fd_cwd, Dirstack_state const *ds, char const *filename, program_name, quoted_name); else { - /* TRANSLATORS: You may find it more convenient to translate - the equivalent of _("%s: remove %s (write-protected) %s? "). - It should avoid grammatical problems with the output - of file_type. */ + if (cache_fstatat (fd_cwd, filename, sbuf, AT_SYMLINK_NOFOLLOW) != 0) + { + error (0, errno, _("cannot remove %s"), quoted_name); + return RM_ERROR; + } + fprintf (stderr, (write_protected + /* TRANSLATORS: You may find it more convenient to + translate "%s: remove %s (write-protected) %s? " + instead. It should avoid grammatical problems + with the output of file_type. */ ? _("%s: remove write-protected %s %s? ") : _("%s: remove %s %s? ")), program_name, file_type (sbuf), quoted_name); } + } if (!yesno ()) return RM_USER_DECLINED; @@ -886,28 +984,30 @@ prompt (int fd_cwd, Dirstack_state const *ds, char const *filename, *ST is FILENAME's tstatus. Do not modify errno. */ static inline bool -is_dir_lstat (char const *filename, struct stat *st) +is_dir_lstat (int fd_cwd, char const *filename, struct stat *st) { int saved_errno = errno; bool is_dir = - (cache_fstatat (AT_FDCWD, filename, st, AT_SYMLINK_NOFOLLOW) == 0 + (cache_fstatat (fd_cwd, filename, st, AT_SYMLINK_NOFOLLOW) == 0 && S_ISDIR (st->st_mode)); errno = saved_errno; return is_dir; } -#if HAVE_STRUCT_DIRENT_D_TYPE - -/* True if the type of the directory entry D is known. */ -# define DT_IS_KNOWN(d) ((d)->d_type != DT_UNKNOWN) - -/* True if the type of the directory entry D must be T. */ -# define DT_MUST_BE(d, t) ((d)->d_type == (t)) - -#else -# define DT_IS_KNOWN(d) false -# define DT_MUST_BE(d, t) false -#endif +/* Return true if FILENAME is a non-directory. + Otherwise, including the case in which lstat fails, return false. + *ST is FILENAME's tstatus. + Do not modify errno. */ +static inline bool +is_nondir_lstat (int fd_cwd, char const *filename, struct stat *st) +{ + int saved_errno = errno; + bool is_non_dir = + (cache_fstatat (fd_cwd, filename, st, AT_SYMLINK_NOFOLLOW) == 0 + && !S_ISDIR (st->st_mode)); + errno = saved_errno; + return is_non_dir; +} #define DO_UNLINK(Fd_cwd, Filename, X) \ do \ @@ -978,14 +1078,14 @@ ignorable_missing (struct rm_options const *x, int errnum) static enum RM_status remove_entry (int fd_cwd, Dirstack_state const *ds, char const *filename, - struct stat *st, - struct rm_options const *x, struct dirent const *dp) + int dirent_type_arg, struct stat *st, + struct rm_options const *x) { Ternary is_empty_directory; - enum RM_status s = prompt (fd_cwd, ds, filename, st, x, PA_DESCEND_INTO_DIR, + enum RM_status s = prompt (fd_cwd, ds, filename, &dirent_type_arg, st, x, + PA_DESCEND_INTO_DIR, &is_empty_directory); - bool known_to_be_dir = (cache_stat_ok (st) && S_ISDIR (st->st_mode)); - + int dirent_type = dirent_type_arg; if (s != RM_OK) return s; @@ -1005,7 +1105,7 @@ remove_entry (int fd_cwd, Dirstack_state const *ds, char const *filename, if (cannot_unlink_dir ()) { - if (known_to_be_dir && ! x->recursive) + if (dirent_type == DT_DIR && ! x->recursive) { error (0, EISDIR, _("cannot remove %s"), quote (full_filename (filename))); @@ -1021,22 +1121,27 @@ remove_entry (int fd_cwd, Dirstack_state const *ds, char const *filename, /* If we happen to know that FILENAME is a directory, return now and let the caller remove it -- this saves the overhead of a failed - unlink call. If FILENAME is a command-line argument, then dp is NULL, - so we'll first try to unlink it. Using unlink here is ok, because it - cannot remove a directory. */ - if ((dp && DT_MUST_BE (dp, DT_DIR)) || known_to_be_dir) + unlink call. If FILENAME is a command-line argument, then + DIRENT_TYPE is DT_UNKNOWN so we'll first try to unlink it. + Using unlink here is ok, because it cannot remove a + directory. */ + if (dirent_type == DT_DIR) return RM_NONEMPTY_DIR; DO_UNLINK (fd_cwd, filename, x); - /* Upon a failed attempt to unlink a directory, most non-Linux systems - set errno to the POSIX-required value EPERM. In that case, change - errno to EISDIR so that we emit a better diagnostic. */ - if (! x->recursive && errno == EPERM && is_dir_lstat (filename, st)) + /* Upon a failed attempt to unlink a directory, most non GNU/Linux + systems set errno to the POSIX-required value EPERM. In that case, + change errno to EISDIR so that we emit a better diagnostic. */ + if (! x->recursive && errno == EPERM && is_dir_lstat (fd_cwd, + filename, st)) errno = EISDIR; if (! x->recursive - || (cache_stat_ok (st) && !S_ISDIR (st->st_mode))) + || (cache_stat_ok (st) && !S_ISDIR (st->st_mode)) + || ((errno == EACCES || errno == EPERM) + && is_nondir_lstat (fd_cwd, filename, st)) + ) { if (ignorable_missing (x, errno)) return RM_OK; @@ -1054,31 +1159,24 @@ remove_entry (int fd_cwd, Dirstack_state const *ds, char const *filename, /* If we don't already know whether FILENAME is a directory, find out now. Then, if it's a non-directory, we can use unlink on it. */ - bool is_dir; - if (cache_statted (st)) - is_dir = known_to_be_dir; - else + if (dirent_type == DT_UNKNOWN) { - if (dp && DT_IS_KNOWN (dp)) - is_dir = DT_MUST_BE (dp, DT_DIR); - else + if (fstatat (fd_cwd, filename, st, AT_SYMLINK_NOFOLLOW)) { - if (fstatat (fd_cwd, filename, st, AT_SYMLINK_NOFOLLOW)) - { - if (ignorable_missing (x, errno)) - return RM_OK; + if (ignorable_missing (x, errno)) + return RM_OK; - error (0, errno, _("cannot remove %s"), - quote (full_filename (filename))); - return RM_ERROR; - } - - is_dir = !! S_ISDIR (st->st_mode); + error (0, errno, _("cannot remove %s"), + quote (full_filename (filename))); + return RM_ERROR; } + + if (S_ISDIR (st->st_mode)) + dirent_type = DT_DIR; } - if (! is_dir) + if (dirent_type != DT_DIR) { /* At this point, barring race conditions, FILENAME is known to be a non-directory, so it's ok to try to unlink it. */ @@ -1125,7 +1223,7 @@ remove_entry (int fd_cwd, Dirstack_state const *ds, char const *filename, isn't restored. */ static DIR * fd_to_subdirp (int fd_cwd, char const *f, - struct rm_options const *x, int prev_errno, + int prev_errno, struct stat *subdir_sb, int *cwd_errno ATTRIBUTE_UNUSED) { @@ -1155,6 +1253,188 @@ fd_to_subdirp (int fd_cwd, char const *f, return NULL; } +struct readdir_data +{ + ino_t ino; + char name[FLEXIBLE_ARRAY_MEMBER]; +}; + +#if HAVE_STRUCT_DIRENT_D_TYPE +/* A comparison function to sort on increasing inode number. */ +static int +compare_ino (void const *av, void const *bv) +{ + struct readdir_data const *const *a = av; + struct readdir_data const *const *b = bv; + return (a[0]->ino < b[0]->ino ? -1 + : b[0]->ino < a[0]->ino ? 1 : 0); +} + +/* Return an approximation of the maximum number of dirent entries + in a directory with stat data *ST. */ +static size_t +dirent_count (struct stat const *st) +{ + return st->st_size / 16; +} + +#if defined __linux__ \ + && HAVE_SYS_VFS_H && HAVE_FSTATFS && HAVE_STRUCT_STATFS_F_TYPE +# include +# include "fs.h" + +/* Return false if it is easy to determine the file system type of + the directory on which DIR_FD is open, and sorting dirents on + inode numbers is known not to improve traversal performance with + that type of file system. Otherwise, return true. */ +static bool +dirent_inode_sort_may_be_useful (int dir_fd) +{ + /* Skip the sort only if we can determine efficiently + that skipping it is the right thing to do. + The cost of performing an unnecessary sort is negligible, + while the cost of *not* performing it can be O(N^2) with + a very large constant. */ + struct statfs fs_buf; + + /* If fstatfs fails, assume sorting would be useful. */ + if (fstatfs (dir_fd, &fs_buf) != 0) + return true; + + /* FIXME: what about when f_type is not an integral type? + deal with that if/when it's encountered. */ + switch (fs_buf.f_type) + { + case S_MAGIC_TMPFS: + case S_MAGIC_NFS: + /* On a file system of any of these types, sorting + is unnecessary, and hence wasteful. */ + return false; + + default: + return true; + } +} +# else /* !HAVE_STRUCT_STATFS_F_TYPE */ +static bool dirent_inode_sort_may_be_useful (int dir_fd) { return true; } +# endif /* !HAVE_STRUCT_STATFS_F_TYPE */ +#endif /* HAVE_STRUCT_DIRENT_D_TYPE */ + +/* When a directory contains very many entries, operating on N entries in + readdir order can be very seek-intensive (be it to unlink or even to + merely stat each entry), to the point that it results in O(N^2) work. + This is file-system-specific: ext3 and ext4 (as of 2008) are susceptible, + but tmpfs is not. The general solution is to process entries in inode + order. That means reading all entries, and sorting them before operating + on any. As such, it is useful only on systems with useful dirent.d_ino. + Since 'rm -r's removal process must traverse into directories and since + this preprocessing phase can allocate O(N) storage, here we store and + sort only non-directory entries, and then remove all of those, so that we + can free all allocated storage before traversing into any subdirectory. + Perform this optimization only when not interactive and not in verbose + mode, to keep the implementation simple and to minimize duplication. + Upon failure, simply free any resources and return. */ +static void +preprocess_dir (DIR **dirp, struct rm_options const *x) +{ +#if HAVE_STRUCT_DIRENT_D_TYPE + + struct stat st; + /* There are many reasons to return right away, skipping this + optimization. The penalty for being wrong is that we will + perform a small amount of extra work. + + Skip this optimization if... */ + + int dir_fd = dirfd (*dirp); + if (/* - there is a chance of interactivity */ + x->interactive != RMI_NEVER + + /* - we're in verbose mode */ + || x->verbose + + /* - privileged users can unlink nonempty directories. + Otherwise, there'd be a race condition between the readdir + call (in which we learn dirent.d_type) and the unlink, by + which time the non-directory may be replaced with a directory. */ + || ! cannot_unlink_dir () + + /* - we can't fstat the file descriptor */ + || fstat (dir_fd, &st) != 0 + + /* - the directory is smaller than some threshold. + Estimate the number of inodes with a heuristic. + There's no significant benefit to sorting if there are + too few inodes. */ + || dirent_count (&st) < INODE_SORT_DIR_ENTRIES_THRESHOLD + + /* Sort only if it might help. */ + || ! dirent_inode_sort_may_be_useful (dir_fd)) + return; + + /* FIXME: maybe test file system type, too; skip if it's tmpfs: see fts.c */ + + struct obstack o_readdir_data; /* readdir data: inode,name pairs */ + struct obstack o_p; /* an array of pointers to each inode,name pair */ + + /* Arrange to longjmp upon obstack allocation failure. */ + jmp_buf readdir_jumpbuf; + if (setjmp (readdir_jumpbuf)) + goto cleanup; + + obstack_init_minimal (&o_readdir_data); + obstack_init_minimal (&o_p); + + obstack_specify_allocation_with_arg (&o_readdir_data, 0, 0, + rm_malloc, rm_free, &readdir_jumpbuf); + obstack_specify_allocation_with_arg (&o_p, 0, 0, + rm_malloc, rm_free, &readdir_jumpbuf); + + /* Read all entries, storing for each non-dir one. + Maintain a parallel list of pointers into the primary buffer. */ + while (1) + { + struct dirent const *dp; + dp = readdir_ignoring_dot_and_dotdot (*dirp); + /* no need to distinguish EOF from failure */ + if (dp == NULL) + break; + + /* Skip known-directory and type-unknown entries. */ + if (D_TYPE (dp) == DT_UNKNOWN || D_TYPE (dp) == DT_DIR) + break; + + size_t name_len = strlen (dp->d_name); + size_t ent_len = offsetof (struct readdir_data, name) + name_len + 1; + struct readdir_data *v = obstack_alloc (&o_readdir_data, ent_len); + v->ino = D_INO (dp); + memcpy (v->name, dp->d_name, name_len + 1); + + /* Append V to the list of pointers. */ + obstack_ptr_grow (&o_p, v); + } + + /* Compute size and finalize VV. */ + size_t n = obstack_object_size (&o_p) / sizeof (void *); + struct readdir_data **vv = obstack_finish (&o_p); + + /* Sort on inode number. */ + qsort(vv, n, sizeof *vv, compare_ino); + + /* Iterate through those pointers, unlinking each name. */ + for (size_t i = 0; i < n; i++) + { + /* ignore failure */ + unlinkat (dir_fd, vv[i]->name, 0); + } + + cleanup: + obstack_free (&o_readdir_data, NULL); + obstack_free (&o_p, NULL); + rewinddir (*dirp); +#endif +} + /* Remove entries in the directory open on DIRP Upon finding a directory that is both non-empty and that can be chdir'd into, return RM_OK and set *SUBDIR and fill in SUBDIR_SB, where @@ -1177,6 +1457,10 @@ remove_cwd_entries (DIR **dirp, assert (VALID_STATUS (status)); *subdir = NULL; + /* This is just an optimization. + It's not a fatal problem if it fails. */ + preprocess_dir (dirp, x); + while (1) { struct dirent const *dp; @@ -1216,7 +1500,8 @@ remove_cwd_entries (DIR **dirp, Systems without the d_type member will have to endure the performance hit of first calling lstat F. */ cache_stat_init (subdir_sb); - tmp_status = remove_entry (dirfd (*dirp), ds, f, subdir_sb, x, dp); + tmp_status = remove_entry (dirfd (*dirp), ds, f, + D_TYPE (dp), subdir_sb, x); switch (tmp_status) { case RM_OK: @@ -1236,7 +1521,7 @@ remove_cwd_entries (DIR **dirp, case RM_NONEMPTY_DIR: { DIR *subdir_dirp = fd_to_subdirp (dirfd (*dirp), f, - x, errno, subdir_sb, NULL); + errno, subdir_sb, NULL); if (subdir_dirp == NULL) { status = RM_ERROR; @@ -1324,7 +1609,7 @@ remove_dir (int fd_cwd, Dirstack_state *ds, char const *dir, fd_to_subdirp's fstat, along with the `fstat' and the dev/ino comparison in AD_push ensure that we detect it and fail. */ - DIR *dirp = fd_to_subdirp (fd_cwd, dir, x, 0, dir_st, cwd_errno); + DIR *dirp = fd_to_subdirp (fd_cwd, dir, 0, dir_st, cwd_errno); if (dirp == NULL) { @@ -1412,13 +1697,10 @@ remove_dir (int fd_cwd, Dirstack_state *ds, char const *dir, /* Try to remove EMPTY_DIR only if remove_cwd_entries succeeded. */ if (tmp_status == RM_OK) { - /* This does a little more work than necessary when it actually - prompts the user. E.g., we already know that D is a directory - and that it's almost certainly empty, yet we lstat it. - But that's no big deal since we're interactive. */ struct stat empty_st; Ternary is_empty; - enum RM_status s = prompt (fd, ds, empty_dir, + int dirent_type = DT_DIR; + enum RM_status s = prompt (fd, ds, empty_dir, &dirent_type, cache_stat_init (&empty_st), x, PA_REMOVE_DIR, &is_empty); @@ -1489,8 +1771,8 @@ rm_1 (Dirstack_state *ds, char const *filename, if (dot_or_dotdot (base)) { error (0, 0, _(base == filename - ? "cannot remove directory %s" - : "cannot remove %s directory %s"), + ? N_("cannot remove directory %s") + : N_("cannot remove %s directory %s")), quote_n (0, base), quote_n (1, filename)); return RM_ERROR; } @@ -1519,7 +1801,8 @@ rm_1 (Dirstack_state *ds, char const *filename, AD_INIT_OTHER_MEMBERS (); { - enum RM_status status = remove_entry (AT_FDCWD, ds, filename, &st, x, NULL); + enum RM_status status = remove_entry (AT_FDCWD, ds, filename, + DT_UNKNOWN, &st, x); if (status == RM_NONEMPTY_DIR) { /* In the event that remove_dir->remove_cwd_entries detects @@ -1535,7 +1818,7 @@ rm_1 (Dirstack_state *ds, char const *filename, ds_clear (ds); return status; - } +} } } @@ -1545,10 +1828,19 @@ extern enum RM_status rm (size_t n_files, char const *const *file, struct rm_options const *x) { enum RM_status status = RM_OK; - Dirstack_state *ds = ds_init (); + Dirstack_state ds; int cwd_errno = 0; size_t i; + /* Arrange for obstack allocation failure to longjmp. */ + if (setjmp (ds.current_arg_jumpbuf)) + { + status = RM_ERROR; + goto cleanup; + } + + ds_init (&ds); + for (i = 0; i < n_files; i++) { if (cwd_errno && IS_RELATIVE_FILE_NAME (file[i])) @@ -1558,7 +1850,7 @@ rm (size_t n_files, char const *const *file, struct rm_options const *x) } else { - enum RM_status s = rm_1 (ds, file[i], x, &cwd_errno); + enum RM_status s = rm_1 (&ds, file[i], x, &cwd_errno); assert (VALID_STATUS (s)); UPDATE_STATUS (status, s); } @@ -1571,7 +1863,8 @@ rm (size_t n_files, char const *const *file, struct rm_options const *x) status = RM_ERROR; } - ds_free (ds); + cleanup:; + ds_free (&ds); return status; } diff --git a/src/bin/coreutils/src/remove.h b/src/bin/coreutils/src/remove.h index ae01e3c6c8..8f14d06ab6 100644 --- a/src/bin/coreutils/src/remove.h +++ b/src/bin/coreutils/src/remove.h @@ -3,10 +3,10 @@ Copyright (C) 1998, 2000, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ #ifndef REMOVE_H # define REMOVE_H diff --git a/src/bin/coreutils/src/rm.c b/src/bin/coreutils/src/rm.c index 3dc1be1c25..12de631220 100644 --- a/src/bin/coreutils/src/rm.c +++ b/src/bin/coreutils/src/rm.c @@ -1,10 +1,10 @@ /* `rm' file deletion utility for GNU. - Copyright (C) 88, 90, 91, 1994-2007 Free Software Foundation, Inc. + Copyright (C) 88, 90, 91, 1994-2008 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Paul Rubin, David MacKenzie, and Richard Stallman. Reworked to use chdir and avoid recursion by Jim Meyering. */ @@ -51,21 +50,21 @@ #include "system.h" #include "argmatch.h" #include "error.h" -#include "lstat.h" #include "quote.h" #include "quotearg.h" #include "remove.h" #include "root-dev-ino.h" #include "yesno.h" +#include "priv-set.h" /* The official name of this program (e.g., no `g' prefix). */ #define PROGRAM_NAME "rm" #define AUTHORS \ - "Paul Rubin", "David MacKenzie, Richard Stallman", "Jim Meyering" - -/* Name this program was run with. */ -char *program_name; + proper_name ("Paul Rubin"), \ + proper_name ("David MacKenzie"), \ + proper_name ("Richard M. Stallman"), \ + proper_name ("Jim Meyering") /* For long options that have no equivalent short option, use a non-character as a pseudo short option, starting with CHAR_MAX + 1. */ @@ -204,7 +203,7 @@ Note that if you use rm to remove a file, it is usually possible to recover\n\ the contents of that file. If you want more assurance that the contents are\n\ truly unrecoverable, consider using shred.\n\ "), stdout); - printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT); + emit_bug_reporting_address (); } exit (status); } @@ -234,15 +233,18 @@ main (int argc, char **argv) int c; initialize_main (&argc, &argv); - program_name = argv[0]; + set_program_name (argv[0]); setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); - atexit (close_stdout); + atexit (close_stdin); rm_option_init (&x); + /* Try to disable the ability to unlink a directory. */ + priv_set_remove_linkdir (); + while ((c = getopt_long (argc, argv, "dfirvIR", long_opts, NULL)) != -1) { switch (c) diff --git a/src/bin/coreutils/src/rmdir.c b/src/bin/coreutils/src/rmdir.c index 39063b4c73..935792f86d 100644 --- a/src/bin/coreutils/src/rmdir.c +++ b/src/bin/coreutils/src/rmdir.c @@ -1,12 +1,12 @@ /* rmdir -- remove directories - Copyright (C) 90, 91, 1995-2002, 2004, 2005, 2006 Free Software + Copyright (C) 90, 91, 1995-2002, 2004-2008 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Options: -p, --parent Remove any parent dirs that are explicitly mentioned @@ -31,15 +30,13 @@ #include "system.h" #include "error.h" -#include "quotearg.h" +#include "prog-fprintf.h" +#include "quote.h" /* The official name of this program (e.g., no `g' prefix). */ #define PROGRAM_NAME "rmdir" -#define AUTHORS "David MacKenzie" - -/* The name this program was run with. */ -char *program_name; +#define AUTHORS proper_name ("David MacKenzie") /* If true, remove empty parent directories. */ static bool remove_empty_parents; @@ -75,13 +72,41 @@ static struct option const longopts[] = /* Return true if ERROR_NUMBER is one of the values associated with a failed rmdir due to non-empty target directory. */ - static bool errno_rmdir_non_empty (int error_number) { return (error_number == RMDIR_ERRNO_NOT_EMPTY); } +/* Return true if when rmdir fails with errno == ERROR_NUMBER + the directory may be empty. */ +static bool +errno_may_be_empty (int error_number) +{ + switch (error_number) + { + case EACCES: + case EPERM: + case EROFS: + case EEXIST: + case EBUSY: + return true; + default: + return false; + } +} + +/* Return true if an rmdir failure with errno == error_number + for DIR is ignorable. */ +static bool +ignorable_failure (int error_number, char const *dir) +{ + return (ignore_fail_on_non_empty + && (errno_rmdir_non_empty (error_number) + || (errno_may_be_empty (error_number) + && is_empty_dir (AT_FDCWD, dir)))); +} + /* Remove any empty parent directories of DIR. If DIR contains slash characters, at least one of them (beginning with the rightmost) is replaced with a NUL byte. @@ -107,21 +132,22 @@ remove_parents (char *dir) /* Give a diagnostic for each attempted removal if --verbose. */ if (verbose) - error (0, 0, _("removing directory, %s"), dir); + prog_fprintf (stdout, _("removing directory, %s"), quote (dir)); ok = (rmdir (dir) == 0); if (!ok) { /* Stop quietly if --ignore-fail-on-non-empty. */ - if (ignore_fail_on_non_empty - && errno_rmdir_non_empty (errno)) + if (ignorable_failure (errno, dir)) { ok = true; } else { - error (0, errno, "%s", quotearg_colon (dir)); + /* Barring race conditions, DIR is expected to be a directory. */ + error (0, errno, _("failed to remove directory %s"), + quote (dir)); } break; } @@ -143,16 +169,16 @@ Remove the DIRECTORY(ies), if they are empty.\n\ \n\ --ignore-fail-on-non-empty\n\ ignore each failure that is solely because a directory\n\ - is non-empty\n\ + is non-empty\n\ "), stdout); fputs (_("\ - -p, --parents Remove DIRECTORY and its ancestors. E.g., `rmdir -p a/b/c' is\n\ - similar to `rmdir a/b/c a/b a'.\n\ + -p, --parents remove DIRECTORY and its ancestors; e.g., `rmdir -p a/b/c' is\n\ + similar to `rmdir a/b/c a/b a'\n\ -v, --verbose output a diagnostic for every directory processed\n\ "), stdout); fputs (HELP_OPTION_DESCRIPTION, stdout); fputs (VERSION_OPTION_DESCRIPTION, stdout); - printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT); + emit_bug_reporting_address (); } exit (status); } @@ -164,7 +190,7 @@ main (int argc, char **argv) int optc; initialize_main (&argc, &argv); - program_name = argv[0]; + set_program_name (argv[0]); setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); @@ -205,15 +231,16 @@ main (int argc, char **argv) /* Give a diagnostic for each attempted removal if --verbose. */ if (verbose) - error (0, 0, _("removing directory, %s"), dir); + prog_fprintf (stdout, _("removing directory, %s"), quote (dir)); if (rmdir (dir) != 0) { - if (ignore_fail_on_non_empty - && errno_rmdir_non_empty (errno)) + if (ignorable_failure (errno, dir)) continue; - error (0, errno, "%s", quotearg_colon (dir)); + /* Here, the diagnostic is less precise, since we have no idea + whether DIR is a directory. */ + error (0, errno, _("failed to remove %s"), quote (dir)); ok = false; } else if (remove_empty_parents) diff --git a/src/bin/coreutils/src/runcon.c b/src/bin/coreutils/src/runcon.c new file mode 100644 index 0000000000..fce83e52aa --- /dev/null +++ b/src/bin/coreutils/src/runcon.c @@ -0,0 +1,264 @@ +/* runcon -- run command with specified security context + Copyright (C) 2005-2008 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* + * runcon [ context | + * ( [ -c ] [ -r role ] [-t type] [ -u user ] [ -l levelrange ] ) + * command [arg1 [arg2 ...] ] + * + * attempt to run the specified command with the specified context. + * + * -r role : use the current context with the specified role + * -t type : use the current context with the specified type + * -u user : use the current context with the specified user + * -l level : use the current context with the specified level range + * -c : compute process transition context before modifying + * + * Contexts are interpreted as follows: + * + * Number of MLS + * components system? + * + * 1 - type + * 2 - role:type + * 3 Y role:type:range + * 3 N user:role:type + * 4 Y user:role:type:range + * 4 N error + */ + +#include +#include +#include +#include +#include +#ifdef HAVE_SELINUX_FLASK_H +# include +#else +# define SECCLASS_PROCESS 0 +#endif +#include +#include "system.h" +#include "error.h" +#include "quote.h" +#include "quotearg.h" + +/* The official name of this program (e.g., no `g' prefix). */ +#define PROGRAM_NAME "runcon" + +#define AUTHORS proper_name ("Russell Coker") + +static struct option const long_options[] = +{ + {"role", required_argument, NULL, 'r'}, + {"type", required_argument, NULL, 't'}, + {"user", required_argument, NULL, 'u'}, + {"range", required_argument, NULL, 'l'}, + {"compute", no_argument, NULL, 'c'}, + {GETOPT_HELP_OPTION_DECL}, + {GETOPT_VERSION_OPTION_DECL}, + {NULL, 0, NULL, 0} +}; + +void +usage (int status) +{ + if (status != EXIT_SUCCESS) + fprintf (stderr, _("Try `%s --help' for more information.\n"), + program_name); + else + { + printf (_("\ +Usage: %s CONTEXT COMMAND [args]\n\ + or: %s [ -c ] [-u USER] [-r ROLE] [-t TYPE] [-l RANGE] COMMAND [args]\n\ +"), program_name, program_name); + fputs (_("\ +Run a program in a different security context.\n\ +With neither CONTEXT nor COMMAND, print the current security context.\n\ +\n\ + CONTEXT Complete security context\n\ + -c, --compute compute process transition context before modifying\n\ + -t, --type=TYPE type (for same role as parent)\n\ + -u, --user=USER user identity\n\ + -r, --role=ROLE role\n\ + -l, --range=RANGE levelrange\n\ +\n\ +"), stdout); + fputs (HELP_OPTION_DESCRIPTION, stdout); + fputs (VERSION_OPTION_DESCRIPTION, stdout); + emit_bug_reporting_address (); + } + exit (status); +} + +int +main (int argc, char **argv) +{ + char *role = NULL; + char *range = NULL; + char *user = NULL; + char *type = NULL; + char *context = NULL; + security_context_t cur_context = NULL; + security_context_t file_context = NULL; + security_context_t new_context = NULL; + bool compute_trans = false; + + context_t con; + + initialize_main (&argc, &argv); + set_program_name (argv[0]); + setlocale (LC_ALL, ""); + bindtextdomain (PACKAGE, LOCALEDIR); + textdomain (PACKAGE); + + atexit (close_stdout); + + while (1) + { + int option_index = 0; + int c = getopt_long (argc, argv, "+r:t:u:l:c", long_options, + &option_index); + if (c == -1) + break; + switch (c) + { + case 'r': + if (role) + error (EXIT_FAILURE, 0, _("multiple roles")); + role = optarg; + break; + case 't': + if (type) + error (EXIT_FAILURE, 0, _("multiple types")); + type = optarg; + break; + case 'u': + if (user) + error (EXIT_FAILURE, 0, _("multiple users")); + user = optarg; + break; + case 'l': + if (range) + error (EXIT_FAILURE, 0, _("multiple levelranges")); + range = optarg; + break; + case 'c': + compute_trans = true; + break; + + case_GETOPT_HELP_CHAR; + case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS); + default: + usage (EXIT_FAILURE); + break; + } + } + + if (argc - optind == 0) + { + if (getcon (&cur_context) < 0) + error (EXIT_FAILURE, errno, _("failed to get current context")); + fputs (cur_context, stdout); + fputc ('\n', stdout); + exit (EXIT_SUCCESS); + } + + if (!(user || role || type || range || compute_trans)) + { + if (optind >= argc) + { + error (0, 0, _("you must specify -c, -t, -u, -l, -r, or context")); + usage (1); + } + context = argv[optind++]; + } + + if (optind >= argc) + { + error (0, 0, _("no command specified")); + usage (1); + } + + if (is_selinux_enabled () != 1) + error (EXIT_FAILURE, 0, + _("runcon may be used only on a SELinux kernel")); + + if (context) + { + con = context_new (context); + if (!con) + error (EXIT_FAILURE, errno, _("failed to create security context: %s"), + quotearg_colon (context)); + } + else + { + if (getcon (&cur_context) < 0) + error (EXIT_FAILURE, errno, _("failed to get current context")); + + /* We will generate context based on process transition */ + if (compute_trans) + { + /* Get context of file to be executed */ + if (getfilecon (argv[optind], &file_context) == -1) + error (EXIT_FAILURE, errno, + _("failed to get security context of %s"), + quote (argv[optind])); + /* compute result of process transition */ + if (security_compute_create (cur_context, file_context, + SECCLASS_PROCESS, &new_context) != 0) + error (EXIT_FAILURE, errno, + _("failed to compute a new context")); + /* free contexts */ + freecon (file_context); + freecon (cur_context); + + /* set cur_context equal to new_context */ + cur_context = new_context; + } + + con = context_new (cur_context); + if (!con) + error (EXIT_FAILURE, errno, _("failed to create security context: %s"), + quotearg_colon (cur_context)); + if (user && context_user_set (con, user)) + error (EXIT_FAILURE, errno, _("failed to set new user %s"), user); + if (type && context_type_set (con, type)) + error (EXIT_FAILURE, errno, _("failed to set new type %s"), type); + if (range && context_range_set (con, range)) + error (EXIT_FAILURE, errno, _("failed to set new range %s"), range); + if (role && context_role_set (con, role)) + error (EXIT_FAILURE, errno, _("failed to set new role %s"), role); + } + + if (security_check_context (context_str (con)) < 0) + error (EXIT_FAILURE, errno, _("invalid context: %s"), + quotearg_colon (context_str (con))); + + if (setexeccon (context_str (con)) != 0) + error (EXIT_FAILURE, errno, _("unable to set security context %s"), + quote (context_str (con))); + if (cur_context != NULL) + freecon (cur_context); + + execvp (argv[optind], argv + optind); + + { + int exit_status = (errno == ENOENT ? EXIT_ENOENT : EXIT_CANNOT_INVOKE); + error (0, errno, "%s", argv[optind]); + exit (exit_status); + } +} diff --git a/src/bin/coreutils/src/seq.c b/src/bin/coreutils/src/seq.c index 59dd318d4e..1ec2725398 100644 --- a/src/bin/coreutils/src/seq.c +++ b/src/bin/coreutils/src/seq.c @@ -1,10 +1,10 @@ /* seq - print sequence of numbers to standard output. - Copyright (C) 1994-2006 Free Software Foundation, Inc. + Copyright (C) 1994-2009 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Ulrich Drepper. */ @@ -37,14 +36,11 @@ /* The official name of this program (e.g., no `g' prefix). */ #define PROGRAM_NAME "seq" -#define AUTHORS "Ulrich Drepper" +#define AUTHORS proper_name ("Ulrich Drepper") /* If true print all number with equal width. */ static bool equal_width; -/* The name that this program was run with. */ -char *program_name; - /* The string used to separate two numbers. */ static char const *separator; @@ -98,7 +94,7 @@ FORMAT must be suitable for printing one argument of type `double';\n\ it defaults to %.PRECf if FIRST, INCREMENT, and LAST are all fixed point\n\ decimal numbers with maximum precision PREC, and to %g otherwise.\n\ "), stdout); - printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT); + emit_bug_reporting_address (); } exit (status); } @@ -121,6 +117,14 @@ struct operand }; typedef struct operand operand; +/* Description of what a number-generating format will generate. */ +struct layout +{ + /* Number of bytes before and after the number. */ + size_t prefix_len; + size_t suffix_len; +}; + /* Read a long double value from the command line. Return if the string is correct else signal error. */ @@ -135,43 +139,64 @@ scan_arg (const char *arg) usage (EXIT_FAILURE); } + /* We don't output spaces or '+' so don't include in width */ + while (isspace (to_uchar (*arg)) || *arg == '+') + arg++; + ret.width = strlen (arg); ret.precision = INT_MAX; - if (! arg[strcspn (arg, "eExX")] && isfinite (ret.value)) + if (! arg[strcspn (arg, "xX")] && isfinite (ret.value)) { char const *decimal_point = strchr (arg, '.'); if (! decimal_point) ret.precision = 0; else { - size_t fraction_len = strlen (decimal_point + 1); + size_t fraction_len = strcspn (decimal_point + 1, "eE"); if (fraction_len <= INT_MAX) ret.precision = fraction_len; - ret.width += (fraction_len == 0 + ret.width += (fraction_len == 0 /* #. -> # */ ? -1 - : (decimal_point == arg - || ! ISDIGIT (decimal_point[-1]))); + : (decimal_point == arg /* .# -> 0.# */ + || ! ISDIGIT (decimal_point[-1]))); /* -.# -> 0.# */ } + { + char const *e = strchr (arg, 'e'); + if (! e) + e = strchr (arg, 'E'); + if (e) + { + long exponent = strtol (e + 1, NULL, 10); + ret.precision += exponent < 0 ? -exponent : 0; + } + } } return ret; } /* If FORMAT is a valid printf format for a double argument, return - its long double equivalent, possibly allocated from dynamic - storage; otherwise, return NULL. */ + its long double equivalent, allocated from dynamic storage, and + store into *LAYOUT a description of the output layout; otherwise, + report an error and exit. */ static char const * -long_double_format (char const *fmt) +long_double_format (char const *fmt, struct layout *layout) { size_t i; - size_t prefix_len; + size_t prefix_len = 0; + size_t suffix_len = 0; + size_t length_modifier_offset; bool has_L; - for (i = 0; ! (fmt[i] == '%' && fmt[i + 1] != '%'); i++) - if (! fmt[i]) - return NULL; + for (i = 0; ! (fmt[i] == '%' && fmt[i + 1] != '%'); i += (fmt[i] == '%') + 1) + { + if (!fmt[i]) + error (EXIT_FAILURE, 0, + _("format %s has no %% directive"), quote (fmt)); + prefix_len++; + } i++; i += strspn (fmt + i, "-+#0 '"); @@ -182,47 +207,98 @@ long_double_format (char const *fmt) i += strspn (fmt + i, "0123456789"); } - prefix_len = i; + length_modifier_offset = i; has_L = (fmt[i] == 'L'); i += has_L; + if (fmt[i] == '\0') + error (EXIT_FAILURE, 0, _("format %s ends in %%"), quote (fmt)); if (! strchr ("efgaEFGA", fmt[i])) - return NULL; + error (EXIT_FAILURE, 0, + _("format %s has unknown %%%c directive"), quote (fmt), fmt[i]); - for (i++; ! (fmt[i] == '%' && fmt[i + 1] != '%'); i++) - if (! fmt[i]) + for (i++; ; i += (fmt[i] == '%') + 1) + if (fmt[i] == '%' && fmt[i + 1] != '%') + error (EXIT_FAILURE, 0, _("format %s has too many %% directives"), + quote (fmt)); + else if (fmt[i]) + suffix_len++; + else { size_t format_size = i + 1; char *ldfmt = xmalloc (format_size + 1); - memcpy (ldfmt, fmt, prefix_len); - ldfmt[prefix_len] = 'L'; - strcpy (ldfmt + prefix_len + 1, fmt + prefix_len + has_L); + memcpy (ldfmt, fmt, length_modifier_offset); + ldfmt[length_modifier_offset] = 'L'; + strcpy (ldfmt + length_modifier_offset + 1, + fmt + length_modifier_offset + has_L); + layout->prefix_len = prefix_len; + layout->suffix_len = suffix_len; return ldfmt; } - - return NULL; } /* Actually print the sequence of numbers in the specified range, with the given or default stepping and format. */ static void -print_numbers (char const *fmt, +print_numbers (char const *fmt, struct layout layout, long double first, long double step, long double last) { - long double i; + bool out_of_range = (step < 0 ? first < last : last < first); - for (i = 0; /* empty */; i++) + if (! out_of_range) { - long double x = first + i * step; - if (step < 0 ? x < last : last < x) - break; - if (i) - fputs (separator, stdout); - printf (fmt, x); - } + long double x = first; + long double i; - if (i) - fputs (terminator, stdout); + for (i = 1; ; i++) + { + long double x0 = x; + printf (fmt, x); + if (out_of_range) + break; + x = first + i * step; + out_of_range = (step < 0 ? x < last : last < x); + + if (out_of_range) + { + /* If the number just past LAST prints as a value equal + to LAST, and prints differently from the previous + number, then print the number. This avoids problems + with rounding. For example, with the x86 it causes + "seq 0 0.000001 0.000003" to print 0.000003 instead + of stopping at 0.000002. */ + + bool print_extra_number = false; + long double x_val; + char *x_str; + int x_strlen; + setlocale (LC_NUMERIC, "C"); + x_strlen = asprintf (&x_str, fmt, x); + setlocale (LC_NUMERIC, ""); + if (x_strlen < 0) + xalloc_die (); + x_str[x_strlen - layout.suffix_len] = '\0'; + + if (xstrtold (x_str + layout.prefix_len, NULL, &x_val, c_strtold) + && x_val == last) + { + char *x0_str = NULL; + if (asprintf (&x0_str, fmt, x0) < 0) + xalloc_die (); + print_extra_number = !STREQ (x0_str, x_str); + free (x0_str); + } + + free (x_str); + if (! print_extra_number) + break; + } + + fputs (separator, stdout); + } + + fputs (terminator, stdout); + } } /* Return the default format given FIRST, STEP, and LAST. */ @@ -237,19 +313,23 @@ get_default_format (operand first, operand step, operand last) { if (equal_width) { + /* increase first_width by any increased precision in step */ size_t first_width = first.width + (prec - first.precision); + /* adjust last_width to use precision from first/step */ size_t last_width = last.width + (prec - last.precision); - if (first.width <= first_width - && (last.width < last_width) == (prec < last.precision)) + if (last.precision && prec == 0) + last_width--; /* don't include space for '.' */ + if (last.precision == 0 && prec) + last_width++; /* include space for '.' */ + { + size_t width = MAX (first_width, last_width); + if (width <= INT_MAX) { - size_t width = MAX (first_width, last_width); - if (width <= INT_MAX) - { - int w = width; - sprintf (format_buf, "%%0%d.%dLf", w, prec); - return format_buf; - } + int w = width; + sprintf (format_buf, "%%0%d.%dLf", w, prec); + return format_buf; } + } } else { @@ -268,12 +348,13 @@ main (int argc, char **argv) operand first = { 1, 1, 0 }; operand step = { 1, 1, 0 }; operand last; + struct layout layout = { 0, 0 }; /* The printf(3) format used for output. */ char const *format_str = NULL; initialize_main (&argc, &argv); - program_name = argv[0]; + set_program_name (argv[0]); setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); @@ -335,15 +416,7 @@ main (int argc, char **argv) } if (format_str) - { - char const *f = long_double_format (format_str); - if (! f) - { - error (0, 0, _("invalid format string: %s"), quote (format_str)); - usage (EXIT_FAILURE); - } - format_str = f; - } + format_str = long_double_format (format_str, &layout); last = scan_arg (argv[optind++]); @@ -369,7 +442,7 @@ format string may not be specified when printing equal width strings")); if (format_str == NULL) format_str = get_default_format (first, step, last); - print_numbers (format_str, first.value, step.value, last.value); + print_numbers (format_str, layout, first.value, step.value, last.value); exit (EXIT_SUCCESS); } diff --git a/src/bin/coreutils/src/setuidgid.c b/src/bin/coreutils/src/setuidgid.c index 3a51225dc0..beff04acb3 100644 --- a/src/bin/coreutils/src/setuidgid.c +++ b/src/bin/coreutils/src/setuidgid.c @@ -1,10 +1,10 @@ /* setuidgid - run a command with the UID and GID of a specified user - Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. + Copyright (C) 2003-2009 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Jim Meyering */ @@ -28,43 +27,47 @@ #include "error.h" #include "long-options.h" +#include "mgetgroups.h" #include "quote.h" +#include "xstrtol.h" #define PROGRAM_NAME "setuidgid" /* I wrote this program from scratch, based on the description of D.J. Bernstein's program: http://cr.yp.to/daemontools/setuidgid.html. */ -#define AUTHORS "Jim Meyering" +#define AUTHORS proper_name ("Jim Meyering") #define SETUIDGID_FAILURE 111 -char *program_name; - void usage (int status) { if (status != EXIT_SUCCESS) fprintf (stderr, _("Try `%s --help' for more information.\n"), - program_name); + program_name); else { printf (_("\ -Usage: %s USERNAME COMMAND [ARGUMENT]...\n\ - or: %s OPTION\n\ +Usage: %s [SHORT-OPTION]... USER COMMAND [ARGUMENT]...\n\ + or: %s LONG-OPTION\n\ "), - program_name, program_name); + program_name, program_name); fputs (_("\ -Drop any supplemental groups, assume the user-ID and group-ID of\n\ -the specified USERNAME, and run COMMAND with any specified ARGUMENTs.\n\ +Drop any supplemental groups, assume the user-ID and group-ID of the specified\n\ +USER (numeric ID or user name), and run COMMAND with any specified ARGUMENTs.\n\ Exit with status 111 if unable to assume the required user and group ID.\n\ Otherwise, exit with the exit status of COMMAND.\n\ This program is useful only when run by root (user ID zero).\n\ \n\ +"), stdout); + fputs (_("\ + -g GID[,GID1...] also set the primary group-ID to the numeric GID, and\n\ + (if specified) supplemental group IDs to GID1, ...\n\ "), stdout); fputs (HELP_OPTION_DESCRIPTION, stdout); fputs (VERSION_OPTION_DESCRIPTION, stdout); - printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT); + emit_bug_reporting_address (); } exit (status); } @@ -72,11 +75,14 @@ This program is useful only when run by root (user ID zero).\n\ int main (int argc, char **argv) { - char const *user_id; - struct passwd *pwd; + uid_t uid; + GETGROUPS_T *gids = NULL; + size_t n_gids = 0; + size_t n_gids_allocated = 0; + gid_t primary_gid; initialize_main (&argc, &argv); - program_name = argv[0]; + set_program_name (argv[0]); setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); @@ -84,38 +90,119 @@ main (int argc, char **argv) initialize_exit_failure (SETUIDGID_FAILURE); atexit (close_stdout); - parse_long_options (argc, argv, PROGRAM_NAME, GNU_PACKAGE, VERSION, - usage, AUTHORS, (char const *) NULL); - if (getopt_long (argc, argv, "+", NULL, NULL) != -1) - usage (SETUIDGID_FAILURE); + parse_long_options (argc, argv, PROGRAM_NAME, PACKAGE_NAME, Version, + usage, AUTHORS, (char const *) NULL); + { + int c; + while ((c = getopt_long (argc, argv, "+g:", NULL, NULL)) != -1) + { + switch (c) + { + case 'g': + { + unsigned long int tmp_ul; + char *gr = optarg; + char *ptr; + while (true) + { + if (! (xstrtoul (gr, &ptr, 10, &tmp_ul, NULL) == LONGINT_OK + && tmp_ul <= GID_T_MAX)) + error (EXIT_FAILURE, 0, _("invalid group %s"), + quote (gr)); + if (n_gids == n_gids_allocated) + gids = x2nrealloc (gids, &n_gids_allocated, sizeof *gids); + gids[n_gids++] = tmp_ul; + + if (*ptr == '\0') + break; + if (*ptr != ',') + { + error (0, 0, _("invalid group %s"), quote (gr)); + usage (SETUIDGID_FAILURE); + } + gr = ptr + 1; + } + break; + } + + default: + usage (SETUIDGID_FAILURE); + } + } + } if (argc <= optind + 1) { if (argc < optind + 1) - error (0, 0, _("missing operand")); + error (0, 0, _("missing operand")); else - error (0, 0, _("missing operand after %s"), quote (argv[optind])); + error (0, 0, _("missing operand after %s"), quote (argv[optind])); usage (SETUIDGID_FAILURE); } - user_id = argv[optind]; - pwd = getpwnam (user_id); - if (pwd == NULL) - error (SETUIDGID_FAILURE, errno, - _("unknown user-ID: %s"), quote (user_id)); + { + const struct passwd *pwd; + unsigned long int tmp_ul; + char *user = argv[optind]; + char *ptr; + bool have_uid = false; + + if (xstrtoul (user, &ptr, 10, &tmp_ul, "") == LONGINT_OK + && tmp_ul <= UID_T_MAX) + { + uid = tmp_ul; + have_uid = true; + } + + if (!have_uid) + { + pwd = getpwnam (user); + if (pwd == NULL) + { + error (SETUIDGID_FAILURE, errno, + _("unknown user-ID: %s"), quote (user)); + usage (SETUIDGID_FAILURE); + } + uid = pwd->pw_uid; + } + else if (n_gids == 0) + { + pwd = getpwuid (uid); + if (pwd == NULL) + { + error (SETUIDGID_FAILURE, errno, + _("to use user-ID %s you need to use -g too"), quote (user)); + usage (SETUIDGID_FAILURE); + } + } #if HAVE_SETGROUPS - if (setgroups (1, &pwd->pw_gid)) - error (SETUIDGID_FAILURE, errno, _("cannot set supplemental group")); + if (n_gids == 0) + { + int n = mgetgroups (pwd->pw_name, pwd->pw_gid, &gids); + if (n <= 0) + error (1, errno, _("failed to get groups for user %s"), + quote (pwd->pw_name)); + n_gids = n; + } + + if (setgroups (n_gids, gids)) + error (SETUIDGID_FAILURE, errno, + _("failed to set supplemental group(s)")); + + primary_gid = gids[0]; +#else + primary_gid = pwd->pw_gid; #endif + } - if (setgid (pwd->pw_gid)) + if (setgid (primary_gid)) error (SETUIDGID_FAILURE, errno, - _("cannot set group-ID to %lu"), (unsigned long int) pwd->pw_gid); + _("cannot set group-ID to %lu"), (unsigned long int) primary_gid); - if (setuid (pwd->pw_uid)) + if (setuid (uid)) error (SETUIDGID_FAILURE, errno, - _("cannot set user-ID to %lu"), (unsigned long int) pwd->pw_uid); + _("cannot set user-ID to %lu"), (unsigned long int) uid); { char **cmd = argv + optind + 1; @@ -127,3 +214,9 @@ main (int argc, char **argv) exit (exit_status); } } + +/* + * Local variables: + * indent-tabs-mode: nil + * End: + */ diff --git a/src/bin/coreutils/src/shred.c b/src/bin/coreutils/src/shred.c index 822762926f..4497a88cae 100644 --- a/src/bin/coreutils/src/shred.c +++ b/src/bin/coreutils/src/shred.c @@ -1,12 +1,12 @@ /* shred.c - overwrite files and devices to make it harder to recover data - Copyright (C) 1999-2006 Free Software Foundation, Inc. + Copyright (C) 1999-2009 Free Software Foundation, Inc. Copyright (C) 1997, 1998, 1999 Colin Plumb. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + along with this program. If not, see . Written by Colin Plumb. */ @@ -83,7 +82,7 @@ /* The official name of this program (e.g., no `g' prefix). */ #define PROGRAM_NAME "shred" -#define AUTHORS "Colin Plumb" +#define AUTHORS proper_name ("Colin Plumb") #include @@ -97,16 +96,13 @@ #include "xstrtol.h" #include "error.h" #include "fcntl--.h" -#include "getpagesize.h" #include "human.h" -#include "inttostr.h" #include "quotearg.h" /* For quotearg_colon */ -#include "quote.h" /* For quotearg_colon */ #include "randint.h" #include "randread.h" /* Default number of times to overwrite. */ -enum { DEFAULT_PASSES = 25 }; +enum { DEFAULT_PASSES = 3 }; /* How many seconds to wait before checking whether to output another verbose output line. */ @@ -151,9 +147,6 @@ static struct option const long_opts[] = {NULL, 0, NULL, 0} }; -/* Global variable for error printing purposes */ -char const *program_name; /* Initialized before any possible use */ - void usage (int status) { @@ -162,7 +155,7 @@ usage (int status) program_name); else { - printf (_("Usage: %s [OPTIONS] FILE [...]\n"), program_name); + printf (_("Usage: %s [OPTION]... FILE...\n"), program_name); fputs (_("\ Overwrite the specified FILE(s) repeatedly, in order to make it harder\n\ for even very expensive hardware probing to recover the data.\n\ @@ -173,8 +166,8 @@ Mandatory arguments to long options are mandatory for short options too.\n\ "), stdout); printf (_("\ -f, --force change permissions to allow writing if necessary\n\ - -n, --iterations=N Overwrite N times instead of the default (%d)\n\ - --random-source=FILE get random bytes from FILE (default /dev/urandom)\n\ + -n, --iterations=N overwrite N times instead of the default (%d)\n\ + --random-source=FILE get random bytes from FILE\n\ -s, --size=N shred this many bytes (suffixes like K, M, G accepted)\n\ "), DEFAULT_PASSES); fputs (_("\ @@ -236,7 +229,7 @@ In addition, file system backups and remote mirrors may contain copies\n\ of the file that cannot be removed, and that will allow a shredded file\n\ to be recovered later.\n\ "), stdout); - printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT); + emit_bug_reporting_address (); } exit (status); } @@ -283,6 +276,17 @@ passname (unsigned char const *data, char name[PASS_NAME_SIZE]) memcpy (name, "random", PASS_NAME_SIZE); } +/* Return true when it's ok to ignore an fsync or fdatasync + failure that set errno to ERRNO_VAL. */ +static bool +ignorable_sync_errno (int errno_val) +{ + return (errno_val == EINVAL + || errno_val == EBADF + /* HP-UX does this */ + || errno_val == EISDIR); +} + /* Request that all data for FD be transferred to the corresponding storage device. QNAME is the file name (quoted for colons). Report any errors found. Return 0 on success, -1 @@ -298,7 +302,7 @@ dosync (int fd, char const *qname) if (fdatasync (fd) == 0) return 0; err = errno; - if (err != EINVAL && err != EBADF) + if ( ! ignorable_sync_errno (err)) { error (0, err, _("%s: fdatasync failed"), qname); errno = err; @@ -309,7 +313,7 @@ dosync (int fd, char const *qname) if (fsync (fd) == 0) return 0; err = errno; - if (err != EINVAL && err != EBADF) + if ( ! ignorable_sync_errno (err)) { error (0, err, _("%s: fsync failed"), qname); errno = err; @@ -395,7 +399,7 @@ dopass (int fd, char const *qname, off_t *sizep, int type, /* Constant fill patterns need only be set up once. */ if (type >= 0) { - lim = (0 <= size && size < sizeof_r ? size : sizeof r); + lim = (0 <= size && size < sizeof_r ? size : sizeof_r); fillpattern (type, r.u, lim); passname (r.u, pass_string); } @@ -446,8 +450,8 @@ dopass (int fd, char const *qname, off_t *sizep, int type, /* If the first write of the first pass for a given file has just failed with EINVAL, turn off direct mode I/O - and try again. This works around a bug in linux-2.4 - whereby opening with O_DIRECT would succeed for some + and try again. This works around a bug in Linux kernel + 2.4 whereby opening with O_DIRECT would succeed for some file system types (e.g., ext3), but any attempt to access a file through the resulting descriptor would fail with EINVAL. */ @@ -484,7 +488,7 @@ dopass (int fd, char const *qname, off_t *sizep, int type, /* Okay, we have written "soff" bytes. */ - if (offset + soff < offset) + if (offset > OFF_T_MAX - (off_t) soff) { error (0, 0, _("%s: file too large"), qname); return -1; @@ -1095,7 +1099,7 @@ int main (int argc, char **argv) { bool ok = true; - struct Options flags = { 0, }; + DECLARE_ZEROED_AGGREGATE (struct Options, flags); char **file; int n_files; int c; @@ -1103,7 +1107,7 @@ main (int argc, char **argv) char const *random_source = NULL; initialize_main (&argc, &argv); - program_name = argv[0]; + set_program_name (argv[0]); setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); diff --git a/src/bin/coreutils/src/shuf.c b/src/bin/coreutils/src/shuf.c index bfc9f30a27..b221d03385 100644 --- a/src/bin/coreutils/src/shuf.c +++ b/src/bin/coreutils/src/shuf.c @@ -1,11 +1,11 @@ /* Shuffle lines of text. - Copyright (C) 2006, 2007 Free Software Foundation, Inc. + Copyright (C) 2006, 2007-2008 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + along with this program. If not, see . Written by Paul Eggert. */ @@ -35,10 +34,7 @@ /* The official name of this program (e.g., no `g' prefix). */ #define PROGRAM_NAME "shuf" -#define AUTHORS "Paul Eggert" - -/* The name this program was run with. */ -char *program_name; +#define AUTHORS proper_name ("Paul Eggert") void usage (int status) @@ -64,9 +60,9 @@ Mandatory arguments to long options are mandatory for short options too.\n\ fputs (_("\ -e, --echo treat each ARG as an input line\n\ -i, --input-range=LO-HI treat each number LO through HI as an input line\n\ - -n, --head-lines=LINES output at most LINES lines\n\ + -n, --head-count=COUNT output at most COUNT lines\n\ -o, --output=FILE write result to FILE instead of standard output\n\ - --random-source=FILE get random bytes from FILE (default /dev/urandom)\n\ + --random-source=FILE get random bytes from FILE\n\ -z, --zero-terminated end lines with 0 byte, not newline\n\ "), stdout); fputs (HELP_OPTION_DESCRIPTION, stdout); @@ -75,7 +71,7 @@ Mandatory arguments to long options are mandatory for short options too.\n\ \n\ With no FILE, or when FILE is -, read standard input.\n\ "), stdout); - printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT); + emit_bug_reporting_address (); } exit (status); @@ -218,7 +214,7 @@ read_input (FILE *in, char eolbyte, char ***pline) static int write_permuted_output (size_t n_lines, char * const *line, size_t lo_input, - size_t const *permutation) + size_t const *permutation, char eolbyte) { size_t i; @@ -234,7 +230,7 @@ write_permuted_output (size_t n_lines, char * const *line, size_t lo_input, for (i = 0; i < n_lines; i++) { unsigned long int n = lo_input + permutation[i]; - if (printf ("%lu\n", n) < 0) + if (printf ("%lu%c", n, eolbyte) < 0) return -1; } @@ -262,7 +258,7 @@ main (int argc, char **argv) size_t *permutation; initialize_main (&argc, &argv); - program_name = argv[0]; + set_program_name (argv[0]); setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); @@ -404,7 +400,8 @@ main (int argc, char **argv) if (outfile && ! freopen (outfile, "w", stdout)) error (EXIT_FAILURE, errno, "%s", quotearg_colon (outfile)); - if (write_permuted_output (head_lines, line, lo_input, permutation) != 0) + if (write_permuted_output (head_lines, line, lo_input, permutation, eolbyte) + != 0) error (EXIT_FAILURE, errno, _("write error")); #ifdef lint diff --git a/src/bin/coreutils/src/sleep.c b/src/bin/coreutils/src/sleep.c index 730b19d171..0c11b8e73b 100644 --- a/src/bin/coreutils/src/sleep.c +++ b/src/bin/coreutils/src/sleep.c @@ -1,10 +1,11 @@ /* sleep - delay for a specified amount of time. - Copyright (C) 84, 1991-1997, 1999-2005 Free Software Foundation, Inc. + Copyright (C) 84, 1991-1997, 1999-2005, 2007-2008 + Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ #include #include @@ -31,10 +31,9 @@ /* The official name of this program (e.g., no `g' prefix). */ #define PROGRAM_NAME "sleep" -#define AUTHORS "Jim Meyering", "Paul Eggert" - -/* The name by which this program was run. */ -char *program_name; +#define AUTHORS \ + proper_name ("Jim Meyering"), \ + proper_name ("Paul Eggert") void usage (int status) @@ -57,7 +56,7 @@ specified by the sum of their values.\n\ program_name, program_name); fputs (HELP_OPTION_DESCRIPTION, stdout); fputs (VERSION_OPTION_DESCRIPTION, stdout); - printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT); + emit_bug_reporting_address (); } exit (status); } @@ -105,14 +104,14 @@ main (int argc, char **argv) bool ok = true; initialize_main (&argc, &argv); - program_name = argv[0]; + set_program_name (argv[0]); setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); atexit (close_stdout); - parse_long_options (argc, argv, PROGRAM_NAME, GNU_PACKAGE, VERSION, + parse_long_options (argc, argv, PROGRAM_NAME, PACKAGE_NAME, Version, usage, AUTHORS, (char const *) NULL); if (getopt_long (argc, argv, "", NULL, NULL) != -1) usage (EXIT_FAILURE); diff --git a/src/bin/coreutils/src/sort.c b/src/bin/coreutils/src/sort.c index 58ca66a2e3..989560893d 100644 --- a/src/bin/coreutils/src/sort.c +++ b/src/bin/coreutils/src/sort.c @@ -1,10 +1,10 @@ /* sort - sort lines of text (with all kinds of options). - Copyright (C) 1988, 1991-2007 Free Software Foundation, Inc. + Copyright (C) 1988, 1991-2009 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + along with this program. If not, see . Written December 1988 by Mike Haertel. The author may be reached (Email) at the address mike@gnu.ai.mit.edu, @@ -30,14 +29,15 @@ #include "system.h" #include "argmatch.h" #include "error.h" -#include "hard-locale.h" +#include "filevercmp.h" #include "hash.h" -#include "inttostr.h" #include "md5.h" #include "physmem.h" #include "posixver.h" #include "quote.h" +#include "quotearg.h" #include "randread.h" +#include "readtokens0.h" #include "stdio--.h" #include "stdlib--.h" #include "strnumcmp.h" @@ -56,7 +56,9 @@ struct rlimit { size_t rlim_cur; }; /* The official name of this program (e.g., no `g' prefix). */ #define PROGRAM_NAME "sort" -#define AUTHORS "Mike Haertel", "Paul Eggert" +#define AUTHORS \ + proper_name ("Mike Haertel"), \ + proper_name ("Paul Eggert") #if HAVE_LANGINFO_CODESET # include @@ -74,8 +76,11 @@ struct rlimit { size_t rlim_cur; }; # endif #endif -#ifndef STDC_HEADERS -double strtod (); +#if !defined OPEN_MAX && defined NR_OPEN +# define OPEN_MAX NR_OPEN +#endif +#if !defined OPEN_MAX +# define OPEN_MAX 20 #endif #define UCHAR_LIM (UCHAR_MAX + 1) @@ -173,6 +178,7 @@ struct keyfield Handle numbers in exponential notation. */ bool month; /* Flag for comparison by month name. */ bool reverse; /* Reverse the sense of comparison. */ + bool version; /* sort by version number */ struct keyfield *next; /* Next keyfield to try. */ }; @@ -182,9 +188,6 @@ struct month int val; }; -/* The name this program was run with. */ -char *program_name; - /* FIXME: None of these tables work with multibyte character sets. Also, there are many other bugs when handling multibyte characters. One way to fix this is to rewrite `sort' to use wide characters @@ -224,13 +227,13 @@ static struct month monthtab[] = }; /* During the merge phase, the number of files to merge at once. */ -#define NMERGE 16 +#define NMERGE_DEFAULT 16 /* Minimum size for a merge or check buffer. */ #define MIN_MERGE_BUFFER_SIZE (2 + sizeof (struct line)) /* Minimum sort size; the code might not work with smaller sizes. */ -#define MIN_SORT_SIZE (NMERGE * MIN_MERGE_BUFFER_SIZE) +#define MIN_SORT_SIZE (nmerge * MIN_MERGE_BUFFER_SIZE) /* The number of bytes needed for a merge or check buffer, which can function relatively efficiently even if it holds only one line. If @@ -282,6 +285,10 @@ static struct keyfield *keylist; /* Program used to (de)compress temp files. Must accept -d. */ static char const *compress_program; +/* Maximum number of files to merge in one go. If more than this + number are present, temp files will be used. */ +static unsigned int nmerge = NMERGE_DEFAULT; + static void sortlines_temp (struct line *, size_t, struct line *); /* Report MESSAGE for FILE, then clean up and exit. @@ -305,8 +312,9 @@ usage (int status) { printf (_("\ Usage: %s [OPTION]... [FILE]...\n\ + or: %s [OPTION]... --files0-from=F\n\ "), - program_name); + program_name, program_name); fputs (_("\ Write sorted concatenation of all FILE(s) to standard output.\n\ \n\ @@ -327,20 +335,40 @@ Ordering options:\n\ -g, --general-numeric-sort compare according to general numerical value\n\ -i, --ignore-nonprinting consider only printable characters\n\ -M, --month-sort compare (unknown) < `JAN' < ... < `DEC'\n\ +"), stdout); + fputs (_("\ -n, --numeric-sort compare according to string numerical value\n\ -R, --random-sort sort by random hash of keys\n\ - --random-source=FILE get random bytes from FILE (default /dev/urandom)\n\ + --random-source=FILE get random bytes from FILE\n\ -r, --reverse reverse the result of comparisons\n\ +"), stdout); + fputs (_("\ + --sort=WORD sort according to WORD:\n\ + general-numeric -g, month -M, numeric -n,\n\ + random -R, version -V\n\ + -V, --version-sort natural sort of (version) numbers within text\n\ \n\ "), stdout); fputs (_("\ Other options:\n\ \n\ +"), stdout); + fputs (_("\ + --batch-size=NMERGE merge at most NMERGE inputs at once;\n\ + for more use temp files\n\ +"), stdout); + fputs (_("\ -c, --check, --check=diagnose-first check for sorted input; do not sort\n\ -C, --check=quiet, --check=silent like -c, but do not report first bad line\n\ --compress-program=PROG compress temporaries with PROG;\n\ decompress them with PROG -d\n\ - -k, --key=POS1[,POS2] start a key at POS1, end it at POS2 (origin 1)\n\ + --files0-from=F read input from the files specified by\n\ + NUL-terminated names in file F;\n\ + If F is - then read names from standard input\n\ +"), stdout); + fputs (_("\ + -k, --key=POS1[,POS2] start a key at POS1 (origin 1), end it at POS2\n\ + (default end of line)\n\ -m, --merge merge already sorted files; do not sort\n\ "), stdout); fputs (_("\ @@ -380,7 +408,7 @@ The locale specified by the environment affects sort order.\n\ Set LC_ALL=C to get the traditional sort order that uses\n\ native byte values.\n\ "), stdout ); - printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT); + emit_bug_reporting_address (); } exit (status); @@ -392,10 +420,13 @@ enum { CHECK_OPTION = CHAR_MAX + 1, COMPRESS_PROGRAM_OPTION, - RANDOM_SOURCE_OPTION + FILES0_FROM_OPTION, + NMERGE_OPTION, + RANDOM_SOURCE_OPTION, + SORT_OPTION }; -static char const short_options[] = "-bcCdfgik:mMno:rRsS:t:T:uy:z"; +static char const short_options[] = "-bcCdfgik:mMno:rRsS:t:T:uVy:z"; static struct option const long_options[] = { @@ -404,17 +435,21 @@ static struct option const long_options[] = {"compress-program", required_argument, NULL, COMPRESS_PROGRAM_OPTION}, {"dictionary-order", no_argument, NULL, 'd'}, {"ignore-case", no_argument, NULL, 'f'}, + {"files0-from", required_argument, NULL, FILES0_FROM_OPTION}, {"general-numeric-sort", no_argument, NULL, 'g'}, {"ignore-nonprinting", no_argument, NULL, 'i'}, {"key", required_argument, NULL, 'k'}, {"merge", no_argument, NULL, 'm'}, {"month-sort", no_argument, NULL, 'M'}, {"numeric-sort", no_argument, NULL, 'n'}, + {"version-sort", no_argument, NULL, 'V'}, {"random-sort", no_argument, NULL, 'R'}, {"random-source", required_argument, NULL, RANDOM_SOURCE_OPTION}, + {"sort", required_argument, NULL, SORT_OPTION}, {"output", required_argument, NULL, 'o'}, {"reverse", no_argument, NULL, 'r'}, {"stable", no_argument, NULL, 's'}, + {"batch-size", required_argument, NULL, NMERGE_OPTION}, {"buffer-size", required_argument, NULL, 'S'}, {"field-separator", required_argument, NULL, 't'}, {"temporary-directory", required_argument, NULL, 'T'}, @@ -425,15 +460,43 @@ static struct option const long_options[] = {NULL, 0, NULL, 0}, }; +#define CHECK_TABLE \ + _ct_("quiet", 'C') \ + _ct_("silent", 'C') \ + _ct_("diagnose-first", 'c') + static char const *const check_args[] = { - "quiet", "silent", "diagnose-first", NULL +#define _ct_(_s, _c) _s, + CHECK_TABLE NULL +#undef _ct_ }; static char const check_types[] = { - 'C', 'C', 'c' +#define _ct_(_s, _c) _c, + CHECK_TABLE +#undef _ct_ +}; + +#define SORT_TABLE \ + _st_("general-numeric", 'g') \ + _st_("month", 'M') \ + _st_("numeric", 'n') \ + _st_("random", 'R') \ + _st_("version", 'V') + +static char const *const sort_args[] = +{ +#define _st_(_s, _c) _s, + SORT_TABLE NULL +#undef _st_ +}; +static char const sort_types[] = +{ +#define _st_(_s, _c) _c, + SORT_TABLE +#undef _st_ }; -ARGMATCH_VERIFY (check_args, check_types); /* The set of signals that are caught. */ static sigset_t caught_signals; @@ -669,10 +732,13 @@ exit_cleanup (void) } /* Create a new temporary file, returning its newly allocated tempnode. - Store into *PFD the file descriptor open for writing. */ + Store into *PFD the file descriptor open for writing. + If the creation fails, return NULL and store -1 into *PFD if the + failure is due to file descriptor exhaustion and + SURVIVE_FD_EXHAUSTION; otherwise, die. */ static struct tempnode * -create_temp_file (int *pfd) +create_temp_file (int *pfd, bool survive_fd_exhaustion) { static char const slashbase[] = "/sortXXXXXX"; static size_t temp_dir_index; @@ -705,7 +771,13 @@ create_temp_file (int *pfd) errno = saved_errno; if (fd < 0) - die (_("cannot create temporary file"), file); + { + if (! (survive_fd_exhaustion && errno == EMFILE)) + error (SORT_FAILURE, errno, _("cannot create temporary file in %s"), + quote (temp_dir)); + free (node); + node = NULL; + } *pfd = fd; return node; @@ -715,27 +787,30 @@ create_temp_file (int *pfd) standard output; HOW should be "w". When opening for input, "-" means standard input. To avoid confusion, do not return file descriptors STDIN_FILENO, STDOUT_FILENO, or STDERR_FILENO when - opening an ordinary FILE. */ + opening an ordinary FILE. Return NULL if unsuccessful. */ + +static FILE * +stream_open (const char *file, const char *how) +{ + if (!file) + return stdout; + if (STREQ (file, "-") && *how == 'r') + { + have_read_stdin = true; + return stdin; + } + return fopen (file, how); +} + +/* Same as stream_open, except always return a non-null value; die on + failure. */ static FILE * xfopen (const char *file, const char *how) -{ - FILE *fp; - - if (!file) - fp = stdout; - else if (STREQ (file, "-") && *how == 'r') - { - have_read_stdin = true; - fp = stdin; - } - else - { - fp = fopen (file, how); - if (! fp) - die (_("open failed"), file); - } - + { + FILE *fp = stream_open (file, how); + if (!fp) + die (_("open failed"), file); return fp; } @@ -774,7 +849,8 @@ dup2_or_die (int oldfd, int newfd) /* Fork a child process for piping to and do common cleanup. The TRIES parameter tells us how many times to try to fork before - giving up. Return the PID of the child or -1 if fork failed. */ + giving up. Return the PID of the child, or -1 (setting errno) + on failure. */ static pid_t pipe_fork (int pipefds[2], size_t tries) @@ -817,8 +893,10 @@ pipe_fork (int pipefds[2], size_t tries) if (pid < 0) { + saved_errno = errno; close (pipefds[0]); close (pipefds[1]); + errno = saved_errno; } else if (pid == 0) { @@ -836,15 +914,22 @@ pipe_fork (int pipefds[2], size_t tries) } /* Create a temporary file and start a compression program to filter output - to that file. Set *PFP to the file handle and if *PPID is non-NULL, - set it to the PID of the newly-created process. */ + to that file. Set *PFP to the file handle and if PPID is non-NULL, + set *PPID to the PID of the newly-created process. If the creation + fails, return NULL if the failure is due to file descriptor + exhaustion and SURVIVE_FD_EXHAUSTION; otherwise, die. */ static char * -create_temp (FILE **pfp, pid_t *ppid) +maybe_create_temp (FILE **pfp, pid_t *ppid, bool survive_fd_exhaustion) { int tempfd; - struct tempnode *node = create_temp_file (&tempfd); - char *name = node->name; + struct tempnode *node = create_temp_file (&tempfd, survive_fd_exhaustion); + char *name; + + if (! node) + return NULL; + + name = node->name; if (compress_program) { @@ -885,48 +970,68 @@ create_temp (FILE **pfp, pid_t *ppid) return name; } +/* Create a temporary file and start a compression program to filter output + to that file. Set *PFP to the file handle and if *PPID is non-NULL, + set it to the PID of the newly-created process. Die on failure. */ + +static char * +create_temp (FILE **pfp, pid_t *ppid) +{ + return maybe_create_temp (pfp, ppid, false); +} + /* Open a compressed temp file and start a decompression process through which to filter the input. PID must be the valid processes ID of the - process used to compress the file. */ + process used to compress the file. Return NULL (setting errno to + EMFILE) if we ran out of file descriptors, and die on any other + kind of failure. */ static FILE * open_temp (const char *name, pid_t pid) { int tempfd, pipefds[2]; - pid_t child_pid; - FILE *fp; + FILE *fp = NULL; wait_proc (pid); tempfd = open (name, O_RDONLY); if (tempfd < 0) - die (_("couldn't open temporary file"), name); + return NULL; - child_pid = pipe_fork (pipefds, MAX_FORK_TRIES_DECOMPRESS); - if (0 < child_pid) + switch (pipe_fork (pipefds, MAX_FORK_TRIES_DECOMPRESS)) { + case -1: + if (errno != EMFILE) + error (SORT_FAILURE, errno, _("couldn't create process for %s -d"), + compress_program); close (tempfd); - close (pipefds[1]); - } - else if (child_pid == 0) - { + errno = EMFILE; + break; + + case 0: close (pipefds[0]); dup2_or_die (tempfd, STDIN_FILENO); close (tempfd); dup2_or_die (pipefds[1], STDOUT_FILENO); close (pipefds[1]); - if (execlp (compress_program, compress_program, "-d", (char *) NULL) < 0) - error (SORT_FAILURE, errno, _("couldn't execute %s -d"), - compress_program); - } - else - error (SORT_FAILURE, errno, _("couldn't create process for %s -d"), - compress_program); + execlp (compress_program, compress_program, "-d", (char *) NULL); + error (SORT_FAILURE, errno, _("couldn't execute %s -d"), + compress_program); - fp = fdopen (pipefds[0], "r"); - if (! fp) - die (_("couldn't create temporary file"), name); + default: + close (tempfd); + close (pipefds[1]); + + fp = fdopen (pipefds[0], "r"); + if (! fp) + { + int saved_errno = errno; + close (pipefds[0]); + errno = saved_errno; + } + break; + } return fp; } @@ -1031,9 +1136,65 @@ inittables (void) #endif } +/* Specify how many inputs may be merged at once. + This may be set on the command-line with the + --batch-size option. */ +static void +specify_nmerge (int oi, char c, char const *s) +{ + uintmax_t n; + struct rlimit rlimit; + enum strtol_error e = xstrtoumax (s, NULL, 10, &n, NULL); + + /* Try to find out how many file descriptors we'll be able + to open. We need at least nmerge + 3 (STDIN_FILENO, + STDOUT_FILENO and STDERR_FILENO). */ + unsigned int max_nmerge = ((getrlimit (RLIMIT_NOFILE, &rlimit) == 0 + ? rlimit.rlim_cur + : OPEN_MAX) + - 3); + + if (e == LONGINT_OK) + { + nmerge = n; + if (nmerge != n) + e = LONGINT_OVERFLOW; + else + { + if (nmerge < 2) + { + error (0, 0, _("invalid --%s argument %s"), + long_options[oi].name, quote(s)); + error (SORT_FAILURE, 0, + _("minimum --%s argument is %s"), + long_options[oi].name, quote("2")); + } + else if (max_nmerge < nmerge) + { + e = LONGINT_OVERFLOW; + } + else + return; + } + } + + if (e == LONGINT_OVERFLOW) + { + char max_nmerge_buf[INT_BUFSIZE_BOUND (unsigned int)]; + error (0, 0, _("--%s argument %s too large"), + long_options[oi].name, quote(s)); + error (SORT_FAILURE, 0, + _("maximum --%s argument with current rlimit is %s"), + long_options[oi].name, + uinttostr (max_nmerge, max_nmerge_buf)); + } + else + xstrtol_fatal (e, oi, c, long_options, s); +} + /* Specify the amount of main memory to use when sorting. */ static void -specify_sort_size (char const *s) +specify_sort_size (int oi, char c, char const *s) { uintmax_t n; char *suffix; @@ -1089,7 +1250,7 @@ specify_sort_size (char const *s) e = LONGINT_OVERFLOW; } - STRTOL_FATAL_ERROR (s, _("sort size"), e); + xstrtol_fatal (e, oi, c, long_options, s); } /* Return the default sort size. */ @@ -1246,7 +1407,6 @@ begfield (const struct line *line, const struct keyfield *key) char *ptr = line->text, *lim = ptr + line->length - 1; size_t sword = key->sword; size_t schar = key->schar; - size_t remaining_bytes; /* The leading field separator itself is included in a field when -t is absent. */ @@ -1268,16 +1428,14 @@ begfield (const struct line *line, const struct keyfield *key) ++ptr; } + /* If we're ignoring leading blanks when computing the Start + of the field, skip past them here. */ if (key->skipsblanks) while (ptr < lim && blanks[to_uchar (*ptr)]) ++ptr; /* Advance PTR by SCHAR (if possible), but no further than LIM. */ - remaining_bytes = lim - ptr; - if (schar < remaining_bytes) - ptr += schar; - else - ptr = lim; + ptr = MIN (lim, ptr + schar); return ptr; } @@ -1290,7 +1448,9 @@ limfield (const struct line *line, const struct keyfield *key) { char *ptr = line->text, *lim = ptr + line->length - 1; size_t eword = key->eword, echar = key->echar; - size_t remaining_bytes; + + if (echar == 0) + eword++; /* Skip all of end field. */ /* Move PTR past EWORD fields or to one past the last byte on LINE, whichever comes first. If there are more than EWORD fields, leave @@ -1367,19 +1527,17 @@ limfield (const struct line *line, const struct keyfield *key) } #endif - /* If we're ignoring leading blanks when computing the End - of the field, don't start counting bytes until after skipping - past any leading blanks. */ - if (key->skipeblanks) - while (ptr < lim && blanks[to_uchar (*ptr)]) - ++ptr; + if (echar != 0) /* We need to skip over a portion of the end field. */ + { + /* If we're ignoring leading blanks when computing the End + of the field, skip past them here. */ + if (key->skipeblanks) + while (ptr < lim && blanks[to_uchar (*ptr)]) + ++ptr; - /* Advance PTR by ECHAR (if possible), but no further than LIM. */ - remaining_bytes = lim - ptr; - if (echar < remaining_bytes) - ptr += echar; - else - ptr = lim; + /* Advance PTR by ECHAR (if possible), but no further than LIM. */ + ptr = MIN (lim, ptr + echar); + } return ptr; } @@ -1489,9 +1647,14 @@ fillbuf (struct buffer *buf, FILE *fp, char const *file) return true; } - /* The current input line is too long to fit in the buffer. - Double the buffer size and try again. */ - buf->buf = X2REALLOC (buf->buf, &buf->alloc); + { + /* The current input line is too long to fit in the buffer. + Double the buffer size and try again, keeping it properly + aligned. */ + size_t line_alloc = buf->alloc / sizeof (struct line); + buf->buf = x2nrealloc (buf->buf, &line_alloc, sizeof (struct line)); + buf->alloc = line_alloc * sizeof (struct line); + } } } @@ -1698,6 +1861,32 @@ compare_random (char *restrict texta, size_t lena, return diff; } +/* Compare the keys TEXTA (of length LENA) and TEXTB (of length LENB) + using filevercmp. See lib/filevercmp.h for function description. */ + +static int +compare_version (char *restrict texta, size_t lena, + char *restrict textb, size_t lenb) +{ + int diff; + + /* It is necessary to save the character after the end of the field. + "filevercmp" works with NUL terminated strings. Our blocks of + text are not necessarily terminated with a NUL byte. */ + char sv_a = texta[lena]; + char sv_b = textb[lenb]; + + texta[lena] = '\0'; + textb[lenb] = '\0'; + + diff = filevercmp (texta, textb); + + texta[lena] = sv_a; + textb[lenb] = sv_b; + + return diff; +} + /* Compare two lines A and B trying every key in sequence until there are no more keys or a difference is found. */ @@ -1737,6 +1926,8 @@ keycompare (const struct line *a, const struct line *b) (texta, textb)); *lima = savea, *limb = saveb; } + else if (key->version) + diff = compare_version (texta, lena, textb, lenb); else if (key->month) diff = getmonth (texta, lena) - getmonth (textb, lenb); /* Sorting like this may become slow, so in a simple locale the user @@ -1998,27 +2189,54 @@ check (char const *file_name, char checkonly) return ordered; } +/* Open FILES (there are NFILES of them) and store the resulting array + of stream pointers into (*PFPS). Allocate the array. Return the + number of successfully opened files, setting errno if this value is + less than NFILES. */ + +static size_t +open_input_files (struct sortfile *files, size_t nfiles, FILE ***pfps) +{ + FILE **fps = *pfps = xnmalloc (nfiles, sizeof *fps); + int i; + + /* Open as many input files as we can. */ + for (i = 0; i < nfiles; i++) + { + fps[i] = (files[i].pid + ? open_temp (files[i].name, files[i].pid) + : stream_open (files[i].name, "r")); + if (!fps[i]) + break; + } + + return i; +} + /* Merge lines from FILES onto OFP. NTEMPS is the number of temporary files (all of which are at the start of the FILES array), and NFILES is the number of files; 0 <= NTEMPS <= NFILES <= NMERGE. - Close input and output files before returning. + FPS is the vector of open stream corresponding to the files. + Close input and output streams before returning. OUTPUT_FILE gives the name of the output file. If it is NULL, - the output file is standard output. If OFP is NULL, the output - file has not been opened yet (or written to, if standard output). */ + the output file is standard output. */ static void mergefps (struct sortfile *files, size_t ntemps, size_t nfiles, - FILE *ofp, char const *output_file) + FILE *ofp, char const *output_file, FILE **fps) { - FILE *fps[NMERGE]; /* Input streams for each file. */ - struct buffer buffer[NMERGE]; /* Input buffers for each file. */ + struct buffer *buffer = xnmalloc (nfiles, sizeof *buffer); + /* Input buffers for each file. */ struct line saved; /* Saved line storage for unique check. */ struct line const *savedline = NULL; /* &saved if there is a saved line. */ size_t savealloc = 0; /* Size allocated for the saved line. */ - struct line const *cur[NMERGE]; /* Current line in each line table. */ - struct line const *base[NMERGE]; /* Base of each line table. */ - size_t ord[NMERGE]; /* Table representing a permutation of fps, + struct line const **cur = xnmalloc (nfiles, sizeof *cur); + /* Current line in each line table. */ + struct line const **base = xnmalloc (nfiles, sizeof *base); + /* Base of each line table. */ + size_t *ord = xnmalloc (nfiles, sizeof *ord); + /* Table representing a permutation of fps, such that cur[ord[0]] is the smallest line and will be next output. */ size_t i; @@ -2030,9 +2248,6 @@ mergefps (struct sortfile *files, size_t ntemps, size_t nfiles, /* Read initial lines from each input file. */ for (i = 0; i < nfiles; ) { - fps[i] = (files[i].pid - ? open_temp (files[i].name, files[i].pid) - : xfopen (files[i].name, "r")); initbuf (&buffer[i], sizeof (struct line), MAX (merge_buffer_size, sort_size / nfiles)); if (fillbuf (&buffer[i], fps[i], files[i].name)) @@ -2054,13 +2269,13 @@ mergefps (struct sortfile *files, size_t ntemps, size_t nfiles, free (buffer[i].buf); --nfiles; for (j = i; j < nfiles; ++j) - files[j] = files[j + 1]; + { + files[j] = files[j + 1]; + fps[j] = fps[j + 1]; + } } } - if (! ofp) - ofp = xfopen (output_file, "w"); - /* Set up the ord table according to comparisons among input lines. Since this only reorders two items if one is strictly greater than the other, it is stable. */ @@ -2191,6 +2406,33 @@ mergefps (struct sortfile *files, size_t ntemps, size_t nfiles, } xfclose (ofp, output_file); + free(fps); + free(buffer); + free(ord); + free(base); + free(cur); +} + +/* Merge lines from FILES onto OFP. NTEMPS is the number of temporary + files (all of which are at the start of the FILES array), and + NFILES is the number of files; 0 <= NTEMPS <= NFILES <= NMERGE. + Close input and output files before returning. + OUTPUT_FILE gives the name of the output file. + + Return the number of files successfully merged. This number can be + less than NFILES if we ran low on file descriptors, but in this + case it is never less than 2. */ + +static size_t +mergefiles (struct sortfile *files, size_t ntemps, size_t nfiles, + FILE *ofp, char const *output_file) +{ + FILE **fps; + size_t nopened = open_input_files (files, nfiles, &fps); + if (nopened < nfiles && nopened < 2) + die (_("open failed"), files[nopened].name); + mergefps (files, ntemps, nopened, ofp, output_file, fps); + return nopened; } /* Merge into T the two sorted arrays of lines LO (with NLO members) @@ -2359,10 +2601,21 @@ avoid_trashing_input (struct sortfile *files, size_t ntemps, FILE *tftp; pid_t pid; char *temp = create_temp (&tftp, &pid); - mergefps (&files[i],0, nfiles - i, tftp, temp); - files[i].name = temp; - files[i].pid = pid; - return i + 1; + size_t num_merged = 0; + do + { + num_merged += mergefiles (&files[i], 0, nfiles - i, tftp, temp); + files[i].name = temp; + files[i].pid = pid; + + if (i + num_merged < nfiles) + memmove(&files[i + 1], &files[i + num_merged], + num_merged * sizeof *files); + ntemps += 1; + nfiles -= num_merged - 1;; + i += num_merged; + } + while (i < nfiles); } } @@ -2378,7 +2631,7 @@ static void merge (struct sortfile *files, size_t ntemps, size_t nfiles, char const *output_file) { - while (NMERGE < nfiles) + while (nmerge < nfiles) { /* Number of input files processed so far. */ size_t in; @@ -2393,21 +2646,24 @@ merge (struct sortfile *files, size_t ntemps, size_t nfiles, /* Number of easily-available slots at the next loop iteration. */ size_t cheap_slots; - /* Do as many NMERGE-size merges as possible. */ - for (out = in = 0; out < nfiles / NMERGE; out++, in += NMERGE) + /* Do as many NMERGE-size merges as possible. In the case that + nmerge is bogus, increment by the maximum number of file + descriptors allowed. */ + for (out = in = 0; nmerge <= nfiles - in; out++) { FILE *tfp; pid_t pid; char *temp = create_temp (&tfp, &pid); - size_t nt = MIN (ntemps, NMERGE); - ntemps -= nt; - mergefps (&files[in], nt, NMERGE, tfp, temp); + size_t num_merged = mergefiles (&files[in], MIN (ntemps, nmerge), + nmerge, tfp, temp); + ntemps -= MIN (ntemps, num_merged); files[out].name = temp; files[out].pid = pid; + in += num_merged; } remainder = nfiles - in; - cheap_slots = NMERGE - out % NMERGE; + cheap_slots = nmerge - out % nmerge; if (cheap_slots < remainder) { @@ -2418,12 +2674,12 @@ merge (struct sortfile *files, size_t ntemps, size_t nfiles, FILE *tfp; pid_t pid; char *temp = create_temp (&tfp, &pid); - size_t nt = MIN (ntemps, nshortmerge); - ntemps -= nt; - mergefps (&files[in], nt, nshortmerge, tfp, temp); + size_t num_merged = mergefiles (&files[in], MIN (ntemps, nshortmerge), + nshortmerge, tfp, temp); + ntemps -= MIN (ntemps, num_merged); files[out].name = temp; files[out++].pid = pid; - in += nshortmerge; + in += num_merged; } /* Put the remaining input files into the last NMERGE-sized output @@ -2434,7 +2690,59 @@ merge (struct sortfile *files, size_t ntemps, size_t nfiles, } nfiles = avoid_trashing_input (files, ntemps, nfiles, output_file); - mergefps (files, ntemps, nfiles, NULL, output_file); + + /* We aren't guaranteed that this final mergefiles will work, therefore we + try to merge into the output, and then merge as much as we can into a + temp file if we can't. Repeat. */ + + for (;;) + { + /* Merge directly into the output file if possible. */ + FILE **fps; + size_t nopened = open_input_files (files, nfiles, &fps); + + if (nopened == nfiles) + { + FILE *ofp = stream_open (output_file, "w"); + if (ofp) + { + mergefps (files, ntemps, nfiles, ofp, output_file, fps); + break; + } + if (errno != EMFILE || nopened <= 2) + die (_("open failed"), output_file); + } + else if (nopened <= 2) + die (_("open failed"), files[nopened].name); + + /* We ran out of file descriptors. Close one of the input + files, to gain a file descriptor. Then create a temporary + file with our spare file descriptor. Retry if that failed + (e.g., some other process could open a file between the time + we closed and tried to create). */ + { + FILE *tfp; + pid_t pid; + char *temp; + do + { + nopened--; + xfclose (fps[nopened], files[nopened].name); + temp = maybe_create_temp (&tfp, &pid, ! (nopened <= 2)); + } + while (!temp); + + /* Merge into the newly allocated temporary. */ + mergefps (&files[0], MIN (ntemps, nopened), nopened, tfp, temp, fps); + ntemps -= MIN (ntemps, nopened); + files[0].name = temp; + files[0].pid = pid; + + memmove (&files[1], &files[nopened], (nfiles - nopened) * sizeof *files); + ntemps++; + nfiles -= nopened - 1; + } + } } /* Sort NFILES FILES onto OUTPUT_FILE. */ @@ -2583,10 +2891,11 @@ check_ordering_compatibility (void) for (key = keylist; key; key = key->next) if ((1 < (key->random + key->numeric + key->general_numeric + key->month - + !!key->ignore)) + + key->version + !!key->ignore)) || (key->random && key->translate)) { - char opts[7]; + /* The following is too big, but guaranteed to be "big enough". */ + char opts[sizeof short_options]; char *p = opts; if (key->ignore == nondictionary) *p++ = 'd'; @@ -2600,6 +2909,8 @@ check_ordering_compatibility (void) *p++ = 'M'; if (key->numeric) *p++ = 'n'; + if (key->version) + *p++ = 'V'; if (key->random) *p++ = 'R'; *p = '\0'; @@ -2701,6 +3012,9 @@ set_ordering (const char *s, struct keyfield *key, enum blanktype blanktype) case 'r': key->reverse = true; break; + case 'V': + key->version = true; + break; default: return (char *) s; } @@ -2733,10 +3047,12 @@ main (int argc, char **argv) bool posixly_correct = (getenv ("POSIXLY_CORRECT") != NULL); bool obsolete_usage = (posix2_version () < 200112); char **files; + char *files_from = NULL; + struct Tokens tok; char const *outfile = NULL; initialize_main (&argc, &argv); - program_name = argv[0]; + set_program_name (argv[0]); setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); @@ -2826,7 +3142,7 @@ main (int argc, char **argv) gkey.sword = gkey.eword = SIZE_MAX; gkey.ignore = NULL; gkey.translate = NULL; - gkey.numeric = gkey.general_numeric = gkey.random = false; + gkey.numeric = gkey.general_numeric = gkey.random = gkey.version = false; gkey.month = gkey.reverse = false; gkey.skipsblanks = gkey.skipeblanks = false; @@ -2838,6 +3154,7 @@ main (int argc, char **argv) pedantic and a file was seen, unless the POSIX version predates 1003.1-2001 and -c was not seen and the operand is "-o FILE" or "-oFILE". */ + int oi = -1; if (c == -1 || (posixly_correct && nfiles != 0 @@ -2847,7 +3164,7 @@ main (int argc, char **argv) && argv[optind][0] == '-' && argv[optind][1] == 'o' && (argv[optind][2] || optind + 1 != argc))) || ((c = getopt_long (argc, argv, short_options, - long_options, NULL)) + long_options, &oi)) == -1)) { if (argc <= optind) @@ -2874,10 +3191,7 @@ main (int argc, char **argv) if (! (key->sword | key->schar)) key->sword = SIZE_MAX; if (! s || *set_ordering (s, key, bl_start)) - { - free (key); - key = NULL; - } + key = NULL; else { if (minus_pos_usage) @@ -2900,6 +3214,9 @@ main (int argc, char **argv) files[nfiles++] = optarg; break; + case SORT_OPTION: + c = XARGMATCH ("--sort", optarg, sort_args, sort_types); + /* Fall through. */ case 'b': case 'd': case 'f': @@ -2909,6 +3226,7 @@ main (int argc, char **argv) case 'n': case 'r': case 'R': + case 'V': { char str[2]; str[0] = c; @@ -2930,11 +3248,15 @@ main (int argc, char **argv) break; case COMPRESS_PROGRAM_OPTION: - if (compress_program && strcmp (compress_program, optarg) != 0) + if (compress_program && !STREQ (compress_program, optarg)) error (SORT_FAILURE, 0, _("multiple compress programs specified")); compress_program = optarg; break; + case FILES0_FROM_OPTION: + files_from = optarg; + break; + case 'k': key = key_init (&key_buf); @@ -2975,12 +3297,9 @@ main (int argc, char **argv) badfieldspec (optarg, N_("field number is zero")); } if (*s == '.') - s = parse_field_count (s + 1, &key->echar, - N_("invalid number after `.'")); - else { - /* `-k 2,3' is equivalent to `+1 -3'. */ - key->eword++; + s = parse_field_count (s + 1, &key->echar, + N_("invalid number after `.'")); } s = set_ordering (s, key, bl_end); } @@ -2993,6 +3312,10 @@ main (int argc, char **argv) mergeonly = true; break; + case NMERGE_OPTION: + specify_nmerge (oi, c, optarg); + break; + case 'o': if (outfile && !STREQ (outfile, optarg)) error (SORT_FAILURE, 0, _("multiple output files specified")); @@ -3010,7 +3333,7 @@ main (int argc, char **argv) break; case 'S': - specify_sort_size (optarg); + specify_sort_size (oi, c, optarg); break; case 't': @@ -3079,14 +3402,78 @@ main (int argc, char **argv) } } + if (files_from) + { + FILE *stream; + + /* When using --files0-from=F, you may not specify any files + on the command-line. */ + if (nfiles) + { + error (0, 0, _("extra operand %s"), quote (files[0])); + fprintf (stderr, "%s\n", + _("file operands cannot be combined with --files0-from")); + usage (SORT_FAILURE); + } + + if (STREQ (files_from, "-")) + stream = stdin; + else + { + stream = fopen (files_from, "r"); + if (stream == NULL) + error (SORT_FAILURE, errno, _("cannot open %s for reading"), + quote (files_from)); + } + + readtokens0_init (&tok); + + if (! readtokens0 (stream, &tok) || fclose (stream) != 0) + error (SORT_FAILURE, 0, _("cannot read file names from %s"), + quote (files_from)); + + if (tok.n_tok) + { + size_t i; + free (files); + files = tok.tok; + nfiles = tok.n_tok; + for (i = 0; i < nfiles; i++) + { + if (STREQ (files[i], "-")) + error (SORT_FAILURE, 0, _("when reading file names from stdin, " + "no file name of %s allowed"), + quote (files[i])); + else if (files[i][0] == '\0') + { + /* Using the standard `filename:line-number:' prefix here is + not totally appropriate, since NUL is the separator, not NL, + but it might be better than nothing. */ + unsigned long int file_number = i + 1; + error (SORT_FAILURE, 0, + _("%s:%lu: invalid zero-length file name"), + quotearg_colon (files_from), file_number); + } + } + } + else + error (SORT_FAILURE, 0, _("no input from %s"), + quote (files_from)); + } + /* Inheritance of global options to individual keys. */ for (key = keylist; key; key = key->next) { - if (! (key->ignore || key->translate - || (key->skipsblanks | key->reverse - | key->skipeblanks | key->month | key->numeric - | key->general_numeric - | key->random))) + if (! (key->ignore + || key->translate + || (key->skipsblanks + | key->reverse + | key->skipeblanks + | key->month + | key->numeric + | key->version + | key->general_numeric + | key->random))) { key->ignore = gkey.ignore; key->translate = gkey.translate; @@ -3097,15 +3484,21 @@ main (int argc, char **argv) key->general_numeric = gkey.general_numeric; key->random = gkey.random; key->reverse = gkey.reverse; + key->version = gkey.version; } need_random |= key->random; } - if (!keylist && (gkey.ignore || gkey.translate - || (gkey.skipsblanks | gkey.skipeblanks | gkey.month - | gkey.numeric | gkey.general_numeric - | gkey.random))) + if (!keylist && (gkey.ignore + || gkey.translate + || (gkey.skipsblanks + | gkey.skipeblanks + | gkey.month + | gkey.numeric + | gkey.general_numeric + | gkey.random + | gkey.version))) { insertkey (&gkey); need_random |= gkey.random; @@ -3130,12 +3523,17 @@ main (int argc, char **argv) if (nfiles == 0) { - static char *minus = "-"; + static char *minus = (char *) "-"; nfiles = 1; free (files); files = − } + /* Need to re-check that we meet the minimum requirement for memory + usage with the final value for NMERGE. */ + if (0 < sort_size) + sort_size = MAX (sort_size, MIN_SORT_SIZE); + if (checkonly) { if (nfiles > 1) @@ -3163,6 +3561,7 @@ main (int argc, char **argv) sortfiles[i].name = files[i]; merge (sortfiles, 0, nfiles, outfile); + IF_LINT (free (sortfiles)); } else sort (files, nfiles, outfile); diff --git a/src/bin/coreutils/src/split.c b/src/bin/coreutils/src/split.c index 1f0f3d7270..f8e26835bf 100644 --- a/src/bin/coreutils/src/split.c +++ b/src/bin/coreutils/src/split.c @@ -1,10 +1,10 @@ /* split.c -- split a file into pieces. - Copyright (C) 1988, 1991, 1995-2006 Free Software Foundation, Inc. + Copyright (C) 1988, 1991, 1995-2008 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* By tege@sics.se, with rms. @@ -31,24 +30,22 @@ #include "error.h" #include "fd-reopen.h" #include "fcntl--.h" -#include "getpagesize.h" #include "full-read.h" #include "full-write.h" -#include "inttostr.h" #include "quote.h" #include "safe-read.h" +#include "xfreopen.h" #include "xstrtol.h" /* The official name of this program (e.g., no `g' prefix). */ #define PROGRAM_NAME "split" -#define AUTHORS "Torbjorn Granlund", "Richard M. Stallman" +#define AUTHORS \ + proper_name_utf8 ("Torbjorn Granlund", "Torbj\303\266rn Granlund"), \ + proper_name ("Richard M. Stallman") #define DEFAULT_SUFFIX_LENGTH 2 -/* The name this program was run with. */ -char *program_name; - /* Base name of output files. */ static char const *outbase; @@ -104,7 +101,7 @@ usage (int status) else { printf (_("\ -Usage: %s [OPTION] [INPUT [PREFIX]]\n\ +Usage: %s [OPTION]... [INPUT [PREFIX]]\n\ "), program_name); fputs (_("\ @@ -124,16 +121,18 @@ Mandatory arguments to long options are mandatory for short options too.\n\ -l, --lines=NUMBER put NUMBER lines per output file\n\ "), DEFAULT_SUFFIX_LENGTH); fputs (_("\ - --verbose print a diagnostic to standard error just\n\ - before each output file is opened\n\ + --verbose print a diagnostic just before each\n\ + output file is opened\n\ "), stdout); fputs (HELP_OPTION_DESCRIPTION, stdout); fputs (VERSION_OPTION_DESCRIPTION, stdout); fputs (_("\ \n\ -SIZE may have a multiplier suffix: b for 512, k for 1K, m for 1 Meg.\n\ +SIZE may have a multiplier suffix:\n\ +b 512, kB 1000, K 1024, MB 1000*1000, M 1024*1024,\n\ +GB 1000*1000*1000, G 1024*1024*1024, and so on for T, P, E, Z, Y.\n\ "), stdout); - printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT); + emit_bug_reporting_address (); } exit (status); } @@ -190,7 +189,7 @@ next_file_name (void) sufindex[i] = 0; outfile_mid[i] = suffix_alphabet[sufindex[i]]; } - error (EXIT_FAILURE, 0, _("Output file suffixes exhausted")); + error (EXIT_FAILURE, 0, _("output file suffixes exhausted")); } } @@ -208,7 +207,7 @@ cwrite (bool new_file_flag, const char *bp, size_t bytes) next_file_name (); if (verbose) - fprintf (stderr, _("creating file %s\n"), quote (outfile)); + fprintf (stdout, _("creating file %s\n"), quote (outfile)); output_desc = open (outfile, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP @@ -336,7 +335,11 @@ line_bytes_split (size_t n_bytes) n_buffered += n_read; if (n_buffered != n_bytes) - eof = true; + { + if (n_buffered == 0) + break; + eof = true; + } /* Find where to end this chunk. */ bp = buf + n_buffered; @@ -384,11 +387,12 @@ main (int argc, char **argv) char *buf; /* file i/o buffer */ size_t page_size = getpagesize (); uintmax_t n_units; + static char const multipliers[] = "bEGKkMmPTYZ0"; int c; int digits_optind = 0; initialize_main (&argc, &argv); - program_name = argv[0]; + set_program_name (argv[0]); setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); @@ -397,8 +401,8 @@ main (int argc, char **argv) /* Parse command line options. */ - infile = "-"; - outbase = "x"; + infile = bad_cast ( "-"); + outbase = bad_cast ("x"); while (1) { @@ -428,7 +432,7 @@ main (int argc, char **argv) if (split_type != type_undef) FAIL_ONLY_ONE_WAY (); split_type = type_bytes; - if (xstrtoumax (optarg, NULL, 10, &n_units, "bkm") != LONGINT_OK + if (xstrtoumax (optarg, NULL, 10, &n_units, multipliers) != LONGINT_OK || n_units == 0) { error (0, 0, _("%s: invalid number of bytes"), optarg); @@ -452,7 +456,7 @@ main (int argc, char **argv) if (split_type != type_undef) FAIL_ONLY_ONE_WAY (); split_type = type_byteslines; - if (xstrtoumax (optarg, NULL, 10, &n_units, "bkm") != LONGINT_OK + if (xstrtoumax (optarg, NULL, 10, &n_units, multipliers) != LONGINT_OK || n_units == 0 || SIZE_MAX < n_units) { error (0, 0, _("%s: invalid number of bytes"), optarg); @@ -541,7 +545,7 @@ main (int argc, char **argv) /* Binary I/O is safer when bytecounts are used. */ if (O_BINARY && ! isatty (STDIN_FILENO)) - freopen (NULL, "rb", stdin); + xfreopen (NULL, "rb", stdin); /* No output file is open now. */ output_desc = -1; @@ -550,7 +554,7 @@ main (int argc, char **argv) if (fstat (STDIN_FILENO, &stat_buf) != 0) error (EXIT_FAILURE, errno, "%s", infile); - in_blk_size = ST_BLKSIZE (stat_buf); + in_blk_size = io_blksize (stat_buf); buf = ptr_align (xmalloc (in_blk_size + 1 + page_size - 1), page_size); diff --git a/src/bin/coreutils/src/stat.c b/src/bin/coreutils/src/stat.c index ca84236775..63c5911c42 100644 --- a/src/bin/coreutils/src/stat.c +++ b/src/bin/coreutils/src/stat.c @@ -1,10 +1,10 @@ /* stat.c -- display file or file system status - Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation. + Copyright (C) 2001-2009 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + along with this program. If not, see . Written by Michael Meskes. */ @@ -54,6 +53,7 @@ #elif HAVE_OS_H /* BeOS */ # include #endif +#include #include "system.h" @@ -62,12 +62,11 @@ #include "file-type.h" #include "fs.h" #include "getopt.h" -#include "inttostr.h" #include "quote.h" #include "quotearg.h" #include "stat-time.h" #include "strftime.h" -#include "xreadlink.h" +#include "areadlink.h" #define alignof(type) offsetof (struct { char c; type x; }, x) @@ -150,17 +149,18 @@ statfs (char const *filename, struct fs_info *buf) #define PROGRAM_NAME "stat" -#define AUTHORS "Michael Meskes" +#define AUTHORS proper_name ("Michael Meskes") enum { PRINTF_OPTION = CHAR_MAX + 1 }; -static struct option const long_options[] = { +static struct option const long_options[] = +{ + {"context", no_argument, 0, 'Z'}, {"dereference", no_argument, NULL, 'L'}, {"file-system", no_argument, NULL, 'f'}, - {"filesystem", no_argument, NULL, 'f'}, /* obsolete and undocumented alias */ {"format", required_argument, NULL, 'c'}, {"printf", required_argument, NULL, PRINTF_OPTION}, {"terse", no_argument, NULL, 't'}, @@ -169,7 +169,8 @@ static struct option const long_options[] = { {NULL, 0, NULL, 0} }; -char *program_name; +/* Whether to follow symbolic links; True for --dereference (-L). */ +static bool follow_links; /* Whether to interpret backslash-escape sequences. True for --printf=FMT, not for --format=FMT (-c). */ @@ -183,7 +184,7 @@ static char const *trailing_delim = ""; Some systems have statfvs.f_basetype[FSTYPSZ] (AIX, HP-UX, and Solaris). Others have statvfs.f_fstypename[_VFS_NAMELEN] (NetBSD 3.0). Others have statfs.f_fstypename[MFSNAMELEN] (NetBSD 1.5.2). - Still others have neither and have to get by with f_type (Linux). + Still others have neither and have to get by with f_type (GNU/Linux). But f_type may only exist in statfs (Cygwin). */ static char const * human_fstype (STRUCT_STATVFS const *statfsbuf) @@ -195,33 +196,77 @@ human_fstype (STRUCT_STATVFS const *statfsbuf) { # if defined __linux__ + /* Compare with what's in libc: + f=/a/libc/sysdeps/unix/sysv/linux/linux_fsinfo.h + sed -n '/ADFS_SUPER_MAGIC/,/SYSFS_MAGIC/p' $f \ + | perl -n -e '/#define (.*?)_(?:SUPER_)MAGIC\s+0x(\S+)/' \ + -e 'and print "case S_MAGIC_$1: /\* 0x" . uc($2) . " *\/\n"' \ + | sort > sym_libc + perl -ne '/^\s+(case S_MAGIC_.*?): \/\* 0x(\S+) \*\//' \ + -e 'and do { $v=uc$2; print "$1: /\* 0x$v *\/\n"}' stat.c \ + | sort > sym_stat + diff -u sym_stat sym_libc + */ + + /* Also sync from the list in "man 2 statfs". */ + /* IMPORTANT NOTE: Each of the following `case S_MAGIC_...:' statements must be followed by a hexadecimal constant in a comment. The S_MAGIC_... name and constant are automatically combined to produce the #define directives in fs.h. */ + case S_MAGIC_ADFS: /* 0xADF5 */ + return "adfs"; case S_MAGIC_AFFS: /* 0xADFF */ return "affs"; + case S_MAGIC_AUTOFS: /* 0x187 */ + return "autofs"; + case S_MAGIC_BEFS: /* 0x42465331 */ + return "befs"; + case S_MAGIC_BFS: /* 0x1BADFACE */ + return "bfs"; + case S_MAGIC_BINFMT_MISC: /* 0x42494e4d */ + return "binfmt_misc"; + case S_MAGIC_CODA: /* 0x73757245 */ + return "coda"; + case S_MAGIC_COH: /* 0x012FF7B7 */ + return "coh"; + case S_MAGIC_CRAMFS: /* 0x28CD3D45 */ + return "cramfs"; + case S_MAGIC_DEVFS: /* 0x1373 */ + return "devfs"; case S_MAGIC_DEVPTS: /* 0x1CD1 */ return "devpts"; + case S_MAGIC_EFS: /* 0x414A53 */ + return "efs"; case S_MAGIC_EXT: /* 0x137D */ return "ext"; - case S_MAGIC_EXT2_OLD: /* 0xEF51 */ - return "ext2"; case S_MAGIC_EXT2: /* 0xEF53 */ return "ext2/ext3"; - case S_MAGIC_JFS: /* 0x3153464a */ - return "jfs"; - case S_MAGIC_XFS: /* 0x58465342 */ - return "xfs"; + case S_MAGIC_EXT2_OLD: /* 0xEF51 */ + return "ext2"; + case S_MAGIC_FAT: /* 0x4006 */ + return "fat"; + case S_MAGIC_FUSECTL: /* 0x65735543 */ + return "fusectl"; case S_MAGIC_HPFS: /* 0xF995E849 */ return "hpfs"; + case S_MAGIC_HUGETLBFS: /* 0x958458f6 */ + return "hugetlbfs"; case S_MAGIC_ISOFS: /* 0x9660 */ return "isofs"; - case S_MAGIC_ISOFS_WIN: /* 0x4000 */ - return "isofs"; case S_MAGIC_ISOFS_R_WIN: /* 0x4004 */ return "isofs"; + case S_MAGIC_ISOFS_WIN: /* 0x4000 */ + return "isofs"; + case S_MAGIC_JFFS2: /* 0x72B6 */ + return "jffs2"; + case S_MAGIC_JFFS: /* 0x07C0 */ + return "jffs"; + case S_MAGIC_JFS: /* 0x3153464A */ + return "jfs"; + case S_MAGIC_LUSTRE: /* 0x0BD00BD0 */ + return "lustre"; case S_MAGIC_MINIX: /* 0x137F */ return "minix"; case S_MAGIC_MINIX_30: /* 0x138F */ @@ -230,46 +275,57 @@ human_fstype (STRUCT_STATVFS const *statfsbuf) return "minix v2"; case S_MAGIC_MINIX_V2_30: /* 0x2478 */ return "minix v2 (30 char.)"; - case S_MAGIC_MSDOS: /* 0x4d44 */ + case S_MAGIC_MSDOS: /* 0x4D44 */ return "msdos"; - case S_MAGIC_FAT: /* 0x4006 */ - return "fat"; - case S_MAGIC_NCP: /* 0x564c */ + case S_MAGIC_NCP: /* 0x564C */ return "novell"; case S_MAGIC_NFS: /* 0x6969 */ return "nfs"; - case S_MAGIC_PROC: /* 0x9fa0 */ - return "proc"; - case S_MAGIC_SMB: /* 0x517B */ - return "smb"; - case S_MAGIC_XENIX: /* 0x012FF7B4 */ - return "xenix"; - case S_MAGIC_SYSV4: /* 0x012FF7B5 */ - return "sysv4"; - case S_MAGIC_SYSV2: /* 0x012FF7B6 */ - return "sysv2"; - case S_MAGIC_COH: /* 0x012FF7B7 */ - return "coh"; - case S_MAGIC_UFS: /* 0x00011954 */ - return "ufs"; - case S_MAGIC_XIAFS: /* 0x012FD16D */ - return "xia"; - case S_MAGIC_NTFS: /* 0x5346544e */ + case S_MAGIC_NFSD: /* 0x6E667364 */ + return "nfsd"; + case S_MAGIC_NTFS: /* 0x5346544E */ return "ntfs"; - case S_MAGIC_TMPFS: /* 0x1021994 */ - return "tmpfs"; + case S_MAGIC_OPENPROM: /* 0x9fa1 */ + return "openprom"; + case S_MAGIC_PROC: /* 0x9FA0 */ + return "proc"; + case S_MAGIC_QNX4: /* 0x002F */ + return "qnx4"; + case S_MAGIC_RAMFS: /* 0x858458F6 */ + return "ramfs"; case S_MAGIC_REISERFS: /* 0x52654973 */ return "reiserfs"; - case S_MAGIC_CRAMFS: /* 0x28cd3d45 */ - return "cramfs"; case S_MAGIC_ROMFS: /* 0x7275 */ return "romfs"; - case S_MAGIC_RAMFS: /* 0x858458f6 */ - return "ramfs"; + case S_MAGIC_SMB: /* 0x517B */ + return "smb"; case S_MAGIC_SQUASHFS: /* 0x73717368 */ return "squashfs"; case S_MAGIC_SYSFS: /* 0x62656572 */ return "sysfs"; + case S_MAGIC_SYSV2: /* 0x012FF7B6 */ + return "sysv2"; + case S_MAGIC_SYSV4: /* 0x012FF7B5 */ + return "sysv4"; + case S_MAGIC_TMPFS: /* 0x1021994 */ + return "tmpfs"; + case S_MAGIC_UDF: /* 0x15013346 */ + return "udf"; + case S_MAGIC_UFS: /* 0x00011954 */ + return "ufs"; + case S_MAGIC_UFS_BYTESWAPPED: /* 0x54190100 */ + return "ufs"; + case S_MAGIC_USBDEVFS: /* 0x9FA2 */ + return "usbdevfs"; + case S_MAGIC_VXFS: /* 0xA501FCF5 */ + return "vxfs"; + case S_MAGIC_XENIX: /* 0x012FF7B4 */ + return "xenix"; + case S_MAGIC_XFS: /* 0x58465342 */ + return "xfs"; + case S_MAGIC_XIAFS: /* 0x012FD16D */ + return "xia"; + # elif __GNU__ case FSTYPE_UFS: return "ufs"; @@ -356,9 +412,7 @@ human_time (struct timespec t) + sizeof "-MM-DD HH:MM:SS.NNNNNNNNN +ZZZZ"))]; struct tm const *tm = localtime (&t.tv_sec); if (tm == NULL) - return (TYPE_SIGNED (time_t) - ? imaxtostr (t.tv_sec, str) - : umaxtostr (t.tv_sec, str)); + return timetostr (t.tv_sec, str); nstrftime (str, sizeof str, "%Y-%m-%d %H:%M:%S.%N %z", tm, 0, t.tv_nsec); return str; } @@ -394,6 +448,26 @@ out_uint_x (char *pformat, size_t prefix_len, uintmax_t arg) printf (pformat, arg); } +/* Very specialized function (modifies FORMAT), just so as to avoid + duplicating this code between both print_statfs and print_stat. */ +static void +out_file_context (char const *filename, char *pformat, size_t prefix_len) +{ + char *scontext; + if ((follow_links + ? getfilecon (filename, &scontext) + : lgetfilecon (filename, &scontext)) < 0) + { + error (0, errno, _("failed to get security context of %s"), + quote (filename)); + scontext = NULL; + } + strcpy (pformat + prefix_len, "s"); + printf (pformat, (scontext ? scontext : "?")); + if (scontext) + freecon (scontext); +} + /* print statfs info */ static void print_statfs (char *pformat, size_t prefix_len, char m, char const *filename, @@ -467,12 +541,14 @@ print_statfs (char *pformat, size_t prefix_len, char m, char const *filename, } break; case 'c': - out_int (pformat, prefix_len, statfsbuf->f_files); + out_uint (pformat, prefix_len, statfsbuf->f_files); break; case 'd': out_int (pformat, prefix_len, statfsbuf->f_ffree); break; - + case 'C': + out_file_context (filename, pformat, prefix_len); + break; default: fputc ('?', stdout); break; @@ -497,7 +573,7 @@ print_stat (char *pformat, size_t prefix_len, char m, out_string (pformat, prefix_len, quote (filename)); if (S_ISLNK (statbuf->st_mode)) { - char *linkname = xreadlink_with_size (filename, statbuf->st_size); + char *linkname = areadlink_with_size (filename, statbuf->st_size); if (linkname == NULL) { error (0, errno, _("cannot read symbolic link %s"), @@ -595,6 +671,9 @@ print_stat (char *pformat, size_t prefix_len, char m, else out_uint (pformat, prefix_len, statbuf->st_ctime); break; + case 'C': + out_file_context (filename, pformat, prefix_len); + break; default: fputc ('?', stdout); break; @@ -774,8 +853,7 @@ do_statfs (char const *filename, bool terse, char const *format) /* stat the file and print what we find */ static bool -do_stat (char const *filename, bool follow_links, bool terse, - char const *format) +do_stat (char const *filename, bool terse, char const *format) { struct stat statbuf; @@ -828,7 +906,7 @@ usage (int status) program_name); else { - printf (_("Usage: %s [OPTION] FILE...\n"), program_name); + printf (_("Usage: %s [OPTION]... FILE...\n"), program_name); fputs (_("\ Display file or file system status.\n\ \n\ @@ -853,6 +931,7 @@ The valid format sequences for files (without --file-system):\n\ %A Access rights in human readable form\n\ %b Number of blocks allocated (see %B)\n\ %B The size in bytes of each block reported by %b\n\ + %C SELinux security context string\n\ "), stdout); fputs (_("\ %d Device number in decimal\n\ @@ -892,6 +971,7 @@ Valid format sequences for file systems:\n\ %c Total file nodes in file system\n\ %d Free file nodes in file system\n\ %f Free blocks in file system\n\ + %C SELinux security context string\n\ "), stdout); fputs (_("\ %i File System ID in hex\n\ @@ -903,7 +983,7 @@ Valid format sequences for file systems:\n\ %T Type in human readable form\n\ "), stdout); printf (USAGE_BUILTIN_WARNING, PROGRAM_NAME); - printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT); + emit_bug_reporting_address (); } exit (status); } @@ -913,21 +993,20 @@ main (int argc, char *argv[]) { int c; int i; - bool follow_links = false; bool fs = false; bool terse = false; char *format = NULL; bool ok = true; initialize_main (&argc, &argv); - program_name = argv[0]; + set_program_name (argv[0]); setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); atexit (close_stdout); - while ((c = getopt_long (argc, argv, "c:fLt", long_options, NULL)) != -1) + while ((c = getopt_long (argc, argv, "c:fLtZ", long_options, NULL)) != -1) { switch (c) { @@ -955,6 +1034,15 @@ main (int argc, char *argv[]) terse = true; break; + case 'Z': /* FIXME: remove in 2010 */ + /* Ignore, for compatibility with distributions + that implemented this before upstream. + But warn of impending removal. */ + error (0, 0, + _("the --context (-Z) option is obsolete and will be removed\n" + "in a future release")); + break; + case_GETOPT_HELP_CHAR; case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS); @@ -973,7 +1061,7 @@ main (int argc, char *argv[]) for (i = optind; i < argc; i++) ok &= (fs ? do_statfs (argv[i], terse, format) - : do_stat (argv[i], follow_links, terse, format)); + : do_stat (argv[i], terse, format)); exit (ok ? EXIT_SUCCESS : EXIT_FAILURE); } diff --git a/src/bin/coreutils/src/stty.c b/src/bin/coreutils/src/stty.c index 33a821d25b..389ab9eb90 100644 --- a/src/bin/coreutils/src/stty.c +++ b/src/bin/coreutils/src/stty.c @@ -1,10 +1,10 @@ /* stty -- change and print terminal line settings - Copyright (C) 1990-2005 Free Software Foundation, Inc. + Copyright (C) 1990-2005, 2007-2009 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Usage: stty [-ag] [--all] [--save] [-F device] [--file=device] [setting...] @@ -62,13 +61,12 @@ #include "error.h" #include "fd-reopen.h" #include "quote.h" -#include "vasprintf.h" #include "xstrtol.h" /* The official name of this program (e.g., no `g' prefix). */ #define PROGRAM_NAME "stty" -#define AUTHORS "David MacKenzie" +#define AUTHORS proper_name ("David MacKenzie") #ifndef _POSIX_VDISABLE # define _POSIX_VDISABLE 0 @@ -206,7 +204,7 @@ struct mode_info unsigned long mask; /* Other bits to turn off for this mode. */ }; -static struct mode_info mode_info[] = +static struct mode_info const mode_info[] = { {"parenb", control, REV, PARENB, 0}, {"parodd", control, REV, PARODD, 0}, @@ -370,7 +368,7 @@ struct control_info /* Control characters. */ -static struct control_info control_info[] = +static struct control_info const control_info[] = { {"intr", CINTR, VINTR}, {"quit", CQUIT, VQUIT}, @@ -420,7 +418,7 @@ static char const *visible (cc_t ch); static unsigned long int baud_to_value (speed_t speed); static bool recover_mode (char const *arg, struct termios *mode); static int screen_columns (void); -static bool set_mode (struct mode_info *info, bool reversed, +static bool set_mode (struct mode_info const *info, bool reversed, struct termios *mode); static unsigned long int integer_arg (const char *s, unsigned long int max); static speed_t string_to_baud (const char *arg); @@ -434,7 +432,7 @@ static void display_settings (enum output_type output_type, static void display_speed (struct termios *mode, bool fancy); static void display_window_size (bool fancy, char const *device_name); static void sane_mode (struct termios *mode); -static void set_control_char (struct control_info *info, +static void set_control_char (struct control_info const *info, const char *arg, struct termios *mode); static void set_speed (enum speed_setting type, const char *arg, @@ -447,7 +445,7 @@ static int max_col; /* Current position, to know when to wrap. */ static int current_col; -static struct option longopts[] = +static struct option const longopts[] = { {"all", no_argument, NULL, 'a'}, {"save", no_argument, NULL, 'g'}, @@ -457,9 +455,6 @@ static struct option longopts[] = {NULL, 0, NULL, 0} }; -/* The name this program was run with. */ -char *program_name; - static void wrapf (const char *message, ...) __attribute__ ((__format__ (__printf__, 1, 2))); @@ -509,9 +504,9 @@ usage (int status) else { printf (_("\ -Usage: %s [-F DEVICE] [--file=DEVICE] [SETTING]...\n\ - or: %s [-F DEVICE] [--file=DEVICE] [-a|--all]\n\ - or: %s [-F DEVICE] [--file=DEVICE] [-g|--save]\n\ +Usage: %s [-F DEVICE | --file=DEVICE] [SETTING]...\n\ + or: %s [-F DEVICE | --file=DEVICE] [-a|--all]\n\ + or: %s [-F DEVICE | --file=DEVICE] [-g|--save]\n\ "), program_name, program_name, program_name); fputs (_("\ @@ -556,7 +551,7 @@ Special characters:\n\ fputs (_("\ \n\ Special settings:\n\ - N set the input and output speeds to N bauds\n\ + N set the input and output speeds to N bauds\n\ * cols N tell the kernel that the terminal has N columns\n\ * columns N same as cols N\n\ "), stdout); @@ -712,7 +707,7 @@ Combination settings:\n\ -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0\n\ isig icanon iexten echo echoe echok -echonl -noflsh\n\ -xcase -tostop -echoprt echoctl echoke, all special\n\ - characters to their default values.\n\ + characters to their default values\n\ "), stdout); fputs (_("\ \n\ @@ -721,7 +716,7 @@ prints baud rate, line discipline, and deviations from stty sane. In\n\ settings, CHAR is taken literally, or coded as in ^c, 0x37, 0177 or\n\ 127; special values ^- or undef used to disable special characters.\n\ "), stdout); - printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT); + emit_bug_reporting_address (); } exit (status); } @@ -731,7 +726,7 @@ main (int argc, char **argv) { /* Initialize to all zeroes so there is no risk memcmp will report a spurious difference in an uninitialized portion of the structure. */ - struct termios mode = { 0, }; + DECLARE_ZEROED_AGGREGATE (struct termios, mode); enum output_type output_type; int optc; @@ -747,7 +742,7 @@ main (int argc, char **argv) const char *device_name; initialize_main (&argc, &argv); - program_name = argv[0]; + set_program_name (argv[0]); setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); @@ -820,7 +815,7 @@ main (int argc, char **argv) "mutually exclusive")); /* Specifying any other arguments with -a or -g gets an error. */ - if (!noargs & (verbose_output | recoverable_output)) + if (!noargs && (verbose_output | recoverable_output)) error (EXIT_FAILURE, 0, _("when specifying an output style, modes may not be set")); @@ -1004,7 +999,7 @@ main (int argc, char **argv) { /* Initialize to all zeroes so there is no risk memcmp will report a spurious difference in an uninitialized portion of the structure. */ - struct termios new_mode = { 0, }; + DECLARE_ZEROED_AGGREGATE (struct termios, new_mode); if (tcsetattr (STDIN_FILENO, TCSADRAIN, &mode)) error (EXIT_FAILURE, errno, "%s", device_name); @@ -1048,7 +1043,7 @@ main (int argc, char **argv) #ifdef TESTING { size_t i; - printf (_("new_mode: mode\n")); + printf ("new_mode: mode\n"); for (i = 0; i < sizeof (new_mode); i++) printf ("0x%02x: 0x%02x\n", *(((unsigned char *) &new_mode) + i), @@ -1066,7 +1061,7 @@ main (int argc, char **argv) return true. */ static bool -set_mode (struct mode_info *info, bool reversed, struct termios *mode) +set_mode (struct mode_info const *info, bool reversed, struct termios *mode) { tcflag_t *bitsp; @@ -1272,7 +1267,7 @@ set_mode (struct mode_info *info, bool reversed, struct termios *mode) } static void -set_control_char (struct control_info *info, const char *arg, +set_control_char (struct control_info const *info, const char *arg, struct termios *mode) { unsigned long int value; @@ -1655,43 +1650,62 @@ display_recoverable (struct termios *mode) putchar ('\n'); } +/* NOTE: identical to below, modulo use of tcflag_t */ +static int +strtoul_tcflag_t (char const *s, int base, char **p, tcflag_t *result, + char delim) +{ + unsigned long ul; + errno = 0; + ul = strtoul (s, p, base); + if (errno || **p != delim || *p == s || (tcflag_t) ul != ul) + return -1; + *result = ul; + return 0; +} + +/* NOTE: identical to above, modulo use of cc_t */ +static int +strtoul_cc_t (char const *s, int base, char **p, cc_t *result, char delim) +{ + unsigned long ul; + errno = 0; + ul = strtoul (s, p, base); + if (errno || **p != delim || *p == s || (cc_t) ul != ul) + return -1; + *result = ul; + return 0; +} + +/* Parse the output of display_recoverable. + Return false if any part of it is invalid. */ static bool recover_mode (char const *arg, struct termios *mode) { + tcflag_t flag[4]; + char const *s = arg; size_t i; - int n; - unsigned long int chr; - unsigned long int iflag, oflag, cflag, lflag; + for (i = 0; i < 4; i++) + { + char *p; + if (strtoul_tcflag_t (s, 16, &p, flag + i, ':') != 0) + return false; + s = p + 1; + } + mode->c_iflag = flag[0]; + mode->c_oflag = flag[1]; + mode->c_cflag = flag[2]; + mode->c_lflag = flag[3]; - /* Scan into temporaries since it is too much trouble to figure out - the right format for `tcflag_t'. */ - if (sscanf (arg, "%lx:%lx:%lx:%lx%n", - &iflag, &oflag, &cflag, &lflag, &n) != 4) - return false; - mode->c_iflag = iflag; - mode->c_oflag = oflag; - mode->c_cflag = cflag; - mode->c_lflag = lflag; - if (mode->c_iflag != iflag - || mode->c_oflag != oflag - || mode->c_cflag != cflag - || mode->c_lflag != lflag) - return false; - arg += n; for (i = 0; i < NCCS; ++i) { - if (sscanf (arg, ":%lx%n", &chr, &n) != 1) + char *p; + char delim = i < NCCS - 1 ? ':' : '\0'; + if (strtoul_cc_t (s, 16, &p, mode->c_cc + i, delim) != 0) return false; - mode->c_cc[i] = chr; - if (mode->c_cc[i] != chr) - return false; - arg += n; + s = p + 1; } - /* Fail if there are too many fields. */ - if (*arg != '\0') - return false; - return true; } @@ -1702,7 +1716,7 @@ struct speed_map unsigned long int value; /* Numeric value. */ }; -static struct speed_map speeds[] = +static struct speed_map const speeds[] = { {"0", B0, 0}, {"50", B50, 50}, @@ -1846,8 +1860,8 @@ visible (cc_t ch) } else { - *bpout++ = 'M', - *bpout++ = '-'; + *bpout++ = 'M'; + *bpout++ = '-'; if (ch >= 128 + 32) { if (ch < 128 + 127) @@ -1882,8 +1896,7 @@ static unsigned long int integer_arg (const char *s, unsigned long int maxval) { unsigned long int value; - if (xstrtoul (s, NULL, 0, &value, "bB") != LONGINT_OK - || maxval < value) + if (xstrtoul (s, NULL, 0, &value, "bB") != LONGINT_OK || maxval < value) { error (0, 0, _("invalid integer argument %s"), quote (s)); usage (EXIT_FAILURE); diff --git a/src/bin/coreutils/src/su.c b/src/bin/coreutils/src/su.c index 70828b8fd8..c8367c53e9 100644 --- a/src/bin/coreutils/src/su.c +++ b/src/bin/coreutils/src/su.c @@ -1,10 +1,10 @@ /* su for GNU. Run a shell with substitute user and group IDs. - Copyright (C) 1992-2006 Free Software Foundation, Inc. + Copyright (C) 1992-2006, 2008 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Run a shell with the real and effective UID and GID and groups of USER, default `root'. @@ -93,7 +92,7 @@ /* The official name of this program (e.g., no `g' prefix). */ #define PROGRAM_NAME "su" -#define AUTHORS "David MacKenzie" +#define AUTHORS proper_name ("David MacKenzie") #if HAVE_PATHS_H # include @@ -119,19 +118,16 @@ /* The user to become if none is specified. */ #define DEFAULT_USER "root" -char *crypt (); -char *getusershell (); -void endusershell (); -void setusershell (); +char *crypt (char const *key, char const *salt); +char *getusershell (void); +void endusershell (void); +void setusershell (void); extern char **environ; static void run_shell (char const *, char const *, char **, size_t) ATTRIBUTE_NORETURN; -/* The name this program was run with. */ -char *program_name; - /* If true, pass the `-f' option to the subshell. */ static bool fast_startup; @@ -300,13 +296,13 @@ change_identity (const struct passwd *pw) #ifdef HAVE_INITGROUPS errno = 0; if (initgroups (pw->pw_name, pw->pw_gid) == -1) - error (EXIT_FAIL, errno, _("cannot set groups")); + error (EXIT_FAILURE, errno, _("cannot set groups")); endgrent (); #endif if (setgid (pw->pw_gid)) - error (EXIT_FAIL, errno, _("cannot set group id")); + error (EXIT_FAILURE, errno, _("cannot set group id")); if (setuid (pw->pw_uid)) - error (EXIT_FAIL, errno, _("cannot set user id")); + error (EXIT_FAILURE, errno, _("cannot set user id")); } /* Run SHELL, or DEFAULT_SHELL if SHELL is empty. @@ -399,7 +395,7 @@ Change the effective user id and group id to that of USER.\n\ \n\ A mere - implies -l. If USER not given, assume root.\n\ "), stdout); - printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT); + emit_bug_reporting_address (); } exit (status); } @@ -415,12 +411,12 @@ main (int argc, char **argv) struct passwd pw_copy; initialize_main (&argc, &argv); - program_name = argv[0]; + set_program_name (argv[0]); setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); - initialize_exit_failure (EXIT_FAIL); + initialize_exit_failure (EXIT_FAILURE); atexit (close_stdout); fast_startup = false; @@ -457,7 +453,7 @@ main (int argc, char **argv) case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS); default: - usage (EXIT_FAIL); + usage (EXIT_FAILURE); } } @@ -472,10 +468,10 @@ main (int argc, char **argv) pw = getpwnam (new_user); if (! (pw && pw->pw_name && pw->pw_name[0] && pw->pw_dir && pw->pw_dir[0] && pw->pw_passwd)) - error (EXIT_FAIL, 0, _("user %s does not exist"), new_user); + error (EXIT_FAILURE, 0, _("user %s does not exist"), new_user); /* Make a copy of the password information and point pw at the local - copy instead. Otherwise, some systems (e.g. Linux) would clobber + copy instead. Otherwise, some systems (e.g. GNU/Linux) would clobber the static data through the getlogin call from log_su. Also, make sure pw->pw_shell is a nonempty string. It may be NULL when NEW_USER is a username that is retrieved via NIS (YP), @@ -495,7 +491,7 @@ main (int argc, char **argv) #ifdef SYSLOG_FAILURE log_su (pw, false); #endif - error (EXIT_FAIL, 0, _("incorrect password")); + error (EXIT_FAILURE, 0, _("incorrect password")); } #ifdef SYSLOG_SUCCESS else diff --git a/src/bin/coreutils/src/sum.c b/src/bin/coreutils/src/sum.c index 92e4126881..4cb8f31aa2 100644 --- a/src/bin/coreutils/src/sum.c +++ b/src/bin/coreutils/src/sum.c @@ -1,10 +1,11 @@ /* sum -- checksum and count the blocks in a file - Copyright (C) 86, 89, 91, 1995-2002, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 86, 89, 91, 1995-2002, 2004, 2005, 2008 + Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Like BSD sum or SysV sum -r, except like SysV sum if -s option is given. */ @@ -28,14 +28,14 @@ #include "error.h" #include "human.h" #include "safe-read.h" +#include "xfreopen.h" /* The official name of this program (e.g., no `g' prefix). */ #define PROGRAM_NAME "sum" -#define AUTHORS "Kayvan Aghaiepour", "David MacKenzie" - -/* The name this program was run with. */ -char *program_name; +#define AUTHORS \ + proper_name ("Kayvan Aghaiepour"), \ + proper_name ("David MacKenzie") /* True if any of the files read were the standard input. */ static bool have_read_stdin; @@ -63,7 +63,7 @@ Usage: %s [OPTION]... [FILE]...\n\ fputs (_("\ Print checksum and block counts for each FILE.\n\ \n\ - -r defeat -s, use BSD sum algorithm, use 1K blocks\n\ + -r use BSD sum algorithm, use 1K blocks\n\ -s, --sysv use System V sum algorithm, use 512 bytes blocks\n\ "), stdout); fputs (HELP_OPTION_DESCRIPTION, stdout); @@ -72,7 +72,7 @@ Print checksum and block counts for each FILE.\n\ \n\ With no FILE, or when FILE is -, read standard input.\n\ "), stdout); - printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT); + emit_bug_reporting_address (); } exit (status); } @@ -98,7 +98,7 @@ bsd_sum_file (const char *file, int print_name) fp = stdin; have_read_stdin = true; if (O_BINARY && ! isatty (STDIN_FILENO)) - freopen (NULL, "rb", stdin); + xfreopen (NULL, "rb", stdin); } else { @@ -166,7 +166,7 @@ sysv_sum_file (const char *file, int print_name) fd = STDIN_FILENO; have_read_stdin = true; if (O_BINARY && ! isatty (STDIN_FILENO)) - freopen (NULL, "rb", stdin); + xfreopen (NULL, "rb", stdin); } else { @@ -226,7 +226,7 @@ main (int argc, char **argv) bool (*sum_func) (const char *, int) = bsd_sum_file; initialize_main (&argc, &argv); - program_name = argv[0]; + set_program_name (argv[0]); setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); diff --git a/src/bin/coreutils/src/sync.c b/src/bin/coreutils/src/sync.c index 5e94afbdd8..fccc6fb922 100644 --- a/src/bin/coreutils/src/sync.c +++ b/src/bin/coreutils/src/sync.c @@ -1,10 +1,10 @@ /* sync - update the super block - Copyright (C) 1994-2004 Free Software Foundation, Inc. + Copyright (C) 1994-2004, 2008 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Jim Meyering */ @@ -29,10 +28,7 @@ /* The official name of this program (e.g., no `g' prefix). */ #define PROGRAM_NAME "sync" -#define AUTHORS "Jim Meyering" - -/* The name this program was run with. */ -char *program_name; +#define AUTHORS proper_name ("Jim Meyering") void usage (int status) @@ -49,7 +45,7 @@ Force changed blocks to disk, update the super block.\n\ "), stdout); fputs (HELP_OPTION_DESCRIPTION, stdout); fputs (VERSION_OPTION_DESCRIPTION, stdout); - printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT); + emit_bug_reporting_address (); } exit (status); } @@ -58,14 +54,14 @@ int main (int argc, char **argv) { initialize_main (&argc, &argv); - program_name = argv[0]; + set_program_name (argv[0]); setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); atexit (close_stdout); - parse_long_options (argc, argv, PROGRAM_NAME, PACKAGE, VERSION, + parse_long_options (argc, argv, PROGRAM_NAME, PACKAGE, Version, usage, AUTHORS, (char const *) NULL); if (getopt_long (argc, argv, "", NULL, NULL) != -1) usage (EXIT_FAILURE); diff --git a/src/bin/coreutils/src/system.h b/src/bin/coreutils/src/system.h index 763909bac0..5bc23b32fb 100644 --- a/src/bin/coreutils/src/system.h +++ b/src/bin/coreutils/src/system.h @@ -1,10 +1,10 @@ /* system-dependent definitions for coreutils - Copyright (C) 1989, 1991-2007 Free Software Foundation, Inc. + Copyright (C) 1989, 1991-2009 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ #include @@ -37,19 +36,6 @@ you must include before including this file #include -#ifndef STDIN_FILENO -# define STDIN_FILENO 0 -#endif - -#ifndef STDOUT_FILENO -# define STDOUT_FILENO 1 -#endif - -#ifndef STDERR_FILENO -# define STDERR_FILENO 2 -#endif - - /* limits.h must come before pathmax.h because limits.h on some systems undefs PATH_MAX, whereas pathmax.h sets PATH_MAX. */ #include @@ -110,15 +96,17 @@ you must include before including this file #ifndef ENOSYS # define ENOSYS (-1) #endif +#ifndef ENODATA +# define ENODATA (-1) +#endif #include #include +#include "version.h" -/* Exit statuses for programs like 'env' that exec other programs. - EXIT_FAILURE might not be 1, so use EXIT_FAIL in such programs. */ +/* Exit statuses for programs like 'env' that exec other programs. */ enum { - EXIT_FAIL = 1, EXIT_CANNOT_INVOKE = 126, EXIT_ENOENT = 127 }; @@ -159,6 +147,9 @@ enum # define D_INO(dp) NOT_AN_INODE_NUMBER #endif +/* include here for SIZE_MAX. */ +#include + /* Get or fake the disk device blocksize. Usually defined by sys/param.h (if at all). */ #if !defined DEV_BSIZE && defined BSIZE @@ -240,8 +231,6 @@ enum #include "timespec.h" -#include - #include #if ! (defined isblank || HAVE_DECL_ISBLANK) @@ -359,6 +348,7 @@ uid_t getuid (); #include "same-inode.h" #include "dirname.h" +#include "openat.h" static inline bool dot_or_dotdot (char const *file_name) @@ -384,6 +374,36 @@ readdir_ignoring_dot_and_dotdot (DIR *dirp) } } +/* Return true if DIR is determined to be an empty directory. */ +static inline bool +is_empty_dir (int fd_cwd, char const *dir) +{ + DIR *dirp; + struct dirent const *dp; + int saved_errno; + int fd = openat (fd_cwd, dir, + (O_RDONLY | O_DIRECTORY + | O_NOCTTY | O_NOFOLLOW | O_NONBLOCK)); + + if (fd < 0) + return false; + + dirp = fdopendir (fd); + if (dirp == NULL) + { + close (fd); + return false; + } + + errno = 0; + dp = readdir_ignoring_dot_and_dotdot (dirp); + saved_errno = errno; + closedir (dirp); + if (dp != NULL) + return false; + return saved_errno == 0 ? true : false; +} + /* Factor out some of the common --help and --version processing code. */ /* These enum values cannot possibly conflict with the option values @@ -399,6 +419,8 @@ enum "help", no_argument, NULL, GETOPT_HELP_CHAR #define GETOPT_VERSION_OPTION_DECL \ "version", no_argument, NULL, GETOPT_VERSION_CHAR +#define GETOPT_SELINUX_CONTEXT_OPTION_DECL \ + "context", required_argument, NULL, 'Z' #define case_GETOPT_HELP_CHAR \ case GETOPT_HELP_CHAR: \ @@ -418,12 +440,26 @@ enum #define VERSION_OPTION_DESCRIPTION \ _(" --version output version information and exit\n") +#include "closein.h" #include "closeout.h" + +#define emit_bug_reporting_address unused__emit_bug_reporting_address #include "version-etc.h" +#undef emit_bug_reporting_address + +#include "propername.h" +/* Define away proper_name (leaving proper_name_utf8, which affects far + fewer programs), since it's not worth the cost of adding ~17KB to + the x86_64 text size of every single program. This avoids a 40% + (almost ~2MB) increase in the on-disk space utilization for the set + of the 100 binaries. */ +#define proper_name(x) (x) + +#include "progname.h" #define case_GETOPT_VERSION_CHAR(Program_name, Authors) \ case GETOPT_VERSION_CHAR: \ - version_etc (stdout, Program_name, GNU_PACKAGE, VERSION, Authors, \ + version_etc (stdout, Program_name, PACKAGE_NAME, Version, Authors, \ (char *) NULL); \ exit (EXIT_SUCCESS); \ break; @@ -469,8 +505,21 @@ enum # define IF_LINT(Code) /* empty */ #endif +/* With -Dlint, avoid warnings from gcc about code like mbstate_t m = {0,}; + by wasting space on a static variable of the same type, that is thus + guaranteed to be initialized to 0, and use that on the RHS. */ +#define DZA_CONCAT0(x,y) x ## y +#define DZA_CONCAT(x,y) DZA_CONCAT0 (x, y) +#ifdef lint +# define DECLARE_ZEROED_AGGREGATE(Type, Var) \ + static Type DZA_CONCAT (s0_, __LINE__); Type Var = DZA_CONCAT (s0_, __LINE__) +#else +# define DECLARE_ZEROED_AGGREGATE(Type, Var) \ + Type Var = { 0, } +#endif + #ifndef __attribute__ -# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8) || __STRICT_ANSI__ +# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8) # define __attribute__(x) /* empty */ # endif #endif @@ -502,21 +551,6 @@ enum # define EOVERFLOW EINVAL #endif -#if ! HAVE_FSEEKO -# if ! defined fseeko -# define fseeko(s, o, w) ((o) == (long int) (o) \ - ? fseek (s, o, w) \ - : (errno = EOVERFLOW, -1)) -# endif -# if ! defined ftello -static inline off_t ftello (FILE *stream) -{ - verify (sizeof (long int) <= sizeof (off_t)); - return ftell (stream); -} -# endif -#endif - #if ! HAVE_SYNC # define sync() /* empty */ #endif @@ -581,3 +615,90 @@ ptr_align (void const *ptr, size_t alignment) || (Type) ((Accum) * 10 + (Digit_val)) < (Accum)) \ ? false : (((Accum) = (Accum) * 10 + (Digit_val)), true)) \ ) + +#include "hard-locale.h" +static inline void +emit_bug_reporting_address (void) +{ + printf (_("\nReport %s bugs to %s\n"), last_component (program_name), + PACKAGE_BUGREPORT); + /* FIXME 2010: use AC_PACKAGE_URL once we require autoconf-2.64 */ + printf (_("%s home page: \n"), + PACKAGE_NAME, PACKAGE); + fputs (_("General help using GNU software: \n"), + stdout); + + if (hard_locale (LC_MESSAGES)) + { + /* TRANSLATORS: Replace LANG_CODE in this URL with your language code + to form one of + the URLs at http://translationproject.org/team/. Otherwise, replace + the entire URL with your translation team's email address. */ + printf (_("Report %s translation bugs to " + "\n"), + last_component (program_name)); + } +} + +#include "inttostr.h" + +static inline char * +timetostr (time_t t, char *buf) +{ + return (TYPE_SIGNED (time_t) + ? imaxtostr (t, buf) + : umaxtostr (t, buf)); +} + +static inline char * +bad_cast (char const *s) +{ + return (char *) s; +} + +/* As of Mar 2009, 32KiB is determined to be the minimium + blksize to best minimize system call overhead. + This can be tested with this script with the results + shown for a 1.7GHz pentium-m with 2GB of 400MHz DDR2 RAM: + + for i in $(seq 0 10); do + size=$((8*1024**3)) #ensure this is big enough + bs=$((1024*2**$i)) + printf "%7s=" $bs + dd bs=$bs if=/dev/zero of=/dev/null count=$(($size/$bs)) 2>&1 | + sed -n 's/.* \([0-9.]* [GM]B\/s\)/\1/p' + done + + 1024=734 MB/s + 2048=1.3 GB/s + 4096=2.4 GB/s + 8192=3.5 GB/s + 16384=3.9 GB/s + 32768=5.2 GB/s + 65536=5.3 GB/s + 131072=5.5 GB/s + 262144=5.7 GB/s + 524288=5.7 GB/s + 1048576=5.8 GB/s + + Note that this is to minimize system call overhead. + Other values may be appropriate to minimize file system + or disk overhead. For example on my current GNU/Linux system + the readahead setting is 128KiB which was read using: + + file="." + device=$(df -P --local "$file" | tail -n1 | cut -d' ' -f1) + echo $(( $(blockdev --getra $device) * 512 )) + + However there isn't a portable way to get the above. + In the future we could use the above method if available + and default to io_blksize() if not. + */ +enum { IO_BUFSIZE = 32*1024 }; +static inline size_t +io_blksize (struct stat sb) +{ + return MAX (IO_BUFSIZE, ST_BLKSIZE (sb)); +} + +void usage (int status) ATTRIBUTE_NORETURN; diff --git a/src/bin/coreutils/src/tac-pipe.c b/src/bin/coreutils/src/tac-pipe.c index d2c6f677b7..35be3314a8 100644 --- a/src/bin/coreutils/src/tac-pipe.c +++ b/src/bin/coreutils/src/tac-pipe.c @@ -2,10 +2,10 @@ Copyright (C) 1997, 1998, 2002, 2004 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* FIXME */ #include diff --git a/src/bin/coreutils/src/tac.c b/src/bin/coreutils/src/tac.c index dc166aaa3d..be8f3abccb 100644 --- a/src/bin/coreutils/src/tac.c +++ b/src/bin/coreutils/src/tac.c @@ -1,10 +1,10 @@ /* tac - concatenate and print files in reverse - Copyright (C) 1988-1991, 1995-2006 Free Software Foundation, Inc. + Copyright (C) 1988-1991, 1995-2006, 2008 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Jay Lepreau (lepreau@cs.utah.edu). GNU enhancements by David MacKenzie (djm@gnu.ai.mit.edu). */ @@ -49,11 +48,14 @@ tac -r -s '.\| #include "quotearg.h" #include "safe-read.h" #include "stdlib--.h" +#include "xfreopen.h" /* The official name of this program (e.g., no `g' prefix). */ #define PROGRAM_NAME "tac" -#define AUTHORS "Jay Lepreau", "David MacKenzie" +#define AUTHORS \ + proper_name ("Jay Lepreau"), \ + proper_name ("David MacKenzie") #if defined __MSDOS__ || defined _WIN32 /* Define this to non-zero on systems for which the regular mechanism @@ -74,9 +76,6 @@ tac -r -s '.\| /* The number of bytes per atomic write. */ #define WRITESIZE 8192 -/* The name this program was run with. */ -char *program_name; - /* The string that separates the records of the file. */ static char const *separator; @@ -111,6 +110,7 @@ static size_t G_buffer_size; /* The compiled regular expression representing `separator'. */ static struct re_pattern_buffer compiled_separator; static char compiled_separator_fastmap[UCHAR_MAX + 1]; +static struct re_registers regs; static struct option const longopts[] = { @@ -149,7 +149,7 @@ Mandatory arguments to long options are mandatory for short options too.\n\ "), stdout); fputs (HELP_OPTION_DESCRIPTION, stdout); fputs (VERSION_OPTION_DESCRIPTION, stdout); - printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT); + emit_bug_reporting_address (); } exit (status); } @@ -213,7 +213,6 @@ tac_seekable (int input_fd, const char *file) char first_char = *separator; /* Speed optimization, non-regexp. */ char const *separator1 = separator + 1; /* Speed optimization, non-regexp. */ size_t match_length1 = match_length - 1; /* Speed optimization, non-regexp. */ - struct re_registers regs; /* Find the size of the input file. */ file_pos = lseek (input_fd, (off_t) 0, SEEK_END); @@ -456,7 +455,8 @@ copy_to_temp (FILE **g_tmp, char **g_tempfile, int input_fd, char const *file) fd = mkstemp (template); if (fd < 0) { - error (0, errno, _("cannot create temporary file %s"), quote (tempfile)); + error (0, errno, _("cannot create temporary file in %s"), + quote (tempdir)); return false; } @@ -534,7 +534,7 @@ tac_file (const char *filename) fd = STDIN_FILENO; filename = _("standard input"); if (O_BINARY && ! isatty (STDIN_FILENO)) - freopen (NULL, "rb", stdin); + xfreopen (NULL, "rb", stdin); } else { @@ -574,7 +574,7 @@ main (int argc, char **argv) char const *const *file; initialize_main (&argc, &argv); - program_name = argv[0]; + set_program_name (argv[0]); setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); @@ -648,7 +648,7 @@ main (int argc, char **argv) : default_file_list); if (O_BINARY && ! isatty (STDOUT_FILENO)) - freopen (NULL, "wb", stdout); + xfreopen (NULL, "wb", stdout); { size_t i; diff --git a/src/bin/coreutils/src/tail.c b/src/bin/coreutils/src/tail.c index 2582b9d694..fe34600545 100644 --- a/src/bin/coreutils/src/tail.c +++ b/src/bin/coreutils/src/tail.c @@ -1,10 +1,10 @@ /* tail -- output the last part of file(s) - Copyright (C) 1989, 90, 91, 1995-2006 Free Software Foundation, Inc. + Copyright (C) 1989, 90, 91, 1995-2006, 2008 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Can display any amount of data, unlike the Unix version, which uses a fixed size buffer and therefore can only deliver a limited number @@ -36,12 +35,12 @@ #include "c-strtod.h" #include "error.h" #include "fcntl--.h" -#include "inttostr.h" #include "isapipe.h" #include "posixver.h" #include "quote.h" #include "safe-read.h" #include "stat-time.h" +#include "xfreopen.h" #include "xnanosleep.h" #include "xstrtol.h" #include "xstrtod.h" @@ -50,7 +49,10 @@ #define PROGRAM_NAME "tail" #define AUTHORS \ - "Paul Rubin", "David MacKenzie, Ian Lance Taylor", "Jim Meyering" + proper_name ("Paul Rubin"), \ + proper_name ("David MacKenzie"), \ + proper_name ("Ian Lance Taylor"), \ + proper_name ("Jim Meyering") /* Number of items to tail. */ #define DEFAULT_N_LINES 10 @@ -160,9 +162,6 @@ enum header_mode static uintmax_t max_n_unchanged_stats_between_opens = DEFAULT_MAX_N_UNCHANGED_STATS_BETWEEN_OPENS; -/* The name this program was run with. */ -char *program_name; - /* The process ID of the process (presumably on the current host) that is writing to all followed files. */ static pid_t pid; @@ -227,10 +226,6 @@ With no FILE, or when FILE is -, read standard input.\n\ Mandatory arguments to long options are mandatory for short options too.\n\ "), stdout); fputs (_("\ - --retry keep trying to open a file even if it is\n\ - inaccessible when tail starts or if it becomes\n\ - inaccessible later; useful when following by name,\n\ - i.e., with --follow=name\n\ -c, --bytes=N output the last N bytes; alternatively, use +N to\n\ output bytes starting with the Nth of each file\n\ "), stdout); @@ -256,8 +251,13 @@ Mandatory arguments to long options are mandatory for short options too.\n\ fputs (_("\ --pid=PID with -f, terminate after process ID, PID dies\n\ -q, --quiet, --silent never output headers giving file names\n\ + --retry keep trying to open a file even when it is or\n\ + becomes inaccessible; useful when following by\n\ + name, i.e., with --follow=name\n\ +"), stdout); + fputs (_("\ -s, --sleep-interval=S with -f, sleep for approximately S seconds\n\ - (default 1.0) between iterations.\n\ + (default 1.0) between iterations\n\ -v, --verbose always output headers giving file names\n\ "), stdout); fputs (HELP_OPTION_DESCRIPTION, stdout); @@ -267,7 +267,8 @@ Mandatory arguments to long options are mandatory for short options too.\n\ If the first character of N (the number of bytes or lines) is a `+',\n\ print beginning with the Nth item from the start of each file, otherwise,\n\ print the last N items in the file. N may have a multiplier suffix:\n\ -b 512, k 1024, m 1024*1024.\n\ +b 512, kB 1000, K 1024, MB 1000*1000, M 1024*1024,\n\ +GB 1000*1000*1000, G 1024*1024*1024, and so on for T, P, E, Z, Y.\n\ \n\ "), stdout); fputs (_("\ @@ -282,7 +283,7 @@ rotation). Use --follow=name in that case. That causes tail to track the\n\ named file by reopening it periodically to see if it has been removed and\n\ recreated by some other program.\n\ "), stdout); - printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT); + emit_bug_reporting_address (); } exit (status); } @@ -297,7 +298,7 @@ valid_file_spec (struct File_spec const *f) static char const * pretty_name (struct File_spec const *f) { - return (STREQ (f->name, "-") ? "standard input" : f->name); + return (STREQ (f->name, "-") ? _("standard input") : f->name); } static void @@ -1273,7 +1274,7 @@ tail_file (struct File_spec *f, uintmax_t n_units) have_read_stdin = true; fd = STDIN_FILENO; if (O_BINARY && ! isatty (STDIN_FILENO)) - freopen (NULL, "rb", stdin); + xfreopen (NULL, "rb", stdin); } else fd = open (f->name, O_RDONLY | O_BINARY); @@ -1475,7 +1476,7 @@ parse_options (int argc, char **argv, { strtol_error s_err; - s_err = xstrtoumax (optarg, NULL, 10, n_units, "bkm"); + s_err = xstrtoumax (optarg, NULL, 10, n_units, "bkKmMGTPEZY0"); if (s_err != LONGINT_OK) { error (EXIT_FAILURE, 0, "%s: %s", optarg, @@ -1596,7 +1597,7 @@ main (int argc, char **argv) double sleep_interval = 1.0; initialize_main (&argc, &argv); - program_name = argv[0]; + set_program_name (argv[0]); setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); @@ -1628,7 +1629,7 @@ main (int argc, char **argv) } else { - static char *dummy_stdin = "-"; + static char *dummy_stdin = (char *) "-"; n_files = 1; file = &dummy_stdin; @@ -1683,7 +1684,7 @@ main (int argc, char **argv) print_headers = true; if (O_BINARY && ! isatty (STDOUT_FILENO)) - freopen (NULL, "wb", stdout); + xfreopen (NULL, "wb", stdout); for (i = 0; i < n_files; i++) ok &= tail_file (&F[i], n_units); diff --git a/src/bin/coreutils/src/tee.c b/src/bin/coreutils/src/tee.c index d21edbc04f..2d13f6d54a 100644 --- a/src/bin/coreutils/src/tee.c +++ b/src/bin/coreutils/src/tee.c @@ -1,10 +1,10 @@ /* tee - read from standard input and write to standard output and files. - Copyright (C) 85,1990-2006 Free Software Foundation, Inc. + Copyright (C) 85,1990-2006, 2008 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Mike Parker, Richard M. Stallman, and David MacKenzie */ @@ -25,11 +24,15 @@ #include "system.h" #include "error.h" #include "stdio--.h" +#include "xfreopen.h" /* The official name of this program (e.g., no `g' prefix). */ #define PROGRAM_NAME "tee" -#define AUTHORS "Mike Parker", "Richard M. Stallman", "David MacKenzie" +#define AUTHORS \ + proper_name ("Mike Parker"), \ + proper_name ("Richard M. Stallman"), \ + proper_name ("David MacKenzie") static bool tee_files (int nfiles, const char **files); @@ -39,9 +42,6 @@ static bool append; /* If true, ignore interrupts. */ static bool ignore_interrupts; -/* The name that this program was run with. */ -char *program_name; - static struct option const long_options[] = { {"append", no_argument, NULL, 'a'}, @@ -72,7 +72,7 @@ Copy standard input to each FILE, and also to standard output.\n\ \n\ If a FILE is -, copy again to standard output.\n\ "), stdout); - printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT); + emit_bug_reporting_address (); } exit (status); } @@ -84,7 +84,7 @@ main (int argc, char **argv) int optc; initialize_main (&argc, &argv); - program_name = argv[0]; + set_program_name (argv[0]); setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); @@ -153,9 +153,9 @@ tee_files (int nfiles, const char **files) files[i] = files[i - 1]; if (O_BINARY && ! isatty (STDIN_FILENO)) - freopen (NULL, "rb", stdin); + xfreopen (NULL, "rb", stdin); if (O_BINARY && ! isatty (STDOUT_FILENO)) - freopen (NULL, "wb", stdout); + xfreopen (NULL, "wb", stdout); /* In the array of NFILES + 1 descriptors, make the first one correspond to standard output. */ @@ -191,7 +191,7 @@ tee_files (int nfiles, const char **files) Standard output is the first one. */ for (i = 0; i <= nfiles; i++) if (descriptors[i] - && fwrite (buffer, 1, bytes_read, descriptors[i]) != bytes_read) + && fwrite (buffer, bytes_read, 1, descriptors[i]) != 1) { error (0, errno, "%s", files[i]); descriptors[i] = NULL; diff --git a/src/bin/coreutils/src/test.c b/src/bin/coreutils/src/test.c index b25436b1f1..1825e901af 100644 --- a/src/bin/coreutils/src/test.c +++ b/src/bin/coreutils/src/test.c @@ -2,23 +2,20 @@ /* Modified to run with the GNU shell by bfox. */ -/* Copyright (C) 1987-2005 Free Software Foundation, Inc. +/* Copyright (C) 1987-2005, 2007-2009 Free Software Foundation, Inc. - This file is part of GNU Bash, the Bourne Again SHell. + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. - Bash is free software; you can redistribute it and/or modify it under - the terms of the GNU General Public License as published by the Free - Software Foundation; either version 2, or (at your option) any later - version. - - Bash is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Define TEST_STANDALONE to get the /bin/test version. Otherwise, you get the shell builtin version. */ @@ -41,9 +38,6 @@ #endif #include "system.h" -#include "error.h" -#include "euidaccess.h" -#include "inttostr.h" #include "quote.h" #include "stat-time.h" #include "strnumcmp.h" @@ -52,8 +46,6 @@ # include #endif -char *program_name; - /* Exit status for syntax errors, etc. */ enum { TEST_TRUE, TEST_FALSE, TEST_FAILURE }; @@ -99,7 +91,7 @@ test_syntax_error (char const *format, char const *arg) past the end of the argument list. This check is supressed if the argument is false. */ -static inline void +static void advance (bool f) { ++pos; @@ -108,7 +100,7 @@ advance (bool f) beyond (); } -static inline void +static void unary_advance (void) { advance (true); @@ -575,9 +567,9 @@ test_unop (char const *op) case 'u': case 'w': case 'x': case 'z': case 'G': case 'L': case 'O': case 'S': case 'N': return true; + default: + return false; } - - return false; } static bool @@ -681,7 +673,6 @@ posixtest (int nargs) } #if defined TEST_STANDALONE -# include "long-options.h" void usage (int status) @@ -772,9 +763,14 @@ EXPRESSION is true or false and sets exit status. It is one of:\n\ Except for -h and -L, all FILE-related tests dereference symbolic links.\n\ Beware that parentheses need to be escaped (e.g., by backslashes) for shells.\n\ INTEGER may also be -l STRING, which evaluates to the length of STRING.\n\ +"), stdout); + fputs (_("\ +\n\ +NOTE: [ honors the --help and --version options, but test does not.\n\ +test treats each of those as it treats any other nonempty STRING.\n\ "), stdout); printf (USAGE_BUILTIN_WARNING, _("test and/or [")); - printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT); + emit_bug_reporting_address (); } exit (status); } @@ -784,7 +780,9 @@ INTEGER may also be -l STRING, which evaluates to the length of STRING.\n\ # define main test_command #endif -#define AUTHORS "Kevin Braunsdorf", "Matthew Bradburn" +#define AUTHORS \ + proper_name ("Kevin Braunsdorf"), \ + proper_name ("Matthew Bradburn") /* * [: @@ -806,7 +804,7 @@ main (int margc, char **margv) return (test_error_return); #else /* TEST_STANDALONE */ initialize_main (&margc, &margv); - program_name = margv[0]; + set_program_name (margv[0]); setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); @@ -820,16 +818,25 @@ main (int margc, char **margv) if (LBRACKET) { /* Recognize --help or --version, but only when invoked in the - "[" form, and when the last argument is not "]". POSIX - allows "[ --help" and "[ --version" to have the usual GNU - behavior, but it requires "test --help" and "test --version" - to exit silently with status 0. */ - if (margc < 2 || !STREQ (margv[margc - 1], "]")) + "[" form, when the last argument is not "]". Use direct + parsing, rather than parse_long_options, to avoid accepting + abbreviations. POSIX allows "[ --help" and "[ --version" to + have the usual GNU behavior, but it requires "test --help" + and "test --version" to exit silently with status 0. */ + if (margc == 2) { - parse_long_options (margc, margv, PROGRAM_NAME, GNU_PACKAGE, VERSION, - usage, AUTHORS, (char const *) NULL); - test_syntax_error (_("missing `]'"), NULL); + if (STREQ (margv[1], "--help")) + usage (EXIT_SUCCESS); + + if (STREQ (margv[1], "--version")) + { + version_etc (stdout, PROGRAM_NAME, PACKAGE_NAME, Version, AUTHORS, + (char *) NULL); + test_exit (EXIT_SUCCESS); + } } + if (margc < 2 || !STREQ (margv[margc - 1], "]")) + test_syntax_error (_("missing `]'"), NULL); --margc; } diff --git a/src/bin/coreutils/src/timeout.c b/src/bin/coreutils/src/timeout.c new file mode 100644 index 0000000000..c79f24eb50 --- /dev/null +++ b/src/bin/coreutils/src/timeout.c @@ -0,0 +1,338 @@ +/* timeout -- run a command with bounded time + Copyright (C) 2008 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + + +/* timeout - Start a command, and kill it if the specified timeout expires + + We try to behave like a shell starting a single (foreground) job, + and will kill the job if we receive the alarm signal we setup. + The exit status of the job is returned, or one of these errors: + EXIT_TIMEDOUT 124 job timed out + EXIT_CANCELED 125 internal error + EXIT_CANNOT_INVOKE 126 error executing job + EXIT_ENOENT 127 couldn't find job to exec + + Caveats: + If user specifies the KILL (9) signal is to be sent on timeout, + the monitor is killed and so exits with 128+9 rather than 124. + + If you start a command in the background, which reads from the tty + and so is immediately sent SIGTTIN to stop, then the timeout + process will ignore this so it can timeout the command as expected. + This can be seen with `timeout 10 dd&` for example. + However if one brings this group to the foreground with the `fg` + command before the timer expires, the command will remain + in the sTop state as the shell doesn't send a SIGCONT + because the timeout process (group leader) is already running. + To get the command running again one can Ctrl-Z, and do fg again. + Note one can Ctrl-C the whole job when in this state. + I think this could be fixed but I'm not sure the extra + complication is justified for this scenario. + + Written by Pádraig Brady. */ + +#include +#include +#include +#include +#include + +#if HAVE_SYS_WAIT_H +# include +#endif +#ifndef WIFSIGNALED +# define WIFSIGNALED(s) (((s) & 0xFFFF) - 1 < (unsigned int) 0xFF) +#endif +#ifndef WTERMSIG +# define WTERMSIG(s) ((s) & 0x7F) +#endif + +#include "system.h" +#include "xstrtol.h" +#include "sig2str.h" +#include "operand2sig.h" +#include "cloexec.h" +#include "error.h" +#include "long-options.h" +#include "quote.h" + +#define PROGRAM_NAME "timeout" + +#define AUTHORS proper_name_utf8 ("Padraig Brady", "P\303\241draig Brady") + +/* Note ETIMEDOUT is 110 on GNU/Linux systems but this is non standard */ +#define EXIT_TIMEDOUT 124 + +/* Internal failure. */ +#define EXIT_CANCELED 125 + +static int timed_out; +static int term_signal = SIGTERM; /* same default as kill command. */ +static int monitored_pid; +static int sigs_to_ignore[NSIG]; /* so monitor can ignore sigs it resends. */ + +static struct option const long_options[] = +{ + {"signal", required_argument, NULL, 's'}, + {NULL, 0, NULL, 0} +}; + +/* send sig to group but not ourselves. + * FIXME: Is there a better way to achieve this? */ +static int +send_sig (int where, int sig) +{ + sigs_to_ignore[sig] = 1; + return kill (where, sig); +} + +static void +cleanup (int sig) +{ + if (sig == SIGALRM) + { + timed_out = 1; + sig = term_signal; + } + if (monitored_pid) + { + if (sigs_to_ignore[sig]) + { + sigs_to_ignore[sig] = 0; + return; + } + send_sig (0, sig); + if (sig != SIGKILL && sig != SIGCONT) + send_sig (0, SIGCONT); + } + else /* we're the child or the child is not exec'd yet. */ + _exit (128 + sig); +} + +void +usage (int status) +{ + if (status != EXIT_SUCCESS) + fprintf (stderr, _("Try `%s --help' for more information.\n"), + program_name); + else + { + printf (_("\ +Usage: %s [OPTION] NUMBER[SUFFIX] COMMAND [ARG]...\n\ + or: %s [OPTION]\n"), program_name, program_name); + + fputs (_("\ +Start COMMAND, and kill it if still running after NUMBER seconds.\n\ +SUFFIX may be `s' for seconds (the default), `m' for minutes,\n\ +`h' for hours or `d' for days.\n\ +\n\ +"), stdout); + + fputs (_("\ +Mandatory arguments to long options are mandatory for short options too.\n\ +"), stdout); + fputs (_("\ + -s, --signal=SIGNAL\n\ + specify the signal to be sent on timeout.\n\ + SIGNAL may be a name like `HUP' or a number.\n\ + See `kill -l` for a list of signals\n"), stdout); + + fputs (HELP_OPTION_DESCRIPTION, stdout); + fputs (VERSION_OPTION_DESCRIPTION, stdout); + fputs (_("\n\ +If the command times out, then we exit with status 124,\n\ +otherwise the normal exit status of the command is returned.\n\ +If no signal is specified, the TERM signal is sent. The TERM signal\n\ +will kill processes which do not catch this signal. For other processes,\n\ +it may be necessary to use the KILL (9) signal, since this signal cannot\n\ +be caught.\n"), stdout); + emit_bug_reporting_address (); + } + exit (status); +} + +/* Given a long integer value *X, and a suffix character, SUFFIX_CHAR, + scale *X by the multiplier implied by SUFFIX_CHAR. SUFFIX_CHAR may + be the NUL byte or `s' to denote seconds, `m' for minutes, `h' for + hours, or `d' for days. If SUFFIX_CHAR is invalid, don't modify *X + and return false. If *X would overflow an integer, don't modify *X + and return false. Otherwise return true. */ + +static bool +apply_time_suffix (unsigned long *x, char suffix_char) +{ + unsigned int multiplier = 1; + + switch (suffix_char) + { + case 0: + case 's': + return true; + case 'd': + multiplier *= 24; + case 'h': + multiplier *= 60; + case 'm': + if (multiplier > UINT_MAX / 60) /* 16 bit overflow */ + return false; + multiplier *= 60; + break; + default: + return false; + } + + if (*x > UINT_MAX / multiplier) + return false; + + *x *= multiplier; + + return true; +} + +static void +install_signal_handlers (void) +{ + struct sigaction sa; + sigemptyset(&sa.sa_mask); /* Allow concurrent calls to handler */ + sa.sa_handler = cleanup; + sa.sa_flags = SA_RESTART; /* restart syscalls (like wait() below) */ + + sigaction (SIGALRM, &sa, NULL); /* our timeout. */ + sigaction (SIGINT, &sa, NULL); /* Ctrl-C at terminal for example. */ + sigaction (SIGQUIT, &sa, NULL); /* Ctrl-\ at terminal for example. */ + sigaction (SIGTERM, &sa, NULL); /* if we're killed, stop monitored proc. */ + sigaction (SIGHUP, &sa, NULL); /* terminal closed for example. */ +} + +int +main (int argc, char **argv) +{ + unsigned long timeout; + char signame[SIG2STR_MAX]; + int c; + char *ep; + + initialize_main (&argc, &argv); + set_program_name (argv[0]); + setlocale (LC_ALL, ""); + bindtextdomain (PACKAGE, LOCALEDIR); + textdomain (PACKAGE); + + initialize_exit_failure (EXIT_CANCELED); + atexit (close_stdout); + + parse_long_options (argc, argv, PROGRAM_NAME, PACKAGE_NAME, Version, + usage, AUTHORS, (char const *) NULL); + + while ((c = getopt_long (argc, argv, "+s:", long_options, NULL)) != -1) + { + switch (c) + { + case 's': + term_signal = operand2sig (optarg, signame); + if (term_signal == -1) + usage (EXIT_CANCELED); + break; + default: + usage (EXIT_CANCELED); + break; + } + } + + if (argc - optind < 2) + usage (EXIT_CANCELED); + + if (xstrtoul (argv[optind], &ep, 10, &timeout, NULL) + /* Invalid interval. Note 0 disables timeout */ + || (timeout > UINT_MAX) + /* Extra chars after the number and an optional s,m,h,d char. */ + || (*ep && *(ep + 1)) + /* Check any suffix char and update timeout based on the suffix. */ + || !apply_time_suffix (&timeout, *ep)) + { + error (0, 0, _("invalid time interval %s"), quote (argv[optind])); + usage (EXIT_CANCELED); + } + optind++; + + argc -= optind; + argv += optind; + + /* Ensure we're in our own group so all subprocesses can be killed. + Note we don't just put the child in a separate group as + then we would need to worry about foreground and background groups + and propagating signals between them. */ + setpgid (0, 0); + + /* Setup handlers before fork() so that we + handle any signals caused by child, without races. */ + install_signal_handlers (); + signal (SIGTTIN, SIG_IGN); /* don't sTop if background child needs tty. */ + signal (SIGTTOU, SIG_IGN); /* don't sTop if background child needs tty. */ + + monitored_pid = fork (); + if (monitored_pid == -1) + { + error (0, errno, _("fork system call failed")); + return EXIT_CANCELED; + } + else if (monitored_pid == 0) + { /* child */ + int exit_status; + + /* exec doesn't reset SIG_IGN -> SIG_DFL. */ + signal (SIGTTIN, SIG_DFL); + signal (SIGTTOU, SIG_DFL); + + execvp (argv[0], argv); /* FIXME: should we use "sh -c" ... here? */ + + /* exit like sh, env, nohup, ... */ + exit_status = (errno == ENOENT ? EXIT_ENOENT : EXIT_CANNOT_INVOKE); + error (0, errno, _("cannot run command %s"), quote (argv[0])); + return exit_status; + } + else + { + int status; + + alarm (timeout); + + /* We're just waiting for a single process here, so wait() suffices. + Note the signal() calls above on GNU/Linux and BSD at least, + essentially call the lower level sigaction() with the SA_RESTART flag + set, which ensures the following wait call will only return if the + child exits, not on this process receiving a signal. Also we're not + passing WUNTRACED | WCONTINUED to a waitpid() call and so will not get + indication that the child has stopped or continued. */ + wait (&status); + + if (WIFEXITED (status)) + status = WEXITSTATUS (status); + else if (WIFSIGNALED (status)) + status = WTERMSIG (status) + 128; /* what sh does at least. */ + + if (timed_out) + return EXIT_TIMEDOUT; + else + return status; + } +} + +/* + * Local variables: + * indent-tabs-mode: nil + * End: + */ diff --git a/src/bin/coreutils/src/touch.c b/src/bin/coreutils/src/touch.c index a79c26d97e..3d6d9fac26 100644 --- a/src/bin/coreutils/src/touch.c +++ b/src/bin/coreutils/src/touch.c @@ -1,10 +1,11 @@ /* touch -- change modification and access times of files - Copyright (C) 87, 1989-1991, 1995-2005 Free Software Foundation, Inc. + Copyright (C) 87, 1989-1991, 1995-2005, 2007-2009 + Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Paul Rubin, Arnold Robbins, Jim Kingdon, David MacKenzie, and Randy Smith. */ @@ -31,7 +31,6 @@ #include "posixtm.h" #include "posixver.h" #include "quote.h" -#include "safe-read.h" #include "stat-time.h" #include "utimens.h" @@ -39,15 +38,16 @@ #define PROGRAM_NAME "touch" #define AUTHORS \ -"Paul Rubin", "Arnold Robbins, Jim Kingdon, David MacKenzie", "Randy Smith" + proper_name ("Paul Rubin"), \ + proper_name ("Arnold Robbins"), \ + proper_name ("Jim Kingdon"), \ + proper_name ("David MacKenzie"), \ + proper_name ("Randy Smith") /* Bitmasks for `change_times'. */ #define CH_ATIME 1 #define CH_MTIME 2 -/* The name by which this program was run. */ -char *program_name; - /* Which timestamps to change. */ static int change_times; @@ -82,7 +82,7 @@ static struct option const longopts[] = {"time", required_argument, NULL, TIME_OPTION}, {"no-create", no_argument, NULL, 'c'}, {"date", required_argument, NULL, 'd'}, - {"file", required_argument, NULL, 'r'}, /* FIXME: remove --file in 2006 */ + {"file", required_argument, NULL, 'r'}, /* FIXME: remove --file in 2010 */ {"reference", required_argument, NULL, 'r'}, {GETOPT_HELP_OPTION_DECL}, {GETOPT_VERSION_OPTION_DECL}, @@ -182,7 +182,7 @@ touch (const char *file) t = timespec; } - ok = (futimens (fd, (fd == STDOUT_FILENO ? NULL : file), t) == 0); + ok = (gl_futimens (fd, (fd == STDOUT_FILENO ? NULL : file), t) == 0); if (fd == STDIN_FILENO) { @@ -234,6 +234,11 @@ usage (int status) fputs (_("\ Update the access and modification times of each FILE to the current time.\n\ \n\ +A FILE argument that does not exist is created empty.\n\ +\n\ +A FILE argument string of - is handled specially and causes touch to\n\ +change the times of the file associated with standard output.\n\ +\n\ "), stdout); fputs (_("\ Mandatory arguments to long options are mandatory for short options too.\n\ @@ -257,10 +262,8 @@ Mandatory arguments to long options are mandatory for short options too.\n\ fputs (_("\ \n\ Note that the -d and -t options accept different time-date formats.\n\ -\n\ -If a FILE is -, touch standard output.\n\ "), stdout); - printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT); + emit_bug_reporting_address (); } exit (status); } @@ -272,9 +275,10 @@ main (int argc, char **argv) bool date_set = false; bool ok = true; char const *flex_date = NULL; + int long_idx; /* FIXME: remove in 2010, when --file is removed */ initialize_main (&argc, &argv); - program_name = argv[0]; + set_program_name (argv[0]); setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); @@ -284,7 +288,7 @@ main (int argc, char **argv) change_times = 0; no_create = use_ref = false; - while ((c = getopt_long (argc, argv, "acd:fmr:t:", longopts, NULL)) != -1) + while ((c = getopt_long (argc, argv, "acd:fmr:t:", longopts, &long_idx)) != -1) { switch (c) { @@ -308,6 +312,10 @@ main (int argc, char **argv) break; case 'r': + if (long_idx == 3) + error (0, 0, + _("warning: the --%s option is obsolete; use --reference"), + longopts[long_idx].name); use_ref = true; ref_file = optarg; break; @@ -366,9 +374,29 @@ main (int argc, char **argv) { if (flex_date) { - get_reldate (&newtime[0], flex_date, NULL); + struct timespec now; + gettime (&now); + get_reldate (&newtime[0], flex_date, &now); newtime[1] = newtime[0]; date_set = true; + + /* If neither -a nor -m is specified, treat "-d now" as if + it were absent; this lets "touch" succeed more often in + the presence of restrictive permissions. */ + if (change_times == (CH_ATIME | CH_MTIME) + && newtime[0].tv_sec == now.tv_sec + && newtime[0].tv_nsec == now.tv_nsec) + { + /* Check that it really was "-d now", and not a time + stamp that just happens to be the current time. */ + struct timespec notnow, notnow1; + notnow.tv_sec = now.tv_sec ^ 1; + notnow.tv_nsec = now.tv_nsec; + get_reldate (¬now1, flex_date, ¬now); + if (notnow1.tv_sec == notnow.tv_sec + && notnow1.tv_nsec == notnow.tv_nsec) + date_set = false; + } } } diff --git a/src/bin/coreutils/src/tr.c b/src/bin/coreutils/src/tr.c index 214eb2bc97..f4b5317315 100644 --- a/src/bin/coreutils/src/tr.c +++ b/src/bin/coreutils/src/tr.c @@ -1,10 +1,10 @@ /* tr -- a filter to translate characters - Copyright (C) 91, 1995-2006 Free Software Foundation, Inc. + Copyright (C) 91, 1995-2008 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Jim Meyering */ @@ -28,12 +27,13 @@ #include "error.h" #include "quote.h" #include "safe-read.h" +#include "xfreopen.h" #include "xstrtol.h" /* The official name of this program (e.g., no `g' prefix). */ #define PROGRAM_NAME "tr" -#define AUTHORS "Jim Meyering" +#define AUTHORS proper_name ("Jim Meyering") enum { N_CHARS = UCHAR_MAX + 1 }; @@ -194,9 +194,6 @@ es_match (struct E_string const *es, size_t i, char c) return es->s[i] == c && !es->escaped[i]; } -/* The name by which this program was run. */ -char *program_name; - /* When true, each sequence in the input of a repeated character (call it c) is replaced (in the output) by a single occurrence of c for every c in the squeeze set. */ @@ -343,20 +340,14 @@ Interpreted sequences are:\n\ \n\ Translation occurs if -d is not given and both SET1 and SET2 appear.\n\ -t may be used only when translating. SET2 is extended to length of\n\ -SET1 by repeating its last character as necessary. \ -"), stdout); - fputs (_("\ -Excess characters\n\ +SET1 by repeating its last character as necessary. Excess characters\n\ of SET2 are ignored. Only [:lower:] and [:upper:] are guaranteed to\n\ expand in ascending order; used in SET2 while translating, they may\n\ -only be used in pairs to specify case conversion. \ -"), stdout); - fputs (_("\ --s uses SET1 if not\n\ +only be used in pairs to specify case conversion. -s uses SET1 if not\n\ translating nor deleting; else squeezing uses SET2 and occurs after\n\ translation or deletion.\n\ "), stdout); - printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT); + emit_bug_reporting_address (); } exit (status); } @@ -525,8 +516,9 @@ unquote (char const *s, struct E_string *es) } break; case '\0': - /* POSIX seems to require that a trailing backslash must - stand for itself. Weird. */ + error (0, 0, _("warning: an unescaped backslash " + "at end of string is not portable")); + /* POSIX is not clear about this. */ es->escaped[j] = false; i--; c = '\\'; @@ -1019,6 +1011,15 @@ build_spec_list (const struct E_string *es, struct Spec_list *result) return true; } +/* Advance past the current construct. + S->tail must be non-NULL. */ +static void +skip_construct (struct Spec_list *s) +{ + s->tail = s->tail->next; + s->state = NEW_ELEMENT; +} + /* Given a Spec_list S (with its saved state implicit in the values of its members `tail' and `state'), return the next single character in the expansion of S's constructs. If the last character of S was @@ -1077,27 +1078,15 @@ get_next (struct Spec_list *s, enum Upper_Lower_class *class) case RE_CHAR_CLASS: if (class) { - bool upper_or_lower; switch (p->u.char_class) { case CC_LOWER: *class = UL_LOWER; - upper_or_lower = true; break; case CC_UPPER: *class = UL_UPPER; - upper_or_lower = true; break; default: - upper_or_lower = false; - break; - } - - if (upper_or_lower) - { - s->tail = p->next; - s->state = NEW_ELEMENT; - return_val = 0; break; } } @@ -1674,7 +1663,7 @@ main (int argc, char **argv) struct Spec_list *s2 = &buf2; initialize_main (&argc, &argv); - program_name = argv[0]; + set_program_name (argv[0]); setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); @@ -1726,9 +1715,9 @@ main (int argc, char **argv) error (0, 0, _("missing operand after %s"), quote (argv[argc - 1])); fprintf (stderr, "%s\n", _(squeeze_repeats - ? ("Two strings must be given when " - "both deleting and squeezing repeats.") - : "Two strings must be given when translating.")); + ? N_("Two strings must be given when " + "both deleting and squeezing repeats.") + : N_("Two strings must be given when translating."))); } usage (EXIT_FAILURE); } @@ -1762,9 +1751,9 @@ main (int argc, char **argv) non-printable characters, or characters which are stripped away by text-mode reads (like CR and ^Z). */ if (O_BINARY && ! isatty (STDIN_FILENO)) - freopen (NULL, "rb", stdin); + xfreopen (NULL, "rb", stdin); if (O_BINARY && ! isatty (STDOUT_FILENO)) - freopen (NULL, "wb", stdout); + xfreopen (NULL, "wb", stdout); if (squeeze_repeats && non_option_args == 1) { @@ -1816,12 +1805,12 @@ main (int argc, char **argv) xlate[i] = ch; } } - assert (get_next (s2, NULL) == -1 || truncate_set1); } else { int c1, c2; int i; + bool case_convert = false; enum Upper_Lower_class class_s1; enum Upper_Lower_class class_s2; @@ -1831,26 +1820,37 @@ main (int argc, char **argv) s2->state = BEGIN_STATE; for (;;) { + /* When the previous pair identified case-converting classes, + advance S1 and S2 so that each points to the following + construct. */ + if (case_convert) + { + skip_construct (s1); + skip_construct (s2); + case_convert = false; + } + c1 = get_next (s1, &class_s1); c2 = get_next (s2, &class_s2); - /* When constructing the translation array, either one of the - values returned by paired calls to get_next must be from - [:upper:] and the other is [:lower:], or neither can be from - upper or lower. */ - - if ((class_s1 == UL_NONE) != (class_s2 == UL_NONE)) + /* When translating and there is an [:upper:] or [:lower:] + class in SET2, then there must be a corresponding [:lower:] + or [:upper:] class in SET1. */ + if (class_s1 == UL_NONE + && (class_s2 == UL_LOWER || class_s2 == UL_UPPER)) error (EXIT_FAILURE, 0, _("misaligned [:upper:] and/or [:lower:] construct")); if (class_s1 == UL_LOWER && class_s2 == UL_UPPER) { + case_convert = true; for (i = 0; i < N_CHARS; i++) if (islower (i)) xlate[i] = toupper (i); } else if (class_s1 == UL_UPPER && class_s2 == UL_LOWER) { + case_convert = true; for (i = 0; i < N_CHARS; i++) if (isupper (i)) xlate[i] = tolower (i); diff --git a/src/bin/coreutils/src/true.c b/src/bin/coreutils/src/true.c index 55490f90ea..80940f07b6 100644 --- a/src/bin/coreutils/src/true.c +++ b/src/bin/coreutils/src/true.c @@ -1,10 +1,10 @@ /* Exit with a status code indicating success. - Copyright (C) 1999-2003, 2005 Free Software Foundation, Inc. + Copyright (C) 1999-2003, 2005, 2007-2008 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ #include #include @@ -31,10 +30,7 @@ # define PROGRAM_NAME "false" #endif -#define AUTHORS "Jim Meyering" - -/* The name this program was run with. */ -char *program_name; +#define AUTHORS proper_name ("Jim Meyering") void usage (int status) @@ -46,12 +42,12 @@ Usage: %s [ignored command line arguments]\n\ program_name, program_name); printf ("%s\n\n", _(EXIT_STATUS == EXIT_SUCCESS - ? "Exit with a status code indicating success." - : "Exit with a status code indicating failure.")); + ? N_("Exit with a status code indicating success.") + : N_("Exit with a status code indicating failure."))); fputs (HELP_OPTION_DESCRIPTION, stdout); fputs (VERSION_OPTION_DESCRIPTION, stdout); printf (USAGE_BUILTIN_WARNING, PROGRAM_NAME); - printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT); + emit_bug_reporting_address (); exit (status); } @@ -59,7 +55,7 @@ int main (int argc, char **argv) { initialize_main (&argc, &argv); - program_name = argv[0]; + set_program_name (argv[0]); setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); @@ -74,7 +70,7 @@ main (int argc, char **argv) usage (EXIT_STATUS); if (STREQ (argv[1], "--version")) - version_etc (stdout, PROGRAM_NAME, GNU_PACKAGE, VERSION, AUTHORS, + version_etc (stdout, PROGRAM_NAME, PACKAGE_NAME, Version, AUTHORS, (char *) NULL); } diff --git a/src/bin/coreutils/src/truncate.c b/src/bin/coreutils/src/truncate.c new file mode 100644 index 0000000000..06fa03a038 --- /dev/null +++ b/src/bin/coreutils/src/truncate.c @@ -0,0 +1,424 @@ +/* truncate -- truncate or extend the length of files. + Copyright (C) 2008 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* Written by Pádraig Brady + + This is backwards compatible with the FreeBSD utility, but is more + flexible wrt the size specifications and the use of long options, + to better fit the "GNU" environment. + + Note if !defined(HAVE_FTRUNCATE) then the --skip-ftruncate configure flag + was specified or we're in a mingw environment. In these cases gnulib + emulation will be used and GNULIB_FTRUNCATE is defined. Note if emulation + can't even be provided ftruncate() will return EIO. */ + +#include /* sets _FILE_OFFSET_BITS=64 etc. */ +#include +#include +#include + +#include "system.h" +#include "error.h" +#include "posixver.h" +#include "quote.h" +#include "xstrtol.h" + +/* The official name of this program (e.g., no `g' prefix). */ +#define PROGRAM_NAME "truncate" + +#define AUTHORS proper_name_utf8 ("Padraig Brady", "P\303\241draig Brady") + +/* (-c) If true, don't create if not already there */ +static bool no_create; + +/* (-o) If true, --size refers to blocks not bytes */ +static bool block_mode; + +/* (-r) Reference file to use size from */ +static char const *ref_file; + +static struct option const longopts[] = +{ + {"no-create", no_argument, NULL, 'c'}, + {"io-blocks", no_argument, NULL, 'o'}, + {"reference", required_argument, NULL, 'r'}, + {"size", required_argument, NULL, 's'}, + {GETOPT_HELP_OPTION_DECL}, + {GETOPT_VERSION_OPTION_DECL}, + {NULL, 0, NULL, 0} +}; + +typedef enum +{ rm_abs = 0, rm_rel, rm_min, rm_max, rm_rdn, rm_rup } rel_mode_t; + +/* Set size to the value of STR, interpreted as a decimal integer, + optionally multiplied by various values. + Return -1 on error, 0 on success. + + This supports dd BLOCK size suffixes + lowercase g,t,m for bsd compat + Note we don't support dd's b=512, c=1, w=2 or 21x512MiB formats. */ +static int +parse_len (char const *str, off_t *size) +{ + enum strtol_error e; + intmax_t tmp_size; + e = xstrtoimax (str, NULL, 10, &tmp_size, "EgGkKmMPtTYZ0"); + if (e == LONGINT_OK + && !(OFF_T_MIN <= tmp_size && tmp_size <= OFF_T_MAX)) + e = LONGINT_OVERFLOW; + + if (e == LONGINT_OK) + { + errno = 0; + *size = tmp_size; + return 0; + } + + errno = (e == LONGINT_OVERFLOW ? EOVERFLOW : 0); + return -1; +} + +void +usage (int status) +{ + if (status != EXIT_SUCCESS) + fprintf (stderr, _("Try `%s --help' for more information.\n"), + program_name); + else + { + printf (_("Usage: %s OPTION... FILE...\n"), program_name); + fputs (_("\ +Shrink or extend the size of each FILE to the specified size\n\ +\n\ +A FILE argument that does not exist is created.\n\ +\n\ +If a FILE is larger than the specified size, the extra data is lost.\n\ +If a FILE is shorter, it is extended and the extended part (hole)\n\ +reads as zero bytes.\n\ +\n\ +"), stdout); + fputs (_("\ +Mandatory arguments to long options are mandatory for short options too.\n\ +"), stdout); + fputs (_("\ + -c, --no-create do not create any files\n\ +"), stdout); + fputs (_("\ + -o, --io-blocks Treat SIZE as number of IO blocks instead of bytes\n\ +"), stdout); + fputs (_("\ + -r, --reference=FILE use this FILE's size\n\ + -s, --size=SIZE use this SIZE\n"), stdout); + fputs (HELP_OPTION_DESCRIPTION, stdout); + fputs (VERSION_OPTION_DESCRIPTION, stdout); + fputs (_("\n\ +SIZE is a number which may be followed by one of the following suffixes:\n\ +KB 1000, K 1024, MB 1000*1000, M 1024*1024, and so on for G, T, P, E, Z, Y.\n\ +"), stdout); + fputs (_("\n\ +SIZE may also be prefixed by one of the following modifying characters:\n\ +`+' extend by, `-' reduce by, `<' at most, `>' at least,\n\ +`/' round down to multiple of, `%' round up to multiple of.\n"), stdout); + fputs (_("\ +\n\ +Note that the -r and -s options are mutually exclusive.\n\ +"), stdout); + emit_bug_reporting_address (); + } + exit (status); +} + +/* return 1 on error, 0 on success */ +static int +do_ftruncate (int fd, char const *fname, off_t ssize, rel_mode_t rel_mode) +{ + struct stat sb; + off_t nsize; + + if ((block_mode || rel_mode) && fstat (fd, &sb) != 0) + { + error (0, errno, _("cannot fstat %s"), quote (fname)); + return 1; + } + if (block_mode) + { + off_t const blksize = ST_BLKSIZE (sb); + if (ssize < OFF_T_MIN / blksize || ssize > OFF_T_MAX / blksize) + { + error (0, 0, + _("overflow in %" PRIdMAX + " * %" PRIdMAX " byte blocks for file %s"), + (intmax_t) ssize, (intmax_t) blksize, + quote (fname)); + return 1; + } + ssize *= blksize; + } + if (rel_mode) + { + uintmax_t const fsize = sb.st_size; + + if (sb.st_size < 0) + { + /* Complain only for a regular file, a directory, + or a shared memory object, as POSIX 1003.1-2004 specifies + ftruncate's behavior only for these file types. */ + if (S_ISREG (sb.st_mode) || S_ISDIR (sb.st_mode) + || S_TYPEISSHM (&sb)) + { + /* overflow is the only reason I can think + this would ever go negative for the above types */ + error (0, 0, _("%s has unusable, apparently negative size"), + quote (fname)); + return 1; + } + return 0; + } + + if (rel_mode == rm_min) + nsize = MAX (fsize, (uintmax_t) ssize); + else if (rel_mode == rm_max) + nsize = MIN (fsize, (uintmax_t) ssize); + else if (rel_mode == rm_rdn) + /* 0..ssize-1 -> 0 */ + nsize = (fsize / ssize) * ssize; + else if (rel_mode == rm_rup) + /* 1..ssize -> ssize */ + { + /* Here ssize>=1 && fsize>=0 */ + uintmax_t const overflow = ((fsize + ssize - 1) / ssize) * ssize; + if (overflow > OFF_T_MAX) + { + error (0, 0, _("overflow rounding up size of file %s"), + quote (fname)); + return 1; + } + nsize = overflow; + } + else + { + if (ssize > OFF_T_MAX - (off_t)fsize) + { + error (0, 0, _("overflow extending size of file %s"), + quote (fname)); + return 1; + } + nsize = fsize + ssize; + } + } + else + nsize = ssize; + if (nsize < 0) + nsize = 0; + + if (ftruncate (fd, nsize) == -1) /* note updates mtime & ctime */ + { + /* Complain only when ftruncate fails on a regular file, a + directory, or a shared memory object, as POSIX 1003.1-2004 + specifies ftruncate's behavior only for these file types. + For example, do not complain when Linux kernel 2.4 ftruncate + fails on /dev/fd0. */ + int const ftruncate_errno = errno; + if (fstat (fd, &sb) != 0) + { + error (0, errno, _("cannot fstat %s"), quote (fname)); + return 1; + } + else if (S_ISREG (sb.st_mode) || S_ISDIR (sb.st_mode) + || S_TYPEISSHM (&sb)) + { + error (0, ftruncate_errno, + _("truncating %s at %" PRIdMAX " bytes"), quote (fname), + (intmax_t) nsize); + return 1; + } + return 0; + } + + return 0; +} + +int +main (int argc, char **argv) +{ + bool got_size = false; + off_t size IF_LINT (= 0); + rel_mode_t rel_mode = rm_abs; + mode_t omode; + int c, errors = 0, fd = -1, oflags; + char const *fname; + + initialize_main (&argc, &argv); + set_program_name (argv[0]); + setlocale (LC_ALL, ""); + bindtextdomain (PACKAGE, LOCALEDIR); + textdomain (PACKAGE); + + atexit (close_stdout); + + while ((c = getopt_long (argc, argv, "cor:s:", longopts, NULL)) != -1) + { + switch (c) + { + case 'c': + no_create = true; + break; + + case 'o': + block_mode = true; + break; + + case 'r': + ref_file = optarg; + break; + + case 's': + /* skip any whitespace */ + while (isspace (*optarg)) + optarg++; + switch (*optarg) + { + case '<': + rel_mode = rm_max; + optarg++; + break; + case '>': + rel_mode = rm_min; + optarg++; + break; + case '/': + rel_mode = rm_rdn; + optarg++; + break; + case '%': + rel_mode = rm_rup; + optarg++; + break; + } + /* skip any whitespace */ + while (isspace (*optarg)) + optarg++; + if (*optarg == '+' || *optarg == '-') + { + if (rel_mode) + { + error (0, 0, _("multiple relative modifiers specified")); + /* Note other combinations are flagged as invalid numbers */ + usage (EXIT_FAILURE); + } + rel_mode = rm_rel; + } + if (parse_len (optarg, &size) == -1) + error (EXIT_FAILURE, errno, _("invalid number %s"), + quote (optarg)); + /* Rounding to multiple of 0 is nonsensical */ + if ((rel_mode == rm_rup || rel_mode == rm_rdn) && size == 0) + error (EXIT_FAILURE, 0, _("division by zero")); + got_size = true; + break; + + case_GETOPT_HELP_CHAR; + + case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS); + + default: + usage (EXIT_FAILURE); + } + } + + argv += optind; + argc -= optind; + + /* must specify either size or reference file */ + if ((ref_file && got_size) || (!ref_file && !got_size)) + { + error (0, 0, _("you must specify one of %s or %s"), + quote_n (0, "--size"), quote_n (1, "--reference")); + usage (EXIT_FAILURE); + } + /* block_mode without size is not valid */ + if (block_mode && !got_size) + { + error (0, 0, _("%s was specified but %s was not"), + quote_n (0, "--io-blocks"), quote_n (1, "--size")); + usage (EXIT_FAILURE); + } + /* must specify at least 1 file */ + if (argc < 1) + { + error (0, 0, _("missing file operand")); + usage (EXIT_FAILURE); + } + + if (ref_file) + { + struct stat sb; + if (stat (ref_file, &sb) != 0) + error (EXIT_FAILURE, errno, _("cannot stat %s"), quote (ref_file)); + size = sb.st_size; + } + + oflags = O_WRONLY | (no_create ? 0 : O_CREAT) | O_NONBLOCK; + omode = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH; + + while ((fname = *argv++) != NULL) + { + if ((fd = open (fname, oflags, omode)) == -1) + { + /* `truncate -s0 -c no-such-file` shouldn't gen error + `truncate -s0 no-such-dir/file` should gen ENOENT error + `truncate -s0 no-such-dir/` should gen EISDIR error + `truncate -s0 .` should gen EISDIR error */ + if (!(no_create && errno == ENOENT)) + { + int const open_errno = errno; + struct stat sb; + if (stat (fname, &sb) == 0) + { + /* Complain only for a regular file, a directory, + or a shared memory object, as POSIX 1003.1-2004 specifies + ftruncate's behavior only for these file types. */ + if (!S_ISREG (sb.st_mode) && !S_ISDIR (sb.st_mode) + && !S_TYPEISSHM (&sb)) + continue; + } + error (0, open_errno, _("cannot open %s for writing"), + quote (fname)); + errors++; + } + continue; + } + + + if (fd != -1) + { + errors += do_ftruncate (fd, fname, size, rel_mode); + if (close (fd) != 0) + { + error (0, errno, _("closing %s"), quote (fname)); + errors++; + } + } + } + + return errors ? EXIT_FAILURE : EXIT_SUCCESS; +} + +/* + * Local variables: + * indent-tabs-mode: nil + * End: + */ diff --git a/src/bin/coreutils/src/tsort.c b/src/bin/coreutils/src/tsort.c index 9393232139..76865b95ff 100644 --- a/src/bin/coreutils/src/tsort.c +++ b/src/bin/coreutils/src/tsort.c @@ -1,10 +1,10 @@ /* tsort - topological sort. - Copyright (C) 1998-2005 Free Software Foundation, Inc. + Copyright (C) 1998-2005, 2007-2008 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Mark Kettenis . */ @@ -37,7 +36,7 @@ /* The official name of this program (e.g., no `g' prefix). */ #define PROGRAM_NAME "tsort" -#define AUTHORS "Mark Kettenis" +#define AUTHORS proper_name ("Mark Kettenis") /* Token delimiters when reading from a file. */ #define DELIM " \t\n" @@ -60,9 +59,6 @@ struct item struct successor *top; }; -/* The name this program was run with. */ -char *program_name; - /* The head of the sorted list. */ static struct item *head = NULL; @@ -91,7 +87,7 @@ With no FILE, or when FILE is -, read standard input.\n\ "), program_name); fputs (HELP_OPTION_DESCRIPTION, stdout); fputs (VERSION_OPTION_DESCRIPTION, stdout); - printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT); + emit_bug_reporting_address (); } exit (status); @@ -487,7 +483,7 @@ tsort (const char *file) struct successor *p = head->top; /* T5. Output front of queue. */ - printf ("%s\n", head->str); + puts (head->str); head->str = NULL; /* Avoid printing the same string twice. */ n_strings--; @@ -535,14 +531,14 @@ main (int argc, char **argv) bool ok; initialize_main (&argc, &argv); - program_name = argv[0]; + set_program_name (argv[0]); setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); atexit (close_stdout); - parse_long_options (argc, argv, PROGRAM_NAME, PACKAGE, VERSION, + parse_long_options (argc, argv, PROGRAM_NAME, PACKAGE, Version, usage, AUTHORS, (char const *) NULL); if (getopt_long (argc, argv, "", NULL, NULL) != -1) usage (EXIT_FAILURE); diff --git a/src/bin/coreutils/src/tty.c b/src/bin/coreutils/src/tty.c index 5228e7aaea..c7b13dcabb 100644 --- a/src/bin/coreutils/src/tty.c +++ b/src/bin/coreutils/src/tty.c @@ -1,10 +1,10 @@ /* tty -- print the name of the terminal connected to standard input - Copyright (C) 1990-2005 Free Software Foundation, Inc. + Copyright (C) 1990-2005, 2008 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Displays "not a tty" if stdin is not a terminal. Displays nothing if -s option is given. @@ -41,10 +40,7 @@ enum /* The official name of this program (e.g., no `g' prefix). */ #define PROGRAM_NAME "tty" -#define AUTHORS "David MacKenzie" - -/* The name under which this program was run. */ -char *program_name; +#define AUTHORS proper_name ("David MacKenzie") /* If true, return an exit status but produce no output. */ static bool silent; @@ -74,7 +70,7 @@ Print the file name of the terminal connected to standard input.\n\ "), stdout); fputs (HELP_OPTION_DESCRIPTION, stdout); fputs (VERSION_OPTION_DESCRIPTION, stdout); - printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT); + emit_bug_reporting_address (); } exit (status); } @@ -86,7 +82,7 @@ main (int argc, char **argv) int optc; initialize_main (&argc, &argv); - program_name = argv[0]; + set_program_name (argv[0]); setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); @@ -125,5 +121,5 @@ main (int argc, char **argv) puts (_("not a tty")); } - exit (isatty (STDIN_FILENO) ? EXIT_SUCCESS : EXIT_FAIL); + exit (isatty (STDIN_FILENO) ? EXIT_SUCCESS : EXIT_FAILURE); } diff --git a/src/bin/coreutils/src/uname-arch.c b/src/bin/coreutils/src/uname-arch.c new file mode 100644 index 0000000000..eb429424e7 --- /dev/null +++ b/src/bin/coreutils/src/uname-arch.c @@ -0,0 +1,2 @@ +#include "uname.h" +int uname_mode = UNAME_ARCH; diff --git a/src/bin/coreutils/src/uname-uname.c b/src/bin/coreutils/src/uname-uname.c new file mode 100644 index 0000000000..450245dcc2 --- /dev/null +++ b/src/bin/coreutils/src/uname-uname.c @@ -0,0 +1,2 @@ +#include "uname.h" +int uname_mode = UNAME_UNAME; diff --git a/src/bin/coreutils/src/uname.c b/src/bin/coreutils/src/uname.c index 0715e07cd6..3870dfa3d0 100644 --- a/src/bin/coreutils/src/uname.c +++ b/src/bin/coreutils/src/uname.c @@ -1,12 +1,12 @@ /* uname -- print system information - Copyright (C) 1989, 1992, 1993, 1996, 1997, 1999, 2000, 2001, 2002, - 2003, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 1989, 1992, 1993, 1996, 1997, 1999-2005, 2007-2008 + Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by David MacKenzie */ @@ -54,11 +53,13 @@ #include "system.h" #include "error.h" #include "quote.h" +#include "uname.h" /* The official name of this program (e.g., no `g' prefix). */ -#define PROGRAM_NAME "uname" +#define PROGRAM_NAME (uname_mode == UNAME_UNAME ? "uname" : "arch") -#define AUTHORS "David MacKenzie" +#define AUTHORS proper_name ("David MacKenzie") +#define ARCH_AUTHORS "David MacKenzie", "Karel Zak" /* Values that are bitwise or'd into `toprint'. */ /* Kernel name. */ @@ -85,10 +86,7 @@ /* Operating system. */ #define PRINT_OPERATING_SYSTEM 128 -/* The name this program was run with, for error messages. */ -char *program_name; - -static struct option const long_options[] = +static struct option const uname_long_options[] = { {"all", no_argument, NULL, 'a'}, {"kernel-name", no_argument, NULL, 's'}, @@ -106,6 +104,13 @@ static struct option const long_options[] = {NULL, 0, NULL, 0} }; +static struct option const arch_long_options[] = +{ + {GETOPT_HELP_OPTION_DECL}, + {GETOPT_VERSION_OPTION_DECL}, + {NULL, 0, NULL, 0} +}; + void usage (int status) { @@ -115,7 +120,10 @@ usage (int status) else { printf (_("Usage: %s [OPTION]...\n"), program_name); - fputs (_("\ + + if (uname_mode == UNAME_UNAME) + { + fputs (_("\ Print certain system information. With no OPTION, same as -s.\n\ \n\ -a, --all print all information, in the following order,\n\ @@ -124,16 +132,25 @@ Print certain system information. With no OPTION, same as -s.\n\ -n, --nodename print the network node hostname\n\ -r, --kernel-release print the kernel release\n\ "), stdout); - fputs (_("\ + fputs (_("\ -v, --kernel-version print the kernel version\n\ -m, --machine print the machine hardware name\n\ -p, --processor print the processor type or \"unknown\"\n\ -i, --hardware-platform print the hardware platform or \"unknown\"\n\ -o, --operating-system print the operating system\n\ "), stdout); + } + else + { + fputs (_("\ +Print machine architecture.\n\ +\n\ +"), stdout); + } + fputs (HELP_OPTION_DESCRIPTION, stdout); fputs (VERSION_OPTION_DESCRIPTION, stdout); - printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT); + emit_bug_reporting_address (); } exit (status); } @@ -151,69 +168,83 @@ print_element (char const *element) fputs (element, stdout); } -int -main (int argc, char **argv) + +/* Set all the option flags according to the switches specified. + Return the mask indicating which elements to print. */ + +static int +decode_switches (int argc, char **argv) { int c; - static char const unknown[] = "unknown"; - - /* Mask indicating which elements to print. */ unsigned int toprint = 0; - initialize_main (&argc, &argv); - program_name = argv[0]; - setlocale (LC_ALL, ""); - bindtextdomain (PACKAGE, LOCALEDIR); - textdomain (PACKAGE); - - atexit (close_stdout); - - while ((c = getopt_long (argc, argv, "asnrvmpio", long_options, NULL)) != -1) + if (uname_mode == UNAME_ARCH) { - switch (c) + while ((c = getopt_long (argc, argv, "", + arch_long_options, NULL)) != -1) { - case 'a': - toprint = UINT_MAX; - break; + switch (c) + { + case_GETOPT_HELP_CHAR; - case 's': - toprint |= PRINT_KERNEL_NAME; - break; + case_GETOPT_VERSION_CHAR (PROGRAM_NAME, ARCH_AUTHORS); - case 'n': - toprint |= PRINT_NODENAME; - break; + default: + usage (EXIT_FAILURE); + } + } + toprint = PRINT_MACHINE; + } + else + { + while ((c = getopt_long (argc, argv, "asnrvmpio", + uname_long_options, NULL)) != -1) + { + switch (c) + { + case 'a': + toprint = UINT_MAX; + break; - case 'r': - toprint |= PRINT_KERNEL_RELEASE; - break; + case 's': + toprint |= PRINT_KERNEL_NAME; + break; - case 'v': - toprint |= PRINT_KERNEL_VERSION; - break; + case 'n': + toprint |= PRINT_NODENAME; + break; - case 'm': - toprint |= PRINT_MACHINE; - break; + case 'r': + toprint |= PRINT_KERNEL_RELEASE; + break; - case 'p': - toprint |= PRINT_PROCESSOR; - break; + case 'v': + toprint |= PRINT_KERNEL_VERSION; + break; - case 'i': - toprint |= PRINT_HARDWARE_PLATFORM; - break; + case 'm': + toprint |= PRINT_MACHINE; + break; - case 'o': - toprint |= PRINT_OPERATING_SYSTEM; - break; + case 'p': + toprint |= PRINT_PROCESSOR; + break; - case_GETOPT_HELP_CHAR; + case 'i': + toprint |= PRINT_HARDWARE_PLATFORM; + break; - case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS); + case 'o': + toprint |= PRINT_OPERATING_SYSTEM; + break; - default: - usage (EXIT_FAILURE); + case_GETOPT_HELP_CHAR; + + case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS); + + default: + usage (EXIT_FAILURE); + } } } @@ -223,6 +254,27 @@ main (int argc, char **argv) usage (EXIT_FAILURE); } + return toprint; +} + +int +main (int argc, char **argv) +{ + static char const unknown[] = "unknown"; + + /* Mask indicating which elements to print. */ + unsigned int toprint = 0; + + initialize_main (&argc, &argv); + set_program_name (argv[0]); + setlocale (LC_ALL, ""); + bindtextdomain (PACKAGE, LOCALEDIR); + textdomain (PACKAGE); + + atexit (close_stdout); + + toprint = decode_switches (argc, argv); + if (toprint == 0) toprint = PRINT_KERNEL_NAME; diff --git a/src/bin/coreutils/src/uname.h b/src/bin/coreutils/src/uname.h new file mode 100644 index 0000000000..2f4a872423 --- /dev/null +++ b/src/bin/coreutils/src/uname.h @@ -0,0 +1,7 @@ +/* This is for the `uname' program. */ +#define UNAME_UNAME 1 + +/* This is for the `arch' program. */ +#define UNAME_ARCH 2 + +extern int uname_mode; diff --git a/src/bin/coreutils/src/unexpand.c b/src/bin/coreutils/src/unexpand.c index cbceca0f4a..9f6a6d7a21 100644 --- a/src/bin/coreutils/src/unexpand.c +++ b/src/bin/coreutils/src/unexpand.c @@ -1,10 +1,10 @@ /* unexpand - convert blanks to tabs - Copyright (C) 89, 91, 1995-2006 Free Software Foundation, Inc. + Copyright (C) 89, 91, 1995-2006, 2008-2009 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* By default, convert only maximal strings of initial blanks and tabs into tabs. @@ -47,14 +46,7 @@ /* The official name of this program (e.g., no `g' prefix). */ #define PROGRAM_NAME "unexpand" -#define AUTHORS "David MacKenzie" - -/* The number of bytes added at a time to the amount of memory - allocated for the output line. */ -#define OUTPUT_BLOCK 256 - -/* The name this program was run with. */ -char *program_name; +#define AUTHORS proper_name ("David MacKenzie") /* If true, convert blanks even after nonblank characters have been read on the line. */ @@ -84,7 +76,7 @@ static char **file_list; /* Default for `file_list' if no files are given on the command line. */ static char *stdin_argv[] = { - "-", NULL + (char *) "-", NULL }; /* True if we have ever read standard input. */ @@ -138,7 +130,7 @@ Mandatory arguments to long options are mandatory for short options too.\n\ "), stdout); fputs (HELP_OPTION_DESCRIPTION, stdout); fputs (VERSION_OPTION_DESCRIPTION, stdout); - printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT); + emit_bug_reporting_address (); } exit (status); } @@ -465,7 +457,7 @@ main (int argc, char **argv) bool convert_first_only = false; initialize_main (&argc, &argv); - program_name = argv[0]; + set_program_name (argv[0]); setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); diff --git a/src/bin/coreutils/src/uniq.c b/src/bin/coreutils/src/uniq.c index 6c38ed8077..249b24ab32 100644 --- a/src/bin/coreutils/src/uniq.c +++ b/src/bin/coreutils/src/uniq.c @@ -1,10 +1,10 @@ /* uniq -- remove duplicate lines from a sorted file - Copyright (C) 86, 91, 1995-2006 Free Software Foundation, Inc. + Copyright (C) 86, 91, 1995-2008 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,10 +12,9 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ -/* Written by Richard Stallman and David MacKenzie. */ +/* Written by Richard M. Stallman and David MacKenzie. */ #include @@ -27,7 +26,6 @@ #include "argmatch.h" #include "linebuffer.h" #include "error.h" -#include "hard-locale.h" #include "posixver.h" #include "quote.h" #include "xmemcoll.h" @@ -37,7 +35,9 @@ /* The official name of this program (e.g., no `g' prefix). */ #define PROGRAM_NAME "uniq" -#define AUTHORS "Richard Stallman", "David MacKenzie" +#define AUTHORS \ + proper_name ("Richard M. Stallman"), \ + proper_name ("David MacKenzie") #define SWAP_LINES(A, B) \ do \ @@ -49,9 +49,6 @@ } \ while (0) -/* The name this program was run with. */ -char *program_name; - /* True if the LC_COLLATE locale is hard. */ static bool hard_LC_COLLATE; @@ -119,6 +116,7 @@ static struct option const longopts[] = {"skip-fields", required_argument, NULL, 'f'}, {"skip-chars", required_argument, NULL, 's'}, {"check-chars", required_argument, NULL, 'w'}, + {"zero-terminated", no_argument, NULL, 'z'}, {GETOPT_HELP_OPTION_DECL}, {GETOPT_VERSION_OPTION_DECL}, {NULL, 0, NULL, 0} @@ -137,8 +135,10 @@ Usage: %s [OPTION]... [INPUT [OUTPUT]]\n\ "), program_name); fputs (_("\ -Discard all but one of successive identical lines from INPUT (or\n\ -standard input), writing to OUTPUT (or standard output).\n\ +Filter adjacent matching lines from INPUT (or standard input),\n\ +writing to OUTPUT (or standard output).\n\ +\n\ +With no options, matching lines are merged to the first occurrence.\n\ \n\ "), stdout); fputs (_("\ @@ -156,6 +156,7 @@ Mandatory arguments to long options are mandatory for short options too.\n\ -i, --ignore-case ignore differences in case when comparing\n\ -s, --skip-chars=N avoid comparing the first N characters\n\ -u, --unique only print unique lines\n\ + -z, --zero-terminated end lines with 0 byte, not newline\n\ "), stdout); fputs (_("\ -w, --check-chars=N compare no more than N characters in lines\n\ @@ -164,10 +165,16 @@ Mandatory arguments to long options are mandatory for short options too.\n\ fputs (VERSION_OPTION_DESCRIPTION, stdout); fputs (_("\ \n\ -A field is a run of whitespace, then non-whitespace characters.\n\ -Fields are skipped before chars.\n\ +A field is a run of blanks (usually spaces and/or TABs), then non-blank\n\ +characters. Fields are skipped before chars.\n\ "), stdout); - printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT); + fputs (_("\ +\n\ +Note: 'uniq' does not detect repeated lines unless they are adjacent.\n\ +You may want to sort the input first, or use `sort -u' without `uniq'.\n\ +Also, comparisons honor the rules specified by `LC_COLLATE'.\n\ +"), stdout); + emit_bug_reporting_address (); } exit (status); } @@ -198,25 +205,25 @@ size_opt (char const *opt, char const *msgid) return a pointer to the beginning of the line's field to be compared. */ static char * -find_field (const struct linebuffer *line) +find_field (struct linebuffer const *line) { size_t count; - char *lp = line->buffer; + char const *lp = line->buffer; size_t size = line->length - 1; size_t i = 0; - for (count = 0; count < skip_fields && i < size; count++) + for (count = 0; count < skip_fields; count++) { - while (i < size && isblank (lp[i])) + while (i < size && isblank (to_uchar (lp[i]))) i++; - while (i < size && !isblank (lp[i])) + while (i < size && !isblank (to_uchar (lp[i]))) i++; } for (count = 0; count < skip_chars && i < size; count++) i++; - return lp + i; + return line->buffer + i; } /* Return false if two strings OLD and NEW match, true if not. @@ -268,7 +275,7 @@ writeline (struct linebuffer const *line, If either is "-", use the standard I/O stream for it instead. */ static void -check_file (const char *infile, const char *outfile) +check_file (const char *infile, const char *outfile, char delimiter) { struct linebuffer lb1, lb2; struct linebuffer *thisline, *prevline; @@ -300,7 +307,7 @@ check_file (const char *infile, const char *outfile) { char *thisfield; size_t thislen; - if (readlinebuffer (thisline, stdin) == 0) + if (readlinebuffer_delim (thisline, stdin, delimiter) == 0) break; thisfield = find_field (thisline); thislen = thisline->length - 1 - (thisfield - thisline->buffer); @@ -323,7 +330,7 @@ check_file (const char *infile, const char *outfile) uintmax_t match_count = 0; bool first_delimiter = true; - if (readlinebuffer (prevline, stdin) == 0) + if (readlinebuffer_delim (prevline, stdin, delimiter) == 0) goto closefiles; prevfield = find_field (prevline); prevlen = prevline->length - 1 - (prevfield - prevline->buffer); @@ -333,7 +340,7 @@ check_file (const char *infile, const char *outfile) bool match; char *thisfield; size_t thislen; - if (readlinebuffer (thisline, stdin) == 0) + if (readlinebuffer_delim (thisline, stdin, delimiter) == 0) { if (ferror (stdin)) goto closefiles; @@ -363,7 +370,7 @@ check_file (const char *infile, const char *outfile) if ((delimit_groups == DM_PREPEND) || (delimit_groups == DM_SEPARATE && !first_delimiter)) - putchar ('\n'); + putchar (delimiter); } } @@ -406,10 +413,11 @@ main (int argc, char **argv) enum Skip_field_option_type skip_field_option_type = SFO_NONE; int nfiles = 0; char const *file[2]; + char delimiter = '\n'; /* change with --zero-terminated, -z */ file[0] = file[1] = "-"; initialize_main (&argc, &argv); - program_name = argv[0]; + set_program_name (argv[0]); setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); @@ -434,7 +442,7 @@ main (int argc, char **argv) if (optc == -1 || (posixly_correct && nfiles != 0) || ((optc = getopt_long (argc, argv, - "-0123456789Dcdf:is:uw:", longopts, NULL)) + "-0123456789Dcdf:is:uw:z", longopts, NULL)) == -1)) { if (argc <= optind) @@ -530,6 +538,10 @@ main (int argc, char **argv) N_("invalid number of bytes to compare")); break; + case 'z': + delimiter = '\0'; + break; + case_GETOPT_HELP_CHAR; case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS); @@ -546,7 +558,7 @@ main (int argc, char **argv) usage (EXIT_FAILURE); } - check_file (file[0], file[1]); + check_file (file[0], file[1], delimiter); exit (EXIT_SUCCESS); } diff --git a/src/bin/coreutils/src/unlink.c b/src/bin/coreutils/src/unlink.c index 7255076493..1b999d1d60 100644 --- a/src/bin/coreutils/src/unlink.c +++ b/src/bin/coreutils/src/unlink.c @@ -1,10 +1,10 @@ /* unlink utility for GNU. - Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc. + Copyright (C) 2001, 2002, 2004, 2007-2008 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Michael Stone */ @@ -34,10 +33,7 @@ /* The official name of this program (e.g., no `g' prefix). */ #define PROGRAM_NAME "unlink" -#define AUTHORS "Michael Stone" - -/* Name this program was run with. */ -char *program_name; +#define AUTHORS proper_name ("Michael Stone") void usage (int status) @@ -54,7 +50,7 @@ Usage: %s FILE\n\ stdout); fputs (HELP_OPTION_DESCRIPTION, stdout); fputs (VERSION_OPTION_DESCRIPTION, stdout); - printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT); + emit_bug_reporting_address (); } exit (status); } @@ -63,14 +59,14 @@ int main (int argc, char **argv) { initialize_main (&argc, &argv); - program_name = argv[0]; + set_program_name (argv[0]); setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); atexit (close_stdout); - parse_long_options (argc, argv, PROGRAM_NAME, GNU_PACKAGE, VERSION, + parse_long_options (argc, argv, PROGRAM_NAME, PACKAGE_NAME, Version, usage, AUTHORS, (char const *) NULL); if (getopt_long (argc, argv, "", NULL, NULL) != -1) usage (EXIT_FAILURE); diff --git a/src/bin/coreutils/src/uptime.c b/src/bin/coreutils/src/uptime.c index 6b2a7240a4..95fea4b91b 100644 --- a/src/bin/coreutils/src/uptime.c +++ b/src/bin/coreutils/src/uptime.c @@ -1,10 +1,10 @@ /* GNU's uptime. - Copyright (C) 1992-2002, 2004, 2005, 2006 Free Software Foundation, Inc. + Copyright (C) 1992-2002, 2004-2008 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Created by hacking who.c by Kaveh Ghazi ghazi@caip.rutgers.edu. */ @@ -37,16 +36,15 @@ #include "long-options.h" #include "quote.h" #include "readutmp.h" +#include "fprintftime.h" /* The official name of this program (e.g., no `g' prefix). */ #define PROGRAM_NAME "uptime" -#define AUTHORS "Joseph Arceneaux", "David MacKenzie", "Kaveh Ghazi" - -int getloadavg (); - -/* The name this program was run with. */ -char *program_name; +#define AUTHORS \ + proper_name ("Joseph Arceneaux"), \ + proper_name ("David MacKenzie"), \ + proper_name ("Kaveh Ghazi") static void print_uptime (size_t n, const STRUCT_UTMP *this) @@ -127,22 +125,24 @@ print_uptime (size_t n, const STRUCT_UTMP *this) uphours = (uptime - (updays * 86400)) / 3600; upmins = (uptime - (updays * 86400) - (uphours * 3600)) / 60; tmn = localtime (&time_now); + /* procps' version of uptime also prints the seconds field, but + previous versions of coreutils don't. */ if (tmn) - printf (_(" %2d:%02d%s up "), - ((tmn->tm_hour % 12) == 0 ? 12 : tmn->tm_hour % 12), - /* FIXME: use strftime, not am, pm. Uli reports that - the german translation is meaningless. */ - tmn->tm_min, (tmn->tm_hour < 12 ? _("am") : _("pm"))); + /* TRANSLATORS: This prints the current clock time. */ + fprintftime (stdout, _(" %H:%M%P "), tmn, 0, 0); else - printf (_(" ??:???? up ")); + printf (_(" ??:???? ")); if (uptime == (time_t) -1) - printf (_("???? days ??:??, ")); + printf (_("up ???? days ??:??, ")); else { if (0 < updays) - printf (ngettext ("%ld day", "%ld days", select_plural (updays)), - updays); - printf (" %2d:%02d, ", uphours, upmins); + printf (ngettext ("up %ld day %2d:%02d, ", + "up %ld days %2d:%02d, ", + select_plural (updays)), + updays, uphours, upmins); + else + printf ("up %2d:%02d, ", uphours, upmins); } printf (ngettext ("%lu user", "%lu users", entries), (unsigned long int) entries); @@ -194,18 +194,29 @@ usage (int status) program_name); else { - printf (_("Usage: %s [OPTION]... [ FILE ]\n"), program_name); + printf (_("Usage: %s [OPTION]... [FILE]\n"), program_name); printf (_("\ Print the current time, the length of time the system has been up,\n\ the number of users on the system, and the average number of jobs\n\ -in the run queue over the last 1, 5 and 15 minutes.\n\ +in the run queue over the last 1, 5 and 15 minutes.")); +#ifdef __linux__ + /* It would be better to introduce a configure test for this, + but such a test is hard to write. For the moment then, we + have a hack which depends on the preprocessor used at compile + time to tell us what the running kernel is. Ugh. */ + printf(_(" \ +Processes in\n\ +an uninterruptible sleep state also contribute to the load average.\n")); +#else + printf(_("\n")); +#endif + printf (_("\ If FILE is not specified, use %s. %s as FILE is common.\n\ -\n\ -"), +\n"), UTMP_FILE, WTMP_FILE); fputs (HELP_OPTION_DESCRIPTION, stdout); fputs (VERSION_OPTION_DESCRIPTION, stdout); - printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT); + emit_bug_reporting_address (); } exit (status); } @@ -214,14 +225,14 @@ int main (int argc, char **argv) { initialize_main (&argc, &argv); - program_name = argv[0]; + set_program_name (argv[0]); setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); atexit (close_stdout); - parse_long_options (argc, argv, PROGRAM_NAME, GNU_PACKAGE, VERSION, + parse_long_options (argc, argv, PROGRAM_NAME, PACKAGE_NAME, Version, usage, AUTHORS, (char const *) NULL); if (getopt_long (argc, argv, "", NULL, NULL) != -1) usage (EXIT_FAILURE); diff --git a/src/bin/coreutils/src/users.c b/src/bin/coreutils/src/users.c index dba4701137..c10dac67d7 100644 --- a/src/bin/coreutils/src/users.c +++ b/src/bin/coreutils/src/users.c @@ -1,10 +1,10 @@ /* GNU's users. - Copyright (C) 1992-2005 Free Software Foundation, Inc. + Copyright (C) 1992-2005, 2007-2008 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by jla; revised by djm */ @@ -32,10 +31,9 @@ /* The official name of this program (e.g., no `g' prefix). */ #define PROGRAM_NAME "users" -#define AUTHORS "Joseph Arceneaux", "David MacKenzie" - -/* The name this program was run with. */ -char *program_name; +#define AUTHORS \ + proper_name ("Joseph Arceneaux"), \ + proper_name ("David MacKenzie") static int userid_compare (const void *v_a, const void *v_b) @@ -105,7 +103,7 @@ usage (int status) program_name); else { - printf (_("Usage: %s [OPTION]... [ FILE ]\n"), program_name); + printf (_("Usage: %s [OPTION]... [FILE]\n"), program_name); printf (_("\ Output who is currently logged in according to FILE.\n\ If FILE is not specified, use %s. %s as FILE is common.\n\ @@ -114,7 +112,7 @@ If FILE is not specified, use %s. %s as FILE is common.\n\ UTMP_FILE, WTMP_FILE); fputs (HELP_OPTION_DESCRIPTION, stdout); fputs (VERSION_OPTION_DESCRIPTION, stdout); - printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT); + emit_bug_reporting_address (); } exit (status); } @@ -123,14 +121,14 @@ int main (int argc, char **argv) { initialize_main (&argc, &argv); - program_name = argv[0]; + set_program_name (argv[0]); setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); atexit (close_stdout); - parse_long_options (argc, argv, PROGRAM_NAME, GNU_PACKAGE, VERSION, + parse_long_options (argc, argv, PROGRAM_NAME, PACKAGE_NAME, Version, usage, AUTHORS, (char const *) NULL); if (getopt_long (argc, argv, "", NULL, NULL) != -1) usage (EXIT_FAILURE); diff --git a/src/bin/coreutils/src/wc.c b/src/bin/coreutils/src/wc.c index 332f32dc4a..780ff234ca 100644 --- a/src/bin/coreutils/src/wc.c +++ b/src/bin/coreutils/src/wc.c @@ -1,10 +1,10 @@ /* wc - print the number of lines, words, and bytes in files - Copyright (C) 85, 91, 1995-2006 Free Software Foundation, Inc. + Copyright (C) 85, 91, 1995-2009 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Paul Rubin, phr@ocf.berkeley.edu and David MacKenzie, djm@gnu.ai.mit.edu. */ @@ -21,16 +20,22 @@ #include #include +#include #include #include +#include +#include #include "system.h" +#include "argv-iter.h" #include "error.h" -#include "inttostr.h" +#include "mbchar.h" +#include "physmem.h" #include "quote.h" +#include "quotearg.h" #include "readtokens0.h" #include "safe-read.h" -#include "wcwidth.h" +#include "xfreopen.h" #if !defined iswspace && !HAVE_ISWSPACE # define iswspace(wc) \ @@ -40,14 +45,13 @@ /* The official name of this program (e.g., no `g' prefix). */ #define PROGRAM_NAME "wc" -#define AUTHORS "Paul Rubin", "David MacKenzie" +#define AUTHORS \ + proper_name ("Paul Rubin"), \ + proper_name ("David MacKenzie") /* Size of atomic reads. */ #define BUFFER_SIZE (16 * 1024) -/* The name this program was run with. */ -char *program_name; - /* Cumulative number of lines, words, chars and bytes in all files so far. max_line_length is the maximum over all files processed so far. */ static uintmax_t total_lines; @@ -120,13 +124,14 @@ read standard input.\n\ "), stdout); fputs (_("\ --files0-from=F read input from the files specified by\n\ - NUL-terminated names in file F\n\ + NUL-terminated names in file F;\n\ + If F is - then read names from standard input\n\ -L, --max-line-length print the length of the longest line\n\ -w, --words print the word counts\n\ "), stdout); fputs (HELP_OPTION_DESCRIPTION, stdout); fputs (VERSION_OPTION_DESCRIPTION, stdout); - printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT); + emit_bug_reporting_address (); } exit (status); } @@ -191,7 +196,7 @@ wc (int fd, char const *file_x, struct fstatus *fstatus) /* If in the current locale, chars are equivalent to bytes, we prefer counting bytes, because that's easier. */ -#if HAVE_MBRTOWC && (MB_LEN_MAX > 1) +#if MB_LEN_MAX > 1 if (MB_CUR_MAX > 1) { count_bytes = print_bytes; @@ -244,7 +249,7 @@ wc (int fd, char const *file_x, struct fstatus *fstatus) } } } - else if (!count_chars & !count_complicated) + else if (!count_chars && !count_complicated) { /* Use a separate loop when counting only lines or lines and bytes -- but not chars or words. */ @@ -267,15 +272,14 @@ wc (int fd, char const *file_x, struct fstatus *fstatus) bytes += bytes_read; } } -#if HAVE_MBRTOWC && (MB_LEN_MAX > 1) +#if MB_LEN_MAX > 1 # define SUPPORT_OLD_MBRTOWC 1 else if (MB_CUR_MAX > 1) { bool in_word = false; uintmax_t linepos = 0; - mbstate_t state = { 0, }; - uintmax_t last_error_line = 0; - int last_error_errno = 0; + DECLARE_ZEROED_AGGREGATE (mbstate_t, state); + bool in_shift = false; # if SUPPORT_OLD_MBRTOWC /* Back-up the state before each multibyte character conversion and move the last incomplete character of the buffer to the front @@ -310,77 +314,81 @@ wc (int fd, char const *file_x, struct fstatus *fstatus) wchar_t wide_char; size_t n; -# if SUPPORT_OLD_MBRTOWC - backup_state = state; -# endif - n = mbrtowc (&wide_char, p, bytes_read, &state); - if (n == (size_t) -2) + if (!in_shift && is_basic (*p)) { -# if SUPPORT_OLD_MBRTOWC - state = backup_state; -# endif - break; - } - if (n == (size_t) -1) - { - /* Signal repeated errors only once per line. */ - if (!(lines + 1 == last_error_line - && errno == last_error_errno)) - { - char line_number_buf[INT_BUFSIZE_BOUND (uintmax_t)]; - last_error_line = lines + 1; - last_error_errno = errno; - error (0, errno, "%s:%s", file, - umaxtostr (last_error_line, line_number_buf)); - ok = false; - } - p++; - bytes_read--; + /* Handle most ASCII characters quickly, without calling + mbrtowc(). */ + n = 1; + wide_char = *p; } else { + in_shift = true; +# if SUPPORT_OLD_MBRTOWC + backup_state = state; +# endif + n = mbrtowc (&wide_char, p, bytes_read, &state); + if (n == (size_t) -2) + { +# if SUPPORT_OLD_MBRTOWC + state = backup_state; +# endif + break; + } + if (n == (size_t) -1) + { + /* Remember that we read a byte, but don't complain + about the error. Because of the decoding error, + this is a considered to be byte but not a + character (that is, chars is not incremented). */ + p++; + bytes_read--; + continue; + } + if (mbsinit (&state)) + in_shift = false; if (n == 0) { wide_char = 0; n = 1; } - p += n; - bytes_read -= n; - chars++; - switch (wide_char) + } + p += n; + bytes_read -= n; + chars++; + switch (wide_char) + { + case '\n': + lines++; + /* Fall through. */ + case '\r': + case '\f': + if (linepos > linelength) + linelength = linepos; + linepos = 0; + goto mb_word_separator; + case '\t': + linepos += 8 - (linepos % 8); + goto mb_word_separator; + case ' ': + linepos++; + /* Fall through. */ + case '\v': + mb_word_separator: + words += in_word; + in_word = false; + break; + default: + if (iswprint (wide_char)) { - case '\n': - lines++; - /* Fall through. */ - case '\r': - case '\f': - if (linepos > linelength) - linelength = linepos; - linepos = 0; - goto mb_word_separator; - case '\t': - linepos += 8 - (linepos % 8); - goto mb_word_separator; - case ' ': - linepos++; - /* Fall through. */ - case '\v': - mb_word_separator: - words += in_word; - in_word = false; - break; - default: - if (iswprint (wide_char)) - { - int width = wcwidth (wide_char); - if (width > 0) - linepos += width; - if (iswspace (wide_char)) - goto mb_word_separator; - in_word = true; - } - break; + int width = wcwidth (wide_char); + if (width > 0) + linepos += width; + if (iswspace (wide_char)) + goto mb_word_separator; + in_word = true; } + break; } } while (bytes_read > 0); @@ -483,7 +491,7 @@ wc_file (char const *file, struct fstatus *fstatus) { have_read_stdin = true; if (O_BINARY && ! isatty (STDIN_FILENO)) - freopen (NULL, "rb", stdin); + xfreopen (NULL, "rb", stdin); return wc (STDIN_FILENO, file, fstatus); } else @@ -510,17 +518,19 @@ wc_file (char const *file, struct fstatus *fstatus) /* Return the file status for the NFILES files addressed by FILE. Optimize the case where only one number is printed, for just one file; in that case we can use a print width of 1, so we don't need - to stat the file. */ + to stat the file. Handle the case of (nfiles == 0) in the same way; + that happens when we don't know how long the list of file names will be. */ static struct fstatus * -get_input_fstatus (int nfiles, char * const *file) +get_input_fstatus (int nfiles, char *const *file) { - struct fstatus *fstatus = xnmalloc (nfiles, sizeof *fstatus); + struct fstatus *fstatus = xnmalloc (nfiles ? nfiles : 1, sizeof *fstatus); - if (nfiles == 1 - && ((print_lines + print_words + print_chars - + print_bytes + print_linelength) - == 1)) + if (nfiles == 0 + || (nfiles == 1 + && ((print_lines + print_words + print_chars + + print_bytes + print_linelength) + == 1))) fstatus[0].failed = 1; else { @@ -572,7 +582,6 @@ compute_number_width (int nfiles, struct fstatus const *fstatus) int main (int argc, char **argv) { - int i; bool ok; int optc; int nfiles; @@ -580,9 +589,12 @@ main (int argc, char **argv) char *files_from = NULL; struct fstatus *fstatus; struct Tokens tok; + bool read_tokens = false; + struct argv_iterator *ai; + int i; initialize_main (&argc, &argv); - program_name = argv[0]; + set_program_name (argv[0]); setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); @@ -635,6 +647,7 @@ main (int argc, char **argv) if (files_from) { FILE *stream; + struct stat st; /* When using --files0-from=F, you may not specify any files on the command-line. */ @@ -642,7 +655,7 @@ main (int argc, char **argv) { error (0, 0, _("extra operand %s"), quote (argv[optind])); fprintf (stderr, "%s\n", - _("File operands cannot be combined with --files0-from.")); + _("file operands cannot be combined with --files0-from")); usage (EXIT_FAILURE); } @@ -656,45 +669,112 @@ main (int argc, char **argv) quote (files_from)); } - readtokens0_init (&tok); - - if (! readtokens0 (stream, &tok) || fclose (stream) != 0) - error (EXIT_FAILURE, 0, _("cannot read file names from %s"), - quote (files_from)); - - files = tok.tok; - nfiles = tok.n_tok; + /* Read the file list into RAM if we can detect its size and that + size is reasonable. Otherwise, we'll read a name at a time. */ + if (fstat (fileno (stream), &st) == 0 + && S_ISREG (st.st_mode) + && st.st_size <= MIN (10 * 1024 * 1024, physmem_available () / 2)) + { + read_tokens = true; + readtokens0_init (&tok); + if (! readtokens0 (stream, &tok) || fclose (stream) != 0) + error (EXIT_FAILURE, 0, _("cannot read file names from %s"), + quote (files_from)); + files = tok.tok; + nfiles = tok.n_tok; + ai = argv_iter_init_argv (files); + } + else + { + files = NULL; + nfiles = 0; + ai = argv_iter_init_stream (stream); + } } else { - static char *stdin_only[2]; + static char *stdin_only[] = { NULL }; files = (optind < argc ? argv + optind : stdin_only); nfiles = (optind < argc ? argc - optind : 1); - stdin_only[0] = NULL; + ai = argv_iter_init_argv (files); } fstatus = get_input_fstatus (nfiles, files); number_width = compute_number_width (nfiles, fstatus); ok = true; - for (i = 0; i < nfiles; i++) + for (i = 0; /* */; i++) { - if (files_from && STREQ (files_from, "-") && STREQ (files[i], "-")) + bool skip_file = false; + enum argv_iter_err ai_err; + char *file_name = argv_iter (ai, &ai_err); + if (ai_err == AI_ERR_EOF) + break; + if (!file_name) { - ok = false; - error (0, 0, - _("when reading file names from stdin, " - "no file name of %s allowed"), - quote ("-")); - continue; + switch (ai_err) + { + case AI_ERR_READ: + error (0, errno, _("%s: read error"), quote (files_from)); + skip_file = true; + continue; + case AI_ERR_MEM: + xalloc_die (); + default: + assert (!"unexpected error code from argv_iter"); + } } - ok &= wc_file (files[i], &fstatus[i]); + if (files_from && STREQ (files_from, "-") && STREQ (file_name, "-")) + { + /* Give a better diagnostic in an unusual case: + printf - | wc --files0-from=- */ + error (0, 0, _("when reading file names from stdin, " + "no file name of %s allowed"), + quote (file_name)); + skip_file = true; + } + + if (!file_name[0]) + { + /* Diagnose a zero-length file name. When it's one + among many, knowing the record number may help. + FIXME: currently print the record number only with + --files0-from=FILE. Maybe do it for argv, too? */ + if (files_from == NULL) + error (0, 0, "%s", _("invalid zero-length file name")); + else + { + /* Using the standard `filename:line-number:' prefix here is + not totally appropriate, since NUL is the separator, not NL, + but it might be better than nothing. */ + unsigned long int file_number = argv_iter_n_args (ai); + error (0, 0, "%s:%lu: %s", quotearg_colon (files_from), + file_number, _("invalid zero-length file name")); + } + skip_file = true; + } + + if (skip_file) + ok = false; + else + ok &= wc_file (file_name, &fstatus[nfiles ? i : 0]); } - if (1 < nfiles) + /* No arguments on the command line is fine. That means read from stdin. + However, no arguments on the --files0-from input stream is an error + means don't read anything. */ + if (ok && !files_from && argv_iter_n_args (ai) == 0) + ok &= wc_file (NULL, &fstatus[0]); + + if (read_tokens) + readtokens0_free (&tok); + + if (1 < argv_iter_n_args (ai)) write_counts (total_lines, total_words, total_chars, total_bytes, max_line_length, _("total")); + argv_iter_free (ai); + free (fstatus); if (have_read_stdin && close (STDIN_FILENO) != 0) diff --git a/src/bin/coreutils/src/wheel-gen.pl b/src/bin/coreutils/src/wheel-gen.pl index a22583008e..7ed18a6534 100755 --- a/src/bin/coreutils/src/wheel-gen.pl +++ b/src/bin/coreutils/src/wheel-gen.pl @@ -3,10 +3,10 @@ # Copyright (C) 2001, 2005 Free Software Foundation, Inc. -# This program is free software; you can redistribute it and/or modify +# This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ # GNU General Public License for more details. # You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# along with this program. If not, see . eval 'exec /usr/bin/perl -S $0 ${1+"$@"}' if 0; diff --git a/src/bin/coreutils/src/who.c b/src/bin/coreutils/src/who.c index db3af6e185..692b661b31 100644 --- a/src/bin/coreutils/src/who.c +++ b/src/bin/coreutils/src/who.c @@ -1,10 +1,10 @@ /* GNU's who. - Copyright (C) 1992-2006 Free Software Foundation, Inc. + Copyright (C) 1992-2008 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by jla; revised by djm; revised again by mstone */ @@ -31,18 +30,19 @@ #include #include "system.h" +#include "c-ctype.h" #include "canon-host.h" #include "readutmp.h" #include "error.h" -#include "hard-locale.h" -#include "inttostr.h" #include "quote.h" -#include "vasprintf.h" /* The official name of this program (e.g., no `g' prefix). */ #define PROGRAM_NAME "who" -#define AUTHORS "Joseph Arceneaux", "David MacKenzie", "Michael Stone" +#define AUTHORS \ + proper_name ("Joseph Arceneaux"), \ + proper_name ("David MacKenzie"), \ + proper_name ("Michael Stone") #ifndef MAXHOSTNAMELEN # define MAXHOSTNAMELEN 64 @@ -95,10 +95,7 @@ # define UT_ID(U) "??" #endif -char *ttyname (); - -/* The name this program was run with. */ -char *program_name; +char *ttyname (int); /* If true, attempt to canonicalize hostnames via a DNS lookup. */ static bool do_lookup; @@ -161,13 +158,13 @@ enum LOOKUP_OPTION = CHAR_MAX + 1 }; -static struct option const longopts[] = { +static struct option const longopts[] = +{ {"all", no_argument, NULL, 'a'}, {"boot", no_argument, NULL, 'b'}, {"count", no_argument, NULL, 'q'}, {"dead", no_argument, NULL, 'd'}, {"heading", no_argument, NULL, 'H'}, - {"idle", no_argument, NULL, 'i'}, /* FIXME: deprecated: remove in late 2006 */ {"login", no_argument, NULL, 'l'}, {"lookup", no_argument, NULL, LOOKUP_OPTION}, {"message", no_argument, NULL, 'T'}, @@ -233,7 +230,7 @@ time_string (const STRUCT_UTMP *utmp_ent) return buf; } else - return TYPE_SIGNED (time_t) ? imaxtostr (t, buf) : umaxtostr (t, buf); + return timetostr (t, buf); } /* Print formatted output line. Uses mostly arbitrary field sizes, probably @@ -429,7 +426,7 @@ print_user (const STRUCT_UTMP *utmp_ent, time_t boottime) static void print_boottime (const STRUCT_UTMP *utmp_ent) { - print_line (-1, "", ' ', -1, "system boot", + print_line (-1, "", ' ', -1, _("system boot"), time_string (utmp_ent), "", "", "", ""); } @@ -474,7 +471,7 @@ print_login (const STRUCT_UTMP *utmp_ent) /* FIXME: add idle time? */ - print_line (-1, "LOGIN", ' ', sizeof utmp_ent->ut_line, utmp_ent->ut_line, + print_line (-1, _("LOGIN"), ' ', sizeof utmp_ent->ut_line, utmp_ent->ut_line, time_string (utmp_ent), "", pidstr, comment, ""); free (comment); } @@ -514,7 +511,7 @@ print_runlevel (const STRUCT_UTMP *utmp_ent) sprintf (comment, "%s%c", _("last="), (last == 'N') ? 'S' : last); print_line (-1, "", ' ', -1, runlevline, time_string (utmp_ent), - "", "", comment, ""); + "", "", c_isprint (last) ? comment : "", ""); return; } @@ -632,6 +629,9 @@ usage (int status) { printf (_("Usage: %s [OPTION]... [ FILE | ARG1 ARG2 ]\n"), program_name); fputs (_("\ +Print information about users who are currently logged in.\n\ +"), stdout); + fputs (_("\ \n\ -a, --all same as -b -d --login -p -r -t -T -u\n\ -b, --boot time of last system boot\n\ @@ -665,7 +665,7 @@ usage (int status) If FILE is not specified, use %s. %s as FILE is common.\n\ If ARG1 ARG2 given, -m presumed: `am i' or `mom likes' are usual.\n\ "), UTMP_FILE, WTMP_FILE); - printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT); + emit_bug_reporting_address (); } exit (status); } @@ -677,14 +677,14 @@ main (int argc, char **argv) bool assumptions = true; initialize_main (&argc, &argv); - program_name = argv[0]; + set_program_name (argv[0]); setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); atexit (close_stdout); - while ((optc = getopt_long (argc, argv, "abdilmpqrstuwHT", longopts, NULL)) + while ((optc = getopt_long (argc, argv, "abdlmpqrstuwHT", longopts, NULL)) != -1) { switch (optc) @@ -758,11 +758,6 @@ main (int argc, char **argv) include_mesg = true; break; - case 'i': - error (0, 0, - _("Warning: -i will be removed in a future release; \ - use -u instead")); - /* Fall through. */ case 'u': need_users = true; include_idle = true; diff --git a/src/bin/coreutils/src/whoami.c b/src/bin/coreutils/src/whoami.c index c4a2b5e82a..75bb9a6cdc 100644 --- a/src/bin/coreutils/src/whoami.c +++ b/src/bin/coreutils/src/whoami.c @@ -1,12 +1,12 @@ /* whoami -- print effective userid - Copyright (C) 89,90, 1991-1997, 1999-2002, 2004, 2005 Free Software - Foundation, Inc. + Copyright (C) 89,90, 1991-1997, 1999-2002, 2004, 2005, 2007-2008 + Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Equivalent to `id -un'. */ /* Written by Richard Mlynarik. */ @@ -34,10 +33,7 @@ /* The official name of this program (e.g., no `g' prefix). */ #define PROGRAM_NAME "whoami" -#define AUTHORS "Richard Mlynarik" - -/* The name this program was run with. */ -char *program_name; +#define AUTHORS proper_name ("Richard Mlynarik") void usage (int status) @@ -55,7 +51,7 @@ Same as id -un.\n\ "), stdout); fputs (HELP_OPTION_DESCRIPTION, stdout); fputs (VERSION_OPTION_DESCRIPTION, stdout); - printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT); + emit_bug_reporting_address (); } exit (status); } @@ -67,14 +63,14 @@ main (int argc, char **argv) uid_t uid; initialize_main (&argc, &argv); - program_name = argv[0]; + set_program_name (argv[0]); setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); atexit (close_stdout); - parse_long_options (argc, argv, PROGRAM_NAME, GNU_PACKAGE, VERSION, + parse_long_options (argc, argv, PROGRAM_NAME, PACKAGE_NAME, Version, usage, AUTHORS, (char const *) NULL); if (getopt_long (argc, argv, "", NULL, NULL) != -1) usage (EXIT_FAILURE); diff --git a/src/bin/coreutils/src/yes.c b/src/bin/coreutils/src/yes.c index 4f09f68f9e..cfd06079f0 100644 --- a/src/bin/coreutils/src/yes.c +++ b/src/bin/coreutils/src/yes.c @@ -1,10 +1,10 @@ /* yes - output a string repeatedly until killed - Copyright (C) 1991-1997, 1999-2004 Free Software Foundation, Inc. + Copyright (C) 1991-1997, 1999-2004, 2007-2008 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* David MacKenzie */ @@ -30,10 +29,7 @@ /* The official name of this program (e.g., no `g' prefix). */ #define PROGRAM_NAME "yes" -#define AUTHORS "David MacKenzie" - -/* The name this program was run with. */ -char *program_name; +#define AUTHORS proper_name ("David MacKenzie") void usage (int status) @@ -55,7 +51,7 @@ Repeatedly output a line with all specified STRING(s), or `y'.\n\ "), stdout); fputs (HELP_OPTION_DESCRIPTION, stdout); fputs (VERSION_OPTION_DESCRIPTION, stdout); - printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT); + emit_bug_reporting_address (); } exit (status); } @@ -64,14 +60,14 @@ int main (int argc, char **argv) { initialize_main (&argc, &argv); - program_name = argv[0]; + set_program_name (argv[0]); setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); atexit (close_stdout); - parse_long_options (argc, argv, PROGRAM_NAME, GNU_PACKAGE, VERSION, + parse_long_options (argc, argv, PROGRAM_NAME, PACKAGE_NAME, Version, usage, AUTHORS, (char const *) NULL); if (getopt_long (argc, argv, "+", NULL, NULL) != -1) usage (EXIT_FAILURE); @@ -79,7 +75,7 @@ main (int argc, char **argv) if (argc <= optind) { optind = argc; - argv[argc++] = "y"; + argv[argc++] = bad_cast ("y"); } for (;;)